Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / ext-all-debug.js
index 0f649b5..8eb0f03 100644 (file)
 /*!
- * Ext JS Library 3.0.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
-/**
- * @class Ext.DomHelper
- * <p>The DomHelper class provides a layer of abstraction from DOM and transparently supports creating
- * elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates
- * from your DOM building code.</p>
- *
- * <p><b><u>DomHelper element specification object</u></b></p>
- * <p>A specification object is used when creating elements. Attributes of this object
- * are assumed to be element attributes, except for 4 special attributes:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>tag</tt></b> : <div class="sub-desc">The tag name of the element</div></li>
- * <li><b><tt>children</tt></b> : or <tt>cn</tt><div class="sub-desc">An array of the
- * same kind of element definition objects to be created and appended. These can be nested
- * as deep as you want.</div></li>
- * <li><b><tt>cls</tt></b> : <div class="sub-desc">The class attribute of the element.
- * This will end up being either the "class" attribute on a HTML fragment or className
- * for a DOM node, depending on whether DomHelper is using fragments or DOM.</div></li>
- * <li><b><tt>html</tt></b> : <div class="sub-desc">The innerHTML for the element</div></li>
- * </ul></div></p>
- *
- * <p><b><u>Insertion methods</u></b></p>
- * <p>Commonly used insertion methods:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link #append}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertBefore}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertAfter}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #overwrite}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #createTemplate}</tt></b> : <div class="sub-desc"></div></li>
- * <li><b><tt>{@link #insertHtml}</tt></b> : <div class="sub-desc"></div></li>
- * </ul></div></p>
- *
- * <p><b><u>Example</u></b></p>
- * <p>This is an example, where an unordered list with 3 children items is appended to an existing
- * element with id <tt>'my-div'</tt>:<br>
- <pre><code>
-var dh = Ext.DomHelper; // create shorthand alias
-// specification object
-var spec = {
-    id: 'my-ul',
-    tag: 'ul',
-    cls: 'my-list',
-    // append children after creating
-    children: [     // may also specify 'cn' instead of 'children'
-        {tag: 'li', id: 'item0', html: 'List Item 0'},
-        {tag: 'li', id: 'item1', html: 'List Item 1'},
-        {tag: 'li', id: 'item2', html: 'List Item 2'}
-    ]
-};
-var list = dh.append(
-    'my-div', // the context element 'my-div' can either be the id or the actual node
-    spec      // the specification object
-);
- </code></pre></p>
- * <p>Element creation specification parameters in this class may also be passed as an Array of
- * specification objects. This can be used to insert multiple sibling nodes into an existing
- * container very efficiently. For example, to add more list items to the example above:<pre><code>
-dh.append('my-ul', [
-    {tag: 'li', id: 'item3', html: 'List Item 3'},
-    {tag: 'li', id: 'item4', html: 'List Item 4'}
-]);
- * </code></pre></p>
- *
- * <p><b><u>Templating</u></b></p>
- * <p>The real power is in the built-in templating. Instead of creating or appending any elements,
- * <tt>{@link #createTemplate}</tt> returns a Template object which can be used over and over to
- * insert new elements. Revisiting the example above, we could utilize templating this time:
- * <pre><code>
-// create the node
-var list = dh.append('my-div', {tag: 'ul', cls: 'my-list'});
-// get template
-var tpl = dh.createTemplate({tag: 'li', id: 'item{0}', html: 'List Item {0}'});
-
-for(var i = 0; i < 5, i++){
-    tpl.append(list, [i]); // use template to append to the actual node
-}
- * </code></pre></p>
- * <p>An example using a template:<pre><code>
-var html = '<a id="{0}" href="{1}" class="nav">{2}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack&#39;s Site"]);
-tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin&#39;s Site"]);
- * </code></pre></p>
- *
- * <p>The same example using named parameters:<pre><code>
-var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.append('blog-roll', {
-    id: 'link1',
-    url: 'http://www.jackslocum.com/',
-    text: "Jack&#39;s Site"
-});
-tpl.append('blog-roll', {
-    id: 'link2',
-    url: 'http://www.dustindiaz.com/',
-    text: "Dustin&#39;s Site"
-});
- * </code></pre></p>
- *
- * <p><b><u>Compiling Templates</u></b></p>
- * <p>Templates are applied using regular expressions. The performance is great, but if
- * you are adding a bunch of DOM elements using the same template, you can increase
- * performance even further by {@link Ext.Template#compile "compiling"} the template.
- * The way "{@link Ext.Template#compile compile()}" works is the template is parsed and
- * broken up at the different variable points and a dynamic function is created and eval'ed.
- * The generated function performs string concatenation of these parts and the passed
- * variables instead of using regular expressions.
- * <pre><code>
-var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';
-
-var tpl = new Ext.DomHelper.createTemplate(html);
-tpl.compile();
-
-//... use template like normal
- * </code></pre></p>
- *
- * <p><b><u>Performance Boost</u></b></p>
- * <p>DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead
- * of DOM can significantly boost performance.</p>
- * <p>Element creation specification parameters may also be strings. If {@link #useDom} is <tt>false</tt>,
- * then the string is used as innerHTML. If {@link #useDom} is <tt>true</tt>, a string specification
- * results in the creation of a text node. Usage:</p>
- * <pre><code>
-Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance
- * </code></pre>
- * @singleton
- */
-Ext.DomHelper = function(){
-    var tempTableEl = null,
-       emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
-       tableRe = /^table|tbody|tr|td$/i,
-       pub,
-       // kill repeat to save bytes
-       afterbegin = "afterbegin",
-       afterend = "afterend",
-       beforebegin = "beforebegin",
-       beforeend = "beforeend",
-       ts = '<table>',
-        te = '</table>',
-        tbs = ts+'<tbody>',
-        tbe = '</tbody>'+te,
-        trs = tbs + '<tr>',
-        tre = '</tr>'+tbe;
-
-    // private
-    function doInsert(el, o, returnElement, pos, sibling, append){
-        var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o));
-        return returnElement ? Ext.get(newNode, true) : newNode;
-    }
-
-    // build as innerHTML where available
-    function createHtml(o){
-           var b = "",
-               attr,
-               val,
-               key,
-               keyVal,
-               cn;
-
-        if(typeof o == 'string'){
-            b = o;
-        } else if (Ext.isArray(o)) {
-               Ext.each(o, function(v) {
-                b += createHtml(v);
-            });
-        } else {
-               b += "<" + (o.tag = o.tag || "div");
-            Ext.iterate(o, function(attr, val){
-                if(!/tag|children|cn|html$/i.test(attr)){
-                    if (Ext.isObject(val)) {
-                        b += " " + attr + "='";
-                        Ext.iterate(val, function(key, keyVal){
-                            b += key + ":" + keyVal + ";";
-                        });
-                        b += "'";
-                    }else{
-                        b += " " + ({cls : "class", htmlFor : "for"}[attr] || attr) + "='" + val + "'";
-                    }
-                }
-            });
-               // Now either just close the tag or try to add children and close the tag.
-               if (emptyTags.test(o.tag)) {
-                   b += "/>";
-               } else {
-                   b += ">";
-                   if ((cn = o.children || o.cn)) {
-                       b += createHtml(cn);
-                   } else if(o.html){
-                       b += o.html;
-                   }
-                   b += "</" + o.tag + ">";
-               }
-        }
-        return b;
-    }
-
-    function ieTable(depth, s, h, e){
-        tempTableEl.innerHTML = [s, h, e].join('');
-        var i = -1,
-               el = tempTableEl;
-        while(++i < depth){
-            el = el.firstChild;
-        }
-        return el;
-    }
-
-    /**
-     * @ignore
-     * Nasty code for IE's broken table implementation
-     */
-    function insertIntoTable(tag, where, el, html) {
-           var node,
-               before;
-
-        tempTableEl = tempTableEl || document.createElement('div');
-
-           if(tag == 'td' && (where == afterbegin || where == beforeend) ||
-              !/td|tr|tbody/i.test(tag) && (where == beforebegin || where == afterend)) {
-            return;
-        }
-        before = where == beforebegin ? el :
-                                where == afterend ? el.nextSibling :
-                                where == afterbegin ? el.firstChild : null;
-
-        if (where == beforebegin || where == afterend) {
-               el = el.parentNode;
-       }
-
-        if (tag == 'td' || (tag == "tr" && (where == beforeend || where == afterbegin))) {
-               node = ieTable(4, trs, html, tre);
-        } else if ((tag == "tbody" && (where == beforeend || where == afterbegin)) ||
-                          (tag == "tr" && (where == beforebegin || where == afterend))) {
-               node = ieTable(3, tbs, html, tbe);
-        } else {
-               node = ieTable(2, ts, html, te);
-        }
-        el.insertBefore(node, before);
-        return node;
-    }
-
-
-    pub = {
-           /**
-            * Returns the markup for the passed Element(s) config.
-            * @param {Object} o The DOM object spec (and children)
-            * @return {String}
-            */
-           markup : function(o){
-               return createHtml(o);
-           },
-
-           /**
-            * Inserts an HTML fragment into the DOM.
-            * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd.
-            * @param {HTMLElement} el The context element
-            * @param {String} html The HTML fragmenet
-            * @return {HTMLElement} The new node
-            */
-           insertHtml : function(where, el, html){
-               var hash = {},
-                       hashVal,
-                       setStart,
-                       range,
-                       frag,
-                       rangeEl,
-                       rs;
-
-               where = where.toLowerCase();
-               // add these here because they are used in both branches of the condition.
-               hash[beforebegin] = ['BeforeBegin', 'previousSibling'];
-               hash[afterend] = ['AfterEnd', 'nextSibling'];
-
-               if (el.insertAdjacentHTML) {
-                   if(tableRe.test(el.tagName) && (rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html))){
-                       return rs;
-                   }
-                   // add these two to the hash.
-                   hash[afterbegin] = ['AfterBegin', 'firstChild'];
-                   hash[beforeend] = ['BeforeEnd', 'lastChild'];
-                   if ((hashVal = hash[where])) {
-                               el.insertAdjacentHTML(hashVal[0], html);
-                       return el[hashVal[1]];
-                   }
-               } else {
-                       range = el.ownerDocument.createRange();
-                       setStart = "setStart" + (/end/i.test(where) ? "After" : "Before");
-                       if (hash[where]) {
-                               range[setStart](el);
-                               frag = range.createContextualFragment(html);
-                               el.parentNode.insertBefore(frag, where == beforebegin ? el : el.nextSibling);
-                               return el[(where == beforebegin ? "previous" : "next") + "Sibling"];
-                       } else {
-                               rangeEl = (where == afterbegin ? "first" : "last") + "Child";
-                               if (el.firstChild) {
-                                       range[setStart](el[rangeEl]);
-                                       frag = range.createContextualFragment(html);
-                        if(where == afterbegin){
-                            el.insertBefore(frag, el.firstChild);
-                        }else{
-                            el.appendChild(frag);
-                        }
-                               } else {
-                                   el.innerHTML = html;
-                           }
-                           return el[rangeEl];
-                       }
-               }
-               throw 'Illegal insertion point -> "' + where + '"';
-           },
-
-           /**
-            * Creates new DOM element(s) and inserts them before el.
-            * @param {Mixed} el The context element
-            * @param {Object/String} o The DOM object spec (and children) or raw HTML blob
-            * @param {Boolean} returnElement (optional) true to return a Ext.Element
-            * @return {HTMLElement/Ext.Element} The new node
-            */
-           insertBefore : function(el, o, returnElement){
-               return doInsert(el, o, returnElement, beforebegin);
-           },
-
-           /**
-            * Creates new DOM element(s) and inserts them after el.
-            * @param {Mixed} el The context element
-            * @param {Object} o The DOM object spec (and children)
-            * @param {Boolean} returnElement (optional) true to return a Ext.Element
-            * @return {HTMLElement/Ext.Element} The new node
-            */
-           insertAfter : function(el, o, returnElement){
-               return doInsert(el, o, returnElement, afterend, "nextSibling");
-           },
-
-           /**
-            * Creates new DOM element(s) and inserts them as the first child of el.
-            * @param {Mixed} el The context element
-            * @param {Object/String} o The DOM object spec (and children) or raw HTML blob
-            * @param {Boolean} returnElement (optional) true to return a Ext.Element
-            * @return {HTMLElement/Ext.Element} The new node
-            */
-           insertFirst : function(el, o, returnElement){
-               return doInsert(el, o, returnElement, afterbegin, "firstChild");
-           },
-
-           /**
-            * Creates new DOM element(s) and appends them to el.
-            * @param {Mixed} el The context element
-            * @param {Object/String} o The DOM object spec (and children) or raw HTML blob
-            * @param {Boolean} returnElement (optional) true to return a Ext.Element
-            * @return {HTMLElement/Ext.Element} The new node
-            */
-           append : function(el, o, returnElement){
-                   return doInsert(el, o, returnElement, beforeend, "", true);
-           },
-
-           /**
-            * Creates new DOM element(s) and overwrites the contents of el with them.
-            * @param {Mixed} el The context element
-            * @param {Object/String} o The DOM object spec (and children) or raw HTML blob
-            * @param {Boolean} returnElement (optional) true to return a Ext.Element
-            * @return {HTMLElement/Ext.Element} The new node
-            */
-           overwrite : function(el, o, returnElement){
-               el = Ext.getDom(el);
-               el.innerHTML = createHtml(o);
-               return returnElement ? Ext.get(el.firstChild) : el.firstChild;
-           },
-
-           createHtml : createHtml
-    };
-    return pub;
+/**\r
+ * @class Ext.DomHelper\r
+ * <p>The DomHelper class provides a layer of abstraction from DOM and transparently supports creating\r
+ * elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates\r
+ * from your DOM building code.</p>\r
+ *\r
+ * <p><b><u>DomHelper element specification object</u></b></p>\r
+ * <p>A specification object is used when creating elements. Attributes of this object\r
+ * are assumed to be element attributes, except for 4 special attributes:\r
+ * <div class="mdetail-params"><ul>\r
+ * <li><b><tt>tag</tt></b> : <div class="sub-desc">The tag name of the element</div></li>\r
+ * <li><b><tt>children</tt></b> : or <tt>cn</tt><div class="sub-desc">An array of the\r
+ * same kind of element definition objects to be created and appended. These can be nested\r
+ * as deep as you want.</div></li>\r
+ * <li><b><tt>cls</tt></b> : <div class="sub-desc">The class attribute of the element.\r
+ * This will end up being either the "class" attribute on a HTML fragment or className\r
+ * for a DOM node, depending on whether DomHelper is using fragments or DOM.</div></li>\r
+ * <li><b><tt>html</tt></b> : <div class="sub-desc">The innerHTML for the element</div></li>\r
+ * </ul></div></p>\r
+ *\r
+ * <p><b><u>Insertion methods</u></b></p>\r
+ * <p>Commonly used insertion methods:\r
+ * <div class="mdetail-params"><ul>\r
+ * <li><b><tt>{@link #append}</tt></b> : <div class="sub-desc"></div></li>\r
+ * <li><b><tt>{@link #insertBefore}</tt></b> : <div class="sub-desc"></div></li>\r
+ * <li><b><tt>{@link #insertAfter}</tt></b> : <div class="sub-desc"></div></li>\r
+ * <li><b><tt>{@link #overwrite}</tt></b> : <div class="sub-desc"></div></li>\r
+ * <li><b><tt>{@link #createTemplate}</tt></b> : <div class="sub-desc"></div></li>\r
+ * <li><b><tt>{@link #insertHtml}</tt></b> : <div class="sub-desc"></div></li>\r
+ * </ul></div></p>\r
+ *\r
+ * <p><b><u>Example</u></b></p>\r
+ * <p>This is an example, where an unordered list with 3 children items is appended to an existing\r
+ * element with id <tt>'my-div'</tt>:<br>\r
+ <pre><code>\r
+var dh = Ext.DomHelper; // create shorthand alias\r
+// specification object\r
+var spec = {\r
+    id: 'my-ul',\r
+    tag: 'ul',\r
+    cls: 'my-list',\r
+    // append children after creating\r
+    children: [     // may also specify 'cn' instead of 'children'\r
+        {tag: 'li', id: 'item0', html: 'List Item 0'},\r
+        {tag: 'li', id: 'item1', html: 'List Item 1'},\r
+        {tag: 'li', id: 'item2', html: 'List Item 2'}\r
+    ]\r
+};\r
+var list = dh.append(\r
+    'my-div', // the context element 'my-div' can either be the id or the actual node\r
+    spec      // the specification object\r
+);\r
+ </code></pre></p>\r
+ * <p>Element creation specification parameters in this class may also be passed as an Array of\r
+ * specification objects. This can be used to insert multiple sibling nodes into an existing\r
+ * container very efficiently. For example, to add more list items to the example above:<pre><code>\r
+dh.append('my-ul', [\r
+    {tag: 'li', id: 'item3', html: 'List Item 3'},\r
+    {tag: 'li', id: 'item4', html: 'List Item 4'}\r
+]);\r
+ * </code></pre></p>\r
+ *\r
+ * <p><b><u>Templating</u></b></p>\r
+ * <p>The real power is in the built-in templating. Instead of creating or appending any elements,\r
+ * <tt>{@link #createTemplate}</tt> returns a Template object which can be used over and over to\r
+ * insert new elements. Revisiting the example above, we could utilize templating this time:\r
+ * <pre><code>\r
+// create the node\r
+var list = dh.append('my-div', {tag: 'ul', cls: 'my-list'});\r
+// get template\r
+var tpl = dh.createTemplate({tag: 'li', id: 'item{0}', html: 'List Item {0}'});\r
+\r
+for(var i = 0; i < 5, i++){\r
+    tpl.append(list, [i]); // use template to append to the actual node\r
+}\r
+ * </code></pre></p>\r
+ * <p>An example using a template:<pre><code>\r
+var html = '<a id="{0}" href="{1}" class="nav">{2}</a>';\r
+\r
+var tpl = new Ext.DomHelper.createTemplate(html);\r
+tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack&#39;s Site"]);\r
+tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin&#39;s Site"]);\r
+ * </code></pre></p>\r
+ *\r
+ * <p>The same example using named parameters:<pre><code>\r
+var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';\r
+\r
+var tpl = new Ext.DomHelper.createTemplate(html);\r
+tpl.append('blog-roll', {\r
+    id: 'link1',\r
+    url: 'http://www.jackslocum.com/',\r
+    text: "Jack&#39;s Site"\r
+});\r
+tpl.append('blog-roll', {\r
+    id: 'link2',\r
+    url: 'http://www.dustindiaz.com/',\r
+    text: "Dustin&#39;s Site"\r
+});\r
+ * </code></pre></p>\r
+ *\r
+ * <p><b><u>Compiling Templates</u></b></p>\r
+ * <p>Templates are applied using regular expressions. The performance is great, but if\r
+ * you are adding a bunch of DOM elements using the same template, you can increase\r
+ * performance even further by {@link Ext.Template#compile "compiling"} the template.\r
+ * The way "{@link Ext.Template#compile compile()}" works is the template is parsed and\r
+ * broken up at the different variable points and a dynamic function is created and eval'ed.\r
+ * The generated function performs string concatenation of these parts and the passed\r
+ * variables instead of using regular expressions.\r
+ * <pre><code>\r
+var html = '<a id="{id}" href="{url}" class="nav">{text}</a>';\r
+\r
+var tpl = new Ext.DomHelper.createTemplate(html);\r
+tpl.compile();\r
+\r
+//... use template like normal\r
+ * </code></pre></p>\r
+ *\r
+ * <p><b><u>Performance Boost</u></b></p>\r
+ * <p>DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead\r
+ * of DOM can significantly boost performance.</p>\r
+ * <p>Element creation specification parameters may also be strings. If {@link #useDom} is <tt>false</tt>,\r
+ * then the string is used as innerHTML. If {@link #useDom} is <tt>true</tt>, a string specification\r
+ * results in the creation of a text node. Usage:</p>\r
+ * <pre><code>\r
+Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance\r
+ * </code></pre>\r
+ * @singleton\r
+ */\r
+Ext.DomHelper = function(){\r
+    var tempTableEl = null,\r
+        emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,\r
+        tableRe = /^table|tbody|tr|td$/i,\r
+        pub,\r
+        // kill repeat to save bytes\r
+        afterbegin = 'afterbegin',\r
+        afterend = 'afterend',\r
+        beforebegin = 'beforebegin',\r
+        beforeend = 'beforeend',\r
+        ts = '<table>',\r
+        te = '</table>',\r
+        tbs = ts+'<tbody>',\r
+        tbe = '</tbody>'+te,\r
+        trs = tbs + '<tr>',\r
+        tre = '</tr>'+tbe;\r
+\r
+    // private\r
+    function doInsert(el, o, returnElement, pos, sibling, append){\r
+        var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o));\r
+        return returnElement ? Ext.get(newNode, true) : newNode;\r
+    }\r
+\r
+    // build as innerHTML where available\r
+    function createHtml(o){\r
+        var b = '',\r
+            attr,\r
+            val,\r
+            key,\r
+            keyVal,\r
+            cn;\r
+\r
+        if(Ext.isString(o)){\r
+            b = o;\r
+        } else if (Ext.isArray(o)) {\r
+            for (var i=0; i < o.length; i++) {\r
+                if(o[i]) {\r
+                    b += createHtml(o[i]);\r
+                }\r
+            };\r
+        } else {\r
+            b += '<' + (o.tag = o.tag || 'div');\r
+            Ext.iterate(o, function(attr, val){\r
+                if(!/tag|children|cn|html$/i.test(attr)){\r
+                    if (Ext.isObject(val)) {\r
+                        b += ' ' + attr + '="';\r
+                        Ext.iterate(val, function(key, keyVal){\r
+                            b += key + ':' + keyVal + ';';\r
+                        });\r
+                        b += '"';\r
+                    }else{\r
+                        b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '="' + val + '"';\r
+                    }\r
+                }\r
+            });\r
+            // Now either just close the tag or try to add children and close the tag.\r
+            if (emptyTags.test(o.tag)) {\r
+                b += '/>';\r
+            } else {\r
+                b += '>';\r
+                if ((cn = o.children || o.cn)) {\r
+                    b += createHtml(cn);\r
+                } else if(o.html){\r
+                    b += o.html;\r
+                }\r
+                b += '</' + o.tag + '>';\r
+            }\r
+        }\r
+        return b;\r
+    }\r
+\r
+    function ieTable(depth, s, h, e){\r
+        tempTableEl.innerHTML = [s, h, e].join('');\r
+        var i = -1,\r
+            el = tempTableEl,\r
+            ns;\r
+        while(++i < depth){\r
+            el = el.firstChild;\r
+        }\r
+//      If the result is multiple siblings, then encapsulate them into one fragment.\r
+        if(ns = el.nextSibling){\r
+            var df = document.createDocumentFragment();\r
+            while(el){\r
+                ns = el.nextSibling;\r
+                df.appendChild(el);\r
+                el = ns;\r
+            }\r
+            el = df;\r
+        }\r
+        return el;\r
+    }\r
+\r
+    /**\r
+     * @ignore\r
+     * Nasty code for IE's broken table implementation\r
+     */\r
+    function insertIntoTable(tag, where, el, html) {\r
+        var node,\r
+            before;\r
+\r
+        tempTableEl = tempTableEl || document.createElement('div');\r
+\r
+        if(tag == 'td' && (where == afterbegin || where == beforeend) ||\r
+           !/td|tr|tbody/i.test(tag) && (where == beforebegin || where == afterend)) {\r
+            return;\r
+        }\r
+        before = where == beforebegin ? el :\r
+                 where == afterend ? el.nextSibling :\r
+                 where == afterbegin ? el.firstChild : null;\r
+\r
+        if (where == beforebegin || where == afterend) {\r
+            el = el.parentNode;\r
+        }\r
+\r
+        if (tag == 'td' || (tag == 'tr' && (where == beforeend || where == afterbegin))) {\r
+            node = ieTable(4, trs, html, tre);\r
+        } else if ((tag == 'tbody' && (where == beforeend || where == afterbegin)) ||\r
+                   (tag == 'tr' && (where == beforebegin || where == afterend))) {\r
+            node = ieTable(3, tbs, html, tbe);\r
+        } else {\r
+            node = ieTable(2, ts, html, te);\r
+        }\r
+        el.insertBefore(node, before);\r
+        return node;\r
+    }\r
+\r
+\r
+    pub = {\r
+        /**\r
+         * Returns the markup for the passed Element(s) config.\r
+         * @param {Object} o The DOM object spec (and children)\r
+         * @return {String}\r
+         */\r
+        markup : function(o){\r
+            return createHtml(o);\r
+        },\r
+        \r
+        /**\r
+         * Applies a style specification to an element.\r
+         * @param {String/HTMLElement} el The element to apply styles to\r
+         * @param {String/Object/Function} styles A style specification string e.g. 'width:100px', or object in the form {width:'100px'}, or\r
+         * a function which returns such a specification.\r
+         */\r
+        applyStyles : function(el, styles){\r
+            if(styles){\r
+                var i = 0,\r
+                    len,\r
+                    style;\r
+\r
+                el = Ext.fly(el);\r
+                if(Ext.isFunction(styles)){\r
+                    styles = styles.call();\r
+                }\r
+                if(Ext.isString(styles)){\r
+                    styles = styles.trim().split(/\s*(?::|;)\s*/);\r
+                    for(len = styles.length; i < len;){\r
+                        el.setStyle(styles[i++], styles[i++]);\r
+                    }\r
+                }else if (Ext.isObject(styles)){\r
+                    el.setStyle(styles);\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Inserts an HTML fragment into the DOM.\r
+         * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd.\r
+         * @param {HTMLElement} el The context element\r
+         * @param {String} html The HTML fragment\r
+         * @return {HTMLElement} The new node\r
+         */\r
+        insertHtml : function(where, el, html){\r
+            var hash = {},\r
+                hashVal,\r
+                setStart,\r
+                range,\r
+                frag,\r
+                rangeEl,\r
+                rs;\r
+\r
+            where = where.toLowerCase();\r
+            // add these here because they are used in both branches of the condition.\r
+            hash[beforebegin] = ['BeforeBegin', 'previousSibling'];\r
+            hash[afterend] = ['AfterEnd', 'nextSibling'];\r
+\r
+            if (el.insertAdjacentHTML) {\r
+                if(tableRe.test(el.tagName) && (rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html))){\r
+                    return rs;\r
+                }\r
+                // add these two to the hash.\r
+                hash[afterbegin] = ['AfterBegin', 'firstChild'];\r
+                hash[beforeend] = ['BeforeEnd', 'lastChild'];\r
+                if ((hashVal = hash[where])) {\r
+                    el.insertAdjacentHTML(hashVal[0], html);\r
+                    return el[hashVal[1]];\r
+                }\r
+            } else {\r
+                range = el.ownerDocument.createRange();\r
+                setStart = 'setStart' + (/end/i.test(where) ? 'After' : 'Before');\r
+                if (hash[where]) {\r
+                    range[setStart](el);\r
+                    frag = range.createContextualFragment(html);\r
+                    el.parentNode.insertBefore(frag, where == beforebegin ? el : el.nextSibling);\r
+                    return el[(where == beforebegin ? 'previous' : 'next') + 'Sibling'];\r
+                } else {\r
+                    rangeEl = (where == afterbegin ? 'first' : 'last') + 'Child';\r
+                    if (el.firstChild) {\r
+                        range[setStart](el[rangeEl]);\r
+                        frag = range.createContextualFragment(html);\r
+                        if(where == afterbegin){\r
+                            el.insertBefore(frag, el.firstChild);\r
+                        }else{\r
+                            el.appendChild(frag);\r
+                        }\r
+                    } else {\r
+                        el.innerHTML = html;\r
+                    }\r
+                    return el[rangeEl];\r
+                }\r
+            }\r
+            throw 'Illegal insertion point -> "' + where + '"';\r
+        },\r
+\r
+        /**\r
+         * Creates new DOM element(s) and inserts them before el.\r
+         * @param {Mixed} el The context element\r
+         * @param {Object/String} o The DOM object spec (and children) or raw HTML blob\r
+         * @param {Boolean} returnElement (optional) true to return a Ext.Element\r
+         * @return {HTMLElement/Ext.Element} The new node\r
+         */\r
+        insertBefore : function(el, o, returnElement){\r
+            return doInsert(el, o, returnElement, beforebegin);\r
+        },\r
+\r
+        /**\r
+         * Creates new DOM element(s) and inserts them after el.\r
+         * @param {Mixed} el The context element\r
+         * @param {Object} o The DOM object spec (and children)\r
+         * @param {Boolean} returnElement (optional) true to return a Ext.Element\r
+         * @return {HTMLElement/Ext.Element} The new node\r
+         */\r
+        insertAfter : function(el, o, returnElement){\r
+            return doInsert(el, o, returnElement, afterend, 'nextSibling');\r
+        },\r
+\r
+        /**\r
+         * Creates new DOM element(s) and inserts them as the first child of el.\r
+         * @param {Mixed} el The context element\r
+         * @param {Object/String} o The DOM object spec (and children) or raw HTML blob\r
+         * @param {Boolean} returnElement (optional) true to return a Ext.Element\r
+         * @return {HTMLElement/Ext.Element} The new node\r
+         */\r
+        insertFirst : function(el, o, returnElement){\r
+            return doInsert(el, o, returnElement, afterbegin, 'firstChild');\r
+        },\r
+\r
+        /**\r
+         * Creates new DOM element(s) and appends them to el.\r
+         * @param {Mixed} el The context element\r
+         * @param {Object/String} o The DOM object spec (and children) or raw HTML blob\r
+         * @param {Boolean} returnElement (optional) true to return a Ext.Element\r
+         * @return {HTMLElement/Ext.Element} The new node\r
+         */\r
+        append : function(el, o, returnElement){\r
+            return doInsert(el, o, returnElement, beforeend, '', true);\r
+        },\r
+\r
+        /**\r
+         * Creates new DOM element(s) and overwrites the contents of el with them.\r
+         * @param {Mixed} el The context element\r
+         * @param {Object/String} o The DOM object spec (and children) or raw HTML blob\r
+         * @param {Boolean} returnElement (optional) true to return a Ext.Element\r
+         * @return {HTMLElement/Ext.Element} The new node\r
+         */\r
+        overwrite : function(el, o, returnElement){\r
+            el = Ext.getDom(el);\r
+            el.innerHTML = createHtml(o);\r
+            return returnElement ? Ext.get(el.firstChild) : el.firstChild;\r
+        },\r
+\r
+        createHtml : createHtml\r
+    };\r
+    return pub;\r
 }();/**\r
  * @class Ext.DomHelper\r
  */\r
@@ -436,7 +476,7 @@ function(){
                        }\r
                 }\r
             });\r
-            pub.applyStyles(el, o.style);\r
+            Ext.DomHelper.applyStyles(el, o.style);\r
 \r
             if ((cn = o.children || o.cn)) {\r
                 createDom(cn, el);\r
@@ -464,33 +504,6 @@ function(){
                /** True to force the use of DOM instead of html fragments @type Boolean */\r
            useDom : false,\r
 \r
-           /**\r
-            * Applies a style specification to an element.\r
-            * @param {String/HTMLElement} el The element to apply styles to\r
-            * @param {String/Object/Function} styles A style specification string e.g. 'width:100px', or object in the form {width:'100px'}, or\r
-            * a function which returns such a specification.\r
-            */\r
-           applyStyles : function(el, styles){\r
-                   if(styles){\r
-                               var i = 0,\r
-                               len,\r
-                               style;\r
-\r
-                       el = Ext.fly(el);\r
-                               if(Ext.isFunction(styles)){\r
-                                       styles = styles.call();\r
-                               }\r
-                               if(Ext.isString(styles)){\r
-                                       styles = styles.trim().split(/\s*(?::|;)\s*/);\r
-                                       for(len = styles.length; i < len;){\r
-                                               el.setStyle(styles[i++], styles[i++]);\r
-                                       }\r
-                               }else if (Ext.isObject(styles)){\r
-                                       el.setStyle(styles);\r
-                               }\r
-                       }\r
-           },\r
-\r
            /**\r
             * Creates new DOM element(s) and inserts them before el.\r
             * @param {Mixed} el The context element\r
@@ -549,19 +562,58 @@ function(){
        return pub;\r
 }());/**
  * @class Ext.Template
- * Represents an HTML fragment template. Templates can be precompiled for greater performance.
- * For a list of available format functions, see {@link Ext.util.Format}.<br />
- * Usage:
+ * <p>Represents an HTML fragment template. Templates may be {@link #compile precompiled}
+ * for greater performance.</p>
+ * <p>For example usage {@link #Template see the constructor}.</p>
+ * 
+ * @constructor
+ * An instance of this class may be created by passing to the constructor either
+ * a single argument, or multiple arguments:
+ * <div class="mdetail-params"><ul>
+ * <li><b>single argument</b> : String/Array
+ * <div class="sub-desc">
+ * The single argument may be either a String or an Array:<ul>
+ * <li><tt>String</tt> : </li><pre><code>
+var t = new Ext.Template("&lt;div>Hello {0}.&lt;/div>");
+t.{@link #append}('some-element', ['foo']);
+ * </code></pre>
+ * <li><tt>Array</tt> : </li>
+ * An Array will be combined with <code>join('')</code>.
 <pre><code>
-var t = new Ext.Template(
+var t = new Ext.Template([
     '&lt;div name="{id}"&gt;',
         '&lt;span class="{cls}"&gt;{name:trim} {value:ellipsis(10)}&lt;/span&gt;',
-    '&lt;/div&gt;'
-);
-t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
+    '&lt;/div&gt;',
+]);
+t.{@link #compile}();
+t.{@link #append}('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
 </code></pre>
- * @constructor
- * @param {String/Array} html The HTML fragment or an array of fragments to join("") or multiple arguments to join("")
+ * </ul></div></li>
+ * <li><b>multiple arguments</b> : String, Object, Array, ...
+ * <div class="sub-desc">
+ * Multiple arguments will be combined with <code>join('')</code>.
+ * <pre><code>
+var t = new Ext.Template(
+    '&lt;div name="{id}"&gt;',
+        '&lt;span class="{cls}"&gt;{name} {value}&lt;/span&gt;',
+    '&lt;/div&gt;',
+    // a configuration object:
+    {
+        compiled: true,      // {@link #compile} immediately
+        disableFormats: true // See Notes below.
+    } 
+);
+ * </code></pre>
+ * <p><b>Notes</b>:</p>
+ * <div class="mdetail-params"><ul>
+ * <li>Formatting and <code>disableFormats</code> are not applicable for Ext Core.</li>
+ * <li>For a list of available format functions, see {@link Ext.util.Format}.</li>
+ * <li><code>disableFormats</code> reduces <code>{@link #apply}</code> time
+ * when no formatting is required.</li>
+ * </ul></div>
+ * </div></li>
+ * </ul></div>
+ * @param {Mixed} config
  */
 Ext.Template = function(html){
     var me = this,
@@ -583,14 +635,35 @@ Ext.Template = function(html){
 
     /**@private*/
     me.html = html;
+    /**
+     * @cfg {Boolean} compiled Specify <tt>true</tt> to compile the template
+     * immediately (see <code>{@link #compile}</code>).
+     * Defaults to <tt>false</tt>.
+     */
     if (me.compiled) {
         me.compile();
     }
 };
 Ext.Template.prototype = {
     /**
-     * Returns an HTML fragment of this template with the specified values applied.
-     * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @cfg {RegExp} re The regular expression used to match template variables.
+     * Defaults to:<pre><code>
+     * re : /\{([\w-]+)\}/g                                     // for Ext Core
+     * re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g      // for Ext JS
+     * </code></pre>
+     */
+    re : /\{([\w-]+)\}/g,
+    /**
+     * See <code>{@link #re}</code>.
+     * @type RegExp
+     * @property re
+     */
+
+    /**
+     * Returns an HTML fragment of this template with the specified <code>values</code> applied.
+     * @param {Object/Array} values
+     * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
+     * or an object (i.e. <code>{foo: 'bar'}</code>).
      * @return {String} The HTML fragment
      */
     applyTemplate : function(values){
@@ -616,13 +689,6 @@ Ext.Template.prototype = {
         return compile ? me.compile() : me;
     },
 
-    /**
-    * The regular expression used to match template variables
-    * @type RegExp
-    * @property
-    */
-    re : /\{([\w-]+)\}/g,
-
     /**
      * Compiles the template into an internal function, eliminating the RegEx overhead.
      * @return {Ext.Template} this
@@ -676,10 +742,14 @@ Ext.Template.prototype = {
     },
 
     /**
-     * Applies the supplied values to the template and appends the new node(s) to el.
+     * Applies the supplied <code>values</code> to the template and appends
+     * the new node(s) to the specified <code>el</code>.
+     * <p>For example usage {@link #Template see the constructor}.</p>
      * @param {Mixed} el The context element
-     * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
-     * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
+     * @param {Object/Array} values
+     * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
+     * or an object (i.e. <code>{foo: 'bar'}</code>).
+     * @param {Boolean} returnElement (optional) true to return an Ext.Element (defaults to undefined)
      * @return {HTMLElement/Ext.Element} The new node or Element
      */
     append : function(el, values, returnElement){
@@ -707,8 +777,10 @@ Ext.Template.prototype = {
 };
 /**
  * Alias for {@link #applyTemplate}
- * Returns an HTML fragment of this template with the specified values applied.
- * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+ * Returns an HTML fragment of this template with the specified <code>values</code> applied.
+ * @param {Object/Array} values
+ * The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)
+ * or an object (i.e. <code>{foo: 'bar'}</code>).
  * @return {String} The HTML fragment
  * @member Ext.Template
  * @method apply
@@ -729,6 +801,39 @@ Ext.Template.from = function(el, config){
  * @class Ext.Template\r
  */\r
 Ext.apply(Ext.Template.prototype, {\r
+    /**\r
+     * @cfg {Boolean} disableFormats Specify <tt>true</tt> to disable format\r
+     * functions in the template. If the template does not contain\r
+     * {@link Ext.util.Format format functions}, setting <code>disableFormats</code>\r
+     * to true will reduce <code>{@link #apply}</code> time. Defaults to <tt>false</tt>.\r
+     * <pre><code>\r
+var t = new Ext.Template(\r
+    '&lt;div name="{id}"&gt;',\r
+        '&lt;span class="{cls}"&gt;{name} {value}&lt;/span&gt;',\r
+    '&lt;/div&gt;',\r
+    {\r
+        compiled: true,      // {@link #compile} immediately\r
+        disableFormats: true // reduce <code>{@link #apply}</code> time since no formatting\r
+    }    \r
+);\r
+     * </code></pre>\r
+     * For a list of available format functions, see {@link Ext.util.Format}.\r
+     */\r
+    disableFormats : false,                            \r
+    /**\r
+     * See <code>{@link #disableFormats}</code>.\r
+     * @type Boolean\r
+     * @property disableFormats\r
+     */\r
+\r
+    /**\r
+     * The regular expression used to match template variables\r
+     * @type RegExp\r
+     * @property\r
+     * @hide repeat doc\r
+     */\r
+    re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,\r
+\r
     /**\r
      * Returns an HTML fragment of this template with the specified values applied.\r
      * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})\r
@@ -771,21 +876,6 @@ Ext.apply(Ext.Template.prototype, {
         return me.html.replace(me.re, fn);\r
     },\r
                \r
-    /**\r
-     * <tt>true</tt> to disable format functions (defaults to <tt>false</tt>)\r
-     * @type Boolean\r
-     * @property\r
-     */\r
-    disableFormats : false,                            \r
-       \r
-    /**\r
-     * The regular expression used to match template variables\r
-     * @type RegExp\r
-     * @property\r
-     * @hide repeat doc\r
-     */\r
-    re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,\r
-    \r
     /**\r
      * Compiles the template into an internal function, eliminating the RegEx overhead.\r
      * @return {Ext.Template} this\r
@@ -886,6 +976,7 @@ All selectors, attribute filters and pseudos below can be combined infinitely in
     <li> <b>E:has(S)</b> an E element that has a descendent that matches simple selector S</li>\r
     <li> <b>E:next(S)</b> an E element whose next sibling matches simple selector S</li>\r
     <li> <b>E:prev(S)</b> an E element whose previous sibling matches simple selector S</li>\r
+    <li> <b>E:any(S1|S2|S2)</b> an E element which matches any of the simple selectors S1, S2 or S3//\\</li>\r
 </ul>\r
 <h4>CSS Value Selectors:</h4>\r
 <ul class="list">\r
@@ -910,19 +1001,20 @@ Ext.DomQuery = function(){
        nthRe = /(\d*)n\+?(\d*)/, \r
        nthRe2 = /\D/,\r
        // This is for IE MSXML which does not support expandos.\r
-           // IE runs the same speed using setAttribute, however FF slows way down\r
-           // and Safari completely fails so they need to continue to use expandos.\r
-           isIE = window.ActiveXObject ? true : false,\r
-        isOpera = Ext.isOpera,\r
-           key = 30803;\r
-           \r
+       // IE runs the same speed using setAttribute, however FF slows way down\r
+       // and Safari completely fails so they need to continue to use expandos.\r
+       isIE = window.ActiveXObject ? true : false,\r
+       key = 30803;\r
+    \r
     // this eval is stop the compressor from\r
-       // renaming the variable to something shorter\r
-       eval("var batch = 30803;");     \r
+    // renaming the variable to something shorter\r
+    eval("var batch = 30803;");        \r
 \r
-    function child(p, index){\r
+    // Retrieve the child node from a particular\r
+    // parent at the specified index.\r
+    function child(parent, index){\r
         var i = 0,\r
-               n = p.firstChild;\r
+            n = parent.firstChild;\r
         while(n){\r
             if(n.nodeType == 1){\r
                if(++i == index){\r
@@ -932,53 +1024,65 @@ Ext.DomQuery = function(){
             n = n.nextSibling;\r
         }\r
         return null;\r
-    };\r
+    }\r
 \r
-    function next(n){\r
+    // retrieve the next element node\r
+    function next(n){  \r
         while((n = n.nextSibling) && n.nodeType != 1);\r
         return n;\r
-    };\r
+    }\r
 \r
+    // retrieve the previous element node \r
     function prev(n){\r
         while((n = n.previousSibling) && n.nodeType != 1);\r
         return n;\r
-    };\r
+    }\r
+\r
+    // Mark each child node with a nodeIndex skipping and\r
+    // removing empty text nodes.\r
+    function children(parent){\r
+        var n = parent.firstChild,\r
+           nodeIndex = -1,\r
+           nextNode;\r
+       while(n){\r
+           nextNode = n.nextSibling;\r
+           // clean worthless empty nodes.\r
+           if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){\r
+               parent.removeChild(n);\r
+           }else{\r
+               // add an expando nodeIndex\r
+               n.nodeIndex = ++nodeIndex;\r
+           }\r
+           n = nextNode;\r
+       }\r
+       return this;\r
+    }\r
 \r
-    function children(d){\r
-        var n = d.firstChild, ni = -1,\r
-               nx;\r
-           while(n){\r
-               nx = n.nextSibling;\r
-               if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){\r
-                   d.removeChild(n);\r
-               }else{\r
-                   n.nodeIndex = ++ni;\r
-               }\r
-               n = nx;\r
-           }\r
-           return this;\r
-       };\r
-\r
-    function byClassName(c, a, v){\r
-        if(!v){\r
-            return c;\r
-        }\r
-        var r = [], ri = -1, cn;\r
-        for(var i = 0, ci; ci = c[i]; i++){\r
-            if((' '+ci.className+' ').indexOf(v) != -1){\r
-                r[++ri] = ci;\r
+\r
+    // nodeSet - array of nodes\r
+    // cls - CSS Class\r
+    function byClassName(nodeSet, cls){\r
+        if(!cls){\r
+            return nodeSet;\r
+        }\r
+        var result = [], ri = -1;\r
+        for(var i = 0, ci; ci = nodeSet[i]; i++){\r
+            if((' '+ci.className+' ').indexOf(cls) != -1){\r
+                result[++ri] = ci;\r
             }\r
         }\r
-        return r;\r
+        return result;\r
     };\r
 \r
     function attrValue(n, attr){\r
+       // if its an array, use the first node.\r
         if(!n.tagName && typeof n.length != "undefined"){\r
             n = n[0];\r
         }\r
         if(!n){\r
             return null;\r
         }\r
+\r
         if(attr == "for"){\r
             return n.htmlFor;\r
         }\r
@@ -989,15 +1093,23 @@ Ext.DomQuery = function(){
 \r
     };\r
 \r
+\r
+    // ns - nodes\r
+    // mode - false, /, >, +, ~\r
+    // tagName - defaults to "*"\r
     function getNodes(ns, mode, tagName){\r
         var result = [], ri = -1, cs;\r
         if(!ns){\r
             return result;\r
         }\r
         tagName = tagName || "*";\r
+       // convert to array\r
         if(typeof ns.getElementsByTagName != "undefined"){\r
             ns = [ns];\r
         }\r
+       \r
+       // no mode specified, grab all elements by tagName\r
+       // at any depth\r
         if(!mode){\r
             for(var i = 0, ni; ni = ns[i]; i++){\r
                 cs = ni.getElementsByTagName(tagName);\r
@@ -1005,16 +1117,20 @@ Ext.DomQuery = function(){
                     result[++ri] = ci;\r
                 }\r
             }\r
-        }else if(mode == "/" || mode == ">"){\r
+       // Direct Child mode (/ or >)\r
+       // E > F or E/F all direct children elements of E that have the tag     \r
+        } else if(mode == "/" || mode == ">"){\r
             var utag = tagName.toUpperCase();\r
             for(var i = 0, ni, cn; ni = ns[i]; i++){\r
-                cn = isOpera ? ni.childNodes : (ni.children || ni.childNodes);\r
+                cn = ni.childNodes;\r
                 for(var j = 0, cj; cj = cn[j]; j++){\r
                     if(cj.nodeName == utag || cj.nodeName == tagName  || tagName == '*'){\r
                         result[++ri] = cj;\r
                     }\r
                 }\r
             }\r
+       // Immediately Preceding mode (+)\r
+       // E + F all elements with the tag F that are immediately preceded by an element with the tag E\r
         }else if(mode == "+"){\r
             var utag = tagName.toUpperCase();\r
             for(var i = 0, n; n = ns[i]; i++){\r
@@ -1023,6 +1139,8 @@ Ext.DomQuery = function(){
                     result[++ri] = n;\r
                 }\r
             }\r
+       // Sibling mode (~)\r
+       // E ~ F all elements with the tag F that are preceded by a sibling element with the tag E\r
         }else if(mode == "~"){\r
             var utag = tagName.toUpperCase();\r
             for(var i = 0, n; n = ns[i]; i++){\r
@@ -1034,7 +1152,7 @@ Ext.DomQuery = function(){
             }\r
         }\r
         return result;\r
-    };\r
+    }\r
 \r
     function concat(a, b){\r
         if(b.slice){\r
@@ -1053,69 +1171,81 @@ Ext.DomQuery = function(){
         if(!tagName){\r
             return cs;\r
         }\r
-        var r = [], ri = -1;\r
+        var result = [], ri = -1;\r
         tagName = tagName.toLowerCase();\r
         for(var i = 0, ci; ci = cs[i]; i++){\r
-            if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){\r
-                r[++ri] = ci;\r
+            if(ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName){\r
+                result[++ri] = ci;\r
             }\r
         }\r
-        return r;\r
-    };\r
+        return result;\r
+    }\r
 \r
-    function byId(cs, attr, id){\r
+    function byId(cs, id){\r
         if(cs.tagName || cs == document){\r
             cs = [cs];\r
         }\r
         if(!id){\r
             return cs;\r
         }\r
-        var r = [], ri = -1;\r
-        for(var i = 0,ci; ci = cs[i]; i++){\r
+        var result = [], ri = -1;\r
+        for(var i = 0, ci; ci = cs[i]; i++){\r
             if(ci && ci.id == id){\r
-                r[++ri] = ci;\r
-                return r;\r
+                result[++ri] = ci;\r
+                return result;\r
             }\r
         }\r
-        return r;\r
-    };\r
+        return result;\r
+    }\r
 \r
+    // operators are =, !=, ^=, $=, *=, %=, |= and ~=\r
+    // custom can be "{"\r
     function byAttribute(cs, attr, value, op, custom){\r
-        var r = [], \r
-               ri = -1, \r
-               st = custom=="{",\r
-               f = Ext.DomQuery.operators[op];\r
+        var result = [], \r
+            ri = -1, \r
+            useGetStyle = custom == "{",           \r
+            fn = Ext.DomQuery.operators[op],       \r
+            a,     \r
+            innerHTML;\r
         for(var i = 0, ci; ci = cs[i]; i++){\r
+           // skip non-element nodes.\r
             if(ci.nodeType != 1){\r
                 continue;\r
             }\r
-            var a;\r
-            if(st){\r
-                a = Ext.DomQuery.getStyle(ci, attr);\r
-            }\r
-            else if(attr == "class" || attr == "className"){\r
-                a = ci.className;\r
-            }else if(attr == "for"){\r
-                a = ci.htmlFor;\r
-            }else if(attr == "href"){\r
-                a = ci.getAttribute("href", 2);\r
+           \r
+            innerHTML = ci.innerHTML;\r
+            // we only need to change the property names if we're dealing with html nodes, not XML\r
+            if(innerHTML !== null && innerHTML !== undefined){\r
+                if(useGetStyle){\r
+                    a = Ext.DomQuery.getStyle(ci, attr);\r
+                } else if (attr == "class" || attr == "className"){\r
+                    a = ci.className;\r
+                } else if (attr == "for"){\r
+                    a = ci.htmlFor;\r
+                } else if (attr == "href"){\r
+                   // getAttribute href bug\r
+                   // http://www.glennjones.net/Post/809/getAttributehrefbug.htm\r
+                    a = ci.getAttribute("href", 2);\r
+                } else{\r
+                    a = ci.getAttribute(attr);\r
+                }\r
             }else{\r
                 a = ci.getAttribute(attr);\r
             }\r
-            if((f && f(a, value)) || (!f && a)){\r
-                r[++ri] = ci;\r
+            if((fn && fn(a, value)) || (!fn && a)){\r
+                result[++ri] = ci;\r
             }\r
         }\r
-        return r;\r
-    };\r
+        return result;\r
+    }\r
 \r
     function byPseudo(cs, name, value){\r
         return Ext.DomQuery.pseudos[name](cs, value);\r
-    };\r
+    }\r
 \r
     function nodupIEXml(cs){\r
         var d = ++key, \r
-               r;\r
+            r;\r
         cs[0].setAttribute("_nodup", d);\r
         r = [cs[0]];\r
         for(var i = 1, len = cs.length; i < len; i++){\r
@@ -1166,7 +1296,7 @@ Ext.DomQuery = function(){
 \r
     function quickDiffIEXml(c1, c2){\r
         var d = ++key,\r
-               r = [];\r
+            r = [];\r
         for(var i = 0, len = c1.length; i < len; i++){\r
             c1[i].setAttribute("_qdiff", d);\r
         }        \r
@@ -1188,7 +1318,7 @@ Ext.DomQuery = function(){
         if(!len1){\r
             return c2;\r
         }\r
-        if(isIE && c1[0].selectSingleNode){\r
+        if(isIE && typeof c1[0].selectSingleNode != "undefined"){\r
             return quickDiffIEXml(c1, c2);\r
         }        \r
         for(var i = 0; i < len1; i++){\r
@@ -1208,7 +1338,7 @@ Ext.DomQuery = function(){
            return d.getElementById(id);\r
         }\r
         ns = getNodes(ns, mode, "*");\r
-        return byId(ns, null, id);\r
+        return byId(ns, id);\r
     }\r
 \r
     return {\r
@@ -1225,72 +1355,80 @@ Ext.DomQuery = function(){
         compile : function(path, type){\r
             type = type || "select";\r
 \r
+           // setup fn preamble\r
             var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],\r
-               q = path, mode, lq,\r
-               tk = Ext.DomQuery.matchers,\r
-               tklen = tk.length,\r
-               mm,\r
+               mode,           \r
+               lastPath,\r
+               matchers = Ext.DomQuery.matchers,\r
+               matchersLn = matchers.length,\r
+               modeMatch,\r
                // accept leading mode switch\r
-               lmode = q.match(modeRe);\r
+               lmode = path.match(modeRe);\r
             \r
             if(lmode && lmode[1]){\r
                 fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';\r
-                q = q.replace(lmode[1], "");\r
+                path = path.replace(lmode[1], "");\r
             }\r
+           \r
             // strip leading slashes\r
             while(path.substr(0, 1)=="/"){\r
                 path = path.substr(1);\r
             }\r
 \r
-            while(q && lq != q){\r
-                lq = q;\r
-                var tm = q.match(tagTokenRe);\r
+            while(path && lastPath != path){\r
+                lastPath = path;\r
+                var tokenMatch = path.match(tagTokenRe);\r
                 if(type == "select"){\r
-                    if(tm){\r
-                        if(tm[1] == "#"){\r
-                            fn[fn.length] = 'n = quickId(n, mode, root, "'+tm[2]+'");';\r
+                    if(tokenMatch){\r
+                       // ID Selector\r
+                        if(tokenMatch[1] == "#"){\r
+                            fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");';                        \r
                         }else{\r
-                            fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");';\r
+                            fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");';\r
                         }\r
-                        q = q.replace(tm[0], "");\r
-                    }else if(q.substr(0, 1) != '@'){\r
+                        path = path.replace(tokenMatch[0], "");\r
+                    }else if(path.substr(0, 1) != '@'){\r
                         fn[fn.length] = 'n = getNodes(n, mode, "*");';\r
                     }\r
+               // type of "simple"\r
                 }else{\r
-                    if(tm){\r
-                        if(tm[1] == "#"){\r
-                            fn[fn.length] = 'n = byId(n, null, "'+tm[2]+'");';\r
+                    if(tokenMatch){\r
+                        if(tokenMatch[1] == "#"){\r
+                            fn[fn.length] = 'n = byId(n, "'+tokenMatch[2]+'");';\r
                         }else{\r
-                            fn[fn.length] = 'n = byTag(n, "'+tm[2]+'");';\r
+                            fn[fn.length] = 'n = byTag(n, "'+tokenMatch[2]+'");';\r
                         }\r
-                        q = q.replace(tm[0], "");\r
+                        path = path.replace(tokenMatch[0], "");\r
                     }\r
                 }\r
-                while(!(mm = q.match(modeRe))){\r
+                while(!(modeMatch = path.match(modeRe))){\r
                     var matched = false;\r
-                    for(var j = 0; j < tklen; j++){\r
-                        var t = tk[j];\r
-                        var m = q.match(t.re);\r
+                    for(var j = 0; j < matchersLn; j++){\r
+                        var t = matchers[j];\r
+                        var m = path.match(t.re);\r
                         if(m){\r
                             fn[fn.length] = t.select.replace(tplRe, function(x, i){\r
-                                                    return m[i];\r
-                                                });\r
-                            q = q.replace(m[0], "");\r
+                               return m[i];\r
+                           });\r
+                            path = path.replace(m[0], "");\r
                             matched = true;\r
                             break;\r
                         }\r
                     }\r
                     // prevent infinite loop on bad selector\r
                     if(!matched){\r
-                        throw 'Error parsing selector, parsing failed at "' + q + '"';\r
+                        throw 'Error parsing selector, parsing failed at "' + path + '"';\r
                     }\r
                 }\r
-                if(mm[1]){\r
-                    fn[fn.length] = 'mode="'+mm[1].replace(trimRe, "")+'";';\r
-                    q = q.replace(mm[1], "");\r
+                if(modeMatch[1]){\r
+                    fn[fn.length] = 'mode="'+modeMatch[1].replace(trimRe, "")+'";';\r
+                    path = path.replace(modeMatch[1], "");\r
                 }\r
             }\r
+           // close fn out\r
             fn[fn.length] = "return nodup(n);\n}";\r
+           \r
+           // eval fn and return it\r
             eval(fn.join(""));\r
             return f;\r
         },\r
@@ -1298,37 +1436,60 @@ Ext.DomQuery = function(){
         /**\r
          * Selects a group of elements.\r
          * @param {String} selector The selector/xpath query (can be a comma separated list of selectors)\r
-         * @param {Node} root (optional) The start of the query (defaults to document).\r
+         * @param {Node/String} root (optional) The start of the query (defaults to document).\r
          * @return {Array} An Array of DOM elements which match the selector. If there are\r
          * no matches, and empty Array is returned.\r
          */\r
-        select : function(path, root, type){\r
-            if(!root || root == document){\r
-                root = document;\r
-            }\r
+       jsSelect: function(path, root, type){\r
+           // set root to doc if not specified.\r
+           root = root || document;\r
+           \r
             if(typeof root == "string"){\r
                 root = document.getElementById(root);\r
             }\r
             var paths = path.split(","),\r
                results = [];\r
-            for(var i = 0, len = paths.length; i < len; i++){\r
-                var p = paths[i].replace(trimRe, "");\r
-                if(!cache[p]){\r
-                    cache[p] = Ext.DomQuery.compile(p);\r
-                    if(!cache[p]){\r
-                        throw p + " is not a valid selector";\r
+               \r
+           // loop over each selector\r
+            for(var i = 0, len = paths.length; i < len; i++){          \r
+                var subPath = paths[i].replace(trimRe, "");\r
+               // compile and place in cache\r
+                if(!cache[subPath]){\r
+                    cache[subPath] = Ext.DomQuery.compile(subPath);\r
+                    if(!cache[subPath]){\r
+                        throw subPath + " is not a valid selector";\r
                     }\r
                 }\r
-                var result = cache[p](root);\r
+                var result = cache[subPath](root);\r
                 if(result && result != document){\r
                     results = results.concat(result);\r
                 }\r
             }\r
+           \r
+           // if there were multiple selectors, make sure dups\r
+           // are eliminated\r
             if(paths.length > 1){\r
                 return nodup(results);\r
             }\r
             return results;\r
         },\r
+       isXml: function(el) {\r
+           var docEl = (el ? el.ownerDocument || el : 0).documentElement;\r
+           return docEl ? docEl.nodeName !== "HTML" : false;\r
+       },\r
+        select : document.querySelectorAll ? function(path, root, type) {\r
+           root = root || document;\r
+           if (!Ext.DomQuery.isXml(root)) {\r
+               try {\r
+                   var cs = root.querySelectorAll(path);\r
+                   return Ext.toArray(cs);\r
+               }\r
+               catch (ex) {}           \r
+           }       \r
+           return Ext.DomQuery.jsSelect.call(this, path, root, type);\r
+       } : function(path, root, type) {\r
+           return Ext.DomQuery.jsSelect.call(this, path, root, type);\r
+       },\r
 \r
         /**\r
          * Selects a single element.\r
@@ -1352,9 +1513,15 @@ Ext.DomQuery = function(){
             if(!valueCache[path]){\r
                 valueCache[path] = Ext.DomQuery.compile(path, "select");\r
             }\r
-            var n = valueCache[path](root),\r
-               v;\r
+            var n = valueCache[path](root), v;\r
             n = n[0] ? n[0] : n;\r
+                   \r
+           // overcome a limitation of maximum textnode size\r
+           // Rumored to potentially crash IE6 but has not been confirmed.\r
+           // http://reference.sitepoint.com/javascript/Node/normalize\r
+           // https://developer.mozilla.org/En/DOM/Node.normalize          \r
+            if (typeof n.normalize == 'function') n.normalize();\r
+            \r
             v = (n && n.firstChild ? n.firstChild.nodeValue : null);\r
             return ((v === null||v === undefined||v==='') ? defaultValue : v);\r
         },\r
@@ -1406,10 +1573,12 @@ Ext.DomQuery = function(){
 \r
         /**\r
          * Collection of matching regular expressions and code snippets.\r
+         * Each capture group within () will be replace the {} in the select\r
+         * statement as specified by their index.\r
          */\r
         matchers : [{\r
                 re: /^\.([\w-]+)/,\r
-                select: 'n = byClassName(n, null, " {1} ");'\r
+                select: 'n = byClassName(n, " {1} ");'\r
             }, {\r
                 re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,\r
                 select: 'n = byPseudo(n, "{1}", "{2}");'\r
@@ -1418,7 +1587,7 @@ Ext.DomQuery = function(){
                 select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'\r
             }, {\r
                 re: /^#([\w-]+)/,\r
-                select: 'n = byId(n, null, "{1}");'\r
+                select: 'n = byId(n, "{1}");'\r
             },{\r
                 re: /^@([\w-]+)/,\r
                 select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'\r
@@ -1457,8 +1626,29 @@ Ext.DomQuery = function(){
         },\r
 \r
         /**\r
-         * Collection of "pseudo class" processors. Each processor is passed the current nodeset (array)\r
-         * and the argument (if any) supplied in the selector.\r
+         * <p>Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed\r
+         * two parameters:</p><div class="mdetail-params"><ul>\r
+         * <li><b>c</b> : Array<div class="sub-desc">An Array of DOM elements to filter.</div></li>\r
+         * <li><b>v</b> : String<div class="sub-desc">The argument (if any) supplied in the selector.</div></li>\r
+         * </ul></div>\r
+         * <p>A filter function returns an Array of DOM elements which conform to the pseudo class.</p>\r
+         * <p>In addition to the provided pseudo classes listed above such as <code>first-child</code> and <code>nth-child</code>,\r
+         * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.</p>\r
+         * <p>For example, to filter <code>&lt;a></code> elements to only return links to <i>external</i> resources:</p>\r
+         * <code><pre>\r
+Ext.DomQuery.pseudos.external = function(c, v){\r
+    var r = [], ri = -1;\r
+    for(var i = 0, ci; ci = c[i]; i++){\r
+//      Include in result set only if it's a link to an external resource\r
+        if(ci.hostname != location.hostname){\r
+            r[++ri] = ci;\r
+        }\r
+    }\r
+    return r;\r
+};</pre></code>\r
+         * Then external links could be gathered with the following statement:<code><pre>\r
+var externalLinks = Ext.select("a:external");\r
+</code></pre>\r
          */\r
         pseudos : {\r
             "first-child" : function(c){\r
@@ -1653,7 +1843,70 @@ Ext.DomQuery = function(){
  * @method query\r
  */\r
 Ext.query = Ext.DomQuery.select;\r
-(function(){
+/**
+ * @class Ext.util.DelayedTask
+ * <p> The DelayedTask class provides a convenient way to "buffer" the execution of a method,
+ * performing setTimeout where a new timeout cancels the old timeout. When called, the
+ * task will wait the specified time period before executing. If durng that time period,
+ * the task is called again, the original call will be cancelled. This continues so that
+ * the function is only called a single time for each iteration.</p>
+ * <p>This method is especially useful for things like detecting whether a user has finished
+ * typing in a text field. An example would be performing validation on a keypress. You can
+ * use this class to buffer the keypress events for a certain number of milliseconds, and
+ * perform only if they stop for that amount of time.  Usage:</p><pre><code>
+var task = new Ext.util.DelayedTask(function(){
+    alert(Ext.getDom('myInputField').value.length);
+});
+// Wait 500ms before calling our function. If the user presses another key 
+// during that 500ms, it will be cancelled and we'll wait another 500ms.
+Ext.get('myInputField').on('keypress', function(){
+    task.{@link #delay}(500); 
+});
+ * </code></pre> 
+ * <p>Note that we are using a DelayedTask here to illustrate a point. The configuration
+ * option <tt>buffer</tt> for {@link Ext.util.Observable#addListener addListener/on} will
+ * also setup a delayed task for you to buffer events.</p> 
+ * @constructor The parameters to this constructor serve as defaults and are not required.
+ * @param {Function} fn (optional) The default function to call.
+ * @param {Object} scope The default scope (The <code><b>this</b></code> reference) in which the
+ * function is called. If not specified, <code>this</code> will refer to the browser window.
+ * @param {Array} args (optional) The default Array of arguments.
+ */
+Ext.util.DelayedTask = function(fn, scope, args){
+    var me = this,
+       id,     
+       call = function(){
+               clearInterval(id);
+               id = null;
+               fn.apply(scope, args || []);
+           };
+           
+    /**
+     * Cancels any pending timeout and queues a new one
+     * @param {Number} delay The milliseconds to delay
+     * @param {Function} newFn (optional) Overrides function passed to constructor
+     * @param {Object} newScope (optional) Overrides scope passed to constructor. Remember that if no scope
+     * is specified, <code>this</code> will refer to the browser window.
+     * @param {Array} newArgs (optional) Overrides args passed to constructor
+     */
+    me.delay = function(delay, newFn, newScope, newArgs){
+        me.cancel();
+        fn = newFn || fn;
+        scope = newScope || scope;
+        args = newArgs || args;
+        id = setInterval(call, delay);
+    };
+
+    /**
+     * Cancel the last queued timeout
+     */
+    me.cancel = function(){
+        if(id){
+            clearInterval(id);
+            id = null;
+        }
+    };
+};(function(){
 
 var EXTUTIL = Ext.util,
     TOARRAY = Ext.toArray,
@@ -1765,216 +2018,223 @@ var combo = new Ext.form.ComboBox({
     me.events = e || {};
 };
 
-EXTUTIL.Observable.prototype = function(){
-    var filterOptRe = /^(?:scope|delay|buffer|single)$/, toLower = function(s){
-        return s.toLowerCase();
-    };
-
-    return {
-        /**
-         * <p>Fires the specified event with the passed parameters (minus the event name).</p>
-         * <p>An event may be set to bubble up an Observable parent hierarchy (See {@link Ext.Component#getBubbleTarget})
-         * by calling {@link #enableBubble}.</p>
-         * @param {String} eventName The name of the event to fire.
-         * @param {Object...} args Variable number of parameters are passed to handlers.
-         * @return {Boolean} returns false if any of the handlers return false otherwise it returns true.
-         */
+EXTUTIL.Observable.prototype = {
+    // private
+    filterOptRe : /^(?:scope|delay|buffer|single)$/,
 
-        fireEvent : function(){
-            var a = TOARRAY(arguments),
-                ename = toLower(a[0]),
-                me = this,
-                ret = TRUE,
-                ce = me.events[ename],
-                q,
-                c;
-            if (me.eventsSuspended === TRUE) {
-                if (q = me.suspendedEventsQueue) {
-                    q.push(a);
-                }
+    /**
+     * <p>Fires the specified event with the passed parameters (minus the event name).</p>
+     * <p>An event may be set to bubble up an Observable parent hierarchy (See {@link Ext.Component#getBubbleTarget})
+     * by calling {@link #enableBubble}.</p>
+     * @param {String} eventName The name of the event to fire.
+     * @param {Object...} args Variable number of parameters are passed to handlers.
+     * @return {Boolean} returns false if any of the handlers return false otherwise it returns true.
+     */
+    fireEvent : function(){
+        var a = TOARRAY(arguments),
+            ename = a[0].toLowerCase(),
+            me = this,
+            ret = TRUE,
+            ce = me.events[ename],
+            q,
+            c;
+        if (me.eventsSuspended === TRUE) {
+            if (q = me.eventQueue) {
+                q.push(a);
             }
-            else if(ISOBJECT(ce) && ce.bubble){
-                if(ce.fire.apply(ce, a.slice(1)) === FALSE) {
-                    return FALSE;
-                }
-                c = me.getBubbleTarget && me.getBubbleTarget();
-                if(c && c.enableBubble) {
+        }
+        else if(ISOBJECT(ce) && ce.bubble){
+            if(ce.fire.apply(ce, a.slice(1)) === FALSE) {
+                return FALSE;
+            }
+            c = me.getBubbleTarget && me.getBubbleTarget();
+            if(c && c.enableBubble) {
+                if(!c.events[ename] || !Ext.isObject(c.events[ename]) || !c.events[ename].bubble) {
                     c.enableBubble(ename);
-                    return c.fireEvent.apply(c, a);
                 }
+                return c.fireEvent.apply(c, a);
             }
-            else {
-                if (ISOBJECT(ce)) {
-                    a.shift();
-                    ret = ce.fire.apply(ce, a);
-                }
+        }
+        else {
+            if (ISOBJECT(ce)) {
+                a.shift();
+                ret = ce.fire.apply(ce, a);
             }
-            return ret;
-        },
+        }
+        return ret;
+    },
 
-        /**
-         * Appends an event handler to this object.
-         * @param {String}   eventName The name of the event to listen for.
-         * @param {Function} handler The method the event invokes.
-         * @param {Object}   scope (optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
-         * <b>If omitted, defaults to the object which fired the event.</b>
-         * @param {Object}   options (optional) An object containing handler configuration.
-         * properties. This may contain any of the following properties:<ul>
-         * <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
-         * <b>If omitted, defaults to the object which fired the event.</b></div></li>
-         * <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
-         * <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
-         * <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
-         * by the specified number of milliseconds. If the event fires again within that time, the original
-         * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
-         * <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
-         * if the event was bubbled up from a child Observable.</div></li>
-         * </ul><br>
-         * <p>
-         * <b>Combining Options</b><br>
-         * Using the options argument, it is possible to combine different types of listeners:<br>
-         * <br>
-         * A delayed, one-time listener.
-         * <pre><code>
+    /**
+     * Appends an event handler to this object.
+     * @param {String}   eventName The name of the event to listen for.
+     * @param {Function} handler The method the event invokes.
+     * @param {Object}   scope (optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
+     * <b>If omitted, defaults to the object which fired the event.</b>
+     * @param {Object}   options (optional) An object containing handler configuration.
+     * properties. This may contain any of the following properties:<ul>
+     * <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
+     * <b>If omitted, defaults to the object which fired the event.</b></div></li>
+     * <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
+     * <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
+     * <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
+     * by the specified number of milliseconds. If the event fires again within that time, the original
+     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
+     * <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
+     * if the event was bubbled up from a child Observable.</div></li>
+     * </ul><br>
+     * <p>
+     * <b>Combining Options</b><br>
+     * Using the options argument, it is possible to combine different types of listeners:<br>
+     * <br>
+     * A delayed, one-time listener.
+     * <pre><code>
 myDataView.on('click', this.onClick, this, {
-    single: true,
-    delay: 100
-});</code></pre>
-         * <p>
-         * <b>Attaching multiple handlers in 1 call</b><br>
-         * The method also allows for a single argument to be passed which is a config object containing properties
-         * which specify multiple handlers.
-         * <p>
-         * <pre><code>
-myGridPanel.on({
-    'click' : {
-        fn: this.onClick,
-        scope: this,
-        delay: 100
-    },
-    'mouseover' : {
-        fn: this.onMouseOver,
-        scope: this
-    },
-    'mouseout' : {
-        fn: this.onMouseOut,
-        scope: this
-    }
+single: true,
+delay: 100
 });</code></pre>
      * <p>
-     * Or a shorthand syntax:<br>
+     * <b>Attaching multiple handlers in 1 call</b><br>
+     * The method also allows for a single argument to be passed which is a config object containing properties
+     * which specify multiple handlers.
+     * <p>
      * <pre><code>
 myGridPanel.on({
-    'click' : this.onClick,
-    'mouseover' : this.onMouseOver,
-    'mouseout' : this.onMouseOut,
-     scope: this
+'click' : {
+    fn: this.onClick,
+    scope: this,
+    delay: 100
+},
+'mouseover' : {
+    fn: this.onMouseOver,
+    scope: this
+},
+'mouseout' : {
+    fn: this.onMouseOut,
+    scope: this
+}
 });</code></pre>
-         */
-        addListener : function(eventName, fn, scope, o){
-            var me = this,
-                e,
-                oe,
-                isF,
-            ce;
-            if (ISOBJECT(eventName)) {
-                o = eventName;
-                for (e in o){
-                    oe = o[e];
-                    if (!filterOptRe.test(e)) {
-                        me.addListener(e, oe.fn || oe, oe.scope || o.scope, oe.fn ? oe : o);
-                    }
-                }
-            } else {
-                eventName = toLower(eventName);
-                ce = me.events[eventName] || TRUE;
-                if (typeof ce == "boolean") {
-                    me.events[eventName] = ce = new EXTUTIL.Event(me, eventName);
+ * <p>
+ * Or a shorthand syntax:<br>
+ * <pre><code>
+myGridPanel.on({
+'click' : this.onClick,
+'mouseover' : this.onMouseOver,
+'mouseout' : this.onMouseOut,
+ scope: this
+});</code></pre>
+     */
+    addListener : function(eventName, fn, scope, o){
+        var me = this,
+            e,
+            oe,
+            isF,
+        ce;
+        if (ISOBJECT(eventName)) {
+            o = eventName;
+            for (e in o){
+                oe = o[e];
+                if (!me.filterOptRe.test(e)) {
+                    me.addListener(e, oe.fn || oe, oe.scope || o.scope, oe.fn ? oe : o);
                 }
-                ce.addListener(fn, scope, ISOBJECT(o) ? o : {});
             }
-        },
-
-        /**
-         * Removes an event handler.
-         * @param {String}   eventName The type of event the handler was associated with.
-         * @param {Function} handler   The handler to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
-         * @param {Object}   scope     (optional) The scope originally specified for the handler.
-         */
-        removeListener : function(eventName, fn, scope){
-            var ce = this.events[toLower(eventName)];
-            if (ISOBJECT(ce)) {
-                ce.removeListener(fn, scope);
+        } else {
+            eventName = eventName.toLowerCase();
+            ce = me.events[eventName] || TRUE;
+            if (Ext.isBoolean(ce)) {
+                me.events[eventName] = ce = new EXTUTIL.Event(me, eventName);
             }
-        },
+            ce.addListener(fn, scope, ISOBJECT(o) ? o : {});
+        }
+    },
 
-        /**
-         * Removes all listeners for this object
-         */
-        purgeListeners : function(){
-            var events = this.events,
-                evt,
-                key;
-            for(key in events){
-                evt = events[key];
-                if(ISOBJECT(evt)){
-                    evt.clearListeners();
-                }
-            }
-        },
+    /**
+     * Removes an event handler.
+     * @param {String}   eventName The type of event the handler was associated with.
+     * @param {Function} handler   The handler to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
+     * @param {Object}   scope     (optional) The scope originally specified for the handler.
+     */
+    removeListener : function(eventName, fn, scope){
+        var ce = this.events[eventName.toLowerCase()];
+        if (ISOBJECT(ce)) {
+            ce.removeListener(fn, scope);
+        }
+    },
 
-        /**
-         * Used to define events on this Observable
-         * @param {Object} object The object with the events defined
-         */
-        addEvents : function(o){
-            var me = this;
-            me.events = me.events || {};
-            if (typeof o == 'string') {
-                EACH(arguments, function(a) {
-                    me.events[a] = me.events[a] || TRUE;
-                });
-            } else {
-                Ext.applyIf(me.events, o);
+    /**
+     * Removes all listeners for this object
+     */
+    purgeListeners : function(){
+        var events = this.events,
+            evt,
+            key;
+        for(key in events){
+            evt = events[key];
+            if(ISOBJECT(evt)){
+                evt.clearListeners();
             }
-        },
-
-        /**
-         * Checks to see if this object has any listeners for a specified event
-         * @param {String} eventName The name of the event to check for
-         * @return {Boolean} True if the event is being listened for, else false
-         */
-        hasListener : function(eventName){
-            var e = this.events[eventName];
-            return ISOBJECT(e) && e.listeners.length > 0;
-        },
+        }
+    },
 
-        /**
-         * Suspend the firing of all events. (see {@link #resumeEvents})
-         * @param {Boolean} queueSuspended Pass as true to queue up suspended events to be fired
-         * after the {@link #resumeEvents} call instead of discarding all suspended events;
-         */
-        suspendEvents : function(queueSuspended){
-            this.eventsSuspended = TRUE;
-            if (queueSuspended){
-                this.suspendedEventsQueue = [];
+    /**
+     * Adds the specified events to the list of events which this Observable may fire.
+     * @param {Object|String} o Either an object with event names as properties with a value of <code>true</code>
+     * or the first event name string if multiple event names are being passed as separate parameters.
+     * @param {string} Optional. Event name if multiple event names are being passed as separate parameters.
+     * Usage:<pre><code>
+this.addEvents('storeloaded', 'storecleared');
+</code></pre>
+     */
+    addEvents : function(o){
+        var me = this;
+        me.events = me.events || {};
+        if (Ext.isString(o)) {
+            var a = arguments,
+                i = a.length;
+            while(i--) {
+                me.events[a[i]] = me.events[a[i]] || TRUE;
             }
-        },
+        } else {
+            Ext.applyIf(me.events, o);
+        }
+    },
 
-        /**
-         * Resume firing events. (see {@link #suspendEvents})
-         * If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
-         * events fired during event suspension will be sent to any listeners now.
-         */
-        resumeEvents : function(){
-            var me = this;
-            me.eventsSuspended = !delete me.suspendedEventQueue;
-            EACH(me.suspendedEventsQueue, function(e) {
-                me.fireEvent.apply(me, e);
-            });
+    /**
+     * Checks to see if this object has any listeners for a specified event
+     * @param {String} eventName The name of the event to check for
+     * @return {Boolean} True if the event is being listened for, else false
+     */
+    hasListener : function(eventName){
+        var e = this.events[eventName];
+        return ISOBJECT(e) && e.listeners.length > 0;
+    },
+
+    /**
+     * Suspend the firing of all events. (see {@link #resumeEvents})
+     * @param {Boolean} queueSuspended Pass as true to queue up suspended events to be fired
+     * after the {@link #resumeEvents} call instead of discarding all suspended events;
+     */
+    suspendEvents : function(queueSuspended){
+        this.eventsSuspended = TRUE;
+        if(queueSuspended && !this.eventQueue){
+            this.eventQueue = [];
         }
+    },
+
+    /**
+     * Resume firing events. (see {@link #suspendEvents})
+     * If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
+     * events fired during event suspension will be sent to any listeners now.
+     */
+    resumeEvents : function(){
+        var me = this,
+            queued = me.eventQueue || [];
+        me.eventsSuspended = FALSE;
+        delete me.eventQueue;
+        EACH(queued, function(e) {
+            me.fireEvent.apply(me, e);
+        });
     }
-}();
+};
 
 var OBSERVABLE = EXTUTIL.Observable.prototype;
 /**
@@ -2013,26 +2273,28 @@ function createTargeted(h, o, scope){
     };
 };
 
-function createBuffered(h, o, scope){
-    var task = new EXTUTIL.DelayedTask();
+function createBuffered(h, o, l, scope){
+    l.task = new EXTUTIL.DelayedTask();
     return function(){
-        task.delay(o.buffer, h, scope, TOARRAY(arguments));
+        l.task.delay(o.buffer, h, scope, TOARRAY(arguments));
     };
-}
+};
 
 function createSingle(h, e, fn, scope){
     return function(){
         e.removeListener(fn, scope);
         return h.apply(scope, arguments);
     };
-}
+};
 
-function createDelayed(h, o, scope){
+function createDelayed(h, o, l, scope){
     return function(){
-        var args = TOARRAY(arguments);
-        (function(){
-            h.apply(scope, args);
-        }).defer(o.delay || 10);
+        var task = new EXTUTIL.DelayedTask();
+        if(!l.tasks) {
+            l.tasks = [];
+        }
+        l.tasks.push(task);
+        task.delay(o.delay || 10, h, scope, TOARRAY(arguments));
     };
 };
 
@@ -2067,29 +2329,33 @@ EXTUTIL.Event.prototype = {
             h = createTargeted(h, o, scope);
         }
         if(o.delay){
-            h = createDelayed(h, o, scope);
+            h = createDelayed(h, o, l, scope);
         }
         if(o.single){
             h = createSingle(h, this, fn, scope);
         }
         if(o.buffer){
-            h = createBuffered(h, o, scope);
+            h = createBuffered(h, o, l, scope);
         }
         l.fireFn = h;
         return l;
     },
 
     findListener : function(fn, scope){
-        var s, ret = -1;
-        EACH(this.listeners, function(l, i) {
-            s = l.scope;
-            if(l.fn == fn && (s == scope || s == this.obj)){
-                ret = i;
-                return FALSE;
+        var list = this.listeners,
+            i = list.length,
+            l,
+            s;
+        while(i--) {
+            l = list[i];
+            if(l) {
+                s = l.scope;
+                if(l.fn == fn && (s == scope || s == this.obj)){
+                    return i;
+                }
             }
-        },
-        this);
-        return ret;
+        }
+        return -1;
     },
 
     isListening : function(fn, scope){
@@ -2098,62 +2364,88 @@ EXTUTIL.Event.prototype = {
 
     removeListener : function(fn, scope){
         var index,
+            l,
+            k,
             me = this,
             ret = FALSE;
         if((index = me.findListener(fn, scope)) != -1){
             if (me.firing) {
                 me.listeners = me.listeners.slice(0);
             }
+            l = me.listeners[index];
+            if(l.task) {
+                l.task.cancel();
+                delete l.task;
+            }
+            k = l.tasks && l.tasks.length;
+            if(k) {
+                while(k--) {
+                    l.tasks[k].cancel();
+                }
+                delete l.tasks;
+            }
             me.listeners.splice(index, 1);
             ret = TRUE;
         }
         return ret;
     },
 
+    // Iterate to stop any buffered/delayed events
     clearListeners : function(){
-        this.listeners = [];
+        var me = this,
+            l = me.listeners,
+            i = l.length;
+        while(i--) {
+            me.removeListener(l[i].fn, l[i].scope);
+        }
     },
 
     fire : function(){
         var me = this,
             args = TOARRAY(arguments),
-            ret = TRUE;
+            listeners = me.listeners,
+            len = listeners.length,
+            i = 0,
+            l;
 
-        EACH(me.listeners, function(l) {
+        if(len > 0){
             me.firing = TRUE;
-            if (l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) {
-                return ret = me.firing = FALSE;
+            for (; i < len; i++) {
+                l = listeners[i];
+                if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) {
+                    return (me.firing = FALSE);
+                }
             }
-        });
+        }
         me.firing = FALSE;
-        return ret;
+        return TRUE;
     }
 };
 })();/**\r
  * @class Ext.util.Observable\r
  */\r
-Ext.apply(Ext.util.Observable.prototype, function(){    \r
+Ext.apply(Ext.util.Observable.prototype, function(){\r
     // this is considered experimental (along with beforeMethod, afterMethod, removeMethodListener?)\r
     // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call\r
     // private\r
     function getMethodEvent(method){\r
         var e = (this.methodEvents = this.methodEvents ||\r
         {})[method], returnValue, v, cancel, obj = this;\r
-        \r
+\r
         if (!e) {\r
             this.methodEvents[method] = e = {};\r
             e.originalFn = this[method];\r
             e.methodName = method;\r
             e.before = [];\r
             e.after = [];\r
-            \r
+\r
             var makeCall = function(fn, scope, args){\r
                 if (!Ext.isEmpty(v = fn.apply(scope || obj, args))) {\r
                     if (Ext.isObject(v)) {\r
                         returnValue = !Ext.isEmpty(v.returnValue) ? v.returnValue : v;\r
                         cancel = !!v.cancel;\r
                     }\r
-                    else \r
+                    else\r
                         if (v === false) {\r
                             cancel = true;\r
                         }\r
@@ -2162,19 +2454,19 @@ Ext.apply(Ext.util.Observable.prototype, function(){
                         }\r
                 }\r
             };\r
-            \r
+\r
             this[method] = function(){\r
                 var args = Ext.toArray(arguments);\r
                 returnValue = v = undefined;\r
                 cancel = false;\r
-                \r
+\r
                 Ext.each(e.before, function(b){\r
                     makeCall(b.fn, b.scope, args);\r
                     if (cancel) {\r
                         return returnValue;\r
                     }\r
                 });\r
-                \r
+\r
                 if (!Ext.isEmpty(v = e.originalFn.apply(obj, args))) {\r
                     returnValue = v;\r
                 }\r
@@ -2189,26 +2481,26 @@ Ext.apply(Ext.util.Observable.prototype, function(){
         }\r
         return e;\r
     }\r
-    \r
+\r
     return {\r
         // these are considered experimental\r
         // allows for easier interceptor and sequences, including cancelling and overwriting the return value of the call\r
-        // adds an "interceptor" called before the original method\r
-        beforeMethod: function(method, fn, scope){\r
+        // adds an 'interceptor' called before the original method\r
+        beforeMethod : function(method, fn, scope){\r
             getMethodEvent.call(this, method).before.push({\r
                 fn: fn,\r
                 scope: scope\r
             });\r
         },\r
-        \r
-        // adds a "sequence" called after the original method\r
-        afterMethod: function(method, fn, scope){\r
+\r
+        // adds a 'sequence' called after the original method\r
+        afterMethod : function(method, fn, scope){\r
             getMethodEvent.call(this, method).after.push({\r
                 fn: fn,\r
                 scope: scope\r
             });\r
         },\r
-        \r
+\r
         removeMethodListener: function(method, fn, scope){\r
             var e = getMethodEvent.call(this, method), found = false;\r
             Ext.each(e.before, function(b, i, arr){\r
@@ -2227,13 +2519,13 @@ Ext.apply(Ext.util.Observable.prototype, function(){
                 });\r
             }\r
         },\r
-        \r
+\r
         /**\r
          * Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.\r
          * @param {Object} o The Observable whose events this object is to relay.\r
          * @param {Array} events Array of event names to relay.\r
          */\r
-        relayEvents: function(o, events){\r
+        relayEvents : function(o, events){\r
             var me = this;\r
             function createHandler(ename){\r
                 return function(){\r
@@ -2245,23 +2537,58 @@ Ext.apply(Ext.util.Observable.prototype, function(){
                 o.on(ename, createHandler(ename), me);\r
             });\r
         },\r
-        \r
+\r
         /**\r
-         * Used to enable bubbling of events\r
-         * @param {Object} events\r
+         * <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling\r
+         * <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>\r
+         * <p>This is commonly used by Ext.Components to bubble events to owner Containers. See {@link Ext.Component.getBubbleTarget}. The default\r
+         * implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to\r
+         * access the required target more quickly.</p>\r
+         * <p>Example:</p><pre><code>\r
+Ext.override(Ext.form.Field, {\r
+    //  Add functionality to Field&#39;s initComponent to enable the change event to bubble\r
+    initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {\r
+        this.enableBubble('change');\r
+    }),\r
+\r
+    //  We know that we want Field&#39;s events to bubble directly to the FormPanel.\r
+    getBubbleTarget : function() {\r
+        if (!this.formPanel) {\r
+            this.formPanel = this.findParentByType('form');\r
+        }\r
+        return this.formPanel;\r
+    }\r
+});\r
+\r
+var myForm = new Ext.formPanel({\r
+    title: 'User Details',\r
+    items: [{\r
+        ...\r
+    }],\r
+    listeners: {\r
+        change: function() {\r
+            // Title goes red if form has been modified.\r
+            myForm.header.setStyle('color', 'red');\r
+        }\r
+    }\r
+});\r
+</code></pre>\r
+         * @param {String/Array} events The event name to bubble, or an Array of event names.\r
          */\r
-        enableBubble: function(events){\r
+        enableBubble : function(events){\r
             var me = this;\r
-            events = Ext.isArray(events) ? events : Ext.toArray(arguments);\r
-            Ext.each(events, function(ename){\r
-                ename = ename.toLowerCase();\r
-                var ce = me.events[ename] || true;\r
-                if (typeof ce == "boolean") {\r
-                    ce = new Ext.util.Event(me, ename);\r
-                    me.events[ename] = ce;\r
-                }\r
-                ce.bubble = true;\r
-            });\r
+            if(!Ext.isEmpty(events)){\r
+                events = Ext.isArray(events) ? events : Ext.toArray(arguments);\r
+                Ext.each(events, function(ename){\r
+                    ename = ename.toLowerCase();\r
+                    var ce = me.events[ename] || true;\r
+                    if (Ext.isBoolean(ce)) {\r
+                        ce = new Ext.util.Event(me, ename);\r
+                        me.events[ename] = ce;\r
+                    }\r
+                    ce.bubble = true;\r
+                });\r
+            }\r
         }\r
     };\r
 }());\r
@@ -2272,9 +2599,9 @@ Ext.apply(Ext.util.Observable.prototype, function(){
  * to the supplied function with the event name + standard signature of the event\r
  * <b>before</b> the event is fired. If the supplied function returns false,\r
  * the event will not fire.\r
- * @param {Observable} o The Observable to capture\r
- * @param {Function} fn The function to call\r
- * @param {Object} scope (optional) The scope (this object) for the fn\r
+ * @param {Observable} o The Observable to capture events from.\r
+ * @param {Function} fn The function to call when an event is fired.\r
+ * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Observable firing the event.\r
  * @static\r
  */\r
 Ext.util.Observable.capture = function(o, fn, scope){\r
@@ -2289,38888 +2616,42109 @@ Ext.util.Observable.capture = function(o, fn, scope){
  * <p>Usage:</p><pre><code>\r
 Ext.util.Observable.observeClass(Ext.data.Connection);\r
 Ext.data.Connection.on('beforerequest', function(con, options) {\r
-    console.log("Ajax request made to " + options.url);\r
+    console.log('Ajax request made to ' + options.url);\r
 });</code></pre>\r
  * @param {Function} c The class constructor to make observable.\r
+ * @param {Object} listeners An object containing a series of listeners to add. See {@link #addListener}. \r
  * @static\r
  */\r
-Ext.util.Observable.observeClass = function(c){\r
-    Ext.apply(c, new Ext.util.Observable());\r
-    c.prototype.fireEvent = function(){\r
-        return (c.fireEvent.apply(c, arguments) !== false) &&\r
-        (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false);\r
-    };\r
-};/**
- * @class Ext.EventManager
- * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides
- * several useful events directly.
- * See {@link Ext.EventObject} for more details on normalized event objects.
- * @singleton
- */
-Ext.EventManager = function(){
-    var docReadyEvent, 
-       docReadyProcId, 
-       docReadyState = false,          
-       E = Ext.lib.Event,
-       D = Ext.lib.Dom,
-       DOC = document,
-       WINDOW = window,
-       IEDEFERED = "ie-deferred-loader",
-       DOMCONTENTLOADED = "DOMContentLoaded",
-       elHash = {},
-       propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
-
-    /// There is some jquery work around stuff here that isn't needed in Ext Core.
-    function addListener(el, ename, fn, wrap, scope){      
-        var id = Ext.id(el),
-               es = elHash[id] = elHash[id] || {};             
-       
-        (es[ename] = es[ename] || []).push([fn, wrap, scope]);
-        E.on(el, ename, wrap);
-
-        // this is a workaround for jQuery and should somehow be removed from Ext Core in the future
-        // without breaking ExtJS.
-        if(ename == "mousewheel" && el.addEventListener){ // workaround for jQuery
-               var args = ["DOMMouseScroll", wrap, false];
-               el.addEventListener.apply(el, args);
-            E.on(window, 'unload', function(){
-                   el.removeEventListener.apply(el, args);                
-            });
-        }
-        if(ename == "mousedown" && el == document){ // fix stopped mousedowns on the document
-            Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);
-        }
-    };
-    
-    function fireDocReady(){
-        if(!docReadyState){            
-            Ext.isReady = docReadyState = true;
-            if(docReadyProcId){
-                clearInterval(docReadyProcId);
-            }
-            if(Ext.isGecko || Ext.isOpera) {
-                DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false);
-            }
-            if(Ext.isIE){
-                var defer = DOC.getElementById(IEDEFERED);
-                if(defer){
-                    defer.onreadystatechange = null;
-                    defer.parentNode.removeChild(defer);
-                }
-            }
-            if(docReadyEvent){
-                docReadyEvent.fire();
-                docReadyEvent.clearListeners();
-            }
-        }
-    };
-
-    function initDocReady(){
-           var COMPLETE = "complete";
-               
-        docReadyEvent = new Ext.util.Event();
-        if (Ext.isGecko || Ext.isOpera) {
-            DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false);
-        } else if (Ext.isIE){
-            DOC.write("<s"+'cript id=' + IEDEFERED + ' defer="defer" src="/'+'/:"></s'+"cript>");            
-            DOC.getElementById(IEDEFERED).onreadystatechange = function(){
-                if(this.readyState == COMPLETE){
-                    fireDocReady();
-                }
-            };
-        } else if (Ext.isWebKit){
-            docReadyProcId = setInterval(function(){                
-                if(DOC.readyState == COMPLETE) {
-                    fireDocReady();
-                 }
-            }, 10);
-        }
-        // no matter what, make sure it fires on load
-        E.on(WINDOW, "load", fireDocReady);
-    };
-
-    function createTargeted(h, o){
-        return function(){
-               var args = Ext.toArray(arguments);
-            if(o.target == Ext.EventObject.setEvent(args[0]).target){
-                h.apply(this, args);
-            }
-        };
-    };    
-    
-    function createBuffered(h, o){
-        var task = new Ext.util.DelayedTask(h);
-        return function(e){
-            // create new event object impl so new events don't wipe out properties            
-            task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);
-        };
-    };
-
-    function createSingle(h, el, ename, fn, scope){
-        return function(e){
-            Ext.EventManager.removeListener(el, ename, fn, scope);
-            h(e);
-        };
-    };
-
-    function createDelayed(h, o){
-        return function(e){
-            // create new event object impl so new events don't wipe out properties   
-            e = new Ext.EventObjectImpl(e);
-            setTimeout(function(){
-                h(e);
-            }, o.delay || 10);
-        };
-    };
-
-    function listen(element, ename, opt, fn, scope){
-        var o = !Ext.isObject(opt) ? {} : opt,
-               el = Ext.getDom(element);
-               
-        fn = fn || o.fn; 
-        scope = scope || o.scope;
-        
-        if(!el){
-            throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.';
-        }
-        function h(e){
-            // prevent errors while unload occurring
-            if(!Ext){// !window[xname]){  ==> can't we do this? 
-                return;
-            }
-            e = Ext.EventObject.setEvent(e);
-            var t;
-            if (o.delegate) {
-                if(!(t = e.getTarget(o.delegate, el))){
-                    return;
-                }
-            } else {
-                t = e.target;
-            }            
-            if (o.stopEvent) {
-                e.stopEvent();
-            }
-            if (o.preventDefault) {
-               e.preventDefault();
-            }
-            if (o.stopPropagation) {
-                e.stopPropagation();
-            }
-            if (o.normalized) {
-                e = e.browserEvent;
-            }
-            
-            fn.call(scope || el, e, t, o);
-        };
-        if(o.target){
-            h = createTargeted(h, o);
-        }
-        if(o.delay){
-            h = createDelayed(h, o);
-        }
-        if(o.single){
-            h = createSingle(h, el, ename, fn, scope);
-        }
-        if(o.buffer){
-            h = createBuffered(h, o);
-        }
-
-        addListener(el, ename, fn, h, scope);
-        return h;
-    };
-
-    var pub = {
-           /**
-            * Appends an event handler to an element.  The shorthand version {@link #on} is equivalent.  Typically you will
-            * use {@link Ext.Element#addListener} directly on an Element in favor of calling this version.
-            * @param {String/HTMLElement} el The html element or id to assign the event handler to
-            * @param {String} eventName The type of event to listen for
-            * @param {Function} handler The handler function the event invokes This function is passed
-            * the following parameters:<ul>
-            * <li>evt : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>
-            * <li>t : Element<div class="sub-desc">The {@link Ext.Element Element} which was the target of the event.
-            * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
-            * <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li>
-            * </ul>
-            * @param {Object} scope (optional) The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.
-            * @param {Object} options (optional) An object containing handler configuration properties.
-            * This may contain any of the following properties:<ul>
-            * <li>scope : Object<div class="sub-desc">The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.</div></li>
-            * <li>delegate : String<div class="sub-desc">A simple selector to filter the target or look for a descendant of the target</div></li>
-            * <li>stopEvent : Boolean<div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>
-            * <li>preventDefault : Boolean<div class="sub-desc">True to prevent the default action</div></li>
-            * <li>stopPropagation : Boolean<div class="sub-desc">True to prevent event propagation</div></li>
-            * <li>normalized : Boolean<div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>
-            * <li>delay : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after te event fires.</div></li>
-            * <li>single : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
-            * <li>buffer : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
-            * by the specified number of milliseconds. If the event fires again within that time, the original
-            * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
-            * <li>target : Element<div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>
-            * </ul><br>
-            * <p>See {@link Ext.Element#addListener} for examples of how to use these options.</p>
-            */
-               addListener : function(element, eventName, fn, scope, options){                                              
-            if(Ext.isObject(eventName)){                
-                   var o = eventName, e, val;
-                for(e in o){
-                       val = o[e];
-                    if(!propRe.test(e)){                                                
-                           if(Ext.isFunction(val)){
-                               // shared options
-                               listen(element, e, o, val, o.scope);
-                           }else{
-                               // individual options
-                               listen(element, e, val);
-                           }
-                    }
-                }
-            } else {
-               listen(element, eventName, options, fn, scope);
-               }
-        },
-        
-        /**
-         * Removes an event handler from an element.  The shorthand version {@link #un} is equivalent.  Typically
-         * you will use {@link Ext.Element#removeListener} directly on an Element in favor of calling this version.
-         * @param {String/HTMLElement} el The id or html element from which to remove the event
-         * @param {String} eventName The type of event
-         * @param {Function} fn The handler function to remove
-         */
-        removeListener : function(element, eventName, fn, scope){            
-            var el = Ext.getDom(element),
-                id = Ext.id(el),
-                   wrap;      
-               
-               Ext.each((elHash[id] || {})[eventName], function (v,i,a) {
-                           if (Ext.isArray(v) && v[0] == fn && (!scope || v[2] == scope)) {                                                    
-                               E.un(el, eventName, wrap = v[1]);
-                               a.splice(i,1);
-                               return false;                           
-                       }
-               });     
-
-            // jQuery workaround that should be removed from Ext Core
-               if(eventName == "mousewheel" && el.addEventListener && wrap){
-                   el.removeEventListener("DOMMouseScroll", wrap, false);
-               }
-                       
-               if(eventName == "mousedown" && el == DOC && wrap){ // fix stopped mousedowns on the document
-                   Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap);
-               }
-        },
-        
-        /**
-         * Removes all event handers from an element.  Typically you will use {@link Ext.Element#removeAllListeners}
-         * directly on an Element in favor of calling this version.
-         * @param {String/HTMLElement} el The id or html element from which to remove the event
-         */
-        removeAll : function(el){
-               var id = Ext.id(el = Ext.getDom(el)), 
-                               es = elHash[id],                                
-                               ename;
-              
-               for(ename in es){
-                   if(es.hasOwnProperty(ename)){                           
-                       Ext.each(es[ename], function(v) {
-                           E.un(el, ename, v.wrap);                    
-                       });
-                   }            
-               }
-               elHash[id] = null;       
-        },
-
-        /**
-         * Fires when the document is ready (before onload and before images are loaded). Can be
-         * accessed shorthanded as Ext.onReady().
-         * @param {Function} fn The method the event invokes
-         * @param {Object} scope (optional) An object that becomes the scope of the handler
-         * @param {boolean} options (optional) An object containing standard {@link #addListener} options
-         */
-        onDocumentReady : function(fn, scope, options){
-            if(docReadyState){ // if it already fired
-                docReadyEvent.addListener(fn, scope, options);
-                docReadyEvent.fire();
-                docReadyEvent.clearListeners();               
-            } else {
-                if(!docReadyEvent) initDocReady();
-                options = options || {};
-                   options.delay = options.delay || 1;             
-                   docReadyEvent.addListener(fn, scope, options);
-            }
-        },
-        
-        elHash : elHash   
-    };
-     /**
-     * Appends an event handler to an element.  Shorthand for {@link #addListener}.
-     * @param {String/HTMLElement} el The html element or id to assign the event handler to
-     * @param {String} eventName The type of event to listen for
-     * @param {Function} handler The handler function the event invokes
-     * @param {Object} scope (optional) The scope in which to execute the handler
-     * function (the handler function's "this" context)
-     * @param {Object} options (optional) An object containing standard {@link #addListener} options
-     * @member Ext.EventManager
-     * @method on
-     */
-    pub.on = pub.addListener;
-    /**
-     * Removes an event handler from an element.  Shorthand for {@link #removeListener}.
-     * @param {String/HTMLElement} el The id or html element from which to remove the event
-     * @param {String} eventName The type of event
-     * @param {Function} fn The handler function to remove
-     * @return {Boolean} True if a listener was actually removed, else false
-     * @member Ext.EventManager
-     * @method un
-     */
-    pub.un = pub.removeListener;
-
-    pub.stoppedMouseDownEvent = new Ext.util.Event();
-    return pub;
-}();
-/**
-  * Fires when the document is ready (before onload and before images are loaded).  Shorthand of {@link Ext.EventManager#onDocumentReady}.
-  * @param {Function} fn The method the event invokes
-  * @param {Object} scope An object that becomes the scope of the handler
-  * @param {boolean} options (optional) An object containing standard {@link #addListener} options
-  * @member Ext
-  * @method onReady
- */
-Ext.onReady = Ext.EventManager.onDocumentReady;
-
-
-//Initialize doc classes
-(function(){
-    
-    var initExtCss = function(){
-        // find the body element
-        var bd = document.body || document.getElementsByTagName('body')[0];
-        if(!bd){ return false; }
-        var cls = [' ',
-                Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8'))
-                : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3')
-                : Ext.isOpera ? "ext-opera"
-                : Ext.isWebKit ? "ext-webkit" : ""];
-
-        if(Ext.isSafari){
-            cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4')));
-        }else if(Ext.isChrome){
-            cls.push("ext-chrome");
-        }
-
-        if(Ext.isMac){
-            cls.push("ext-mac");
-        }
-        if(Ext.isLinux){
-            cls.push("ext-linux");
-        }
-
-        if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie"
-            var p = bd.parentNode;
-            if(p){
-                p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box';
-            }
-        }
-        bd.className += cls.join(' ');
-        return true;
-    }
-
-    if(!initExtCss()){
-        Ext.onReady(initExtCss);
-    }
-})();
-
-
-/**
- * @class Ext.EventObject
- * Just as {@link Ext.Element} wraps around a native DOM node, Ext.EventObject 
- * wraps the browser's native event-object normalizing cross-browser differences,
- * such as which mouse button is clicked, keys pressed, mechanisms to stop
- * event-propagation along with a method to prevent default actions from taking place.
- * <p>For example:</p>
- * <pre><code>
-function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject
-    e.preventDefault();
-    var target = e.getTarget(); // same as t (the target HTMLElement)
-    ...
-}
-var myDiv = {@link Ext#get Ext.get}("myDiv");  // get reference to an {@link Ext.Element}
-myDiv.on(         // 'on' is shorthand for addListener
-    "click",      // perform an action on click of myDiv
-    handleClick   // reference to the action handler
-);  
-// other methods to do the same:
-Ext.EventManager.on("myDiv", 'click', handleClick);
-Ext.EventManager.addListener("myDiv", 'click', handleClick);
- </code></pre>
- * @singleton
- */
-Ext.EventObject = function(){
-    var E = Ext.lib.Event,
-       // safari keypress events for special keys return bad keycodes
-       safariKeys = {
-               3 : 13, // enter
-               63234 : 37, // left
-               63235 : 39, // right
-               63232 : 38, // up
-               63233 : 40, // down
-               63276 : 33, // page up
-               63277 : 34, // page down
-               63272 : 46, // delete
-               63273 : 36, // home
-               63275 : 35  // end
-       },
-       // normalize button clicks
-       btnMap = Ext.isIE ? {1:0,4:1,2:2} :
-                (Ext.isWebKit ? {1:0,2:1,3:2} : {0:0,1:1,2:2});
-
-    Ext.EventObjectImpl = function(e){
-        if(e){
-            this.setEvent(e.browserEvent || e);
-        }
-    };
-
-    Ext.EventObjectImpl.prototype = {
-           /** @private */
-        setEvent : function(e){
-               var me = this;
-            if(e == me || (e && e.browserEvent)){ // already wrapped
-                return e;
-            }
-            me.browserEvent = e;
-            if(e){
-                // normalize buttons
-                me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1);
-                if(e.type == 'click' && me.button == -1){
-                    me.button = 0;
-                }
-                me.type = e.type;
-                me.shiftKey = e.shiftKey;
-                // mac metaKey behaves like ctrlKey
-                me.ctrlKey = e.ctrlKey || e.metaKey || false;
-                me.altKey = e.altKey;
-                // in getKey these will be normalized for the mac
-                me.keyCode = e.keyCode;
-                me.charCode = e.charCode;
-                // cache the target for the delayed and or buffered events
-                me.target = E.getTarget(e);
-                // same for XY
-                me.xy = E.getXY(e);
-            }else{
-                me.button = -1;
-                me.shiftKey = false;
-                me.ctrlKey = false;
-                me.altKey = false;
-                me.keyCode = 0;
-                me.charCode = 0;
-                me.target = null;
-                me.xy = [0, 0];
-            }
-            return me;
-        },
-
-        /**
-         * Stop the event (preventDefault and stopPropagation)
-         */
-        stopEvent : function(){
-               var me = this;
-            if(me.browserEvent){
-                if(me.browserEvent.type == 'mousedown'){
-                    Ext.EventManager.stoppedMouseDownEvent.fire(me);
-                }
-                E.stopEvent(me.browserEvent);
-            }
-        },
-
-        /**
-         * Prevents the browsers default handling of the event.
-         */
-        preventDefault : function(){
-            if(this.browserEvent){
-                E.preventDefault(this.browserEvent);
-            }
-        },        
-
-        /**
-         * Cancels bubbling of the event.
-         */
-        stopPropagation : function(){
-               var me = this;
-            if(me.browserEvent){
-                if(me.browserEvent.type == 'mousedown'){
-                    Ext.EventManager.stoppedMouseDownEvent.fire(me);
-                }
-                E.stopPropagation(me.browserEvent);
-            }
-        },
-
-        /**
-         * Gets the character code for the event.
-         * @return {Number}
-         */
-        getCharCode : function(){
-            return this.charCode || this.keyCode;
-        },
-
-        /**
-         * Returns a normalized keyCode for the event.
-         * @return {Number} The key code
-         */
-        getKey : function(){
-            return this.normalizeKey(this.keyCode || this.charCode)
-        },
-               
-               // private
-               normalizeKey: function(k){
-                       return Ext.isSafari ? (safariKeys[k] || k) : k; 
-               },
-
-        /**
-         * Gets the x coordinate of the event.
-         * @return {Number}
-         */
-        getPageX : function(){
-            return this.xy[0];
-        },
-
-        /**
-         * Gets the y coordinate of the event.
-         * @return {Number}
-         */
-        getPageY : function(){
-            return this.xy[1];
-        },
-
-        /**
-         * Gets the page coordinates of the event.
-         * @return {Array} The xy values like [x, y]
-         */
-        getXY : function(){
-            return this.xy;
-        },
-
-        /**
-         * Gets the target for the event.
-         * @param {String} selector (optional) A simple selector to filter the target or look for an ancestor of the target
-         * @param {Number/Mixed} maxDepth (optional) The max depth to
-                search as a number or element (defaults to 10 || document.body)
-         * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node
-         * @return {HTMLelement}
-         */
-        getTarget : function(selector, maxDepth, returnEl){
-            return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target);
-        },
-
-        /**
-         * Gets the related target.
-         * @return {HTMLElement}
-         */
-        getRelatedTarget : function(){
-            return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : null;
-        },
-
-        /**
-         * Normalizes mouse wheel delta across browsers
-         * @return {Number} The delta
-         */
-        getWheelDelta : function(){
-            var e = this.browserEvent;
-            var delta = 0;
-            if(e.wheelDelta){ /* IE/Opera. */
-                delta = e.wheelDelta/120;
-            }else if(e.detail){ /* Mozilla case. */
-                delta = -e.detail/3;
-            }
-            return delta;
-        },
-               
-               /**
-               * Returns true if the target of this event is a child of el.  Unless the allowEl parameter is set, it will return false if if the target is el.
-               * Example usage:<pre><code>
-               // Handle click on any child of an element
-               Ext.getBody().on('click', function(e){
-                       if(e.within('some-el')){
-                               alert('Clicked on a child of some-el!');
-                       }
-               });
-               
-               // Handle click directly on an element, ignoring clicks on child nodes
-               Ext.getBody().on('click', function(e,t){
-                       if((t.id == 'some-el') && !e.within(t, true)){
-                               alert('Clicked directly on some-el!');
-                       }
-               });
-               </code></pre>
-                * @param {Mixed} el The id, DOM element or Ext.Element to check
-                * @param {Boolean} related (optional) true to test if the related target is within el instead of the target
-                * @param {Boolean} allowEl {optional} true to also check if the passed element is the target or related target
-                * @return {Boolean}
-                */
-               within : function(el, related, allowEl){
-            if(el){
-                           var t = this[related ? "getRelatedTarget" : "getTarget"]();
-                           return t && ((allowEl ? (t == Ext.getDom(el)) : false) || Ext.fly(el).contains(t));
-            }
-            return false;
-               }
-        };
-
-    return new Ext.EventObjectImpl();
-}();/**\r
+Ext.util.Observable.observeClass = function(c, listeners){\r
+    if(c){\r
+      if(!c.fireEvent){\r
+          Ext.apply(c, new Ext.util.Observable());\r
+          Ext.util.Observable.capture(c.prototype, c.fireEvent, c);\r
+      }\r
+      if(Ext.isObject(listeners)){\r
+          c.on(listeners);\r
+      }\r
+      return c;\r
+   }\r
+};/**\r
  * @class Ext.EventManager\r
+ * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides\r
+ * several useful events directly.\r
+ * See {@link Ext.EventObject} for more details on normalized event objects.\r
+ * @singleton\r
  */\r
-Ext.apply(Ext.EventManager, function(){\r
-       var resizeEvent, \r
-       resizeTask, \r
-       textEvent, \r
-       textSize,\r
-       D = Ext.lib.Dom,\r
-       E = Ext.lib.Event,\r
-       propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,\r
-        curWidth = 0,\r
-        curHeight = 0,\r
-        // note 1: IE fires ONLY the keydown event on specialkey autorepeat\r
-        // note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat\r
-        // (research done by @Jan Wolter at http://unixpapa.com/js/key.html)\r
-        useKeydown = Ext.isSafari ? \r
-                    Ext.num(navigator.userAgent.toLowerCase().match(/version\/(\d+\.\d)/)[1] || 2) >= 3.1 :\r
-                    !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);\r
-       \r
-       return { \r
-               // private\r
-           doResizeEvent: function(){\r
-            var h = D.getViewHeight(),\r
-                w = D.getViewWidth();\r
-            \r
-            //whacky problem in IE where the resize event will fire even though the w/h are the same.\r
-            if(curHeight != h || curWidth != w){\r
-                resizeEvent.fire(curWidth = w, curHeight = h);\r
-            }\r
-           },\r
-           \r
-           /**\r
-            * Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.\r
-            * @param {Function} fn        The method the event invokes\r
-            * @param {Object}   scope    An object that becomes the scope of the handler\r
-            * @param {boolean}  options\r
-            */\r
-           onWindowResize : function(fn, scope, options){\r
-               if(!resizeEvent){\r
-                   resizeEvent = new Ext.util.Event();\r
-                   resizeTask = new Ext.util.DelayedTask(this.doResizeEvent);\r
-                   E.on(window, "resize", this.fireWindowResize, this);\r
-               }\r
-               resizeEvent.addListener(fn, scope, options);\r
-           },\r
-       \r
-           // exposed only to allow manual firing\r
-           fireWindowResize : function(){\r
-               if(resizeEvent){\r
-                   if((Ext.isIE||Ext.isAir) && resizeTask){\r
-                       resizeTask.delay(50);\r
-                   }else{\r
-                       resizeEvent.fire(D.getViewWidth(), D.getViewHeight());\r
-                   }\r
-               }\r
-           },\r
-       \r
-           /**\r
-            * Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.\r
-            * @param {Function} fn        The method the event invokes\r
-            * @param {Object}   scope    An object that becomes the scope of the handler\r
-            * @param {boolean}  options\r
-            */\r
-           onTextResize : function(fn, scope, options){\r
-               if(!textEvent){\r
-                   textEvent = new Ext.util.Event();\r
-                   var textEl = new Ext.Element(document.createElement('div'));\r
-                   textEl.dom.className = 'x-text-resize';\r
-                   textEl.dom.innerHTML = 'X';\r
-                   textEl.appendTo(document.body);\r
-                   textSize = textEl.dom.offsetHeight;\r
-                   setInterval(function(){\r
-                       if(textEl.dom.offsetHeight != textSize){\r
-                           textEvent.fire(textSize, textSize = textEl.dom.offsetHeight);\r
-                       }\r
-                   }, this.textResizeInterval);\r
-               }\r
-               textEvent.addListener(fn, scope, options);\r
-           },\r
-       \r
-           /**\r
-            * Removes the passed window resize listener.\r
-            * @param {Function} fn        The method the event invokes\r
-            * @param {Object}   scope    The scope of handler\r
-            */\r
-           removeResizeListener : function(fn, scope){\r
-               if(resizeEvent){\r
-                   resizeEvent.removeListener(fn, scope);\r
-               }\r
-           },\r
-       \r
-           // private\r
-           fireResize : function(){\r
-               if(resizeEvent){\r
-                   resizeEvent.fire(D.getViewWidth(), D.getViewHeight());\r
-               }\r
-           },\r
-           \r
-            /**\r
-            * The frequency, in milliseconds, to check for text resize events (defaults to 50)\r
-            */\r
-           textResizeInterval : 50,\r
-           \r
-           /**\r
-         * Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL)\r
+Ext.EventManager = function(){\r
+    var docReadyEvent,\r
+        docReadyProcId,\r
+        docReadyState = false,\r
+        E = Ext.lib.Event,\r
+        D = Ext.lib.Dom,\r
+        DOC = document,\r
+        WINDOW = window,\r
+        IEDEFERED = "ie-deferred-loader",\r
+        DOMCONTENTLOADED = "DOMContentLoaded",\r
+        propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,\r
+        /*\r
+         * This cache is used to hold special js objects, the document and window, that don't have an id. We need to keep\r
+         * a reference to them so we can look them up at a later point.\r
          */\r
-        ieDeferSrc : false,\r
-        \r
-        // protected for use inside the framework\r
-        // detects whether we should use keydown or keypress based on the browser.\r
-        useKeydown: useKeydown\r
-    };\r
-}());\r
+        specialElCache = [];\r
+\r
+     function getId(el){\r
+        var id = false,\r
+            i = 0,\r
+            len = specialElCache.length,\r
+            id = false,\r
+            skip = false,\r
+            o;\r
+        if(el){\r
+            if(el.getElementById || el.navigator){\r
+                // look up the id\r
+                for(; i < len; ++i){\r
+                    o = specialElCache[i];\r
+                    if(o.el === el){\r
+                        id = o.id;\r
+                        break;\r
+                    }\r
+                }\r
+                if(!id){\r
+                    // for browsers that support it, ensure that give the el the same id\r
+                    id = Ext.id(el);\r
+                    specialElCache.push({\r
+                        id: id,\r
+                        el: el\r
+                    });\r
+                    skip = true;\r
+                }\r
+            }else{\r
+                id = Ext.id(el);\r
+            }\r
+            if(!Ext.elCache[id]){\r
+                Ext.Element.addToCache(new Ext.Element(el), id);\r
+                if(skip){\r
+                    Ext.elCache[id].skipGC = true;\r
+                }\r
+            }\r
+        }\r
+        return id;\r
+     };\r
 \r
-Ext.EventManager.on = Ext.EventManager.addListener;\r
-\r
-\r
-Ext.apply(Ext.EventObjectImpl.prototype, {\r
-    /** Key constant @type Number */\r
-    BACKSPACE: 8,\r
-    /** Key constant @type Number */\r
-    TAB: 9,\r
-    /** Key constant @type Number */\r
-    NUM_CENTER: 12,\r
-    /** Key constant @type Number */\r
-    ENTER: 13,\r
-    /** Key constant @type Number */\r
-    RETURN: 13,\r
-    /** Key constant @type Number */\r
-    SHIFT: 16,\r
-    /** Key constant @type Number */\r
-    CTRL: 17,\r
-    CONTROL : 17, // legacy\r
-    /** Key constant @type Number */\r
-    ALT: 18,\r
-    /** Key constant @type Number */\r
-    PAUSE: 19,\r
-    /** Key constant @type Number */\r
-    CAPS_LOCK: 20,\r
-    /** Key constant @type Number */\r
-    ESC: 27,\r
-    /** Key constant @type Number */\r
-    SPACE: 32,\r
-    /** Key constant @type Number */\r
-    PAGE_UP: 33,\r
-    PAGEUP : 33, // legacy\r
-    /** Key constant @type Number */\r
-    PAGE_DOWN: 34,\r
-    PAGEDOWN : 34, // legacy\r
-    /** Key constant @type Number */\r
-    END: 35,\r
-    /** Key constant @type Number */\r
-    HOME: 36,\r
-    /** Key constant @type Number */\r
-    LEFT: 37,\r
-    /** Key constant @type Number */\r
-    UP: 38,\r
-    /** Key constant @type Number */\r
-    RIGHT: 39,\r
-    /** Key constant @type Number */\r
-    DOWN: 40,\r
-    /** Key constant @type Number */\r
-    PRINT_SCREEN: 44,\r
-    /** Key constant @type Number */\r
-    INSERT: 45,\r
-    /** Key constant @type Number */\r
-    DELETE: 46,\r
-    /** Key constant @type Number */\r
-    ZERO: 48,\r
-    /** Key constant @type Number */\r
-    ONE: 49,\r
-    /** Key constant @type Number */\r
-    TWO: 50,\r
-    /** Key constant @type Number */\r
-    THREE: 51,\r
-    /** Key constant @type Number */\r
-    FOUR: 52,\r
-    /** Key constant @type Number */\r
-    FIVE: 53,\r
-    /** Key constant @type Number */\r
-    SIX: 54,\r
-    /** Key constant @type Number */\r
-    SEVEN: 55,\r
-    /** Key constant @type Number */\r
-    EIGHT: 56,\r
-    /** Key constant @type Number */\r
-    NINE: 57,\r
-    /** Key constant @type Number */\r
-    A: 65,\r
-    /** Key constant @type Number */\r
-    B: 66,\r
-    /** Key constant @type Number */\r
-    C: 67,\r
-    /** Key constant @type Number */\r
-    D: 68,\r
-    /** Key constant @type Number */\r
-    E: 69,\r
-    /** Key constant @type Number */\r
-    F: 70,\r
-    /** Key constant @type Number */\r
-    G: 71,\r
-    /** Key constant @type Number */\r
-    H: 72,\r
-    /** Key constant @type Number */\r
-    I: 73,\r
-    /** Key constant @type Number */\r
-    J: 74,\r
-    /** Key constant @type Number */\r
-    K: 75,\r
-    /** Key constant @type Number */\r
-    L: 76,\r
-    /** Key constant @type Number */\r
-    M: 77,\r
-    /** Key constant @type Number */\r
-    N: 78,\r
-    /** Key constant @type Number */\r
-    O: 79,\r
-    /** Key constant @type Number */\r
-    P: 80,\r
-    /** Key constant @type Number */\r
-    Q: 81,\r
-    /** Key constant @type Number */\r
-    R: 82,\r
-    /** Key constant @type Number */\r
-    S: 83,\r
-    /** Key constant @type Number */\r
-    T: 84,\r
-    /** Key constant @type Number */\r
-    U: 85,\r
-    /** Key constant @type Number */\r
-    V: 86,\r
-    /** Key constant @type Number */\r
-    W: 87,\r
-    /** Key constant @type Number */\r
-    X: 88,\r
-    /** Key constant @type Number */\r
-    Y: 89,\r
-    /** Key constant @type Number */\r
-    Z: 90,\r
-    /** Key constant @type Number */\r
-    CONTEXT_MENU: 93,\r
-    /** Key constant @type Number */\r
-    NUM_ZERO: 96,\r
-    /** Key constant @type Number */\r
-    NUM_ONE: 97,\r
-    /** Key constant @type Number */\r
-    NUM_TWO: 98,\r
-    /** Key constant @type Number */\r
-    NUM_THREE: 99,\r
-    /** Key constant @type Number */\r
-    NUM_FOUR: 100,\r
-    /** Key constant @type Number */\r
-    NUM_FIVE: 101,\r
-    /** Key constant @type Number */\r
-    NUM_SIX: 102,\r
-    /** Key constant @type Number */\r
-    NUM_SEVEN: 103,\r
-    /** Key constant @type Number */\r
-    NUM_EIGHT: 104,\r
-    /** Key constant @type Number */\r
-    NUM_NINE: 105,\r
-    /** Key constant @type Number */\r
-    NUM_MULTIPLY: 106,\r
-    /** Key constant @type Number */\r
-    NUM_PLUS: 107,\r
-    /** Key constant @type Number */\r
-    NUM_MINUS: 109,\r
-    /** Key constant @type Number */\r
-    NUM_PERIOD: 110,\r
-    /** Key constant @type Number */\r
-    NUM_DIVISION: 111,\r
-    /** Key constant @type Number */\r
-    F1: 112,\r
-    /** Key constant @type Number */\r
-    F2: 113,\r
-    /** Key constant @type Number */\r
-    F3: 114,\r
-    /** Key constant @type Number */\r
-    F4: 115,\r
-    /** Key constant @type Number */\r
-    F5: 116,\r
-    /** Key constant @type Number */\r
-    F6: 117,\r
-    /** Key constant @type Number */\r
-    F7: 118,\r
-    /** Key constant @type Number */\r
-    F8: 119,\r
-    /** Key constant @type Number */\r
-    F9: 120,\r
-    /** Key constant @type Number */\r
-    F10: 121,\r
-    /** Key constant @type Number */\r
-    F11: 122,\r
-    /** Key constant @type Number */\r
-    F12: 123,  \r
-    \r
-    /** @private */\r
-    isNavKeyPress : function(){\r
-        var me = this,\r
-               k = this.normalizeKey(me.keyCode);              \r
-        return (k >= 33 && k <= 40) ||  // Page Up/Down, End, Home, Left, Up, Right, Down\r
-               k == me.RETURN ||\r
-               k == me.TAB ||\r
-               k == me.ESC;\r
-    },\r
+    /// There is some jquery work around stuff here that isn't needed in Ext Core.\r
+    function addListener(el, ename, fn, task, wrap, scope){\r
+        el = Ext.getDom(el);\r
+        var id = getId(el),\r
+            es = Ext.elCache[id].events,\r
+            wfn;\r
+\r
+        wfn = E.on(el, ename, wrap);\r
+        es[ename] = es[ename] || [];\r
+\r
+        /* 0 = Original Function,\r
+           1 = Event Manager Wrapped Function,\r
+           2 = Scope,\r
+           3 = Adapter Wrapped Function,\r
+           4 = Buffered Task\r
+        */\r
+        es[ename].push([fn, wrap, scope, wfn, task]);\r
 \r
-    isSpecialKey : function(){\r
-        var k = this.normalizeKey(this.keyCode);\r
-        return (this.type == 'keypress' && this.ctrlKey) ||\r
-               this.isNavKeyPress() ||\r
-        (k == this.BACKSPACE) || // Backspace\r
-               (k >= 16 && k <= 20) || // Shift, Ctrl, Alt, Pause, Caps Lock\r
-               (k >= 44 && k <= 45);   // Print Screen, Insert\r
-    },\r
-       \r
-       getPoint : function(){\r
-           return new Ext.lib.Point(this.xy[0], this.xy[1]);\r
-       },\r
+        // this is a workaround for jQuery and should somehow be removed from Ext Core in the future\r
+        // without breaking ExtJS.\r
 \r
-    /**\r
-     * Returns true if the control, meta, shift or alt key was pressed during this event.\r
-     * @return {Boolean}\r
-     */\r
-    hasModifier : function(){\r
-        return ((this.ctrlKey || this.altKey) || this.shiftKey);\r
-    }\r
-});/**\r
- * @class Ext.Element\r
- * <p>Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.</p>\r
- * <p>All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.</p>\r
- * <p>Note that the events documented in this class are not Ext events, they encapsulate browser events. To\r
- * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older\r
- * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.</p>\r
- * Usage:<br>\r
-<pre><code>\r
-// by id\r
-var el = Ext.get("my-div");\r
+        // workaround for jQuery\r
+        if(el.addEventListener && ename == "mousewheel"){\r
+            var args = ["DOMMouseScroll", wrap, false];\r
+            el.addEventListener.apply(el, args);\r
+            Ext.EventManager.addListener(WINDOW, 'unload', function(){\r
+                el.removeEventListener.apply(el, args);\r
+            });\r
+        }\r
 \r
-// by DOM element reference\r
-var el = Ext.get(myDivElement);\r
-</code></pre>\r
- * <b>Animations</b><br />\r
- * <p>When an element is manipulated, by default there is no animation.</p>\r
- * <pre><code>\r
-var el = Ext.get("my-div");\r
+        // fix stopped mousedowns on the document\r
+        if(el == DOC && ename == "mousedown"){\r
+            Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);\r
+        }\r
+    };\r
 \r
-// no animation\r
-el.setWidth(100);\r
- * </code></pre>\r
- * <p>Many of the functions for manipulating an element have an optional "animate" parameter.  This\r
- * parameter can be specified as boolean (<tt>true</tt>) for default animation effects.</p>\r
- * <pre><code>\r
-// default animation\r
-el.setWidth(100, true);\r
- * </code></pre>\r
- * \r
- * <p>To configure the effects, an object literal with animation options to use as the Element animation\r
- * configuration object can also be specified. Note that the supported Element animation configuration\r
- * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects.  The supported\r
- * Element animation configuration options are:</p>\r
-<pre>\r
-Option    Default   Description\r
---------- --------  ---------------------------------------------\r
-{@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds\r
-{@link Ext.Fx#easing easing}    easeOut   The easing method\r
-{@link Ext.Fx#callback callback}  none      A function to execute when the anim completes\r
-{@link Ext.Fx#scope scope}     this      The scope (this) of the callback function\r
-</pre>\r
- * \r
- * <pre><code>\r
-// Element animation options object\r
-var opt = {\r
-    {@link Ext.Fx#duration duration}: 1,\r
-    {@link Ext.Fx#easing easing}: 'elasticIn',\r
-    {@link Ext.Fx#callback callback}: this.foo,\r
-    {@link Ext.Fx#scope scope}: this\r
-};\r
-// animation with some options set\r
-el.setWidth(100, opt);\r
- * </code></pre>\r
- * <p>The Element animation object being used for the animation will be set on the options\r
- * object as "anim", which allows you to stop or manipulate the animation. Here is an example:</p>\r
- * <pre><code>\r
-// using the "anim" property to get the Anim object\r
-if(opt.anim.isAnimated()){\r
-    opt.anim.stop();\r
-}\r
- * </code></pre>\r
- * <p>Also see the <tt>{@link #animate}</tt> method for another animation technique.</p>\r
- * <p><b> Composite (Collections of) Elements</b></p>\r
- * <p>For working with collections of Elements, see {@link Ext.CompositeElement}</p>\r
- * @constructor Create a new Element directly.\r
- * @param {String/HTMLElement} element\r
- * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class).\r
- */\r
-(function(){\r
-var DOC = document;\r
+    function fireDocReady(){\r
+        if(!docReadyState){\r
+            Ext.isReady = docReadyState = true;\r
+            if(docReadyProcId){\r
+                clearInterval(docReadyProcId);\r
+            }\r
+            if(Ext.isGecko || Ext.isOpera) {\r
+                DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false);\r
+            }\r
+            if(Ext.isIE){\r
+                var defer = DOC.getElementById(IEDEFERED);\r
+                if(defer){\r
+                    defer.onreadystatechange = null;\r
+                    defer.parentNode.removeChild(defer);\r
+                }\r
+            }\r
+            if(docReadyEvent){\r
+                docReadyEvent.fire();\r
+                docReadyEvent.listeners = []; // clearListeners no longer compatible.  Force single: true?\r
+            }\r
+        }\r
+    };\r
 \r
-Ext.Element = function(element, forceNew){\r
-    var dom = typeof element == "string" ?\r
-              DOC.getElementById(element) : element,\r
-        id;\r
+    function initDocReady(){\r
+        var COMPLETE = "complete";\r
+\r
+        docReadyEvent = new Ext.util.Event();\r
+        if (Ext.isGecko || Ext.isOpera) {\r
+            DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false);\r
+        } else if (Ext.isIE){\r
+            DOC.write("<s"+'cript id=' + IEDEFERED + ' defer="defer" src="/'+'/:"></s'+"cript>");\r
+            DOC.getElementById(IEDEFERED).onreadystatechange = function(){\r
+                if(this.readyState == COMPLETE){\r
+                    fireDocReady();\r
+                }\r
+            };\r
+        } else if (Ext.isWebKit){\r
+            docReadyProcId = setInterval(function(){\r
+                if(DOC.readyState == COMPLETE) {\r
+                    fireDocReady();\r
+                 }\r
+            }, 10);\r
+        }\r
+        // no matter what, make sure it fires on load\r
+        E.on(WINDOW, "load", fireDocReady);\r
+    };\r
 \r
-    if(!dom) return null;\r
+    function createTargeted(h, o){\r
+        return function(){\r
+            var args = Ext.toArray(arguments);\r
+            if(o.target == Ext.EventObject.setEvent(args[0]).target){\r
+                h.apply(this, args);\r
+            }\r
+        };\r
+    };\r
 \r
-    id = dom.id;\r
+    function createBuffered(h, o, task){\r
+        return function(e){\r
+            // create new event object impl so new events don't wipe out properties\r
+            task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]);\r
+        };\r
+    };\r
 \r
-    if(!forceNew && id && Ext.Element.cache[id]){ // element object already exists\r
-        return Ext.Element.cache[id];\r
-    }\r
+    function createSingle(h, el, ename, fn, scope){\r
+        return function(e){\r
+            Ext.EventManager.removeListener(el, ename, fn, scope);\r
+            h(e);\r
+        };\r
+    };\r
 \r
-    /**\r
-     * The DOM element\r
-     * @type HTMLElement\r
-     */\r
-    this.dom = dom;\r
+    function createDelayed(h, o, fn){\r
+        return function(e){\r
+            var task = new Ext.util.DelayedTask(h);\r
+            if(!fn.tasks) {\r
+                fn.tasks = [];\r
+            }\r
+            fn.tasks.push(task);\r
+            task.delay(o.delay || 10, h, null, [new Ext.EventObjectImpl(e)]);\r
+        };\r
+    };\r
 \r
-    /**\r
-     * The DOM element ID\r
-     * @type String\r
-     */\r
-    this.id = id || Ext.id(dom);\r
-};\r
+    function listen(element, ename, opt, fn, scope){\r
+        var o = !Ext.isObject(opt) ? {} : opt,\r
+            el = Ext.getDom(element), task;\r
 \r
-var D = Ext.lib.Dom,\r
-    DH = Ext.DomHelper,\r
-    E = Ext.lib.Event,\r
-    A = Ext.lib.Anim,\r
-    El = Ext.Element;\r
+        fn = fn || o.fn;\r
+        scope = scope || o.scope;\r
 \r
-El.prototype = {\r
-    /**\r
-     * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function)\r
-     * @param {Object} o The object with the attributes\r
-     * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos.\r
-     * @return {Ext.Element} this\r
-     */\r
-    set : function(o, useSet){\r
-        var el = this.dom,\r
-            attr,\r
-            val;        \r
-       \r
-        for(attr in o){\r
-            val = o[attr];\r
-            if (attr != "style" && !Ext.isFunction(val)) {\r
-                if (attr == "cls" ) {\r
-                    el.className = val;\r
-                } else if (o.hasOwnProperty(attr)) {\r
-                    if (useSet || !!el.setAttribute) el.setAttribute(attr, val);\r
-                    else el[attr] = val;\r
+        if(!el){\r
+            throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.';\r
+        }\r
+        function h(e){\r
+            // prevent errors while unload occurring\r
+            if(!Ext){// !window[xname]){  ==> can't we do this?\r
+                return;\r
+            }\r
+            e = Ext.EventObject.setEvent(e);\r
+            var t;\r
+            if (o.delegate) {\r
+                if(!(t = e.getTarget(o.delegate, el))){\r
+                    return;\r
                 }\r
+            } else {\r
+                t = e.target;\r
+            }\r
+            if (o.stopEvent) {\r
+                e.stopEvent();\r
+            }\r
+            if (o.preventDefault) {\r
+               e.preventDefault();\r
+            }\r
+            if (o.stopPropagation) {\r
+                e.stopPropagation();\r
+            }\r
+            if (o.normalized) {\r
+                e = e.browserEvent;\r
             }\r
+\r
+            fn.call(scope || el, e, t, o);\r
+        };\r
+        if(o.target){\r
+            h = createTargeted(h, o);\r
         }\r
-        if(o.style){\r
-            Ext.DomHelper.applyStyles(el, o.style);\r
+        if(o.delay){\r
+            h = createDelayed(h, o, fn);\r
+        }\r
+        if(o.single){\r
+            h = createSingle(h, el, ename, fn, scope);\r
+        }\r
+        if(o.buffer){\r
+            task = new Ext.util.DelayedTask(h);\r
+            h = createBuffered(h, o, task);\r
         }\r
-        return this;\r
-    },\r
-    \r
-//  Mouse events\r
-    /**\r
-     * @event click\r
-     * Fires when a mouse click is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event dblclick\r
-     * Fires when a mouse double click is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mousedown\r
-     * Fires when a mousedown is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mouseup\r
-     * Fires when a mouseup is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mouseover\r
-     * Fires when a mouseover is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mousemove\r
-     * Fires when a mousemove is detected with the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mouseout\r
-     * Fires when a mouseout is detected with the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mouseenter\r
-     * Fires when the mouse enters the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event mouseleave\r
-     * Fires when the mouse leaves the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    \r
-//  Keyboard events\r
-    /**\r
-     * @event keypress\r
-     * Fires when a keypress is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event keydown\r
-     * Fires when a keydown is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event keyup\r
-     * Fires when a keyup is detected within the element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-\r
-\r
-//  HTML frame/object events\r
-    /**\r
-     * @event load\r
-     * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event unload\r
-     * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event abort\r
-     * Fires when an object/image is stopped from loading before completely loaded.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event error\r
-     * Fires when an object/image/frame cannot be loaded properly.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event resize\r
-     * Fires when a document view is resized.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event scroll\r
-     * Fires when a document view is scrolled.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
 \r
-//  Form events\r
-    /**\r
-     * @event select\r
-     * Fires when a user selects some text in a text field, including input and textarea.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event change\r
-     * Fires when a control loses the input focus and its value has been modified since gaining focus.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event submit\r
-     * Fires when a form is submitted.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event reset\r
-     * Fires when a form is reset.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event focus\r
-     * Fires when an element receives focus either via the pointing device or by tab navigation.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event blur\r
-     * Fires when an element loses focus either via the pointing device or by tabbing navigation.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
+        addListener(el, ename, fn, task, h, scope);\r
+        return h;\r
+    };\r
 \r
-//  User Interface events\r
-    /**\r
-     * @event DOMFocusIn\r
-     * Where supported. Similar to HTML focus event, but can be applied to any focusable element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMFocusOut\r
-     * Where supported. Similar to HTML blur event, but can be applied to any focusable element.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMActivate\r
-     * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
+    var pub = {\r
+        /**\r
+         * Appends an event handler to an element.  The shorthand version {@link #on} is equivalent.  Typically you will\r
+         * use {@link Ext.Element#addListener} directly on an Element in favor of calling this version.\r
+         * @param {String/HTMLElement} el The html element or id to assign the event handler to.\r
+         * @param {String} eventName The name of the event to listen for.\r
+         * @param {Function} handler The handler function the event invokes. This function is passed\r
+         * the following parameters:<ul>\r
+         * <li>evt : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>\r
+         * <li>t : Element<div class="sub-desc">The {@link Ext.Element Element} which was the target of the event.\r
+         * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>\r
+         * <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li>\r
+         * </ul>\r
+         * @param {Object} scope (optional) The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.\r
+         * @param {Object} options (optional) An object containing handler configuration properties.\r
+         * This may contain any of the following properties:<ul>\r
+         * <li>scope : Object<div class="sub-desc">The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.</div></li>\r
+         * <li>delegate : String<div class="sub-desc">A simple selector to filter the target or look for a descendant of the target</div></li>\r
+         * <li>stopEvent : Boolean<div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>\r
+         * <li>preventDefault : Boolean<div class="sub-desc">True to prevent the default action</div></li>\r
+         * <li>stopPropagation : Boolean<div class="sub-desc">True to prevent event propagation</div></li>\r
+         * <li>normalized : Boolean<div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>\r
+         * <li>delay : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after te event fires.</div></li>\r
+         * <li>single : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>\r
+         * <li>buffer : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed\r
+         * by the specified number of milliseconds. If the event fires again within that time, the original\r
+         * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>\r
+         * <li>target : Element<div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>\r
+         * </ul><br>\r
+         * <p>See {@link Ext.Element#addListener} for examples of how to use these options.</p>\r
+         */\r
+        addListener : function(element, eventName, fn, scope, options){\r
+            if(Ext.isObject(eventName)){\r
+                var o = eventName, e, val;\r
+                for(e in o){\r
+                    val = o[e];\r
+                    if(!propRe.test(e)){\r
+                        if(Ext.isFunction(val)){\r
+                            // shared options\r
+                            listen(element, e, o, val, o.scope);\r
+                        }else{\r
+                            // individual options\r
+                            listen(element, e, val);\r
+                        }\r
+                    }\r
+                }\r
+            } else {\r
+                listen(element, eventName, options, fn, scope);\r
+            }\r
+        },\r
 \r
-//  DOM Mutation events\r
-    /**\r
-     * @event DOMSubtreeModified\r
-     * Where supported. Fires when the subtree is modified.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMNodeInserted\r
-     * Where supported. Fires when a node has been added as a child of another node.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMNodeRemoved\r
-     * Where supported. Fires when a descendant node of the element is removed.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMNodeRemovedFromDocument\r
-     * Where supported. Fires when a node is being removed from a document.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMNodeInsertedIntoDocument\r
-     * Where supported. Fires when a node is being inserted into a document.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMAttrModified\r
-     * Where supported. Fires when an attribute has been modified.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
-    /**\r
-     * @event DOMCharacterDataModified\r
-     * Where supported. Fires when the character data has been modified.\r
-     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.\r
-     * @param {HtmlElement} t The target of the event.\r
-     * @param {Object} o The options configuration passed to the {@link #addListener} call.\r
-     */\r
+        /**\r
+         * Removes an event handler from an element.  The shorthand version {@link #un} is equivalent.  Typically\r
+         * you will use {@link Ext.Element#removeListener} directly on an Element in favor of calling this version.\r
+         * @param {String/HTMLElement} el The id or html element from which to remove the listener.\r
+         * @param {String} eventName The name of the event.\r
+         * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>\r
+         * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,\r
+         * then this must refer to the same object.\r
+         */\r
+        removeListener : function(el, eventName, fn, scope){\r
+            el = Ext.getDom(el);\r
+            var id = getId(el),\r
+                f = el && (Ext.elCache[id].events)[eventName] || [],\r
+                wrap, i, l, k, len, fnc;\r
+\r
+            for (i = 0, len = f.length; i < len; i++) {\r
+\r
+                /* 0 = Original Function,\r
+                   1 = Event Manager Wrapped Function,\r
+                   2 = Scope,\r
+                   3 = Adapter Wrapped Function,\r
+                   4 = Buffered Task\r
+                */\r
+                if (Ext.isArray(fnc = f[i]) && fnc[0] == fn && (!scope || fnc[2] == scope)) {\r
+                    if(fnc[4]) {\r
+                        fnc[4].cancel();\r
+                    }\r
+                    k = fn.tasks && fn.tasks.length;\r
+                    if(k) {\r
+                        while(k--) {\r
+                            fn.tasks[k].cancel();\r
+                        }\r
+                        delete fn.tasks;\r
+                    }\r
+                    wrap = fnc[1];\r
+                    E.un(el, eventName, E.extAdapter ? fnc[3] : wrap);\r
 \r
-    /**\r
-     * The default unit to append to CSS values where a unit isn't provided (defaults to px).\r
-     * @type String\r
-     */\r
-    defaultUnit : "px",\r
+                    // jQuery workaround that should be removed from Ext Core\r
+                    if(wrap && el.addEventListener && eventName == "mousewheel"){\r
+                        el.removeEventListener("DOMMouseScroll", wrap, false);\r
+                    }\r
 \r
-    /**\r
-     * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child)\r
-     * @param {String} selector The simple selector to test\r
-     * @return {Boolean} True if this element matches the selector, else false\r
-     */\r
-    is : function(simpleSelector){\r
-        return Ext.DomQuery.is(this.dom, simpleSelector);\r
-    },\r
+                    // fix stopped mousedowns on the document\r
+                    if(wrap && el == DOC && eventName == "mousedown"){\r
+                        Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap);\r
+                    }\r
 \r
-    /**\r
-     * Tries to focus the element. Any exceptions are caught and ignored.\r
-     * @param {Number} defer (optional) Milliseconds to defer the focus\r
-     * @return {Ext.Element} this\r
-     */\r
-    focus : function(defer, /* private */ dom) {\r
-        var me = this,\r
-            dom = dom || me.dom;\r
-        try{\r
-            if(Number(defer)){\r
-                me.focus.defer(defer, null, [null, dom]);\r
-            }else{\r
-                dom.focus();\r
+                    f.splice(i, 1);\r
+                    if (f.length === 0) {\r
+                        delete Ext.elCache[id].events[eventName];\r
+                    }\r
+                    for (k in Ext.elCache[id].events) {\r
+                        return false;\r
+                    }\r
+                    Ext.elCache[id].events = {};\r
+                    return false;\r
+                }\r
             }\r
-        }catch(e){}\r
-        return me;\r
-    },\r
+        },\r
 \r
-    /**\r
-     * Tries to blur the element. Any exceptions are caught and ignored.\r
-     * @return {Ext.Element} this\r
-     */\r
-    blur : function() {\r
-        try{\r
-            this.dom.blur();\r
-        }catch(e){}\r
-        return this;\r
-    },\r
+        /**\r
+         * Removes all event handers from an element.  Typically you will use {@link Ext.Element#removeAllListeners}\r
+         * directly on an Element in favor of calling this version.\r
+         * @param {String/HTMLElement} el The id or html element from which to remove all event handlers.\r
+         */\r
+        removeAll : function(el){\r
+            el = Ext.getDom(el);\r
+            var id = getId(el),\r
+                ec = Ext.elCache[id] || {},\r
+                es = ec.events || {},\r
+                f, i, len, ename, fn, k, wrap;\r
+\r
+            for(ename in es){\r
+                if(es.hasOwnProperty(ename)){\r
+                    f = es[ename];\r
+                    /* 0 = Original Function,\r
+                       1 = Event Manager Wrapped Function,\r
+                       2 = Scope,\r
+                       3 = Adapter Wrapped Function,\r
+                       4 = Buffered Task\r
+                    */\r
+                    for (i = 0, len = f.length; i < len; i++) {\r
+                        fn = f[i];\r
+                        if(fn[4]) {\r
+                            fn[4].cancel();\r
+                        }\r
+                        if(fn[0].tasks && (k = fn[0].tasks.length)) {\r
+                            while(k--) {\r
+                                fn[0].tasks[k].cancel();\r
+                            }\r
+                            delete fn.tasks;\r
+                        }\r
+                        wrap =  fn[1];\r
+                        E.un(el, ename, E.extAdapter ? fn[3] : wrap);\r
 \r
-    /**\r
-     * Returns the value of the "value" attribute\r
-     * @param {Boolean} asNumber true to parse the value as a number\r
-     * @return {String/Number}\r
-     */\r
-    getValue : function(asNumber){\r
-        var val = this.dom.value;\r
-        return asNumber ? parseInt(val, 10) : val;\r
-    },\r
+                        // jQuery workaround that should be removed from Ext Core\r
+                        if(el.addEventListener && wrap && ename == "mousewheel"){\r
+                            el.removeEventListener("DOMMouseScroll", wrap, false);\r
+                        }\r
 \r
-    /**\r
-     * Appends an event handler to this element.  The shorthand version {@link #on} is equivalent.\r
-     * @param {String} eventName The type of event to handle\r
-     * @param {Function} fn The handler function the event invokes. This function is passed\r
-     * the following parameters:<ul>\r
-     * <li><b>evt</b> : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>\r
-     * <li><b>el</b> : Element<div class="sub-desc">The {@link Ext.Element Element} which was the target of the event.\r
-     * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>\r
-     * <li><b>o</b> : Object<div class="sub-desc">The options object from the addListener call.</div></li>\r
-     * </ul>\r
-     * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.\r
-     * <b>If omitted, defaults to this Element.</b>.\r
-     * @param {Object} options (optional) An object containing handler configuration properties.\r
-     * This may contain any of the following properties:<ul>\r
-     * <li><b>scope</b> Object : <div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.\r
-     * <b>If omitted, defaults to this Element.</b></div></li>\r
-     * <li><b>delegate</b> String: <div class="sub-desc">A simple selector to filter the target or look for a descendant of the target. See below for additional details.</div></li>\r
-     * <li><b>stopEvent</b> Boolean: <div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>\r
-     * <li><b>preventDefault</b> Boolean: <div class="sub-desc">True to prevent the default action</div></li>\r
-     * <li><b>stopPropagation</b> Boolean: <div class="sub-desc">True to prevent event propagation</div></li>\r
-     * <li><b>normalized</b> Boolean: <div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>\r
-     * <li><b>target</b> Ext.Element: <div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>\r
-     * <li><b>delay</b> Number: <div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>\r
-     * <li><b>single</b> Boolean: <div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>\r
-     * <li><b>buffer</b> Number: <div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed\r
-     * by the specified number of milliseconds. If the event fires again within that time, the original\r
-     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>\r
-     * </ul><br>\r
-     * <p>\r
-     * <b>Combining Options</b><br>\r
-     * In the following examples, the shorthand form {@link #on} is used rather than the more verbose\r
-     * addListener.  The two are equivalent.  Using the options argument, it is possible to combine different\r
-     * types of listeners:<br>\r
-     * <br>\r
-     * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the\r
-     * options object. The options object is available as the third parameter in the handler function.<div style="margin: 5px 20px 20px;">\r
-     * Code:<pre><code>\r
-el.on('click', this.onClick, this, {\r
-    single: true,\r
-    delay: 100,\r
-    stopEvent : true,\r
-    forumId: 4\r
-});</code></pre></p>\r
-     * <p>\r
-     * <b>Attaching multiple handlers in 1 call</b><br>\r
-     * The method also allows for a single argument to be passed which is a config object containing properties\r
-     * which specify multiple handlers.</p>\r
-     * <p>\r
-     * Code:<pre><code>\r
-el.on({\r
-    'click' : {\r
-        fn: this.onClick,\r
-        scope: this,\r
-        delay: 100\r
-    },\r
-    'mouseover' : {\r
-        fn: this.onMouseOver,\r
-        scope: this\r
-    },\r
-    'mouseout' : {\r
-        fn: this.onMouseOut,\r
-        scope: this\r
-    }\r
-});</code></pre>\r
-     * <p>\r
-     * Or a shorthand syntax:<br>\r
-     * Code:<pre><code></p>\r
-el.on({\r
-    'click' : this.onClick,\r
-    'mouseover' : this.onMouseOver,\r
-    'mouseout' : this.onMouseOut,\r
-    scope: this\r
-});\r
-     * </code></pre></p>\r
-     * <p><b>delegate</b></p>\r
-     * <p>This is a configuration option that you can pass along when registering a handler for\r
-     * an event to assist with event delegation. Event delegation is a technique that is used to\r
-     * reduce memory consumption and prevent exposure to memory-leaks. By registering an event\r
-     * for a container element as opposed to each element within a container. By setting this\r
-     * configuration option to a simple selector, the target element will be filtered to look for\r
-     * a descendant of the target.\r
-     * For example:<pre><code>\r
-// using this markup:\r
-&lt;div id='elId'>\r
-    &lt;p id='p1'>paragraph one&lt;/p>\r
-    &lt;p id='p2' class='clickable'>paragraph two&lt;/p>\r
-    &lt;p id='p3'>paragraph three&lt;/p>\r
-&lt;/div>\r
-// utilize event delegation to registering just one handler on the container element: \r
-el = Ext.get('elId');\r
-el.on(\r
-    'click',\r
-    function(e,t) {\r
-        // handle click\r
-        console.info(t.id); // 'p2'\r
-    },\r
-    this,\r
-    {\r
-        // filter the target element to be a descendant with the class 'clickable'\r
-        delegate: '.clickable' \r
-    }\r
-);\r
-     * </code></pre></p>\r
-     * @return {Ext.Element} this\r
-     */\r
-    addListener : function(eventName, fn, scope, options){\r
-        Ext.EventManager.on(this.dom,  eventName, fn, scope || this, options);\r
-        return this;\r
-    },\r
+                        // fix stopped mousedowns on the document\r
+                        if(wrap && el == DOC &&  ename == "mousedown"){\r
+                            Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap);\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+            if (Ext.elCache[id]) {\r
+                Ext.elCache[id].events = {};\r
+            }\r
+        },\r
 \r
-    /**\r
-     * Removes an event handler from this element.  The shorthand version {@link #un} is equivalent.\r
-     * <b>Note</b>: if a <i>scope</i> was explicitly specified when {@link #addListener adding} the\r
-     * listener, the same scope must be specified here.\r
-     * Example:\r
-     * <pre><code>\r
-el.removeListener('click', this.handlerFn);\r
-// or\r
-el.un('click', this.handlerFn);\r
-</code></pre>\r
-     * @param {String} eventName the type of event to remove\r
-     * @param {Function} fn the method the event invokes\r
-     * @param {Object} scope (optional) The scope (The <tt>this</tt> reference) of the handler function. Defaults\r
-     * to this Element.\r
-     * @return {Ext.Element} this\r
-     */\r
-    removeListener : function(eventName, fn, scope){\r
-        Ext.EventManager.removeListener(this.dom,  eventName, fn, scope || this);\r
-        return this;\r
-    },\r
+        getListeners : function(el, eventName) {\r
+            el = Ext.getDom(el);\r
+            var id = getId(el),\r
+                ec = Ext.elCache[id] || {},\r
+                es = ec.events || {},\r
+                results = [];\r
+            if (es && es[eventName]) {\r
+                return es[eventName];\r
+            } else {\r
+                return null;\r
+            }\r
+        },\r
 \r
-    /**\r
-     * Removes all previous added listeners from this element\r
-     * @return {Ext.Element} this\r
-     */\r
-    removeAllListeners : function(){\r
-        Ext.EventManager.removeAll(this.dom);\r
-        return this;\r
-    },\r
+        purgeElement : function(el, recurse, eventName) {\r
+            el = Ext.getDom(el);\r
+            var id = getId(el),\r
+                ec = Ext.elCache[id] || {},\r
+                es = ec.events || {},\r
+                i, f, len;\r
+            if (eventName) {\r
+                if (es && es.hasOwnProperty(eventName)) {\r
+                    f = es[eventName];\r
+                    for (i = 0, len = f.length; i < len; i++) {\r
+                        Ext.EventManager.removeListener(el, eventName, f[i][0]);\r
+                    }\r
+                }\r
+            } else {\r
+                Ext.EventManager.removeAll(el);\r
+            }\r
+            if (recurse && el && el.childNodes) {\r
+                for (i = 0, len = el.childNodes.length; i < len; i++) {\r
+                    Ext.EventManager.purgeElement(el.childNodes[i], recurse, eventName);\r
+                }\r
+            }\r
+        },\r
 \r
-    /**\r
-     * @private Test if size has a unit, otherwise appends the default\r
-     */\r
-    addUnits : function(size){\r
-        if(size === "" || size == "auto" || size === undefined){\r
-            size = size || '';\r
-        } else if(!isNaN(size) || !unitPattern.test(size)){\r
-            size = size + (this.defaultUnit || 'px');\r
-        }\r
-        return size;\r
-    },\r
-\r
-    /**\r
-     * <p>Updates the <a href="http://developer.mozilla.org/en/DOM/element.innerHTML">innerHTML</a> of this Element\r
-     * from a specified URL. Note that this is subject to the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">Same Origin Policy</a></p>\r
-     * <p>Updating innerHTML of an element will <b>not</b> execute embedded <tt>&lt;script></tt> elements. This is a browser restriction.</p>\r
-     * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying\r
-     * exactly how to request the HTML.\r
-     * @return {Ext.Element} this\r
-     */\r
-    load : function(url, params, cb){\r
-        Ext.Ajax.request(Ext.apply({\r
-            params: params,\r
-            url: url.url || url,\r
-            callback: cb,\r
-            el: this.dom,\r
-            indicatorText: url.indicatorText || ''\r
-        }, Ext.isObject(url) ? url : {}));\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Tests various css rules/browsers to determine if this element uses a border box\r
-     * @return {Boolean}\r
-     */\r
-    isBorderBox : function(){\r
-        return noBoxAdjust[(this.dom.tagName || "").toLowerCase()] || Ext.isBorderBox;\r
-    },\r
-\r
-    /**\r
-     * Removes this element from the DOM and deletes it from the cache\r
-     */\r
-    remove : function(){\r
-        var me = this,\r
-            dom = me.dom;\r
-        \r
-        me.removeAllListeners();\r
-        delete El.cache[dom.id];\r
-        delete El.dataCache[dom.id]\r
-        Ext.removeNode(dom);\r
-    },\r
-\r
-    /**\r
-     * Sets up event handlers to call the passed functions when the mouse is moved into and out of the Element.\r
-     * @param {Function} overFn The function to call when the mouse enters the Element.\r
-     * @param {Function} outFn The function to call when the mouse leaves the Element.\r
-     * @param {Object} scope (optional) The scope (<tt>this</tt> reference) in which the functions are executed. Defaults to the Element's DOM element.\r
-     * @param {Object} options (optional) Options for the listener. See {@link Ext.util.Observable#addListener the <tt>options</tt> parameter}.\r
-     * @return {Ext.Element} this\r
-     */\r
-    hover : function(overFn, outFn, scope, options){\r
-        var me = this;\r
-        me.on('mouseenter', overFn, scope || me.dom, options);\r
-        me.on('mouseleave', outFn, scope || me.dom, options);\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Returns true if this element is an ancestor of the passed element\r
-     * @param {HTMLElement/String} el The element to check\r
-     * @return {Boolean} True if this element is an ancestor of el, else false\r
-     */\r
-    contains : function(el){\r
-        return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el);\r
-    },\r
-\r
-    /**\r
-     * Returns the value of a namespaced attribute from the element's underlying DOM node.\r
-     * @param {String} namespace The namespace in which to look for the attribute\r
-     * @param {String} name The attribute name\r
-     * @return {String} The attribute value\r
-     * @deprecated\r
-     */\r
-    getAttributeNS : function(ns, name){\r
-        return this.getAttribute(name, ns); \r
-    },\r
-    \r
-    /**\r
-     * Returns the value of an attribute from the element's underlying DOM node.\r
-     * @param {String} name The attribute name\r
-     * @param {String} namespace (optional) The namespace in which to look for the attribute\r
-     * @return {String} The attribute value\r
-     */\r
-    getAttribute : Ext.isIE ? function(name, ns){\r
-        var d = this.dom,\r
-            type = typeof d[ns + ":" + name];\r
-\r
-        if(['undefined', 'unknown'].indexOf(type) == -1){\r
-            return d[ns + ":" + name];\r
+        _unload : function() {\r
+            var el;\r
+            for (el in Ext.elCache) {\r
+                Ext.EventManager.removeAll(el);\r
+            }\r
+            delete Ext.elCache;\r
+            delete Ext.Element._flyweights;\r
+        },\r
+        /**\r
+         * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be\r
+         * accessed shorthanded as Ext.onReady().\r
+         * @param {Function} fn The method the event invokes.\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.\r
+         * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options\r
+         * <code>{single: true}</code> be used so that the handler is removed on first invocation.\r
+         */\r
+        onDocumentReady : function(fn, scope, options){\r
+            if(docReadyState){ // if it already fired\r
+                docReadyEvent.addListener(fn, scope, options);\r
+                docReadyEvent.fire();\r
+                docReadyEvent.listeners = []; // clearListeners no longer compatible.  Force single: true?\r
+            } else {\r
+                if(!docReadyEvent) initDocReady();\r
+                options = options || {};\r
+                options.delay = options.delay || 1;\r
+                docReadyEvent.addListener(fn, scope, options);\r
+            }\r
         }\r
-        return d[name];\r
-    } : function(name, ns){\r
-        var d = this.dom;\r
-        return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name];\r
-    },\r
-    \r
-    /**\r
-    * Update the innerHTML of this element\r
-    * @param {String} html The new HTML\r
-    * @return {Ext.Element} this\r
-     */\r
-    update : function(html) {\r
-        this.dom.innerHTML = html;\r
-        return this;\r
-    }\r
-};\r
-\r
-var ep = El.prototype;\r
-\r
-El.addMethods = function(o){\r
-   Ext.apply(ep, o);\r
-};\r
-\r
-/**\r
- * Appends an event handler (shorthand for {@link #addListener}).\r
- * @param {String} eventName The type of event to handle\r
- * @param {Function} fn The handler function the event invokes\r
- * @param {Object} scope (optional) The scope (this element) of the handler function\r
- * @param {Object} options (optional) An object containing standard {@link #addListener} options\r
- * @member Ext.Element\r
- * @method on\r
- */\r
-ep.on = ep.addListener;\r
-\r
+    };\r
+     /**\r
+     * Appends an event handler to an element.  Shorthand for {@link #addListener}.\r
+     * @param {String/HTMLElement} el The html element or id to assign the event handler to\r
+     * @param {String} eventName The name of the event to listen for.\r
+     * @param {Function} handler The handler function the event invokes.\r
+     * @param {Object} scope (optional) (<code>this</code> reference) in which the handler function executes. <b>Defaults to the Element</b>.\r
+     * @param {Object} options (optional) An object containing standard {@link #addListener} options\r
+     * @member Ext.EventManager\r
+     * @method on\r
+     */\r
+    pub.on = pub.addListener;\r
+    /**\r
+     * Removes an event handler from an element.  Shorthand for {@link #removeListener}.\r
+     * @param {String/HTMLElement} el The id or html element from which to remove the listener.\r
+     * @param {String} eventName The name of the event.\r
+     * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #on} call.</b>\r
+     * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,\r
+     * then this must refer to the same object.\r
+     * @member Ext.EventManager\r
+     * @method un\r
+     */\r
+    pub.un = pub.removeListener;\r
+\r
+    pub.stoppedMouseDownEvent = new Ext.util.Event();\r
+    return pub;\r
+}();\r
 /**\r
- * Removes an event handler from this element (see {@link #removeListener} for additional notes).\r
- * @param {String} eventName the type of event to remove\r
- * @param {Function} fn the method the event invokes\r
- * @param {Object} scope (optional) The scope (The <tt>this</tt> reference) of the handler function. Defaults\r
- * to this Element.\r
- * @return {Ext.Element} this\r
- * @member Ext.Element\r
- * @method un\r
+  * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Shorthand of {@link Ext.EventManager#onDocumentReady}.\r
+  * @param {Function} fn The method the event invokes.\r
+  * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.\r
+  * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options\r
+  * <code>{single: true}</code> be used so that the handler is removed on first invocation.\r
+  * @member Ext\r
+  * @method onReady\r
  */\r
-ep.un = ep.removeListener;\r
+Ext.onReady = Ext.EventManager.onDocumentReady;\r
 \r
-/**\r
- * true to automatically adjust width and height settings for box-model issues (default to true)\r
- */\r
-ep.autoBoxAdjust = true;\r
 \r
-// private\r
-var unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,\r
-    docEl;\r
+//Initialize doc classes\r
+(function(){\r
 \r
-/**\r
- * @private\r
- */\r
-El.cache = {};\r
-El.dataCache = {};\r
+    var initExtCss = function(){\r
+        // find the body element\r
+        var bd = document.body || document.getElementsByTagName('body')[0];\r
+        if(!bd){ return false; }\r
+        var cls = [' ',\r
+                Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8'))\r
+                : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3')\r
+                : Ext.isOpera ? "ext-opera"\r
+                : Ext.isWebKit ? "ext-webkit" : ""];\r
 \r
-/**\r
- * Retrieves Ext.Element objects.\r
- * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method\r
- * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by\r
- * its ID, use {@link Ext.ComponentMgr#get}.</p>\r
- * <p>Uses simple caching to consistently return the same object. Automatically fixes if an\r
- * object was recreated with the same id via AJAX or DOM.</p>\r
- * @param {Mixed} el The id of the node, a DOM Node or an existing Element.\r
- * @return {Element} The Element object (or null if no matching element was found)\r
- * @static\r
- * @member Ext.Element\r
- * @method get\r
- */\r
-El.get = function(el){\r
-    var ex,\r
-        elm,\r
-        id;\r
-    if(!el){ return null; }\r
-    if (typeof el == "string") { // element id\r
-        if (!(elm = DOC.getElementById(el))) {\r
-            return null;\r
-        }\r
-        if (ex = El.cache[el]) {\r
-            ex.dom = elm;\r
-        } else {\r
-            ex = El.cache[el] = new El(elm);\r
-        }\r
-        return ex;\r
-    } else if (el.tagName) { // dom element\r
-        if(!(id = el.id)){\r
-            id = Ext.id(el);\r
+        if(Ext.isSafari){\r
+            cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4')));\r
+        }else if(Ext.isChrome){\r
+            cls.push("ext-chrome");\r
         }\r
-        if(ex = El.cache[id]){\r
-            ex.dom = el;\r
-        }else{\r
-            ex = El.cache[id] = new El(el);\r
+\r
+        if(Ext.isMac){\r
+            cls.push("ext-mac");\r
         }\r
-        return ex;\r
-    } else if (el instanceof El) {\r
-        if(el != docEl){\r
-            el.dom = DOC.getElementById(el.id) || el.dom; // refresh dom element in case no longer valid,\r
-                                                          // catch case where it hasn't been appended\r
-            El.cache[el.id] = el; // in case it was created directly with Element(), let's cache it\r
+        if(Ext.isLinux){\r
+            cls.push("ext-linux");\r
         }\r
-        return el;\r
-    } else if(el.isComposite) {\r
-        return el;\r
-    } else if(Ext.isArray(el)) {\r
-        return El.select(el);\r
-    } else if(el == DOC) {\r
-        // create a bogus element object representing the document object\r
-        if(!docEl){\r
-            var f = function(){};\r
-            f.prototype = El.prototype;\r
-            docEl = new f();\r
-            docEl.dom = DOC;\r
-        }\r
-        return docEl;\r
-    }\r
-    return null;\r
-};\r
-\r
-// private method for getting and setting element data\r
-El.data = function(el, key, value){\r
-    var c = El.dataCache[el.id];\r
-    if(!c){\r
-        c = El.dataCache[el.id] = {};\r
-    }\r
-    if(arguments.length == 2){\r
-        return c[key];    \r
-    }else{\r
-        c[key] = value;\r
-    }\r
-};\r
-\r
-// private\r
-// Garbage collection - uncache elements/purge listeners on orphaned elements\r
-// so we don't hold a reference and cause the browser to retain them\r
-function garbageCollect(){\r
-    if(!Ext.enableGarbageCollector){\r
-        clearInterval(El.collectorThread);\r
-    } else {\r
-        var eid,\r
-            el,\r
-            d;\r
 \r
-        for(eid in El.cache){\r
-            el = El.cache[eid];\r
-            d = el.dom;\r
-            // -------------------------------------------------------\r
-            // Determining what is garbage:\r
-            // -------------------------------------------------------\r
-            // !d\r
-            // dom node is null, definitely garbage\r
-            // -------------------------------------------------------\r
-            // !d.parentNode\r
-            // no parentNode == direct orphan, definitely garbage\r
-            // -------------------------------------------------------\r
-            // !d.offsetParent && !document.getElementById(eid)\r
-            // display none elements have no offsetParent so we will\r
-            // also try to look it up by it's id. However, check\r
-            // offsetParent first so we don't do unneeded lookups.\r
-            // This enables collection of elements that are not orphans\r
-            // directly, but somewhere up the line they have an orphan\r
-            // parent.\r
-            // -------------------------------------------------------\r
-            if(!d || !d.parentNode || (!d.offsetParent && !DOC.getElementById(eid))){\r
-                delete El.cache[eid];\r
-                if(d && Ext.enableListenerCollection){\r
-                    Ext.EventManager.removeAll(d);\r
-                }\r
+        if(Ext.isStrict || Ext.isBorderBox){ // add to the parent to allow for selectors like ".ext-strict .ext-ie"\r
+            var p = bd.parentNode;\r
+            if(p){\r
+                p.className += Ext.isStrict ? ' ext-strict' : ' ext-border-box';\r
             }\r
         }\r
+        bd.className += cls.join(' ');\r
+        return true;\r
     }\r
-}\r
-El.collectorThreadId = setInterval(garbageCollect, 30000);\r
 \r
-var flyFn = function(){};\r
-flyFn.prototype = El.prototype;\r
-\r
-// dom is optional\r
-El.Flyweight = function(dom){\r
-    this.dom = dom;\r
-};\r
-\r
-El.Flyweight.prototype = new flyFn();\r
-El.Flyweight.prototype.isFlyweight = true;\r
-El._flyweights = {};\r
-\r
-/**\r
- * <p>Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -\r
- * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}</p>\r
- * <p>Use this to make one-time references to DOM elements which are not going to be accessed again either by\r
- * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get}\r
- * will be more appropriate to take advantage of the caching provided by the Ext.Element class.</p>\r
- * @param {String/HTMLElement} el The dom node or id\r
- * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts\r
- * (e.g. internally Ext uses "_global")\r
- * @return {Element} The shared Element object (or null if no matching element was found)\r
- * @member Ext.Element\r
- * @method fly\r
- */\r
-El.fly = function(el, named){\r
-    var ret = null;\r
-    named = named || '_global';\r
-\r
-    if (el = Ext.getDom(el)) {\r
-        (El._flyweights[named] = El._flyweights[named] || new El.Flyweight()).dom = el;\r
-        ret = El._flyweights[named];\r
+    if(!initExtCss()){\r
+        Ext.onReady(initExtCss);\r
     }\r
-    return ret;\r
-};\r
+})();\r
 \r
-/**\r
- * Retrieves Ext.Element objects.\r
- * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method\r
- * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by\r
- * its ID, use {@link Ext.ComponentMgr#get}.</p>\r
- * <p>Uses simple caching to consistently return the same object. Automatically fixes if an\r
- * object was recreated with the same id via AJAX or DOM.</p>\r
- * Shorthand of {@link Ext.Element#get}\r
- * @param {Mixed} el The id of the node, a DOM Node or an existing Element.\r
- * @return {Element} The Element object (or null if no matching element was found)\r
- * @member Ext\r
- * @method get\r
- */\r
-Ext.get = El.get;\r
 \r
 /**\r
- * <p>Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -\r
- * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}</p>\r
- * <p>Use this to make one-time references to DOM elements which are not going to be accessed again either by\r
- * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get}\r
- * will be more appropriate to take advantage of the caching provided by the Ext.Element class.</p>\r
- * @param {String/HTMLElement} el The dom node or id\r
- * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts\r
- * (e.g. internally Ext uses "_global")\r
- * @return {Element} The shared Element object (or null if no matching element was found)\r
- * @member Ext\r
- * @method fly\r
- */\r
-Ext.fly = El.fly;\r
-\r
-// speedy lookup for elements never to box adjust\r
-var noBoxAdjust = Ext.isStrict ? {\r
-    select:1\r
-} : {\r
-    input:1, select:1, textarea:1\r
-};\r
-if(Ext.isIE || Ext.isGecko){\r
-    noBoxAdjust['button'] = 1;\r
+ * @class Ext.EventObject\r
+ * Just as {@link Ext.Element} wraps around a native DOM node, Ext.EventObject\r
+ * wraps the browser's native event-object normalizing cross-browser differences,\r
+ * such as which mouse button is clicked, keys pressed, mechanisms to stop\r
+ * event-propagation along with a method to prevent default actions from taking place.\r
+ * <p>For example:</p>\r
+ * <pre><code>\r
+function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject\r
+    e.preventDefault();\r
+    var target = e.getTarget(); // same as t (the target HTMLElement)\r
+    ...\r
 }\r
+var myDiv = {@link Ext#get Ext.get}("myDiv");  // get reference to an {@link Ext.Element}\r
+myDiv.on(         // 'on' is shorthand for addListener\r
+    "click",      // perform an action on click of myDiv\r
+    handleClick   // reference to the action handler\r
+);\r
+// other methods to do the same:\r
+Ext.EventManager.on("myDiv", 'click', handleClick);\r
+Ext.EventManager.addListener("myDiv", 'click', handleClick);\r
+ </code></pre>\r
+ * @singleton\r
+ */\r
+Ext.EventObject = function(){\r
+    var E = Ext.lib.Event,\r
+        // safari keypress events for special keys return bad keycodes\r
+        safariKeys = {\r
+            3 : 13, // enter\r
+            63234 : 37, // left\r
+            63235 : 39, // right\r
+            63232 : 38, // up\r
+            63233 : 40, // down\r
+            63276 : 33, // page up\r
+            63277 : 34, // page down\r
+            63272 : 46, // delete\r
+            63273 : 36, // home\r
+            63275 : 35  // end\r
+        },\r
+        // normalize button clicks\r
+        btnMap = Ext.isIE ? {1:0,4:1,2:2} :\r
+                (Ext.isWebKit ? {1:0,2:1,3:2} : {0:0,1:1,2:2});\r
 \r
+    Ext.EventObjectImpl = function(e){\r
+        if(e){\r
+            this.setEvent(e.browserEvent || e);\r
+        }\r
+    };\r
 \r
-Ext.EventManager.on(window, 'unload', function(){\r
-    delete El.cache;\r
-    delete El.dataCache;\r
-    delete El._flyweights;\r
-});\r
-})();\r
-/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({    \r
-    /**\r
-     * Stops the specified event(s) from bubbling and optionally prevents the default action\r
-     * @param {String/Array} eventName an event / array of events to stop from bubbling\r
-     * @param {Boolean} preventDefault (optional) true to prevent the default action too\r
-     * @return {Ext.Element} this\r
-     */\r
-    swallowEvent : function(eventName, preventDefault){\r
-           var me = this;\r
-        function fn(e){\r
-            e.stopPropagation();\r
-            if(preventDefault){\r
-                e.preventDefault();\r
+    Ext.EventObjectImpl.prototype = {\r
+           /** @private */\r
+        setEvent : function(e){\r
+            var me = this;\r
+            if(e == me || (e && e.browserEvent)){ // already wrapped\r
+                return e;\r
             }\r
-        }\r
-        if(Ext.isArray(eventName)){            \r
-               Ext.each(eventName, function(e) {\r
-                 me.on(e, fn);\r
-            });\r
-            return me;\r
-        }\r
-        me.on(eventName, fn);\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Create an event handler on this element such that when the event fires and is handled by this element,\r
-     * it will be relayed to another object (i.e., fired again as if it originated from that object instead).\r
-     * @param {String} eventName The type of event to relay\r
-     * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context\r
-     * for firing the relayed event\r
-     */\r
-    relayEvent : function(eventName, observable){\r
-        this.on(eventName, function(e){\r
-            observable.fireEvent(eventName, e);\r
-        });\r
-    },\r
-    \r
-       /**\r
-     * Removes worthless text nodes\r
-     * @param {Boolean} forceReclean (optional) By default the element\r
-     * keeps track if it has been cleaned already so\r
-     * you can call this over and over. However, if you update the element and\r
-     * need to force a reclean, you can pass true.\r
-     */\r
-    clean : function(forceReclean){\r
-        var me = this, \r
-            dom = me.dom,\r
-               n = dom.firstChild, \r
-               ni = -1;\r
-               \r
-           if(Ext.Element.data(dom, 'isCleaned') && forceReclean !== true){\r
-            return me;\r
-        }      \r
-               \r
-           while(n){\r
-               var nx = n.nextSibling;\r
-            if(n.nodeType == 3 && !/\S/.test(n.nodeValue)){\r
-                dom.removeChild(n);\r
+            me.browserEvent = e;\r
+            if(e){\r
+                // normalize buttons\r
+                me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1);\r
+                if(e.type == 'click' && me.button == -1){\r
+                    me.button = 0;\r
+                }\r
+                me.type = e.type;\r
+                me.shiftKey = e.shiftKey;\r
+                // mac metaKey behaves like ctrlKey\r
+                me.ctrlKey = e.ctrlKey || e.metaKey || false;\r
+                me.altKey = e.altKey;\r
+                // in getKey these will be normalized for the mac\r
+                me.keyCode = e.keyCode;\r
+                me.charCode = e.charCode;\r
+                // cache the target for the delayed and or buffered events\r
+                me.target = E.getTarget(e);\r
+                // same for XY\r
+                me.xy = E.getXY(e);\r
             }else{\r
-                n.nodeIndex = ++ni;\r
+                me.button = -1;\r
+                me.shiftKey = false;\r
+                me.ctrlKey = false;\r
+                me.altKey = false;\r
+                me.keyCode = 0;\r
+                me.charCode = 0;\r
+                me.target = null;\r
+                me.xy = [0, 0];\r
             }\r
-               n = nx;\r
-           }\r
-        Ext.Element.data(dom, 'isCleaned', true);\r
-           return me;\r
-       },\r
-    \r
-    /**\r
-     * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object\r
-     * parameter as {@link Ext.Updater#update}\r
-     * @return {Ext.Element} this\r
-     */\r
-    load : function(){\r
-        var um = this.getUpdater();\r
-        um.update.apply(um, arguments);\r
-        return this;\r
-    },\r
+            return me;\r
+        },\r
 \r
-    /**\r
-    * Gets this element's {@link Ext.Updater Updater}\r
-    * @return {Ext.Updater} The Updater\r
-    */\r
-    getUpdater : function(){\r
-        return this.updateManager || (this.updateManager = new Ext.Updater(this));\r
-    },\r
-    \r
-       /**\r
-    * Update the innerHTML of this element, optionally searching for and processing scripts\r
-    * @param {String} html The new HTML\r
-    * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false)\r
-    * @param {Function} callback (optional) For async script loading you can be notified when the update completes\r
-    * @return {Ext.Element} this\r
-     */\r
-    update : function(html, loadScripts, callback){\r
-        html = html || "";\r
-           \r
-        if(loadScripts !== true){\r
-            this.dom.innerHTML = html;\r
-            if(Ext.isFunction(callback)){\r
-                callback();\r
-            }\r
-            return this;\r
-        }\r
-        \r
-        var id = Ext.id(),\r
-               dom = this.dom;\r
-\r
-        html += '<span id="' + id + '"></span>';\r
-\r
-        Ext.lib.Event.onAvailable(id, function(){\r
-            var DOC = document,\r
-                hd = DOC.getElementsByTagName("head")[0],\r
-               re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,\r
-               srcRe = /\ssrc=([\'\"])(.*?)\1/i,\r
-               typeRe = /\stype=([\'\"])(.*?)\1/i,\r
-               match,\r
-               attrs,\r
-               srcMatch,\r
-               typeMatch,\r
-               el,\r
-               s;\r
-\r
-            while((match = re.exec(html))){\r
-                attrs = match[1];\r
-                srcMatch = attrs ? attrs.match(srcRe) : false;\r
-                if(srcMatch && srcMatch[2]){\r
-                   s = DOC.createElement("script");\r
-                   s.src = srcMatch[2];\r
-                   typeMatch = attrs.match(typeRe);\r
-                   if(typeMatch && typeMatch[2]){\r
-                       s.type = typeMatch[2];\r
-                   }\r
-                   hd.appendChild(s);\r
-                }else if(match[2] && match[2].length > 0){\r
-                    if(window.execScript) {\r
-                       window.execScript(match[2]);\r
-                    } else {\r
-                       window.eval(match[2]);\r
-                    }\r
+        /**\r
+         * Stop the event (preventDefault and stopPropagation)\r
+         */\r
+        stopEvent : function(){\r
+            var me = this;\r
+            if(me.browserEvent){\r
+                if(me.browserEvent.type == 'mousedown'){\r
+                    Ext.EventManager.stoppedMouseDownEvent.fire(me);\r
                 }\r
+                E.stopEvent(me.browserEvent);\r
             }\r
-            el = DOC.getElementById(id);\r
-            if(el){Ext.removeNode(el);}\r
-            if(Ext.isFunction(callback)){\r
-                callback();\r
-            }\r
-        });\r
-        dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");\r
-        return this;\r
-    },\r
-    \r
-    /**\r
-     * Creates a proxy element of this element\r
-     * @param {String/Object} config The class name of the proxy element or a DomHelper config object\r
-     * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body)\r
-     * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false)\r
-     * @return {Ext.Element} The new proxy element\r
-     */\r
-    createProxy : function(config, renderTo, matchBox){\r
-        config = Ext.isObject(config) ? config : {tag : "div", cls: config};\r
-\r
-        var me = this,\r
-               proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) :\r
-                                                  Ext.DomHelper.insertBefore(me.dom, config, true);        \r
-        \r
-        if(matchBox && me.setBox && me.getBox){ // check to make sure Element.position.js is loaded\r
-           proxy.setBox(me.getBox());\r
-        }\r
-        return proxy;\r
-    }\r
-});\r
-\r
-Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater;\r
-\r
-// private\r
-Ext.Element.uncache = function(el){\r
-    for(var i = 0, a = arguments, len = a.length; i < len; i++) {\r
-        if(a[i]){\r
-            delete Ext.Element.cache[a[i].id || a[i]];\r
-        }\r
-    }\r
-};/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
-    /**\r
-     * Gets the x,y coordinates specified by the anchor position on the element.\r
-     * @param {String} anchor (optional) The specified anchor position (defaults to "c").  See {@link #alignTo}\r
-     * for details on supported anchor positions.\r
-     * @param {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead\r
-     * of page coordinates\r
-     * @param {Object} size (optional) An object containing the size to use for calculating anchor position\r
-     * {width: (target width), height: (target height)} (defaults to the element's current size)\r
-     * @return {Array} [x, y] An array containing the element's x and y coordinates\r
-     */\r
-    getAnchorXY : function(anchor, local, s){\r
-        //Passing a different size is useful for pre-calculating anchors,\r
-        //especially for anchored animations that change the el size.\r
-               anchor = (anchor || "tl").toLowerCase();\r
-        s = s || {};\r
-        \r
-        var me = this,        \r
-               vp = me.dom == document.body || me.dom == document,\r
-               w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(),\r
-               h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(),                              \r
-               xy,             \r
-               r = Math.round,\r
-               o = me.getXY(),\r
-               scroll = me.getScroll(),\r
-               extraX = vp ? scroll.left : !local ? o[0] : 0,\r
-               extraY = vp ? scroll.top : !local ? o[1] : 0,\r
-               hash = {\r
-                       c  : [r(w * 0.5), r(h * 0.5)],\r
-                       t  : [r(w * 0.5), 0],\r
-                       l  : [0, r(h * 0.5)],\r
-                       r  : [w, r(h * 0.5)],\r
-                       b  : [r(w * 0.5), h],\r
-                       tl : [0, 0],    \r
-                       bl : [0, h],\r
-                       br : [w, h],\r
-                       tr : [w, 0]\r
-               };\r
-        \r
-        xy = hash[anchor];     \r
-        return [xy[0] + extraX, xy[1] + extraY]; \r
-    },\r
-\r
-    /**\r
-     * Anchors an element to another element and realigns it when the window is resized.\r
-     * @param {Mixed} element The element to align to.\r
-     * @param {String} position The position to align to.\r
-     * @param {Array} offsets (optional) Offset the positioning by [x, y]\r
-     * @param {Boolean/Object} animate (optional) True for the default animation or a standard Element animation config object\r
-     * @param {Boolean/Number} monitorScroll (optional) True to monitor body scroll and reposition. If this parameter\r
-     * is a number, it is used as the buffer delay (defaults to 50ms).\r
-     * @param {Function} callback The function to call after the animation finishes\r
-     * @return {Ext.Element} this\r
-     */\r
-    anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){        \r
-           var me = this,\r
-            dom = me.dom;\r
-           \r
-           function action(){\r
-            Ext.fly(dom).alignTo(el, alignment, offsets, animate);\r
-            Ext.callback(callback, Ext.fly(dom));\r
-        }\r
-        \r
-        Ext.EventManager.onWindowResize(action, me);\r
-        \r
-        if(!Ext.isEmpty(monitorScroll)){\r
-            Ext.EventManager.on(window, 'scroll', action, me,\r
-                {buffer: !isNaN(monitorScroll) ? monitorScroll : 50});\r
-        }\r
-        action.call(me); // align immediately\r
-        return me;\r
-    },\r
+        },\r
 \r
-    /**\r
-     * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the\r
-     * supported position values.\r
-     * @param {Mixed} element The element to align to.\r
-     * @param {String} position The position to align to.\r
-     * @param {Array} offsets (optional) Offset the positioning by [x, y]\r
-     * @return {Array} [x, y]\r
-     */\r
-    getAlignToXY : function(el, p, o){     \r
-        el = Ext.get(el);\r
-        \r
-        if(!el || !el.dom){\r
-            throw "Element.alignToXY with an element that doesn't exist";\r
-        }\r
-        \r
-        o = o || [0,0];\r
-        p = (p == "?" ? "tl-bl?" : (!/-/.test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase();       \r
-                \r
-        var me = this,\r
-               d = me.dom,\r
-               a1,\r
-               a2,\r
-               x,\r
-               y,\r
-               //constrain the aligned el to viewport if necessary\r
-               w,\r
-               h,\r
-               r,\r
-               dw = Ext.lib.Dom.getViewWidth() -10, // 10px of margin for ie\r
-               dh = Ext.lib.Dom.getViewHeight()-10, // 10px of margin for ie\r
-               p1y,\r
-               p1x,            \r
-               p2y,\r
-               p2x,\r
-               swapY,\r
-               swapX,\r
-               doc = document,\r
-               docElement = doc.documentElement,\r
-               docBody = doc.body,\r
-               scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5,\r
-               scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5,\r
-               c = false, //constrain to viewport\r
-               p1 = "", \r
-               p2 = "",\r
-               m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);\r
-        \r
-        if(!m){\r
-           throw "Element.alignTo with an invalid alignment " + p;\r
-        }\r
-        \r
-        p1 = m[1]; \r
-        p2 = m[2]; \r
-        c = !!m[3];\r
-\r
-        //Subtract the aligned el's internal xy from the target's offset xy\r
-        //plus custom offset to get the aligned el's new offset xy\r
-        a1 = me.getAnchorXY(p1, true);\r
-        a2 = el.getAnchorXY(p2, false);\r
-\r
-        x = a2[0] - a1[0] + o[0];\r
-        y = a2[1] - a1[1] + o[1];\r
-\r
-        if(c){    \r
-              w = me.getWidth();\r
-           h = me.getHeight();\r
-           r = el.getRegion();       \r
-           //If we are at a viewport boundary and the aligned el is anchored on a target border that is\r
-           //perpendicular to the vp border, allow the aligned el to slide on that border,\r
-           //otherwise swap the aligned el to the opposite border of the target.\r
-           p1y = p1.charAt(0);\r
-           p1x = p1.charAt(p1.length-1);\r
-           p2y = p2.charAt(0);\r
-           p2x = p2.charAt(p2.length-1);\r
-           swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t"));\r
-           swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r"));          \r
-           \r
-\r
-           if (x + w > dw + scrollX) {\r
-                x = swapX ? r.left-w : dw+scrollX-w;\r
-           }\r
-           if (x < scrollX) {\r
-               x = swapX ? r.right : scrollX;\r
-           }\r
-           if (y + h > dh + scrollY) {\r
-                y = swapY ? r.top-h : dh+scrollY-h;\r
+        /**\r
+         * Prevents the browsers default handling of the event.\r
+         */\r
+        preventDefault : function(){\r
+            if(this.browserEvent){\r
+                E.preventDefault(this.browserEvent);\r
             }\r
-           if (y < scrollY){\r
-               y = swapY ? r.bottom : scrollY;\r
-           }\r
-        }\r
-        return [x,y];\r
-    },\r
-\r
-    /**\r
-     * Aligns this element with another element relative to the specified anchor points. If the other element is the\r
-     * document it aligns it to the viewport.\r
-     * The position parameter is optional, and can be specified in any one of the following formats:\r
-     * <ul>\r
-     *   <li><b>Blank</b>: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").</li>\r
-     *   <li><b>One anchor (deprecated)</b>: The passed anchor position is used as the target element's anchor point.\r
-     *       The element being aligned will position its top-left corner (tl) to that point.  <i>This method has been\r
-     *       deprecated in favor of the newer two anchor syntax below</i>.</li>\r
-     *   <li><b>Two anchors</b>: If two values from the table below are passed separated by a dash, the first value is used as the\r
-     *       element's anchor point, and the second value is used as the target's anchor point.</li>\r
-     * </ul>\r
-     * In addition to the anchor points, the position parameter also supports the "?" character.  If "?" is passed at the end of\r
-     * the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to\r
-     * the viewport if necessary.  Note that the element being aligned might be swapped to align to a different position than\r
-     * that specified in order to enforce the viewport constraints.\r
-     * Following are all of the supported anchor positions:\r
-<pre>\r
-Value  Description\r
------  -----------------------------\r
-tl     The top left corner (default)\r
-t      The center of the top edge\r
-tr     The top right corner\r
-l      The center of the left edge\r
-c      In the center of the element\r
-r      The center of the right edge\r
-bl     The bottom left corner\r
-b      The center of the bottom edge\r
-br     The bottom right corner\r
-</pre>\r
-Example Usage:\r
-<pre><code>\r
-// align el to other-el using the default positioning ("tl-bl", non-constrained)\r
-el.alignTo("other-el");\r
-\r
-// align the top left corner of el with the top right corner of other-el (constrained to viewport)\r
-el.alignTo("other-el", "tr?");\r
-\r
-// align the bottom right corner of el with the center left edge of other-el\r
-el.alignTo("other-el", "br-l?");\r
-\r
-// align the center of el with the bottom left corner of other-el and\r
-// adjust the x position by -6 pixels (and the y position by 0)\r
-el.alignTo("other-el", "c-bl", [-6, 0]);\r
-</code></pre>\r
-     * @param {Mixed} element The element to align to.\r
-     * @param {String} position The position to align to.\r
-     * @param {Array} offsets (optional) Offset the positioning by [x, y]\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    alignTo : function(element, position, offsets, animate){\r
-           var me = this;\r
-        return me.setXY(me.getAlignToXY(element, position, offsets),\r
-                               me.preanim && !!animate ? me.preanim(arguments, 3) : false);\r
-    },\r
-    \r
-    // private ==>  used outside of core\r
-    adjustForConstraints : function(xy, parent, offsets){\r
-        return this.getConstrainToXY(parent || document, false, offsets, xy) ||  xy;\r
-    },\r
-\r
-    // private ==>  used outside of core\r
-    getConstrainToXY : function(el, local, offsets, proposedXY){   \r
-           var os = {top:0, left:0, bottom:0, right: 0};\r
-\r
-        return function(el, local, offsets, proposedXY){\r
-            el = Ext.get(el);\r
-            offsets = offsets ? Ext.applyIf(offsets, os) : os;\r
+        },\r
 \r
-            var vw, vh, vx = 0, vy = 0;\r
-            if(el.dom == document.body || el.dom == document){\r
-                vw =Ext.lib.Dom.getViewWidth();\r
-                vh = Ext.lib.Dom.getViewHeight();\r
-            }else{\r
-                vw = el.dom.clientWidth;\r
-                vh = el.dom.clientHeight;\r
-                if(!local){\r
-                    var vxy = el.getXY();\r
-                    vx = vxy[0];\r
-                    vy = vxy[1];\r
+        /**\r
+         * Cancels bubbling of the event.\r
+         */\r
+        stopPropagation : function(){\r
+            var me = this;\r
+            if(me.browserEvent){\r
+                if(me.browserEvent.type == 'mousedown'){\r
+                    Ext.EventManager.stoppedMouseDownEvent.fire(me);\r
                 }\r
+                E.stopPropagation(me.browserEvent);\r
             }\r
+        },\r
+\r
+        /**\r
+         * Gets the character code for the event.\r
+         * @return {Number}\r
+         */\r
+        getCharCode : function(){\r
+            return this.charCode || this.keyCode;\r
+        },\r
+\r
+        /**\r
+         * Returns a normalized keyCode for the event.\r
+         * @return {Number} The key code\r
+         */\r
+        getKey : function(){\r
+            return this.normalizeKey(this.keyCode || this.charCode)\r
+        },\r
 \r
-            var s = el.getScroll();\r
+        // private\r
+        normalizeKey: function(k){\r
+            return Ext.isSafari ? (safariKeys[k] || k) : k;\r
+        },\r
 \r
-            vx += offsets.left + s.left;\r
-            vy += offsets.top + s.top;\r
+        /**\r
+         * Gets the x coordinate of the event.\r
+         * @return {Number}\r
+         */\r
+        getPageX : function(){\r
+            return this.xy[0];\r
+        },\r
 \r
-            vw -= offsets.right;\r
-            vh -= offsets.bottom;\r
+        /**\r
+         * Gets the y coordinate of the event.\r
+         * @return {Number}\r
+         */\r
+        getPageY : function(){\r
+            return this.xy[1];\r
+        },\r
 \r
-            var vr = vx+vw;\r
-            var vb = vy+vh;\r
+        /**\r
+         * Gets the page coordinates of the event.\r
+         * @return {Array} The xy values like [x, y]\r
+         */\r
+        getXY : function(){\r
+            return this.xy;\r
+        },\r
 \r
-            var xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]);\r
-            var x = xy[0], y = xy[1];\r
-            var w = this.dom.offsetWidth, h = this.dom.offsetHeight;\r
+        /**\r
+         * Gets the target for the event.\r
+         * @param {String} selector (optional) A simple selector to filter the target or look for an ancestor of the target\r
+         * @param {Number/Mixed} maxDepth (optional) The max depth to\r
+                search as a number or element (defaults to 10 || document.body)\r
+         * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
+         * @return {HTMLelement}\r
+         */\r
+        getTarget : function(selector, maxDepth, returnEl){\r
+            return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target);\r
+        },\r
 \r
-            // only move it if it needs it\r
-            var moved = false;\r
+        /**\r
+         * Gets the related target.\r
+         * @return {HTMLElement}\r
+         */\r
+        getRelatedTarget : function(){\r
+            return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : null;\r
+        },\r
 \r
-            // first validate right/bottom\r
-            if((x + w) > vr){\r
-                x = vr - w;\r
-                moved = true;\r
+        /**\r
+         * Normalizes mouse wheel delta across browsers\r
+         * @return {Number} The delta\r
+         */\r
+        getWheelDelta : function(){\r
+            var e = this.browserEvent;\r
+            var delta = 0;\r
+            if(e.wheelDelta){ /* IE/Opera. */\r
+                delta = e.wheelDelta/120;\r
+            }else if(e.detail){ /* Mozilla case. */\r
+                delta = -e.detail/3;\r
             }\r
-            if((y + h) > vb){\r
-                y = vb - h;\r
-                moved = true;\r
+            return delta;\r
+        },\r
+\r
+        /**\r
+        * Returns true if the target of this event is a child of el.  Unless the allowEl parameter is set, it will return false if if the target is el.\r
+        * Example usage:<pre><code>\r
+        // Handle click on any child of an element\r
+        Ext.getBody().on('click', function(e){\r
+            if(e.within('some-el')){\r
+                alert('Clicked on a child of some-el!');\r
             }\r
-            // then make sure top/left isn't negative\r
-            if(x < vx){\r
-                x = vx;\r
-                moved = true;\r
+        });\r
+\r
+        // Handle click directly on an element, ignoring clicks on child nodes\r
+        Ext.getBody().on('click', function(e,t){\r
+            if((t.id == 'some-el') && !e.within(t, true)){\r
+                alert('Clicked directly on some-el!');\r
             }\r
-            if(y < vy){\r
-                y = vy;\r
-                moved = true;\r
+        });\r
+        </code></pre>\r
+         * @param {Mixed} el The id, DOM element or Ext.Element to check\r
+         * @param {Boolean} related (optional) true to test if the related target is within el instead of the target\r
+         * @param {Boolean} allowEl {optional} true to also check if the passed element is the target or related target\r
+         * @return {Boolean}\r
+         */\r
+        within : function(el, related, allowEl){\r
+            if(el){\r
+                var t = this[related ? "getRelatedTarget" : "getTarget"]();\r
+                return t && ((allowEl ? (t == Ext.getDom(el)) : false) || Ext.fly(el).contains(t));\r
             }\r
-            return moved ? [x, y] : false;\r
-        };\r
-    }(),\r
-           \r
-           \r
-               \r
-//         el = Ext.get(el);\r
-//         offsets = Ext.applyIf(offsets || {}, {top : 0, left : 0, bottom : 0, right : 0});\r
-\r
-//         var me = this,\r
-//             doc = document,\r
-//             s = el.getScroll(),\r
-//             vxy = el.getXY(),\r
-//             vx = offsets.left + s.left, \r
-//             vy = offsets.top + s.top,               \r
-//             vw = -offsets.right, \r
-//             vh = -offsets.bottom, \r
-//             vr,\r
-//             vb,\r
-//             xy = proposedXY || (!local ? me.getXY() : [me.getLeft(true), me.getTop(true)]),\r
-//             x = xy[0],\r
-//             y = xy[1],\r
-//             w = me.dom.offsetWidth, h = me.dom.offsetHeight,\r
-//             moved = false; // only move it if it needs it\r
-//       \r
-//             \r
-//         if(el.dom == doc.body || el.dom == doc){\r
-//             vw += Ext.lib.Dom.getViewWidth();\r
-//             vh += Ext.lib.Dom.getViewHeight();\r
-//         }else{\r
-//             vw += el.dom.clientWidth;\r
-//             vh += el.dom.clientHeight;\r
-//             if(!local){                    \r
-//                 vx += vxy[0];\r
-//                 vy += vxy[1];\r
-//             }\r
-//         }\r
-\r
-//         // first validate right/bottom\r
-//         if(x + w > vx + vw){\r
-//             x = vx + vw - w;\r
-//             moved = true;\r
-//         }\r
-//         if(y + h > vy + vh){\r
-//             y = vy + vh - h;\r
-//             moved = true;\r
-//         }\r
-//         // then make sure top/left isn't negative\r
-//         if(x < vx){\r
-//             x = vx;\r
-//             moved = true;\r
-//         }\r
-//         if(y < vy){\r
-//             y = vy;\r
-//             moved = true;\r
-//         }\r
-//         return moved ? [x, y] : false;\r
-//    },\r
-    \r
-    /**\r
-    * Calculates the x, y to center this element on the screen\r
-    * @return {Array} The x, y values [x, y]\r
-    */\r
-    getCenterXY : function(){\r
-        return this.getAlignToXY(document, 'c-c');\r
-    },\r
+            return false;\r
+        }\r
+     };\r
 \r
-    /**\r
-    * Centers the Element in either the viewport, or another Element.\r
-    * @param {Mixed} centerIn (optional) The element in which to center the element.\r
-    */\r
-    center : function(centerIn){\r
-        return this.alignTo(centerIn || document, 'c-c');        \r
-    }    \r
-});\r
-/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods(function(){\r
-       var PARENTNODE = 'parentNode',\r
-               NEXTSIBLING = 'nextSibling',\r
-               PREVIOUSSIBLING = 'previousSibling',\r
-               DQ = Ext.DomQuery,\r
-               GET = Ext.get;\r
-       \r
-       return {\r
-               /**\r
-            * Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 50 || document.body)\r
-            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
-            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
-            */\r
-           findParent : function(simpleSelector, maxDepth, returnEl){\r
-               var p = this.dom,\r
-                       b = document.body, \r
-                       depth = 0,                      \r
-                       stopEl;         \r
-            if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') {\r
-                return null;\r
-            }\r
-               maxDepth = maxDepth || 50;\r
-               if (isNaN(maxDepth)) {\r
-                   stopEl = Ext.getDom(maxDepth);\r
-                   maxDepth = Number.MAX_VALUE;\r
-               }\r
-               while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){\r
-                   if(DQ.is(p, simpleSelector)){\r
-                       return returnEl ? GET(p) : p;\r
-                   }\r
-                   depth++;\r
-                   p = p.parentNode;\r
-               }\r
-               return null;\r
-           },\r
-       \r
-           /**\r
-            * Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
-                   search as a number or element (defaults to 10 || document.body)\r
-            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
-            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
-            */\r
-           findParentNode : function(simpleSelector, maxDepth, returnEl){\r
-               var p = Ext.fly(this.dom.parentNode, '_internal');\r
-               return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null;\r
-           },\r
-       \r
-           /**\r
-            * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).\r
-            * This is a shortcut for findParentNode() that always returns an Ext.Element.\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
-                   search as a number or element (defaults to 10 || document.body)\r
-            * @return {Ext.Element} The matching DOM node (or null if no match was found)\r
-            */\r
-           up : function(simpleSelector, maxDepth){\r
-               return this.findParentNode(simpleSelector, maxDepth, true);\r
-           },\r
-       \r
-           /**\r
-            * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} unique (optional) True to create a unique Ext.Element for each child (defaults to false, which creates a single shared flyweight object)\r
-            * @return {CompositeElement/CompositeElementLite} The composite element\r
-            */\r
-           select : function(selector, unique){\r
-               return Ext.Element.select(selector, unique, this.dom);\r
-           },\r
-       \r
-           /**\r
-            * Selects child nodes based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @return {Array} An array of the matched nodes\r
-            */\r
-           query : function(selector, unique){\r
-               return DQ.select(selector, this.dom);\r
-           },\r
-       \r
-           /**\r
-            * Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
-            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
-            */\r
-           child : function(selector, returnDom){\r
-               var n = DQ.selectNode(selector, this.dom);\r
-               return returnDom ? n : GET(n);\r
-           },\r
-       \r
-           /**\r
-            * Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
-            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
-            */\r
-           down : function(selector, returnDom){\r
-               var n = DQ.selectNode(" > " + selector, this.dom);\r
-               return returnDom ? n : GET(n);\r
-           },\r
-       \r
-                /**\r
-            * Gets the parent node for this element, optionally chaining up trying to match a selector\r
-            * @param {String} selector (optional) Find a parent node that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The parent node or null\r
-                */\r
-           parent : function(selector, returnDom){\r
-               return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom);\r
-           },\r
-       \r
-            /**\r
-            * Gets the next sibling, skipping text nodes\r
-            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The next sibling or null\r
-                */\r
-           next : function(selector, returnDom){\r
-               return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom);\r
-           },\r
-       \r
-           /**\r
-            * Gets the previous sibling, skipping text nodes\r
-            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The previous sibling or null\r
-                */\r
-           prev : function(selector, returnDom){\r
-               return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom);\r
-           },\r
-       \r
-       \r
-           /**\r
-            * Gets the first child, skipping text nodes\r
-            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The first child or null\r
-                */\r
-           first : function(selector, returnDom){\r
-               return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom);\r
-           },\r
-       \r
-           /**\r
-            * Gets the last child, skipping text nodes\r
-            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The last child or null\r
-                */\r
-           last : function(selector, returnDom){\r
-               return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom);\r
-           },\r
-           \r
-           matchNode : function(dir, start, selector, returnDom){\r
-               var n = this.dom[start];\r
-               while(n){\r
-                   if(n.nodeType == 1 && (!selector || DQ.is(n, selector))){\r
-                       return !returnDom ? GET(n) : n;\r
-                   }\r
-                   n = n[dir];\r
-               }\r
-               return null;\r
-           }   \r
-    }\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods(\r
-function() {\r
-       var GETDOM = Ext.getDom,\r
-               GET = Ext.get,\r
-               DH = Ext.DomHelper,\r
-        isEl = function(el){\r
-            return  (el.nodeType || el.dom || typeof el == 'string');  \r
-        };\r
-       \r
-       return {\r
-           /**\r
-            * Appends the passed element(s) to this element\r
-            * @param {String/HTMLElement/Array/Element/CompositeElement} el\r
-            * @return {Ext.Element} this\r
-            */\r
-           appendChild: function(el){        \r
-               return GET(el).appendTo(this);        \r
-           },\r
-       \r
-           /**\r
-            * Appends this element to the passed element\r
-            * @param {Mixed} el The new parent element\r
-            * @return {Ext.Element} this\r
-            */\r
-           appendTo: function(el){        \r
-               GETDOM(el).appendChild(this.dom);        \r
-               return this;\r
-           },\r
-       \r
-           /**\r
-            * Inserts this element before the passed element in the DOM\r
-            * @param {Mixed} el The element before which this element will be inserted\r
-            * @return {Ext.Element} this\r
-            */\r
-           insertBefore: function(el){                   \r
-               (el = GETDOM(el)).parentNode.insertBefore(this.dom, el);\r
-               return this;\r
-           },\r
-       \r
-           /**\r
-            * Inserts this element after the passed element in the DOM\r
-            * @param {Mixed} el The element to insert after\r
-            * @return {Ext.Element} this\r
-            */\r
-           insertAfter: function(el){\r
-               (el = GETDOM(el)).parentNode.insertBefore(this.dom, el.nextSibling);\r
-               return this;\r
-           },\r
-       \r
-           /**\r
-            * Inserts (or creates) an element (or DomHelper config) as the first child of this element\r
-            * @param {Mixed/Object} el The id or element to insert or a DomHelper config to create and insert\r
-            * @return {Ext.Element} The new child\r
-            */\r
-           insertFirst: function(el, returnDom){\r
-            el = el || {};\r
-            if(isEl(el)){ // element\r
-                el = GETDOM(el);\r
-                this.dom.insertBefore(el, this.dom.firstChild);\r
-                return !returnDom ? GET(el) : el;\r
-            }else{ // dh config\r
-                return this.createChild(el, this.dom.firstChild, returnDom);\r
-            }\r
-    },\r
-       \r
-           /**\r
-            * Replaces the passed element with this element\r
-            * @param {Mixed} el The element to replace\r
-            * @return {Ext.Element} this\r
-            */\r
-           replace: function(el){\r
-               el = GET(el);\r
-               this.insertBefore(el);\r
-               el.remove();\r
-               return this;\r
-           },\r
-       \r
-           /**\r
-            * Replaces this element with the passed element\r
-            * @param {Mixed/Object} el The new element or a DomHelper config of an element to create\r
-            * @return {Ext.Element} this\r
-            */\r
-           replaceWith: function(el){\r
-                   var me = this,\r
-                       Element = Ext.Element;\r
-            if(isEl(el)){\r
-                el = GETDOM(el);\r
-                me.dom.parentNode.insertBefore(el, me.dom);\r
-            }else{\r
-                el = DH.insertBefore(me.dom, el);\r
-            }\r
-               \r
-               delete Element.cache[me.id];\r
-               Ext.removeNode(me.dom);      \r
-               me.id = Ext.id(me.dom = el);\r
-               return Element.cache[me.id] = me;        \r
-           },\r
-           \r
-               /**\r
-                * Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child element.\r
-                * @param {Object} config DomHelper element config object.  If no tag is specified (e.g., {tag:'input'}) then a div will be\r
-                * automatically generated with the specified attributes.\r
-                * @param {HTMLElement} insertBefore (optional) a child element of this element\r
-                * @param {Boolean} returnDom (optional) true to return the dom node instead of creating an Element\r
-                * @return {Ext.Element} The new child element\r
-                */\r
-               createChild: function(config, insertBefore, returnDom){\r
-                   config = config || {tag:'div'};\r
-                   return insertBefore ? \r
-                          DH.insertBefore(insertBefore, config, returnDom !== true) :  \r
-                          DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config,  returnDom !== true);\r
-               },\r
-               \r
-               /**\r
-                * Creates and wraps this element with another element\r
-                * @param {Object} config (optional) DomHelper element config object for the wrapper element or null for an empty div\r
-                * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element\r
-                * @return {HTMLElement/Element} The newly created wrapper element\r
-                */\r
-               wrap: function(config, returnDom){        \r
-                   var newEl = DH.insertBefore(this.dom, config || {tag: "div"}, !returnDom);\r
-                   newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom);\r
-                   return newEl;\r
-               },\r
-               \r
-               /**\r
-                * Inserts an html fragment into this element\r
-                * @param {String} where Where to insert the html in relation to this element - beforeBegin, afterBegin, beforeEnd, afterEnd.\r
-                * @param {String} html The HTML fragment\r
-                * @param {Boolean} returnEl (optional) True to return an Ext.Element (defaults to false)\r
-                * @return {HTMLElement/Ext.Element} The inserted node (or nearest related if more than 1 inserted)\r
-                */\r
-               insertHtml : function(where, html, returnEl){\r
-                   var el = DH.insertHtml(where, this.dom, html);\r
-                   return returnEl ? Ext.get(el) : el;\r
-               }\r
-       }\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-Ext.apply(Ext.Element.prototype, function() {\r
-       var GETDOM = Ext.getDom,\r
-               GET = Ext.get,\r
-               DH = Ext.DomHelper;\r
-       \r
-       return {        \r
-               /**\r
-            * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element\r
-            * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those.\r
-            * @param {String} where (optional) 'before' or 'after' defaults to before\r
-            * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element\r
-            * @return {Ext.Element} the inserted Element\r
-            */\r
-           insertSibling: function(el, where, returnDom){\r
-               var me = this,\r
-                       rt;\r
-                       \r
-               if(Ext.isArray(el)){            \r
-                   Ext.each(el, function(e) {\r
-                           rt = me.insertSibling(e, where, returnDom);\r
-                   });\r
-                   return rt;\r
-               }\r
-                       \r
-               where = (where || 'before').toLowerCase();\r
-               el = el || {};\r
-               \r
-            if(el.nodeType || el.dom){\r
-                rt = me.dom.parentNode.insertBefore(GETDOM(el), where == 'before' ? me.dom : me.dom.nextSibling);\r
-                if (!returnDom) {\r
-                    rt = GET(rt);\r
-                }\r
-            }else{\r
-                if (where == 'after' && !me.dom.nextSibling) {\r
-                    rt = DH.append(me.dom.parentNode, el, !returnDom);\r
-                } else {                    \r
-                    rt = DH[where == 'after' ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);\r
-                }\r
-            }\r
-               return rt;\r
-           }\r
-    };\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods(function(){  \r
-    // local style camelizing for speed\r
-    var propCache = {},\r
-        camelRe = /(-[a-z])/gi,\r
-        classReCache = {},\r
-        view = document.defaultView,\r
-        propFloat = Ext.isIE ? 'styleFloat' : 'cssFloat',\r
-        opacityRe = /alpha\(opacity=(.*)\)/i,\r
-        trimRe = /^\s+|\s+$/g,\r
-        EL = Ext.Element,   \r
-        PADDING = "padding",\r
-        MARGIN = "margin",\r
-        BORDER = "border",\r
-        LEFT = "-left",\r
-        RIGHT = "-right",\r
-        TOP = "-top",\r
-        BOTTOM = "-bottom",\r
-        WIDTH = "-width",    \r
-        MATH = Math,\r
-        HIDDEN = 'hidden',\r
-        ISCLIPPED = 'isClipped',\r
-        OVERFLOW = 'overflow',\r
-        OVERFLOWX = 'overflow-x',\r
-        OVERFLOWY = 'overflow-y',\r
-        ORIGINALCLIP = 'originalClip',\r
-        // special markup used throughout Ext when box wrapping elements    \r
-        borders = {l: BORDER + LEFT + WIDTH, r: BORDER + RIGHT + WIDTH, t: BORDER + TOP + WIDTH, b: BORDER + BOTTOM + WIDTH},\r
-        paddings = {l: PADDING + LEFT, r: PADDING + RIGHT, t: PADDING + TOP, b: PADDING + BOTTOM},\r
-        margins = {l: MARGIN + LEFT, r: MARGIN + RIGHT, t: MARGIN + TOP, b: MARGIN + BOTTOM},\r
-        data = Ext.Element.data;\r
-        \r
-    \r
-    // private  \r
-    function camelFn(m, a) {\r
-        return a.charAt(1).toUpperCase();\r
-    }\r
-    \r
-    // private (needs to be called => addStyles.call(this, sides, styles))\r
-    function addStyles(sides, styles){\r
-        var val = 0;    \r
-        \r
-        Ext.each(sides.match(/\w/g), function(s) {\r
-            if (s = parseInt(this.getStyle(styles[s]), 10)) {\r
-                val += MATH.abs(s);      \r
-            }\r
-        },\r
-        this);\r
-        return val;\r
-    }\r
-\r
-    function chkCache(prop) {\r
-        return propCache[prop] || (propCache[prop] = prop == 'float' ? propFloat : prop.replace(camelRe, camelFn));\r
-\r
-    }\r
-            \r
-    return {    \r
-        // private  ==> used by Fx  \r
-        adjustWidth : function(width) {\r
-            var me = this;\r
-            var isNum = (typeof width == "number");\r
-            if(isNum && me.autoBoxAdjust && !me.isBorderBox()){\r
-               width -= (me.getBorderWidth("lr") + me.getPadding("lr"));\r
-            }\r
-            return (isNum && width < 0) ? 0 : width;\r
-        },\r
-        \r
-        // private   ==> used by Fx \r
-        adjustHeight : function(height) {\r
-            var me = this;\r
-            var isNum = (typeof height == "number");\r
-            if(isNum && me.autoBoxAdjust && !me.isBorderBox()){\r
-               height -= (me.getBorderWidth("tb") + me.getPadding("tb"));               \r
-            }\r
-            return (isNum && height < 0) ? 0 : height;\r
-        },\r
-    \r
-    \r
-        /**\r
-         * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.\r
-         * @param {String/Array} className The CSS class to add, or an array of classes\r
-         * @return {Ext.Element} this\r
-         */\r
-        addClass : function(className){\r
-            var me = this;\r
-            Ext.each(className, function(v) {\r
-                me.dom.className += (!me.hasClass(v) && v ? " " + v : "");  \r
-            });\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         * Adds one or more CSS classes to this element and removes the same class(es) from all siblings.\r
-         * @param {String/Array} className The CSS class to add, or an array of classes\r
-         * @return {Ext.Element} this\r
-         */\r
-        radioClass : function(className){\r
-            Ext.each(this.dom.parentNode.childNodes, function(v) {\r
-                if(v.nodeType == 1) {\r
-                    Ext.fly(v, '_internal').removeClass(className);          \r
-                }\r
-            });\r
-            return this.addClass(className);\r
-        },\r
-    \r
-        /**\r
-         * Removes one or more CSS classes from the element.\r
-         * @param {String/Array} className The CSS class to remove, or an array of classes\r
-         * @return {Ext.Element} this\r
-         */\r
-        removeClass : function(className){\r
-            var me = this;\r
-            if (me.dom.className) {\r
-                Ext.each(className, function(v) {               \r
-                    me.dom.className = me.dom.className.replace(\r
-                        classReCache[v] = classReCache[v] || new RegExp('(?:^|\\s+)' + v + '(?:\\s+|$)', "g"), \r
-                        " ");               \r
-                });    \r
-            }\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it).\r
-         * @param {String} className The CSS class to toggle\r
-         * @return {Ext.Element} this\r
-         */\r
-        toggleClass : function(className){\r
-            return this.hasClass(className) ? this.removeClass(className) : this.addClass(className);\r
-        },\r
-    \r
-        /**\r
-         * Checks if the specified CSS class exists on this element's DOM node.\r
-         * @param {String} className The CSS class to check for\r
-         * @return {Boolean} True if the class exists, else false\r
-         */\r
-        hasClass : function(className){\r
-            return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1;\r
-        },\r
-    \r
-        /**\r
-         * Replaces a CSS class on the element with another.  If the old name does not exist, the new name will simply be added.\r
-         * @param {String} oldClassName The CSS class to replace\r
-         * @param {String} newClassName The replacement CSS class\r
-         * @return {Ext.Element} this\r
-         */\r
-        replaceClass : function(oldClassName, newClassName){\r
-            return this.removeClass(oldClassName).addClass(newClassName);\r
-        },\r
-        \r
-        isStyle : function(style, val) {\r
-            return this.getStyle(style) == val;  \r
-        },\r
-    \r
-        /**\r
-         * Normalizes currentStyle and computedStyle.\r
-         * @param {String} property The style property whose value is returned.\r
-         * @return {String} The current value of the style property for this element.\r
-         */\r
-        getStyle : function(){         \r
-            return view && view.getComputedStyle ?\r
-                function(prop){\r
-                    var el = this.dom,\r
-                        v,                  \r
-                        cs;\r
-                    if(el == document) return null;\r
-                    prop = chkCache(prop);\r
-                    return (v = el.style[prop]) ? v : \r
-                           (cs = view.getComputedStyle(el, "")) ? cs[prop] : null;\r
-                } :\r
-                function(prop){      \r
-                    var el = this.dom, \r
-                        m, \r
-                        cs;     \r
-                        \r
-                    if(el == document) return null;      \r
-                    if (prop == 'opacity') {\r
-                        if (el.style.filter.match) {                       \r
-                            if(m = el.style.filter.match(opacityRe)){\r
-                                var fv = parseFloat(m[1]);\r
-                                if(!isNaN(fv)){\r
-                                    return fv ? fv / 100 : 0;\r
-                                }\r
-                            }\r
-                        }\r
-                        return 1;\r
-                    }\r
-                    prop = chkCache(prop);  \r
-                    return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);\r
-                };\r
-        }(),\r
-        \r
-        /**\r
-         * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values\r
-         * are convert to standard 6 digit hex color.\r
-         * @param {String} attr The css attribute\r
-         * @param {String} defaultValue The default value to use when a valid color isn't found\r
-         * @param {String} prefix (optional) defaults to #. Use an empty string when working with\r
-         * color anims.\r
-         */\r
-        getColor : function(attr, defaultValue, prefix){\r
-            var v = this.getStyle(attr),\r
-                color = prefix || '#',\r
-                h;\r
-                \r
-            if(!v || /transparent|inherit/.test(v)){\r
-                return defaultValue;\r
-            }\r
-            if(/^r/.test(v)){\r
-                Ext.each(v.slice(4, v.length -1).split(','), function(s){\r
-                    h = parseInt(s, 10);\r
-                    color += (h < 16 ? '0' : '') + h.toString(16); \r
-                });\r
-            }else{\r
-                v = v.replace('#', '');\r
-                color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;\r
-            }\r
-            return(color.length > 5 ? color.toLowerCase() : defaultValue);\r
-        },\r
-    \r
-        /**\r
-         * Wrapper for setting style properties, also takes single object parameter of multiple styles.\r
-         * @param {String/Object} property The style property to be set, or an object of multiple styles.\r
-         * @param {String} value (optional) The value to apply to the given property, or null if an object was passed.\r
-         * @return {Ext.Element} this\r
-         */\r
-        setStyle : function(prop, value){\r
-            var tmp, \r
-                style,\r
-                camel;\r
-            if (!Ext.isObject(prop)) {\r
-                tmp = {};\r
-                tmp[prop] = value;          \r
-                prop = tmp;\r
-            }\r
-            for (style in prop) {\r
-                value = prop[style];            \r
-                style == 'opacity' ? \r
-                    this.setOpacity(value) : \r
-                    this.dom.style[chkCache(style)] = value;\r
-            }\r
-            return this;\r
-        },\r
-        \r
-        /**\r
-         * Set the opacity of the element\r
-         * @param {Float} opacity The new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc\r
-         * @param {Boolean/Object} animate (optional) a standard Element animation config object or <tt>true</tt> for\r
-         * the default animation (<tt>{duration: .35, easing: 'easeIn'}</tt>)\r
-         * @return {Ext.Element} this\r
-         */\r
-         setOpacity : function(opacity, animate){\r
-            var me = this,\r
-                s = me.dom.style;\r
-                \r
-            if(!animate || !me.anim){            \r
-                if(Ext.isIE){\r
-                    var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '', \r
-                    val = s.filter.replace(opacityRe, '').replace(trimRe, '');\r
-\r
-                    s.zoom = 1;\r
-                    s.filter = val + (val.length > 0 ? ' ' : '') + opac;\r
-                }else{\r
-                    s.opacity = opacity;\r
-                }\r
-            }else{\r
-                me.anim({opacity: {to: opacity}}, me.preanim(arguments, 1), null, .35, 'easeIn');\r
-            }\r
-            return me;\r
-        },\r
-        \r
-        /**\r
-         * Clears any opacity settings from this element. Required in some cases for IE.\r
-         * @return {Ext.Element} this\r
-         */\r
-        clearOpacity : function(){\r
-            var style = this.dom.style;\r
-            if(Ext.isIE){\r
-                if(!Ext.isEmpty(style.filter)){\r
-                    style.filter = style.filter.replace(opacityRe, '').replace(trimRe, '');\r
-                }\r
-            }else{\r
-                style.opacity = style['-moz-opacity'] = style['-khtml-opacity'] = '';\r
-            }\r
-            return this;\r
-        },\r
-    \r
-        /**\r
-         * Returns the offset height of the element\r
-         * @param {Boolean} contentHeight (optional) true to get the height minus borders and padding\r
-         * @return {Number} The element's height\r
-         */\r
-        getHeight : function(contentHeight){\r
-            var me = this,\r
-                dom = me.dom,\r
-                h = MATH.max(dom.offsetHeight, dom.clientHeight) || 0;\r
-            h = !contentHeight ? h : h - me.getBorderWidth("tb") - me.getPadding("tb");\r
-            return h < 0 ? 0 : h;\r
-        },\r
-    \r
-        /**\r
-         * Returns the offset width of the element\r
-         * @param {Boolean} contentWidth (optional) true to get the width minus borders and padding\r
-         * @return {Number} The element's width\r
-         */\r
-        getWidth : function(contentWidth){\r
-            var me = this,\r
-                dom = me.dom,\r
-                w = MATH.max(dom.offsetWidth, dom.clientWidth) || 0;\r
-            w = !contentWidth ? w : w - me.getBorderWidth("lr") - me.getPadding("lr");\r
-            return w < 0 ? 0 : w;\r
-        },\r
-    \r
-        /**\r
-         * Set the width of this Element.\r
-         * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>\r
-         * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>\r
-         * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.\r
-         * </ul></div>\r
-         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-        setWidth : function(width, animate){\r
-            var me = this;\r
-            width = me.adjustWidth(width);\r
-            !animate || !me.anim ? \r
-                me.dom.style.width = me.addUnits(width) :\r
-                me.anim({width : {to : width}}, me.preanim(arguments, 1));\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         * Set the height of this Element.\r
-         * <pre><code>\r
-// change the height to 200px and animate with default configuration\r
-Ext.fly('elementId').setHeight(200, true);\r
-\r
-// change the height to 150px and animate with a custom configuration\r
-Ext.fly('elId').setHeight(150, {\r
-    duration : .5, // animation will have a duration of .5 seconds\r
-    // will change the content to "finished"\r
-    callback: function(){ this.{@link #update}("finished"); } \r
-});\r
-         * </code></pre>\r
-         * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>\r
-         * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels.)</li>\r
-         * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>\r
-         * </ul></div>\r
-         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-         setHeight : function(height, animate){\r
-            var me = this;\r
-            height = me.adjustHeight(height);\r
-            !animate || !me.anim ? \r
-                me.dom.style.height = me.addUnits(height) :\r
-                me.anim({height : {to : height}}, me.preanim(arguments, 1));\r
-            return me;\r
-        },\r
-        \r
-        /**\r
-         * Gets the width of the border(s) for the specified side(s)\r
-         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,\r
-         * passing <tt>'lr'</tt> would get the border <b><u>l</u></b>eft width + the border <b><u>r</u></b>ight width.\r
-         * @return {Number} The width of the sides passed added together\r
-         */\r
-        getBorderWidth : function(side){\r
-            return addStyles.call(this, side, borders);\r
-        },\r
-    \r
-        /**\r
-         * Gets the width of the padding(s) for the specified side(s)\r
-         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,\r
-         * passing <tt>'lr'</tt> would get the padding <b><u>l</u></b>eft + the padding <b><u>r</u></b>ight.\r
-         * @return {Number} The padding of the sides passed added together\r
-         */\r
-        getPadding : function(side){\r
-            return addStyles.call(this, side, paddings);\r
-        },\r
-    \r
-        /**\r
-         *  Store the current overflow setting and clip overflow on the element - use <tt>{@link #unclip}</tt> to remove\r
-         * @return {Ext.Element} this\r
-         */\r
-        clip : function(){\r
-            var me = this,\r
-                dom = me.dom;\r
-                \r
-            if(!data(dom, ISCLIPPED)){\r
-                data(dom, ISCLIPPED, true);\r
-                data(dom, ORIGINALCLIP, {\r
-                    o: me.getStyle(OVERFLOW),\r
-                    x: me.getStyle(OVERFLOWX),\r
-                    y: me.getStyle(OVERFLOWY)\r
-                });\r
-                me.setStyle(OVERFLOW, HIDDEN);\r
-                me.setStyle(OVERFLOWX, HIDDEN);\r
-                me.setStyle(OVERFLOWY, HIDDEN);\r
-            }\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         *  Return clipping (overflow) to original clipping before <tt>{@link #clip}</tt> was called\r
-         * @return {Ext.Element} this\r
-         */\r
-        unclip : function(){\r
-            var me = this,\r
-                dom = me.dom;\r
-                \r
-            if(data(dom, ISCLIPPED)){\r
-                data(dom, ISCLIPPED, false);\r
-                var o = data(dom, ORIGINALCLIP);\r
-                if(o.o){\r
-                    me.setStyle(OVERFLOW, o.o);\r
-                }\r
-                if(o.x){\r
-                    me.setStyle(OVERFLOWX, o.x);\r
-                }\r
-                if(o.y){\r
-                    me.setStyle(OVERFLOWY, o.y);\r
-                }\r
-            }\r
-            return me;\r
-        },\r
-        \r
-        addStyles : addStyles,\r
-        margins : margins\r
-    }\r
-}()         \r
-);/**\r
- * @class Ext.Element\r
- */\r
-\r
-// special markup used throughout Ext when box wrapping elements\r
-Ext.Element.boxMarkup = '<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';\r
-\r
-Ext.Element.addMethods(function(){\r
-       var INTERNAL = "_internal";\r
-       return {\r
-           /**\r
-            * More flexible version of {@link #setStyle} for setting style properties.\r
-            * @param {String/Object/Function} styles A style specification string, e.g. "width:100px", or object in the form {width:"100px"}, or\r
-            * a function which returns such a specification.\r
-            * @return {Ext.Element} this\r
-            */\r
-           applyStyles : function(style){\r
-               Ext.DomHelper.applyStyles(this.dom, style);\r
-               return this;\r
-           },\r
-\r
-               /**\r
-            * Returns an object with properties matching the styles requested.\r
-            * For example, el.getStyles('color', 'font-size', 'width') might return\r
-            * {'color': '#FFFFFF', 'font-size': '13px', 'width': '100px'}.\r
-            * @param {String} style1 A style name\r
-            * @param {String} style2 A style name\r
-            * @param {String} etc.\r
-            * @return {Object} The style object\r
-            */\r
-           getStyles : function(){\r
-                   var ret = {};\r
-                   Ext.each(arguments, function(v) {\r
-                          ret[v] = this.getStyle(v);\r
-                   },\r
-                   this);\r
-                   return ret;\r
-           },\r
-\r
-               getStyleSize : function(){\r
-               var me = this,\r
-                       w,\r
-                       h,\r
-                       d = this.dom,\r
-                       s = d.style;\r
-               if(s.width && s.width != 'auto'){\r
-                   w = parseInt(s.width, 10);\r
-                   if(me.isBorderBox()){\r
-                      w -= me.getFrameWidth('lr');\r
-                   }\r
-               }\r
-               if(s.height && s.height != 'auto'){\r
-                   h = parseInt(s.height, 10);\r
-                   if(me.isBorderBox()){\r
-                      h -= me.getFrameWidth('tb');\r
-                   }\r
-               }\r
-               return {width: w || me.getWidth(true), height: h || me.getHeight(true)};\r
-           },\r
-\r
-           // private  ==> used by ext full\r
-               setOverflow : function(v){\r
-                       var dom = this.dom;\r
-               if(v=='auto' && Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug\r
-                       dom.style.overflow = 'hidden';\r
-                       (function(){dom.style.overflow = 'auto';}).defer(1);\r
-               }else{\r
-                       dom.style.overflow = v;\r
-               }\r
-               },\r
-\r
-          /**\r
-               * <p>Wraps the specified element with a special 9 element markup/CSS block that renders by default as\r
-               * a gray container with a gradient background, rounded corners and a 4-way shadow.</p>\r
-               * <p>This special markup is used throughout Ext when box wrapping elements ({@link Ext.Button},\r
-               * {@link Ext.Panel} when <tt>{@link Ext.Panel#frame frame=true}</tt>, {@link Ext.Window}).  The markup\r
-               * is of this form:</p>\r
-               * <pre><code>\r
-Ext.Element.boxMarkup =\r
-    &#39;&lt;div class="{0}-tl">&lt;div class="{0}-tr">&lt;div class="{0}-tc">&lt;/div>&lt;/div>&lt;/div>\r
-     &lt;div class="{0}-ml">&lt;div class="{0}-mr">&lt;div class="{0}-mc">&lt;/div>&lt;/div>&lt;/div>\r
-     &lt;div class="{0}-bl">&lt;div class="{0}-br">&lt;div class="{0}-bc">&lt;/div>&lt;/div>&lt;/div>&#39;;\r
-               * </code></pre>\r
-               * <p>Example usage:</p>\r
-               * <pre><code>\r
-// Basic box wrap\r
-Ext.get("foo").boxWrap();\r
-\r
-// You can also add a custom class and use CSS inheritance rules to customize the box look.\r
-// 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example\r
-// for how to create a custom box wrap style.\r
-Ext.get("foo").boxWrap().addClass("x-box-blue");\r
-               * </code></pre>\r
-               * @param {String} class (optional) A base CSS class to apply to the containing wrapper element\r
-               * (defaults to <tt>'x-box'</tt>). Note that there are a number of CSS rules that are dependent on\r
-               * this name to make the overall effect work, so if you supply an alternate base class, make sure you\r
-               * also supply all of the necessary rules.\r
-               * @return {Ext.Element} this\r
-               */\r
-           boxWrap : function(cls){\r
-               cls = cls || 'x-box';\r
-               var el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "'>" + String.format(Ext.Element.boxMarkup, cls) + "</div>"));        //String.format('<div class="{0}">'+Ext.Element.boxMarkup+'</div>', cls)));\r
-               Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom);\r
-               return el;\r
-           },\r
-\r
-        /**\r
-         * Set the size of this Element. If animation is true, both width and height will be animated concurrently.\r
-         * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>\r
-         * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>\r
-         * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.\r
-         * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>\r
-         * </ul></div>\r
-         * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>\r
-         * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels).</li>\r
-         * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>\r
-         * </ul></div>\r
-         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-           setSize : function(width, height, animate){\r
-                       var me = this;\r
-                       if(Ext.isObject(width)){ // in case of object from getSize()\r
-                           height = width.height;\r
-                           width = width.width;\r
-                       }\r
-                       width = me.adjustWidth(width);\r
-                       height = me.adjustHeight(height);\r
-                       if(!animate || !me.anim){\r
-                           me.dom.style.width = me.addUnits(width);\r
-                           me.dom.style.height = me.addUnits(height);\r
-                       }else{\r
-                           me.anim({width: {to: width}, height: {to: height}}, me.preanim(arguments, 2));\r
-                       }\r
-                       return me;\r
-           },\r
-\r
-           /**\r
-            * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders\r
-            * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements\r
-            * if a height has not been set using CSS.\r
-            * @return {Number}\r
-            */\r
-           getComputedHeight : function(){\r
-                   var me = this,\r
-                       h = Math.max(me.dom.offsetHeight, me.dom.clientHeight);\r
-               if(!h){\r
-                   h = parseInt(me.getStyle('height'), 10) || 0;\r
-                   if(!me.isBorderBox()){\r
-                       h += me.getFrameWidth('tb');\r
-                   }\r
-               }\r
-               return h;\r
-           },\r
-\r
-           /**\r
-            * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders\r
-            * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements\r
-            * if a width has not been set using CSS.\r
-            * @return {Number}\r
-            */\r
-           getComputedWidth : function(){\r
-               var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth);\r
-               if(!w){\r
-                   w = parseInt(this.getStyle('width'), 10) || 0;\r
-                   if(!this.isBorderBox()){\r
-                       w += this.getFrameWidth('lr');\r
-                   }\r
-               }\r
-               return w;\r
-           },\r
-\r
-           /**\r
-            * Returns the sum width of the padding and borders for the passed "sides". See getBorderWidth()\r
-            for more information about the sides.\r
-            * @param {String} sides\r
-            * @return {Number}\r
-            */\r
-           getFrameWidth : function(sides, onlyContentBox){\r
-               return onlyContentBox && this.isBorderBox() ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides));\r
-           },\r
-\r
-           /**\r
-            * Sets up event handlers to add and remove a css class when the mouse is over this element\r
-            * @param {String} className\r
-            * @return {Ext.Element} this\r
-            */\r
-           addClassOnOver : function(className){\r
-               this.hover(\r
-                   function(){\r
-                       Ext.fly(this, INTERNAL).addClass(className);\r
-                   },\r
-                   function(){\r
-                       Ext.fly(this, INTERNAL).removeClass(className);\r
-                   }\r
-               );\r
-               return this;\r
-           },\r
-\r
-           /**\r
-            * Sets up event handlers to add and remove a css class when this element has the focus\r
-            * @param {String} className\r
-            * @return {Ext.Element} this\r
-            */\r
-           addClassOnFocus : function(className){\r
-                   this.on("focus", function(){\r
-                       Ext.fly(this, INTERNAL).addClass(className);\r
-                   }, this.dom);\r
-                   this.on("blur", function(){\r
-                       Ext.fly(this, INTERNAL).removeClass(className);\r
-                   }, this.dom);\r
-                   return this;\r
-           },\r
-\r
-           /**\r
-            * Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect)\r
-            * @param {String} className\r
-            * @return {Ext.Element} this\r
-            */\r
-           addClassOnClick : function(className){\r
-               var dom = this.dom;\r
-               this.on("mousedown", function(){\r
-                   Ext.fly(dom, INTERNAL).addClass(className);\r
-                   var d = Ext.getDoc(),\r
-                       fn = function(){\r
-                               Ext.fly(dom, INTERNAL).removeClass(className);\r
-                               d.removeListener("mouseup", fn);\r
-                           };\r
-                   d.on("mouseup", fn);\r
-               });\r
-               return this;\r
-           },\r
-\r
-           /**\r
-            * Returns the width and height of the viewport.\r
-        * <pre><code>\r
-        var vpSize = Ext.getBody().getViewSize();\r
-\r
-        // all Windows created afterwards will have a default value of 90% height and 95% width\r
-        Ext.Window.override({\r
-            width: vpSize.width * 0.9,\r
-            height: vpSize.height * 0.95\r
-        });\r
-        // To handle window resizing you would have to hook onto onWindowResize.\r
-        </code></pre>\r
-            * @return {Object} An object containing the viewport's size {width: (viewport width), height: (viewport height)}\r
-            */\r
-           getViewSize : function(){\r
-               var doc = document,\r
-                       d = this.dom,\r
-                       extdom = Ext.lib.Dom,\r
-                       isDoc = (d == doc || d == doc.body);\r
-               return { width : (isDoc ? extdom.getViewWidth() : d.clientWidth),\r
-                                height : (isDoc ? extdom.getViewHeight() : d.clientHeight) };\r
-           },\r
-\r
-           /**\r
-            * Returns the size of the element.\r
-            * @param {Boolean} contentSize (optional) true to get the width/size minus borders and padding\r
-            * @return {Object} An object containing the element's size {width: (element width), height: (element height)}\r
-            */\r
-           getSize : function(contentSize){\r
-               return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)};\r
-           },\r
-\r
-           /**\r
-            * Forces the browser to repaint this element\r
-            * @return {Ext.Element} this\r
-            */\r
-           repaint : function(){\r
-               var dom = this.dom;\r
-               this.addClass("x-repaint");\r
-               setTimeout(function(){\r
-                   Ext.fly(dom).removeClass("x-repaint");\r
-               }, 1);\r
-               return this;\r
-           },\r
-\r
-           /**\r
-            * Disables text selection for this element (normalized across browsers)\r
-            * @return {Ext.Element} this\r
-            */\r
-           unselectable : function(){\r
-               this.dom.unselectable = "on";\r
-               return this.swallowEvent("selectstart", true).\r
-                                   applyStyles("-moz-user-select:none;-khtml-user-select:none;").\r
-                                   addClass("x-unselectable");\r
-           },\r
-\r
-           /**\r
-            * Returns an object with properties top, left, right and bottom representing the margins of this element unless sides is passed,\r
-            * then it returns the calculated width of the sides (see getPadding)\r
-            * @param {String} sides (optional) Any combination of l, r, t, b to get the sum of those sides\r
-            * @return {Object/Number}\r
-            */\r
-           getMargins : function(side){\r
-                   var me = this,\r
-                       key,\r
-                       hash = {t:"top", l:"left", r:"right", b: "bottom"},\r
-                       o = {};\r
-\r
-                   if (!side) {\r
-                       for (key in me.margins){\r
-                               o[hash[key]] = parseInt(me.getStyle(me.margins[key]), 10) || 0;\r
-                }\r
-                       return o;\r
-               } else {\r
-                   return me.addStyles.call(me, side, me.margins);\r
-               }\r
-           }\r
-    };\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-(function(){\r
-var D = Ext.lib.Dom,\r
-        LEFT = "left",\r
-        RIGHT = "right",\r
-        TOP = "top",\r
-        BOTTOM = "bottom",\r
-        POSITION = "position",\r
-        STATIC = "static",\r
-        RELATIVE = "relative",\r
-        AUTO = "auto",\r
-        ZINDEX = "z-index";\r
-\r
-function animTest(args, animate, i) {\r
-       return this.preanim && !!animate ? this.preanim(args, i) : false        \r
-}\r
-\r
-Ext.Element.addMethods({\r
-       /**\r
-      * Gets the current X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-      * @return {Number} The X position of the element\r
-      */\r
-    getX : function(){\r
-        return D.getX(this.dom);\r
-    },\r
-\r
-    /**\r
-      * Gets the current Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-      * @return {Number} The Y position of the element\r
-      */\r
-    getY : function(){\r
-        return D.getY(this.dom);\r
-    },\r
-\r
-    /**\r
-      * Gets the current position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-      * @return {Array} The XY position of the element\r
-      */\r
-    getXY : function(){\r
-        return D.getXY(this.dom);\r
-    },\r
-\r
-    /**\r
-      * Returns the offsets of this element from the passed element. Both element must be part of the DOM tree and not have display:none to have page coordinates.\r
-      * @param {Mixed} element The element to get the offsets from.\r
-      * @return {Array} The XY page offsets (e.g. [100, -200])\r
-      */\r
-    getOffsetsTo : function(el){\r
-        var o = this.getXY(),\r
-               e = Ext.fly(el, '_internal').getXY();\r
-        return [o[0]-e[0],o[1]-e[1]];\r
-    },\r
-\r
-    /**\r
-     * Sets the X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-     * @param {Number} The X position of the element\r
-     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setX : function(x, animate){           \r
-           return this.setXY([x, this.getY()], animTest.call(this, arguments, animate, 1));\r
-    },\r
-\r
-    /**\r
-     * Sets the Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-     * @param {Number} The Y position of the element\r
-     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setY : function(y, animate){           \r
-           return this.setXY([this.getX(), y], animTest.call(this, arguments, animate, 1));\r
-    },\r
-\r
-    /**\r
-     * Sets the element's left position directly using CSS style (instead of {@link #setX}).\r
-     * @param {String} left The left CSS property value\r
-     * @return {Ext.Element} this\r
-     */\r
-    setLeft : function(left){\r
-        this.setStyle(LEFT, this.addUnits(left));\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Sets the element's top position directly using CSS style (instead of {@link #setY}).\r
-     * @param {String} top The top CSS property value\r
-     * @return {Ext.Element} this\r
-     */\r
-    setTop : function(top){\r
-        this.setStyle(TOP, this.addUnits(top));\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Sets the element's CSS right style.\r
-     * @param {String} right The right CSS property value\r
-     * @return {Ext.Element} this\r
-     */\r
-    setRight : function(right){\r
-        this.setStyle(RIGHT, this.addUnits(right));\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Sets the element's CSS bottom style.\r
-     * @param {String} bottom The bottom CSS property value\r
-     * @return {Ext.Element} this\r
-     */\r
-    setBottom : function(bottom){\r
-        this.setStyle(BOTTOM, this.addUnits(bottom));\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
-     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-     * @param {Array} pos Contains X & Y [x, y] values for new position (coordinates are page-based)\r
-     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setXY : function(pos, animate){\r
-           var me = this;\r
-        if(!animate || !me.anim){\r
-            D.setXY(me.dom, pos);\r
-        }else{\r
-            me.anim({points: {to: pos}}, me.preanim(arguments, 1), 'motion');\r
-        }\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
-     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-     * @param {Number} x X value for new position (coordinates are page-based)\r
-     * @param {Number} y Y value for new position (coordinates are page-based)\r
-     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setLocation : function(x, y, animate){\r
-        return this.setXY([x, y], animTest.call(this, arguments, animate, 2));\r
-    },\r
-\r
-    /**\r
-     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
-     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
-     * @param {Number} x X value for new position (coordinates are page-based)\r
-     * @param {Number} y Y value for new position (coordinates are page-based)\r
-     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    moveTo : function(x, y, animate){\r
-        return this.setXY([x, y], animTest.call(this, arguments, animate, 2));        \r
-    },    \r
-    \r
-    /**\r
-     * Gets the left X coordinate\r
-     * @param {Boolean} local True to get the local css position instead of page coordinate\r
-     * @return {Number}\r
-     */\r
-    getLeft : function(local){\r
-           return !local ? this.getX() : parseInt(this.getStyle(LEFT), 10) || 0;\r
-    },\r
-\r
-    /**\r
-     * Gets the right X coordinate of the element (element X position + element width)\r
-     * @param {Boolean} local True to get the local css position instead of page coordinate\r
-     * @return {Number}\r
-     */\r
-    getRight : function(local){\r
-           var me = this;\r
-           return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.getWidth()) || 0;\r
-    },\r
-\r
-    /**\r
-     * Gets the top Y coordinate\r
-     * @param {Boolean} local True to get the local css position instead of page coordinate\r
-     * @return {Number}\r
-     */\r
-    getTop : function(local) {\r
-           return !local ? this.getY() : parseInt(this.getStyle(TOP), 10) || 0;\r
-    },\r
-\r
-    /**\r
-     * Gets the bottom Y coordinate of the element (element Y position + element height)\r
-     * @param {Boolean} local True to get the local css position instead of page coordinate\r
-     * @return {Number}\r
-     */\r
-    getBottom : function(local){\r
-           var me = this;\r
-           return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.getHeight()) || 0;\r
-    },\r
-\r
-    /**\r
-    * Initializes positioning on this element. If a desired position is not passed, it will make the\r
-    * the element positioned relative IF it is not already positioned.\r
-    * @param {String} pos (optional) Positioning to use "relative", "absolute" or "fixed"\r
-    * @param {Number} zIndex (optional) The zIndex to apply\r
-    * @param {Number} x (optional) Set the page X position\r
-    * @param {Number} y (optional) Set the page Y position\r
-    */\r
-    position : function(pos, zIndex, x, y){\r
-           var me = this;\r
-           \r
-        if(!pos && me.isStyle(POSITION, STATIC)){           \r
-            me.setStyle(POSITION, RELATIVE);           \r
-        } else if(pos) {\r
-            me.setStyle(POSITION, pos);\r
-        }\r
-        if(zIndex){\r
-            me.setStyle(ZINDEX, zIndex);\r
-        }\r
-        if(x || y) me.setXY([x || false, y || false]);\r
-    },\r
-\r
-    /**\r
-    * Clear positioning back to the default when the document was loaded\r
-    * @param {String} value (optional) The value to use for the left,right,top,bottom, defaults to '' (empty string). You could use 'auto'.\r
-    * @return {Ext.Element} this\r
-     */\r
-    clearPositioning : function(value){\r
-        value = value || '';\r
-        this.setStyle({\r
-            left : value,\r
-            right : value,\r
-            top : value,\r
-            bottom : value,\r
-            "z-index" : "",\r
-            position : STATIC\r
-        });\r
-        return this;\r
-    },\r
-\r
-    /**\r
-    * Gets an object with all CSS positioning properties. Useful along with setPostioning to get\r
-    * snapshot before performing an update and then restoring the element.\r
-    * @return {Object}\r
-    */\r
-    getPositioning : function(){\r
-        var l = this.getStyle(LEFT);\r
-        var t = this.getStyle(TOP);\r
-        return {\r
-            "position" : this.getStyle(POSITION),\r
-            "left" : l,\r
-            "right" : l ? "" : this.getStyle(RIGHT),\r
-            "top" : t,\r
-            "bottom" : t ? "" : this.getStyle(BOTTOM),\r
-            "z-index" : this.getStyle(ZINDEX)\r
-        };\r
-    },\r
-    \r
-    /**\r
-    * Set positioning with an object returned by getPositioning().\r
-    * @param {Object} posCfg\r
-    * @return {Ext.Element} this\r
-     */\r
-    setPositioning : function(pc){\r
-           var me = this,\r
-               style = me.dom.style;\r
-               \r
-        me.setStyle(pc);\r
-        \r
-        if(pc.right == AUTO){\r
-            style.right = "";\r
-        }\r
-        if(pc.bottom == AUTO){\r
-            style.bottom = "";\r
-        }\r
-        \r
-        return me;\r
-    },    \r
-       \r
-    /**\r
-     * Translates the passed page coordinates into left/top css values for this element\r
-     * @param {Number/Array} x The page x or an array containing [x, y]\r
-     * @param {Number} y (optional) The page y, required if x is not an array\r
-     * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)}\r
-     */\r
-    translatePoints : function(x, y){               \r
-           y = isNaN(x[1]) ? y : x[1];\r
-        x = isNaN(x[0]) ? x : x[0];\r
-        var me = this,\r
-               relative = me.isStyle(POSITION, RELATIVE),\r
-               o = me.getXY(),\r
-               l = parseInt(me.getStyle(LEFT), 10),\r
-               t = parseInt(me.getStyle(TOP), 10);\r
-        \r
-        l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft);\r
-        t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop);        \r
-\r
-        return {left: (x - o[0] + l), top: (y - o[1] + t)}; \r
-    },\r
-    \r
-    animTest : animTest\r
-});\r
-})();/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
-    /**\r
-     * Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.\r
-     * @param {Object} box The box to fill {x, y, width, height}\r
-     * @param {Boolean} adjust (optional) Whether to adjust for box-model issues automatically\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setBox : function(box, adjust, animate){\r
-        var me = this,\r
-               w = box.width, \r
-               h = box.height;\r
-        if((adjust && !me.autoBoxAdjust) && !me.isBorderBox()){\r
-           w -= (me.getBorderWidth("lr") + me.getPadding("lr"));\r
-           h -= (me.getBorderWidth("tb") + me.getPadding("tb"));\r
-        }\r
-        me.setBounds(box.x, box.y, w, h, me.animTest.call(me, arguments, animate, 2));\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Return a box {x, y, width, height} that can be used to set another elements\r
-     * size/location to match this element.\r
-     * @param {Boolean} contentBox (optional) If true a box for the content of the element is returned.\r
-     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page x/y.\r
-     * @return {Object} box An object in the format {x, y, width, height}\r
-     */\r
-       getBox : function(contentBox, local) {      \r
-           var me = this,\r
-               xy,\r
-               left,\r
-               top,\r
-               getBorderWidth = me.getBorderWidth,\r
-               getPadding = me.getPadding, \r
-               l,\r
-               r,\r
-               t,\r
-               b;\r
-        if(!local){\r
-            xy = me.getXY();\r
-        }else{\r
-            left = parseInt(me.getStyle("left"), 10) || 0;\r
-            top = parseInt(me.getStyle("top"), 10) || 0;\r
-            xy = [left, top];\r
-        }\r
-        var el = me.dom, w = el.offsetWidth, h = el.offsetHeight, bx;\r
-        if(!contentBox){\r
-            bx = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: w, height: h};\r
-        }else{\r
-            l = getBorderWidth.call(me, "l") + getPadding.call(me, "l");\r
-            r = getBorderWidth.call(me, "r") + getPadding.call(me, "r");\r
-            t = getBorderWidth.call(me, "t") + getPadding.call(me, "t");\r
-            b = getBorderWidth.call(me, "b") + getPadding.call(me, "b");\r
-            bx = {x: xy[0]+l, y: xy[1]+t, 0: xy[0]+l, 1: xy[1]+t, width: w-(l+r), height: h-(t+b)};\r
-        }\r
-        bx.right = bx.x + bx.width;\r
-        bx.bottom = bx.y + bx.height;\r
-        return bx;\r
-       },\r
-       \r
-    /**\r
-     * Move this element relative to its current position.\r
-     * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down").\r
-     * @param {Number} distance How far to move the element in pixels\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-     move : function(direction, distance, animate){\r
-        var me = this,         \r
-               xy = me.getXY(),\r
-               x = xy[0],\r
-               y = xy[1],              \r
-               left = [x - distance, y],\r
-               right = [x + distance, y],\r
-               top = [x, y - distance],\r
-               bottom = [x, y + distance],\r
-               hash = {\r
-                       l :     left,\r
-                       left : left,\r
-                       r : right,\r
-                       right : right,\r
-                       t : top,\r
-                       top : top,\r
-                       up : top,\r
-                       b : bottom, \r
-                       bottom : bottom,\r
-                       down : bottom                           \r
-               };\r
-        \r
-           direction = direction.toLowerCase();    \r
-           me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2));\r
-    },\r
-    \r
-    /**\r
-     * Quick set left and top adding default units\r
-     * @param {String} left The left CSS property value\r
-     * @param {String} top The top CSS property value\r
-     * @return {Ext.Element} this\r
-     */\r
-     setLeftTop : function(left, top){\r
-           var me = this,\r
-               style = me.dom.style;\r
-        style.left = me.addUnits(left);\r
-        style.top = me.addUnits(top);\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Returns the region of the given element.\r
-     * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
-     * @return {Region} A Ext.lib.Region containing "top, left, bottom, right" member data.\r
-     */\r
-    getRegion : function(){\r
-        return Ext.lib.Dom.getRegion(this.dom);\r
-    },\r
-    \r
-    /**\r
-     * Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.\r
-     * @param {Number} x X value for new position (coordinates are page-based)\r
-     * @param {Number} y Y value for new position (coordinates are page-based)\r
-     * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>\r
-     * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels)</li>\r
-     * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.\r
-     * </ul></div>\r
-     * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>\r
-     * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels)</li>\r
-     * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>\r
-     * </ul></div>\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setBounds : function(x, y, width, height, animate){\r
-           var me = this;\r
-        if (!animate || !me.anim) {\r
-            me.setSize(width, height);\r
-            me.setLocation(x, y);\r
-        } else {\r
-            me.anim({points: {to: [x, y]}, \r
-                        width: {to: me.adjustWidth(width)}, \r
-                        height: {to: me.adjustHeight(height)}},\r
-                     me.preanim(arguments, 4), \r
-                     'motion');\r
-        }\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Sets the element's position and size the specified region. If animation is true then width, height, x and y will be animated concurrently.\r
-     * @param {Ext.lib.Region} region The region to fill\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Ext.Element} this\r
-     */\r
-    setRegion : function(region, animate) {\r
-        return this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.animTest.call(this, arguments, animate, 1));\r
-    }\r
-});/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
-    /**\r
-     * Returns true if this element is scrollable.\r
-     * @return {Boolean}\r
-     */\r
-    isScrollable : function(){\r
-        var dom = this.dom;\r
-        return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;\r
-    },\r
-\r
-    /**\r
-     * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().\r
-     * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.\r
-     * @param {Number} value The new scroll value.\r
-     * @return {Element} this\r
-     */\r
-    scrollTo : function(side, value){\r
-        this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Returns the current scroll position of the element.\r
-     * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}\r
-     */\r
-    getScroll : function(){\r
-        var d = this.dom, \r
-            doc = document,\r
-            body = doc.body,\r
-            docElement = doc.documentElement,\r
-            l,\r
-            t,\r
-            ret;\r
-\r
-        if(d == doc || d == body){\r
-            if(Ext.isIE && Ext.isStrict){\r
-                l = docElement.scrollLeft; \r
-                t = docElement.scrollTop;\r
-            }else{\r
-                l = window.pageXOffset;\r
-                t = window.pageYOffset;\r
-            }\r
-            ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};\r
-        }else{\r
-            ret = {left: d.scrollLeft, top: d.scrollTop};\r
-        }\r
-        return ret;\r
-    }\r
-});/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
-    /**\r
-     * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().\r
-     * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.\r
-     * @param {Number} value The new scroll value\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Element} this\r
-     */\r
-    scrollTo : function(side, value, animate){\r
-        var tester = /top/i,\r
-               prop = "scroll" + (tester.test(side) ? "Top" : "Left"),\r
-               me = this,\r
-               dom = me.dom;\r
-        if (!animate || !me.anim) {\r
-            dom[prop] = value;\r
-        } else {\r
-            me.anim({scroll: {to: tester.test(prop) ? [dom[prop], value] : [value, dom[prop]]}},\r
-                        me.preanim(arguments, 2), 'scroll');\r
-        }\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Scrolls this element into view within the passed container.\r
-     * @param {Mixed} container (optional) The container element to scroll (defaults to document.body).  Should be a\r
-     * string (id), dom node, or Ext.Element.\r
-     * @param {Boolean} hscroll (optional) False to disable horizontal scroll (defaults to true)\r
-     * @return {Ext.Element} this\r
-     */\r
-    scrollIntoView : function(container, hscroll){\r
-        var c = Ext.getDom(container) || Ext.getBody().dom,\r
-               el = this.dom,\r
-               o = this.getOffsetsTo(c),\r
-            l = o[0] + c.scrollLeft,\r
-            t = o[1] + c.scrollTop,\r
-            b = t + el.offsetHeight,\r
-            r = l + el.offsetWidth,\r
-               ch = c.clientHeight,\r
-               ct = parseInt(c.scrollTop, 10),\r
-               cl = parseInt(c.scrollLeft, 10),\r
-               cb = ct + ch,\r
-               cr = cl + c.clientWidth;\r
-\r
-        if (el.offsetHeight > ch || t < ct) {\r
-               c.scrollTop = t;\r
-        } else if (b > cb){\r
-            c.scrollTop = b-ch;\r
-        }\r
-        c.scrollTop = c.scrollTop; // corrects IE, other browsers will ignore\r
-\r
-        if(hscroll !== false){\r
-                       if(el.offsetWidth > c.clientWidth || l < cl){\r
-                c.scrollLeft = l;\r
-            }else if(r > cr){\r
-                c.scrollLeft = r - c.clientWidth;\r
-            }\r
-            c.scrollLeft = c.scrollLeft;\r
-        }\r
-        return this;\r
-    },\r
-\r
-    // private\r
-    scrollChildIntoView : function(child, hscroll){\r
-        Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll);\r
-    },\r
-    \r
-    /**\r
-     * Scrolls this element the specified direction. Does bounds checking to make sure the scroll is\r
-     * within this element's scrollable range.\r
-     * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down").\r
-     * @param {Number} distance How far to scroll the element in pixels\r
-     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-     * @return {Boolean} Returns true if a scroll was triggered or false if the element\r
-     * was scrolled as far as it could go.\r
-     */\r
-     scroll : function(direction, distance, animate){\r
-         if(!this.isScrollable()){\r
-             return;\r
-         }\r
-         var el = this.dom,\r
-            l = el.scrollLeft, t = el.scrollTop,\r
-            w = el.scrollWidth, h = el.scrollHeight,\r
-            cw = el.clientWidth, ch = el.clientHeight,\r
-            scrolled = false, v,\r
-            hash = {\r
-                l: Math.min(l + distance, w-cw),\r
-                r: v = Math.max(l - distance, 0),\r
-                t: Math.max(t - distance, 0),\r
-                b: Math.min(t + distance, h-ch)\r
-            };\r
-            hash.d = hash.b;\r
-            hash.u = hash.t;\r
-            \r
-         direction = direction.substr(0, 1);\r
-         if((v = hash[direction]) > -1){\r
-            scrolled = true;\r
-            this.scrollTo(direction == 'l' || direction == 'r' ? 'left' : 'top', v, this.preanim(arguments, 2));\r
-         }\r
-         return scrolled;\r
-    }\r
-});/**\r
- * @class Ext.Element\r
- */\r
-/**\r
- * Visibility mode constant for use with {@link #setVisibilityMode}. Use visibility to hide element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.Element.VISIBILITY = 1;\r
-/**\r
- * Visibility mode constant for use with {@link #setVisibilityMode}. Use display to hide element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.Element.DISPLAY = 2;\r
-\r
-Ext.Element.addMethods(function(){\r
-    var VISIBILITY = "visibility",\r
-        DISPLAY = "display",\r
-        HIDDEN = "hidden",\r
-        NONE = "none",      \r
-        ORIGINALDISPLAY = 'originalDisplay',\r
-        VISMODE = 'visibilityMode',\r
-        ELDISPLAY = Ext.Element.DISPLAY,\r
-        data = Ext.Element.data,\r
-        getDisplay = function(dom){\r
-            var d = data(dom, ORIGINALDISPLAY);\r
-            if(d === undefined){\r
-                data(dom, ORIGINALDISPLAY, d = '');\r
-            }\r
-            return d;\r
-        },\r
-        getVisMode = function(dom){\r
-            var m = data(dom, VISMODE);\r
-            if(m === undefined){\r
-                data(dom, VISMODE, m = 1)\r
-            }\r
-            return m;\r
-        };\r
-    \r
-    return {\r
-        /**\r
-         * The element's default display mode  (defaults to "")\r
-         * @type String\r
-         */\r
-        originalDisplay : "",\r
-        visibilityMode : 1,\r
-        \r
-        /**\r
-         * Sets the element's visibility mode. When setVisible() is called it\r
-         * will use this to determine whether to set the visibility or the display property.\r
-         * @param visMode Ext.Element.VISIBILITY or Ext.Element.DISPLAY\r
-         * @return {Ext.Element} this\r
-         */\r
-        setVisibilityMode : function(visMode){  \r
-            data(this.dom, VISMODE, visMode);\r
-            return this;\r
-        },\r
-        \r
-        /**\r
-         * Perform custom animation on this element.\r
-         * <div><ul class="mdetail-params">\r
-         * <li><u>Animation Properties</u></li>\r
-         * \r
-         * <p>The Animation Control Object enables gradual transitions for any member of an\r
-         * element's style object that takes a numeric value including but not limited to\r
-         * these properties:</p><div><ul class="mdetail-params">\r
-         * <li><tt>bottom, top, left, right</tt></li>\r
-         * <li><tt>height, width</tt></li>\r
-         * <li><tt>margin, padding</tt></li>\r
-         * <li><tt>borderWidth</tt></li>\r
-         * <li><tt>opacity</tt></li>\r
-         * <li><tt>fontSize</tt></li>\r
-         * <li><tt>lineHeight</tt></li>\r
-         * </ul></div>\r
-         * \r
-         * \r
-         * <li><u>Animation Property Attributes</u></li>\r
-         * \r
-         * <p>Each Animation Property is a config object with optional properties:</p>\r
-         * <div><ul class="mdetail-params">\r
-         * <li><tt>by</tt>*  : relative change - start at current value, change by this value</li>\r
-         * <li><tt>from</tt> : ignore current value, start from this value</li>\r
-         * <li><tt>to</tt>*  : start at current value, go to this value</li>\r
-         * <li><tt>unit</tt> : any allowable unit specification</li>\r
-         * <p>* do not specify both <tt>to</tt> and <tt>by</tt> for an animation property</p>\r
-         * </ul></div>\r
-         * \r
-         * <li><u>Animation Types</u></li>\r
-         * \r
-         * <p>The supported animation types:</p><div><ul class="mdetail-params">\r
-         * <li><tt>'run'</tt> : Default\r
-         * <pre><code>\r
-var el = Ext.get('complexEl');\r
-el.animate(\r
-    // animation control object\r
-    {\r
-        borderWidth: {to: 3, from: 0},\r
-        opacity: {to: .3, from: 1},\r
-        height: {to: 50, from: el.getHeight()},\r
-        width: {to: 300, from: el.getWidth()},\r
-        top  : {by: - 100, unit: 'px'},\r
-    },\r
-    0.35,      // animation duration\r
-    null,      // callback\r
-    'easeOut', // easing method\r
-    'run'      // animation type ('run','color','motion','scroll')    \r
-);\r
-         * </code></pre>\r
-         * </li>\r
-         * <li><tt>'color'</tt>\r
-         * <p>Animates transition of background, text, or border colors.</p>\r
-         * <pre><code>\r
-el.animate(\r
-    // animation control object\r
-    {\r
-        color: { to: '#06e' },\r
-        backgroundColor: { to: '#e06' }\r
-    },\r
-    0.35,      // animation duration\r
-    null,      // callback\r
-    'easeOut', // easing method\r
-    'color'    // animation type ('run','color','motion','scroll')    \r
-);\r
-         * </code></pre> \r
-         * </li>\r
-         * \r
-         * <li><tt>'motion'</tt>\r
-         * <p>Animates the motion of an element to/from specific points using optional bezier\r
-         * way points during transit.</p>\r
-         * <pre><code>\r
-el.animate(\r
-    // animation control object\r
-    {\r
-        borderWidth: {to: 3, from: 0},\r
-        opacity: {to: .3, from: 1},\r
-        height: {to: 50, from: el.getHeight()},\r
-        width: {to: 300, from: el.getWidth()},\r
-        top  : {by: - 100, unit: 'px'},\r
-        points: {\r
-            to: [50, 100],  // go to this point\r
-            control: [      // optional bezier way points\r
-                [ 600, 800],\r
-                [-100, 200]\r
-            ]\r
-        }\r
-    },\r
-    3000,      // animation duration (milliseconds!)\r
-    null,      // callback\r
-    'easeOut', // easing method\r
-    'motion'   // animation type ('run','color','motion','scroll')    \r
-);\r
-         * </code></pre> \r
-         * </li>\r
-         * <li><tt>'scroll'</tt>\r
-         * <p>Animate horizontal or vertical scrolling of an overflowing page element.</p>\r
-         * <pre><code>\r
-el.animate(\r
-    // animation control object\r
-    {\r
-        scroll: {to: [400, 300]}\r
-    },\r
-    0.35,      // animation duration\r
-    null,      // callback\r
-    'easeOut', // easing method\r
-    'scroll'   // animation type ('run','color','motion','scroll')    \r
-);\r
-         * </code></pre> \r
-         * </li>\r
-         * </ul></div>\r
-         * \r
-         * </ul></div>\r
-         * \r
-         * @param {Object} args The animation control args\r
-         * @param {Float} duration (optional) How long the animation lasts in seconds (defaults to <tt>.35</tt>)\r
-         * @param {Function} onComplete (optional) Function to call when animation completes\r
-         * @param {String} easing (optional) {@link Ext.Fx#easing} method to use (defaults to <tt>'easeOut'</tt>)\r
-         * @param {String} animType (optional) <tt>'run'</tt> is the default. Can also be <tt>'color'</tt>,\r
-         * <tt>'motion'</tt>, or <tt>'scroll'</tt>\r
-         * @return {Ext.Element} this\r
-         */\r
-        animate : function(args, duration, onComplete, easing, animType){       \r
-            this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType);\r
-            return this;\r
-        },\r
-    \r
-        /*\r
-         * @private Internal animation call\r
-         */\r
-        anim : function(args, opt, animType, defaultDur, defaultEase, cb){\r
-            animType = animType || 'run';\r
-            opt = opt || {};\r
-            var me = this,              \r
-                anim = Ext.lib.Anim[animType](\r
-                    me.dom, \r
-                    args,\r
-                    (opt.duration || defaultDur) || .35,\r
-                    (opt.easing || defaultEase) || 'easeOut',\r
-                    function(){\r
-                        if(cb) cb.call(me);\r
-                        if(opt.callback) opt.callback.call(opt.scope || me, me, opt);\r
-                    },\r
-                    me\r
-                );\r
-            opt.anim = anim;\r
-            return anim;\r
-        },\r
-    \r
-        // private legacy anim prep\r
-        preanim : function(a, i){\r
-            return !a[i] ? false : (Ext.isObject(a[i]) ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]});\r
-        },\r
-        \r
-        /**\r
-         * Checks whether the element is currently visible using both visibility and display properties.         \r
-         * @return {Boolean} True if the element is currently visible, else false\r
-         */\r
-        isVisible : function() {\r
-            return !this.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE);\r
-        },\r
-        \r
-        /**\r
-         * Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use\r
-         * the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the visibility property.\r
-         * @param {Boolean} visible Whether the element is visible\r
-         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-         setVisible : function(visible, animate){\r
-            var me = this,\r
-                dom = me.dom,\r
-                isDisplay = getVisMode(this.dom) == ELDISPLAY;\r
-                \r
-            if (!animate || !me.anim) {\r
-                if(isDisplay){\r
-                    me.setDisplayed(visible);\r
-                }else{\r
-                    me.fixDisplay();\r
-                    dom.style.visibility = visible ? "visible" : HIDDEN;\r
-                }\r
-            }else{\r
-                // closure for composites            \r
-                if(visible){\r
-                    me.setOpacity(.01);\r
-                    me.setVisible(true);\r
-                }\r
-                me.anim({opacity: { to: (visible?1:0) }},\r
-                        me.preanim(arguments, 1),\r
-                        null,\r
-                        .35,\r
-                        'easeIn',\r
-                        function(){\r
-                             if(!visible){\r
-                                 dom.style[isDisplay ? DISPLAY : VISIBILITY] = (isDisplay) ? NONE : HIDDEN;                     \r
-                                 Ext.fly(dom).setOpacity(1);\r
-                             }\r
-                        });\r
-            }\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         * Toggles the element's visibility or display, depending on visibility mode.\r
-         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-        toggle : function(animate){\r
-            var me = this;\r
-            me.setVisible(!me.isVisible(), me.preanim(arguments, 0));\r
-            return me;\r
-        },\r
-    \r
-        /**\r
-         * Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true.\r
-         * @param {Mixed} value Boolean value to display the element using its default display, or a string to set the display directly.\r
-         * @return {Ext.Element} this\r
-         */\r
-        setDisplayed : function(value) {            \r
-            if(typeof value == "boolean"){\r
-               value = value ? getDisplay(this.dom) : NONE;\r
-            }\r
-            this.setStyle(DISPLAY, value);\r
-            return this;\r
-        },\r
-        \r
-        // private\r
-        fixDisplay : function(){\r
-            var me = this;\r
-            if(me.isStyle(DISPLAY, NONE)){\r
-                me.setStyle(VISIBILITY, HIDDEN);\r
-                me.setStyle(DISPLAY, getDisplay(this.dom)); // first try reverting to default\r
-                if(me.isStyle(DISPLAY, NONE)){ // if that fails, default to block\r
-                    me.setStyle(DISPLAY, "block");\r
-                }\r
-            }\r
-        },\r
-    \r
-        /**\r
-         * Hide this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.\r
-         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-        hide : function(animate){\r
-            this.setVisible(false, this.preanim(arguments, 0));\r
-            return this;\r
-        },\r
-    \r
-        /**\r
-        * Show this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.\r
-        * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
-         * @return {Ext.Element} this\r
-         */\r
-        show : function(animate){\r
-            this.setVisible(true, this.preanim(arguments, 0));\r
-            return this;\r
-        }\r
-    }\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods(\r
-function(){\r
-    var VISIBILITY = "visibility",\r
-        DISPLAY = "display",\r
-        HIDDEN = "hidden",\r
-        NONE = "none",\r
-           XMASKED = "x-masked",\r
-               XMASKEDRELATIVE = "x-masked-relative",\r
-        data = Ext.Element.data;\r
-               \r
-       return {\r
-               /**\r
-            * Checks whether the element is currently visible using both visibility and display properties.\r
-            * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false)\r
-            * @return {Boolean} True if the element is currently visible, else false\r
-            */\r
-           isVisible : function(deep) {\r
-               var vis = !this.isStyle(VISIBILITY,HIDDEN) && !this.isStyle(DISPLAY,NONE),\r
-                       p = this.dom.parentNode;\r
-               if(deep !== true || !vis){\r
-                   return vis;\r
-               }               \r
-               while(p && !/body/i.test(p.tagName)){\r
-                   if(!Ext.fly(p, '_isVisible').isVisible()){\r
-                       return false;\r
-                   }\r
-                   p = p.parentNode;\r
-               }\r
-               return true;\r
-           },\r
-           \r
-           /**\r
-            * Returns true if display is not "none"\r
-            * @return {Boolean}\r
-            */\r
-           isDisplayed : function() {\r
-               return !this.isStyle(DISPLAY, NONE);\r
-           },\r
-           \r
-               /**\r
-            * Convenience method for setVisibilityMode(Element.DISPLAY)\r
-            * @param {String} display (optional) What to set display to when visible\r
-            * @return {Ext.Element} this\r
-            */\r
-           enableDisplayMode : function(display){          \r
-               this.setVisibilityMode(Ext.Element.DISPLAY);\r
-               if(!Ext.isEmpty(display)){\r
-                data(this.dom, 'originalDisplay', display);\r
-            }\r
-               return this;\r
-           },\r
-           \r
-               /**\r
-            * Puts a mask over this element to disable user interaction. Requires core.css.\r
-            * This method can only be applied to elements which accept child nodes.\r
-            * @param {String} msg (optional) A message to display in the mask\r
-            * @param {String} msgCls (optional) A css class to apply to the msg element\r
-            * @return {Element} The mask element\r
-            */\r
-           mask : function(msg, msgCls){\r
-                   var me = this,\r
-                       dom = me.dom,\r
-                       dh = Ext.DomHelper,\r
-                       EXTELMASKMSG = "ext-el-mask-msg",\r
-                el, \r
-                mask;\r
-                       \r
-               if(me.getStyle("position") == "static"){\r
-                   me.addClass(XMASKEDRELATIVE);\r
-               }\r
-               if((el = data(dom, 'maskMsg'))){\r
-                   el.remove();\r
-               }\r
-               if((el = data(dom, 'mask'))){\r
-                   el.remove();\r
-               }\r
-       \r
-            mask = dh.append(dom, {cls : "ext-el-mask"}, true);\r
-               data(dom, 'mask', mask);\r
-       \r
-               me.addClass(XMASKED);\r
-               mask.setDisplayed(true);\r
-               if(typeof msg == 'string'){\r
-                var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true);\r
-                data(dom, 'maskMsg', mm);\r
-                   mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG;\r
-                   mm.dom.firstChild.innerHTML = msg;\r
-                   mm.setDisplayed(true);\r
-                   mm.center(me);\r
-               }\r
-               if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto'){ // ie will not expand full height automatically\r
-                   mask.setSize(undefined, me.getHeight());\r
-               }\r
-               return mask;\r
-           },\r
-       \r
-           /**\r
-            * Removes a previously applied mask.\r
-            */\r
-           unmask : function(){\r
-                   var me = this,\r
-                dom = me.dom,\r
-                       mask = data(dom, 'mask'),\r
-                       maskMsg = data(dom, 'maskMsg');\r
-               if(mask){\r
-                   if(maskMsg){\r
-                       maskMsg.remove();\r
-                    data(dom, 'maskMsg', undefined);\r
-                   }\r
-                   mask.remove();\r
-                data(dom, 'mask', undefined);\r
-               }\r
-               me.removeClass([XMASKED, XMASKEDRELATIVE]);\r
-           },\r
-       \r
-           /**\r
-            * Returns true if this element is masked\r
-            * @return {Boolean}\r
-            */\r
-           isMasked : function(){\r
-            var m = data(this.dom, 'mask');\r
-               return m && m.isVisible();\r
-           },\r
-           \r
-           /**\r
-            * Creates an iframe shim for this element to keep selects and other windowed objects from\r
-            * showing through.\r
-            * @return {Ext.Element} The new shim element\r
-            */\r
-           createShim : function(){\r
-               var el = document.createElement('iframe'),              \r
-                       shim;\r
-               el.frameBorder = '0';\r
-               el.className = 'ext-shim';\r
-               if(Ext.isIE && Ext.isSecure){\r
-                   el.src = Ext.SSL_SECURE_URL;\r
-               }\r
-               shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));\r
-               shim.autoBoxAdjust = false;\r
-               return shim;\r
-           }\r
-    };\r
-}());/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
-    /**\r
-     * Convenience method for constructing a KeyMap\r
-     * @param {Number/Array/Object/String} key Either a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options:\r
-     *                                  {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function\r
-     * @return {Ext.KeyMap} The KeyMap created\r
-     */\r
-    addKeyListener : function(key, fn, scope){\r
-        var config;\r
-        if(!Ext.isObject(key) || Ext.isArray(key)){\r
-            config = {\r
-                key: key,\r
-                fn: fn,\r
-                scope: scope\r
-            };\r
-        }else{\r
-            config = {\r
-                key : key.key,\r
-                shift : key.shift,\r
-                ctrl : key.ctrl,\r
-                alt : key.alt,\r
-                fn: fn,\r
-                scope: scope\r
-            };\r
-        }\r
-        return new Ext.KeyMap(this, config);\r
-    },\r
-\r
-    /**\r
-     * Creates a KeyMap for this element\r
-     * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details\r
-     * @return {Ext.KeyMap} The KeyMap created\r
-     */\r
-    addKeyMap : function(config){\r
-        return new Ext.KeyMap(this, config);\r
-    }\r
-});(function(){\r
-    // contants\r
-    var NULL = null,\r
-        UNDEFINED = undefined,\r
-        TRUE = true,\r
-        FALSE = false,\r
-        SETX = "setX",\r
-        SETY = "setY",\r
-        SETXY = "setXY",\r
-        LEFT = "left",\r
-        BOTTOM = "bottom",\r
-        TOP = "top",\r
-        RIGHT = "right",\r
-        HEIGHT = "height",\r
-        WIDTH = "width",\r
-        POINTS = "points",\r
-        HIDDEN = "hidden",\r
-        ABSOLUTE = "absolute",\r
-        VISIBLE = "visible",\r
-        MOTION = "motion",\r
-        POSITION = "position",\r
-        EASEOUT = "easeOut",\r
-        /*\r
-         * Use a light flyweight here since we are using so many callbacks and are always assured a DOM element\r
-         */\r
-        flyEl = new Ext.Element.Flyweight(),\r
-        queues = {},\r
-        getObject = function(o){\r
-            return o || {};\r
-        },\r
-        fly = function(dom){\r
-            flyEl.dom = dom;\r
-            flyEl.id = Ext.id(dom);\r
-            return flyEl;\r
-        },\r
-        /*\r
-         * Queueing now stored outside of the element due to closure issues\r
-         */\r
-        getQueue = function(id){\r
-            if(!queues[id]){\r
-                queues[id] = [];\r
-            }\r
-            return queues[id];\r
-        },\r
-        setQueue = function(id, value){\r
-            queues[id] = value;\r
-        };\r
-        \r
-//Notifies Element that fx methods are available\r
-Ext.enableFx = TRUE;\r
-\r
-/**\r
- * @class Ext.Fx\r
- * <p>A class to provide basic animation and visual effects support.  <b>Note:</b> This class is automatically applied\r
- * to the {@link Ext.Element} interface when included, so all effects calls should be performed via {@link Ext.Element}.\r
- * Conversely, since the effects are not actually defined in {@link Ext.Element}, Ext.Fx <b>must</b> be\r
- * {@link Ext#enableFx included} in order for the Element effects to work.</p><br/>\r
- * \r
- * <p><b><u>Method Chaining</u></b></p>\r
- * <p>It is important to note that although the Fx methods and many non-Fx Element methods support "method chaining" in that\r
- * they return the Element object itself as the method return value, it is not always possible to mix the two in a single\r
- * method chain.  The Fx methods use an internal effects queue so that each effect can be properly timed and sequenced.\r
- * Non-Fx methods, on the other hand, have no such internal queueing and will always execute immediately.  For this reason,\r
- * while it may be possible to mix certain Fx and non-Fx method calls in a single chain, it may not always provide the\r
- * expected results and should be done with care.  Also see <tt>{@link #callback}</tt>.</p><br/>\r
- *\r
- * <p><b><u>Anchor Options for Motion Effects</u></b></p>\r
- * <p>Motion effects support 8-way anchoring, meaning that you can choose one of 8 different anchor points on the Element\r
- * that will serve as either the start or end point of the animation.  Following are all of the supported anchor positions:</p>\r
-<pre>\r
-Value  Description\r
------  -----------------------------\r
-tl     The top left corner\r
-t      The center of the top edge\r
-tr     The top right corner\r
-l      The center of the left edge\r
-r      The center of the right edge\r
-bl     The bottom left corner\r
-b      The center of the bottom edge\r
-br     The bottom right corner\r
-</pre>\r
- * <b>Note</b>: some Fx methods accept specific custom config parameters.  The options shown in the Config Options\r
- * section below are common options that can be passed to any Fx method unless otherwise noted.</b>\r
- * \r
- * @cfg {Function} callback A function called when the effect is finished.  Note that effects are queued internally by the\r
- * Fx class, so a callback is not required to specify another effect -- effects can simply be chained together\r
- * and called in sequence (see note for <b><u>Method Chaining</u></b> above), for example:<pre><code>\r
- * el.slideIn().highlight();\r
- * </code></pre>\r
- * The callback is intended for any additional code that should run once a particular effect has completed. The Element\r
- * being operated upon is passed as the first parameter.\r
- * \r
- * @cfg {Object} scope The scope of the <tt>{@link #callback}</tt> function\r
- * \r
- * @cfg {String} easing A valid Ext.lib.Easing value for the effect:</p><div class="mdetail-params"><ul>\r
- * <li><b><tt>backBoth</tt></b></li>\r
- * <li><b><tt>backIn</tt></b></li>\r
- * <li><b><tt>backOut</tt></b></li>\r
- * <li><b><tt>bounceBoth</tt></b></li>\r
- * <li><b><tt>bounceIn</tt></b></li>\r
- * <li><b><tt>bounceOut</tt></b></li>\r
- * <li><b><tt>easeBoth</tt></b></li>\r
- * <li><b><tt>easeBothStrong</tt></b></li>\r
- * <li><b><tt>easeIn</tt></b></li>\r
- * <li><b><tt>easeInStrong</tt></b></li>\r
- * <li><b><tt>easeNone</tt></b></li>\r
- * <li><b><tt>easeOut</tt></b></li>\r
- * <li><b><tt>easeOutStrong</tt></b></li>\r
- * <li><b><tt>elasticBoth</tt></b></li>\r
- * <li><b><tt>elasticIn</tt></b></li>\r
- * <li><b><tt>elasticOut</tt></b></li>\r
- * </ul></div>\r
- *\r
- * @cfg {String} afterCls A css class to apply after the effect\r
- * @cfg {Number} duration The length of time (in seconds) that the effect should last\r
- * \r
- * @cfg {Number} endOpacity Only applicable for {@link #fadeIn} or {@link #fadeOut}, a number between\r
- * <tt>0</tt> and <tt>1</tt> inclusive to configure the ending opacity value.\r
- *  \r
- * @cfg {Boolean} remove Whether the Element should be removed from the DOM and destroyed after the effect finishes\r
- * @cfg {Boolean} useDisplay Whether to use the <i>display</i> CSS property instead of <i>visibility</i> when hiding Elements (only applies to \r
- * effects that end with the element being visually hidden, ignored otherwise)\r
- * @cfg {String/Object/Function} afterStyle A style specification string, e.g. <tt>"width:100px"</tt>, or an object\r
- * in the form <tt>{width:"100px"}</tt>, or a function which returns such a specification that will be applied to the\r
- * Element after the effect finishes.\r
- * @cfg {Boolean} block Whether the effect should block other effects from queueing while it runs\r
- * @cfg {Boolean} concurrent Whether to allow subsequently-queued effects to run at the same time as the current effect, or to ensure that they run in sequence\r
- * @cfg {Boolean} stopFx Whether preceding effects should be stopped and removed before running current effect (only applies to non blocking effects)\r
- */\r
-Ext.Fx = {\r
-    \r
-    // private - calls the function taking arguments from the argHash based on the key.  Returns the return value of the function.\r
-    //           this is useful for replacing switch statements (for example).\r
-    switchStatements : function(key, fn, argHash){\r
-        return fn.apply(this, argHash[key]);\r
-    },\r
-    \r
-    /**\r
-     * Slides the element into view.  An anchor point can be optionally passed to set the point of\r
-     * origin for the slide effect.  This function automatically handles wrapping the element with\r
-     * a fixed-size container if needed.  See the Fx class overview for valid anchor point options.\r
-     * Usage:\r
-     *<pre><code>\r
-// default: slide the element in from the top\r
-el.slideIn();\r
-\r
-// custom: slide the element in from the right with a 2-second duration\r
-el.slideIn('r', { duration: 2 });\r
-\r
-// common config options shown with default values\r
-el.slideIn('t', {\r
-    easing: 'easeOut',\r
-    duration: .5\r
-});\r
-</code></pre>\r
-     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    slideIn : function(anchor, o){ \r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            st = dom.style,\r
-            xy,\r
-            r,\r
-            b,              \r
-            wrap,               \r
-            after,\r
-            st,\r
-            args, \r
-            pt,\r
-            bw,\r
-            bh;\r
-            \r
-        anchor = anchor || "t";\r
-\r
-        me.queueFx(o, function(){            \r
-            xy = fly(dom).getXY();\r
-            // fix display to visibility\r
-            fly(dom).fixDisplay();            \r
-            \r
-            // restore values after effect\r
-            r = fly(dom).getFxRestore();      \r
-            b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight};\r
-            b.right = b.x + b.width;\r
-            b.bottom = b.y + b.height;\r
-            \r
-            // fixed size for slide\r
-            fly(dom).setWidth(b.width).setHeight(b.height);            \r
-            \r
-            // wrap if needed\r
-            wrap = fly(dom).fxWrap(r.pos, o, HIDDEN);\r
-            \r
-            st.visibility = VISIBLE;\r
-            st.position = ABSOLUTE;\r
-            \r
-            // clear out temp styles after slide and unwrap\r
-            function after(){\r
-                 fly(dom).fxUnwrap(wrap, r.pos, o);\r
-                 st.width = r.width;\r
-                 st.height = r.height;\r
-                 fly(dom).afterFx(o);\r
-            }\r
-            \r
-            // time to calculate the positions        \r
-            pt = {to: [b.x, b.y]}; \r
-            bw = {to: b.width};\r
-            bh = {to: b.height};\r
-                \r
-            function argCalc(wrap, style, ww, wh, sXY, sXYval, s1, s2, w, h, p){                    \r
-                var ret = {};\r
-                fly(wrap).setWidth(ww).setHeight(wh);\r
-                if(fly(wrap)[sXY]){\r
-                    fly(wrap)[sXY](sXYval);                  \r
-                }\r
-                style[s1] = style[s2] = "0";                    \r
-                if(w){\r
-                    ret.width = w\r
-                };\r
-                if(h){\r
-                    ret.height = h;\r
-                }\r
-                if(p){\r
-                    ret.points = p;\r
-                }\r
-                return ret;\r
-            };\r
-\r
-            args = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, {\r
-                    t  : [wrap, st, b.width, 0, NULL, NULL, LEFT, BOTTOM, NULL, bh, NULL],\r
-                    l  : [wrap, st, 0, b.height, NULL, NULL, RIGHT, TOP, bw, NULL, NULL],\r
-                    r  : [wrap, st, b.width, b.height, SETX, b.right, LEFT, TOP, NULL, NULL, pt],\r
-                    b  : [wrap, st, b.width, b.height, SETY, b.bottom, LEFT, TOP, NULL, bh, pt],\r
-                    tl : [wrap, st, 0, 0, NULL, NULL, RIGHT, BOTTOM, bw, bh, pt],\r
-                    bl : [wrap, st, 0, 0, SETY, b.y + b.height, RIGHT, TOP, bw, bh, pt],\r
-                    br : [wrap, st, 0, 0, SETXY, [b.right, b.bottom], LEFT, TOP, bw, bh, pt],\r
-                    tr : [wrap, st, 0, 0, SETX, b.x + b.width, LEFT, BOTTOM, bw, bh, pt]\r
-                });\r
-            \r
-            st.visibility = VISIBLE;\r
-            fly(wrap).show();\r
-\r
-            arguments.callee.anim = fly(wrap).fxanim(args,\r
-                o,\r
-                MOTION,\r
-                .5,\r
-                EASEOUT, \r
-                after);\r
-        });\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Slides the element out of view.  An anchor point can be optionally passed to set the end point\r
-     * for the slide effect.  When the effect is completed, the element will be hidden (visibility = \r
-     * 'hidden') but block elements will still take up space in the document.  The element must be removed\r
-     * from the DOM using the 'remove' config option if desired.  This function automatically handles \r
-     * wrapping the element with a fixed-size container if needed.  See the Fx class overview for valid anchor point options.\r
-     * Usage:\r
-     *<pre><code>\r
-// default: slide the element out to the top\r
-el.slideOut();\r
-\r
-// custom: slide the element out to the right with a 2-second duration\r
-el.slideOut('r', { duration: 2 });\r
-\r
-// common config options shown with default values\r
-el.slideOut('t', {\r
-    easing: 'easeOut',\r
-    duration: .5,\r
-    remove: false,\r
-    useDisplay: false\r
-});\r
-</code></pre>\r
-     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    slideOut : function(anchor, o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            st = dom.style,\r
-            xy = me.getXY(),\r
-            wrap,\r
-            r,\r
-            b,\r
-            a,\r
-            zero = {to: 0}; \r
-                    \r
-        anchor = anchor || "t";\r
-\r
-        me.queueFx(o, function(){\r
-            \r
-            // restore values after effect\r
-            r = fly(dom).getFxRestore(); \r
-            b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight};\r
-            b.right = b.x + b.width;\r
-            b.bottom = b.y + b.height;\r
-                \r
-            // fixed size for slide   \r
-            fly(dom).setWidth(b.width).setHeight(b.height);\r
-\r
-            // wrap if needed\r
-            wrap = fly(dom).fxWrap(r.pos, o, VISIBLE);\r
-                \r
-            st.visibility = VISIBLE;\r
-            st.position = ABSOLUTE;\r
-            fly(wrap).setWidth(b.width).setHeight(b.height);            \r
-\r
-            function after(){\r
-                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();                \r
-                fly(dom).fxUnwrap(wrap, r.pos, o);\r
-                st.width = r.width;\r
-                st.height = r.height;\r
-                fly(dom).afterFx(o);\r
-            }            \r
-            \r
-            function argCalc(style, s1, s2, p1, v1, p2, v2, p3, v3){                    \r
-                var ret = {};\r
-                \r
-                style[s1] = style[s2] = "0";\r
-                ret[p1] = v1;               \r
-                if(p2){\r
-                    ret[p2] = v2;               \r
-                }\r
-                if(p3){\r
-                    ret[p3] = v3;\r
-                }\r
-                \r
-                return ret;\r
-            };\r
-            \r
-            a = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, {\r
-                t  : [st, LEFT, BOTTOM, HEIGHT, zero],\r
-                l  : [st, RIGHT, TOP, WIDTH, zero],\r
-                r  : [st, LEFT, TOP, WIDTH, zero, POINTS, {to : [b.right, b.y]}],\r
-                b  : [st, LEFT, TOP, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}],\r
-                tl : [st, RIGHT, BOTTOM, WIDTH, zero, HEIGHT, zero],\r
-                bl : [st, RIGHT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}],\r
-                br : [st, LEFT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x + b.width, b.bottom]}],\r
-                tr : [st, LEFT, BOTTOM, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.right, b.y]}]\r
-            });\r
-            \r
-            arguments.callee.anim = fly(wrap).fxanim(a,\r
-                o,\r
-                MOTION,\r
-                .5,\r
-                EASEOUT, \r
-                after);\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Fades the element out while slowly expanding it in all directions.  When the effect is completed, the \r
-     * element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. \r
-     * The element must be removed from the DOM using the 'remove' config option if desired.\r
-     * Usage:\r
-     *<pre><code>\r
-// default\r
-el.puff();\r
-\r
-// common config options shown with default values\r
-el.puff({\r
-    easing: 'easeOut',\r
-    duration: .5,\r
-    remove: false,\r
-    useDisplay: false\r
-});\r
-</code></pre>\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    puff : function(o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            st = dom.style,\r
-            width,\r
-            height,\r
-            r;\r
-\r
-        me.queueFx(o, function(){\r
-            width = fly(dom).getWidth();\r
-            height = fly(dom).getHeight();\r
-            fly(dom).clearOpacity();\r
-            fly(dom).show();\r
-\r
-            // restore values after effect\r
-            r = fly(dom).getFxRestore();                   \r
-            \r
-            function after(){\r
-                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();                  \r
-                fly(dom).clearOpacity();  \r
-                fly(dom).setPositioning(r.pos);\r
-                st.width = r.width;\r
-                st.height = r.height;\r
-                st.fontSize = '';\r
-                fly(dom).afterFx(o);\r
-            }   \r
-\r
-            arguments.callee.anim = fly(dom).fxanim({\r
-                    width : {to : fly(dom).adjustWidth(width * 2)},\r
-                    height : {to : fly(dom).adjustHeight(height * 2)},\r
-                    points : {by : [-width * .5, -height * .5]},\r
-                    opacity : {to : 0},\r
-                    fontSize: {to : 200, unit: "%"}\r
-                },\r
-                o,\r
-                MOTION,\r
-                .5,\r
-                EASEOUT,\r
-                 after);\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).\r
-     * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still \r
-     * take up space in the document. The element must be removed from the DOM using the 'remove' config option if desired.\r
-     * Usage:\r
-     *<pre><code>\r
-// default\r
-el.switchOff();\r
-\r
-// all config options shown with default values\r
-el.switchOff({\r
-    easing: 'easeIn',\r
-    duration: .3,\r
-    remove: false,\r
-    useDisplay: false\r
-});\r
-</code></pre>\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    switchOff : function(o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            st = dom.style,\r
-            r;\r
-\r
-        me.queueFx(o, function(){\r
-            fly(dom).clearOpacity();\r
-            fly(dom).clip();\r
-\r
-            // restore values after effect\r
-            r = fly(dom).getFxRestore();\r
-                \r
-            function after(){\r
-                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();  \r
-                fly(dom).clearOpacity();\r
-                fly(dom).setPositioning(r.pos);\r
-                st.width = r.width;\r
-                st.height = r.height;   \r
-                fly(dom).afterFx(o);\r
-            };\r
-\r
-            fly(dom).fxanim({opacity : {to : 0.3}}, \r
-                NULL, \r
-                NULL, \r
-                .1, \r
-                NULL, \r
-                function(){                                 \r
-                    fly(dom).clearOpacity();\r
-                        (function(){                            \r
-                            fly(dom).fxanim({\r
-                                height : {to : 1},\r
-                                points : {by : [0, fly(dom).getHeight() * .5]}\r
-                            }, \r
-                            o, \r
-                            MOTION, \r
-                            0.3, \r
-                            'easeIn', \r
-                            after);\r
-                        }).defer(100);\r
-                });\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Highlights the Element by setting a color (applies to the background-color by default, but can be\r
-     * changed using the "attr" config option) and then fading back to the original color. If no original\r
-     * color is available, you should provide the "endColor" config option which will be cleared after the animation.\r
-     * Usage:\r
-<pre><code>\r
-// default: highlight background to yellow\r
-el.highlight();\r
-\r
-// custom: highlight foreground text to blue for 2 seconds\r
-el.highlight("0000ff", { attr: 'color', duration: 2 });\r
-\r
-// common config options shown with default values\r
-el.highlight("ffff9c", {\r
-    attr: "background-color", //can be any valid CSS property (attribute) that supports a color value\r
-    endColor: (current color) or "ffffff",\r
-    easing: 'easeIn',\r
-    duration: 1\r
-});\r
-</code></pre>\r
-     * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */ \r
-    highlight : function(color, o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            attr = o.attr || "backgroundColor",\r
-            a = {},\r
-            restore;\r
-\r
-        me.queueFx(o, function(){\r
-            fly(dom).clearOpacity();\r
-            fly(dom).show();\r
-\r
-            function after(){\r
-                dom.style[attr] = restore;\r
-                fly(dom).afterFx(o);\r
-            }            \r
-            restore = dom.style[attr];\r
-            a[attr] = {from: color || "ffff9c", to: o.endColor || fly(dom).getColor(attr) || "ffffff"};\r
-            arguments.callee.anim = fly(dom).fxanim(a,\r
-                o,\r
-                'color',\r
-                1,\r
-                'easeIn', \r
-                after);\r
-        });\r
-        return me;\r
-    },\r
-\r
-   /**\r
-    * Shows a ripple of exploding, attenuating borders to draw attention to an Element.\r
-    * Usage:\r
-<pre><code>\r
-// default: a single light blue ripple\r
-el.frame();\r
-\r
-// custom: 3 red ripples lasting 3 seconds total\r
-el.frame("ff0000", 3, { duration: 3 });\r
-\r
-// common config options shown with default values\r
-el.frame("C3DAF9", 1, {\r
-    duration: 1 //duration of each individual ripple.\r
-    // Note: Easing is not configurable and will be ignored if included\r
-});\r
-</code></pre>\r
-    * @param {String} color (optional) The color of the border.  Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9').\r
-    * @param {Number} count (optional) The number of ripples to display (defaults to 1)\r
-    * @param {Object} options (optional) Object literal with any of the Fx config options\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    frame : function(color, count, o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            proxy,\r
-            active;\r
-\r
-        me.queueFx(o, function(){\r
-            color = color || "#C3DAF9"\r
-            if(color.length == 6){\r
-                color = "#" + color;\r
-            }            \r
-            count = count || 1;\r
-            fly(dom).show();\r
-\r
-            var xy = fly(dom).getXY(),\r
-                b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight},\r
-                queue = function(){\r
-                    proxy = fly(document.body || document.documentElement).createChild({\r
-                        style:{\r
-                            visbility: HIDDEN,\r
-                            position : ABSOLUTE,\r
-                            "z-index": 35000, // yee haw\r
-                            border : "0px solid " + color\r
-                        }\r
-                    });\r
-                    return proxy.queueFx({}, animFn);\r
-                };\r
-            \r
-            \r
-            arguments.callee.anim = {\r
-                isAnimated: true,\r
-                stop: function() {\r
-                    count = 0;\r
-                    proxy.stopFx();\r
-                }\r
-            };\r
-            \r
-            function animFn(){\r
-                var scale = Ext.isBorderBox ? 2 : 1;\r
-                active = proxy.anim({\r
-                    top : {from : b.y, to : b.y - 20},\r
-                    left : {from : b.x, to : b.x - 20},\r
-                    borderWidth : {from : 0, to : 10},\r
-                    opacity : {from : 1, to : 0},\r
-                    height : {from : b.height, to : b.height + 20 * scale},\r
-                    width : {from : b.width, to : b.width + 20 * scale}\r
-                },{\r
-                    duration: o.duration || 1,\r
-                    callback: function() {\r
-                        proxy.remove();\r
-                        --count > 0 ? queue() : fly(dom).afterFx(o);\r
-                    }\r
-                });\r
-                arguments.callee.anim = {\r
-                    isAnimated: true,\r
-                    stop: function(){\r
-                        active.stop();\r
-                    }\r
-                };\r
-            };\r
-            queue();\r
-        });\r
-        return me;\r
-    },\r
-\r
-   /**\r
-    * Creates a pause before any subsequent queued effects begin.  If there are\r
-    * no effects queued after the pause it will have no effect.\r
-    * Usage:\r
-<pre><code>\r
-el.pause(1);\r
-</code></pre>\r
-    * @param {Number} seconds The length of time to pause (in seconds)\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    pause : function(seconds){        \r
-        var dom = this.dom,\r
-            t;\r
-\r
-        this.queueFx({}, function(){\r
-            t = setTimeout(function(){\r
-                fly(dom).afterFx({});\r
-            }, seconds * 1000);\r
-            arguments.callee.anim = {\r
-                isAnimated: true,\r
-                stop: function(){\r
-                    clearTimeout(t);\r
-                    fly(dom).afterFx({});\r
-                }\r
-            };\r
-        });\r
-        return this;\r
-    },\r
-\r
-   /**\r
-    * Fade an element in (from transparent to opaque).  The ending opacity can be specified\r
-    * using the <tt>{@link #endOpacity}</tt> config option.\r
-    * Usage:\r
-<pre><code>\r
-// default: fade in from opacity 0 to 100%\r
-el.fadeIn();\r
-\r
-// custom: fade in from opacity 0 to 75% over 2 seconds\r
-el.fadeIn({ endOpacity: .75, duration: 2});\r
-\r
-// common config options shown with default values\r
-el.fadeIn({\r
-    endOpacity: 1, //can be any value between 0 and 1 (e.g. .5)\r
-    easing: 'easeOut',\r
-    duration: .5\r
-});\r
-</code></pre>\r
-    * @param {Object} options (optional) Object literal with any of the Fx config options\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    fadeIn : function(o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            to = o.endOpacity || 1;\r
-        \r
-        me.queueFx(o, function(){\r
-            fly(dom).setOpacity(0);\r
-            fly(dom).fixDisplay();\r
-            dom.style.visibility = VISIBLE;\r
-            arguments.callee.anim = fly(dom).fxanim({opacity:{to:to}},\r
-                o, NULL, .5, EASEOUT, function(){\r
-                if(to == 1){\r
-                    fly(dom).clearOpacity();\r
-                }\r
-                fly(dom).afterFx(o);\r
-            });\r
-        });\r
-        return me;\r
-    },\r
-\r
-   /**\r
-    * Fade an element out (from opaque to transparent).  The ending opacity can be specified\r
-    * using the <tt>{@link #endOpacity}</tt> config option.  Note that IE may require\r
-    * <tt>{@link #useDisplay}:true</tt> in order to redisplay correctly.\r
-    * Usage:\r
-<pre><code>\r
-// default: fade out from the element's current opacity to 0\r
-el.fadeOut();\r
-\r
-// custom: fade out from the element's current opacity to 25% over 2 seconds\r
-el.fadeOut({ endOpacity: .25, duration: 2});\r
-\r
-// common config options shown with default values\r
-el.fadeOut({\r
-    endOpacity: 0, //can be any value between 0 and 1 (e.g. .5)\r
-    easing: 'easeOut',\r
-    duration: .5,\r
-    remove: false,\r
-    useDisplay: false\r
-});\r
-</code></pre>\r
-    * @param {Object} options (optional) Object literal with any of the Fx config options\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    fadeOut : function(o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            style = dom.style,\r
-            to = o.endOpacity || 0;         \r
-        \r
-        me.queueFx(o, function(){  \r
-            arguments.callee.anim = fly(dom).fxanim({ \r
-                opacity : {to : to}},\r
-                o, \r
-                NULL, \r
-                .5, \r
-                EASEOUT, \r
-                function(){\r
-                    if(to == 0){\r
-                        Ext.Element.data(dom, 'visibilityMode') == Ext.Element.DISPLAY || o.useDisplay ? \r
-                            style.display = "none" :\r
-                            style.visibility = HIDDEN;\r
-                            \r
-                        fly(dom).clearOpacity();\r
-                    }\r
-                    fly(dom).afterFx(o);\r
-            });\r
-        });\r
-        return me;\r
-    },\r
-\r
-   /**\r
-    * Animates the transition of an element's dimensions from a starting height/width\r
-    * to an ending height/width.  This method is a convenience implementation of {@link shift}.\r
-    * Usage:\r
-<pre><code>\r
-// change height and width to 100x100 pixels\r
-el.scale(100, 100);\r
-\r
-// common config options shown with default values.  The height and width will default to\r
-// the element&#39;s existing values if passed as null.\r
-el.scale(\r
-    [element&#39;s width],\r
-    [element&#39;s height], {\r
-        easing: 'easeOut',\r
-        duration: .35\r
-    }\r
-);\r
-</code></pre>\r
-    * @param {Number} width  The new width (pass undefined to keep the original width)\r
-    * @param {Number} height  The new height (pass undefined to keep the original height)\r
-    * @param {Object} options (optional) Object literal with any of the Fx config options\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    scale : function(w, h, o){\r
-        this.shift(Ext.apply({}, o, {\r
-            width: w,\r
-            height: h\r
-        }));\r
-        return this;\r
-    },\r
-\r
-   /**\r
-    * Animates the transition of any combination of an element's dimensions, xy position and/or opacity.\r
-    * Any of these properties not specified in the config object will not be changed.  This effect \r
-    * requires that at least one new dimension, position or opacity setting must be passed in on\r
-    * the config object in order for the function to have any effect.\r
-    * Usage:\r
-<pre><code>\r
-// slide the element horizontally to x position 200 while changing the height and opacity\r
-el.shift({ x: 200, height: 50, opacity: .8 });\r
-\r
-// common config options shown with default values.\r
-el.shift({\r
-    width: [element&#39;s width],\r
-    height: [element&#39;s height],\r
-    x: [element&#39;s x position],\r
-    y: [element&#39;s y position],\r
-    opacity: [element&#39;s opacity],\r
-    easing: 'easeOut',\r
-    duration: .35\r
-});\r
-</code></pre>\r
-    * @param {Object} options  Object literal with any of the Fx config options\r
-    * @return {Ext.Element} The Element\r
-    */\r
-    shift : function(o){\r
-        o = getObject(o);\r
-        var dom = this.dom,\r
-            a = {};\r
-                \r
-        this.queueFx(o, function(){\r
-            for (var prop in o) {\r
-                if (o[prop] != UNDEFINED) {                                                 \r
-                    a[prop] = {to : o[prop]};                   \r
-                }\r
-            } \r
-            \r
-            a.width ? a.width.to = fly(dom).adjustWidth(o.width) : a;\r
-            a.height ? a.height.to = fly(dom).adjustWidth(o.height) : a;   \r
-            \r
-            if (a.x || a.y || a.xy) {\r
-                a.points = a.xy || \r
-                           {to : [ a.x ? a.x.to : fly(dom).getX(),\r
-                                   a.y ? a.y.to : fly(dom).getY()]};                  \r
-            }\r
-\r
-            arguments.callee.anim = fly(dom).fxanim(a,\r
-                o, \r
-                MOTION, \r
-                .35, \r
-                EASEOUT, \r
-                function(){\r
-                    fly(dom).afterFx(o);\r
-                });\r
-        });\r
-        return this;\r
-    },\r
-\r
-    /**\r
-     * Slides the element while fading it out of view.  An anchor point can be optionally passed to set the \r
-     * ending point of the effect.\r
-     * Usage:\r
-     *<pre><code>\r
-// default: slide the element downward while fading out\r
-el.ghost();\r
-\r
-// custom: slide the element out to the right with a 2-second duration\r
-el.ghost('r', { duration: 2 });\r
-\r
-// common config options shown with default values\r
-el.ghost('b', {\r
-    easing: 'easeOut',\r
-    duration: .5,\r
-    remove: false,\r
-    useDisplay: false\r
-});\r
-</code></pre>\r
-     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to bottom: 'b')\r
-     * @param {Object} options (optional) Object literal with any of the Fx config options\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    ghost : function(anchor, o){\r
-        o = getObject(o);\r
-        var me = this,\r
-            dom = me.dom,\r
-            st = dom.style,\r
-            a = {opacity: {to: 0}, points: {}},\r
-            pt = a.points,\r
-            r,\r
-            w,\r
-            h;\r
-            \r
-        anchor = anchor || "b";\r
-\r
-        me.queueFx(o, function(){\r
-            // restore values after effect\r
-            r = fly(dom).getFxRestore();\r
-            w = fly(dom).getWidth();\r
-            h = fly(dom).getHeight();\r
-            \r
-            function after(){\r
-                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();   \r
-                fly(dom).clearOpacity();\r
-                fly(dom).setPositioning(r.pos);\r
-                st.width = r.width;\r
-                st.height = r.height;\r
-                fly(dom).afterFx(o);\r
-            }\r
-                \r
-            pt.by = fly(dom).switchStatements(anchor.toLowerCase(), function(v1,v2){ return [v1, v2];}, {\r
-               t  : [0, -h],\r
-               l  : [-w, 0],\r
-               r  : [w, 0],\r
-               b  : [0, h],\r
-               tl : [-w, -h],\r
-               bl : [-w, h],\r
-               br : [w, h],\r
-               tr : [w, -h] \r
-            });\r
-                \r
-            arguments.callee.anim = fly(dom).fxanim(a,\r
-                o,\r
-                MOTION,\r
-                .5,\r
-                EASEOUT, after);\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Ensures that all effects queued after syncFx is called on the element are\r
-     * run concurrently.  This is the opposite of {@link #sequenceFx}.\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    syncFx : function(){\r
-        var me = this;\r
-        me.fxDefaults = Ext.apply(me.fxDefaults || {}, {\r
-            block : FALSE,\r
-            concurrent : TRUE,\r
-            stopFx : FALSE\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /**\r
-     * Ensures that all effects queued after sequenceFx is called on the element are\r
-     * run in sequence.  This is the opposite of {@link #syncFx}.\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    sequenceFx : function(){\r
-        var me = this;\r
-        me.fxDefaults = Ext.apply(me.fxDefaults || {}, {\r
-            block : FALSE,\r
-            concurrent : FALSE,\r
-            stopFx : FALSE\r
-        });\r
-        return me;\r
-    },\r
-\r
-    /* @private */\r
-    nextFx : function(){        \r
-        var ef = getQueue(this.dom.id)[0];\r
-        if(ef){\r
-            ef.call(this);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns true if the element has any effects actively running or queued, else returns false.\r
-     * @return {Boolean} True if element has active effects, else false\r
-     */\r
-    hasActiveFx : function(){\r
-        return getQueue(this.dom.id)[0];\r
-    },\r
-\r
-    /**\r
-     * Stops any running effects and clears the element's internal effects queue if it contains\r
-     * any additional effects that haven't started yet.\r
-     * @return {Ext.Element} The Element\r
-     */\r
-    stopFx : function(finish){\r
-        var me = this,\r
-            id = me.dom.id;\r
-        if(me.hasActiveFx()){\r
-            var cur = getQueue(id)[0];\r
-            if(cur && cur.anim){\r
-                if(cur.anim.isAnimated){\r
-                    setQueue(id, [cur]); //clear\r
-                    cur.anim.stop(finish !== undefined ? finish : TRUE);\r
-                }else{\r
-                    setQueue(id, []);\r
-                }\r
-            }\r
-        }\r
-        return me;\r
-    },\r
-\r
-    /* @private */\r
-    beforeFx : function(o){\r
-        if(this.hasActiveFx() && !o.concurrent){\r
-           if(o.stopFx){\r
-               this.stopFx();\r
-               return TRUE;\r
-           }\r
-           return FALSE;\r
-        }\r
-        return TRUE;\r
-    },\r
-\r
-    /**\r
-     * Returns true if the element is currently blocking so that no other effect can be queued\r
-     * until this effect is finished, else returns false if blocking is not set.  This is commonly\r
-     * used to ensure that an effect initiated by a user action runs to completion prior to the\r
-     * same effect being restarted (e.g., firing only one effect even if the user clicks several times).\r
-     * @return {Boolean} True if blocking, else false\r
-     */\r
-    hasFxBlock : function(){\r
-        var q = getQueue(this.dom.id);\r
-        return q && q[0] && q[0].block;\r
-    },\r
-\r
-    /* @private */\r
-    queueFx : function(o, fn){\r
-        var me = this;\r
-        if(!me.hasFxBlock()){\r
-            Ext.applyIf(o, me.fxDefaults);\r
-            if(!o.concurrent){\r
-                var run = me.beforeFx(o);\r
-                fn.block = o.block;\r
-                getQueue(me.dom.id).push(fn);\r
-                if(run){\r
-                    me.nextFx();\r
-                }\r
-            }else{\r
-                fn.call(me);\r
-            }\r
-        }\r
-        return me;\r
-    },\r
-\r
-    /* @private */\r
-    fxWrap : function(pos, o, vis){ \r
-        var dom = this.dom,\r
-            wrap,\r
-            wrapXY;\r
-        if(!o.wrap || !(wrap = Ext.getDom(o.wrap))){            \r
-            if(o.fixPosition){\r
-                wrapXY = fly(dom).getXY();\r
-            }\r
-            var div = document.createElement("div");\r
-            div.style.visibility = vis;\r
-            wrap = dom.parentNode.insertBefore(div, dom);\r
-            fly(wrap).setPositioning(pos);\r
-            if(fly(wrap).isStyle(POSITION, "static")){\r
-                fly(wrap).position("relative");\r
-            }\r
-            fly(dom).clearPositioning('auto');\r
-            fly(wrap).clip();\r
-            wrap.appendChild(dom);\r
-            if(wrapXY){\r
-                fly(wrap).setXY(wrapXY);\r
-            }\r
-        }\r
-        return wrap;\r
-    },\r
-\r
-    /* @private */\r
-    fxUnwrap : function(wrap, pos, o){      \r
-        var dom = this.dom;\r
-        fly(dom).clearPositioning();\r
-        fly(dom).setPositioning(pos);\r
-        if(!o.wrap){\r
-            wrap.parentNode.insertBefore(dom, wrap);\r
-            fly(wrap).remove();\r
-        }\r
-    },\r
-\r
-    /* @private */\r
-    getFxRestore : function(){\r
-        var st = this.dom.style;\r
-        return {pos: this.getPositioning(), width: st.width, height : st.height};\r
-    },\r
-\r
-    /* @private */\r
-    afterFx : function(o){\r
-        var dom = this.dom,\r
-            id = dom.id,\r
-            notConcurrent = !o.concurrent;\r
-        if(o.afterStyle){\r
-            fly(dom).setStyle(o.afterStyle);            \r
-        }\r
-        if(o.afterCls){\r
-            fly(dom).addClass(o.afterCls);\r
-        }\r
-        if(o.remove == TRUE){\r
-            fly(dom).remove();\r
-        }\r
-        if(notConcurrent){\r
-            getQueue(id).shift();\r
-        }\r
-        if(o.callback){\r
-            o.callback.call(o.scope, fly(dom));\r
-        }\r
-        if(notConcurrent){\r
-            fly(dom).nextFx();\r
-        }\r
-    },\r
-\r
-    /* @private */\r
-    fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){\r
-        animType = animType || 'run';\r
-        opt = opt || {};\r
-        var anim = Ext.lib.Anim[animType](\r
-                this.dom, \r
-                args,\r
-                (opt.duration || defaultDur) || .35,\r
-                (opt.easing || defaultEase) || EASEOUT,\r
-                cb,            \r
-                this\r
-            );\r
-        opt.anim = anim;\r
-        return anim;\r
-    }\r
-};\r
-\r
-// backwards compat\r
-Ext.Fx.resize = Ext.Fx.scale;\r
-\r
-//When included, Ext.Fx is automatically applied to Element so that all basic\r
-//effects are available directly via the Element API\r
-Ext.Element.addMethods(Ext.Fx);\r
-})();/**\r
- * @class Ext.CompositeElementLite\r
- * Flyweight composite class. Reuses the same Ext.Element for element operations.\r
- <pre><code>\r
- var els = Ext.select("#some-el div.some-class");\r
- // or select directly from an existing element\r
- var el = Ext.get('some-el');\r
- el.select('div.some-class');\r
-\r
- els.setWidth(100); // all elements become 100 width\r
- els.hide(true); // all elements fade out and hide\r
- // or\r
- els.setWidth(100).hide(true);\r
- </code></pre><br><br>\r
- * <b>NOTE: Although they are not listed, this class supports all of the set/update methods of Ext.Element. All Ext.Element\r
- * actions will be performed on all the elements in this collection.</b>\r
- */\r
-Ext.CompositeElementLite = function(els, root){\r
-    this.elements = [];\r
-    this.add(els, root);\r
-    this.el = new Ext.Element.Flyweight();\r
-};\r
-\r
-Ext.CompositeElementLite.prototype = {\r
-       isComposite: true,      \r
-       /**\r
-     * Returns the number of elements in this composite\r
-     * @return Number\r
-     */\r
-    getCount : function(){\r
-        return this.elements.length;\r
-    },    \r
-       add : function(els){\r
-        if(els){\r
-            if (Ext.isArray(els)) {\r
-                this.elements = this.elements.concat(els);\r
-            } else {\r
-                var yels = this.elements;                                      \r
-                   Ext.each(els, function(e) {\r
-                    yels.push(e);\r
-                });\r
-            }\r
-        }\r
-        return this;\r
-    },\r
-    invoke : function(fn, args){\r
-        var els = this.elements,\r
-               el = this.el;        \r
-           Ext.each(els, function(e) {    \r
-            el.dom = e;\r
-               Ext.Element.prototype[fn].apply(el, args);\r
-        });\r
-        return this;\r
-    },\r
-    /**\r
-     * Returns a flyweight Element of the dom element object at the specified index\r
-     * @param {Number} index\r
-     * @return {Ext.Element}\r
-     */\r
-    item : function(index){\r
-           var me = this;\r
-        if(!me.elements[index]){\r
-            return null;\r
-        }\r
-        me.el.dom = me.elements[index];\r
-        return me.el;\r
-    },\r
-\r
-    // fixes scope with flyweight\r
-    addListener : function(eventName, handler, scope, opt){\r
-        Ext.each(this.elements, function(e) {\r
-               Ext.EventManager.on(e, eventName, handler, scope || e, opt);\r
-        });\r
-        return this;\r
-    },\r
-    /**\r
-    * Calls the passed function passing (el, this, index) for each element in this composite. <b>The element\r
-    * passed is the flyweight (shared) Ext.Element instance, so if you require a\r
-    * a reference to the dom node, use el.dom.</b>\r
-    * @param {Function} fn The function to call\r
-    * @param {Object} scope (optional) The <i>this</i> object (defaults to the element)\r
-    * @return {CompositeElement} this\r
-    */\r
-    each : function(fn, scope){       \r
-        var me = this,\r
-               el = me.el;\r
-       \r
-           Ext.each(me.elements, function(e,i) {    \r
-            el.dom = e;\r
-               return fn.call(scope || el, el, me, i);\r
-        });\r
-        return me;\r
-    },\r
-    \r
-    /**\r
-     * Find the index of the passed element within the composite collection.\r
-     * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.\r
-     * @return Number The index of the passed Ext.Element in the composite collection, or -1 if not found.\r
-     */\r
-    indexOf : function(el){\r
-        return this.elements.indexOf(Ext.getDom(el));\r
-    },\r
-    \r
-    /**\r
-    * Replaces the specified element with the passed element.\r
-    * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite\r
-    * to replace.\r
-    * @param {Mixed} replacement The id of an element or the Element itself.\r
-    * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too.\r
-    * @return {CompositeElement} this\r
-    */    \r
-    replaceElement : function(el, replacement, domReplace){\r
-        var index = !isNaN(el) ? el : this.indexOf(el),\r
-               d;\r
-        if(index > -1){\r
-            replacement = Ext.getDom(replacement);\r
-            if(domReplace){\r
-                d = this.elements[index];\r
-                d.parentNode.insertBefore(replacement, d);\r
-                Ext.removeNode(d);\r
-            }\r
-            this.elements.splice(index, 1, replacement);\r
-        }\r
-        return this;\r
-    },\r
-    \r
-    /**\r
-     * Removes all elements.\r
-     */\r
-    clear : function(){\r
-        this.elements = [];\r
-    }\r
-};\r
-\r
-Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;\r
-\r
-(function(){\r
-var fnName,\r
-       ElProto = Ext.Element.prototype,\r
-       CelProto = Ext.CompositeElementLite.prototype;\r
-       \r
-for(fnName in ElProto){\r
-    if(Ext.isFunction(ElProto[fnName])){\r
-           (function(fnName){ \r
-                   CelProto[fnName] = CelProto[fnName] || function(){\r
-                       return this.invoke(fnName, arguments);\r
-               };\r
-       }).call(CelProto, fnName);\r
-        \r
-    }\r
-}\r
-})();\r
-\r
-if(Ext.DomQuery){\r
-    Ext.Element.selectorFunction = Ext.DomQuery.select;\r
-} \r
-\r
-/**\r
- * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
- * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
- * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
- * @param {String/Array} selector The CSS selector or an array of elements\r
- * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object) <b>Not supported in core</b>\r
- * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
- * @return {CompositeElementLite/CompositeElement}\r
- * @member Ext.Element\r
- * @method select\r
- */\r
-Ext.Element.select = function(selector, unique, root){\r
-    var els;\r
-    if(typeof selector == "string"){\r
-        els = Ext.Element.selectorFunction(selector, root);\r
-    }else if(selector.length !== undefined){\r
-        els = selector;\r
-    }else{\r
-        throw "Invalid selector";\r
-    }\r
-    return new Ext.CompositeElementLite(els);\r
-};\r
-/**\r
- * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
- * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
- * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
- * @param {String/Array} selector The CSS selector or an array of elements\r
- * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)\r
- * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
- * @return {CompositeElementLite/CompositeElement}\r
- * @member Ext\r
- * @method select\r
- */\r
-Ext.select = Ext.Element.select;/**\r
- * @class Ext.CompositeElementLite\r
- */\r
-Ext.apply(Ext.CompositeElementLite.prototype, {        \r
-       addElements : function(els, root){\r
-        if(!els){\r
-            return this;\r
-        }\r
-        if(typeof els == "string"){\r
-            els = Ext.Element.selectorFunction(els, root);\r
-        }\r
-        var yels = this.elements;        \r
-           Ext.each(els, function(e) {\r
-               yels.push(Ext.get(e));\r
-        });\r
-        return this;\r
-    },\r
-    \r
-    /**\r
-    * Clears this composite and adds the elements returned by the passed selector.\r
-    * @param {String/Array} els A string CSS selector, an array of elements or an element\r
-    * @return {CompositeElement} this\r
-    */\r
-    fill : function(els){\r
-        this.elements = [];\r
-        this.add(els);\r
-        return this;\r
-    },\r
-    \r
-    /**\r
-     * Returns the first Element\r
-     * @return {Ext.Element}\r
-     */\r
-    first : function(){\r
-        return this.item(0);\r
-    },   \r
-    \r
-    /**\r
-     * Returns the last Element\r
-     * @return {Ext.Element}\r
-     */\r
-    last : function(){\r
-        return this.item(this.getCount()-1);\r
-    },\r
-    \r
-    /**\r
-     * Returns true if this composite contains the passed element\r
-     * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.\r
-     * @return Boolean\r
-     */\r
-    contains : function(el){\r
-        return this.indexOf(el) != -1;\r
-    },\r
-\r
-    /**\r
-    * Filters this composite to only elements that match the passed selector.\r
-    * @param {String} selector A string CSS selector\r
-    * @return {CompositeElement} this\r
-    */\r
-    filter : function(selector){\r
-        var els = [];\r
-        this.each(function(el){\r
-            if(el.is(selector)){\r
-                els[els.length] = el.dom;\r
-            }\r
-        });\r
-        this.fill(els);\r
-        return this;\r
-    },
-    
-    /**\r
-    * Removes the specified element(s).\r
-    * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite\r
-    * or an array of any of those.\r
-    * @param {Boolean} removeDom (optional) True to also remove the element from the document\r
-    * @return {CompositeElement} this\r
-    */\r
-    removeElement : function(keys, removeDom){\r
-        var me = this,\r
-               els = this.elements,        \r
-               el;             \r
-           Ext.each(keys, function(val){\r
-                   if ((el = (els[val] || els[val = me.indexOf(val)]))) {\r
-                       if(removeDom){\r
-                    if(el.dom){\r
-                        el.remove();\r
-                    }else{\r
-                        Ext.removeNode(el);\r
-                    }\r
-                }\r
-                       els.splice(val, 1);                     \r
-                       }\r
-           });\r
-        return this;\r
-    }    \r
-});
-/**\r
- * @class Ext.CompositeElement\r
- * @extends Ext.CompositeElementLite\r
- * Standard composite class. Creates a Ext.Element for every element in the collection.\r
- * <br><br>\r
- * <b>NOTE: Although they are not listed, this class supports all of the set/update methods of Ext.Element. All Ext.Element\r
- * actions will be performed on all the elements in this collection.</b>\r
- * <br><br>\r
- * All methods return <i>this</i> and can be chained.\r
- <pre><code>\r
- var els = Ext.select("#some-el div.some-class", true);\r
- // or select directly from an existing element\r
- var el = Ext.get('some-el');\r
- el.select('div.some-class', true);\r
-\r
- els.setWidth(100); // all elements become 100 width\r
- els.hide(true); // all elements fade out and hide\r
- // or\r
- els.setWidth(100).hide(true);\r
- </code></pre>\r
- */\r
-Ext.CompositeElement = function(els, root){\r
-    this.elements = [];\r
-    this.add(els, root);\r
-};\r
-\r
-Ext.extend(Ext.CompositeElement, Ext.CompositeElementLite, {\r
-    invoke : function(fn, args){\r
-           Ext.each(this.elements, function(e) {\r
-               Ext.Element.prototype[fn].apply(e, args);\r
-        });\r
-        return this;\r
-    },\r
-    \r
-    /**\r
-    * Adds elements to this composite.\r
-    * @param {String/Array} els A string CSS selector, an array of elements or an element\r
-    * @return {CompositeElement} this\r
-    */\r
-    add : function(els, root){\r
-           if(!els){\r
-            return this;\r
-        }\r
-        if(typeof els == "string"){\r
-            els = Ext.Element.selectorFunction(els, root);\r
-        }\r
-        var yels = this.elements;        \r
-           Ext.each(els, function(e) {\r
-               yels.push(Ext.get(e));\r
-        });\r
-        return this;\r
-    },    \r
-    \r
-    /**\r
-     * Returns the Element object at the specified index\r
-     * @param {Number} index\r
-     * @return {Ext.Element}\r
-     */\r
-    item : function(index){\r
-        return this.elements[index] || null;\r
-    },\r
-\r
-\r
-    indexOf : function(el){\r
-        return this.elements.indexOf(Ext.get(el));\r
-    },\r
-        \r
-    filter : function(selector){\r
-               var me = this,\r
-                       out = [];\r
-                       \r
-               Ext.each(me.elements, function(el) {    \r
-                       if(el.is(selector)){\r
-                               out.push(Ext.get(el));\r
-                       }\r
-               });\r
-               me.elements = out;\r
-               return me;\r
-       },\r
-       \r
-       /**\r
-    * Calls the passed function passing (el, this, index) for each element in this composite.\r
-    * @param {Function} fn The function to call\r
-    * @param {Object} scope (optional) The <i>this</i> object (defaults to the element)\r
-    * @return {CompositeElement} this\r
-    */\r
-    each : function(fn, scope){        \r
-        Ext.each(this.elements, function(e,i) {\r
-               return fn.call(scope || e, e, this, i);\r
-        }, this);\r
-        return this;\r
-    }\r
-});\r
-\r
-/**\r
- * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
- * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
- * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
- * @param {String/Array} selector The CSS selector or an array of elements\r
- * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)\r
- * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
- * @return {CompositeElementLite/CompositeElement}\r
- * @member Ext.Element\r
- * @method select\r
- */\r
-Ext.Element.select = function(selector, unique, root){\r
-    var els;\r
-    if(typeof selector == "string"){\r
-        els = Ext.Element.selectorFunction(selector, root);\r
-    }else if(selector.length !== undefined){\r
-        els = selector;\r
-    }else{\r
-        throw "Invalid selector";\r
-    }\r
-\r
-    return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els);\r
-};
-\r
-/**\r
- * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
- * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
- * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
- * @param {String/Array} selector The CSS selector or an array of elements\r
- * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)\r
- * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
- * @return {CompositeElementLite/CompositeElement}\r
- * @member Ext.Element\r
- * @method select\r
- */\r
-Ext.select = Ext.Element.select;(function(){\r
-    var BEFOREREQUEST = "beforerequest",\r
-        REQUESTCOMPLETE = "requestcomplete",\r
-        REQUESTEXCEPTION = "requestexception",\r
-        UNDEFINED = undefined,\r
-        LOAD = 'load',\r
-        POST = 'POST',\r
-        GET = 'GET',\r
-        WINDOW = window;\r
-    \r
-    /**\r
-     * @class Ext.data.Connection\r
-     * @extends Ext.util.Observable\r
-     * <p>The class encapsulates a connection to the page's originating domain, allowing requests to be made\r
-     * either to a configured URL, or to a URL specified at request time.</p>\r
-     * <p>Requests made by this class are asynchronous, and will return immediately. No data from\r
-     * the server will be available to the statement immediately following the {@link #request} call.\r
-     * To process returned data, use a\r
-     * <a href="#request-option-success" ext:member="request-option-success" ext:cls="Ext.data.Connection">success callback</a>\r
-     * in the request options object,\r
-     * or an {@link #requestcomplete event listener}.</p>\r
-     * <p><h3>File Uploads</h3><a href="#request-option-isUpload" ext:member="request-option-isUpload" ext:cls="Ext.data.Connection">File uploads</a> are not performed using normal "Ajax" techniques, that\r
-     * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard\r
-     * manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its\r
-     * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer\r
-     * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document\r
-     * but removed after the return data has been gathered.</p>\r
-     * <p>The server response is parsed by the browser to create the document for the IFRAME. If the\r
-     * server is using JSON to send the return object, then the\r
-     * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header\r
-     * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>\r
-     * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode\r
-     * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>\r
-     * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object\r
-     * is created containing a <tt>responseText</tt> property in order to conform to the\r
-     * requirements of event handlers and callbacks.</p>\r
-     * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>\r
-     * and some server technologies (notably JEE) may require some custom processing in order to\r
-     * retrieve parameter names and parameter values from the packet content.</p>\r
-     * @constructor\r
-     * @param {Object} config a configuration object.\r
-     */\r
-    Ext.data.Connection = function(config){    \r
-        Ext.apply(this, config);\r
-        this.addEvents(\r
-            /**\r
-             * @event beforerequest\r
-             * Fires before a network request is made to retrieve a data object.\r
-             * @param {Connection} conn This Connection object.\r
-             * @param {Object} options The options config object passed to the {@link #request} method.\r
-             */\r
-            BEFOREREQUEST,\r
-            /**\r
-             * @event requestcomplete\r
-             * Fires if the request was successfully completed.\r
-             * @param {Connection} conn This Connection object.\r
-             * @param {Object} response The XHR object containing the response data.\r
-             * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>\r
-             * for details.\r
-             * @param {Object} options The options config object passed to the {@link #request} method.\r
-             */\r
-            REQUESTCOMPLETE,\r
-            /**\r
-             * @event requestexception\r
-             * Fires if an error HTTP status was returned from the server.\r
-             * See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>\r
-             * for details of HTTP status codes.\r
-             * @param {Connection} conn This Connection object.\r
-             * @param {Object} response The XHR object containing the response data.\r
-             * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>\r
-             * for details.\r
-             * @param {Object} options The options config object passed to the {@link #request} method.\r
-             */\r
-            REQUESTEXCEPTION\r
-        );\r
-        Ext.data.Connection.superclass.constructor.call(this);\r
-    };\r
-\r
-    // private\r
-    function handleResponse(response){\r
-        this.transId = false;\r
-        var options = response.argument.options;\r
-        response.argument = options ? options.argument : null;\r
-        this.fireEvent(REQUESTCOMPLETE, this, response, options);\r
-        if(options.success){\r
-            options.success.call(options.scope, response, options);\r
-        }\r
-        if(options.callback){\r
-            options.callback.call(options.scope, options, true, response);\r
-        }\r
-    }\r
-\r
-    // private\r
-    function handleFailure(response, e){\r
-        this.transId = false;\r
-        var options = response.argument.options;\r
-        response.argument = options ? options.argument : null;\r
-        this.fireEvent(REQUESTEXCEPTION, this, response, options, e);\r
-        if(options.failure){\r
-            options.failure.call(options.scope, response, options);\r
-        }\r
-        if(options.callback){\r
-            options.callback.call(options.scope, options, false, response);\r
-        }\r
-    }\r
-\r
-    // private\r
-    function doFormUpload(o, ps, url){\r
-        var id = Ext.id(),\r
-            doc = document,\r
-            frame = doc.createElement('iframe'),\r
-            form = Ext.getDom(o.form),\r
-            hiddens = [],\r
-            hd,\r
-            encoding = 'multipart/form-data',\r
-            buf = {\r
-                target: form.target,\r
-                method: form.method,\r
-                encoding: form.encoding,\r
-                enctype: form.enctype,\r
-                action: form.action\r
-            };\r
-            \r
-        Ext.apply(frame, {\r
-            id: id,\r
-            name: id,\r
-            className: 'x-hidden',\r
-            src: Ext.SSL_SECURE_URL // for IE\r
-        });     \r
-        doc.body.appendChild(frame);\r
-        \r
-        // This is required so that IE doesn't pop the response up in a new window.\r
-        if(Ext.isIE){\r
-           document.frames[id].name = id;\r
-        }\r
-        \r
-        Ext.apply(form, {\r
-            target: id,\r
-            method: POST,\r
-            enctype: encoding,\r
-            encoding: encoding,\r
-            action: url || buf.action\r
-        });\r
-        \r
-        // add dynamic params            \r
-        ps = Ext.urlDecode(ps, false);\r
-        for(var k in ps){\r
-            if(ps.hasOwnProperty(k)){\r
-                hd = doc.createElement('input');\r
-                hd.type = 'hidden';                    \r
-                hd.value = ps[hd.name = k];\r
-                form.appendChild(hd);\r
-                hiddens.push(hd);\r
-            }\r
-        }        \r
-\r
-        function cb(){\r
-            var me = this,\r
-                // bogus response object\r
-                r = {responseText : '',\r
-                     responseXML : null,\r
-                     argument : o.argument},\r
-                doc,\r
-                firstChild;\r
-\r
-            try{ \r
-                doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;\r
-                if(doc){\r
-                    if(doc.body){\r
-                        if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea                        \r
-                            r.responseText = firstChild.value;\r
-                        }else{\r
-                            r.responseText = doc.body.innerHTML;\r
-                        }\r
-                    }\r
-                    //in IE the document may still have a body even if returns XML.\r
-                    r.responseXML = doc.XMLDocument || doc;\r
-                }\r
-            }\r
-            catch(e) {}\r
-\r
-            Ext.EventManager.removeListener(frame, LOAD, cb, me);\r
-\r
-            me.fireEvent(REQUESTCOMPLETE, me, r, o);\r
-            \r
-            function runCallback(fn, scope, args){\r
-                if(Ext.isFunction(fn)){\r
-                    fn.apply(scope, args);\r
-                }\r
-            }\r
-\r
-            runCallback(o.success, o.scope, [r, o]);\r
-            runCallback(o.callback, o.scope, [o, true, r]);\r
-\r
-            if(!me.debugUploads){\r
-                setTimeout(function(){Ext.removeNode(frame);}, 100);\r
-            }\r
-        }\r
-\r
-        Ext.EventManager.on(frame, LOAD, cb, this);\r
-        form.submit();\r
-        \r
-        Ext.apply(form, buf);\r
-        Ext.each(hiddens, function(h) {\r
-            Ext.removeNode(h);\r
-        });\r
-    }\r
-\r
-    Ext.extend(Ext.data.Connection, Ext.util.Observable, {\r
-        /**\r
-         * @cfg {String} url (Optional) <p>The default URL to be used for requests to the server. Defaults to undefined.</p>\r
-         * <p>The <code>url</code> config may be a function which <i>returns</i> the URL to use for the Ajax request. The scope\r
-         * (<code><b>this</b></code> reference) of the function is the <code>scope</code> option passed to the {@link #request} method.</p>\r
-         */\r
-        /**\r
-         * @cfg {Object} extraParams (Optional) An object containing properties which are used as\r
-         * extra parameters to each request made by this object. (defaults to undefined)\r
-         */\r
-        /**\r
-         * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added\r
-         *  to each request made by this object. (defaults to undefined)\r
-         */\r
-        /**\r
-         * @cfg {String} method (Optional) The default HTTP method to be used for requests.\r
-         * (defaults to undefined; if not set, but {@link #request} params are present, POST will be used;\r
-         * otherwise, GET will be used.)\r
-         */\r
-        /**\r
-         * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)\r
-         */\r
-        timeout : 30000,\r
-        /**\r
-         * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false)\r
-         * @type Boolean\r
-         */\r
-        autoAbort:false,\r
-    \r
-        /**\r
-         * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)\r
-         * @type Boolean\r
-         */\r
-        disableCaching: true,\r
-        \r
-        /**\r
-         * @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching\r
-         * through a cache buster. Defaults to '_dc'\r
-         * @type String\r
-         */\r
-        disableCachingParam: '_dc',\r
-        \r
-        /**\r
-         * <p>Sends an HTTP request to a remote server.</p>\r
-         * <p><b>Important:</b> Ajax server requests are asynchronous, and this call will\r
-         * return before the response has been received. Process any returned data\r
-         * in a callback function.</p>\r
-         * <pre><code>\r
-Ext.Ajax.request({\r
-   url: 'ajax_demo/sample.json',\r
-   success: function(response, opts) {\r
-      var obj = Ext.decode(response.responseText);\r
-      console.dir(obj);\r
-   },\r
-   failure: function(response, opts) {\r
-      console.log('server-side failure with status code ' + response.status);\r
-   }\r
-});\r
-         * </code></pre>\r
-         * <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p>\r
-         * @param {Object} options An object which may contain the following properties:<ul>\r
-         * <li><b>url</b> : String/Function (Optional)<div class="sub-desc">The URL to\r
-         * which to send the request, or a function to call which returns a URL string. The scope of the\r
-         * function is specified by the <tt>scope</tt> option. Defaults to the configured\r
-         * <tt>{@link #url}</tt>.</div></li>\r
-         * <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">\r
-         * An object containing properties which are used as parameters to the\r
-         * request, a url encoded string or a function to call to get either. The scope of the function\r
-         * is specified by the <tt>scope</tt> option.</div></li>\r
-         * <li><b>method</b> : String (Optional)<div class="sub-desc">The HTTP method to use\r
-         * for the request. Defaults to the configured method, or if no method was configured,\r
-         * "GET" if no parameters are being sent, and "POST" if parameters are being sent.  Note that\r
-         * the method name is case-sensitive and should be all caps.</div></li>\r
-         * <li><b>callback</b> : Function (Optional)<div class="sub-desc">The\r
-         * function to be called upon receipt of the HTTP response. The callback is\r
-         * called regardless of success or failure and is passed the following\r
-         * parameters:<ul>\r
-         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
-         * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>\r
-         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data. \r
-         * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about \r
-         * accessing elements of the response.</div></li>\r
-         * </ul></div></li>\r
-         * <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function\r
-         * to be called upon success of the request. The callback is passed the following\r
-         * parameters:<ul>\r
-         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>\r
-         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
-         * </ul></div></li>\r
-         * <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function\r
-         * to be called upon failure of the request. The callback is passed the\r
-         * following parameters:<ul>\r
-         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>\r
-         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
-         * </ul></div></li>\r
-         * <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in\r
-         * which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were\r
-         * specified as functions from which to draw values, then this also serves as the scope for those function calls.\r
-         * Defaults to the browser window.</div></li>\r
-         * <li><b>timeout</b> : Number (Optional)<div class="sub-desc">The timeout in milliseconds to be used for this request. Defaults to 30 seconds.</div></li>\r
-         * <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt>&lt;form&gt;</tt>\r
-         * Element or the id of the <tt>&lt;form&gt;</tt> to pull parameters from.</div></li>\r
-         * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used \r
-         * with the <tt>form</tt> option</b>.\r
-         * <p>True if the form object is a file upload (will be set automatically if the form was\r
-         * configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>\r
-         * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>\r
-         * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the\r
-         * DOM <tt>&lt;form></tt> element temporarily modified to have its\r
-         * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer\r
-         * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document\r
-         * but removed after the return data has been gathered.</p>\r
-         * <p>The server response is parsed by the browser to create the document for the IFRAME. If the\r
-         * server is using JSON to send the return object, then the\r
-         * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header\r
-         * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>\r
-         * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object\r
-         * is created containing a <tt>responseText</tt> property in order to conform to the\r
-         * requirements of event handlers and callbacks.</p>\r
-         * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>\r
-         * and some server technologies (notably JEE) may require some custom processing in order to\r
-         * retrieve parameter names and parameter values from the packet content.</p>\r
-         * </div></li>\r
-         * <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request\r
-         * headers to set for the request.</div></li>\r
-         * <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document\r
-         * to use for the post. Note: This will be used instead of params for the post\r
-         * data. Any params will be appended to the URL.</div></li>\r
-         * <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON\r
-         * data to use as the post. Note: This will be used instead of params for the post\r
-         * data. Any params will be appended to the URL.</div></li>\r
-         * <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True\r
-         * to add a unique cache-buster param to GET requests.</div></li>\r
-         * </ul></p>\r
-         * <p>The options object may also contain any other property which might be needed to perform\r
-         * postprocessing in a callback because it is passed to callback functions.</p>\r
-         * @return {Number} transactionId The id of the server transaction. This may be used\r
-         * to cancel the request.\r
-         */\r
-        request : function(o){\r
-            var me = this;\r
-            if(me.fireEvent(BEFOREREQUEST, me, o)){\r
-                if (o.el) {\r
-                    if(!Ext.isEmpty(o.indicatorText)){\r
-                        me.indicatorText = '<div class="loading-indicator">'+o.indicatorText+"</div>";\r
-                    }\r
-                    if(me.indicatorText) {\r
-                        Ext.getDom(o.el).innerHTML = me.indicatorText;                        \r
-                    }\r
-                    o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) {\r
-                        Ext.getDom(o.el).innerHTML = response.responseText;\r
-                    });\r
-                }\r
-                \r
-                var p = o.params,\r
-                    url = o.url || me.url,                \r
-                    method,\r
-                    cb = {success: handleResponse,\r
-                          failure: handleFailure,\r
-                          scope: me,\r
-                          argument: {options: o},\r
-                          timeout : o.timeout || me.timeout\r
-                    },\r
-                    form,                    \r
-                    serForm;                    \r
-                  \r
-                     \r
-                if (Ext.isFunction(p)) {\r
-                    p = p.call(o.scope||WINDOW, o);\r
-                }\r
-                                                           \r
-                p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p);    \r
-                \r
-                if (Ext.isFunction(url)) {\r
-                    url = url.call(o.scope || WINDOW, o);\r
-                }\r
-    \r
-                if((form = Ext.getDom(o.form))){\r
-                    url = url || form.action;\r
-                     if(o.isUpload || /multipart\/form-data/i.test(form.getAttribute("enctype"))) { \r
-                         return doFormUpload.call(me, o, p, url);\r
-                     }\r
-                    serForm = Ext.lib.Ajax.serializeForm(form);                    \r
-                    p = p ? (p + '&' + serForm) : serForm;\r
-                }\r
-                \r
-                method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET);\r
-                \r
-                if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){\r
-                    var dcp = o.disableCachingParam || me.disableCachingParam;\r
-                    url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));\r
-                }\r
-                \r
-                o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {});\r
-                \r
-                if(o.autoAbort === true || me.autoAbort) {\r
-                    me.abort();\r
-                }\r
-                 \r
-                if((method == GET || o.xmlData || o.jsonData) && p){\r
-                    url = Ext.urlAppend(url, p);  \r
-                    p = '';\r
-                }\r
-                return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o));\r
-            }else{                \r
-                return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : null;\r
-            }\r
-        },\r
-    \r
-        /**\r
-         * Determine whether this object has a request outstanding.\r
-         * @param {Number} transactionId (Optional) defaults to the last transaction\r
-         * @return {Boolean} True if there is an outstanding request.\r
-         */\r
-        isLoading : function(transId){\r
-            return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId;            \r
-        },\r
-    \r
-        /**\r
-         * Aborts any outstanding request.\r
-         * @param {Number} transactionId (Optional) defaults to the last transaction\r
-         */\r
-        abort : function(transId){\r
-            if(transId || this.isLoading()){\r
-                Ext.lib.Ajax.abort(transId || this.transId);\r
-            }\r
-        }\r
-    });\r
-})();\r
-\r
-/**\r
- * @class Ext.Ajax\r
- * @extends Ext.data.Connection\r
- * <p>The global Ajax request class that provides a simple way to make Ajax requests\r
- * with maximum flexibility.</p>\r
- * <p>Since Ext.Ajax is a singleton, you can set common properties/events for it once\r
- * and override them at the request function level only if necessary.</p>\r
- * <p>Common <b>Properties</b> you may want to set are:<div class="mdetail-params"><ul>\r
- * <li><b><tt>{@link #method}</tt></b><p class="sub-desc"></p></li>\r
- * <li><b><tt>{@link #extraParams}</tt></b><p class="sub-desc"></p></li>\r
- * <li><b><tt>{@link #url}</tt></b><p class="sub-desc"></p></li>\r
- * </ul></div>\r
- * <pre><code>\r
-// Default headers to pass in every request\r
-Ext.Ajax.defaultHeaders = {\r
-    'Powered-By': 'Ext'\r
-};\r
- * </code></pre> \r
- * </p>\r
- * <p>Common <b>Events</b> you may want to set are:<div class="mdetail-params"><ul>\r
- * <li><b><tt>{@link Ext.data.Connection#beforerequest beforerequest}</tt></b><p class="sub-desc"></p></li>\r
- * <li><b><tt>{@link Ext.data.Connection#requestcomplete requestcomplete}</tt></b><p class="sub-desc"></p></li>\r
- * <li><b><tt>{@link Ext.data.Connection#requestexception requestexception}</tt></b><p class="sub-desc"></p></li>\r
- * </ul></div>\r
- * <pre><code>\r
-// Example: show a spinner during all Ajax requests\r
-Ext.Ajax.on('beforerequest', this.showSpinner, this);\r
-Ext.Ajax.on('requestcomplete', this.hideSpinner, this);\r
-Ext.Ajax.on('requestexception', this.hideSpinner, this);\r
- * </code></pre> \r
- * </p>\r
- * <p>An example request:</p>\r
- * <pre><code>\r
-// Basic request\r
-Ext.Ajax.{@link Ext.data.Connection#request request}({\r
-   url: 'foo.php',\r
-   success: someFn,\r
-   failure: otherFn,\r
-   headers: {\r
-       'my-header': 'foo'\r
-   },\r
-   params: { foo: 'bar' }\r
-});\r
-\r
-// Simple ajax form submission\r
-Ext.Ajax.{@link Ext.data.Connection#request request}({\r
-    form: 'some-form',\r
-    params: 'foo=bar'\r
-});\r
- * </code></pre> \r
- * </p>\r
- * @singleton\r
- */\r
-Ext.Ajax = new Ext.data.Connection({\r
-    /**\r
-     * @cfg {String} url @hide\r
-     */\r
-    /**\r
-     * @cfg {Object} extraParams @hide\r
-     */\r
-    /**\r
-     * @cfg {Object} defaultHeaders @hide\r
-     */\r
-    /**\r
-     * @cfg {String} method (Optional) @hide\r
-     */\r
-    /**\r
-     * @cfg {Number} timeout (Optional) @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} autoAbort (Optional) @hide\r
-     */\r
-\r
-    /**\r
-     * @cfg {Boolean} disableCaching (Optional) @hide\r
-     */\r
-\r
-    /**\r
-     * @property  disableCaching\r
-     * True to add a unique cache-buster param to GET requests. (defaults to true)\r
-     * @type Boolean\r
-     */\r
-    /**\r
-     * @property  url\r
-     * The default URL to be used for requests to the server. (defaults to undefined)\r
-     * If the server receives all requests through one URL, setting this once is easier than\r
-     * entering it on every request.\r
-     * @type String\r
-     */\r
-    /**\r
-     * @property  extraParams\r
-     * An object containing properties which are used as extra parameters to each request made\r
-     * by this object (defaults to undefined). Session information and other data that you need\r
-     * to pass with each request are commonly put here.\r
-     * @type Object\r
-     */\r
-    /**\r
-     * @property  defaultHeaders\r
-     * An object containing request headers which are added to each request made by this object\r
-     * (defaults to undefined).\r
-     * @type Object\r
-     */\r
-    /**\r
-     * @property  method\r
-     * The default HTTP method to be used for requests. Note that this is case-sensitive and\r
-     * should be all caps (defaults to undefined; if not set but params are present will use\r
-     * <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)\r
-     * @type String\r
-     */\r
-    /**\r
-     * @property  timeout\r
-     * The timeout in milliseconds to be used for requests. (defaults to 30000)\r
-     * @type Number\r
-     */\r
-\r
-    /**\r
-     * @property  autoAbort\r
-     * Whether a new request should abort any pending requests. (defaults to false)\r
-     * @type Boolean\r
-     */\r
-    autoAbort : false,\r
-\r
-    /**\r
-     * Serialize the passed form into a url encoded string\r
-     * @param {String/HTMLElement} form\r
-     * @return {String}\r
-     */\r
-    serializeForm : function(form){\r
-        return Ext.lib.Ajax.serializeForm(form);\r
-    }\r
-});\r
-/**
- * @class Ext.Updater
- * @extends Ext.util.Observable
- * Provides AJAX-style update capabilities for Element objects.  Updater can be used to {@link #update}
- * an {@link Ext.Element} once, or you can use {@link #startAutoRefresh} to set up an auto-updating
- * {@link Ext.Element Element} on a specific interval.<br><br>
- * Usage:<br>
- * <pre><code>
- * var el = Ext.get("foo"); // Get Ext.Element object
- * var mgr = el.getUpdater();
- * mgr.update({
-        url: "http://myserver.com/index.php",
-        params: {
-            param1: "foo",
-            param2: "bar"
-        }
- * });
- * ...
- * mgr.formUpdate("myFormId", "http://myserver.com/index.php");
- * <br>
- * // or directly (returns the same Updater instance)
- * var mgr = new Ext.Updater("myElementId");
- * mgr.startAutoRefresh(60, "http://myserver.com/index.php");
- * mgr.on("update", myFcnNeedsToKnow);
- * <br>
- * // short handed call directly from the element object
- * Ext.get("foo").load({
-        url: "bar.php",
-        scripts: true,
-        params: "param1=foo&amp;param2=bar",
-        text: "Loading Foo..."
- * });
- * </code></pre>
- * @constructor
- * Create new Updater directly.
- * @param {Mixed} el The element to update
- * @param {Boolean} forceNew (optional) By default the constructor checks to see if the passed element already
- * has an Updater and if it does it returns the same instance. This will skip that check (useful for extending this class).
- */
-Ext.UpdateManager = Ext.Updater = Ext.extend(Ext.util.Observable, 
-function() {
-       var BEFOREUPDATE = "beforeupdate",
-               UPDATE = "update",
-               FAILURE = "failure";
-               
-       // private
-    function processSuccess(response){     
-           var me = this;
-        me.transaction = null;
-        if (response.argument.form && response.argument.reset) {
-            try { // put in try/catch since some older FF releases had problems with this
-                response.argument.form.reset();
-            } catch(e){}
-        }
-        if (me.loadScripts) {
-            me.renderer.render(me.el, response, me,
-               updateComplete.createDelegate(me, [response]));
-        } else {
-            me.renderer.render(me.el, response, me);
-            updateComplete.call(me, response);
-        }
-    }
-    
-    // private
-    function updateComplete(response, type, success){
-        this.fireEvent(type || UPDATE, this.el, response);
-        if(Ext.isFunction(response.argument.callback)){
-            response.argument.callback.call(response.argument.scope, this.el, Ext.isEmpty(success) ? true : false, response, response.argument.options);
-        }
-    }
-
-    // private
-    function processFailure(response){             
-        updateComplete.call(this, response, FAILURE, !!(this.transaction = null));
-    }
-           
-       return {
-           constructor: function(el, forceNew){
-                   var me = this;
-               el = Ext.get(el);
-               if(!forceNew && el.updateManager){
-                   return el.updateManager;
-               }
-               /**
-                * The Element object
-                * @type Ext.Element
-                */
-               me.el = el;
-               /**
-                * Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
-                * @type String
-                */
-               me.defaultUrl = null;
-       
-               me.addEvents(
-                   /**
-                    * @event beforeupdate
-                    * Fired before an update is made, return false from your handler and the update is cancelled.
-                    * @param {Ext.Element} el
-                    * @param {String/Object/Function} url
-                    * @param {String/Object} params
-                    */
-                   BEFOREUPDATE,
-                   /**
-                    * @event update
-                    * Fired after successful update is made.
-                    * @param {Ext.Element} el
-                    * @param {Object} oResponseObject The response Object
-                    */
-                   UPDATE,
-                   /**
-                    * @event failure
-                    * Fired on update failure.
-                    * @param {Ext.Element} el
-                    * @param {Object} oResponseObject The response Object
-                    */
-                   FAILURE
-               );
-       
-               Ext.apply(me, Ext.Updater.defaults);
-               /**
-                * Blank page URL to use with SSL file uploads (defaults to {@link Ext.Updater.defaults#sslBlankUrl}).
-                * @property sslBlankUrl
-                * @type String
-                */
-               /**
-                * Whether to append unique parameter on get request to disable caching (defaults to {@link Ext.Updater.defaults#disableCaching}).
-                * @property disableCaching
-                * @type Boolean
-                */
-               /**
-                * Text for loading indicator (defaults to {@link Ext.Updater.defaults#indicatorText}).
-                * @property indicatorText
-                * @type String
-                */
-               /**
-                * Whether to show indicatorText when loading (defaults to {@link Ext.Updater.defaults#showLoadIndicator}).
-                * @property showLoadIndicator
-                * @type String
-                */
-               /**
-                * Timeout for requests or form posts in seconds (defaults to {@link Ext.Updater.defaults#timeout}).
-                * @property timeout
-                * @type Number
-                */
-               /**
-                * True to process scripts in the output (defaults to {@link Ext.Updater.defaults#loadScripts}).
-                * @property loadScripts
-                * @type Boolean
-                */
-       
-               /**
-                * Transaction object of the current executing transaction, or null if there is no active transaction.
-                */
-               me.transaction = null;
-               /**
-                * Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
-                * @type Function
-                */
-               me.refreshDelegate = me.refresh.createDelegate(me);
-               /**
-                * Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments
-                * @type Function
-                */
-               me.updateDelegate = me.update.createDelegate(me);
-               /**
-                * Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments
-                * @type Function
-                */
-               me.formUpdateDelegate = (me.formUpdate || function(){}).createDelegate(me);     
-               
-                       /**
-                        * The renderer for this Updater (defaults to {@link Ext.Updater.BasicRenderer}).
-                        */
-               me.renderer = me.renderer || me.getDefaultRenderer();
-               
-               Ext.Updater.superclass.constructor.call(me);
-           },
-        
-               /**
-            * Sets the content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
-            * @param {Object} renderer The object implementing the render() method
-            */
-           setRenderer : function(renderer){
-               this.renderer = renderer;
-           },  
-        
-           /**
-            * Returns the current content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
-            * @return {Object}
-            */
-           getRenderer : function(){
-              return this.renderer;
-           },
-
-           /**
-            * This is an overrideable method which returns a reference to a default
-            * renderer class if none is specified when creating the Ext.Updater.
-            * Defaults to {@link Ext.Updater.BasicRenderer}
-            */
-           getDefaultRenderer: function() {
-               return new Ext.Updater.BasicRenderer();
-           },
-                
-           /**
-            * Sets the default URL used for updates.
-            * @param {String/Function} defaultUrl The url or a function to call to get the url
-            */
-           setDefaultUrl : function(defaultUrl){
-               this.defaultUrl = defaultUrl;
-           },
-        
-           /**
-            * Get the Element this Updater is bound to
-            * @return {Ext.Element} The element
-            */
-           getEl : function(){
-               return this.el;
-           },
-       
-               /**
-            * Performs an <b>asynchronous</b> request, updating this element with the response.
-            * If params are specified it uses POST, otherwise it uses GET.<br><br>
-            * <b>Note:</b> Due to the asynchronous nature of remote server requests, the Element
-            * will not have been fully updated when the function returns. To post-process the returned
-            * data, use the callback option, or an <b><tt>update</tt></b> event handler.
-            * @param {Object} options A config object containing any of the following options:<ul>
-            * <li>url : <b>String/Function</b><p class="sub-desc">The URL to request or a function which
-            * <i>returns</i> the URL (defaults to the value of {@link Ext.Ajax#url} if not specified).</p></li>
-            * <li>method : <b>String</b><p class="sub-desc">The HTTP method to
-            * use. Defaults to POST if the <tt>params</tt> argument is present, otherwise GET.</p></li>
-            * <li>params : <b>String/Object/Function</b><p class="sub-desc">The
-            * parameters to pass to the server (defaults to none). These may be specified as a url-encoded
-            * string, or as an object containing properties which represent parameters,
-            * or as a function, which returns such an object.</p></li>
-            * <li>scripts : <b>Boolean</b><p class="sub-desc">If <tt>true</tt>
-            * any &lt;script&gt; tags embedded in the response text will be extracted
-            * and executed (defaults to {@link Ext.Updater.defaults#loadScripts}). If this option is specified,
-            * the callback will be called <i>after</i> the execution of the scripts.</p></li>
-            * <li>callback : <b>Function</b><p class="sub-desc">A function to
-            * be called when the response from the server arrives. The following
-            * parameters are passed:<ul>
-            * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
-            * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
-            * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li>
-            * <li><b>options</b> : Object<p class="sub-desc">The config object passed to the update call.</p></li></ul>
-            * </p></li>
-            * <li>scope : <b>Object</b><p class="sub-desc">The scope in which
-            * to execute the callback (The callback's <tt>this</tt> reference.) If the
-            * <tt>params</tt> argument is a function, this scope is used for that function also.</p></li>
-            * <li>discardUrl : <b>Boolean</b><p class="sub-desc">By default, the URL of this request becomes
-            * the default URL for this Updater object, and will be subsequently used in {@link #refresh}
-            * calls.  To bypass this behavior, pass <tt>discardUrl:true</tt> (defaults to false).</p></li>
-            * <li>timeout : <b>Number</b><p class="sub-desc">The number of seconds to wait for a response before
-            * timing out (defaults to {@link Ext.Updater.defaults#timeout}).</p></li>
-            * <li>text : <b>String</b><p class="sub-desc">The text to use as the innerHTML of the
-            * {@link Ext.Updater.defaults#indicatorText} div (defaults to 'Loading...').  To replace the entire div, not
-            * just the text, override {@link Ext.Updater.defaults#indicatorText} directly.</p></li>
-            * <li>nocache : <b>Boolean</b><p class="sub-desc">Only needed for GET
-            * requests, this option causes an extra, auto-generated parameter to be appended to the request
-            * to defeat caching (defaults to {@link Ext.Updater.defaults#disableCaching}).</p></li></ul>
-            * <p>
-            * For example:
-       <pre><code>
-       um.update({
-           url: "your-url.php",
-           params: {param1: "foo", param2: "bar"}, // or a URL encoded string
-           callback: yourFunction,
-           scope: yourObject, //(optional scope)
-           discardUrl: true,
-           nocache: true,
-           text: "Loading...",
-           timeout: 60,
-           scripts: false // Save time by avoiding RegExp execution.
-       });
-       </code></pre>
-            */
-           update : function(url, params, callback, discardUrl){
-                   var me = this,
-                       cfg, 
-                       callerScope;
-                       
-               if(me.fireEvent(BEFOREUPDATE, me.el, url, params) !== false){               
-                   if(Ext.isObject(url)){ // must be config object
-                       cfg = url;
-                       url = cfg.url;
-                       params = params || cfg.params;
-                       callback = callback || cfg.callback;
-                       discardUrl = discardUrl || cfg.discardUrl;
-                       callerScope = cfg.scope;                        
-                       if(!Ext.isEmpty(cfg.nocache)){me.disableCaching = cfg.nocache;};
-                       if(!Ext.isEmpty(cfg.text)){me.indicatorText = '<div class="loading-indicator">'+cfg.text+"</div>";};
-                       if(!Ext.isEmpty(cfg.scripts)){me.loadScripts = cfg.scripts;};
-                       if(!Ext.isEmpty(cfg.timeout)){me.timeout = cfg.timeout;};
-                   }
-                   me.showLoading();
-       
-                   if(!discardUrl){
-                       me.defaultUrl = url;
-                   }
-                   if(Ext.isFunction(url)){
-                       url = url.call(me);
-                   }
-       
-                   var o = Ext.apply({}, {
-                       url : url,
-                       params: (Ext.isFunction(params) && callerScope) ? params.createDelegate(callerScope) : params,
-                       success: processSuccess,
-                       failure: processFailure,
-                       scope: me,
-                       callback: undefined,
-                       timeout: (me.timeout*1000),
-                       disableCaching: me.disableCaching,
-                       argument: {
-                           "options": cfg,
-                           "url": url,
-                           "form": null,
-                           "callback": callback,
-                           "scope": callerScope || window,
-                           "params": params
-                       }
-                   }, cfg);
-       
-                   me.transaction = Ext.Ajax.request(o);
-               }
-           },          
-
-               /**
-            * <p>Performs an async form post, updating this element with the response. If the form has the attribute
-            * enctype="<a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>", it assumes it's a file upload.
-            * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.</p>
-            * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
-            * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
-            * DOM <tt>&lt;form></tt> element temporarily modified to have its
-            * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
-            * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
-            * but removed after the return data has been gathered.</p>
-            * <p>Be aware that file upload packets, sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>
-            * and some server technologies (notably JEE) may require some custom processing in order to
-            * retrieve parameter names and parameter values from the packet content.</p>
-            * @param {String/HTMLElement} form The form Id or form element
-            * @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
-            * @param {Boolean} reset (optional) Whether to try to reset the form after the update
-            * @param {Function} callback (optional) Callback when transaction is complete. The following
-            * parameters are passed:<ul>
-            * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
-            * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
-            * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li></ul>
-            */
-           formUpdate : function(form, url, reset, callback){
-                   var me = this;
-               if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){
-                   if(Ext.isFunction(url)){
-                       url = url.call(me);
-                   }
-                   form = Ext.getDom(form)
-                   me.transaction = Ext.Ajax.request({
-                       form: form,
-                       url:url,
-                       success: processSuccess,
-                       failure: processFailure,
-                       scope: me,
-                       timeout: (me.timeout*1000),
-                       argument: {
-                           "url": url,
-                           "form": form,
-                           "callback": callback,
-                           "reset": reset
-                       }
-                   });
-                   me.showLoading.defer(1, me);
-               }
-           },
-                       
-           /**
-            * Set this element to auto refresh.  Can be canceled by calling {@link #stopAutoRefresh}.
-            * @param {Number} interval How often to update (in seconds).
-            * @param {String/Object/Function} url (optional) The url for this request, a config object in the same format
-            * supported by {@link #load}, or a function to call to get the url (defaults to the last used url).  Note that while
-            * the url used in a load call can be reused by this method, other load config options will not be reused and must be
-            * sepcified as part of a config object passed as this paramter if needed.
-            * @param {String/Object} params (optional) The parameters to pass as either a url encoded string
-            * "&param1=1&param2=2" or as an object {param1: 1, param2: 2}
-            * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
-            * @param {Boolean} refreshNow (optional) Whether to execute the refresh now, or wait the interval
-            */
-           startAutoRefresh : function(interval, url, params, callback, refreshNow){
-                   var me = this;
-               if(refreshNow){
-                   me.update(url || me.defaultUrl, params, callback, true);
-               }
-               if(me.autoRefreshProcId){
-                   clearInterval(me.autoRefreshProcId);
-               }
-               me.autoRefreshProcId = setInterval(me.update.createDelegate(me, [url || me.defaultUrl, params, callback, true]), interval * 1000);
-           },
-       
-           /**
-            * Stop auto refresh on this element.
-            */
-           stopAutoRefresh : function(){
-               if(this.autoRefreshProcId){
-                   clearInterval(this.autoRefreshProcId);
-                   delete this.autoRefreshProcId;
-               }
-           },
-       
-           /**
-            * Returns true if the Updater is currently set to auto refresh its content (see {@link #startAutoRefresh}), otherwise false.
-            */
-           isAutoRefreshing : function(){
-              return !!this.autoRefreshProcId;
-           },
-       
-           /**
-            * Display the element's "loading" state. By default, the element is updated with {@link #indicatorText}. This
-            * method may be overridden to perform a custom action while this Updater is actively updating its contents.
-            */
-           showLoading : function(){
-               if(this.showLoadIndicator){
-               this.el.dom.innerHTML = this.indicatorText;
-               }
-           },
-       
-           /**
-            * Aborts the currently executing transaction, if any.
-            */
-           abort : function(){
-               if(this.transaction){
-                   Ext.Ajax.abort(this.transaction);
-               }
-           },
-       
-           /**
-            * Returns true if an update is in progress, otherwise false.
-            * @return {Boolean}
-            */
-           isUpdating : function(){        
-               return this.transaction ? Ext.Ajax.isLoading(this.transaction) : false;        
-           },
-           
-           /**
-            * Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
-            * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
-            */
-           refresh : function(callback){
-               if(this.defaultUrl){
-                       this.update(this.defaultUrl, null, callback, true);
-               }
-           }
-    }
-}());
-
-/**
- * @class Ext.Updater.defaults
- * The defaults collection enables customizing the default properties of Updater
- */
-Ext.Updater.defaults = {
-   /**
-     * Timeout for requests or form posts in seconds (defaults to 30 seconds).
-     * @type Number
-     */
-    timeout : 30,    
-    /**
-     * True to append a unique parameter to GET requests to disable caching (defaults to false).
-     * @type Boolean
-     */
-    disableCaching : false,
-    /**
-     * Whether or not to show {@link #indicatorText} during loading (defaults to true).
-     * @type Boolean
-     */
-    showLoadIndicator : true,
-    /**
-     * Text for loading indicator (defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
-     * @type String
-     */
-    indicatorText : '<div class="loading-indicator">Loading...</div>',
-     /**
-     * True to process scripts by default (defaults to false).
-     * @type Boolean
-     */
-    loadScripts : false,
-    /**
-    * Blank page URL to use with SSL file uploads (defaults to {@link Ext#SSL_SECURE_URL} if set, or "javascript:false").
-    * @type String
-    */
-    sslBlankUrl : (Ext.SSL_SECURE_URL || "javascript:false")      
-};
-
-
-/**
- * Static convenience method. <b>This method is deprecated in favor of el.load({url:'foo.php', ...})</b>.
- * Usage:
- * <pre><code>Ext.Updater.updateElement("my-div", "stuff.php");</code></pre>
- * @param {Mixed} el The element to update
- * @param {String} url The url
- * @param {String/Object} params (optional) Url encoded param string or an object of name/value pairs
- * @param {Object} options (optional) A config object with any of the Updater properties you want to set - for
- * example: {disableCaching:true, indicatorText: "Loading data..."}
- * @static
- * @deprecated
- * @member Ext.Updater
- */
-Ext.Updater.updateElement = function(el, url, params, options){
-    var um = Ext.get(el).getUpdater();
-    Ext.apply(um, options);
-    um.update(url, params, options ? options.callback : null);
-};
-
-/**
- * @class Ext.Updater.BasicRenderer
- * Default Content renderer. Updates the elements innerHTML with the responseText.
- */
-Ext.Updater.BasicRenderer = function(){};
-
-Ext.Updater.BasicRenderer.prototype = {
-    /**
-     * This is called when the transaction is completed and it's time to update the element - The BasicRenderer
-     * updates the elements innerHTML with the responseText - To perform a custom render (i.e. XML or JSON processing),
-     * create an object with a "render(el, response)" method and pass it to setRenderer on the Updater.
-     * @param {Ext.Element} el The element being rendered
-     * @param {Object} response The XMLHttpRequest object
-     * @param {Updater} updateManager The calling update manager
-     * @param {Function} callback A callback that will need to be called if loadScripts is true on the Updater
-     */
-     render : function(el, response, updateManager, callback){      
-        el.update(response.responseText, updateManager.loadScripts, callback);
-    }
-};/**
- * @class Date
- *
- * The date parsing and formatting syntax contains a subset of
- * <a href="http://www.php.net/date">PHP's date() function</a>, and the formats that are
- * supported will provide results equivalent to their PHP versions.
- *
- * The following is a list of all currently supported formats:
- * <pre>
-Format  Description                                                               Example returned values
-------  -----------------------------------------------------------------------   -----------------------
-  d     Day of the month, 2 digits with leading zeros                             01 to 31
-  D     A short textual representation of the day of the week                     Mon to Sun
-  j     Day of the month without leading zeros                                    1 to 31
-  l     A full textual representation of the day of the week                      Sunday to Saturday
-  N     ISO-8601 numeric representation of the day of the week                    1 (for Monday) through 7 (for Sunday)
-  S     English ordinal suffix for the day of the month, 2 characters             st, nd, rd or th. Works well with j
-  w     Numeric representation of the day of the week                             0 (for Sunday) to 6 (for Saturday)
-  z     The day of the year (starting from 0)                                     0 to 364 (365 in leap years)
-  W     ISO-8601 week number of year, weeks starting on Monday                    01 to 53
-  F     A full textual representation of a month, such as January or March        January to December
-  m     Numeric representation of a month, with leading zeros                     01 to 12
-  M     A short textual representation of a month                                 Jan to Dec
-  n     Numeric representation of a month, without leading zeros                  1 to 12
-  t     Number of days in the given month                                         28 to 31
-  L     Whether it's a leap year                                                  1 if it is a leap year, 0 otherwise.
-  o     ISO-8601 year number (identical to (Y), but if the ISO week number (W)    Examples: 1998 or 2004
-        belongs to the previous or next year, that year is used instead)
-  Y     A full numeric representation of a year, 4 digits                         Examples: 1999 or 2003
-  y     A two digit representation of a year                                      Examples: 99 or 03
-  a     Lowercase Ante meridiem and Post meridiem                                 am or pm
-  A     Uppercase Ante meridiem and Post meridiem                                 AM or PM
-  g     12-hour format of an hour without leading zeros                           1 to 12
-  G     24-hour format of an hour without leading zeros                           0 to 23
-  h     12-hour format of an hour with leading zeros                              01 to 12
-  H     24-hour format of an hour with leading zeros                              00 to 23
-  i     Minutes, with leading zeros                                               00 to 59
-  s     Seconds, with leading zeros                                               00 to 59
-  u     Decimal fraction of a second                                              Examples:
-        (minimum 1 digit, arbitrary number of digits allowed)                     001 (i.e. 0.001s) or
-                                                                                  100 (i.e. 0.100s) or
-                                                                                  999 (i.e. 0.999s) or
-                                                                                  999876543210 (i.e. 0.999876543210s)
-  O     Difference to Greenwich time (GMT) in hours and minutes                   Example: +1030
-  P     Difference to Greenwich time (GMT) with colon between hours and minutes   Example: -08:00
-  T     Timezone abbreviation of the machine running the code                     Examples: EST, MDT, PDT ...
-  Z     Timezone offset in seconds (negative if west of UTC, positive if east)    -43200 to 50400
-  c     ISO 8601 date
-        Notes:                                                                    Examples:
-        1) If unspecified, the month / day defaults to the current month / day,   1991 or
-           the time defaults to midnight, while the timezone defaults to the      1992-10 or
-           browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
-           and minutes. The "T" delimiter, seconds, milliseconds and timezone     1994-08-19T16:20+01:00 or
-           are optional.                                                          1995-07-18T17:21:28-02:00 or
-        2) The decimal fraction of a second, if specified, must contain at        1996-06-17T18:22:29.98765+03:00 or
-           least 1 digit (there is no limit to the maximum number                 1997-05-16T19:23:30,12345-0400 or
-           of digits allowed), and may be delimited by either a '.' or a ','      1998-04-15T20:24:31.2468Z or
-        Refer to the examples on the right for the various levels of              1999-03-14T20:24:32Z or
-        date-time granularity which are supported, or see                         2000-02-13T21:25:33
-        http://www.w3.org/TR/NOTE-datetime for more info.                         2001-01-12 22:26:34
-  U     Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)                1193432466 or -2138434463
-  M$    Microsoft AJAX serialized dates                                           \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
-                                                                                  \/Date(1238606590509+0800)\/
-</pre>
- *
- * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
- * <pre><code>
-// Sample date:
-// 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
-
-var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
-document.write(dt.format('Y-m-d'));                           // 2007-01-10
-document.write(dt.format('F j, Y, g:i a'));                   // January 10, 2007, 3:05 pm
-document.write(dt.format('l, \\t\\he jS \\of F Y h:i:s A'));  // Wednesday, the 10th of January 2007 03:05:01 PM
-</code></pre>
- *
- * Here are some standard date/time patterns that you might find helpful.  They
- * are not part of the source of Date.js, but to use them you can simply copy this
- * block of code into any script that is included after Date.js and they will also become
- * globally available on the Date object.  Feel free to add or remove patterns as needed in your code.
- * <pre><code>
-Date.patterns = {
-    ISO8601Long:"Y-m-d H:i:s",
-    ISO8601Short:"Y-m-d",
-    ShortDate: "n/j/Y",
-    LongDate: "l, F d, Y",
-    FullDateTime: "l, F d, Y g:i:s A",
-    MonthDay: "F d",
-    ShortTime: "g:i A",
-    LongTime: "g:i:s A",
-    SortableDateTime: "Y-m-d\\TH:i:s",
-    UniversalSortableDateTime: "Y-m-d H:i:sO",
-    YearMonth: "F, Y"
-};
-</code></pre>
- *
- * Example usage:
- * <pre><code>
-var dt = new Date();
-document.write(dt.format(Date.patterns.ShortDate));
-</code></pre>
- * <p>Developer-written, custom formats may be used by supplying both a formatting and a parsing function
- * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.</p>
- */
-
-/*
- * Most of the date-formatting functions below are the excellent work of Baron Schwartz.
- * (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
- * They generate precompiled functions from format patterns instead of parsing and
- * processing each pattern every time a date is formatted. These functions are available
- * on every Date object.
- */
-
-(function() {
-
-/**
- * Global flag which determines if strict date parsing should be used.
- * Strict date parsing will not roll-over invalid dates, which is the
- * default behaviour of javascript Date objects.
- * (see {@link #parseDate} for more information)
- * Defaults to <tt>false</tt>.
- * @static
- * @type Boolean
-*/
-Date.useStrict = false;
-
-
-// create private copy of Ext's String.format() method
-// - to remove unnecessary dependency
-// - to resolve namespace conflict with M$-Ajax's implementation
-function xf(format) {
-    var args = Array.prototype.slice.call(arguments, 1);
-    return format.replace(/\{(\d+)\}/g, function(m, i) {
-        return args[i];
-    });
-}
-
-
-// private
-Date.formatCodeToRegex = function(character, currentGroup) {
-    // Note: currentGroup - position in regex result array (see notes for Date.parseCodes below)
-    var p = Date.parseCodes[character];
-
-    if (p) {
-      p = typeof p == 'function'? p() : p;
-      Date.parseCodes[character] = p; // reassign function result to prevent repeated execution
-    }
-
-    return p? Ext.applyIf({
-      c: p.c? xf(p.c, currentGroup || "{0}") : p.c
-    }, p) : {
-        g:0,
-        c:null,
-        s:Ext.escapeRe(character) // treat unrecognised characters as literals
-    }
-}
-
-// private shorthand for Date.formatCodeToRegex since we'll be using it fairly often
-var $f = Date.formatCodeToRegex;
-
-Ext.apply(Date, {
-    /**
-     * <p>An object hash in which each property is a date parsing function. The property name is the
-     * format string which that function parses.</p>
-     * <p>This object is automatically populated with date parsing functions as
-     * date formats are requested for Ext standard formatting strings.</p>
-     * <p>Custom parsing functions may be inserted into this object, keyed by a name which from then on
-     * may be used as a format string to {@link #parseDate}.<p>
-     * <p>Example:</p><pre><code>
-Date.parseFunctions['x-date-format'] = myDateParser;
-</code></pre>
-     * <p>A parsing function should return a Date object, and is passed the following parameters:<div class="mdetail-params"><ul>
-     * <li><code>date</code> : String<div class="sub-desc">The date string to parse.</div></li>
-     * <li><code>strict</code> : Boolean<div class="sub-desc">True to validate date strings while parsing
-     * (i.e. prevent javascript Date "rollover") (The default must be false).
-     * Invalid date strings should return null when parsed.</div></li>
-     * </ul></div></p>
-     * <p>To enable Dates to also be <i>formatted</i> according to that format, a corresponding
-     * formatting function must be placed into the {@link #formatFunctions} property.
-     * @property parseFunctions
-     * @static
-     * @type Object
-     */
-    parseFunctions: {
-        "M$": function(input, strict) {
-            // note: the timezone offset is ignored since the M$ Ajax server sends
-            // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
-            var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/');
-            var r = (input || '').match(re);
-            return r? new Date(((r[1] || '') + r[2]) * 1) : null;
-        }
-    },
-    parseRegexes: [],
-
-    /**
-     * <p>An object hash in which each property is a date formatting function. The property name is the
-     * format string which corresponds to the produced formatted date string.</p>
-     * <p>This object is automatically populated with date formatting functions as
-     * date formats are requested for Ext standard formatting strings.</p>
-     * <p>Custom formatting functions may be inserted into this object, keyed by a name which from then on
-     * may be used as a format string to {@link #format}. Example:</p><pre><code>
-Date.formatFunctions['x-date-format'] = myDateFormatter;
-</code></pre>
-     * <p>A formatting function should return a string repesentation of the passed Date object:<div class="mdetail-params"><ul>
-     * <li><code>date</code> : Date<div class="sub-desc">The Date to format.</div></li>
-     * </ul></div></p>
-     * <p>To enable date strings to also be <i>parsed</i> according to that format, a corresponding
-     * parsing function must be placed into the {@link #parseFunctions} property.
-     * @property formatFunctions
-     * @static
-     * @type Object
-     */
-    formatFunctions: {
-        "M$": function() {
-            // UTC milliseconds since Unix epoch (M$-AJAX serialized date format (MRSF))
-            return '\\/Date(' + this.getTime() + ')\\/';
-        }
-    },
-
-    y2kYear : 50,
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    MILLI : "ms",
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    SECOND : "s",
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    MINUTE : "mi",
-
-    /** Date interval constant
-     * @static
-     * @type String
-     */
-    HOUR : "h",
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    DAY : "d",
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    MONTH : "mo",
-
-    /**
-     * Date interval constant
-     * @static
-     * @type String
-     */
-    YEAR : "y",
-
-    /**
-     * <p>An object hash containing default date values used during date parsing.</p>
-     * <p>The following properties are available:<div class="mdetail-params"><ul>
-     * <li><code>y</code> : Number<div class="sub-desc">The default year value. (defaults to undefined)</div></li>
-     * <li><code>m</code> : Number<div class="sub-desc">The default 1-based month value. (defaults to undefined)</div></li>
-     * <li><code>d</code> : Number<div class="sub-desc">The default day value. (defaults to undefined)</div></li>
-     * <li><code>h</code> : Number<div class="sub-desc">The default hour value. (defaults to undefined)</div></li>
-     * <li><code>i</code> : Number<div class="sub-desc">The default minute value. (defaults to undefined)</div></li>
-     * <li><code>s</code> : Number<div class="sub-desc">The default second value. (defaults to undefined)</div></li>
-     * <li><code>ms</code> : Number<div class="sub-desc">The default millisecond value. (defaults to undefined)</div></li>
-     * </ul></div></p>
-     * <p>Override these properties to customize the default date values used by the {@link #parseDate} method.</p>
-     * <p><b>Note: In countries which experience Daylight Saving Time (i.e. DST), the <tt>h</tt>, <tt>i</tt>, <tt>s</tt>
-     * and <tt>ms</tt> properties may coincide with the exact time in which DST takes effect.
-     * It is the responsiblity of the developer to account for this.</b></p>
-     * Example Usage:
-     * <pre><code>
-// set default day value to the first day of the month
-Date.defaults.d = 1;
-
-// parse a February date string containing only year and month values.
-// setting the default day value to 1 prevents weird date rollover issues
-// when attempting to parse the following date string on, for example, March 31st 2009.
-Date.parseDate('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
-</code></pre>
-     * @property defaults
-     * @static
-     * @type Object
-     */
-    defaults: {},
-
-    /**
-     * An array of textual day names.
-     * Override these values for international dates.
-     * Example:
-     * <pre><code>
-Date.dayNames = [
-    'SundayInYourLang',
-    'MondayInYourLang',
-    ...
-];
-</code></pre>
-     * @type Array
-     * @static
-     */
-    dayNames : [
-        "Sunday",
-        "Monday",
-        "Tuesday",
-        "Wednesday",
-        "Thursday",
-        "Friday",
-        "Saturday"
-    ],
-
-    /**
-     * An array of textual month names.
-     * Override these values for international dates.
-     * Example:
-     * <pre><code>
-Date.monthNames = [
-    'JanInYourLang',
-    'FebInYourLang',
-    ...
-];
-</code></pre>
-     * @type Array
-     * @static
-     */
-    monthNames : [
-        "January",
-        "February",
-        "March",
-        "April",
-        "May",
-        "June",
-        "July",
-        "August",
-        "September",
-        "October",
-        "November",
-        "December"
-    ],
-
-    /**
-     * An object hash of zero-based javascript month numbers (with short month names as keys. note: keys are case-sensitive).
-     * Override these values for international dates.
-     * Example:
-     * <pre><code>
-Date.monthNumbers = {
-    'ShortJanNameInYourLang':0,
-    'ShortFebNameInYourLang':1,
-    ...
-};
-</code></pre>
-     * @type Object
-     * @static
-     */
-    monthNumbers : {
-        Jan:0,
-        Feb:1,
-        Mar:2,
-        Apr:3,
-        May:4,
-        Jun:5,
-        Jul:6,
-        Aug:7,
-        Sep:8,
-        Oct:9,
-        Nov:10,
-        Dec:11
-    },
-
-    /**
-     * Get the short month name for the given month number.
-     * Override this function for international dates.
-     * @param {Number} month A zero-based javascript month number.
-     * @return {String} The short month name.
-     * @static
-     */
-    getShortMonthName : function(month) {
-        return Date.monthNames[month].substring(0, 3);
-    },
-
-    /**
-     * Get the short day name for the given day number.
-     * Override this function for international dates.
-     * @param {Number} day A zero-based javascript day number.
-     * @return {String} The short day name.
-     * @static
-     */
-    getShortDayName : function(day) {
-        return Date.dayNames[day].substring(0, 3);
-    },
-
-    /**
-     * Get the zero-based javascript month number for the given short/full month name.
-     * Override this function for international dates.
-     * @param {String} name The short/full month name.
-     * @return {Number} The zero-based javascript month number.
-     * @static
-     */
-    getMonthNumber : function(name) {
-        // handle camel casing for english month names (since the keys for the Date.monthNumbers hash are case sensitive)
-        return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
-    },
-
-    /**
-     * The base format-code to formatting-function hashmap used by the {@link #format} method.
-     * Formatting functions are strings (or functions which return strings) which
-     * will return the appropriate value when evaluated in the context of the Date object
-     * from which the {@link #format} method is called.
-     * Add to / override these mappings for custom date formatting.
-     * Note: Date.format() treats characters as literals if an appropriate mapping cannot be found.
-     * Example:
-     * <pre><code>
-Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')";
-(new Date()).format("X"); // returns the current day of the month
-</code></pre>
-     * @type Object
-     * @static
-     */
-    formatCodes : {
-        d: "String.leftPad(this.getDate(), 2, '0')",
-        D: "Date.getShortDayName(this.getDay())", // get localised short day name
-        j: "this.getDate()",
-        l: "Date.dayNames[this.getDay()]",
-        N: "(this.getDay() ? this.getDay() : 7)",
-        S: "this.getSuffix()",
-        w: "this.getDay()",
-        z: "this.getDayOfYear()",
-        W: "String.leftPad(this.getWeekOfYear(), 2, '0')",
-        F: "Date.monthNames[this.getMonth()]",
-        m: "String.leftPad(this.getMonth() + 1, 2, '0')",
-        M: "Date.getShortMonthName(this.getMonth())", // get localised short month name
-        n: "(this.getMonth() + 1)",
-        t: "this.getDaysInMonth()",
-        L: "(this.isLeapYear() ? 1 : 0)",
-        o: "(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",
-        Y: "this.getFullYear()",
-        y: "('' + this.getFullYear()).substring(2, 4)",
-        a: "(this.getHours() < 12 ? 'am' : 'pm')",
-        A: "(this.getHours() < 12 ? 'AM' : 'PM')",
-        g: "((this.getHours() % 12) ? this.getHours() % 12 : 12)",
-        G: "this.getHours()",
-        h: "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",
-        H: "String.leftPad(this.getHours(), 2, '0')",
-        i: "String.leftPad(this.getMinutes(), 2, '0')",
-        s: "String.leftPad(this.getSeconds(), 2, '0')",
-        u: "String.leftPad(this.getMilliseconds(), 3, '0')",
-        O: "this.getGMTOffset()",
-        P: "this.getGMTOffset(true)",
-        T: "this.getTimezone()",
-        Z: "(this.getTimezoneOffset() * -60)",
-
-        c: function() { // ISO-8601 -- GMT format
-            for (var c = "Y-m-dTH:i:sP", code = [], i = 0, l = c.length; i < l; ++i) {
-                var e = c.charAt(i);
-                code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); // treat T as a character literal
-            }
-            return code.join(" + ");
-        },
-        /*
-        c: function() { // ISO-8601 -- UTC format
-            return [
-              "this.getUTCFullYear()", "'-'",
-              "String.leftPad(this.getUTCMonth() + 1, 2, '0')", "'-'",
-              "String.leftPad(this.getUTCDate(), 2, '0')",
-              "'T'",
-              "String.leftPad(this.getUTCHours(), 2, '0')", "':'",
-              "String.leftPad(this.getUTCMinutes(), 2, '0')", "':'",
-              "String.leftPad(this.getUTCSeconds(), 2, '0')",
-              "'Z'"
-            ].join(" + ");
-        },
-        */
-
-        U: "Math.round(this.getTime() / 1000)"
-    },
-
-    /**
-     * Checks if the passed Date parameters will cause a javascript Date "rollover".
-     * @param {Number} year 4-digit year
-     * @param {Number} month 1-based month-of-year
-     * @param {Number} day Day of month
-     * @param {Number} hour (optional) Hour
-     * @param {Number} minute (optional) Minute
-     * @param {Number} second (optional) Second
-     * @param {Number} millisecond (optional) Millisecond
-     * @return {Boolean} true if the passed parameters do not cause a Date "rollover", false otherwise.
-     * @static
-     */
-    isValid : function(y, m, d, h, i, s, ms) {
-        // setup defaults
-        h = h || 0;
-        i = i || 0;
-        s = s || 0;
-        ms = ms || 0;
-
-        var dt = new Date(y, m - 1, d, h, i, s, ms);
-
-        return y == dt.getFullYear() &&
-            m == dt.getMonth() + 1 &&
-            d == dt.getDate() &&
-            h == dt.getHours() &&
-            i == dt.getMinutes() &&
-            s == dt.getSeconds() &&
-            ms == dt.getMilliseconds();
-    },
-
-    /**
-     * Parses the passed string using the specified date format.
-     * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January).
-     * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond)
-     * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash,
-     * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead.
-     * Keep in mind that the input date string must precisely match the specified format string
-     * in order for the parse operation to be successful (failed parse operations return a null value).
-     * <p>Example:</p><pre><code>
-//dt = Fri May 25 2007 (current date)
-var dt = new Date();
-
-//dt = Thu May 25 2006 (today&#39;s month/day in 2006)
-dt = Date.parseDate("2006", "Y");
-
-//dt = Sun Jan 15 2006 (all date parts specified)
-dt = Date.parseDate("2006-01-15", "Y-m-d");
-
-//dt = Sun Jan 15 2006 15:20:01
-dt = Date.parseDate("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
-
-// attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
-dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
-</code></pre>
-     * @param {String} input The raw date string.
-     * @param {String} format The expected date string format.
-     * @param {Boolean} strict (optional) True to validate date strings while parsing (i.e. prevents javascript Date "rollover")
-                        (defaults to false). Invalid date strings will return null when parsed.
-     * @return {Date} The parsed Date.
-     * @static
-     */
-    parseDate : function(input, format, strict) {
-        var p = Date.parseFunctions;
-        if (p[format] == null) {
-            Date.createParser(format);
-        }
-        return p[format](input, Ext.isDefined(strict) ? strict : Date.useStrict);
-    },
-
-    // private
-    getFormatCode : function(character) {
-        var f = Date.formatCodes[character];
-
-        if (f) {
-          f = typeof f == 'function'? f() : f;
-          Date.formatCodes[character] = f; // reassign function result to prevent repeated execution
-        }
-
-        // note: unknown characters are treated as literals
-        return f || ("'" + String.escape(character) + "'");
-    },
-
-    // private
-    createFormat : function(format) {
-        var code = [],
-            special = false,
-            ch = '';
-
-        for (var i = 0; i < format.length; ++i) {
-            ch = format.charAt(i);
-            if (!special && ch == "\\") {
-                special = true;
-            } else if (special) {
-                special = false;
-                code.push("'" + String.escape(ch) + "'");
-            } else {
-                code.push(Date.getFormatCode(ch))
-            }
-        }
-        Date.formatFunctions[format] = new Function("return " + code.join('+'));
-    },
-
-    // private
-    createParser : function() {
-        var code = [
-            "var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,",
-                "def = Date.defaults,",
-                "results = String(input).match(Date.parseRegexes[{0}]);", // either null, or an array of matched strings
-
-            "if(results){",
-                "{1}",
-
-                "if(u != null){", // i.e. unix time is defined
-                    "v = new Date(u * 1000);", // give top priority to UNIX time
-                "}else{",
-                    // create Date object representing midnight of the current day;
-                    // this will provide us with our date defaults
-                    // (note: clearTime() handles Daylight Saving Time automatically)
-                    "dt = (new Date()).clearTime();",
-
-                    // date calculations (note: these calculations create a dependency on Ext.num())
-                    "y = y >= 0? y : Ext.num(def.y, dt.getFullYear());",
-                    "m = m >= 0? m : Ext.num(def.m - 1, dt.getMonth());",
-                    "d = d >= 0? d : Ext.num(def.d, dt.getDate());",
-
-                    // time calculations (note: these calculations create a dependency on Ext.num())
-                    "h  = h || Ext.num(def.h, dt.getHours());",
-                    "i  = i || Ext.num(def.i, dt.getMinutes());",
-                    "s  = s || Ext.num(def.s, dt.getSeconds());",
-                    "ms = ms || Ext.num(def.ms, dt.getMilliseconds());",
-
-                    "if(z >= 0 && y >= 0){",
-                        // both the year and zero-based day of year are defined and >= 0.
-                        // these 2 values alone provide sufficient info to create a full date object
-
-                        // create Date object representing January 1st for the given year
-                        "v = new Date(y, 0, 1, h, i, s, ms);",
-
-                        // then add day of year, checking for Date "rollover" if necessary
-                        "v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);",
-                    "}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){", // check for Date "rollover"
-                        "v = null;", // invalid date, so return null
-                    "}else{",
-                        // plain old Date object
-                        "v = new Date(y, m, d, h, i, s, ms);",
-                    "}",
-                "}",
-            "}",
-
-            "if(v){",
-                // favour UTC offset over GMT offset
-                "if(zz != null){",
-                    // reset to UTC, then add offset
-                    "v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);",
-                "}else if(o){",
-                    // reset to GMT, then add offset
-                    "v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
-                "}",
-            "}",
-
-            "return v;"
-        ].join('\n');
-
-        return function(format) {
-            var regexNum = Date.parseRegexes.length,
-                currentGroup = 1,
-                calc = [],
-                regex = [],
-                special = false,
-                ch = "";
-
-            for (var i = 0; i < format.length; ++i) {
-                ch = format.charAt(i);
-                if (!special && ch == "\\") {
-                    special = true;
-                } else if (special) {
-                    special = false;
-                    regex.push(String.escape(ch));
-                } else {
-                    var obj = $f(ch, currentGroup);
-                    currentGroup += obj.g;
-                    regex.push(obj.s);
-                    if (obj.g && obj.c) {
-                        calc.push(obj.c);
-                    }
-                }
-            }
-
-            Date.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", "i");
-            Date.parseFunctions[format] = new Function("input", "strict", xf(code, regexNum, calc.join('')));
-        }
-    }(),
-
-    // private
-    parseCodes : {
-        /*
-         * Notes:
-         * g = {Number} calculation group (0 or 1. only group 1 contributes to date calculations.)
-         * c = {String} calculation method (required for group 1. null for group 0. {0} = currentGroup - position in regex result array)
-         * s = {String} regex pattern. all matches are stored in results[], and are accessible by the calculation mapped to 'c'
-         */
-        d: {
-            g:1,
-            c:"d = parseInt(results[{0}], 10);\n",
-            s:"(\\d{2})" // day of month with leading zeroes (01 - 31)
-        },
-        j: {
-            g:1,
-            c:"d = parseInt(results[{0}], 10);\n",
-            s:"(\\d{1,2})" // day of month without leading zeroes (1 - 31)
-        },
-        D: function() {
-            for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); // get localised short day names
-            return {
-                g:0,
-                c:null,
-                s:"(?:" + a.join("|") +")"
-            }
-        },
-        l: function() {
-            return {
-                g:0,
-                c:null,
-                s:"(?:" + Date.dayNames.join("|") + ")"
-            }
-        },
-        N: {
-            g:0,
-            c:null,
-            s:"[1-7]" // ISO-8601 day number (1 (monday) - 7 (sunday))
-        },
-        S: {
-            g:0,
-            c:null,
-            s:"(?:st|nd|rd|th)"
-        },
-        w: {
-            g:0,
-            c:null,
-            s:"[0-6]" // javascript day number (0 (sunday) - 6 (saturday))
-        },
-        z: {
-            g:1,
-            c:"z = parseInt(results[{0}], 10);\n",
-            s:"(\\d{1,3})" // day of the year (0 - 364 (365 in leap years))
-        },
-        W: {
-            g:0,
-            c:null,
-            s:"(?:\\d{2})" // ISO-8601 week number (with leading zero)
-        },
-        F: function() {
-            return {
-                g:1,
-                c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", // get localised month number
-                s:"(" + Date.monthNames.join("|") + ")"
-            }
-        },
-        M: function() {
-            for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); // get localised short month names
-            return Ext.applyIf({
-                s:"(" + a.join("|") + ")"
-            }, $f("F"));
-        },
-        m: {
-            g:1,
-            c:"m = parseInt(results[{0}], 10) - 1;\n",
-            s:"(\\d{2})" // month number with leading zeros (01 - 12)
-        },
-        n: {
-            g:1,
-            c:"m = parseInt(results[{0}], 10) - 1;\n",
-            s:"(\\d{1,2})" // month number without leading zeros (1 - 12)
-        },
-        t: {
-            g:0,
-            c:null,
-            s:"(?:\\d{2})" // no. of days in the month (28 - 31)
-        },
-        L: {
-            g:0,
-            c:null,
-            s:"(?:1|0)"
-        },
-        o: function() {
-            return $f("Y");
-        },
-        Y: {
-            g:1,
-            c:"y = parseInt(results[{0}], 10);\n",
-            s:"(\\d{4})" // 4-digit year
-        },
-        y: {
-            g:1,
-            c:"var ty = parseInt(results[{0}], 10);\n"
-                + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", // 2-digit year
-            s:"(\\d{1,2})"
-        },
-        a: {
-            g:1,
-            c:"if (results[{0}] == 'am') {\n"
-                + "if (h == 12) { h = 0; }\n"
-                + "} else { if (h < 12) { h += 12; }}",
-            s:"(am|pm)"
-        },
-        A: {
-            g:1,
-            c:"if (results[{0}] == 'AM') {\n"
-                + "if (h == 12) { h = 0; }\n"
-                + "} else { if (h < 12) { h += 12; }}",
-            s:"(AM|PM)"
-        },
-        g: function() {
-            return $f("G");
-        },
-        G: {
-            g:1,
-            c:"h = parseInt(results[{0}], 10);\n",
-            s:"(\\d{1,2})" // 24-hr format of an hour without leading zeroes (0 - 23)
-        },
-        h: function() {
-            return $f("H");
-        },
-        H: {
-            g:1,
-            c:"h = parseInt(results[{0}], 10);\n",
-            s:"(\\d{2})" //  24-hr format of an hour with leading zeroes (00 - 23)
-        },
-        i: {
-            g:1,
-            c:"i = parseInt(results[{0}], 10);\n",
-            s:"(\\d{2})" // minutes with leading zeros (00 - 59)
-        },
-        s: {
-            g:1,
-            c:"s = parseInt(results[{0}], 10);\n",
-            s:"(\\d{2})" // seconds with leading zeros (00 - 59)
-        },
-        u: {
-            g:1,
-            c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
-            s:"(\\d+)" // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
-        },
-        O: {
-            g:1,
-            c:[
-                "o = results[{0}];",
-                "var sn = o.substring(0,1),", // get + / - sign
-                    "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),", // get hours (performs minutes-to-hour conversion also, just in case)
-                    "mn = o.substring(3,5) % 60;", // get minutes
-                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs
-            ].join("\n"),
-            s: "([+\-]\\d{4})" // GMT offset in hrs and mins
-        },
-        P: {
-            g:1,
-            c:[
-                "o = results[{0}];",
-                "var sn = o.substring(0,1),", // get + / - sign
-                    "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),", // get hours (performs minutes-to-hour conversion also, just in case)
-                    "mn = o.substring(4,6) % 60;", // get minutes
-                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs
-            ].join("\n"),
-            s: "([+\-]\\d{2}:\\d{2})" // GMT offset in hrs and mins (with colon separator)
-        },
-        T: {
-            g:0,
-            c:null,
-            s:"[A-Z]{1,4}" // timezone abbrev. may be between 1 - 4 chars
-        },
-        Z: {
-            g:1,
-            c:"zz = results[{0}] * 1;\n" // -43200 <= UTC offset <= 50400
-                  + "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
-            s:"([+\-]?\\d{1,5})" // leading '+' sign is optional for UTC offset
-        },
-        c: function() {
-            var calc = [],
-                arr = [
-                    $f("Y", 1), // year
-                    $f("m", 2), // month
-                    $f("d", 3), // day
-                    $f("h", 4), // hour
-                    $f("i", 5), // minute
-                    $f("s", 6), // second
-                    {c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"}, // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
-                    {c:[ // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified
-                        "if(results[8]) {", // timezone specified
-                            "if(results[8] == 'Z'){",
-                                "zz = 0;", // UTC
-                            "}else if (results[8].indexOf(':') > -1){",
-                                $f("P", 8).c, // timezone offset with colon separator
-                            "}else{",
-                                $f("O", 8).c, // timezone offset without colon separator
-                            "}",
-                        "}"
-                    ].join('\n')}
-                ];
-
-            for (var i = 0, l = arr.length; i < l; ++i) {
-                calc.push(arr[i].c);
-            }
-
-            return {
-                g:1,
-                c:calc.join(""),
-                s:[
-                    arr[0].s, // year (required)
-                    "(?:", "-", arr[1].s, // month (optional)
-                        "(?:", "-", arr[2].s, // day (optional)
-                            "(?:",
-                                "(?:T| )?", // time delimiter -- either a "T" or a single blank space
-                                arr[3].s, ":", arr[4].s,  // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
-                                "(?::", arr[5].s, ")?", // seconds (optional)
-                                "(?:(?:\\.|,)(\\d+))?", // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
-                                "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?", // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
-                            ")?",
-                        ")?",
-                    ")?"
-                ].join("")
-            }
-        },
-        U: {
-            g:1,
-            c:"u = parseInt(results[{0}], 10);\n",
-            s:"(-?\\d+)" // leading minus sign indicates seconds before UNIX epoch
-        }
-    }
-});
-
-}());
-
-Ext.apply(Date.prototype, {
-    // private
-    dateFormat : function(format) {
-        if (Date.formatFunctions[format] == null) {
-            Date.createFormat(format);
-        }
-        return Date.formatFunctions[format].call(this);
-    },
-
-    /**
-     * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
-     *
-     * Note: The date string returned by the javascript Date object's toString() method varies
-     * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
-     * For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
-     * getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses
-     * (which may or may not be present), failing which it proceeds to get the timezone abbreviation
-     * from the GMT offset portion of the date string.
-     * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
-     */
-    getTimezone : function() {
-        // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
-        //
-        // Opera  : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
-        // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF)
-        // FF     : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
-        // IE     : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
-        // IE     : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
-        //
-        // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
-        // step 1: (?:\((.*)\) -- find timezone in parentheses
-        // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string
-        // step 3: remove all non uppercase characters found in step 1 and 2
-        return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
-    },
-
-    /**
-     * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
-     * @param {Boolean} colon (optional) true to separate the hours and minutes with a colon (defaults to false).
-     * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
-     */
-    getGMTOffset : function(colon) {
-        return (this.getTimezoneOffset() > 0 ? "-" : "+")
-            + String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset()) / 60), 2, "0")
-            + (colon ? ":" : "")
-            + String.leftPad(Math.abs(this.getTimezoneOffset() % 60), 2, "0");
-    },
-
-    /**
-     * Get the numeric day number of the year, adjusted for leap year.
-     * @return {Number} 0 to 364 (365 in leap years).
-     */
-    getDayOfYear: function() {
-        var i = 0,
-            num = 0,
-            d = this.clone(),
-            m = this.getMonth();
-
-        for (i = 0, d.setMonth(0); i < m; d.setMonth(++i)) {
-            num += d.getDaysInMonth();
-        }
-        return num + this.getDate() - 1;
-    },
-
-    /**
-     * Get the numeric ISO-8601 week number of the year.
-     * (equivalent to the format specifier 'W', but without a leading zero).
-     * @return {Number} 1 to 53
-     */
-    getWeekOfYear : function() {
-        // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
-        var ms1d = 864e5, // milliseconds in a day
-            ms7d = 7 * ms1d; // milliseconds in a week
-
-        return function() { // return a closure so constants get calculated only once
-            var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number
-                AWN = Math.floor(DC3 / 7), // an Absolute Week Number
-                Wyr = new Date(AWN * ms7d).getUTCFullYear();
-
-            return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1;
-        }
-    }(),
-
-    /**
-     * Checks if the current date falls within a leap year.
-     * @return {Boolean} True if the current date falls within a leap year, false otherwise.
-     */
-    isLeapYear : function() {
-        var year = this.getFullYear();
-        return !!((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
-    },
-
-    /**
-     * Get the first day of the current month, adjusted for leap year.  The returned value
-     * is the numeric day index within the week (0-6) which can be used in conjunction with
-     * the {@link #monthNames} array to retrieve the textual day name.
-     * Example:
-     * <pre><code>
-var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
-</code></pre>
-     * @return {Number} The day number (0-6).
-     */
-    getFirstDayOfMonth : function() {
-        var day = (this.getDay() - (this.getDate() - 1)) % 7;
-        return (day < 0) ? (day + 7) : day;
-    },
-
-    /**
-     * Get the last day of the current month, adjusted for leap year.  The returned value
-     * is the numeric day index within the week (0-6) which can be used in conjunction with
-     * the {@link #monthNames} array to retrieve the textual day name.
-     * Example:
-     * <pre><code>
-var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
-</code></pre>
-     * @return {Number} The day number (0-6).
-     */
-    getLastDayOfMonth : function() {
-        return this.getLastDateOfMonth().getDay();
-    },
-
-
-    /**
-     * Get the date of the first day of the month in which this date resides.
-     * @return {Date}
-     */
-    getFirstDateOfMonth : function() {
-        return new Date(this.getFullYear(), this.getMonth(), 1);
-    },
-
-    /**
-     * Get the date of the last day of the month in which this date resides.
-     * @return {Date}
-     */
-    getLastDateOfMonth : function() {
-        return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth());
-    },
-
-    /**
-     * Get the number of days in the current month, adjusted for leap year.
-     * @return {Number} The number of days in the month.
-     */
-    getDaysInMonth: function() {
-        var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-
-        return function() { // return a closure for efficiency
-            var m = this.getMonth();
-
-            return m == 1 && this.isLeapYear() ? 29 : daysInMonth[m];
-        }
-    }(),
-
-    /**
-     * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
-     * @return {String} 'st, 'nd', 'rd' or 'th'.
-     */
-    getSuffix : function() {
-        switch (this.getDate()) {
-            case 1:
-            case 21:
-            case 31:
-                return "st";
-            case 2:
-            case 22:
-                return "nd";
-            case 3:
-            case 23:
-                return "rd";
-            default:
-                return "th";
-        }
-    },
-
-    /**
-     * Creates and returns a new Date instance with the exact same date value as the called instance.
-     * Dates are copied and passed by reference, so if a copied date variable is modified later, the original
-     * variable will also be changed.  When the intention is to create a new variable that will not
-     * modify the original instance, you should create a clone.
-     *
-     * Example of correctly cloning a date:
-     * <pre><code>
-//wrong way:
-var orig = new Date('10/1/2006');
-var copy = orig;
-copy.setDate(5);
-document.write(orig);  //returns 'Thu Oct 05 2006'!
-
-//correct way:
-var orig = new Date('10/1/2006');
-var copy = orig.clone();
-copy.setDate(5);
-document.write(orig);  //returns 'Thu Oct 01 2006'
-</code></pre>
-     * @return {Date} The new Date instance.
-     */
-    clone : function() {
-        return new Date(this.getTime());
-    },
-
-    /**
-     * Checks if the current date is affected by Daylight Saving Time (DST).
-     * @return {Boolean} True if the current date is affected by DST.
-     */
-    isDST : function() {
-        // adapted from http://extjs.com/forum/showthread.php?p=247172#post247172
-        // courtesy of @geoffrey.mcgill
-        return new Date(this.getFullYear(), 0, 1).getTimezoneOffset() != this.getTimezoneOffset();
-    },
-
-    /**
-     * Attempts to clear all time information from this Date by setting the time to midnight of the same day,
-     * automatically adjusting for Daylight Saving Time (DST) where applicable.
-     * (note: DST timezone information for the browser's host operating system is assumed to be up-to-date)
-     * @param {Boolean} clone true to create a clone of this date, clear the time and return it (defaults to false).
-     * @return {Date} this or the clone.
-     */
-    clearTime : function(clone) {
-        if (clone) {
-            return this.clone().clearTime();
-        }
-
-        // get current date before clearing time
-        var d = this.getDate();
-
-        // clear time
-        this.setHours(0);
-        this.setMinutes(0);
-        this.setSeconds(0);
-        this.setMilliseconds(0);
-
-        if (this.getDate() != d) { // account for DST (i.e. day of month changed when setting hour = 0)
-            // note: DST adjustments are assumed to occur in multiples of 1 hour (this is almost always the case)
-            // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions to this rule
-
-            // increment hour until cloned date == current date
-            for (var hr = 1, c = this.add(Date.HOUR, hr); c.getDate() != d; hr++, c = this.add(Date.HOUR, hr));
-
-            this.setDate(d);
-            this.setHours(c.getHours());
-        }
-
-        return this;
-    },
-
-    /**
-     * Provides a convenient method for performing basic date arithmetic. This method
-     * does not modify the Date instance being called - it creates and returns
-     * a new Date instance containing the resulting date value.
-     *
-     * Examples:
-     * <pre><code>
-// Basic usage:
-var dt = new Date('10/29/2006').add(Date.DAY, 5);
-document.write(dt); //returns 'Fri Nov 03 2006 00:00:00'
-
-// Negative values will be subtracted:
-var dt2 = new Date('10/1/2006').add(Date.DAY, -5);
-document.write(dt2); //returns 'Tue Sep 26 2006 00:00:00'
-
-// You can even chain several calls together in one line:
-var dt3 = new Date('10/1/2006').add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
-document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
-</code></pre>
-     *
-     * @param {String} interval A valid date interval enum value.
-     * @param {Number} value The amount to add to the current date.
-     * @return {Date} The new Date instance.
-     */
-    add : function(interval, value) {
-        var d = this.clone();
-        if (!interval || value === 0) return d;
-
-        switch(interval.toLowerCase()) {
-            case Date.MILLI:
-                d.setMilliseconds(this.getMilliseconds() + value);
-                break;
-            case Date.SECOND:
-                d.setSeconds(this.getSeconds() + value);
-                break;
-            case Date.MINUTE:
-                d.setMinutes(this.getMinutes() + value);
-                break;
-            case Date.HOUR:
-                d.setHours(this.getHours() + value);
-                break;
-            case Date.DAY:
-                d.setDate(this.getDate() + value);
-                break;
-            case Date.MONTH:
-                var day = this.getDate();
-                if (day > 28) {
-                    day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
-                }
-                d.setDate(day);
-                d.setMonth(this.getMonth() + value);
-                break;
-            case Date.YEAR:
-                d.setFullYear(this.getFullYear() + value);
-                break;
-        }
-        return d;
-    },
-
-    /**
-     * Checks if this date falls on or between the given start and end dates.
-     * @param {Date} start Start date
-     * @param {Date} end End date
-     * @return {Boolean} true if this date falls on or between the given start and end dates.
-     */
-    between : function(start, end) {
-        var t = this.getTime();
-        return start.getTime() <= t && t <= end.getTime();
-    }
-});
-
-
-/**
- * Formats a date given the supplied format string.
- * @param {String} format The format string.
- * @return {String} The formatted date.
- * @method format
- */
-Date.prototype.format = Date.prototype.dateFormat;
-
-
-// private
-if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420) {
-    Ext.apply(Date.prototype, {
-        _xMonth : Date.prototype.setMonth,
-        _xDate  : Date.prototype.setDate,
-
-        // Bug in Safari 1.3, 2.0 (WebKit build < 420)
-        // Date.setMonth does not work consistently if iMonth is not 0-11
-        setMonth : function(num) {
-            if (num <= -1) {
-                var n = Math.ceil(-num),
-                    back_year = Math.ceil(n / 12),
-                    month = (n % 12) ? 12 - n % 12 : 0;
-
-                this.setFullYear(this.getFullYear() - back_year);
-
-                return this._xMonth(month);
-            } else {
-                return this._xMonth(num);
-            }
-        },
-
-        // Bug in setDate() method (resolved in WebKit build 419.3, so to be safe we target Webkit builds < 420)
-        // The parameter for Date.setDate() is converted to a signed byte integer in Safari
-        // http://brianary.blogspot.com/2006/03/safari-date-bug.html
-        setDate : function(d) {
-            // use setTime() to workaround setDate() bug
-            // subtract current day of month in milliseconds, then add desired day of month in milliseconds
-            return this.setTime(this.getTime() - (this.getDate() - d) * 864e5);
-        }
-    });
-}
-
-
-
-/* Some basic Date tests... (requires Firebug)
-
-Date.parseDate('', 'c'); // call Date.parseDate() once to force computation of regex string so we can console.log() it
-console.log('Insane Regex for "c" format: %o', Date.parseCodes.c.s); // view the insane regex for the "c" format specifier
-
-// standard tests
-console.group('Standard Date.parseDate() Tests');
-    console.log('Date.parseDate("2009-01-05T11:38:56", "c")               = %o', Date.parseDate("2009-01-05T11:38:56", "c")); // assumes browser's timezone setting
-    console.log('Date.parseDate("2009-02-04T12:37:55.001000", "c")        = %o', Date.parseDate("2009-02-04T12:37:55.001000", "c")); // assumes browser's timezone setting
-    console.log('Date.parseDate("2009-03-03T13:36:54,101000Z", "c")       = %o', Date.parseDate("2009-03-03T13:36:54,101000Z", "c")); // UTC
-    console.log('Date.parseDate("2009-04-02T14:35:53.901000-0530", "c")   = %o', Date.parseDate("2009-04-02T14:35:53.901000-0530", "c")); // GMT-0530
-    console.log('Date.parseDate("2009-05-01T15:34:52,9876000+08:00", "c") = %o', Date.parseDate("2009-05-01T15:34:52,987600+08:00", "c")); // GMT+08:00
-console.groupEnd();
-
-// ISO-8601 format as specified in http://www.w3.org/TR/NOTE-datetime
-// -- accepts ALL 6 levels of date-time granularity
-console.group('ISO-8601 Granularity Test (see http://www.w3.org/TR/NOTE-datetime)');
-    console.log('Date.parseDate("1997", "c")                              = %o', Date.parseDate("1997", "c")); // YYYY (e.g. 1997)
-    console.log('Date.parseDate("1997-07", "c")                           = %o', Date.parseDate("1997-07", "c")); // YYYY-MM (e.g. 1997-07)
-    console.log('Date.parseDate("1997-07-16", "c")                        = %o', Date.parseDate("1997-07-16", "c")); // YYYY-MM-DD (e.g. 1997-07-16)
-    console.log('Date.parseDate("1997-07-16T19:20+01:00", "c")            = %o', Date.parseDate("1997-07-16T19:20+01:00", "c")); // YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00)
-    console.log('Date.parseDate("1997-07-16T19:20:30+01:00", "c")         = %o', Date.parseDate("1997-07-16T19:20:30+01:00", "c")); // YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00)
-    console.log('Date.parseDate("1997-07-16T19:20:30.45+01:00", "c")      = %o', Date.parseDate("1997-07-16T19:20:30.45+01:00", "c")); // YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00)
-    console.log('Date.parseDate("1997-07-16 19:20:30.45+01:00", "c")      = %o', Date.parseDate("1997-07-16 19:20:30.45+01:00", "c")); // YYYY-MM-DD hh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00)
-    console.log('Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)= %o', Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)); // strict date parsing with invalid month value
-console.groupEnd();
-
-//*//**
- * @class Ext.util.DelayedTask
- * <p> The DelayedTask class provides a convenient way to "buffer" the execution of a method,
- * performing setTimeout where a new timeout cancels the old timeout. When called, the
- * task will wait the specified time period before executing. If durng that time period,
- * the task is called again, the original call will be cancelled. This continues so that
- * the function is only called a single time for each iteration.</p>
- * <p>This method is especially useful for things like detecting whether a user has finished
- * typing in a text field. An example would be performing validation on a keypress. You can
- * use this class to buffer the keypress events for a certain number of milliseconds, and
- * perform only if they stop for that amount of time.  Usage:</p><pre><code>
-var task = new Ext.util.DelayedTask(function(){
-    alert(Ext.getDom('myInputField').value.length);
-});
-// Wait 500ms before calling our function. If the user presses another key 
-// during that 500ms, it will be cancelled and we'll wait another 500ms.
-Ext.get('myInputField').on('keypress', function(){
-    task.{@link #delay}(500); 
-});
- * </code></pre> 
- * <p>Note that we are using a DelayedTask here to illustrate a point. The configuration
- * option <tt>buffer</tt> for {@link Ext.util.Observable#addListener addListener/on} will
- * also setup a delayed task for you to buffer events.</p> 
- * @constructor The parameters to this constructor serve as defaults and are not required.
- * @param {Function} fn (optional) The default function to timeout
- * @param {Object} scope (optional) The default scope of that timeout
- * @param {Array} args (optional) The default Array of arguments
- */
-Ext.util.DelayedTask = function(fn, scope, args){
-    var me = this,
-       id,     
-       call = function(){
-               clearInterval(id);
-               id = null;
-               fn.apply(scope, args || []);
-           };
-           
-    /**
-     * Cancels any pending timeout and queues a new one
-     * @param {Number} delay The milliseconds to delay
-     * @param {Function} newFn (optional) Overrides function passed to constructor
-     * @param {Object} newScope (optional) Overrides scope passed to constructor
-     * @param {Array} newArgs (optional) Overrides args passed to constructor
-     */
-    me.delay = function(delay, newFn, newScope, newArgs){
-        me.cancel();
-        fn = newFn || fn;
-        scope = newScope || scope;
-        args = newArgs || args;
-        id = setInterval(call, delay);
-    };
-
-    /**
-     * Cancel the last queued timeout
-     */
-    me.cancel = function(){
-        if(id){
-            clearInterval(id);
-            id = null;
-        }
-    };
-};/**\r
- * @class Ext.util.MixedCollection\r
- * @extends Ext.util.Observable\r
- * A Collection class that maintains both numeric indexes and keys and exposes events.\r
- * @constructor\r
- * @param {Boolean} allowFunctions True if the addAll function should add function references to the\r
- * collection (defaults to false)\r
- * @param {Function} keyFn A function that can accept an item of the type(s) stored in this MixedCollection\r
- * and return the key value for that item.  This is used when available to look up the key on items that\r
- * were passed without an explicit key parameter to a MixedCollection method.  Passing this parameter is\r
- * equivalent to providing an implementation for the {@link #getKey} method.\r
- */\r
-Ext.util.MixedCollection = function(allowFunctions, keyFn){\r
-    this.items = [];\r
-    this.map = {};\r
-    this.keys = [];\r
-    this.length = 0;\r
-    this.addEvents(\r
-        /**\r
-         * @event clear\r
-         * Fires when the collection is cleared.\r
-         */\r
-        "clear",\r
-        /**\r
-         * @event add\r
-         * Fires when an item is added to the collection.\r
-         * @param {Number} index The index at which the item was added.\r
-         * @param {Object} o The item added.\r
-         * @param {String} key The key associated with the added item.\r
-         */\r
-        "add",\r
-        /**\r
-         * @event replace\r
-         * Fires when an item is replaced in the collection.\r
-         * @param {String} key he key associated with the new added.\r
-         * @param {Object} old The item being replaced.\r
-         * @param {Object} new The new item.\r
-         */\r
-        "replace",\r
-        /**\r
-         * @event remove\r
-         * Fires when an item is removed from the collection.\r
-         * @param {Object} o The item being removed.\r
-         * @param {String} key (optional) The key associated with the removed item.\r
-         */\r
-        "remove",\r
-        "sort"\r
-    );\r
-    this.allowFunctions = allowFunctions === true;\r
-    if(keyFn){\r
-        this.getKey = keyFn;\r
-    }\r
-    Ext.util.MixedCollection.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {\r
-    allowFunctions : false,\r
-\r
-/**\r
- * Adds an item to the collection. Fires the {@link #add} event when complete.\r
- * @param {String} key <p>The key to associate with the item, or the new item.</p>\r
- * <p>If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key\r
- * of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection\r
- * will be able to <i>derive</i> the key for the new item. In this case just pass the new item in\r
- * this parameter.</p>\r
- * @param {Object} o The item to add.\r
- * @return {Object} The item added.\r
- */\r
-    add: function(key, o){\r
-        if(arguments.length == 1){\r
-            o = arguments[0];\r
-            key = this.getKey(o);\r
-        }\r
-        if(typeof key != 'undefined' && key !== null){\r
-            var old = this.map[key];\r
-            if(typeof old != 'undefined'){\r
-                return this.replace(key, o);\r
-            }\r
-            this.map[key] = o;\r
-        }\r
-        this.length++;\r
-        this.items.push(o);\r
-        this.keys.push(key);\r
-        this.fireEvent('add', this.length-1, o, key);\r
-        return o;\r
-    },\r
-\r
-/**\r
-  * MixedCollection has a generic way to fetch keys if you implement getKey.  The default implementation\r
-  * simply returns <tt style="font-weight:bold;">item.id</tt> but you can provide your own implementation\r
-  * to return a different value as in the following examples:\r
-<pre><code>\r
-// normal way\r
-var mc = new Ext.util.MixedCollection();\r
-mc.add(someEl.dom.id, someEl);\r
-mc.add(otherEl.dom.id, otherEl);\r
-//and so on\r
-\r
-// using getKey\r
-var mc = new Ext.util.MixedCollection();\r
-mc.getKey = function(el){\r
-   return el.dom.id;\r
-};\r
-mc.add(someEl);\r
-mc.add(otherEl);\r
-\r
-// or via the constructor\r
-var mc = new Ext.util.MixedCollection(false, function(el){\r
-   return el.dom.id;\r
-});\r
-mc.add(someEl);\r
-mc.add(otherEl);\r
-</code></pre>\r
- * @param {Object} item The item for which to find the key.\r
- * @return {Object} The key for the passed item.\r
- */\r
-    getKey : function(o){\r
-         return o.id;\r
-    },\r
-\r
-/**\r
- * Replaces an item in the collection. Fires the {@link #replace} event when complete.\r
- * @param {String} key <p>The key associated with the item to replace, or the replacement item.</p>\r
- * <p>If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key\r
- * of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection\r
- * will be able to <i>derive</i> the key of the replacement item. If you want to replace an item\r
- * with one having the same key value, then just pass the replacement item in this parameter.</p>\r
- * @param o {Object} o (optional) If the first parameter passed was a key, the item to associate\r
- * with that key.\r
- * @return {Object}  The new item.\r
- */\r
-    replace : function(key, o){\r
-        if(arguments.length == 1){\r
-            o = arguments[0];\r
-            key = this.getKey(o);\r
-        }\r
-        var old = this.map[key];\r
-        if(typeof key == "undefined" || key === null || typeof old == "undefined"){\r
-             return this.add(key, o);\r
-        }\r
-        var index = this.indexOfKey(key);\r
-        this.items[index] = o;\r
-        this.map[key] = o;\r
-        this.fireEvent("replace", key, old, o);\r
-        return o;\r
-    },\r
-\r
-/**\r
- * Adds all elements of an Array or an Object to the collection.\r
- * @param {Object/Array} objs An Object containing properties which will be added to the collection, or\r
- * an Array of values, each of which are added to the collection.\r
- */\r
-    addAll : function(objs){\r
-        if(arguments.length > 1 || Ext.isArray(objs)){\r
-            var args = arguments.length > 1 ? arguments : objs;\r
-            for(var i = 0, len = args.length; i < len; i++){\r
-                this.add(args[i]);\r
-            }\r
-        }else{\r
-            for(var key in objs){\r
-                if(this.allowFunctions || typeof objs[key] != "function"){\r
-                    this.add(key, objs[key]);\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-/**\r
- * Executes the specified function once for every item in the collection, passing the following arguments:\r
- * <div class="mdetail-params"><ul>\r
- * <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li>\r
- * <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li>\r
- * <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li>\r
- * </ul></div>\r
- * The function should return a boolean value. Returning false from the function will stop the iteration.\r
- * @param {Function} fn The function to execute for each item.\r
- * @param {Object} scope (optional) The scope in which to execute the function.\r
- */\r
-    each : function(fn, scope){\r
-        var items = [].concat(this.items); // each safe for removal\r
-        for(var i = 0, len = items.length; i < len; i++){\r
-            if(fn.call(scope || items[i], items[i], i, len) === false){\r
-                break;\r
-            }\r
-        }\r
-    },\r
-\r
-/**\r
- * Executes the specified function once for every key in the collection, passing each\r
- * key, and its associated item as the first two parameters.\r
- * @param {Function} fn The function to execute for each item.\r
- * @param {Object} scope (optional) The scope in which to execute the function.\r
- */\r
-    eachKey : function(fn, scope){\r
-        for(var i = 0, len = this.keys.length; i < len; i++){\r
-            fn.call(scope || window, this.keys[i], this.items[i], i, len);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns the first item in the collection which elicits a true return value from the\r
-     * passed selection function.\r
-     * @param {Function} fn The selection function to execute for each item.\r
-     * @param {Object} scope (optional) The scope in which to execute the function.\r
-     * @return {Object} The first item in the collection which returned true from the selection function.\r
-     */\r
-    find : function(fn, scope){\r
-        for(var i = 0, len = this.items.length; i < len; i++){\r
-            if(fn.call(scope || window, this.items[i], this.keys[i])){\r
-                return this.items[i];\r
-            }\r
-        }\r
-        return null;\r
-    },\r
-\r
-/**\r
- * Inserts an item at the specified index in the collection. Fires the {@link #add} event when complete.\r
- * @param {Number} index The index to insert the item at.\r
- * @param {String} key The key to associate with the new item, or the item itself.\r
- * @param {Object} o (optional) If the second parameter was a key, the new item.\r
- * @return {Object} The item inserted.\r
- */\r
-    insert : function(index, key, o){\r
-        if(arguments.length == 2){\r
-            o = arguments[1];\r
-            key = this.getKey(o);\r
-        }\r
-        if(this.containsKey(key)){\r
-            this.suspendEvents();\r
-            this.removeKey(key);\r
-            this.resumeEvents();\r
-        }\r
-        if(index >= this.length){\r
-            return this.add(key, o);\r
-        }\r
-        this.length++;\r
-        this.items.splice(index, 0, o);\r
-        if(typeof key != "undefined" && key !== null){\r
-            this.map[key] = o;\r
-        }\r
-        this.keys.splice(index, 0, key);\r
-        this.fireEvent("add", index, o, key);\r
-        return o;\r
-    },\r
-\r
-/**\r
- * Remove an item from the collection.\r
- * @param {Object} o The item to remove.\r
- * @return {Object} The item removed or false if no item was removed.\r
- */\r
-    remove : function(o){\r
-        return this.removeAt(this.indexOf(o));\r
-    },\r
-\r
-/**\r
- * Remove an item from a specified index in the collection. Fires the {@link #remove} event when complete.\r
- * @param {Number} index The index within the collection of the item to remove.\r
- * @return {Object} The item removed or false if no item was removed.\r
- */\r
-    removeAt : function(index){\r
-        if(index < this.length && index >= 0){\r
-            this.length--;\r
-            var o = this.items[index];\r
-            this.items.splice(index, 1);\r
-            var key = this.keys[index];\r
-            if(typeof key != "undefined"){\r
-                delete this.map[key];\r
-            }\r
-            this.keys.splice(index, 1);\r
-            this.fireEvent("remove", o, key);\r
-            return o;\r
-        }\r
-        return false;\r
-    },\r
-\r
-/**\r
- * Removed an item associated with the passed key fom the collection.\r
- * @param {String} key The key of the item to remove.\r
- * @return {Object} The item removed or false if no item was removed.\r
- */\r
-    removeKey : function(key){\r
-        return this.removeAt(this.indexOfKey(key));\r
-    },\r
-\r
-/**\r
- * Returns the number of items in the collection.\r
- * @return {Number} the number of items in the collection.\r
- */\r
-    getCount : function(){\r
-        return this.length;\r
-    },\r
-\r
-/**\r
- * Returns index within the collection of the passed Object.\r
- * @param {Object} o The item to find the index of.\r
- * @return {Number} index of the item. Returns -1 if not found.\r
- */\r
-    indexOf : function(o){\r
-        return this.items.indexOf(o);\r
-    },\r
-\r
-/**\r
- * Returns index within the collection of the passed key.\r
- * @param {String} key The key to find the index of.\r
- * @return {Number} index of the key.\r
- */\r
-    indexOfKey : function(key){\r
-        return this.keys.indexOf(key);\r
-    },\r
-\r
-/**\r
- * Returns the item associated with the passed key OR index. Key has priority over index.  This is the equivalent\r
- * of calling {@link #key} first, then if nothing matched calling {@link #itemAt}.\r
- * @param {String/Number} key The key or index of the item.\r
- * @return {Object} If the item is found, returns the item.  If the item was not found, returns <tt>undefined</tt>.\r
- * If an item was found, but is a Class, returns <tt>null</tt>.\r
- */\r
-    item : function(key){\r
-        var mk = this.map[key],\r
-            item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined;\r
-        return !Ext.isFunction(item) || this.allowFunctions ? item : null; // for prototype!\r
-    },\r
-\r
-/**\r
- * Returns the item at the specified index.\r
- * @param {Number} index The index of the item.\r
- * @return {Object} The item at the specified index.\r
- */\r
-    itemAt : function(index){\r
-        return this.items[index];\r
-    },\r
-\r
-/**\r
- * Returns the item associated with the passed key.\r
- * @param {String/Number} key The key of the item.\r
- * @return {Object} The item associated with the passed key.\r
- */\r
-    key : function(key){\r
-        return this.map[key];\r
-    },\r
-\r
-/**\r
- * Returns true if the collection contains the passed Object as an item.\r
- * @param {Object} o  The Object to look for in the collection.\r
- * @return {Boolean} True if the collection contains the Object as an item.\r
- */\r
-    contains : function(o){\r
-        return this.indexOf(o) != -1;\r
-    },\r
-\r
-/**\r
- * Returns true if the collection contains the passed Object as a key.\r
- * @param {String} key The key to look for in the collection.\r
- * @return {Boolean} True if the collection contains the Object as a key.\r
- */\r
-    containsKey : function(key){\r
-        return typeof this.map[key] != "undefined";\r
-    },\r
-\r
-/**\r
- * Removes all items from the collection.  Fires the {@link #clear} event when complete.\r
- */\r
-    clear : function(){\r
-        this.length = 0;\r
-        this.items = [];\r
-        this.keys = [];\r
-        this.map = {};\r
-        this.fireEvent("clear");\r
-    },\r
-\r
-/**\r
- * Returns the first item in the collection.\r
- * @return {Object} the first item in the collection..\r
- */\r
-    first : function(){\r
-        return this.items[0];\r
-    },\r
-\r
-/**\r
- * Returns the last item in the collection.\r
- * @return {Object} the last item in the collection..\r
- */\r
-    last : function(){\r
-        return this.items[this.length-1];\r
-    },\r
-\r
-    // private\r
-    _sort : function(property, dir, fn){\r
-        var i,\r
-            len,\r
-            dsc = String(dir).toUpperCase() == "DESC" ? -1 : 1,\r
-            c = [], k = this.keys, items = this.items;\r
-            \r
-        fn = fn || function(a, b){\r
-            return a-b;\r
-        };\r
-        for(i = 0, len = items.length; i < len; i++){\r
-            c[c.length] = {key: k[i], value: items[i], index: i};\r
-        }\r
-        c.sort(function(a, b){\r
-            var v = fn(a[property], b[property]) * dsc;\r
-            if(v === 0){\r
-                v = (a.index < b.index ? -1 : 1);\r
-            }\r
-            return v;\r
-        });\r
-        for(i = 0, len = c.length; i < len; i++){\r
-            items[i] = c[i].value;\r
-            k[i] = c[i].key;\r
-        }\r
-        this.fireEvent("sort", this);\r
-    },\r
-\r
-    /**\r
-     * Sorts this collection with the passed comparison function\r
-     * @param {String} direction (optional) "ASC" or "DESC"\r
-     * @param {Function} fn (optional) comparison function\r
-     */\r
-    sort : function(dir, fn){\r
-        this._sort("value", dir, fn);\r
-    },\r
-\r
-    /**\r
-     * Sorts this collection by keys\r
-     * @param {String} direction (optional) "ASC" or "DESC"\r
-     * @param {Function} fn (optional) a comparison function (defaults to case insensitive string)\r
-     */\r
-    keySort : function(dir, fn){\r
-        this._sort("key", dir, fn || function(a, b){\r
-            var v1 = String(a).toUpperCase(), v2 = String(b).toUpperCase();\r
-            return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);\r
-        });\r
-    },\r
-\r
-    /**\r
-     * Returns a range of items in this collection\r
-     * @param {Number} startIndex (optional) defaults to 0\r
-     * @param {Number} endIndex (optional) default to the last item\r
-     * @return {Array} An array of items\r
-     */\r
-    getRange : function(start, end){\r
-        var items = this.items;\r
-        if(items.length < 1){\r
-            return [];\r
-        }\r
-        start = start || 0;\r
-        end = Math.min(typeof end == "undefined" ? this.length-1 : end, this.length-1);\r
-        var i, r = [];\r
-        if(start <= end){\r
-            for(i = start; i <= end; i++) {\r
-                r[r.length] = items[i];\r
-            }\r
-        }else{\r
-            for(i = start; i >= end; i--) {\r
-                r[r.length] = items[i];\r
-            }\r
-        }\r
-        return r;\r
-    },\r
-\r
-    /**\r
-     * Filter the <i>objects</i> in this collection by a specific property.\r
-     * Returns a new collection that has been filtered.\r
-     * @param {String} property A property on your objects\r
-     * @param {String/RegExp} value Either string that the property values\r
-     * should start with or a RegExp to test against the property\r
-     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning\r
-     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison (defaults to False).\r
-     * @return {MixedCollection} The new filtered collection\r
-     */\r
-    filter : function(property, value, anyMatch, caseSensitive){\r
-        if(Ext.isEmpty(value, false)){\r
-            return this.clone();\r
-        }\r
-        value = this.createValueMatcher(value, anyMatch, caseSensitive);\r
-        return this.filterBy(function(o){\r
-            return o && value.test(o[property]);\r
-        });\r
-    },\r
-\r
-    /**\r
-     * Filter by a function. Returns a <i>new</i> collection that has been filtered.\r
-     * The passed function will be called with each object in the collection.\r
-     * If the function returns true, the value is included otherwise it is filtered.\r
-     * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key)\r
-     * @param {Object} scope (optional) The scope of the function (defaults to this)\r
-     * @return {MixedCollection} The new filtered collection\r
-     */\r
-    filterBy : function(fn, scope){\r
-        var r = new Ext.util.MixedCollection();\r
-        r.getKey = this.getKey;\r
-        var k = this.keys, it = this.items;\r
-        for(var i = 0, len = it.length; i < len; i++){\r
-            if(fn.call(scope||this, it[i], k[i])){\r
-                r.add(k[i], it[i]);\r
-            }\r
-        }\r
-        return r;\r
-    },\r
-\r
-    /**\r
-     * Finds the index of the first matching object in this collection by a specific property/value.\r
-     * @param {String} property The name of a property on your objects.\r
-     * @param {String/RegExp} value A string that the property values\r
-     * should start with or a RegExp to test against the property.\r
-     * @param {Number} start (optional) The index to start searching at (defaults to 0).\r
-     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning.\r
-     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison.\r
-     * @return {Number} The matched index or -1\r
-     */\r
-    findIndex : function(property, value, start, anyMatch, caseSensitive){\r
-        if(Ext.isEmpty(value, false)){\r
-            return -1;\r
-        }\r
-        value = this.createValueMatcher(value, anyMatch, caseSensitive);\r
-        return this.findIndexBy(function(o){\r
-            return o && value.test(o[property]);\r
-        }, null, start);\r
-    },\r
-\r
-    /**\r
-     * Find the index of the first matching object in this collection by a function.\r
-     * If the function returns <i>true</i> it is considered a match.\r
-     * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key).\r
-     * @param {Object} scope (optional) The scope of the function (defaults to this).\r
-     * @param {Number} start (optional) The index to start searching at (defaults to 0).\r
-     * @return {Number} The matched index or -1\r
-     */\r
-    findIndexBy : function(fn, scope, start){\r
-        var k = this.keys, it = this.items;\r
-        for(var i = (start||0), len = it.length; i < len; i++){\r
-            if(fn.call(scope||this, it[i], k[i])){\r
-                return i;\r
-            }\r
-        }\r
-        return -1;\r
-    },\r
-\r
-    // private\r
-    createValueMatcher : function(value, anyMatch, caseSensitive){\r
-        if(!value.exec){ // not a regex\r
-            value = String(value);\r
-            value = new RegExp((anyMatch === true ? '' : '^') + Ext.escapeRe(value), caseSensitive ? '' : 'i');\r
-        }\r
-        return value;\r
-    },\r
-\r
-    /**\r
-     * Creates a shallow copy of this collection\r
-     * @return {MixedCollection}\r
-     */\r
-    clone : function(){\r
-        var r = new Ext.util.MixedCollection();\r
-        var k = this.keys, it = this.items;\r
-        for(var i = 0, len = it.length; i < len; i++){\r
-            r.add(k[i], it[i]);\r
-        }\r
-        r.getKey = this.getKey;\r
-        return r;\r
-    }\r
-});\r
-/**\r
- * This method calls {@link #item item()}.\r
- * Returns the item associated with the passed key OR index. Key has priority over index.  This is the equivalent\r
- * of calling {@link #key} first, then if nothing matched calling {@link #itemAt}.\r
- * @param {String/Number} key The key or index of the item.\r
- * @return {Object} If the item is found, returns the item.  If the item was not found, returns <tt>undefined</tt>.\r
- * If an item was found, but is a Class, returns <tt>null</tt>.\r
- */\r
-Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;/**
- * @class Ext.util.JSON
- * Modified version of Douglas Crockford"s json.js that doesn"t
- * mess with the Object prototype
- * http://www.json.org/js.html
- * @singleton
- */
-Ext.util.JSON = new (function(){
-    var useHasOwn = !!{}.hasOwnProperty,
-        isNative = function() {
-            var useNative = null;
-
-            return function() {
-                if (useNative === null) {
-                    useNative = Ext.USE_NATIVE_JSON && window.JSON && JSON.toString() == '[object JSON]';
-                }
-        
-                return useNative;
-            };
-        }(),
-        pad = function(n) {
-            return n < 10 ? "0" + n : n;
-        },
-        doDecode = function(json){
-            return eval("(" + json + ')');    
-        },
-        doEncode = function(o){
-            if(typeof o == "undefined" || o === null){
-                return "null";
-            }else if(Ext.isArray(o)){
-                return encodeArray(o);
-            }else if(Object.prototype.toString.apply(o) === '[object Date]'){
-                return Ext.util.JSON.encodeDate(o);
-            }else if(typeof o == "string"){
-                return encodeString(o);
-            }else if(typeof o == "number"){
-                return isFinite(o) ? String(o) : "null";
-            }else if(typeof o == "boolean"){
-                return String(o);
-            }else {
-                var a = ["{"], b, i, v;
-                for (i in o) {
-                    if(!useHasOwn || o.hasOwnProperty(i)) {
-                        v = o[i];
-                        switch (typeof v) {
-                        case "undefined":
-                        case "function":
-                        case "unknown":
-                            break;
-                        default:
-                            if(b){
-                                a.push(',');
-                            }
-                            a.push(doEncode(i), ":",
-                                    v === null ? "null" : doEncode(v));
-                            b = true;
-                        }
-                    }
-                }
-                a.push("}");
-                return a.join("");
-            }    
-        },
-        m = {
-            "\b": '\\b',
-            "\t": '\\t',
-            "\n": '\\n',
-            "\f": '\\f',
-            "\r": '\\r',
-            '"' : '\\"',
-            "\\": '\\\\'
-        },
-        encodeString = function(s){
-            if (/["\\\x00-\x1f]/.test(s)) {
-                return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
-                    var c = m[b];
-                    if(c){
-                        return c;
-                    }
-                    c = b.charCodeAt();
-                    return "\\u00" +
-                        Math.floor(c / 16).toString(16) +
-                        (c % 16).toString(16);
-                }) + '"';
-            }
-            return '"' + s + '"';
-        },
-        encodeArray = function(o){
-            var a = ["["], b, i, l = o.length, v;
-                for (i = 0; i < l; i += 1) {
-                    v = o[i];
-                    switch (typeof v) {
-                        case "undefined":
-                        case "function":
-                        case "unknown":
-                            break;
-                        default:
-                            if (b) {
-                                a.push(',');
-                            }
-                            a.push(v === null ? "null" : Ext.util.JSON.encode(v));
-                            b = true;
-                    }
-                }
-                a.push("]");
-                return a.join("");
-        };
-
-    this.encodeDate = function(o){
-        return '"' + o.getFullYear() + "-" +
-                pad(o.getMonth() + 1) + "-" +
-                pad(o.getDate()) + "T" +
-                pad(o.getHours()) + ":" +
-                pad(o.getMinutes()) + ":" +
-                pad(o.getSeconds()) + '"';
-    };
-
-    /**
-     * Encodes an Object, Array or other value
-     * @param {Mixed} o The variable to encode
-     * @return {String} The JSON string
-     */
-    this.encode = function() {
-        var ec;
-        return function(o) {
-            if (!ec) {
-                // setup encoding function on first access
-                ec = isNative() ? JSON.stringify : doEncode;
-            }
-            return ec(o);
-        };
-    }();
-
-
-    /**
-     * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set.
-     * @param {String} json The JSON string
-     * @return {Object} The resulting object
-     */
-    this.decode = function() {
-        var dc;
-        return function(json) {
-            if (!dc) {
-                // setup decoding function on first access
-                dc = isNative() ? JSON.parse : doDecode;
-            }
-            return dc(json);
-        };
-    }();
-
-})();
-/**
- * Shorthand for {@link Ext.util.JSON#encode}
- * @param {Mixed} o The variable to encode
- * @return {String} The JSON string
- * @member Ext
- * @method encode
- */
-Ext.encode = Ext.util.JSON.encode;
-/**
- * Shorthand for {@link Ext.util.JSON#decode}
- * @param {String} json The JSON string
- * @param {Boolean} safe (optional) Whether to return null or throw an exception if the JSON is invalid.
- * @return {Object} The resulting object
- * @member Ext
- * @method decode
- */
-Ext.decode = Ext.util.JSON.decode;
-/**\r
- * @class Ext.util.Format\r
- * Reusable data formatting functions\r
- * @singleton\r
- */\r
-Ext.util.Format = function(){\r
-    var trimRe = /^\s+|\s+$/g;\r
-    return {\r
-        /**\r
-         * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length\r
-         * @param {String} value The string to truncate\r
-         * @param {Number} length The maximum length to allow before truncating\r
-         * @param {Boolean} word True to try to find a common work break\r
-         * @return {String} The converted text\r
-         */\r
-        ellipsis : function(value, len, word){\r
-            if(value && value.length > len){\r
-                if(word){\r
-                    var vs = value.substr(0, len - 2);\r
-                    var index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));\r
-                    if(index == -1 || index < (len - 15)){\r
-                        return value.substr(0, len - 3) + "...";\r
-                    }else{\r
-                        return vs.substr(0, index) + "...";\r
-                    }\r
-                } else{\r
-                    return value.substr(0, len - 3) + "...";\r
-                }\r
-            }\r
-            return value;\r
-        },\r
-\r
-        /**\r
-         * Checks a reference and converts it to empty string if it is undefined\r
-         * @param {Mixed} value Reference to check\r
-         * @return {Mixed} Empty string if converted, otherwise the original value\r
-         */\r
-        undef : function(value){\r
-            return value !== undefined ? value : "";\r
-        },\r
-\r
-        /**\r
-         * Checks a reference and converts it to the default value if it's empty\r
-         * @param {Mixed} value Reference to check\r
-         * @param {String} defaultValue The value to insert of it's undefined (defaults to "")\r
-         * @return {String}\r
-         */\r
-        defaultValue : function(value, defaultValue){\r
-            return value !== undefined && value !== '' ? value : defaultValue;\r
-        },\r
-\r
-        /**\r
-         * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.\r
-         * @param {String} value The string to encode\r
-         * @return {String} The encoded text\r
-         */\r
-        htmlEncode : function(value){\r
-            return !value ? value : String(value).replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");\r
-        },\r
-\r
-        /**\r
-         * Convert certain characters (&, <, >, and ') from their HTML character equivalents.\r
-         * @param {String} value The string to decode\r
-         * @return {String} The decoded text\r
-         */\r
-        htmlDecode : function(value){\r
-            return !value ? value : String(value).replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");\r
-        },\r
-\r
-        /**\r
-         * Trims any whitespace from either side of a string\r
-         * @param {String} value The text to trim\r
-         * @return {String} The trimmed text\r
-         */\r
-        trim : function(value){\r
-            return String(value).replace(trimRe, "");\r
-        },\r
-\r
-        /**\r
-         * Returns a substring from within an original string\r
-         * @param {String} value The original text\r
-         * @param {Number} start The start index of the substring\r
-         * @param {Number} length The length of the substring\r
-         * @return {String} The substring\r
-         */\r
-        substr : function(value, start, length){\r
-            return String(value).substr(start, length);\r
-        },\r
-\r
-        /**\r
-         * Converts a string to all lower case letters\r
-         * @param {String} value The text to convert\r
-         * @return {String} The converted text\r
-         */\r
-        lowercase : function(value){\r
-            return String(value).toLowerCase();\r
-        },\r
-\r
-        /**\r
-         * Converts a string to all upper case letters\r
-         * @param {String} value The text to convert\r
-         * @return {String} The converted text\r
-         */\r
-        uppercase : function(value){\r
-            return String(value).toUpperCase();\r
-        },\r
-\r
-        /**\r
-         * Converts the first character only of a string to upper case\r
-         * @param {String} value The text to convert\r
-         * @return {String} The converted text\r
-         */\r
-        capitalize : function(value){\r
-            return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase();\r
-        },\r
-\r
-        // private\r
-        call : function(value, fn){\r
-            if(arguments.length > 2){\r
-                var args = Array.prototype.slice.call(arguments, 2);\r
-                args.unshift(value);\r
-                return eval(fn).apply(window, args);\r
-            }else{\r
-                return eval(fn).call(window, value);\r
-            }\r
-        },\r
-\r
-        /**\r
-         * Format a number as US currency\r
-         * @param {Number/String} value The numeric value to format\r
-         * @return {String} The formatted currency string\r
-         */\r
-        usMoney : function(v){\r
-            v = (Math.round((v-0)*100))/100;\r
-            v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);\r
-            v = String(v);\r
-            var ps = v.split('.');\r
-            var whole = ps[0];\r
-            var sub = ps[1] ? '.'+ ps[1] : '.00';\r
-            var r = /(\d+)(\d{3})/;\r
-            while (r.test(whole)) {\r
-                whole = whole.replace(r, '$1' + ',' + '$2');\r
-            }\r
-            v = whole + sub;\r
-            if(v.charAt(0) == '-'){\r
-                return '-$' + v.substr(1);\r
-            }\r
-            return "$" +  v;\r
-        },\r
-\r
-        /**\r
-         * Parse a value into a formatted date using the specified format pattern.\r
-         * @param {String/Date} value The value to format (Strings must conform to the format expected by the javascript Date object's <a href="http://www.w3schools.com/jsref/jsref_parse.asp">parse()</a> method)\r
-         * @param {String} format (optional) Any valid date format string (defaults to 'm/d/Y')\r
-         * @return {String} The formatted date string\r
-         */\r
-        date : function(v, format){\r
-            if(!v){\r
-                return "";\r
-            }\r
-            if(!Ext.isDate(v)){\r
-                v = new Date(Date.parse(v));\r
-            }\r
-            return v.dateFormat(format || "m/d/Y");\r
-        },\r
-\r
-        /**\r
-         * Returns a date rendering function that can be reused to apply a date format multiple times efficiently\r
-         * @param {String} format Any valid date format string\r
-         * @return {Function} The date formatting function\r
-         */\r
-        dateRenderer : function(format){\r
-            return function(v){\r
-                return Ext.util.Format.date(v, format);\r
-            };\r
-        },\r
-\r
-        // private\r
-        stripTagsRE : /<\/?[^>]+>/gi,\r
-        \r
-        /**\r
-         * Strips all HTML tags\r
-         * @param {Mixed} value The text from which to strip tags\r
-         * @return {String} The stripped text\r
-         */\r
-        stripTags : function(v){\r
-            return !v ? v : String(v).replace(this.stripTagsRE, "");\r
-        },\r
-\r
-        stripScriptsRe : /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,\r
-\r
-        /**\r
-         * Strips all script tags\r
-         * @param {Mixed} value The text from which to strip script tags\r
-         * @return {String} The stripped text\r
-         */\r
-        stripScripts : function(v){\r
-            return !v ? v : String(v).replace(this.stripScriptsRe, "");\r
-        },\r
-\r
-        /**\r
-         * Simple format for a file size (xxx bytes, xxx KB, xxx MB)\r
-         * @param {Number/String} size The numeric value to format\r
-         * @return {String} The formatted file size\r
-         */\r
-        fileSize : function(size){\r
-            if(size < 1024) {\r
-                return size + " bytes";\r
-            } else if(size < 1048576) {\r
-                return (Math.round(((size*10) / 1024))/10) + " KB";\r
-            } else {\r
-                return (Math.round(((size*10) / 1048576))/10) + " MB";\r
-            }\r
-        },\r
-\r
-        /**\r
-         * It does simple math for use in a template, for example:<pre><code>\r
-         * var tpl = new Ext.Template('{value} * 10 = {value:math("* 10")}');\r
-         * </code></pre>\r
-         * @return {Function} A function that operates on the passed value.\r
-         */\r
-        math : function(){\r
-            var fns = {};\r
-            return function(v, a){\r
-                if(!fns[a]){\r
-                    fns[a] = new Function('v', 'return v ' + a + ';');\r
-                }\r
-                return fns[a](v);\r
-            }\r
-        }(),\r
-\r
-        /**\r
-         * Rounds the passed number to the required decimal precision.\r
-         * @param {Number/String} value The numeric value to round.\r
-         * @param {Number} precision The number of decimal places to which to round the first parameter's value.\r
-         * @return {Number} The rounded value.\r
-         */\r
-        round : function(value, precision) {\r
-            var result = Number(value);\r
-            if (typeof precision == 'number') {\r
-                precision = Math.pow(10, precision);\r
-                result = Math.round(value * precision) / precision;\r
-            }\r
-            return result;\r
-        },\r
-\r
-        /**\r
-         * Formats the number according to the format string.\r
-         * <div style="margin-left:40px">examples (123456.789):\r
-         * <div style="margin-left:10px">\r
-         * 0 - (123456) show only digits, no precision<br>\r
-         * 0.00 - (123456.78) show only digits, 2 precision<br>\r
-         * 0.0000 - (123456.7890) show only digits, 4 precision<br>\r
-         * 0,000 - (123,456) show comma and digits, no precision<br>\r
-         * 0,000.00 - (123,456.78) show comma and digits, 2 precision<br>\r
-         * 0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision<br>\r
-         * To reverse the grouping (,) and decimal (.) for international numbers, add /i to the end.\r
-         * For example: 0.000,00/i\r
-         * </div></div>\r
-         * @param {Number} v The number to format.\r
-         * @param {String} format The way you would like to format this text.\r
-         * @return {String} The formatted number.\r
-         */\r
-        number: function(v, format) {\r
-            if(!format){\r
-                       return v;\r
-                   }\r
-                   v = Ext.num(v, NaN);\r
-            if (isNaN(v)){\r
-                return '';\r
-            }\r
-                   var comma = ',',\r
-                       dec = '.',\r
-                       i18n = false,\r
-                       neg = v < 0;\r
-               \r
-                   v = Math.abs(v);\r
-                   if(format.substr(format.length - 2) == '/i'){\r
-                       format = format.substr(0, format.length - 2);\r
-                       i18n = true;\r
-                       comma = '.';\r
-                       dec = ',';\r
-                   }\r
-               \r
-                   var hasComma = format.indexOf(comma) != -1, \r
-                       psplit = (i18n ? format.replace(/[^\d\,]/g, '') : format.replace(/[^\d\.]/g, '')).split(dec);\r
-               \r
-                   if(1 < psplit.length){\r
-                       v = v.toFixed(psplit[1].length);\r
-                   }else if(2 < psplit.length){\r
-                       throw ('NumberFormatException: invalid format, formats should have no more than 1 period: ' + format);\r
-                   }else{\r
-                       v = v.toFixed(0);\r
-                   }\r
-               \r
-                   var fnum = v.toString();\r
-                   if(hasComma){\r
-                       psplit = fnum.split('.');\r
-               \r
-                       var cnum = psplit[0], parr = [], j = cnum.length, m = Math.floor(j / 3), n = cnum.length % 3 || 3;\r
-               \r
-                       for(var i = 0; i < j; i += n){\r
-                           if(i != 0){\r
-                               n = 3;\r
-                           }\r
-                           parr[parr.length] = cnum.substr(i, n);\r
-                           m -= 1;\r
-                       }\r
-                       fnum = parr.join(comma);\r
-                       if(psplit[1]){\r
-                           fnum += dec + psplit[1];\r
-                       }\r
-                   }\r
-               \r
-                   return (neg ? '-' : '') + format.replace(/[\d,?\.?]+/, fnum);\r
-        },\r
-\r
-        /**\r
-         * Returns a number rendering function that can be reused to apply a number format multiple times efficiently\r
-         * @param {String} format Any valid number format string for {@link #number}\r
-         * @return {Function} The number formatting function\r
-         */\r
-        numberRenderer : function(format){\r
-            return function(v){\r
-                return Ext.util.Format.number(v, format);\r
-            };\r
-        },\r
-\r
-        /**\r
-         * Selectively do a plural form of a word based on a numeric value. For example, in a template,\r
-         * {commentCount:plural("Comment")}  would result in "1 Comment" if commentCount was 1 or would be "x Comments"\r
-         * if the value is 0 or greater than 1.\r
-         * @param {Number} value The value to compare against\r
-         * @param {String} singular The singular form of the word\r
-         * @param {String} plural (optional) The plural form of the word (defaults to the singular with an "s")\r
-         */\r
-        plural : function(v, s, p){\r
-            return v +' ' + (v == 1 ? s : (p ? p : s+'s'));\r
-        },\r
-        \r
-        /**\r
-         * Converts newline characters to the HTML tag &lt;br/>\r
-         * @param {String} The string value to format.\r
-         * @return {String} The string with embedded &lt;br/> tags in place of newlines.\r
-         */\r
-        nl2br : function(v){\r
-            return v === undefined || v === null ? '' : v.replace(/\n/g, '<br/>');\r
-        }\r
-    }\r
-}();/**
- * @class Ext.XTemplate
- * @extends Ext.Template
- * <p>A template class that supports advanced functionality like autofilling arrays, conditional processing with
- * basic comparison operators, sub-templates, basic math function support, special built-in template variables,
- * inline code execution and more.  XTemplate also provides the templating mechanism built into {@link Ext.DataView}.</p>
- * <p>XTemplate supports many special tags and built-in operators that aren't defined as part of the API, but are
- * supported in the templates that can be created.  The following examples demonstrate all of the supported features.
- * This is the data object used for reference in each code example:</p>
- * <pre><code>
-var data = {
-    name: 'Jack Slocum',
-    title: 'Lead Developer',
-    company: 'Ext JS, LLC',
-    email: 'jack@extjs.com',
-    address: '4 Red Bulls Drive',
-    city: 'Cleveland',
-    state: 'Ohio',
-    zip: '44102',
-    drinks: ['Red Bull', 'Coffee', 'Water'],
-    kids: [{
-        name: 'Sara Grace',
-        age:3
-    },{
-        name: 'Zachary',
-        age:2
-    },{
-        name: 'John James',
-        age:0
-    }]
-};
- * </code></pre>
- * <p><b>Auto filling of arrays</b><br/>The <tt>tpl</tt> tag and the <tt>for</tt> operator are used
- * to process the provided data object. If <tt>for="."</tt> is specified, the data object provided
- * is examined. If the variable in <tt>for</tt> is an array, it will auto-fill, repeating the template
- * block inside the <tt>tpl</tt> tag for each item in the array:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Kids: ',
-    '&lt;tpl for=".">',
-        '&lt;p>{name}&lt;/p>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data.kids); // pass the kids property of the data object
- * </code></pre>
- * <p><b>Scope switching</b><br/>The <tt>for</tt> property can be leveraged to access specified members
- * of the provided data object to populate the template:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Title: {title}&lt;/p>',
-    '&lt;p>Company: {company}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl <b>for="kids"</b>>', // interrogate the kids property within the data
-        '&lt;p>{name}&lt;/p>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
- * </code></pre>
- * <p><b>Access to parent object from within sub-template scope</b><br/>When processing a sub-template, for example while
- * looping through a child array, you can access the parent object's members via the <tt>parent</tt> object:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl for="kids">',
-        '&lt;tpl if="age &amp;gt; 1">',  // <-- Note that the &gt; is encoded
-            '&lt;p>{name}&lt;/p>',
-            '&lt;p>Dad: {parent.name}&lt;/p>',
-        '&lt;/tpl>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * <p><b>Array item index and basic math support</b> <br/>While processing an array, the special variable <tt>{#}</tt>
- * will provide the current array index + 1 (starts at 1, not 0). Templates also support the basic math operators
- * + - * and / that can be applied directly on numeric data values:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl for="kids">',
-        '&lt;tpl if="age &amp;gt; 1">',  // <-- Note that the &gt; is encoded
-            '&lt;p>{#}: {name}&lt;/p>',  // <-- Auto-number each item
-            '&lt;p>In 5 Years: {age+5}&lt;/p>',  // <-- Basic math
-            '&lt;p>Dad: {parent.name}&lt;/p>',
-        '&lt;/tpl>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * <p><b>Auto-rendering of flat arrays</b> <br/>Flat arrays that contain values (and not objects) can be auto-rendered
- * using the special <tt>{.}</tt> variable inside a loop.  This variable will represent the value of
- * the array at the current index:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>{name}\'s favorite beverages:&lt;/p>',
-    '&lt;tpl for="drinks">',
-       '&lt;div> - {.}&lt;/div>',
-    '&lt;/tpl>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * <p><b>Basic conditional logic</b> <br/>Using the <tt>tpl</tt> tag and the <tt>if</tt>
- * operator you can provide conditional checks for deciding whether or not to render specific parts of the template.
- * Note that there is no <tt>else</tt> operator &mdash; if needed, you should use two opposite <tt>if</tt> statements.
- * Properly-encoded attributes are required as seen in the following example:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl for="kids">',
-        '&lt;tpl if="age &amp;gt; 1">',  // <-- Note that the &gt; is encoded
-            '&lt;p>{name}&lt;/p>',
-        '&lt;/tpl>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * <p><b>Ability to execute arbitrary inline code</b> <br/>In an XTemplate, anything between {[ ... ]}  is considered
- * code to be executed in the scope of the template. There are some special variables available in that code:
- * <ul>
- * <li><b><tt>values</tt></b>: The values in the current scope. If you are using scope changing sub-templates, you
- * can change what <tt>values</tt> is.</li>
- * <li><b><tt>parent</tt></b>: The scope (values) of the ancestor template.</li>
- * <li><b><tt>xindex</tt></b>: If you are in a looping template, the index of the loop you are in (1-based).</li>
- * <li><b><tt>xcount</tt></b>: If you are in a looping template, the total length of the array you are looping.</li>
- * <li><b><tt>fm</tt></b>: An alias for <tt>Ext.util.Format</tt>.</li>
- * </ul>
- * This example demonstrates basic row striping using an inline code block and the <tt>xindex</tt> variable:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Company: {[values.company.toUpperCase() + ", " + values.title]}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl for="kids">',
-       '&lt;div class="{[xindex % 2 === 0 ? "even" : "odd"]}">',
-        '{name}',
-        '&lt;/div>',
-    '&lt;/tpl>&lt;/p>'
-);
-tpl.overwrite(panel.body, data);
-</code></pre>
- * <p><b>Template member functions</b> <br/>One or more member functions can be defined directly on the config
- * object passed into the XTemplate constructor for more complex processing:</p>
- * <pre><code>
-var tpl = new Ext.XTemplate(
-    '&lt;p>Name: {name}&lt;/p>',
-    '&lt;p>Kids: ',
-    '&lt;tpl for="kids">',
-        '&lt;tpl if="this.isGirl(name)">',
-            '&lt;p>Girl: {name} - {age}&lt;/p>',
-        '&lt;/tpl>',
-        '&lt;tpl if="this.isGirl(name) == false">',
-            '&lt;p>Boy: {name} - {age}&lt;/p>',
-        '&lt;/tpl>',
-        '&lt;tpl if="this.isBaby(age)">',
-            '&lt;p>{name} is a baby!&lt;/p>',
-        '&lt;/tpl>',
-    '&lt;/tpl>&lt;/p>', {
-     isGirl: function(name){
-         return name == 'Sara Grace';
-     },
-     isBaby: function(age){
-        return age < 1;
-     }
-});
-tpl.overwrite(panel.body, data);
-</code></pre>
- * @constructor
- * @param {String/Array/Object} parts The HTML fragment or an array of fragments to join(""), or multiple arguments
- * to join("") that can also include a config object
- */
-Ext.XTemplate = function(){
-    Ext.XTemplate.superclass.constructor.apply(this, arguments);
-
-    var me = this,
-       s = me.html,
-       re = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,
-       nameRe = /^<tpl\b[^>]*?for="(.*?)"/,
-       ifRe = /^<tpl\b[^>]*?if="(.*?)"/,
-       execRe = /^<tpl\b[^>]*?exec="(.*?)"/,
-       m,
-       id = 0,
-       tpls = [],
-       VALUES = 'values',
-       PARENT = 'parent',
-       XINDEX = 'xindex',
-       XCOUNT = 'xcount',
-       RETURN = 'return ',
-       WITHVALUES = 'with(values){ ';
-
-    s = ['<tpl>', s, '</tpl>'].join('');
-
-    while((m = s.match(re))){
-               var m2 = m[0].match(nameRe),
-                       m3 = m[0].match(ifRe),
-                       m4 = m[0].match(execRe),
-                       exp = null,
-                       fn = null,
-                       exec = null,
-                       name = m2 && m2[1] ? m2[1] : '';
-
-       if (m3) {
-           exp = m3 && m3[1] ? m3[1] : null;
-           if(exp){
-               fn = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES + RETURN +(Ext.util.Format.htmlDecode(exp))+'; }');
-           }
-       }
-       if (m4) {
-           exp = m4 && m4[1] ? m4[1] : null;
-           if(exp){
-               exec = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES +(Ext.util.Format.htmlDecode(exp))+'; }');
-           }
-       }
-       if(name){
-           switch(name){
-               case '.': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + VALUES + '; }'); break;
-               case '..': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + PARENT + '; }'); break;
-               default: name = new Function(VALUES, PARENT, WITHVALUES + RETURN + name + '; }');
-           }
-       }
-       tpls.push({
-            id: id,
-            target: name,
-            exec: exec,
-            test: fn,
-            body: m[1]||''
-        });
-       s = s.replace(m[0], '{xtpl'+ id + '}');
-       ++id;
-    }
-       Ext.each(tpls, function(t) {
-        me.compileTpl(t);
-    });
-    me.master = tpls[tpls.length-1];
-    me.tpls = tpls;
-};
-Ext.extend(Ext.XTemplate, Ext.Template, {
-    // private
-    re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
-    // private
-    codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g,
-
-    // private
-    applySubTemplate : function(id, values, parent, xindex, xcount){
-        var me = this,
-               len,
-               t = me.tpls[id],
-               vs,
-               buf = [];
-        if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) ||
-            (t.exec && t.exec.call(me, values, parent, xindex, xcount))) {
-            return '';
-        }
-        vs = t.target ? t.target.call(me, values, parent) : values;
-        len = vs.length;
-        parent = t.target ? values : parent;
-        if(t.target && Ext.isArray(vs)){
-               Ext.each(vs, function(v, i) {
-                buf[buf.length] = t.compiled.call(me, v, parent, i+1, len);
-            });
-            return buf.join('');
-        }
-        return t.compiled.call(me, vs, parent, xindex, xcount);
-    },
-
-    // private
-    compileTpl : function(tpl){
-        var fm = Ext.util.Format,
-                       useF = this.disableFormats !== true,
-            sep = Ext.isGecko ? "+" : ",",
-            body;
-
-        function fn(m, name, format, args, math){
-            if(name.substr(0, 4) == 'xtpl'){
-                return "'"+ sep +'this.applySubTemplate('+name.substr(4)+', values, parent, xindex, xcount)'+sep+"'";
-            }
-            var v;
-            if(name === '.'){
-                v = 'values';
-            }else if(name === '#'){
-                v = 'xindex';
-            }else if(name.indexOf('.') != -1){
-                v = name;
-            }else{
-                v = "values['" + name + "']";
-            }
-            if(math){
-                v = '(' + v + math + ')';
-            }
-            if (format && useF) {
-                args = args ? ',' + args : "";
-                if(format.substr(0, 5) != "this."){
-                    format = "fm." + format + '(';
-                }else{
-                    format = 'this.call("'+ format.substr(5) + '", ';
-                    args = ", values";
-                }
-            } else {
-                args= ''; format = "("+v+" === undefined ? '' : ";
-            }
-            return "'"+ sep + format + v + args + ")"+sep+"'";
-        }
-
-        function codeFn(m, code){
-            return "'"+ sep +'('+code+')'+sep+"'";
-        }
-
-        // branched to use + in gecko and [].join() in others
-        if(Ext.isGecko){
-            body = "tpl.compiled = function(values, parent, xindex, xcount){ return '" +
-                   tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn) +
-                    "';};";
-        }else{
-            body = ["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];
-            body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn));
-            body.push("'].join('');};");
-            body = body.join('');
-        }
-        eval(body);
-        return this;
-    },
-
-    /**
-     * Returns an HTML fragment of this template with the specified values applied.
-     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
-     * @return {String} The HTML fragment
-     */
-    applyTemplate : function(values){
-        return this.master.compiled.call(this, values, {}, 1, 1);
-    },
-
-    /**
-     * Compile the template to a function for optimized performance.  Recommended if the template will be used frequently.
-     * @return {Function} The compiled function
-     */
-    compile : function(){return this;}
-
-    /**
-     * @property re
-     * @hide
-     */
-    /**
-     * @property disableFormats
-     * @hide
-     */
-    /**
-     * @method set
-     * @hide
-     */
-
-});
-/**
- * Alias for {@link #applyTemplate}
- * Returns an HTML fragment of this template with the specified values applied.
- * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
- * @return {String} The HTML fragment
- * @member Ext.XTemplate
- * @method apply
- */
-Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate;
-
-/**
- * Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.
- * @param {String/HTMLElement} el A DOM element or its id
- * @return {Ext.Template} The created template
- * @static
- */
-Ext.XTemplate.from = function(el){
-    el = Ext.getDom(el);
-    return new Ext.XTemplate(el.value || el.innerHTML);
-};/**\r
- * @class Ext.util.CSS\r
- * Utility class for manipulating CSS rules\r
- * @singleton\r
- */\r
-Ext.util.CSS = function(){\r
-       var rules = null;\r
-       var doc = document;\r
-\r
-    var camelRe = /(-[a-z])/gi;\r
-    var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); };\r
-\r
-   return {\r
-   /**\r
-    * Creates a stylesheet from a text blob of rules.\r
-    * These rules will be wrapped in a STYLE tag and appended to the HEAD of the document.\r
-    * @param {String} cssText The text containing the css rules\r
-    * @param {String} id An id to add to the stylesheet for later removal\r
-    * @return {StyleSheet}\r
-    */\r
-   createStyleSheet : function(cssText, id){\r
-       var ss;\r
-       var head = doc.getElementsByTagName("head")[0];\r
-       var rules = doc.createElement("style");\r
-       rules.setAttribute("type", "text/css");\r
-       if(id){\r
-           rules.setAttribute("id", id);\r
-       }\r
-       if(Ext.isIE){\r
-           head.appendChild(rules);\r
-           ss = rules.styleSheet;\r
-           ss.cssText = cssText;\r
-       }else{\r
-           try{\r
-                rules.appendChild(doc.createTextNode(cssText));\r
-           }catch(e){\r
-               rules.cssText = cssText;\r
-           }\r
-           head.appendChild(rules);\r
-           ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]);\r
-       }\r
-       this.cacheStyleSheet(ss);\r
-       return ss;\r
-   },\r
-\r
-   /**\r
-    * Removes a style or link tag by id\r
-    * @param {String} id The id of the tag\r
-    */\r
-   removeStyleSheet : function(id){\r
-       var existing = doc.getElementById(id);\r
-       if(existing){\r
-           existing.parentNode.removeChild(existing);\r
-       }\r
-   },\r
-\r
-   /**\r
-    * Dynamically swaps an existing stylesheet reference for a new one\r
-    * @param {String} id The id of an existing link tag to remove\r
-    * @param {String} url The href of the new stylesheet to include\r
-    */\r
-   swapStyleSheet : function(id, url){\r
-       this.removeStyleSheet(id);\r
-       var ss = doc.createElement("link");\r
-       ss.setAttribute("rel", "stylesheet");\r
-       ss.setAttribute("type", "text/css");\r
-       ss.setAttribute("id", id);\r
-       ss.setAttribute("href", url);\r
-       doc.getElementsByTagName("head")[0].appendChild(ss);\r
-   },\r
-   \r
-   /**\r
-    * Refresh the rule cache if you have dynamically added stylesheets\r
-    * @return {Object} An object (hash) of rules indexed by selector\r
-    */\r
-   refreshCache : function(){\r
-       return this.getRules(true);\r
-   },\r
-\r
-   // private\r
-   cacheStyleSheet : function(ss){\r
-       if(!rules){\r
-           rules = {};\r
-       }\r
-       try{// try catch for cross domain access issue\r
-           var ssRules = ss.cssRules || ss.rules;\r
-           for(var j = ssRules.length-1; j >= 0; --j){\r
-               rules[ssRules[j].selectorText] = ssRules[j];\r
-           }\r
-       }catch(e){}\r
-   },\r
-   \r
-   /**\r
-    * Gets all css rules for the document\r
-    * @param {Boolean} refreshCache true to refresh the internal cache\r
-    * @return {Object} An object (hash) of rules indexed by selector\r
-    */\r
-   getRules : function(refreshCache){\r
-               if(rules === null || refreshCache){\r
-                       rules = {};\r
-                       var ds = doc.styleSheets;\r
-                       for(var i =0, len = ds.length; i < len; i++){\r
-                           try{\r
-                       this.cacheStyleSheet(ds[i]);\r
-                   }catch(e){} \r
-               }\r
-               }\r
-               return rules;\r
-       },\r
-       \r
-       /**\r
-    * Gets an an individual CSS rule by selector(s)\r
-    * @param {String/Array} selector The CSS selector or an array of selectors to try. The first selector that is found is returned.\r
-    * @param {Boolean} refreshCache true to refresh the internal cache if you have recently updated any rules or added styles dynamically\r
-    * @return {CSSRule} The CSS rule or null if one is not found\r
-    */\r
-   getRule : function(selector, refreshCache){\r
-               var rs = this.getRules(refreshCache);\r
-               if(!Ext.isArray(selector)){\r
-                   return rs[selector];\r
-               }\r
-               for(var i = 0; i < selector.length; i++){\r
-                       if(rs[selector[i]]){\r
-                               return rs[selector[i]];\r
-                       }\r
-               }\r
-               return null;\r
-       },\r
-       \r
-       \r
-       /**\r
-    * Updates a rule property\r
-    * @param {String/Array} selector If it's an array it tries each selector until it finds one. Stops immediately once one is found.\r
-    * @param {String} property The css property\r
-    * @param {String} value The new value for the property\r
-    * @return {Boolean} true If a rule was found and updated\r
-    */\r
-   updateRule : function(selector, property, value){\r
-               if(!Ext.isArray(selector)){\r
-                       var rule = this.getRule(selector);\r
-                       if(rule){\r
-                               rule.style[property.replace(camelRe, camelFn)] = value;\r
-                               return true;\r
-                       }\r
-               }else{\r
-                       for(var i = 0; i < selector.length; i++){\r
-                               if(this.updateRule(selector[i], property, value)){\r
-                                       return true;\r
-                               }\r
-                       }\r
-               }\r
-               return false;\r
-       }\r
-   };  \r
-}();/**
- @class Ext.util.ClickRepeater
- @extends Ext.util.Observable
-
- A wrapper class which can be applied to any element. Fires a "click" event while the
- mouse is pressed. The interval between firings may be specified in the config but
- defaults to 20 milliseconds.
-
- Optionally, a CSS class may be applied to the element during the time it is pressed.
-
- @cfg {Mixed} el The element to act as a button.
- @cfg {Number} delay The initial delay before the repeating event begins firing.
- Similar to an autorepeat key delay.
- @cfg {Number} interval The interval between firings of the "click" event. Default 20 ms.
- @cfg {String} pressClass A CSS class name to be applied to the element while pressed.
- @cfg {Boolean} accelerate True if autorepeating should start slowly and accelerate.
-           "interval" and "delay" are ignored.
- @cfg {Boolean} preventDefault True to prevent the default click event
- @cfg {Boolean} stopDefault True to stop the default click event
-
- @history
-    2007-02-02 jvs Original code contributed by Nige "Animal" White
-    2007-02-02 jvs Renamed to ClickRepeater
-    2007-02-03 jvs Modifications for FF Mac and Safari
-
- @constructor
- @param {Mixed} el The element to listen on
- @param {Object} config
- */
-Ext.util.ClickRepeater = function(el, config)
-{
-    this.el = Ext.get(el);
-    this.el.unselectable();
-
-    Ext.apply(this, config);
-
-    this.addEvents(
-    /**
-     * @event mousedown
-     * Fires when the mouse button is depressed.
-     * @param {Ext.util.ClickRepeater} this
-     */
-        "mousedown",
-    /**
-     * @event click
-     * Fires on a specified interval during the time the element is pressed.
-     * @param {Ext.util.ClickRepeater} this
-     */
-        "click",
-    /**
-     * @event mouseup
-     * Fires when the mouse key is released.
-     * @param {Ext.util.ClickRepeater} this
-     */
-        "mouseup"
-    );
-
-    if(!this.disabled){
-        this.disabled = true;
-        this.enable();
-    }
-
-    // allow inline handler
-    if(this.handler){
-        this.on("click", this.handler,  this.scope || this);
-    }
-
-    Ext.util.ClickRepeater.superclass.constructor.call(this);
-};
-
-Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, {
-    interval : 20,
-    delay: 250,
-    preventDefault : true,
-    stopDefault : false,
-    timer : 0,
-
-    /**
-     * Enables the repeater and allows events to fire.
-     */
-    enable: function(){
-        if(this.disabled){
-            this.el.on('mousedown', this.handleMouseDown, this);
-            if(this.preventDefault || this.stopDefault){
-                this.el.on('click', this.eventOptions, this);
-            }
-        }
-        this.disabled = false;
-    },
-    
-    /**
-     * Disables the repeater and stops events from firing.
-     */
-    disable: function(/* private */ force){
-        if(force || !this.disabled){
-            clearTimeout(this.timer);
-            if(this.pressClass){
-                this.el.removeClass(this.pressClass);
-            }
-            Ext.getDoc().un('mouseup', this.handleMouseUp, this);
-            this.el.removeAllListeners();
-        }
-        this.disabled = true;
-    },
-    
-    /**
-     * Convenience function for setting disabled/enabled by boolean.
-     * @param {Boolean} disabled
-     */
-    setDisabled: function(disabled){
-        this[disabled ? 'disable' : 'enable']();    
-    },
-    
-    eventOptions: function(e){
-        if(this.preventDefault){
-            e.preventDefault();
-        }
-        if(this.stopDefault){
-            e.stopEvent();
-        }       
-    },
-    
-    // private
-    destroy : function() {
-        this.disable(true);
-        Ext.destroy(this.el);
-        this.purgeListeners();
-    },
-    
-    // private
-    handleMouseDown : function(){
-        clearTimeout(this.timer);
-        this.el.blur();
-        if(this.pressClass){
-            this.el.addClass(this.pressClass);
-        }
-        this.mousedownTime = new Date();
-
-        Ext.getDoc().on("mouseup", this.handleMouseUp, this);
-        this.el.on("mouseout", this.handleMouseOut, this);
-
-        this.fireEvent("mousedown", this);
-        this.fireEvent("click", this);
-
-//      Do not honor delay or interval if acceleration wanted.
-        if (this.accelerate) {
-            this.delay = 400;
-           }
-        this.timer = this.click.defer(this.delay || this.interval, this);
-    },
-
-    // private
-    click : function(){
-        this.fireEvent("click", this);
-        this.timer = this.click.defer(this.accelerate ?
-            this.easeOutExpo(this.mousedownTime.getElapsed(),
-                400,
-                -390,
-                12000) :
-            this.interval, this);
-    },
-
-    easeOutExpo : function (t, b, c, d) {
-        return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
-    },
-
-    // private
-    handleMouseOut : function(){
-        clearTimeout(this.timer);
-        if(this.pressClass){
-            this.el.removeClass(this.pressClass);
-        }
-        this.el.on("mouseover", this.handleMouseReturn, this);
-    },
-
-    // private
-    handleMouseReturn : function(){
-        this.el.un("mouseover", this.handleMouseReturn, this);
-        if(this.pressClass){
-            this.el.addClass(this.pressClass);
-        }
-        this.click();
-    },
-
-    // private
-    handleMouseUp : function(){
-        clearTimeout(this.timer);
-        this.el.un("mouseover", this.handleMouseReturn, this);
-        this.el.un("mouseout", this.handleMouseOut, this);
-        Ext.getDoc().un("mouseup", this.handleMouseUp, this);
-        this.el.removeClass(this.pressClass);
-        this.fireEvent("mouseup", this);
-    }
-});/**
- * @class Ext.KeyNav
- * <p>Provides a convenient wrapper for normalized keyboard navigation.  KeyNav allows you to bind
- * navigation keys to function calls that will get called when the keys are pressed, providing an easy
- * way to implement custom navigation schemes for any UI component.</p>
- * <p>The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc,
- * pageUp, pageDown, del, home, end.  Usage:</p>
- <pre><code>
-var nav = new Ext.KeyNav("my-element", {
-    "left" : function(e){
-        this.moveLeft(e.ctrlKey);
-    },
-    "right" : function(e){
-        this.moveRight(e.ctrlKey);
-    },
-    "enter" : function(e){
-        this.save();
-    },
-    scope : this
-});
-</code></pre>
- * @constructor
- * @param {Mixed} el The element to bind to
- * @param {Object} config The config
- */
-Ext.KeyNav = function(el, config){
-    this.el = Ext.get(el);
-    Ext.apply(this, config);
-    if(!this.disabled){
-        this.disabled = true;
-        this.enable();
-    }
-};
-
-Ext.KeyNav.prototype = {
-    /**
-     * @cfg {Boolean} disabled
-     * True to disable this KeyNav instance (defaults to false)
-     */
-    disabled : false,
-    /**
-     * @cfg {String} defaultEventAction
-     * The method to call on the {@link Ext.EventObject} after this KeyNav intercepts a key.  Valid values are
-     * {@link Ext.EventObject#stopEvent}, {@link Ext.EventObject#preventDefault} and
-     * {@link Ext.EventObject#stopPropagation} (defaults to 'stopEvent')
-     */
-    defaultEventAction: "stopEvent",
-    /**
-     * @cfg {Boolean} forceKeyDown
-     * Handle the keydown event instead of keypress (defaults to false).  KeyNav automatically does this for IE since
-     * IE does not propagate special keys on keypress, but setting this to true will force other browsers to also
-     * handle keydown instead of keypress.
-     */
-    forceKeyDown : false,
-
-    // private
-    prepareEvent : function(e){
-        var k = e.getKey();
-        var h = this.keyToHandler[k];
-        if(Ext.isSafari2 && h && k >= 37 && k <= 40){
-            e.stopEvent();
-        }
-    },
-
-    // private
-    relay : function(e){
-        var k = e.getKey();
-        var h = this.keyToHandler[k];
-        if(h && this[h]){
-            if(this.doRelay(e, this[h], h) !== true){
-                e[this.defaultEventAction]();
-            }
-        }
-    },
-
-    // private
-    doRelay : function(e, h, hname){
-        return h.call(this.scope || this, e);
-    },
-
-    // possible handlers
-    enter : false,
-    left : false,
-    right : false,
-    up : false,
-    down : false,
-    tab : false,
-    esc : false,
-    pageUp : false,
-    pageDown : false,
-    del : false,
-    home : false,
-    end : false,
-
-    // quick lookup hash
-    keyToHandler : {
-        37 : "left",
-        39 : "right",
-        38 : "up",
-        40 : "down",
-        33 : "pageUp",
-        34 : "pageDown",
-        46 : "del",
-        36 : "home",
-        35 : "end",
-        13 : "enter",
-        27 : "esc",
-        9  : "tab"
-    },
-
-       /**
-        * Enable this KeyNav
-        */
-       enable: function(){
-               if(this.disabled){
-            // ie won't do special keys on keypress, no one else will repeat keys with keydown
-            // the EventObject will normalize Safari automatically
-            if(this.isKeydown()){
-                this.el.on("keydown", this.relay,  this);
-            }else{
-                this.el.on("keydown", this.prepareEvent,  this);
-                this.el.on("keypress", this.relay,  this);
-            }
-                   this.disabled = false;
-               }
-       },
-
-       /**
-        * Disable this KeyNav
-        */
-       disable: function(){
-               if(!this.disabled){
-                   if(this.isKeydown()){
-                this.el.un("keydown", this.relay, this);
-            }else{
-                this.el.un("keydown", this.prepareEvent, this);
-                this.el.un("keypress", this.relay, this);
-            }
-                   this.disabled = true;
-               }
-       },
-    
-    /**
-     * Convenience function for setting disabled/enabled by boolean.
-     * @param {Boolean} disabled
-     */
-    setDisabled : function(disabled){
-        this[disabled ? "disable" : "enable"]();
-    },
-    
-    // private
-    isKeydown: function(){
-        return this.forceKeyDown || Ext.EventManager.useKeydown;
-    }
-};
-/**\r
- * @class Ext.KeyMap\r
- * Handles mapping keys to actions for an element. One key map can be used for multiple actions.\r
- * The constructor accepts the same config object as defined by {@link #addBinding}.\r
- * If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key\r
- * combination it will call the function with this signature (if the match is a multi-key\r
- * combination the callback will still be called only once): (String key, Ext.EventObject e)\r
- * A KeyMap can also handle a string representation of keys.<br />\r
- * Usage:\r
- <pre><code>\r
-// map one key by key code\r
-var map = new Ext.KeyMap("my-element", {\r
-    key: 13, // or Ext.EventObject.ENTER\r
-    fn: myHandler,\r
-    scope: myObject\r
-});\r
-\r
-// map multiple keys to one action by string\r
-var map = new Ext.KeyMap("my-element", {\r
-    key: "a\r\n\t",\r
-    fn: myHandler,\r
-    scope: myObject\r
-});\r
-\r
-// map multiple keys to multiple actions by strings and array of codes\r
-var map = new Ext.KeyMap("my-element", [\r
-    {\r
-        key: [10,13],\r
-        fn: function(){ alert("Return was pressed"); }\r
-    }, {\r
-        key: "abc",\r
-        fn: function(){ alert('a, b or c was pressed'); }\r
-    }, {\r
-        key: "\t",\r
-        ctrl:true,\r
-        shift:true,\r
-        fn: function(){ alert('Control + shift + tab was pressed.'); }\r
-    }\r
-]);\r
-</code></pre>\r
- * <b>Note: A KeyMap starts enabled</b>\r
- * @constructor\r
- * @param {Mixed} el The element to bind to\r
- * @param {Object} config The config (see {@link #addBinding})\r
- * @param {String} eventName (optional) The event to bind to (defaults to "keydown")\r
- */\r
-Ext.KeyMap = function(el, config, eventName){\r
-    this.el  = Ext.get(el);\r
-    this.eventName = eventName || "keydown";\r
-    this.bindings = [];\r
-    if(config){\r
-        this.addBinding(config);\r
-    }\r
-    this.enable();\r
-};\r
-\r
-Ext.KeyMap.prototype = {\r
-    /**\r
-     * True to stop the event from bubbling and prevent the default browser action if the\r
-     * key was handled by the KeyMap (defaults to false)\r
-     * @type Boolean\r
-     */\r
-    stopEvent : false,\r
-\r
-    /**\r
-     * Add a new binding to this KeyMap. The following config object properties are supported:\r
-     * <pre>\r
-Property    Type             Description\r
-----------  ---------------  ----------------------------------------------------------------------\r
-key         String/Array     A single keycode or an array of keycodes to handle\r
-shift       Boolean          True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)\r
-ctrl        Boolean          True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)\r
-alt         Boolean          True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)\r
-handler     Function         The function to call when KeyMap finds the expected key combination\r
-fn          Function         Alias of handler (for backwards-compatibility)\r
-scope       Object           The scope of the callback function\r
-stopEvent   Boolean          True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false)\r
-</pre>\r
-     *\r
-     * Usage:\r
-     * <pre><code>\r
-// Create a KeyMap\r
-var map = new Ext.KeyMap(document, {\r
-    key: Ext.EventObject.ENTER,\r
-    fn: handleKey,\r
-    scope: this\r
-});\r
-\r
-//Add a new binding to the existing KeyMap later\r
-map.addBinding({\r
-    key: 'abc',\r
-    shift: true,\r
-    fn: handleKey,\r
-    scope: this\r
-});\r
-</code></pre>\r
-     * @param {Object/Array} config A single KeyMap config or an array of configs\r
-     */\r
-       addBinding : function(config){\r
-        if(Ext.isArray(config)){\r
-            Ext.each(config, function(c){\r
-                this.addBinding(c);\r
-            }, this);\r
-            return;\r
-        }\r
-        var keyCode = config.key,\r
-            fn = config.fn || config.handler,\r
-            scope = config.scope;\r
-\r
-       if (config.stopEvent) {\r
-           this.stopEvent = config.stopEvent;    \r
-       }       \r
-\r
-        if(typeof keyCode == "string"){\r
-            var ks = [];\r
-            var keyString = keyCode.toUpperCase();\r
-            for(var j = 0, len = keyString.length; j < len; j++){\r
-                ks.push(keyString.charCodeAt(j));\r
-            }\r
-            keyCode = ks;\r
-        }\r
-        var keyArray = Ext.isArray(keyCode);\r
-        \r
-        var handler = function(e){\r
-            if(this.checkModifiers(config, e)){\r
-                var k = e.getKey();\r
-                if(keyArray){\r
-                    for(var i = 0, len = keyCode.length; i < len; i++){\r
-                        if(keyCode[i] == k){\r
-                          if(this.stopEvent){\r
-                              e.stopEvent();\r
-                          }\r
-                          fn.call(scope || window, k, e);\r
-                          return;\r
-                        }\r
-                    }\r
-                }else{\r
-                    if(k == keyCode){\r
-                        if(this.stopEvent){\r
-                           e.stopEvent();\r
-                        }\r
-                        fn.call(scope || window, k, e);\r
-                    }\r
-                }\r
-            }\r
-        };\r
-        this.bindings.push(handler);\r
-       },\r
-    \r
-    // private\r
-    checkModifiers: function(config, e){\r
-        var val, key, keys = ['shift', 'ctrl', 'alt'];\r
-        for (var i = 0, len = keys.length; i < len; ++i){\r
-            key = keys[i];\r
-            val = config[key];\r
-            if(!(val === undefined || (val === e[key + 'Key']))){\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    },\r
-\r
-    /**\r
-     * Shorthand for adding a single key listener\r
-     * @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the\r
-     * following options:\r
-     * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function\r
-     */\r
-    on : function(key, fn, scope){\r
-        var keyCode, shift, ctrl, alt;\r
-        if(typeof key == "object" && !Ext.isArray(key)){\r
-            keyCode = key.key;\r
-            shift = key.shift;\r
-            ctrl = key.ctrl;\r
-            alt = key.alt;\r
-        }else{\r
-            keyCode = key;\r
-        }\r
-        this.addBinding({\r
-            key: keyCode,\r
-            shift: shift,\r
-            ctrl: ctrl,\r
-            alt: alt,\r
-            fn: fn,\r
-            scope: scope\r
-        });\r
-    },\r
-\r
-    // private\r
-    handleKeyDown : function(e){\r
-           if(this.enabled){ //just in case\r
-           var b = this.bindings;\r
-           for(var i = 0, len = b.length; i < len; i++){\r
-               b[i].call(this, e);\r
-           }\r
-           }\r
-       },\r
-\r
-       /**\r
-        * Returns true if this KeyMap is enabled\r
-        * @return {Boolean}\r
-        */\r
-       isEnabled : function(){\r
-           return this.enabled;\r
-       },\r
-\r
-       /**\r
-        * Enables this KeyMap\r
-        */\r
-       enable: function(){\r
-               if(!this.enabled){\r
-                   this.el.on(this.eventName, this.handleKeyDown, this);\r
-                   this.enabled = true;\r
-               }\r
-       },\r
-\r
-       /**\r
-        * Disable this KeyMap\r
-        */\r
-       disable: function(){\r
-               if(this.enabled){\r
-                   this.el.removeListener(this.eventName, this.handleKeyDown, this);\r
-                   this.enabled = false;\r
-               }\r
-       },\r
-    \r
-    /**\r
-     * Convenience function for setting disabled/enabled by boolean.\r
-     * @param {Boolean} disabled\r
-     */\r
-    setDisabled : function(disabled){\r
-        this[disabled ? "disable" : "enable"]();\r
-    }\r
-};/**
- * @class Ext.util.TextMetrics
- * Provides precise pixel measurements for blocks of text so that you can determine exactly how high and
- * wide, in pixels, a given block of text will be. Note that when measuring text, it should be plain text and
- * should not contain any HTML, otherwise it may not be measured correctly.
- * @singleton
- */
-Ext.util.TextMetrics = function(){
-    var shared;
-    return {
-        /**
-         * Measures the size of the specified text
-         * @param {String/HTMLElement} el The element, dom node or id from which to copy existing CSS styles
-         * that can affect the size of the rendered text
-         * @param {String} text The text to measure
-         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
-         * in order to accurately measure the text height
-         * @return {Object} An object containing the text's size {width: (width), height: (height)}
-         */
-        measure : function(el, text, fixedWidth){
-            if(!shared){
-                shared = Ext.util.TextMetrics.Instance(el, fixedWidth);
-            }
-            shared.bind(el);
-            shared.setFixedWidth(fixedWidth || 'auto');
-            return shared.getSize(text);
-        },
-
-        /**
-         * Return a unique TextMetrics instance that can be bound directly to an element and reused.  This reduces
-         * the overhead of multiple calls to initialize the style properties on each measurement.
-         * @param {String/HTMLElement} el The element, dom node or id that the instance will be bound to
-         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
-         * in order to accurately measure the text height
-         * @return {Ext.util.TextMetrics.Instance} instance The new instance
-         */
-        createInstance : function(el, fixedWidth){
-            return Ext.util.TextMetrics.Instance(el, fixedWidth);
-        }
-    };
-}();
-
-Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){
-    var ml = new Ext.Element(document.createElement('div'));
-    document.body.appendChild(ml.dom);
-    ml.position('absolute');
-    ml.setLeftTop(-1000, -1000);
-    ml.hide();
-
-    if(fixedWidth){
-        ml.setWidth(fixedWidth);
-    }
-
-    var instance = {
-        /**
-         * Returns the size of the specified text based on the internal element's style and width properties
-         * @param {String} text The text to measure
-         * @return {Object} An object containing the text's size {width: (width), height: (height)}
-         */
-        getSize : function(text){
-            ml.update(text);
-            var s = ml.getSize();
-            ml.update('');
-            return s;
-        },
-
-        /**
-         * Binds this TextMetrics instance to an element from which to copy existing CSS styles
-         * that can affect the size of the rendered text
-         * @param {String/HTMLElement} el The element, dom node or id
-         */
-        bind : function(el){
-            ml.setStyle(
-                Ext.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing')
-            );
-        },
-
-        /**
-         * Sets a fixed width on the internal measurement element.  If the text will be multiline, you have
-         * to set a fixed width in order to accurately measure the text height.
-         * @param {Number} width The width to set on the element
-         */
-        setFixedWidth : function(width){
-            ml.setWidth(width);
-        },
-
-        /**
-         * Returns the measured width of the specified text
-         * @param {String} text The text to measure
-         * @return {Number} width The width in pixels
-         */
-        getWidth : function(text){
-            ml.dom.style.width = 'auto';
-            return this.getSize(text).width;
-        },
-
-        /**
-         * Returns the measured height of the specified text.  For multiline text, be sure to call
-         * {@link #setFixedWidth} if necessary.
-         * @param {String} text The text to measure
-         * @return {Number} height The height in pixels
-         */
-        getHeight : function(text){
-            return this.getSize(text).height;
-        }
-    };
-
-    instance.bind(bindTo);
-
-    return instance;
-};
-
-Ext.Element.addMethods({
-    /**
-     * Returns the width in pixels of the passed text, or the width of the text in this Element.
-     * @param {String} text The text to measure. Defaults to the innerHTML of the element.
-     * @param {Number} min (Optional) The minumum value to return.
-     * @param {Number} max (Optional) The maximum value to return.
-     * @return {Number} The text width in pixels.
-     * @member Ext.Element getTextWidth
-     */
-    getTextWidth : function(text, min, max){
-        return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text, this.dom.innerHTML, true)).width).constrain(min || 0, max || 1000000);
-    }
-});
-/**\r
- * @class Ext.util.Cookies\r
- * Utility class for managing and interacting with cookies.\r
- * @singleton\r
- */\r
-Ext.util.Cookies = {\r
-    /**\r
-     * Create a cookie with the specified name and value. Additional settings\r
-     * for the cookie may be optionally specified (for example: expiration,\r
-     * access restriction, SSL).\r
-     * @param {Object} name\r
-     * @param {Object} value\r
-     * @param {Object} expires (Optional) Specify an expiration date the\r
-     * cookie is to persist until.  Note that the specified Date object will\r
-     * be converted to Greenwich Mean Time (GMT). \r
-     * @param {String} path (Optional) Setting a path on the cookie restricts\r
-     * access to pages that match that path. Defaults to all pages (<tt>'/'</tt>). \r
-     * @param {String} domain (Optional) Setting a domain restricts access to\r
-     * pages on a given domain (typically used to allow cookie access across\r
-     * subdomains). For example, "extjs.com" will create a cookie that can be\r
-     * accessed from any subdomain of extjs.com, including www.extjs.com,\r
-     * support.extjs.com, etc.\r
-     * @param {Boolean} secure (Optional) Specify true to indicate that the cookie\r
-     * should only be accessible via SSL on a page using the HTTPS protocol.\r
-     * Defaults to <tt>false</tt>. Note that this will only work if the page\r
-     * calling this code uses the HTTPS protocol, otherwise the cookie will be\r
-     * created with default options.\r
-     */\r
-    set : function(name, value){\r
-        var argv = arguments;\r
-        var argc = arguments.length;\r
-        var expires = (argc > 2) ? argv[2] : null;\r
-        var path = (argc > 3) ? argv[3] : '/';\r
-        var domain = (argc > 4) ? argv[4] : null;\r
-        var secure = (argc > 5) ? argv[5] : false;\r
-        document.cookie = name + "=" + escape(value) + ((expires === null) ? "" : ("; expires=" + expires.toGMTString())) + ((path === null) ? "" : ("; path=" + path)) + ((domain === null) ? "" : ("; domain=" + domain)) + ((secure === true) ? "; secure" : "");\r
-    },\r
-\r
-    /**\r
-     * Retrieves cookies that are accessible by the current page. If a cookie\r
-     * does not exist, <code>get()</code> returns <tt>null</tt>.  The following\r
-     * example retrieves the cookie called "valid" and stores the String value\r
-     * in the variable <tt>validStatus</tt>.\r
-     * <pre><code>\r
-     * var validStatus = Ext.util.Cookies.get("valid");\r
-     * </code></pre>\r
-     * @param {Object} name The name of the cookie to get\r
-     * @return {Mixed} Returns the cookie value for the specified name;\r
-     * null if the cookie name does not exist.\r
-     */\r
-    get : function(name){\r
-        var arg = name + "=";\r
-        var alen = arg.length;\r
-        var clen = document.cookie.length;\r
-        var i = 0;\r
-        var j = 0;\r
-        while(i < clen){\r
-            j = i + alen;\r
-            if(document.cookie.substring(i, j) == arg){\r
-                return Ext.util.Cookies.getCookieVal(j);\r
-            }\r
-            i = document.cookie.indexOf(" ", i) + 1;\r
-            if(i === 0){\r
-                break;\r
-            }\r
-        }\r
-        return null;\r
-    },\r
-\r
-    /**\r
-     * Removes a cookie with the provided name from the browser\r
-     * if found.\r
-     * @param {Object} name The name of the cookie to remove\r
-     */\r
-    clear : function(name){\r
-        if(Ext.util.Cookies.get(name)){\r
-            document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";\r
-        }\r
-    },\r
-    /**\r
-     * @private\r
-     */\r
-    getCookieVal : function(offset){\r
-        var endstr = document.cookie.indexOf(";", offset);\r
-        if(endstr == -1){\r
-            endstr = document.cookie.length;\r
-        }\r
-        return unescape(document.cookie.substring(offset, endstr));\r
-    }\r
-};/**
- * Framework-wide error-handler.  Developers can override this method to provide
- * custom exception-handling.  Framework errors will often extend from the base
- * Ext.Error class.
- * @param {Object/Error} e The thrown exception object.
- */
-Ext.handleError = function(e) {
-    throw e;
-};
-
-/**
- * @class Ext.Error
- * @extends Error
- * <p>A base error class. Future implementations are intended to provide more
- * robust error handling throughout the framework (<b>in the debug build only</b>)
- * to check for common errors and problems. The messages issued by this class
- * will aid error checking. Error checks will be automatically removed in the
- * production build so that performance is not negatively impacted.</p>
- * <p>Some sample messages currently implemented:</p><pre>
-"DataProxy attempted to execute an API-action but found an undefined
-url / function. Please review your Proxy url/api-configuration."
- * </pre><pre>
-"Could not locate your "root" property in your server response.
-Please review your JsonReader config to ensure the config-property
-"root" matches the property your server-response.  See the JsonReader
-docs for additional assistance."
- * </pre>
- * <p>An example of the code used for generating error messages:</p><pre><code>
-try {
-    generateError({
-        foo: 'bar'
-    });
-}
-catch (e) {
-    console.error(e);
-}
-function generateError(data) {
-    throw new Ext.Error('foo-error', data);
-}
- * </code></pre>
- * @param {String} message
- */
-Ext.Error = function(message) {
-    // Try to read the message from Ext.Error.lang
-    this.message = (this.lang[message]) ? this.lang[message] : message;
-}
-Ext.Error.prototype = new Error();
-Ext.apply(Ext.Error.prototype, {
-    // protected.  Extensions place their error-strings here.
-    lang: {},
-
-    name: 'Ext.Error',
-    /**
-     * getName
-     * @return {String}
-     */
-    getName : function() {
-        return this.name;
-    },
-    /**
-     * getMessage
-     * @return {String}
-     */
-    getMessage : function() {
-        return this.message;
-    },
-    /**
-     * toJson
-     * @return {String}
-     */
-    toJson : function() {
-        return Ext.encode(this);
-    }
-});
-
-/**
- * @class Ext.ComponentMgr
- * <p>Provides a registry of all Components (instances of {@link Ext.Component} or any subclass
- * thereof) on a page so that they can be easily accessed by {@link Ext.Component component}
- * {@link Ext.Component#id id} (see {@link #get}, or the convenience method {@link Ext#getCmp Ext.getCmp}).</p>
- * <p>This object also provides a registry of available Component <i>classes</i>
- * indexed by a mnemonic code known as the Component's {@link Ext.Component#xtype xtype}.
- * The <tt>{@link Ext.Component#xtype xtype}</tt> provides a way to avoid instantiating child Components
- * when creating a full, nested config object for a complete Ext page.</p>
- * <p>A child Component may be specified simply as a <i>config object</i>
- * as long as the correct <tt>{@link Ext.Component#xtype xtype}</tt> is specified so that if and when the Component
- * needs rendering, the correct type can be looked up for lazy instantiation.</p>
- * <p>For a list of all available <tt>{@link Ext.Component#xtype xtypes}</tt>, see {@link Ext.Component}.</p>
- * @singleton
- */
-Ext.ComponentMgr = function(){
-    var all = new Ext.util.MixedCollection();
-    var types = {};
-    var ptypes = {};
-
-    return {
-        /**
-         * Registers a component.
-         * @param {Ext.Component} c The component
-         */
-        register : function(c){
-            all.add(c);
-        },
-
-        /**
-         * Unregisters a component.
-         * @param {Ext.Component} c The component
-         */
-        unregister : function(c){
-            all.remove(c);
-        },
-
-        /**
-         * Returns a component by {@link Ext.Component#id id}.
-         * For additional details see {@link Ext.util.MixedCollection#get}.
-         * @param {String} id The component {@link Ext.Component#id id}
-         * @return Ext.Component The Component, <tt>undefined</tt> if not found, or <tt>null</tt> if a
-         * Class was found.
-         */
-        get : function(id){
-            return all.get(id);
-        },
-
-        /**
-         * Registers a function that will be called when a specified component is added to ComponentMgr
-         * @param {String} id The component {@link Ext.Component#id id}
-         * @param {Function} fn The callback function
-         * @param {Object} scope The scope of the callback
-         */
-        onAvailable : function(id, fn, scope){
-            all.on("add", function(index, o){
-                if(o.id == id){
-                    fn.call(scope || o, o);
-                    all.un("add", fn, scope);
-                }
-            });
-        },
-
-        /**
-         * The MixedCollection used internally for the component cache. An example usage may be subscribing to
-         * events on the MixedCollection to monitor addition or removal.  Read-only.
-         * @type {MixedCollection}
-         */
-        all : all,
-        
-        /**
-         * Checks if a Component type is registered.
-         * @param {Ext.Component} xtype The mnemonic string by which the Component class may be looked up
-         * @return {Boolean} Whether the type is registered.
-         */
-        isRegistered : function(xtype){
-            return types[xtype] !== undefined;    
-        },
-
-        /**
-         * <p>Registers a new Component constructor, keyed by a new
-         * {@link Ext.Component#xtype}.</p>
-         * <p>Use this method (or its alias {@link Ext#reg Ext.reg}) to register new
-         * subclasses of {@link Ext.Component} so that lazy instantiation may be used when specifying
-         * child Components.
-         * see {@link Ext.Container#items}</p>
-         * @param {String} xtype The mnemonic string by which the Component class may be looked up.
-         * @param {Constructor} cls The new Component class.
-         */
-        registerType : function(xtype, cls){
-            types[xtype] = cls;
-            cls.xtype = xtype;
-        },
-
-        /**
-         * Creates a new Component from the specified config object using the
-         * config object's {@link Ext.component#xtype xtype} to determine the class to instantiate.
-         * @param {Object} config A configuration object for the Component you wish to create.
-         * @param {Constructor} defaultType The constructor to provide the default Component type if
-         * the config object does not contain a <tt>xtype</tt>. (Optional if the config contains a <tt>xtype</tt>).
-         * @return {Ext.Component} The newly instantiated Component.
-         */
-        create : function(config, defaultType){
-            return config.render ? config : new types[config.xtype || defaultType](config);
-        },
-
-        /**
-         * <p>Registers a new Plugin constructor, keyed by a new
-         * {@link Ext.Component#ptype}.</p>
-         * <p>Use this method (or its alias {@link Ext#preg Ext.preg}) to register new
-         * plugins for {@link Ext.Component}s so that lazy instantiation may be used when specifying
-         * Plugins.</p>
-         * @param {String} ptype The mnemonic string by which the Plugin class may be looked up.
-         * @param {Constructor} cls The new Plugin class.
-         */
-        registerPlugin : function(ptype, cls){
-            ptypes[ptype] = cls;
-            cls.ptype = ptype;
-        },
-
-        /**
-         * Creates a new Plugin from the specified config object using the
-         * config object's {@link Ext.component#ptype ptype} to determine the class to instantiate.
-         * @param {Object} config A configuration object for the Plugin you wish to create.
-         * @param {Constructor} defaultType The constructor to provide the default Plugin type if
-         * the config object does not contain a <tt>ptype</tt>. (Optional if the config contains a <tt>ptype</tt>).
-         * @return {Ext.Component} The newly instantiated Plugin.
-         */
-        createPlugin : function(config, defaultType){
-            return new ptypes[config.ptype || defaultType](config);
-        }
-    };
-}();
-
-/**
- * Shorthand for {@link Ext.ComponentMgr#registerType}
- * @param {String} xtype The {@link Ext.component#xtype mnemonic string} by which the Component class
- * may be looked up.
- * @param {Constructor} cls The new Component class.
- * @member Ext
- * @method reg
- */
-Ext.reg = Ext.ComponentMgr.registerType; // this will be called a lot internally, shorthand to keep the bytes down
-/**
- * Shorthand for {@link Ext.ComponentMgr#registerPlugin}
- * @param {String} ptype The {@link Ext.component#ptype mnemonic string} by which the Plugin class
- * may be looked up.
- * @param {Constructor} cls The new Plugin class.
- * @member Ext
- * @method preg
- */
-Ext.preg = Ext.ComponentMgr.registerPlugin;
-Ext.create = Ext.ComponentMgr.create;
-/**
- * @class Ext.Component
- * @extends Ext.util.Observable
- * <p>Base class for all Ext components.  All subclasses of Component may participate in the automated
- * Ext component lifecycle of creation, rendering and destruction which is provided by the {@link Ext.Container Container} class.
- * Components may be added to a Container through the {@link Ext.Container#items items} config option at the time the Container is created,
- * or they may be added dynamically via the {@link Ext.Container#add add} method.</p>
- * <p>The Component base class has built-in support for basic hide/show and enable/disable behavior.</p>
- * <p>All Components are registered with the {@link Ext.ComponentMgr} on construction so that they can be referenced at any time via
- * {@link Ext#getCmp}, passing the {@link #id}.</p>
- * <p>All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component (or
- * {@link Ext.BoxComponent} if managed box model handling is required, ie height and width management).</p>
- * <p>See the <a href="http://extjs.com/learn/Tutorial:Creating_new_UI_controls">Creating new UI controls</a> tutorial for details on how
- * and to either extend or augment ExtJs base classes to create custom Components.</p>
- * <p>Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the
- * xtype like {@link #getXType} and {@link #isXType}. This is the list of all valid xtypes:</p>
- * <pre>
-xtype            Class
--------------    ------------------
-box              {@link Ext.BoxComponent}
-button           {@link Ext.Button}
-buttongroup      {@link Ext.ButtonGroup}
-colorpalette     {@link Ext.ColorPalette}
-component        {@link Ext.Component}
-container        {@link Ext.Container}
-cycle            {@link Ext.CycleButton}
-dataview         {@link Ext.DataView}
-datepicker       {@link Ext.DatePicker}
-editor           {@link Ext.Editor}
-editorgrid       {@link Ext.grid.EditorGridPanel}
-flash            {@link Ext.FlashComponent}
-grid             {@link Ext.grid.GridPanel}
-listview         {@link Ext.ListView}
-panel            {@link Ext.Panel}
-progress         {@link Ext.ProgressBar}
-propertygrid     {@link Ext.grid.PropertyGrid}
-slider           {@link Ext.Slider}
-spacer           {@link Ext.Spacer}
-splitbutton      {@link Ext.SplitButton}
-tabpanel         {@link Ext.TabPanel}
-treepanel        {@link Ext.tree.TreePanel}
-viewport         {@link Ext.ViewPort}
-window           {@link Ext.Window}
-
-Toolbar components
----------------------------------------
-paging           {@link Ext.PagingToolbar}
-toolbar          {@link Ext.Toolbar}
-tbbutton         {@link Ext.Toolbar.Button}        (deprecated; use button)
-tbfill           {@link Ext.Toolbar.Fill}
-tbitem           {@link Ext.Toolbar.Item}
-tbseparator      {@link Ext.Toolbar.Separator}
-tbspacer         {@link Ext.Toolbar.Spacer}
-tbsplit          {@link Ext.Toolbar.SplitButton}   (deprecated; use splitbutton)
-tbtext           {@link Ext.Toolbar.TextItem}
-
-Menu components
----------------------------------------
-menu             {@link Ext.menu.Menu}
-colormenu        {@link Ext.menu.ColorMenu}
-datemenu         {@link Ext.menu.DateMenu}
-menubaseitem     {@link Ext.menu.BaseItem}
-menucheckitem    {@link Ext.menu.CheckItem}
-menuitem         {@link Ext.menu.Item}
-menuseparator    {@link Ext.menu.Separator}
-menutextitem     {@link Ext.menu.TextItem}
-
-Form components
----------------------------------------
-form             {@link Ext.FormPanel}
-checkbox         {@link Ext.form.Checkbox}
-checkboxgroup    {@link Ext.form.CheckboxGroup}
-combo            {@link Ext.form.ComboBox}
-datefield        {@link Ext.form.DateField}
-displayfield     {@link Ext.form.DisplayField}
-field            {@link Ext.form.Field}
-fieldset         {@link Ext.form.FieldSet}
-hidden           {@link Ext.form.Hidden}
-htmleditor       {@link Ext.form.HtmlEditor}
-label            {@link Ext.form.Label}
-numberfield      {@link Ext.form.NumberField}
-radio            {@link Ext.form.Radio}
-radiogroup       {@link Ext.form.RadioGroup}
-textarea         {@link Ext.form.TextArea}
-textfield        {@link Ext.form.TextField}
-timefield        {@link Ext.form.TimeField}
-trigger          {@link Ext.form.TriggerField}
-
-Chart components
----------------------------------------
-chart            {@link Ext.chart.Chart}
-barchart         {@link Ext.chart.BarChart}
-cartesianchart   {@link Ext.chart.CartesianChart}
-columnchart      {@link Ext.chart.ColumnChart}
-linechart        {@link Ext.chart.LineChart}
-piechart         {@link Ext.chart.PieChart}
-
-Store xtypes
----------------------------------------
-arraystore       {@link Ext.data.ArrayStore}
-directstore      {@link Ext.data.DirectStore}
-groupingstore    {@link Ext.data.GroupingStore}
-jsonstore        {@link Ext.data.JsonStore}
-simplestore      {@link Ext.data.SimpleStore}      (deprecated; use arraystore)
-store            {@link Ext.data.Store}
-xmlstore         {@link Ext.data.XmlStore}
-</pre>
- * @constructor
- * @param {Ext.Element/String/Object} config The configuration options may be specified as either:
- * <div class="mdetail-params"><ul>
- * <li><b>an element</b> :
- * <p class="sub-desc">it is set as the internal element and its id used as the component id</p></li>
- * <li><b>a string</b> :
- * <p class="sub-desc">it is assumed to be the id of an existing element and is used as the component id</p></li>
- * <li><b>anything else</b> :
- * <p class="sub-desc">it is assumed to be a standard config object and is applied to the component</p></li>
- * </ul></div>
- */
-Ext.Component = function(config){
-    config = config || {};
-    if(config.initialConfig){
-        if(config.isAction){           // actions
-            this.baseAction = config;
-        }
-        config = config.initialConfig; // component cloning / action set up
-    }else if(config.tagName || config.dom || Ext.isString(config)){ // element object
-        config = {applyTo: config, id: config.id || config};
-    }
-
-    /**
-     * This Component's initial configuration specification. Read-only.
-     * @type Object
-     * @property initialConfig
-     */
-    this.initialConfig = config;
-
-    Ext.apply(this, config);
-    this.addEvents(
-        /**
-         * @event disable
-         * Fires after the component is disabled.
-         * @param {Ext.Component} this
-         */
-        'disable',
-        /**
-         * @event enable
-         * Fires after the component is enabled.
-         * @param {Ext.Component} this
-         */
-        'enable',
-        /**
-         * @event beforeshow
-         * Fires before the component is shown by calling the {@link #show} method.
-         * Return false from an event handler to stop the show.
-         * @param {Ext.Component} this
-         */
-        'beforeshow',
-        /**
-         * @event show
-         * Fires after the component is shown when calling the {@link #show} method.
-         * @param {Ext.Component} this
-         */
-        'show',
-        /**
-         * @event beforehide
-         * Fires before the component is hidden by calling the {@link #hide} method.
-         * Return false from an event handler to stop the hide.
-         * @param {Ext.Component} this
-         */
-        'beforehide',
-        /**
-         * @event hide
-         * Fires after the component is hidden.
-         * Fires after the component is hidden when calling the {@link #hide} method.
-         * @param {Ext.Component} this
-         */
-        'hide',
-        /**
-         * @event beforerender
-         * Fires before the component is {@link #rendered}. Return false from an
-         * event handler to stop the {@link #render}.
-         * @param {Ext.Component} this
-         */
-        'beforerender',
-        /**
-         * @event render
-         * Fires after the component markup is {@link #rendered}.
-         * @param {Ext.Component} this
-         */
-        'render',
-        /**
-         * @event afterrender
-         * <p>Fires after the component rendering is finished.</p>
-         * <p>The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed
-         * by any afterRender method defined for the Component, and, if {@link #stateful}, after state
-         * has been restored.</p>
-         * @param {Ext.Component} this
-         */
-        'afterrender',
-        /**
-         * @event beforedestroy
-         * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}.
-         * @param {Ext.Component} this
-         */
-        'beforedestroy',
-        /**
-         * @event destroy
-         * Fires after the component is {@link #destroy}ed.
-         * @param {Ext.Component} this
-         */
-        'destroy',
-        /**
-         * @event beforestaterestore
-         * Fires before the state of the component is restored. Return false from an event handler to stop the restore.
-         * @param {Ext.Component} this
-         * @param {Object} state The hash of state values returned from the StateProvider. If this
-         * event is not vetoed, then the state object is passed to <b><tt>applyState</tt></b>. By default,
-         * that simply copies property values into this Component. The method maybe overriden to
-         * provide custom state restoration.
-         */
-        'beforestaterestore',
-        /**
-         * @event staterestore
-         * Fires after the state of the component is restored.
-         * @param {Ext.Component} this
-         * @param {Object} state The hash of state values returned from the StateProvider. This is passed
-         * to <b><tt>applyState</tt></b>. By default, that simply copies property values into this
-         * Component. The method maybe overriden to provide custom state restoration.
-         */
-        'staterestore',
-        /**
-         * @event beforestatesave
-         * Fires before the state of the component is saved to the configured state provider. Return false to stop the save.
-         * @param {Ext.Component} this
-         * @param {Object} state The hash of state values. This is determined by calling
-         * <b><tt>getState()</tt></b> on the Component. This method must be provided by the
-         * developer to return whetever representation of state is required, by default, Ext.Component
-         * has a null implementation.
-         */
-        'beforestatesave',
-        /**
-         * @event statesave
-         * Fires after the state of the component is saved to the configured state provider.
-         * @param {Ext.Component} this
-         * @param {Object} state The hash of state values. This is determined by calling
-         * <b><tt>getState()</tt></b> on the Component. This method must be provided by the
-         * developer to return whetever representation of state is required, by default, Ext.Component
-         * has a null implementation.
-         */
-        'statesave'
-    );
-    this.getId();
-    Ext.ComponentMgr.register(this);
-    Ext.Component.superclass.constructor.call(this);
-
-    if(this.baseAction){
-        this.baseAction.addComponent(this);
-    }
-
-    this.initComponent();
-
-    if(this.plugins){
-        if(Ext.isArray(this.plugins)){
-            for(var i = 0, len = this.plugins.length; i < len; i++){
-                this.plugins[i] = this.initPlugin(this.plugins[i]);
-            }
-        }else{
-            this.plugins = this.initPlugin(this.plugins);
-        }
-    }
-
-    if(this.stateful !== false){
-        this.initState(config);
-    }
-
-    if(this.applyTo){
-        this.applyToMarkup(this.applyTo);
-        delete this.applyTo;
-    }else if(this.renderTo){
-        this.render(this.renderTo);
-        delete this.renderTo;
-    }
-};
-
-// private
-Ext.Component.AUTO_ID = 1000;
-
-Ext.extend(Ext.Component, Ext.util.Observable, {
-       // Configs below are used for all Components when rendered by FormLayout.
-    /**
-     * @cfg {String} fieldLabel <p>The label text to display next to this Component (defaults to '').</p>
-     * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container which
-     * has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout manager (e.g.
-     * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>).</p><br>
-     * <p>Also see <tt>{@link #hideLabel}</tt> and
-     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
-     * Example use:<pre><code>
-new Ext.FormPanel({
-    height: 100,
-    renderTo: Ext.getBody(),
-    items: [{
-        xtype: 'textfield',
-        fieldLabel: 'Name'
-    }]
-});
-</code></pre>
-     */
-    /**
-     * @cfg {String} labelStyle <p>A CSS style specification string to apply directly to this field's
-     * label.  Defaults to the container's labelStyle value if set (e.g.,
-     * <tt>{@link Ext.layout.FormLayout#labelStyle}</tt> , or '').</p>
-     * <br><p><b>Note</b>: see the note for <code>{@link #clearCls}</code>.</p><br>
-     * <p>Also see <code>{@link #hideLabel}</code> and
-     * <code>{@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</code></p>
-     * Example use:<pre><code>
-new Ext.FormPanel({
-    height: 100,
-    renderTo: Ext.getBody(),
-    items: [{
-        xtype: 'textfield',
-        fieldLabel: 'Name',
-        labelStyle: 'font-weight:bold;'
-    }]
-});
-</code></pre>
-     */
-    /**
-     * @cfg {String} labelSeparator <p>The separator to display after the text of each
-     * <tt>{@link #fieldLabel}</tt>.  This property may be configured at various levels.
-     * The order of precedence is:
-     * <div class="mdetail-params"><ul>
-     * <li>field / component level</li>
-     * <li>container level</li>
-     * <li>{@link Ext.layout.FormLayout#labelSeparator layout level} (defaults to colon <tt>':'</tt>)</li>
-     * </ul></div>
-     * To display no separator for this field's label specify empty string ''.</p>
-     * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
-     * <p>Also see <tt>{@link #hideLabel}</tt> and
-     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
-     * Example use:<pre><code>
-new Ext.FormPanel({
-    height: 100,
-    renderTo: Ext.getBody(),
-    layoutConfig: {
-        labelSeparator: '~'   // layout config has lowest priority (defaults to ':')
-    },
-    {@link Ext.layout.FormLayout#labelSeparator labelSeparator}: '>>',     // config at container level
-    items: [{
-        xtype: 'textfield',
-        fieldLabel: 'Field 1',
-        labelSeparator: '...' // field/component level config supersedes others
-    },{
-        xtype: 'textfield',
-        fieldLabel: 'Field 2' // labelSeparator will be '='
-    }]
-});
-</code></pre>
-     */
-    /**
-     * @cfg {Boolean} hideLabel <p><tt>true</tt> to completely hide the label element
-     * ({@link #fieldLabel label} and {@link #labelSeparator separator}). Defaults to <tt>false</tt>.
-     * By default, even if you do not specify a <tt>{@link #fieldLabel}</tt> the space will still be
-     * reserved so that the field will line up with other fields that do have labels.
-     * Setting this to <tt>true</tt> will cause the field to not reserve that space.</p>
-     * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
-     * Example use:<pre><code>
-new Ext.FormPanel({
-    height: 100,
-    renderTo: Ext.getBody(),
-    items: [{
-        xtype: 'textfield'
-        hideLabel: true
-    }]
-});
-</code></pre>
-     */
-    /**
-     * @cfg {String} clearCls <p>The CSS class used to to apply to the special clearing div rendered
-     * directly after each form field wrapper to provide field clearing (defaults to
-     * <tt>'x-form-clear-left'</tt>).</p>
-     * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container
-     * which has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout
-     * manager (e.g. {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) and either a
-     * <tt>{@link #fieldLabel}</tt> is specified or <tt>isFormField=true</tt> is specified.</p><br>
-     * <p>See {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} also.</p>
-     */
-    /**
-     * @cfg {String} itemCls <p>An additional CSS class to apply to the div wrapping the form item
-     * element of this field.  If supplied, <tt>itemCls</tt> at the <b>field</b> level will override
-     * the default <tt>itemCls</tt> supplied at the <b>container</b> level. The value specified for
-     * <tt>itemCls</tt> will be added to the default class (<tt>'x-form-item'</tt>).</p>
-     * <p>Since it is applied to the item wrapper (see
-     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}), it allows
-     * you to write standard CSS rules that can apply to the field, the label (if specified), or
-     * any other element within the markup for the field.</p>
-     * <br><p><b>Note</b>: see the note for <tt>{@link #fieldLabel}</tt>.</p><br>
-     * Example use:<pre><code>
-// Apply a style to the field's label:
-&lt;style>
-    .required .x-form-item-label {font-weight:bold;color:red;}
-&lt;/style>
-
-new Ext.FormPanel({
-       height: 100,
-       renderTo: Ext.getBody(),
-       items: [{
-               xtype: 'textfield',
-               fieldLabel: 'Name',
-               itemCls: 'required' //this label will be styled
-       },{
-               xtype: 'textfield',
-               fieldLabel: 'Favorite Color'
-       }]
-});
-</code></pre>
-     */
-
-       // Configs below are used for all Components when rendered by AnchorLayout.
-    /**
-     * @cfg {String} anchor <p><b>Note</b>: this config is only used when this Component is rendered
-     * by a Container which has been configured to use an <b>{@link Ext.layout.AnchorLayout AnchorLayout}</b>
-     * based layout manager, for example:<div class="mdetail-params"><ul>
-     * <li>{@link Ext.form.FormPanel}</li>
-     * <li>specifying <code>layout: 'anchor' // or 'form', or 'absolute'</code></li>
-     * </ul></div></p>
-     * <p>See {@link Ext.layout.AnchorLayout}.{@link Ext.layout.AnchorLayout#anchor anchor} also.</p>
-     */
-
-    /**
-     * @cfg {String} id
-     * <p>The <b>unique</b> id of this component (defaults to an {@link #getId auto-assigned id}).
-     * You should assign an id if you need to be able to access the component later and you do
-     * not have an object reference available (e.g., using {@link Ext}.{@link Ext#getCmp getCmp}).</p>
-     * <p>Note that this id will also be used as the element id for the containing HTML element
-     * that is rendered to the page for this component. This allows you to write id-based CSS
-     * rules to style the specific instance of this component uniquely, and also to select
-     * sub-elements using this component's id as the parent.</p>
-     * <p><b>Note</b>: to avoid complications imposed by a unique <tt>id</tt> also see
-     * <code>{@link #itemId}</code> and <code>{@link #ref}</code>.</p>
-     * <p><b>Note</b>: to access the container of an item see <code>{@link #ownerCt}</code>.</p>
-     */
-    /**
-     * @cfg {String} itemId
-     * <p>An <tt>itemId</tt> can be used as an alternative way to get a reference to a component
-     * when no object reference is available.  Instead of using an <code>{@link #id}</code> with
-     * {@link Ext}.{@link Ext#getCmp getCmp}, use <code>itemId</code> with
-     * {@link Ext.Container}.{@link Ext.Container#getComponent getComponent} which will retrieve
-     * <code>itemId</code>'s or <tt>{@link #id}</tt>'s. Since <code>itemId</code>'s are an index to the
-     * container's internal MixedCollection, the <code>itemId</code> is scoped locally to the container --
-     * avoiding potential conflicts with {@link Ext.ComponentMgr} which requires a <b>unique</b>
-     * <code>{@link #id}</code>.</p>
-     * <pre><code>
-var c = new Ext.Panel({ //
-    {@link Ext.BoxComponent#height height}: 300,
-    {@link #renderTo}: document.body,
-    {@link Ext.Container#layout layout}: 'auto',
-    {@link Ext.Container#items items}: [
-        {
-            itemId: 'p1',
-            {@link Ext.Panel#title title}: 'Panel 1',
-            {@link Ext.BoxComponent#height height}: 150
-        },
-        {
-            itemId: 'p2',
-            {@link Ext.Panel#title title}: 'Panel 2',
-            {@link Ext.BoxComponent#height height}: 150
-        }
-    ]
-})
-p1 = c.{@link Ext.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
-p2 = p1.{@link #ownerCt}.{@link Ext.Container#getComponent getComponent}('p2'); // reference via a sibling
-     * </code></pre>
-     * <p>Also see <tt>{@link #id}</tt> and <code>{@link #ref}</code>.</p>
-     * <p><b>Note</b>: to access the container of an item see <tt>{@link #ownerCt}</tt>.</p>
-     */
-    /**
-     * @cfg {String} xtype
-     * The registered <tt>xtype</tt> to create. This config option is not used when passing
-     * a config object into a constructor. This config option is used only when
-     * lazy instantiation is being used, and a child item of a Container is being
-     * specified not as a fully instantiated Component, but as a <i>Component config
-     * object</i>. The <tt>xtype</tt> will be looked up at render time up to determine what
-     * type of child Component to create.<br><br>
-     * The predefined xtypes are listed {@link Ext.Component here}.
-     * <br><br>
-     * If you subclass Components to create your own Components, you may register
-     * them using {@link Ext.ComponentMgr#registerType} in order to be able to
-     * take advantage of lazy instantiation and rendering.
-     */
-    /**
-     * @cfg {String} ptype
-     * The registered <tt>ptype</tt> to create. This config option is not used when passing
-     * a config object into a constructor. This config option is used only when
-     * lazy instantiation is being used, and a Plugin is being
-     * specified not as a fully instantiated Component, but as a <i>Component config
-     * object</i>. The <tt>ptype</tt> will be looked up at render time up to determine what
-     * type of Plugin to create.<br><br>
-     * If you create your own Plugins, you may register them using
-     * {@link Ext.ComponentMgr#registerPlugin} in order to be able to
-     * take advantage of lazy instantiation and rendering.
-     */
-    /**
-     * @cfg {String} cls
-     * An optional extra CSS class that will be added to this component's Element (defaults to '').  This can be
-     * useful for adding customized styles to the component or any of its children using standard CSS rules.
-     */
-    /**
-     * @cfg {String} overCls
-     * An optional extra CSS class that will be added to this component's Element when the mouse moves
-     * over the Element, and removed when the mouse moves out. (defaults to '').  This can be
-     * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
-     */
-    /**
-     * @cfg {String} style
-     * A custom style specification to be applied to this component's Element.  Should be a valid argument to
-     * {@link Ext.Element#applyStyles}.
-     * <pre><code>
-new Ext.Panel({
-    title: 'Some Title',
-    renderTo: Ext.getBody(),
-    width: 400, height: 300,
-    layout: 'form',
-    items: [{
-        xtype: 'textarea',
-        style: {
-            width: '95%',
-            marginBottom: '10px'
-        }
-    },
-        new Ext.Button({
-            text: 'Send',
-            minWidth: '100',
-            style: {
-                marginBottom: '10px'
-            }
-        })
-    ]
-});
-     * </code></pre>
-     */
-    /**
-     * @cfg {String} ctCls
-     * <p>An optional extra CSS class that will be added to this component's container. This can be useful for
-     * adding customized styles to the container or any of its children using standard CSS rules.  See
-     * {@link Ext.layout.ContainerLayout}.{@link Ext.layout.ContainerLayout#extraCls extraCls} also.</p>
-     * <p><b>Note</b>: <tt>ctCls</tt> defaults to <tt>''</tt> except for the following class
-     * which assigns a value by default:
-     * <div class="mdetail-params"><ul>
-     * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-layout-ct'</tt></li>
-     * </ul></div>
-     * To configure the above Class with an extra CSS class append to the default.  For example,
-     * for BoxLayout (Hbox and Vbox):<pre><code>
-     * ctCls: 'x-box-layout-ct custom-class'
-     * </code></pre>
-     * </p>
-     */
-    /**
-     * @cfg {Boolean} disabled
-     * Render this component disabled (default is false).
-     */
-    disabled : false,
-    /**
-     * @cfg {Boolean} hidden
-     * Render this component hidden (default is false). If <tt>true</tt>, the
-     * {@link #hide} method will be called internally.
-     */
-    hidden : false,
-    /**
-     * @cfg {Object/Array} plugins
-     * An object or array of objects that will provide custom functionality for this component.  The only
-     * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component.
-     * When a component is created, if any plugins are available, the component will call the init method on each
-     * plugin, passing a reference to itself.  Each plugin can then call methods or respond to events on the
-     * component as needed to provide its functionality.
-     */
-    /**
-     * @cfg {Mixed} applyTo
-     * <p>Specify the id of the element, a DOM element or an existing Element corresponding to a DIV
-     * that is already present in the document that specifies some structural markup for this
-     * component.</p><div><ul>
-     * <li><b>Description</b> : <ul>
-     * <div class="sub-desc">When <tt>applyTo</tt> is used, constituent parts of the component can also be specified
-     * by id or CSS class name within the main element, and the component being created may attempt
-     * to create its subcomponents from that markup if applicable.</div>
-     * </ul></li>
-     * <li><b>Notes</b> : <ul>
-     * <div class="sub-desc">When using this config, a call to render() is not required.</div>
-     * <div class="sub-desc">If applyTo is specified, any value passed for {@link #renderTo} will be ignored and the target
-     * element's parent node will automatically be used as the component's container.</div>
-     * </ul></li>
-     * </ul></div>
-     */
-    /**
-     * @cfg {Mixed} renderTo
-     * <p>Specify the id of the element, a DOM element or an existing Element that this component
-     * will be rendered into.</p><div><ul>
-     * <li><b>Notes</b> : <ul>
-     * <div class="sub-desc">Do <u>not</u> use this option if the Component is to be a child item of
-     * a {@link Ext.Container Container}. It is the responsibility of the
-     * {@link Ext.Container Container}'s {@link Ext.Container#layout layout manager}
-     * to render and manage its child items.</div>
-     * <div class="sub-desc">When using this config, a call to render() is not required.</div>
-     * </ul></li>
-     * </ul></div>
-     * <p>See <tt>{@link #render}</tt> also.</p>
-     */
-    /**
-     * @cfg {Boolean} stateful
-     * <p>A flag which causes the Component to attempt to restore the state of
-     * internal properties from a saved state on startup. The component must have
-     * either a <code>{@link #stateId}</code> or <code>{@link #id}</code> assigned
-     * for state to be managed. Auto-generated ids are not guaranteed to be stable
-     * across page loads and cannot be relied upon to save and restore the same
-     * state for a component.<p>
-     * <p>For state saving to work, the state manager's provider must have been
-     * set to an implementation of {@link Ext.state.Provider} which overrides the
-     * {@link Ext.state.Provider#set set} and {@link Ext.state.Provider#get get}
-     * methods to save and recall name/value pairs. A built-in implementation,
-     * {@link Ext.state.CookieProvider} is available.</p>
-     * <p>To set the state provider for the current page:</p>
-     * <pre><code>
-Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
-    expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
-}));
-     * </code></pre>
-     * <p>A stateful Component attempts to save state when one of the events
-     * listed in the <code>{@link #stateEvents}</code> configuration fires.</p>
-     * <p>To save state, a stateful Component first serializes its state by
-     * calling <b><code>getState</code></b>. By default, this function does
-     * nothing. The developer must provide an implementation which returns an
-     * object hash which represents the Component's restorable state.</p>
-     * <p>The value yielded by getState is passed to {@link Ext.state.Manager#set}
-     * which uses the configured {@link Ext.state.Provider} to save the object
-     * keyed by the Component's <code>{@link stateId}</code>, or, if that is not
-     * specified, its <code>{@link #id}</code>.</p>
-     * <p>During construction, a stateful Component attempts to <i>restore</i>
-     * its state by calling {@link Ext.state.Manager#get} passing the
-     * <code>{@link #stateId}</code>, or, if that is not specified, the
-     * <code>{@link #id}</code>.</p>
-     * <p>The resulting object is passed to <b><code>applyState</code></b>.
-     * The default implementation of <code>applyState</code> simply copies
-     * properties into the object, but a developer may override this to support
-     * more behaviour.</p>
-     * <p>You can perform extra processing on state save and restore by attaching
-     * handlers to the {@link #beforestaterestore}, {@link #staterestore},
-     * {@link #beforestatesave} and {@link #statesave} events.</p>
-     */
-    /**
-     * @cfg {String} stateId
-     * The unique id for this component to use for state management purposes
-     * (defaults to the component id if one was set, otherwise null if the
-     * component is using a generated id).
-     * <p>See <code>{@link #stateful}</code> for an explanation of saving and
-     * restoring Component state.</p>
-     */
-    /**
-     * @cfg {Array} stateEvents
-     * <p>An array of events that, when fired, should trigger this component to
-     * save its state (defaults to none). <code>stateEvents</code> may be any type
-     * of event supported by this component, including browser or custom events
-     * (e.g., <tt>['click', 'customerchange']</tt>).</p>
-     * <p>See <code>{@link #stateful}</code> for an explanation of saving and
-     * restoring Component state.</p>
-     */
-    /**
-     * @cfg {Mixed} autoEl
-     * <p>A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
-     * encapsulate this Component.</p>
-     * <p>You do not normally need to specify this. For the base classes {@link Ext.Component}, {@link Ext.BoxComponent},
-     * and {@link Ext.Container}, this defaults to <b><tt>'div'</tt></b>. The more complex Ext classes use a more complex
-     * DOM structure created by their own onRender methods.</p>
-     * <p>This is intended to allow the developer to create application-specific utility Components encapsulated by
-     * different DOM elements. Example usage:</p><pre><code>
-{
-    xtype: 'box',
-    autoEl: {
-        tag: 'img',
-        src: 'http://www.example.com/example.jpg'
-    }
-}, {
-    xtype: 'box',
-    autoEl: {
-        tag: 'blockquote',
-        html: 'autoEl is cool!'
-    }
-}, {
-    xtype: 'container',
-    autoEl: 'ul',
-    cls: 'ux-unordered-list',
-    items: {
-        xtype: 'box',
-        autoEl: 'li',
-        html: 'First list item'
-    }
-}
-</code></pre>
-     */
-    autoEl : 'div',
-
-    /**
-     * @cfg {String} disabledClass
-     * CSS class added to the component when it is disabled (defaults to 'x-item-disabled').
-     */
-    disabledClass : 'x-item-disabled',
-    /**
-     * @cfg {Boolean} allowDomMove
-     * Whether the component can move the Dom node when rendering (defaults to true).
-     */
-    allowDomMove : true,
-    /**
-     * @cfg {Boolean} autoShow
-     * True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
-     * them on render (defaults to false).
-     */
-    autoShow : false,
-    /**
-     * @cfg {String} hideMode
-     * <p>How this component should be hidden. Supported values are <tt>'visibility'</tt>
-     * (css visibility), <tt>'offsets'</tt> (negative offset position) and <tt>'display'</tt>
-     * (css display).</p>
-     * <br><p><b>Note</b>: the default of <tt>'display'</tt> is generally preferred
-     * since items are automatically laid out when they are first shown (no sizing
-     * is done while hidden).</p>
-     */
-    hideMode : 'display',
-    /**
-     * @cfg {Boolean} hideParent
-     * True to hide and show the component's container when hide/show is called on the component, false to hide
-     * and show the component itself (defaults to false).  For example, this can be used as a shortcut for a hide
-     * button on a window by setting hide:true on the button when adding it to its parent container.
-     */
-    hideParent : false,
-    /**
-     * <p>The {@link Ext.Element} which encapsulates this Component. Read-only.</p>
-     * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
-     * that may be overridden using the <code>{@link #autoEl}</code> config.</p>
-     * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
-     * <p>To add listeners for <b>DOM events</b> to this Component (as opposed to listeners
-     * for this Component's own Observable events), see the {@link Ext.util.Observable#listeners listeners}
-     * config for a suggestion, or use a render listener directly:</p><pre><code>
-new Ext.Panel({
-    title: 'The Clickable Panel',
-    listeners: {
-        render: function(p) {
-            // Append the Panel to the click handler&#39;s argument list.
-            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
-        },
-        single: true  // Remove the listener after first invocation
-    }
-});
-</code></pre>
-     * <p>See also <tt>{@link #getEl getEl}</p>
-     * @type Ext.Element
-     * @property el
-     */
-    /**
-     * The component's owner {@link Ext.Container} (defaults to undefined, and is set automatically when
-     * the component is added to a container).  Read-only.
-     * <p><b>Note</b>: to access items within the container see <tt>{@link #itemId}</tt>.</p>
-     * @type Ext.Container
-     * @property ownerCt
-     */
-    /**
-     * True if this component is hidden. Read-only.
-     * @type Boolean
-     * @property
-     */
-    /**
-     * True if this component is disabled. Read-only.
-     * @type Boolean
-     * @property
-     */
-    /**
-     * True if this component has been rendered. Read-only.
-     * @type Boolean
-     * @property
-     */
-    rendered : false,
-
-    // private
-    ctype : 'Ext.Component',
-
-    // private
-    actionMode : 'el',
-
-    // private
-    getActionEl : function(){
-        return this[this.actionMode];
-    },
-
-    initPlugin : function(p){
-        if(p.ptype && !Ext.isFunction(p.init)){
-            p = Ext.ComponentMgr.createPlugin(p);
-        }else if(Ext.isString(p)){
-            p = Ext.ComponentMgr.createPlugin({
-                ptype: p
-            });
-        }
-        p.init(this);
-        return p;
-    },
-
-    /* // protected
-     * Function to be implemented by Component subclasses to be part of standard component initialization flow (it is empty by default).
-     * <pre><code>
-// Traditional constructor:
-Ext.Foo = function(config){
-    // call superclass constructor:
-    Ext.Foo.superclass.constructor.call(this, config);
-
-    this.addEvents({
-        // add events
-    });
-};
-Ext.extend(Ext.Foo, Ext.Bar, {
-   // class body
-}
-
-// initComponent replaces the constructor:
-Ext.Foo = Ext.extend(Ext.Bar, {
-    initComponent : function(){
-        // call superclass initComponent
-        Ext.Container.superclass.initComponent.call(this);
-
-        this.addEvents({
-            // add events
-        });
-    }
-}
-</code></pre>
-     */
-    initComponent : Ext.emptyFn,
-
-    /**
-     * <p>Render this Component into the passed HTML element.</p>
-     * <p><b>If you are using a {@link Ext.Container Container} object to house this Component, then
-     * do not use the render method.</b></p>
-     * <p>A Container's child Components are rendered by that Container's
-     * {@link Ext.Container#layout layout} manager when the Container is first rendered.</p>
-     * <p>Certain layout managers allow dynamic addition of child components. Those that do
-     * include {@link Ext.layout.CardLayout}, {@link Ext.layout.AnchorLayout},
-     * {@link Ext.layout.FormLayout}, {@link Ext.layout.TableLayout}.</p>
-     * <p>If the Container is already rendered when a new child Component is added, you may need to call
-     * the Container's {@link Ext.Container#doLayout doLayout} to refresh the view which causes any
-     * unrendered child Components to be rendered. This is required so that you can add multiple
-     * child components if needed while only refreshing the layout once.</p>
-     * <p>When creating complex UIs, it is important to remember that sizing and positioning
-     * of child items is the responsibility of the Container's {@link Ext.Container#layout layout} manager.
-     * If you expect child items to be sized in response to user interactions, you must
-     * configure the Container with a layout manager which creates and manages the type of layout you
-     * have in mind.</p>
-     * <p><b>Omitting the Container's {@link Ext.Container#layout layout} config means that a basic
-     * layout manager is used which does nothing but render child components sequentially into the
-     * Container. No sizing or positioning will be performed in this situation.</b></p>
-     * @param {Element/HTMLElement/String} container (optional) The element this Component should be
-     * rendered into. If it is being created from existing markup, this should be omitted.
-     * @param {String/Number} position (optional) The element ID or DOM node index within the container <b>before</b>
-     * which this component will be inserted (defaults to appending to the end of the container)
-     */
-    render : function(container, position){
-        if(!this.rendered && this.fireEvent('beforerender', this) !== false){
-            if(!container && this.el){
-                this.el = Ext.get(this.el);
-                container = this.el.dom.parentNode;
-                this.allowDomMove = false;
-            }
-            this.container = Ext.get(container);
-            if(this.ctCls){
-                this.container.addClass(this.ctCls);
-            }
-            this.rendered = true;
-            if(position !== undefined){
-                if(Ext.isNumber(position)){
-                    position = this.container.dom.childNodes[position];
-                }else{
-                    position = Ext.getDom(position);
-                }
-            }
-            this.onRender(this.container, position || null);
-            if(this.autoShow){
-                this.el.removeClass(['x-hidden','x-hide-' + this.hideMode]);
-            }
-            if(this.cls){
-                this.el.addClass(this.cls);
-                delete this.cls;
-            }
-            if(this.style){
-                this.el.applyStyles(this.style);
-                delete this.style;
-            }
-            if(this.overCls){
-                this.el.addClassOnOver(this.overCls);
-            }
-            this.fireEvent('render', this);
-            this.afterRender(this.container);
-            if(this.hidden){
-                // call this so we don't fire initial hide events.
-                this.doHide();
-            }
-            if(this.disabled){
-                // pass silent so the event doesn't fire the first time.
-                this.disable(true);
-            }
-
-            if(this.stateful !== false){
-                this.initStateEvents();
-            }
-            this.initRef();
-            this.fireEvent('afterrender', this);
-        }
-        return this;
-    },
-
-    initRef : function(){
-        /**
-         * @cfg {String} ref
-         * <p>A path specification, relative to the Component's {@link #ownerCt} specifying into which
-         * ancestor Container to place a named reference to this Component.</p>
-         * <p>The ancestor axis can be traversed by using '/' characters in the path.
-         * For example, to put a reference to a Toolbar Button into <i>the Panel which owns the Toolbar</i>:</p><pre><code>
-var myGrid = new Ext.grid.EditorGridPanel({
-    title: 'My EditorGridPanel',
-    store: myStore,
-    colModel: myColModel,
-    tbar: [{
-        text: 'Save',
-        handler: saveChanges,
-        disabled: true,
-        ref: '../saveButton'
-    }],
-    listeners: {
-        afteredit: function() {
-//          The button reference is in the GridPanel
-            myGrid.saveButton.enable();
-        }
-    }
-});
-</code></pre>
-         * <p>In the code above, if the ref had been <code>'saveButton'</code> the reference would
-         * have been placed into the Toolbar. Each '/' in the ref moves up one level from the
-         * Component's {@link #ownerCt}.</p>
-         */
-        if(this.ref){
-            var levels = this.ref.split('/');
-            var last = levels.length, i = 0;
-            var t = this;
-            while(i < last){
-                if(t.ownerCt){
-                    t = t.ownerCt;
-                }
-                i++;
-            }
-            t[levels[--i]] = this;
-        }
-    },
-
-    // private
-    initState : function(config){
-        if(Ext.state.Manager){
-            var id = this.getStateId();
-            if(id){
-                var state = Ext.state.Manager.get(id);
-                if(state){
-                    if(this.fireEvent('beforestaterestore', this, state) !== false){
-                        this.applyState(state);
-                        this.fireEvent('staterestore', this, state);
-                    }
-                }
-            }
-        }
-    },
-
-    // private
-    getStateId : function(){
-        return this.stateId || ((this.id.indexOf('ext-comp-') == 0 || this.id.indexOf('ext-gen') == 0) ? null : this.id);
-    },
-
-    // private
-    initStateEvents : function(){
-        if(this.stateEvents){
-            for(var i = 0, e; e = this.stateEvents[i]; i++){
-                this.on(e, this.saveState, this, {delay:100});
-            }
-        }
-    },
-
-    // private
-    applyState : function(state, config){
-        if(state){
-            Ext.apply(this, state);
-        }
-    },
-
-    // private
-    getState : function(){
-        return null;
-    },
-
-    // private
-    saveState : function(){
-        if(Ext.state.Manager && this.stateful !== false){
-            var id = this.getStateId();
-            if(id){
-                var state = this.getState();
-                if(this.fireEvent('beforestatesave', this, state) !== false){
-                    Ext.state.Manager.set(id, state);
-                    this.fireEvent('statesave', this, state);
-                }
-            }
-        }
-    },
-
-    /**
-     * Apply this component to existing markup that is valid. With this function, no call to render() is required.
-     * @param {String/HTMLElement} el
-     */
-    applyToMarkup : function(el){
-        this.allowDomMove = false;
-        this.el = Ext.get(el);
-        this.render(this.el.dom.parentNode);
-    },
-
-    /**
-     * Adds a CSS class to the component's underlying element.
-     * @param {string} cls The CSS class name to add
-     * @return {Ext.Component} this
-     */
-    addClass : function(cls){
-        if(this.el){
-            this.el.addClass(cls);
-        }else{
-            this.cls = this.cls ? this.cls + ' ' + cls : cls;
-        }
-        return this;
-    },
-
-    /**
-     * Removes a CSS class from the component's underlying element.
-     * @param {string} cls The CSS class name to remove
-     * @return {Ext.Component} this
-     */
-    removeClass : function(cls){
-        if(this.el){
-            this.el.removeClass(cls);
-        }else if(this.cls){
-            this.cls = this.cls.split(' ').remove(cls).join(' ');
-        }
-        return this;
-    },
-
-    // private
-    // default function is not really useful
-    onRender : function(ct, position){
-        if(!this.el && this.autoEl){
-            if(Ext.isString(this.autoEl)){
-                this.el = document.createElement(this.autoEl);
-            }else{
-                var div = document.createElement('div');
-                Ext.DomHelper.overwrite(div, this.autoEl);
-                this.el = div.firstChild;
-            }
-            if (!this.el.id) {
-                this.el.id = this.getId();
-            }
-        }
-        if(this.el){
-            this.el = Ext.get(this.el);
-            if(this.allowDomMove !== false){
-                ct.dom.insertBefore(this.el.dom, position);
-            }
-        }
-    },
-
-    // private
-    getAutoCreate : function(){
-        var cfg = Ext.isObject(this.autoCreate) ?
-                      this.autoCreate : Ext.apply({}, this.defaultAutoCreate);
-        if(this.id && !cfg.id){
-            cfg.id = this.id;
-        }
-        return cfg;
-    },
-
-    // private
-    afterRender : Ext.emptyFn,
-
-    /**
-     * Destroys this component by purging any event listeners, removing the component's element from the DOM,
-     * removing the component from its {@link Ext.Container} (if applicable) and unregistering it from
-     * {@link Ext.ComponentMgr}.  Destruction is generally handled automatically by the framework and this method
-     * should usually not need to be called directly.
-     *
-     */
-    destroy : function(){
-        if(this.fireEvent('beforedestroy', this) !== false){
-            this.beforeDestroy();
-            if(this.rendered){
-                this.el.removeAllListeners();
-                this.el.remove();
-                if(this.actionMode == 'container' || this.removeMode == 'container'){
-                    this.container.remove();
-                }
-            }
-            this.onDestroy();
-            Ext.ComponentMgr.unregister(this);
-            this.fireEvent('destroy', this);
-            this.purgeListeners();
-        }
-    },
-
-    // private
-    beforeDestroy : Ext.emptyFn,
-
-    // private
-    onDestroy  : Ext.emptyFn,
-
-    /**
-     * <p>Returns the {@link Ext.Element} which encapsulates this Component.</p>
-     * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
-     * that may be overridden using the {@link #autoEl} config.</p>
-     * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
-     * <p>To add listeners for <b>DOM events</b> to this Component (as opposed to listeners
-     * for this Component's own Observable events), see the {@link #listeners} config for a suggestion,
-     * or use a render listener directly:</p><pre><code>
-new Ext.Panel({
-    title: 'The Clickable Panel',
-    listeners: {
-        render: function(p) {
-            // Append the Panel to the click handler&#39;s argument list.
-            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
-        },
-        single: true  // Remove the listener after first invocation
-    }
-});
-</code></pre>
-     * @return {Ext.Element} The Element which encapsulates this Component.
-     */
-    getEl : function(){
-        return this.el;
-    },
-
-    /**
-     * Returns the <code>id</code> of this component or automatically generates and
-     * returns an <code>id</code> if an <code>id</code> is not defined yet:<pre><code>
-     * 'ext-comp-' + (++Ext.Component.AUTO_ID)
-     * </code></pre>
-     * @return {String} id
-     */
-    getId : function(){
-        return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID));
-    },
-
-    /**
-     * Returns the <code>{@link #itemId}</code> of this component.  If an
-     * <code>{@link #itemId}</code> was not assigned through configuration the
-     * <code>id</code> is returned using <code>{@link #getId}</code>.
-     * @return {String}
-     */
-    getItemId : function(){
-        return this.itemId || this.getId();
-    },
-
-    /**
-     * Try to focus this component.
-     * @param {Boolean} selectText (optional) If applicable, true to also select the text in this component
-     * @param {Boolean/Number} delay (optional) Delay the focus this number of milliseconds (true for 10 milliseconds)
-     * @return {Ext.Component} this
-     */
-    focus : function(selectText, delay){
-        if(delay){
-            this.focus.defer(Ext.isNumber(delay) ? delay : 10, this, [selectText, false]);
-            return;
-        }
-        if(this.rendered){
-            this.el.focus();
-            if(selectText === true){
-                this.el.dom.select();
-            }
-        }
-        return this;
-    },
-
-    // private
-    blur : function(){
-        if(this.rendered){
-            this.el.blur();
-        }
-        return this;
-    },
-
-    /**
-     * Disable this component and fire the 'disable' event.
-     * @return {Ext.Component} this
-     */
-    disable : function(/* private */ silent){
-        if(this.rendered){
-            this.onDisable();
-        }
-        this.disabled = true;
-        if(silent !== true){
-            this.fireEvent('disable', this);
-        }
-        return this;
-    },
-
-    // private
-    onDisable : function(){
-        this.getActionEl().addClass(this.disabledClass);
-        this.el.dom.disabled = true;
-    },
-
-    /**
-     * Enable this component and fire the 'enable' event.
-     * @return {Ext.Component} this
-     */
-    enable : function(){
-        if(this.rendered){
-            this.onEnable();
-        }
-        this.disabled = false;
-        this.fireEvent('enable', this);
-        return this;
-    },
-
-    // private
-    onEnable : function(){
-        this.getActionEl().removeClass(this.disabledClass);
-        this.el.dom.disabled = false;
-    },
-
-    /**
-     * Convenience function for setting disabled/enabled by boolean.
-     * @param {Boolean} disabled
-     * @return {Ext.Component} this
-     */
-    setDisabled : function(disabled){
-        return this[disabled ? 'disable' : 'enable']();
-    },
-
-    /**
-     * Show this component.  Listen to the '{@link #beforeshow}' event and return
-     * <tt>false</tt> to cancel showing the component.  Fires the '{@link #show}'
-     * event after showing the component.
-     * @return {Ext.Component} this
-     */
-    show : function(){
-        if(this.fireEvent('beforeshow', this) !== false){
-            this.hidden = false;
-            if(this.autoRender){
-                this.render(Ext.isBoolean(this.autoRender) ? Ext.getBody() : this.autoRender);
-            }
-            if(this.rendered){
-                this.onShow();
-            }
-            this.fireEvent('show', this);
-        }
-        return this;
-    },
-
-    // private
-    onShow : function(){
-        this.getVisibiltyEl().removeClass('x-hide-' + this.hideMode);
-    },
-
-    /**
-     * Hide this component.  Listen to the '{@link #beforehide}' event and return
-     * <tt>false</tt> to cancel hiding the component.  Fires the '{@link #hide}'
-     * event after hiding the component. Note this method is called internally if
-     * the component is configured to be <code>{@link #hidden}</code>.
-     * @return {Ext.Component} this
-     */
-    hide : function(){
-        if(this.fireEvent('beforehide', this) !== false){
-            this.doHide();
-            this.fireEvent('hide', this);
-        }
-        return this;
-    },
-
-    // private
-    doHide: function(){
-        this.hidden = true;
-        if(this.rendered){
-            this.onHide();
-        }
-    },
-
-    // private
-    onHide : function(){
-        this.getVisibiltyEl().addClass('x-hide-' + this.hideMode);
-    },
-
-    // private
-    getVisibiltyEl : function(){
-        return this.hideParent ? this.container : this.getActionEl();
-    },
-
-    /**
-     * Convenience function to hide or show this component by boolean.
-     * @param {Boolean} visible True to show, false to hide
-     * @return {Ext.Component} this
-     */
-    setVisible : function(visible){
-        return this[visible ? 'show' : 'hide']();
-    },
-
-    /**
-     * Returns true if this component is visible.
-     * @return {Boolean} True if this component is visible, false otherwise.
-     */
-    isVisible : function(){
-        return this.rendered && this.getVisibiltyEl().isVisible();
-    },
-
-    /**
-     * Clone the current component using the original config values passed into this instance by default.
-     * @param {Object} overrides A new config containing any properties to override in the cloned version.
-     * An id property can be passed on this object, otherwise one will be generated to avoid duplicates.
-     * @return {Ext.Component} clone The cloned copy of this component
-     */
-    cloneConfig : function(overrides){
-        overrides = overrides || {};
-        var id = overrides.id || Ext.id();
-        var cfg = Ext.applyIf(overrides, this.initialConfig);
-        cfg.id = id; // prevent dup id
-        return new this.constructor(cfg);
-    },
-
-    /**
-     * Gets the xtype for this component as registered with {@link Ext.ComponentMgr}. For a list of all
-     * available xtypes, see the {@link Ext.Component} header. Example usage:
-     * <pre><code>
-var t = new Ext.form.TextField();
-alert(t.getXType());  // alerts 'textfield'
-</code></pre>
-     * @return {String} The xtype
-     */
-    getXType : function(){
-        return this.constructor.xtype;
-    },
-
-    /**
-     * <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
-     * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p>
-     * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
-     * to participate in determination of inherited xtypes.</b></p>
-     * <p>For a list of all available xtypes, see the {@link Ext.Component} header.</p>
-     * <p>Example usage:</p>
-     * <pre><code>
-var t = new Ext.form.TextField();
-var isText = t.isXType('textfield');        // true
-var isBoxSubclass = t.isXType('box');       // true, descended from BoxComponent
-var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
-</code></pre>
-     * @param {String} xtype The xtype to check for this Component
-     * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
-     * the default), or true to check whether this Component is directly of the specified xtype.
-     * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
-     */
-    isXType : function(xtype, shallow){
-        //assume a string by default
-        if (Ext.isFunction(xtype)){
-            xtype = xtype.xtype; //handle being passed the class, e.g. Ext.Component
-        }else if (Ext.isObject(xtype)){
-            xtype = xtype.constructor.xtype; //handle being passed an instance
-        }
-
-        return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : this.constructor.xtype == xtype;
-    },
-
-    /**
-     * <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
-     * available xtypes, see the {@link Ext.Component} header.</p>
-     * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
-     * to participate in determination of inherited xtypes.</b></p>
-     * <p>Example usage:</p>
-     * <pre><code>
-var t = new Ext.form.TextField();
-alert(t.getXTypes());  // alerts 'component/box/field/textfield'
-</code></pre>
-     * @return {String} The xtype hierarchy string
-     */
-    getXTypes : function(){
-        var tc = this.constructor;
-        if(!tc.xtypes){
-            var c = [], sc = this;
-            while(sc && sc.constructor.xtype){
-                c.unshift(sc.constructor.xtype);
-                sc = sc.constructor.superclass;
-            }
-            tc.xtypeChain = c;
-            tc.xtypes = c.join('/');
-        }
-        return tc.xtypes;
-    },
-
-    /**
-     * Find a container above this component at any level by a custom function. If the passed function returns
-     * true, the container will be returned.
-     * @param {Function} fn The custom function to call with the arguments (container, this component).
-     * @return {Ext.Container} The first Container for which the custom function returns true
-     */
-    findParentBy : function(fn) {
-        for (var p = this.ownerCt; (p != null) && !fn(p, this); p = p.ownerCt);
-        return p || null;
-    },
-
-    /**
-     * Find a container above this component at any level by xtype or class
-     * @param {String/Class} xtype The xtype string for a component, or the class of the component directly
-     * @return {Ext.Container} The first Container which matches the given xtype or class
-     */
-    findParentByType : function(xtype) {
-        return Ext.isFunction(xtype) ?
-            this.findParentBy(function(p){
-                return p.constructor === xtype;
-            }) :
-            this.findParentBy(function(p){
-                return p.constructor.xtype === xtype;
-            });
-    },
-
-    getDomPositionEl : function(){
-        return this.getPositionEl ? this.getPositionEl() : this.getEl();
-    },
-
-    // private
-    purgeListeners : function(){
-        Ext.Component.superclass.purgeListeners.call(this);
-        if(this.mons){
-            this.on('beforedestroy', this.clearMons, this, {single: true});
-        }
-    },
-
-    // private
-    clearMons : function(){
-        Ext.each(this.mons, function(m){
-            m.item.un(m.ename, m.fn, m.scope);
-        }, this);
-        this.mons = [];
-    },
-
-    // internal function for auto removal of assigned event handlers on destruction
-    mon : function(item, ename, fn, scope, opt){
-        if(!this.mons){
-            this.mons = [];
-            this.on('beforedestroy', this.clearMons, this, {single: true});
-        }
-
-        if(Ext.isObject(ename)){
-               var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
-
-            var o = ename;
-            for(var e in o){
-                if(propRe.test(e)){
-                    continue;
-                }
-                if(Ext.isFunction(o[e])){
-                    // shared options
-                               this.mons.push({
-                                   item: item, ename: e, fn: o[e], scope: o.scope
-                               });
-                               item.on(e, o[e], o.scope, o);
-                }else{
-                    // individual options
-                               this.mons.push({
-                                   item: item, ename: e, fn: o[e], scope: o.scope
-                               });
-                               item.on(e, o[e]);
-                }
-            }
-            return;
-        }
-
-
-        this.mons.push({
-            item: item, ename: ename, fn: fn, scope: scope
-        });
-        item.on(ename, fn, scope, opt);
-    },
-
-    // protected, opposite of mon
-    mun : function(item, ename, fn, scope){
-        var found, mon;
-        for(var i = 0, len = this.mons.length; i < len; ++i){
-            mon = this.mons[i];
-            if(item === mon.item && ename == mon.ename && fn === mon.fn && scope === mon.scope){
-                this.mons.splice(i, 1);
-                item.un(ename, fn, scope);
-                found = true;
-                break;
-            }
-        }
-        return found;
-    },
-
-    /**
-     * Returns the next component in the owning container
-     * @return Ext.Component
-     */
-    nextSibling : function(){
-        if(this.ownerCt){
-            var index = this.ownerCt.items.indexOf(this);
-            if(index != -1 && index+1 < this.ownerCt.items.getCount()){
-                return this.ownerCt.items.itemAt(index+1);
-            }
-        }
-        return null;
-    },
-
-    /**
-     * Returns the previous component in the owning container
-     * @return Ext.Component
-     */
-    previousSibling : function(){
-        if(this.ownerCt){
-            var index = this.ownerCt.items.indexOf(this);
-            if(index > 0){
-                return this.ownerCt.items.itemAt(index-1);
-            }
-        }
-        return null;
-    },
-
-    /**
-     * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
-     * @return {Ext.Container} the Container which owns this Component.
-     */
-    getBubbleTarget : function(){
-        return this.ownerCt;
-    }
-});
-
-Ext.reg('component', Ext.Component);
-/**\r
- * @class Ext.Action\r
- * <p>An Action is a piece of reusable functionality that can be abstracted out of any particular component so that it\r
- * can be usefully shared among multiple components.  Actions let you share handlers, configuration options and UI\r
- * updates across any components that support the Action interface (primarily {@link Ext.Toolbar}, {@link Ext.Button}\r
- * and {@link Ext.menu.Menu} components).</p>\r
- * <p>Aside from supporting the config object interface, any component that needs to use Actions must also support\r
- * the following method list, as these will be called as needed by the Action class: setText(string), setIconCls(string),\r
- * setDisabled(boolean), setVisible(boolean) and setHandler(function).</p>\r
- * Example usage:<br>\r
- * <pre><code>\r
-// Define the shared action.  Each component below will have the same\r
-// display text and icon, and will display the same message on click.\r
-var action = new Ext.Action({\r
-    {@link #text}: 'Do something',\r
-    {@link #handler}: function(){\r
-        Ext.Msg.alert('Click', 'You did something.');\r
-    },\r
-    {@link #iconCls}: 'do-something',\r
-    {@link #itemId}: 'myAction'\r
-});\r
-\r
-var panel = new Ext.Panel({\r
-    title: 'Actions',\r
-    width: 500,\r
-    height: 300,\r
-    tbar: [\r
-        // Add the action directly to a toolbar as a menu button\r
-        action,\r
-        {\r
-            text: 'Action Menu',\r
-            // Add the action to a menu as a text item\r
-            menu: [action]\r
-        }\r
-    ],\r
-    items: [\r
-        // Add the action to the panel body as a standard button\r
-        new Ext.Button(action)\r
-    ],\r
-    renderTo: Ext.getBody()\r
-});\r
-\r
-// Change the text for all components using the action\r
-action.setText('Something else');\r
-\r
-// Reference an action through a container using the itemId\r
-var btn = panel.getComponent('myAction');\r
-var aRef = btn.baseAction;\r
-aRef.setText('New text');\r
-</code></pre>\r
- * @constructor\r
- * @param {Object} config The configuration options\r
- */\r
-Ext.Action = function(config){\r
-    this.initialConfig = config;\r
-    this.itemId = config.itemId = (config.itemId || config.id || Ext.id());\r
-    this.items = [];\r
-}\r
-\r
-Ext.Action.prototype = {\r
-    /**\r
-     * @cfg {String} text The text to set for all components using this action (defaults to '').\r
-     */\r
-    /**\r
-     * @cfg {String} iconCls\r
-     * The CSS class selector that specifies a background image to be used as the header icon for\r
-     * all components using this action (defaults to '').\r
-     * <p>An example of specifying a custom icon class would be something like:\r
-     * </p><pre><code>\r
-// specify the property in the config for the class:\r
-     ...\r
-     iconCls: 'do-something'\r
-\r
-// css class that specifies background image to be used as the icon image:\r
-.do-something { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }\r
-</code></pre>\r
-     */\r
-    /**\r
-     * @cfg {Boolean} disabled True to disable all components using this action, false to enable them (defaults to false).\r
-     */\r
-    /**\r
-     * @cfg {Boolean} hidden True to hide all components using this action, false to show them (defaults to false).\r
-     */\r
-    /**\r
-     * @cfg {Function} handler The function that will be invoked by each component tied to this action\r
-     * when the component's primary event is triggered (defaults to undefined).\r
-     */\r
-    /**\r
-     * @cfg {String} itemId\r
-     * See {@link Ext.Component}.{@link Ext.Component#itemId itemId}.\r
-     */\r
-    /**\r
-     * @cfg {Object} scope The scope in which the {@link #handler} function will execute.\r
-     */\r
-\r
-    // private\r
-    isAction : true,\r
-\r
-    /**\r
-     * Sets the text to be displayed by all components using this action.\r
-     * @param {String} text The text to display\r
-     */\r
-    setText : function(text){\r
-        this.initialConfig.text = text;\r
-        this.callEach('setText', [text]);\r
-    },\r
-\r
-    /**\r
-     * Gets the text currently displayed by all components using this action.\r
-     */\r
-    getText : function(){\r
-        return this.initialConfig.text;\r
-    },\r
-\r
-    /**\r
-     * Sets the icon CSS class for all components using this action.  The class should supply\r
-     * a background image that will be used as the icon image.\r
-     * @param {String} cls The CSS class supplying the icon image\r
-     */\r
-    setIconClass : function(cls){\r
-        this.initialConfig.iconCls = cls;\r
-        this.callEach('setIconClass', [cls]);\r
-    },\r
-\r
-    /**\r
-     * Gets the icon CSS class currently used by all components using this action.\r
-     */\r
-    getIconClass : function(){\r
-        return this.initialConfig.iconCls;\r
-    },\r
-\r
-    /**\r
-     * Sets the disabled state of all components using this action.  Shortcut method\r
-     * for {@link #enable} and {@link #disable}.\r
-     * @param {Boolean} disabled True to disable the component, false to enable it\r
-     */\r
-    setDisabled : function(v){\r
-        this.initialConfig.disabled = v;\r
-        this.callEach('setDisabled', [v]);\r
-    },\r
-\r
-    /**\r
-     * Enables all components using this action.\r
-     */\r
-    enable : function(){\r
-        this.setDisabled(false);\r
-    },\r
-\r
-    /**\r
-     * Disables all components using this action.\r
-     */\r
-    disable : function(){\r
-        this.setDisabled(true);\r
-    },\r
-\r
-    /**\r
-     * Returns true if the components using this action are currently disabled, else returns false.  \r
-     */\r
-    isDisabled : function(){\r
-        return this.initialConfig.disabled;\r
-    },\r
-\r
-    /**\r
-     * Sets the hidden state of all components using this action.  Shortcut method\r
-     * for <code>{@link #hide}</code> and <code>{@link #show}</code>.\r
-     * @param {Boolean} hidden True to hide the component, false to show it\r
-     */\r
-    setHidden : function(v){\r
-        this.initialConfig.hidden = v;\r
-        this.callEach('setVisible', [!v]);\r
-    },\r
-\r
-    /**\r
-     * Shows all components using this action.\r
-     */\r
-    show : function(){\r
-        this.setHidden(false);\r
-    },\r
-\r
-    /**\r
-     * Hides all components using this action.\r
-     */\r
-    hide : function(){\r
-        this.setHidden(true);\r
-    },\r
-\r
-    /**\r
-     * Returns true if the components using this action are currently hidden, else returns false.  \r
-     */\r
-    isHidden : function(){\r
-        return this.initialConfig.hidden;\r
-    },\r
-\r
-    /**\r
-     * Sets the function that will be called by each component using this action when its primary event is triggered.\r
-     * @param {Function} fn The function that will be invoked by the action's components.  The function\r
-     * will be called with no arguments.\r
-     * @param {Object} scope The scope in which the function will execute\r
-     */\r
-    setHandler : function(fn, scope){\r
-        this.initialConfig.handler = fn;\r
-        this.initialConfig.scope = scope;\r
-        this.callEach('setHandler', [fn, scope]);\r
-    },\r
-\r
-    /**\r
-     * Executes the specified function once for each component currently tied to this action.  The function passed\r
-     * in should accept a single argument that will be an object that supports the basic Action config/method interface.\r
-     * @param {Function} fn The function to execute for each component\r
-     * @param {Object} scope The scope in which the function will execute\r
-     */\r
-    each : function(fn, scope){\r
-        Ext.each(this.items, fn, scope);\r
-    },\r
-\r
-    // private\r
-    callEach : function(fnName, args){\r
-        var cs = this.items;\r
-        for(var i = 0, len = cs.length; i < len; i++){\r
-            cs[i][fnName].apply(cs[i], args);\r
-        }\r
-    },\r
-\r
-    // private\r
-    addComponent : function(comp){\r
-        this.items.push(comp);\r
-        comp.on('destroy', this.removeComponent, this);\r
-    },\r
-\r
-    // private\r
-    removeComponent : function(comp){\r
-        this.items.remove(comp);\r
-    },\r
-\r
-    /**\r
-     * Executes this action manually using the handler function specified in the original config object\r
-     * or the handler function set with <code>{@link #setHandler}</code>.  Any arguments passed to this\r
-     * function will be passed on to the handler function.\r
-     * @param {Mixed} arg1 (optional) Variable number of arguments passed to the handler function\r
-     * @param {Mixed} arg2 (optional)\r
-     * @param {Mixed} etc... (optional)\r
-     */\r
-    execute : function(){\r
-        this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments);\r
-    }\r
-};
-/**
- * @class Ext.Layer
- * @extends Ext.Element
- * An extended {@link Ext.Element} object that supports a shadow and shim, constrain to viewport and
- * automatic maintaining of shadow/shim positions.
- * @cfg {Boolean} shim False to disable the iframe shim in browsers which need one (defaults to true)
- * @cfg {String/Boolean} shadow True to automatically create an {@link Ext.Shadow}, or a string indicating the
- * shadow's display {@link Ext.Shadow#mode}. False to disable the shadow. (defaults to false)
- * @cfg {Object} dh DomHelper object config to create element with (defaults to {tag: 'div', cls: 'x-layer'}).
- * @cfg {Boolean} constrain False to disable constrain to viewport (defaults to true)
- * @cfg {String} cls CSS class to add to the element
- * @cfg {Number} zindex Starting z-index (defaults to 11000)
- * @cfg {Number} shadowOffset Number of pixels to offset the shadow (defaults to 4)
- * @cfg {Boolean} useDisplay
- * Defaults to use css offsets to hide the Layer. Specify <tt>true</tt>
- * to use css style <tt>'display:none;'</tt> to hide the Layer.
- * @constructor
- * @param {Object} config An object with config options.
- * @param {String/HTMLElement} existingEl (optional) Uses an existing DOM element. If the element is not found it creates it.
- */
-(function(){
-Ext.Layer = function(config, existingEl){
-    config = config || {};
-    var dh = Ext.DomHelper;
-    var cp = config.parentEl, pel = cp ? Ext.getDom(cp) : document.body;
-    if(existingEl){
-        this.dom = Ext.getDom(existingEl);
-    }
-    if(!this.dom){
-        var o = config.dh || {tag: 'div', cls: 'x-layer'};
-        this.dom = dh.append(pel, o);
-    }
-    if(config.cls){
-        this.addClass(config.cls);
-    }
-    this.constrain = config.constrain !== false;
-    this.setVisibilityMode(Ext.Element.VISIBILITY);
-    if(config.id){
-        this.id = this.dom.id = config.id;
-    }else{
-        this.id = Ext.id(this.dom);
-    }
-    this.zindex = config.zindex || this.getZIndex();
-    this.position('absolute', this.zindex);
-    if(config.shadow){
-        this.shadowOffset = config.shadowOffset || 4;
-        this.shadow = new Ext.Shadow({
-            offset : this.shadowOffset,
-            mode : config.shadow
-        });
-    }else{
-        this.shadowOffset = 0;
-    }
-    this.useShim = config.shim !== false && Ext.useShims;
-    this.useDisplay = config.useDisplay;
-    this.hide();
-};
-
-var supr = Ext.Element.prototype;
-
-// shims are shared among layer to keep from having 100 iframes
-var shims = [];
-
-Ext.extend(Ext.Layer, Ext.Element, {
-
-    getZIndex : function(){
-        return this.zindex || parseInt((this.getShim() || this).getStyle('z-index'), 10) || 11000;
-    },
-
-    getShim : function(){
-        if(!this.useShim){
-            return null;
-        }
-        if(this.shim){
-            return this.shim;
-        }
-        var shim = shims.shift();
-        if(!shim){
-            shim = this.createShim();
-            shim.enableDisplayMode('block');
-            shim.dom.style.display = 'none';
-            shim.dom.style.visibility = 'visible';
-        }
-        var pn = this.dom.parentNode;
-        if(shim.dom.parentNode != pn){
-            pn.insertBefore(shim.dom, this.dom);
-        }
-        shim.setStyle('z-index', this.getZIndex()-2);
-        this.shim = shim;
-        return shim;
-    },
-
-    hideShim : function(){
-        if(this.shim){
-            this.shim.setDisplayed(false);
-            shims.push(this.shim);
-            delete this.shim;
-        }
-    },
-
-    disableShadow : function(){
-        if(this.shadow){
-            this.shadowDisabled = true;
-            this.shadow.hide();
-            this.lastShadowOffset = this.shadowOffset;
-            this.shadowOffset = 0;
-        }
-    },
-
-    enableShadow : function(show){
-        if(this.shadow){
-            this.shadowDisabled = false;
-            this.shadowOffset = this.lastShadowOffset;
-            delete this.lastShadowOffset;
-            if(show){
-                this.sync(true);
-            }
-        }
-    },
-
-    // private
-    // this code can execute repeatedly in milliseconds (i.e. during a drag) so
-    // code size was sacrificed for effeciency (e.g. no getBox/setBox, no XY calls)
-    sync : function(doShow){
-        var sw = this.shadow;
-        if(!this.updating && this.isVisible() && (sw || this.useShim)){
-            var sh = this.getShim();
-
-            var w = this.getWidth(),
-                h = this.getHeight();
-
-            var l = this.getLeft(true),
-                t = this.getTop(true);
-
-            if(sw && !this.shadowDisabled){
-                if(doShow && !sw.isVisible()){
-                    sw.show(this);
-                }else{
-                    sw.realign(l, t, w, h);
-                }
-                if(sh){
-                    if(doShow){
-                       sh.show();
-                    }
-                    // fit the shim behind the shadow, so it is shimmed too
-                    var a = sw.adjusts, s = sh.dom.style;
-                    s.left = (Math.min(l, l+a.l))+'px';
-                    s.top = (Math.min(t, t+a.t))+'px';
-                    s.width = (w+a.w)+'px';
-                    s.height = (h+a.h)+'px';
-                }
-            }else if(sh){
-                if(doShow){
-                   sh.show();
-                }
-                sh.setSize(w, h);
-                sh.setLeftTop(l, t);
-            }
-
-        }
-    },
-
-    // private
-    destroy : function(){
-        this.hideShim();
-        if(this.shadow){
-            this.shadow.hide();
-        }
-        this.removeAllListeners();
-        Ext.removeNode(this.dom);
-        Ext.Element.uncache(this.id);
-    },
-
-    remove : function(){
-        this.destroy();
-    },
-
-    // private
-    beginUpdate : function(){
-        this.updating = true;
-    },
-
-    // private
-    endUpdate : function(){
-        this.updating = false;
-        this.sync(true);
-    },
-
-    // private
-    hideUnders : function(negOffset){
-        if(this.shadow){
-            this.shadow.hide();
-        }
-        this.hideShim();
-    },
-
-    // private
-    constrainXY : function(){
-        if(this.constrain){
-            var vw = Ext.lib.Dom.getViewWidth(),
-                vh = Ext.lib.Dom.getViewHeight();
-            var s = Ext.getDoc().getScroll();
-
-            var xy = this.getXY();
-            var x = xy[0], y = xy[1];
-            var so = this.shadowOffset;
-            var w = this.dom.offsetWidth+so, h = this.dom.offsetHeight+so;
-            // only move it if it needs it
-            var moved = false;
-            // first validate right/bottom
-            if((x + w) > vw+s.left){
-                x = vw - w - so;
-                moved = true;
-            }
-            if((y + h) > vh+s.top){
-                y = vh - h - so;
-                moved = true;
-            }
-            // then make sure top/left isn't negative
-            if(x < s.left){
-                x = s.left;
-                moved = true;
-            }
-            if(y < s.top){
-                y = s.top;
-                moved = true;
-            }
-            if(moved){
-                if(this.avoidY){
-                    var ay = this.avoidY;
-                    if(y <= ay && (y+h) >= ay){
-                        y = ay-h-5;
-                    }
-                }
-                xy = [x, y];
-                this.storeXY(xy);
-                supr.setXY.call(this, xy);
-                this.sync();
-            }
-        }
-        return this;
-    },
-
-    isVisible : function(){
-        return this.visible;
-    },
-
-    // private
-    showAction : function(){
-        this.visible = true; // track visibility to prevent getStyle calls
-        if(this.useDisplay === true){
-            this.setDisplayed('');
-        }else if(this.lastXY){
-            supr.setXY.call(this, this.lastXY);
-        }else if(this.lastLT){
-            supr.setLeftTop.call(this, this.lastLT[0], this.lastLT[1]);
-        }
-    },
-
-    // private
-    hideAction : function(){
-        this.visible = false;
-        if(this.useDisplay === true){
-            this.setDisplayed(false);
-        }else{
-            this.setLeftTop(-10000,-10000);
-        }
-    },
-
-    // overridden Element method
-    setVisible : function(v, a, d, c, e){
-        if(v){
-            this.showAction();
-        }
-        if(a && v){
-            var cb = function(){
-                this.sync(true);
-                if(c){
-                    c();
-                }
-            }.createDelegate(this);
-            supr.setVisible.call(this, true, true, d, cb, e);
-        }else{
-            if(!v){
-                this.hideUnders(true);
-            }
-            var cb = c;
-            if(a){
-                cb = function(){
-                    this.hideAction();
-                    if(c){
-                        c();
-                    }
-                }.createDelegate(this);
-            }
-            supr.setVisible.call(this, v, a, d, cb, e);
-            if(v){
-                this.sync(true);
-            }else if(!a){
-                this.hideAction();
-            }
-        }
-        return this;
-    },
-
-    storeXY : function(xy){
-        delete this.lastLT;
-        this.lastXY = xy;
-    },
-
-    storeLeftTop : function(left, top){
-        delete this.lastXY;
-        this.lastLT = [left, top];
-    },
-
-    // private
-    beforeFx : function(){
-        this.beforeAction();
-        return Ext.Layer.superclass.beforeFx.apply(this, arguments);
-    },
-
-    // private
-    afterFx : function(){
-        Ext.Layer.superclass.afterFx.apply(this, arguments);
-        this.sync(this.isVisible());
-    },
-
-    // private
-    beforeAction : function(){
-        if(!this.updating && this.shadow){
-            this.shadow.hide();
-        }
-    },
-
-    // overridden Element method
-    setLeft : function(left){
-        this.storeLeftTop(left, this.getTop(true));
-        supr.setLeft.apply(this, arguments);
-        this.sync();
-        return this;
-    },
-
-    setTop : function(top){
-        this.storeLeftTop(this.getLeft(true), top);
-        supr.setTop.apply(this, arguments);
-        this.sync();
-        return this;
-    },
-
-    setLeftTop : function(left, top){
-        this.storeLeftTop(left, top);
-        supr.setLeftTop.apply(this, arguments);
-        this.sync();
-        return this;
-    },
-
-    setXY : function(xy, a, d, c, e){
-        this.fixDisplay();
-        this.beforeAction();
-        this.storeXY(xy);
-        var cb = this.createCB(c);
-        supr.setXY.call(this, xy, a, d, cb, e);
-        if(!a){
-            cb();
-        }
-        return this;
-    },
-
-    // private
-    createCB : function(c){
-        var el = this;
-        return function(){
-            el.constrainXY();
-            el.sync(true);
-            if(c){
-                c();
-            }
-        };
-    },
-
-    // overridden Element method
-    setX : function(x, a, d, c, e){
-        this.setXY([x, this.getY()], a, d, c, e);
-        return this;
-    },
-
-    // overridden Element method
-    setY : function(y, a, d, c, e){
-        this.setXY([this.getX(), y], a, d, c, e);
-        return this;
-    },
-
-    // overridden Element method
-    setSize : function(w, h, a, d, c, e){
-        this.beforeAction();
-        var cb = this.createCB(c);
-        supr.setSize.call(this, w, h, a, d, cb, e);
-        if(!a){
-            cb();
-        }
-        return this;
-    },
-
-    // overridden Element method
-    setWidth : function(w, a, d, c, e){
-        this.beforeAction();
-        var cb = this.createCB(c);
-        supr.setWidth.call(this, w, a, d, cb, e);
-        if(!a){
-            cb();
-        }
-        return this;
-    },
-
-    // overridden Element method
-    setHeight : function(h, a, d, c, e){
-        this.beforeAction();
-        var cb = this.createCB(c);
-        supr.setHeight.call(this, h, a, d, cb, e);
-        if(!a){
-            cb();
-        }
-        return this;
-    },
-
-    // overridden Element method
-    setBounds : function(x, y, w, h, a, d, c, e){
-        this.beforeAction();
-        var cb = this.createCB(c);
-        if(!a){
-            this.storeXY([x, y]);
-            supr.setXY.call(this, [x, y]);
-            supr.setSize.call(this, w, h, a, d, cb, e);
-            cb();
-        }else{
-            supr.setBounds.call(this, x, y, w, h, a, d, cb, e);
-        }
-        return this;
-    },
-
-    /**
-     * Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
-     * incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow
-     * element, if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index).
-     * @param {Number} zindex The new z-index to set
-     * @return {this} The Layer
-     */
-    setZIndex : function(zindex){
-        this.zindex = zindex;
-        this.setStyle('z-index', zindex + 2);
-        if(this.shadow){
-            this.shadow.setZIndex(zindex + 1);
-        }
-        if(this.shim){
-            this.shim.setStyle('z-index', zindex);
-        }
-        return this;
-    }
-});
-})();/**
- * @class Ext.Shadow
- * Simple class that can provide a shadow effect for any element.  Note that the element MUST be absolutely positioned,
- * and the shadow does not provide any shimming.  This should be used only in simple cases -- for more advanced
- * functionality that can also provide the same shadow effect, see the {@link Ext.Layer} class.
- * @constructor
- * Create a new Shadow
- * @param {Object} config The config object
- */
-Ext.Shadow = function(config){
-    Ext.apply(this, config);
-    if(typeof this.mode != "string"){
-        this.mode = this.defaultMode;
-    }
-    var o = this.offset, a = {h: 0};
-    var rad = Math.floor(this.offset/2);
-    switch(this.mode.toLowerCase()){ // all this hideous nonsense calculates the various offsets for shadows
-        case "drop":
-            a.w = 0;
-            a.l = a.t = o;
-            a.t -= 1;
-            if(Ext.isIE){
-                a.l -= this.offset + rad;
-                a.t -= this.offset + rad;
-                a.w -= rad;
-                a.h -= rad;
-                a.t += 1;
-            }
-        break;
-        case "sides":
-            a.w = (o*2);
-            a.l = -o;
-            a.t = o-1;
-            if(Ext.isIE){
-                a.l -= (this.offset - rad);
-                a.t -= this.offset + rad;
-                a.l += 1;
-                a.w -= (this.offset - rad)*2;
-                a.w -= rad + 1;
-                a.h -= 1;
-            }
-        break;
-        case "frame":
-            a.w = a.h = (o*2);
-            a.l = a.t = -o;
-            a.t += 1;
-            a.h -= 2;
-            if(Ext.isIE){
-                a.l -= (this.offset - rad);
-                a.t -= (this.offset - rad);
-                a.l += 1;
-                a.w -= (this.offset + rad + 1);
-                a.h -= (this.offset + rad);
-                a.h += 1;
-            }
-        break;
-    };
-
-    this.adjusts = a;
-};
-
-Ext.Shadow.prototype = {
-    /**
-     * @cfg {String} mode
-     * The shadow display mode.  Supports the following options:<div class="mdetail-params"><ul>
-     * <li><b><tt>sides</tt></b> : Shadow displays on both sides and bottom only</li>
-     * <li><b><tt>frame</tt></b> : Shadow displays equally on all four sides</li>
-     * <li><b><tt>drop</tt></b> : Traditional bottom-right drop shadow</li>
-     * </ul></div>
-     */
-    /**
-     * @cfg {String} offset
-     * The number of pixels to offset the shadow from the element (defaults to <tt>4</tt>)
-     */
-    offset: 4,
-
-    // private
-    defaultMode: "drop",
-
-    /**
-     * Displays the shadow under the target element
-     * @param {Mixed} targetEl The id or element under which the shadow should display
-     */
-    show : function(target){
-        target = Ext.get(target);
-        if(!this.el){
-            this.el = Ext.Shadow.Pool.pull();
-            if(this.el.dom.nextSibling != target.dom){
-                this.el.insertBefore(target);
-            }
-        }
-        this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10)-1);
-        if(Ext.isIE){
-            this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";
-        }
-        this.realign(
-            target.getLeft(true),
-            target.getTop(true),
-            target.getWidth(),
-            target.getHeight()
-        );
-        this.el.dom.style.display = "block";
-    },
-
-    /**
-     * Returns true if the shadow is visible, else false
-     */
-    isVisible : function(){
-        return this.el ? true : false;  
-    },
-
-    /**
-     * Direct alignment when values are already available. Show must be called at least once before
-     * calling this method to ensure it is initialized.
-     * @param {Number} left The target element left position
-     * @param {Number} top The target element top position
-     * @param {Number} width The target element width
-     * @param {Number} height The target element height
-     */
-    realign : function(l, t, w, h){
-        if(!this.el){
-            return;
-        }
-        var a = this.adjusts, d = this.el.dom, s = d.style;
-        var iea = 0;
-        s.left = (l+a.l)+"px";
-        s.top = (t+a.t)+"px";
-        var sw = (w+a.w), sh = (h+a.h), sws = sw +"px", shs = sh + "px";
-        if(s.width != sws || s.height != shs){
-            s.width = sws;
-            s.height = shs;
-            if(!Ext.isIE){
-                var cn = d.childNodes;
-                var sww = Math.max(0, (sw-12))+"px";
-                cn[0].childNodes[1].style.width = sww;
-                cn[1].childNodes[1].style.width = sww;
-                cn[2].childNodes[1].style.width = sww;
-                cn[1].style.height = Math.max(0, (sh-12))+"px";
-            }
-        }
-    },
-
-    /**
-     * Hides this shadow
-     */
-    hide : function(){
-        if(this.el){
-            this.el.dom.style.display = "none";
-            Ext.Shadow.Pool.push(this.el);
-            delete this.el;
-        }
-    },
-
-    /**
-     * Adjust the z-index of this shadow
-     * @param {Number} zindex The new z-index
-     */
-    setZIndex : function(z){
-        this.zIndex = z;
-        if(this.el){
-            this.el.setStyle("z-index", z);
-        }
-    }
-};
-
-// Private utility class that manages the internal Shadow cache
-Ext.Shadow.Pool = function(){
-    var p = [];
-    var markup = Ext.isIE ?
-                 '<div class="x-ie-shadow"></div>' :
-                 '<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
-    return {
-        pull : function(){
-            var sh = p.shift();
-            if(!sh){
-                sh = Ext.get(Ext.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup));
-                sh.autoBoxAdjust = false;
-            }
-            return sh;
-        },
-
-        push : function(sh){
-            p.push(sh);
-        }
-    };
-}();/**
- * @class Ext.BoxComponent
- * @extends Ext.Component
- * <p>Base class for any {@link Ext.Component Component} that is to be sized as a box, using width and height.</p>
- * <p>BoxComponent provides automatic box model adjustments for sizing and positioning and will work correctly
- * within the Component rendering model.</p>
- * <p>A BoxComponent may be created as a custom Component which encapsulates any HTML element, either a pre-existing
- * element, or one that is created to your specifications at render time. Usually, to participate in layouts,
- * a Component will need to be a <b>Box</b>Component in order to have its width and height managed.</p>
- * <p>To use a pre-existing element as a BoxComponent, configure it so that you preset the <b>el</b> property to the
- * element to reference:<pre><code>
-var pageHeader = new Ext.BoxComponent({
-    el: 'my-header-div'
-});</code></pre>
- * This may then be {@link Ext.Container#add added} to a {@link Ext.Container Container} as a child item.</p>
- * <p>To create a BoxComponent based around a HTML element to be created at render time, use the
- * {@link Ext.Component#autoEl autoEl} config option which takes the form of a
- * {@link Ext.DomHelper DomHelper} specification:<pre><code>
-var myImage = new Ext.BoxComponent({
-    autoEl: {
-        tag: 'img',
-        src: '/images/my-image.jpg'
-    }
-});</code></pre></p>
- * @constructor
- * @param {Ext.Element/String/Object} config The configuration options.
- * @xtype box
- */
-Ext.BoxComponent = Ext.extend(Ext.Component, {
-
-    // Configs below are used for all Components when rendered by BorderLayout.
-    /**
-     * @cfg {String} region <p><b>Note</b>: this config is only used when this BoxComponent is rendered
-     * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
-     * layout manager (e.g. specifying <tt>layout:'border'</tt>).</p><br>
-     * <p>See {@link Ext.layout.BorderLayout} also.</p>
-     */
-    // margins config is used when a BoxComponent is rendered by BorderLayout or BoxLayout.
-    /**
-     * @cfg {Object} margins <p><b>Note</b>: this config is only used when this BoxComponent is rendered
-     * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
-     * or one of the two <b>{@link Ext.layout.BoxLayout BoxLayout} subclasses.</b></p>
-     * <p>An object containing margins to apply to this BoxComponent in the
-     * format:</p><pre><code>
-{
-    top: (top margin),
-    right: (right margin),
-    bottom: (bottom margin),
-    left: (left margin)
-}</code></pre>
-     * <p>May also be a string containing space-separated, numeric margin values. The order of the
-     * sides associated with each value matches the way CSS processes margin values:</p>
-     * <p><div class="mdetail-params"><ul>
-     * <li>If there is only one value, it applies to all sides.</li>
-     * <li>If there are two values, the top and bottom borders are set to the first value and the
-     * right and left are set to the second.</li>
-     * <li>If there are three values, the top is set to the first value, the left and right are set
-     * to the second, and the bottom is set to the third.</li>
-     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
-     * </ul></div></p>
-     * <p>Defaults to:</p><pre><code>
-     * {top:0, right:0, bottom:0, left:0}
-     * </code></pre>
-     */
-    /**
-     * @cfg {Number} x
-     * The local x (left) coordinate for this component if contained within a positioning container.
-     */
-    /**
-     * @cfg {Number} y
-     * The local y (top) coordinate for this component if contained within a positioning container.
-     */
-    /**
-     * @cfg {Number} pageX
-     * The page level x coordinate for this component if contained within a positioning container.
-     */
-    /**
-     * @cfg {Number} pageY
-     * The page level y coordinate for this component if contained within a positioning container.
-     */
-    /**
-     * @cfg {Number} height
-     * The height of this component in pixels (defaults to auto).
-     * <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
-     */
-    /**
-     * @cfg {Number} width
-     * The width of this component in pixels (defaults to auto).
-     * <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
-     */
-    /**
-     * @cfg {Boolean} autoHeight
-     * <p>True to use height:'auto', false to use fixed height (or allow it to be managed by its parent
-     * Container's {@link Ext.Container#layout layout manager}. Defaults to false.</p>
-     * <p><b>Note</b>: Although many components inherit this config option, not all will
-     * function as expected with a height of 'auto'. Setting autoHeight:true means that the
-     * browser will manage height based on the element's contents, and that Ext will not manage it at all.</p>
-     * <p>If the <i>browser</i> is managing the height, be aware that resizes performed by the browser in response
-     * to changes within the structure of the Component cannot be detected. Therefore changes to the height might
-     * result in elements needing to be synchronized with the new height. Example:</p><pre><code>
-var w = new Ext.Window({
-    title: 'Window',
-    width: 600,
-    autoHeight: true,
-    items: {
-        title: 'Collapse Me',
-        height: 400,
-        collapsible: true,
-        border: false,
-        listeners: {
-            beforecollapse: function() {
-                w.el.shadow.hide();
-            },
-            beforeexpand: function() {
-                w.el.shadow.hide();
-            },
-            collapse: function() {
-                w.syncShadow();
-            },
-            expand: function() {
-                w.syncShadow();
-            }
-        }
-    }
-}).show();
-</code></pre>
-     */
-    /**
-     * @cfg {Boolean} autoWidth
-     * <p>True to use width:'auto', false to use fixed width (or allow it to be managed by its parent
-     * Container's {@link Ext.Container#layout layout manager}. Defaults to false.</p>
-     * <p><b>Note</b>: Although many components  inherit this config option, not all will
-     * function as expected with a width of 'auto'. Setting autoWidth:true means that the
-     * browser will manage width based on the element's contents, and that Ext will not manage it at all.</p>
-     * <p>If the <i>browser</i> is managing the width, be aware that resizes performed by the browser in response
-     * to changes within the structure of the Component cannot be detected. Therefore changes to the width might
-     * result in elements needing to be synchronized with the new width. For example, where the target element is:</p><pre><code>
-&lt;div id='grid-container' style='margin-left:25%;width:50%'>&lt;/div>
-</code></pre>
-     * A Panel rendered into that target element must listen for browser window resize in order to relay its
-      * child items when the browser changes its width:<pre><code>
-var myPanel = new Ext.Panel({
-    renderTo: 'grid-container',
-    monitorResize: true, // relay on browser resize
-    title: 'Panel',
-    height: 400,
-    autoWidth: true,
-    layout: 'hbox',
-    layoutConfig: {
-        align: 'stretch'
-    },
-    defaults: {
-        flex: 1
-    },
-    items: [{
-        title: 'Box 1',
-    }, {
-        title: 'Box 2'
-    }, {
-        title: 'Box 3'
-    }],
-});
-</code></pre>
-     */
-
-    /* // private internal config
-     * {Boolean} deferHeight
-     * True to defer height calculations to an external component, false to allow this component to set its own
-     * height (defaults to false).
-     */
-
-    // private
-    initComponent : function(){
-        Ext.BoxComponent.superclass.initComponent.call(this);
-        this.addEvents(
-            /**
-             * @event resize
-             * Fires after the component is resized.
-             * @param {Ext.Component} this
-             * @param {Number} adjWidth The box-adjusted width that was set
-             * @param {Number} adjHeight The box-adjusted height that was set
-             * @param {Number} rawWidth The width that was originally specified
-             * @param {Number} rawHeight The height that was originally specified
-             */
-            'resize',
-            /**
-             * @event move
-             * Fires after the component is moved.
-             * @param {Ext.Component} this
-             * @param {Number} x The new x position
-             * @param {Number} y The new y position
-             */
-            'move'
-        );
-    },
-
-    // private, set in afterRender to signify that the component has been rendered
-    boxReady : false,
-    // private, used to defer height settings to subclasses
-    deferHeight: false,
-
-    /**
-     * Sets the width and height of this BoxComponent. This method fires the {@link #resize} event. This method can accept
-     * either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.
-     * @param {Mixed} width The new width to set. This may be one of:<div class="mdetail-params"><ul>
-     * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
-     * <li>A String used to set the CSS width style.</li>
-     * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
-     * <li><code>undefined</code> to leave the width unchanged.</li>
-     * </ul></div>
-     * @param {Mixed} height The new height to set (not required if a size object is passed as the first arg).
-     * This may be one of:<div class="mdetail-params"><ul>
-     * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
-     * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
-     * <li><code>undefined</code> to leave the height unchanged.</li>
-     * </ul></div>
-     * @return {Ext.BoxComponent} this
-     */
-    setSize : function(w, h){
-        // support for standard size objects
-        if(typeof w == 'object'){
-            h = w.height;
-            w = w.width;
-        }
-        // not rendered
-        if(!this.boxReady){
-            this.width = w;
-            this.height = h;
-            return this;
-        }
-
-        // prevent recalcs when not needed
-        if(this.cacheSizes !== false && this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
-            return this;
-        }
-        this.lastSize = {width: w, height: h};
-        var adj = this.adjustSize(w, h);
-        var aw = adj.width, ah = adj.height;
-        if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
-            var rz = this.getResizeEl();
-            if(!this.deferHeight && aw !== undefined && ah !== undefined){
-                rz.setSize(aw, ah);
-            }else if(!this.deferHeight && ah !== undefined){
-                rz.setHeight(ah);
-            }else if(aw !== undefined){
-                rz.setWidth(aw);
-            }
-            this.onResize(aw, ah, w, h);
-            this.fireEvent('resize', this, aw, ah, w, h);
-        }
-        return this;
-    },
-
-    /**
-     * Sets the width of the component.  This method fires the {@link #resize} event.
-     * @param {Number} width The new width to setThis may be one of:<div class="mdetail-params"><ul>
-     * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
-     * <li>A String used to set the CSS width style.</li>
-     * </ul></div>
-     * @return {Ext.BoxComponent} this
-     */
-    setWidth : function(width){
-        return this.setSize(width);
-    },
-
-    /**
-     * Sets the height of the component.  This method fires the {@link #resize} event.
-     * @param {Number} height The new height to set. This may be one of:<div class="mdetail-params"><ul>
-     * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
-     * <li>A String used to set the CSS height style.</li>
-     * <li><i>undefined</i> to leave the height unchanged.</li>
-     * </ul></div>
-     * @return {Ext.BoxComponent} this
-     */
-    setHeight : function(height){
-        return this.setSize(undefined, height);
-    },
-
-    /**
-     * Gets the current size of the component's underlying element.
-     * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
-     */
-    getSize : function(){
-        return this.getResizeEl().getSize();
-    },
-
-    /**
-     * Gets the current width of the component's underlying element.
-     * @return {Number}
-     */
-    getWidth : function(){
-        return this.getResizeEl().getWidth();
-    },
-
-    /**
-     * Gets the current height of the component's underlying element.
-     * @return {Number}
-     */
-    getHeight : function(){
-        return this.getResizeEl().getHeight();
-    },
-
-    /**
-     * Gets the current size of the component's underlying element, including space taken by its margins.
-     * @return {Object} An object containing the element's size {width: (element width + left/right margins), height: (element height + top/bottom margins)}
-     */
-    getOuterSize : function(){
-        var el = this.getResizeEl();
-        return {width: el.getWidth() + el.getMargins('lr'),
-                height: el.getHeight() + el.getMargins('tb')};
-    },
-
-    /**
-     * Gets the current XY position of the component's underlying element.
-     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
-     * @return {Array} The XY position of the element (e.g., [100, 200])
-     */
-    getPosition : function(local){
-        var el = this.getPositionEl();
-        if(local === true){
-            return [el.getLeft(true), el.getTop(true)];
-        }
-        return this.xy || el.getXY();
-    },
-
-    /**
-     * Gets the current box measurements of the component's underlying element.
-     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
-     * @return {Object} box An object in the format {x, y, width, height}
-     */
-    getBox : function(local){
-        var pos = this.getPosition(local);
-        var s = this.getSize();
-        s.x = pos[0];
-        s.y = pos[1];
-        return s;
-    },
-
-    /**
-     * Sets the current box measurements of the component's underlying element.
-     * @param {Object} box An object in the format {x, y, width, height}
-     * @return {Ext.BoxComponent} this
-     */
-    updateBox : function(box){
-        this.setSize(box.width, box.height);
-        this.setPagePosition(box.x, box.y);
-        return this;
-    },
-
-    /**
-     * <p>Returns the outermost Element of this Component which defines the Components overall size.</p>
-     * <p><i>Usually</i> this will return the same Element as <code>{@link #getEl}</code>,
-     * but in some cases, a Component may have some more wrapping Elements around its main
-     * active Element.</p>
-     * <p>An example is a ComboBox. It is encased in a <i>wrapping</i> Element which
-     * contains both the <code>&lt;input></code> Element (which is what would be returned
-     * by its <code>{@link #getEl}</code> method, <i>and</i> the trigger button Element.
-     * This Element is returned as the <code>resizeEl</code>.
-     */
-    getResizeEl : function(){
-        return this.resizeEl || this.el;
-    },
-
-    // protected
-    getPositionEl : function(){
-        return this.positionEl || this.el;
-    },
-
-    /**
-     * Sets the left and top of the component.  To set the page XY position instead, use {@link #setPagePosition}.
-     * This method fires the {@link #move} event.
-     * @param {Number} left The new left
-     * @param {Number} top The new top
-     * @return {Ext.BoxComponent} this
-     */
-    setPosition : function(x, y){
-        if(x && typeof x[1] == 'number'){
-            y = x[1];
-            x = x[0];
-        }
-        this.x = x;
-        this.y = y;
-        if(!this.boxReady){
-            return this;
-        }
-        var adj = this.adjustPosition(x, y);
-        var ax = adj.x, ay = adj.y;
-
-        var el = this.getPositionEl();
-        if(ax !== undefined || ay !== undefined){
-            if(ax !== undefined && ay !== undefined){
-                el.setLeftTop(ax, ay);
-            }else if(ax !== undefined){
-                el.setLeft(ax);
-            }else if(ay !== undefined){
-                el.setTop(ay);
-            }
-            this.onPosition(ax, ay);
-            this.fireEvent('move', this, ax, ay);
-        }
-        return this;
-    },
-
-    /**
-     * Sets the page XY position of the component.  To set the left and top instead, use {@link #setPosition}.
-     * This method fires the {@link #move} event.
-     * @param {Number} x The new x position
-     * @param {Number} y The new y position
-     * @return {Ext.BoxComponent} this
-     */
-    setPagePosition : function(x, y){
-        if(x && typeof x[1] == 'number'){
-            y = x[1];
-            x = x[0];
-        }
-        this.pageX = x;
-        this.pageY = y;
-        if(!this.boxReady){
-            return;
-        }
-        if(x === undefined || y === undefined){ // cannot translate undefined points
-            return;
-        }
-        var p = this.getPositionEl().translatePoints(x, y);
-        this.setPosition(p.left, p.top);
-        return this;
-    },
-
-    // private
-    onRender : function(ct, position){
-        Ext.BoxComponent.superclass.onRender.call(this, ct, position);
-        if(this.resizeEl){
-            this.resizeEl = Ext.get(this.resizeEl);
-        }
-        if(this.positionEl){
-            this.positionEl = Ext.get(this.positionEl);
-        }
-    },
-
-    // private
-    afterRender : function(){
-        Ext.BoxComponent.superclass.afterRender.call(this);
-        this.boxReady = true;
-        this.setSize(this.width, this.height);
-        if(this.x || this.y){
-            this.setPosition(this.x, this.y);
-        }else if(this.pageX || this.pageY){
-            this.setPagePosition(this.pageX, this.pageY);
-        }
-    },
-
-    /**
-     * Force the component's size to recalculate based on the underlying element's current height and width.
-     * @return {Ext.BoxComponent} this
-     */
-    syncSize : function(){
-        delete this.lastSize;
-        this.setSize(this.autoWidth ? undefined : this.getResizeEl().getWidth(), this.autoHeight ? undefined : this.getResizeEl().getHeight());
-        return this;
-    },
-
-    /* // protected
-     * Called after the component is resized, this method is empty by default but can be implemented by any
-     * subclass that needs to perform custom logic after a resize occurs.
-     * @param {Number} adjWidth The box-adjusted width that was set
-     * @param {Number} adjHeight The box-adjusted height that was set
-     * @param {Number} rawWidth The width that was originally specified
-     * @param {Number} rawHeight The height that was originally specified
-     */
-    onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
-
-    },
-
-    /* // protected
-     * Called after the component is moved, this method is empty by default but can be implemented by any
-     * subclass that needs to perform custom logic after a move occurs.
-     * @param {Number} x The new x position
-     * @param {Number} y The new y position
-     */
-    onPosition : function(x, y){
-
-    },
-
-    // private
-    adjustSize : function(w, h){
-        if(this.autoWidth){
-            w = 'auto';
-        }
-        if(this.autoHeight){
-            h = 'auto';
-        }
-        return {width : w, height: h};
-    },
-
-    // private
-    adjustPosition : function(x, y){
-        return {x : x, y: y};
-    }
-});
-Ext.reg('box', Ext.BoxComponent);
-
-
-/**
- * @class Ext.Spacer
- * @extends Ext.BoxComponent
- * <p>Used to provide a sizable space in a layout.</p>
- * @constructor
- * @param {Object} config
- */
-Ext.Spacer = Ext.extend(Ext.BoxComponent, {
-    autoEl:'div'
-});
-Ext.reg('spacer', Ext.Spacer);/**\r
- * @class Ext.SplitBar\r
- * @extends Ext.util.Observable\r
- * Creates draggable splitter bar functionality from two elements (element to be dragged and element to be resized).\r
- * <br><br>\r
- * Usage:\r
- * <pre><code>\r
-var split = new Ext.SplitBar("elementToDrag", "elementToSize",\r
-                   Ext.SplitBar.HORIZONTAL, Ext.SplitBar.LEFT);\r
-split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));\r
-split.minSize = 100;\r
-split.maxSize = 600;\r
-split.animate = true;\r
-split.on('moved', splitterMoved);\r
-</code></pre>\r
- * @constructor\r
- * Create a new SplitBar\r
- * @param {Mixed} dragElement The element to be dragged and act as the SplitBar.\r
- * @param {Mixed} resizingElement The element to be resized based on where the SplitBar element is dragged\r
- * @param {Number} orientation (optional) Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)\r
- * @param {Number} placement (optional) Either Ext.SplitBar.LEFT or Ext.SplitBar.RIGHT for horizontal or  \r
-                        Ext.SplitBar.TOP or Ext.SplitBar.BOTTOM for vertical. (By default, this is determined automatically by the initial\r
-                        position of the SplitBar).\r
- */\r
-Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){\r
-    \r
-    /** @private */\r
-    this.el = Ext.get(dragElement, true);\r
-    this.el.dom.unselectable = "on";\r
-    /** @private */\r
-    this.resizingEl = Ext.get(resizingElement, true);\r
-\r
-    /**\r
-     * @private\r
-     * The orientation of the split. Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)\r
-     * Note: If this is changed after creating the SplitBar, the placement property must be manually updated\r
-     * @type Number\r
-     */\r
-    this.orientation = orientation || Ext.SplitBar.HORIZONTAL;\r
-    \r
-    /**\r
-     * The increment, in pixels by which to move this SplitBar. When <i>undefined</i>, the SplitBar moves smoothly.\r
-     * @type Number\r
-     * @property tickSize\r
-     */\r
-    /**\r
-     * The minimum size of the resizing element. (Defaults to 0)\r
-     * @type Number\r
-     */\r
-    this.minSize = 0;\r
-    \r
-    /**\r
-     * The maximum size of the resizing element. (Defaults to 2000)\r
-     * @type Number\r
-     */\r
-    this.maxSize = 2000;\r
-    \r
-    /**\r
-     * Whether to animate the transition to the new size\r
-     * @type Boolean\r
-     */\r
-    this.animate = false;\r
-    \r
-    /**\r
-     * Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes.\r
-     * @type Boolean\r
-     */\r
-    this.useShim = false;\r
-    \r
-    /** @private */\r
-    this.shim = null;\r
-    \r
-    if(!existingProxy){\r
-        /** @private */\r
-        this.proxy = Ext.SplitBar.createProxy(this.orientation);\r
-    }else{\r
-        this.proxy = Ext.get(existingProxy).dom;\r
-    }\r
-    /** @private */\r
-    this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id});\r
-    \r
-    /** @private */\r
-    this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this);\r
-    \r
-    /** @private */\r
-    this.dd.endDrag = this.onEndProxyDrag.createDelegate(this);\r
-    \r
-    /** @private */\r
-    this.dragSpecs = {};\r
-    \r
-    /**\r
-     * @private The adapter to use to positon and resize elements\r
-     */\r
-    this.adapter = new Ext.SplitBar.BasicLayoutAdapter();\r
-    this.adapter.init(this);\r
-    \r
-    if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
-        /** @private */\r
-        this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT);\r
-        this.el.addClass("x-splitbar-h");\r
-    }else{\r
-        /** @private */\r
-        this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM);\r
-        this.el.addClass("x-splitbar-v");\r
-    }\r
-    \r
-    this.addEvents(\r
-        /**\r
-         * @event resize\r
-         * Fires when the splitter is moved (alias for {@link #moved})\r
-         * @param {Ext.SplitBar} this\r
-         * @param {Number} newSize the new width or height\r
-         */\r
-        "resize",\r
-        /**\r
-         * @event moved\r
-         * Fires when the splitter is moved\r
-         * @param {Ext.SplitBar} this\r
-         * @param {Number} newSize the new width or height\r
-         */\r
-        "moved",\r
-        /**\r
-         * @event beforeresize\r
-         * Fires before the splitter is dragged\r
-         * @param {Ext.SplitBar} this\r
-         */\r
-        "beforeresize",\r
-\r
-        "beforeapply"\r
-    );\r
-\r
-    Ext.SplitBar.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.SplitBar, Ext.util.Observable, {\r
-    onStartProxyDrag : function(x, y){\r
-        this.fireEvent("beforeresize", this);\r
-        this.overlay =  Ext.DomHelper.append(document.body,  {cls: "x-drag-overlay", html: "&#160;"}, true);\r
-        this.overlay.unselectable();\r
-        this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));\r
-        this.overlay.show();\r
-        Ext.get(this.proxy).setDisplayed("block");\r
-        var size = this.adapter.getElementSize(this);\r
-        this.activeMinSize = this.getMinimumSize();\r
-        this.activeMaxSize = this.getMaximumSize();\r
-        var c1 = size - this.activeMinSize;\r
-        var c2 = Math.max(this.activeMaxSize - size, 0);\r
-        if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
-            this.dd.resetConstraints();\r
-            this.dd.setXConstraint(\r
-                this.placement == Ext.SplitBar.LEFT ? c1 : c2, \r
-                this.placement == Ext.SplitBar.LEFT ? c2 : c1,\r
-                this.tickSize\r
-            );\r
-            this.dd.setYConstraint(0, 0);\r
-        }else{\r
-            this.dd.resetConstraints();\r
-            this.dd.setXConstraint(0, 0);\r
-            this.dd.setYConstraint(\r
-                this.placement == Ext.SplitBar.TOP ? c1 : c2, \r
-                this.placement == Ext.SplitBar.TOP ? c2 : c1,\r
-                this.tickSize\r
-            );\r
-         }\r
-        this.dragSpecs.startSize = size;\r
-        this.dragSpecs.startPoint = [x, y];\r
-        Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y);\r
-    },\r
-    \r
-    /** \r
-     * @private Called after the drag operation by the DDProxy\r
-     */\r
-    onEndProxyDrag : function(e){\r
-        Ext.get(this.proxy).setDisplayed(false);\r
-        var endPoint = Ext.lib.Event.getXY(e);\r
-        if(this.overlay){\r
-            Ext.destroy(this.overlay);\r
-            delete this.overlay;\r
-        }\r
-        var newSize;\r
-        if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
-            newSize = this.dragSpecs.startSize + \r
-                (this.placement == Ext.SplitBar.LEFT ?\r
-                    endPoint[0] - this.dragSpecs.startPoint[0] :\r
-                    this.dragSpecs.startPoint[0] - endPoint[0]\r
-                );\r
-        }else{\r
-            newSize = this.dragSpecs.startSize + \r
-                (this.placement == Ext.SplitBar.TOP ?\r
-                    endPoint[1] - this.dragSpecs.startPoint[1] :\r
-                    this.dragSpecs.startPoint[1] - endPoint[1]\r
-                );\r
-        }\r
-        newSize = Math.min(Math.max(newSize, this.activeMinSize), this.activeMaxSize);\r
-        if(newSize != this.dragSpecs.startSize){\r
-            if(this.fireEvent('beforeapply', this, newSize) !== false){\r
-                this.adapter.setElementSize(this, newSize);\r
-                this.fireEvent("moved", this, newSize);\r
-                this.fireEvent("resize", this, newSize);\r
-            }\r
-        }\r
-    },\r
-    \r
-    /**\r
-     * Get the adapter this SplitBar uses\r
-     * @return The adapter object\r
-     */\r
-    getAdapter : function(){\r
-        return this.adapter;\r
-    },\r
-    \r
-    /**\r
-     * Set the adapter this SplitBar uses\r
-     * @param {Object} adapter A SplitBar adapter object\r
-     */\r
-    setAdapter : function(adapter){\r
-        this.adapter = adapter;\r
-        this.adapter.init(this);\r
-    },\r
-    \r
-    /**\r
-     * Gets the minimum size for the resizing element\r
-     * @return {Number} The minimum size\r
-     */\r
-    getMinimumSize : function(){\r
-        return this.minSize;\r
-    },\r
-    \r
-    /**\r
-     * Sets the minimum size for the resizing element\r
-     * @param {Number} minSize The minimum size\r
-     */\r
-    setMinimumSize : function(minSize){\r
-        this.minSize = minSize;\r
-    },\r
-    \r
-    /**\r
-     * Gets the maximum size for the resizing element\r
-     * @return {Number} The maximum size\r
-     */\r
-    getMaximumSize : function(){\r
-        return this.maxSize;\r
-    },\r
-    \r
-    /**\r
-     * Sets the maximum size for the resizing element\r
-     * @param {Number} maxSize The maximum size\r
-     */\r
-    setMaximumSize : function(maxSize){\r
-        this.maxSize = maxSize;\r
-    },\r
-    \r
-    /**\r
-     * Sets the initialize size for the resizing element\r
-     * @param {Number} size The initial size\r
-     */\r
-    setCurrentSize : function(size){\r
-        var oldAnimate = this.animate;\r
-        this.animate = false;\r
-        this.adapter.setElementSize(this, size);\r
-        this.animate = oldAnimate;\r
-    },\r
-    \r
-    /**\r
-     * Destroy this splitbar. \r
-     * @param {Boolean} removeEl True to remove the element\r
-     */\r
-    destroy : function(removeEl){\r
-               Ext.destroy(this.shim, Ext.get(this.proxy));\r
-        this.dd.unreg();\r
-        if(removeEl){\r
-            this.el.remove();\r
-        }\r
-               this.purgeListeners();\r
-    }\r
-});\r
-\r
-/**\r
- * @private static Create our own proxy element element. So it will be the same same size on all browsers, we won't use borders. Instead we use a background color.\r
- */\r
-Ext.SplitBar.createProxy = function(dir){\r
-    var proxy = new Ext.Element(document.createElement("div"));\r
-    proxy.unselectable();\r
-    var cls = 'x-splitbar-proxy';\r
-    proxy.addClass(cls + ' ' + (dir == Ext.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v'));\r
-    document.body.appendChild(proxy.dom);\r
-    return proxy.dom;\r
-};\r
-\r
-/** \r
- * @class Ext.SplitBar.BasicLayoutAdapter\r
- * Default Adapter. It assumes the splitter and resizing element are not positioned\r
- * elements and only gets/sets the width of the element. Generally used for table based layouts.\r
- */\r
-Ext.SplitBar.BasicLayoutAdapter = function(){\r
-};\r
-\r
-Ext.SplitBar.BasicLayoutAdapter.prototype = {\r
-    // do nothing for now\r
-    init : function(s){\r
-    \r
-    },\r
-    /**\r
-     * Called before drag operations to get the current size of the resizing element. \r
-     * @param {Ext.SplitBar} s The SplitBar using this adapter\r
-     */\r
-     getElementSize : function(s){\r
-        if(s.orientation == Ext.SplitBar.HORIZONTAL){\r
-            return s.resizingEl.getWidth();\r
-        }else{\r
-            return s.resizingEl.getHeight();\r
-        }\r
-    },\r
-    \r
-    /**\r
-     * Called after drag operations to set the size of the resizing element.\r
-     * @param {Ext.SplitBar} s The SplitBar using this adapter\r
-     * @param {Number} newSize The new size to set\r
-     * @param {Function} onComplete A function to be invoked when resizing is complete\r
-     */\r
-    setElementSize : function(s, newSize, onComplete){\r
-        if(s.orientation == Ext.SplitBar.HORIZONTAL){\r
-            if(!s.animate){\r
-                s.resizingEl.setWidth(newSize);\r
-                if(onComplete){\r
-                    onComplete(s, newSize);\r
-                }\r
-            }else{\r
-                s.resizingEl.setWidth(newSize, true, .1, onComplete, 'easeOut');\r
-            }\r
-        }else{\r
-            \r
-            if(!s.animate){\r
-                s.resizingEl.setHeight(newSize);\r
-                if(onComplete){\r
-                    onComplete(s, newSize);\r
-                }\r
-            }else{\r
-                s.resizingEl.setHeight(newSize, true, .1, onComplete, 'easeOut');\r
-            }\r
-        }\r
-    }\r
-};\r
-\r
-/** \r
- *@class Ext.SplitBar.AbsoluteLayoutAdapter\r
- * @extends Ext.SplitBar.BasicLayoutAdapter\r
- * Adapter that  moves the splitter element to align with the resized sizing element. \r
- * Used with an absolute positioned SplitBar.\r
- * @param {Mixed} container The container that wraps around the absolute positioned content. If it's\r
- * document.body, make sure you assign an id to the body element.\r
- */\r
-Ext.SplitBar.AbsoluteLayoutAdapter = function(container){\r
-    this.basic = new Ext.SplitBar.BasicLayoutAdapter();\r
-    this.container = Ext.get(container);\r
-};\r
-\r
-Ext.SplitBar.AbsoluteLayoutAdapter.prototype = {\r
-    init : function(s){\r
-        this.basic.init(s);\r
-    },\r
-    \r
-    getElementSize : function(s){\r
-        return this.basic.getElementSize(s);\r
-    },\r
-    \r
-    setElementSize : function(s, newSize, onComplete){\r
-        this.basic.setElementSize(s, newSize, this.moveSplitter.createDelegate(this, [s]));\r
-    },\r
-    \r
-    moveSplitter : function(s){\r
-        var yes = Ext.SplitBar;\r
-        switch(s.placement){\r
-            case yes.LEFT:\r
-                s.el.setX(s.resizingEl.getRight());\r
-                break;\r
-            case yes.RIGHT:\r
-                s.el.setStyle("right", (this.container.getWidth() - s.resizingEl.getLeft()) + "px");\r
-                break;\r
-            case yes.TOP:\r
-                s.el.setY(s.resizingEl.getBottom());\r
-                break;\r
-            case yes.BOTTOM:\r
-                s.el.setY(s.resizingEl.getTop() - s.el.getHeight());\r
-                break;\r
-        }\r
-    }\r
-};\r
-\r
-/**\r
- * Orientation constant - Create a vertical SplitBar\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.VERTICAL = 1;\r
-\r
-/**\r
- * Orientation constant - Create a horizontal SplitBar\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.HORIZONTAL = 2;\r
-\r
-/**\r
- * Placement constant - The resizing element is to the left of the splitter element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.LEFT = 1;\r
-\r
-/**\r
- * Placement constant - The resizing element is to the right of the splitter element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.RIGHT = 2;\r
-\r
-/**\r
- * Placement constant - The resizing element is positioned above the splitter element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.TOP = 3;\r
-\r
-/**\r
- * Placement constant - The resizing element is positioned under splitter element\r
- * @static\r
- * @type Number\r
- */\r
-Ext.SplitBar.BOTTOM = 4;\r
-/**
- * @class Ext.Container
- * @extends Ext.BoxComponent
- * <p>Base class for any {@link Ext.BoxComponent} that may contain other Components. Containers handle the
- * basic behavior of containing items, namely adding, inserting and removing items.</p>
- *
- * <p>The most commonly used Container classes are {@link Ext.Panel}, {@link Ext.Window} and {@link Ext.TabPanel}.
- * If you do not need the capabilities offered by the aforementioned classes you can create a lightweight
- * Container to be encapsulated by an HTML element to your specifications by using the
- * <tt><b>{@link Ext.Component#autoEl autoEl}</b></tt> config option. This is a useful technique when creating
- * embedded {@link Ext.layout.ColumnLayout column} layouts inside {@link Ext.form.FormPanel FormPanels}
- * for example.</p>
- *
- * <p>The code below illustrates both how to explicitly create a Container, and how to implicitly
- * create one using the <b><tt>'container'</tt></b> xtype:<pre><code>
-// explicitly create a Container
-var embeddedColumns = new Ext.Container({
-    autoEl: 'div',  // This is the default
-    layout: 'column',
-    defaults: {
-        // implicitly create Container by specifying xtype
-        xtype: 'container',
-        autoEl: 'div', // This is the default.
-        layout: 'form',
-        columnWidth: 0.5,
-        style: {
-            padding: '10px'
-        }
-    },
-//  The two items below will be Ext.Containers, each encapsulated by a &lt;DIV> element.
-    items: [{
-        items: {
-            xtype: 'datefield',
-            name: 'startDate',
-            fieldLabel: 'Start date'
-        }
-    }, {
-        items: {
-            xtype: 'datefield',
-            name: 'endDate',
-            fieldLabel: 'End date'
-        }
-    }]
-});</code></pre></p>
- *
- * <p><u><b>Layout</b></u></p>
- * <p>Container classes delegate the rendering of child Components to a layout
- * manager class which must be configured into the Container using the
- * <code><b>{@link #layout}</b></code> configuration property.</p>
- * <p>When either specifying child <code>{@link #items}</code> of a Container,
- * or dynamically {@link #add adding} Components to a Container, remember to
- * consider how you wish the Container to arrange those child elements, and
- * whether those child elements need to be sized using one of Ext's built-in
- * <b><code>{@link #layout}</code></b> schemes. By default, Containers use the
- * {@link Ext.layout.ContainerLayout ContainerLayout} scheme which only
- * renders child components, appending them one after the other inside the
- * Container, and <b>does not apply any sizing</b> at all.</p>
- * <p>A common mistake is when a developer neglects to specify a
- * <b><code>{@link #layout}</code></b> (e.g. widgets like GridPanels or
- * TreePanels are added to Containers for which no <tt><b>{@link #layout}</b></tt>
- * has been specified). If a Container is left to use the default
- * {@link Ext.layout.ContainerLayout ContainerLayout} scheme, none of its
- * child components will be resized, or changed in any way when the Container
- * is resized.</p>
- * <p>Certain layout managers allow dynamic addition of child components.
- * Those that do include {@link Ext.layout.CardLayout},
- * {@link Ext.layout.AnchorLayout}, {@link Ext.layout.FormLayout}, and
- * {@link Ext.layout.TableLayout}. For example:<pre><code>
-//  Create the GridPanel.
-var myNewGrid = new Ext.grid.GridPanel({
-    store: myStore,
-    columns: myColumnModel,
-    title: 'Results', // the title becomes the title of the tab
-});
-
-myTabPanel.add(myNewGrid); // {@link Ext.TabPanel} implicitly uses {@link Ext.layout.CardLayout CardLayout}
-myTabPanel.{@link Ext.TabPanel#setActiveTab setActiveTab}(myNewGrid);
- * </code></pre></p>
- * <p>The example above adds a newly created GridPanel to a TabPanel. Note that
- * a TabPanel uses {@link Ext.layout.CardLayout} as its layout manager which
- * means all its child items are sized to {@link Ext.layout.FitLayout fit}
- * exactly into its client area.
- * <p><b><u>Overnesting is a common problem</u></b>.
- * An example of overnesting occurs when a GridPanel is added to a TabPanel
- * by wrapping the GridPanel <i>inside</i> a wrapping Panel (that has no
- * <tt><b>{@link #layout}</b></tt> specified) and then add that wrapping Panel
- * to the TabPanel. The point to realize is that a GridPanel <b>is</b> a
- * Component which can be added directly to a Container. If the wrapping Panel
- * has no <tt><b>{@link #layout}</b></tt> configuration, then the overnested
- * GridPanel will not be sized as expected.<p>
-</code></pre>
- *
- * <p><u><b>Adding via remote configuration</b></u></p>
- *
- * <p>A server side script can be used to add Components which are generated dynamically on the server.
- * An example of adding a GridPanel to a TabPanel where the GridPanel is generated by the server
- * based on certain parameters:
- * </p><pre><code>
-// execute an Ajax request to invoke server side script:
-Ext.Ajax.request({
-    url: 'gen-invoice-grid.php',
-    // send additional parameters to instruct server script
-    params: {
-        startDate: Ext.getCmp('start-date').getValue(),
-        endDate: Ext.getCmp('end-date').getValue()
-    },
-    // process the response object to add it to the TabPanel:
-    success: function(xhr) {
-        var newComponent = eval(xhr.responseText); // see discussion below
-        myTabPanel.add(newComponent); // add the component to the TabPanel
-        myTabPanel.setActiveTab(newComponent);
-    },
-    failure: function() {
-        Ext.Msg.alert("Grid create failed", "Server communication failure");
-    }
-});
-</code></pre>
- * <p>The server script needs to return an executable Javascript statement which, when processed
- * using <tt>eval()</tt>, will return either a config object with an {@link Ext.Component#xtype xtype},
- * or an instantiated Component. The server might return this for example:</p><pre><code>
-(function() {
-    function formatDate(value){
-        return value ? value.dateFormat('M d, Y') : '';
-    };
-
-    var store = new Ext.data.Store({
-        url: 'get-invoice-data.php',
-        baseParams: {
-            startDate: '01/01/2008',
-            endDate: '01/31/2008'
-        },
-        reader: new Ext.data.JsonReader({
-            record: 'transaction',
-            idProperty: 'id',
-            totalRecords: 'total'
-        }, [
-           'customer',
-           'invNo',
-           {name: 'date', type: 'date', dateFormat: 'm/d/Y'},
-           {name: 'value', type: 'float'}
-        ])
-    });
-
-    var grid = new Ext.grid.GridPanel({
-        title: 'Invoice Report',
-        bbar: new Ext.PagingToolbar(store),
-        store: store,
-        columns: [
-            {header: "Customer", width: 250, dataIndex: 'customer', sortable: true},
-            {header: "Invoice Number", width: 120, dataIndex: 'invNo', sortable: true},
-            {header: "Invoice Date", width: 100, dataIndex: 'date', renderer: formatDate, sortable: true},
-            {header: "Value", width: 120, dataIndex: 'value', renderer: 'usMoney', sortable: true}
-        ],
-    });
-    store.load();
-    return grid;  // return instantiated component
-})();
-</code></pre>
- * <p>When the above code fragment is passed through the <tt>eval</tt> function in the success handler
- * of the Ajax request, the code is executed by the Javascript processor, and the anonymous function
- * runs, and returns the instantiated grid component.</p>
- * <p>Note: since the code above is <i>generated</i> by a server script, the <tt>baseParams</tt> for
- * the Store, the metadata to allow generation of the Record layout, and the ColumnModel
- * can all be generated into the code since these are all known on the server.</p>
- *
- * @xtype container
- */
-Ext.Container = Ext.extend(Ext.BoxComponent, {
-    /**
-     * @cfg {Boolean} monitorResize
-     * True to automatically monitor window resize events to handle anything that is sensitive to the current size
-     * of the viewport.  This value is typically managed by the chosen <code>{@link #layout}</code> and should not need
-     * to be set manually.
-     */
-    /**
-     * @cfg {String/Object} layout
-     * When creating complex UIs, it is important to remember that sizing and
-     * positioning of child items is the responsibility of the Container's
-     * layout manager. If you expect child items to be sized in response to
-     * user interactions, <b>you must specify a layout manager</b> which
-     * creates and manages the type of layout you have in mind.  For example:<pre><code>
-new Ext.Window({
-    width:300, height: 300,
-    layout: 'fit', // explicitly set layout manager: override the default (layout:'auto')
-    items: [{
-        title: 'Panel inside a Window'
-    }]
-}).show();
-     * </code></pre>
-     * <p>Omitting the {@link #layout} config means that the
-     * {@link Ext.layout.ContainerLayout default layout manager} will be used which does
-     * nothing but render child components sequentially into the Container (no sizing or
-     * positioning will be performed in this situation).</p>
-     * <p>The layout manager class for this container may be specified as either as an
-     * Object or as a String:</p>
-     * <div><ul class="mdetail-params">
-     *
-     * <li><u>Specify as an Object</u></li>
-     * <div><ul class="mdetail-params">
-     * <li>Example usage:</li>
-<pre><code>
-layout: {
-    type: 'vbox',
-    padding: '5',
-    align: 'left'
-}
-</code></pre>
-     *
-     * <li><tt><b>type</b></tt></li>
-     * <br/><p>The layout type to be used for this container.  If not specified,
-     * a default {@link Ext.layout.ContainerLayout} will be created and used.</p>
-     * <br/><p>Valid layout <tt>type</tt> values are:</p>
-     * <div class="sub-desc"><ul class="mdetail-params">
-     * <li><tt><b>{@link Ext.layout.AbsoluteLayout absolute}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.AccordionLayout accordion}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.AnchorLayout anchor}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.ContainerLayout auto}</b></tt> &nbsp;&nbsp;&nbsp; <b>Default</b></li>
-     * <li><tt><b>{@link Ext.layout.BorderLayout border}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.CardLayout card}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.ColumnLayout column}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.FitLayout fit}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.FormLayout form}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.HBoxLayout hbox}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.MenuLayout menu}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.TableLayout table}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.ToolbarLayout toolbar}</b></tt></li>
-     * <li><tt><b>{@link Ext.layout.VBoxLayout vbox}</b></tt></li>
-     * </ul></div>
-     *
-     * <li>Layout specific configuration properties</li>
-     * <br/><p>Additional layout specific configuration properties may also be
-     * specified. For complete details regarding the valid config options for
-     * each layout type, see the layout class corresponding to the <tt>type</tt>
-     * specified.</p>
-     *
-     * </ul></div>
-     *
-     * <li><u>Specify as a String</u></li>
-     * <div><ul class="mdetail-params">
-     * <li>Example usage:</li>
-<pre><code>
-layout: 'vbox',
-layoutConfig: {
-    padding: '5',
-    align: 'left'
-}
-</code></pre>
-     * <li><tt><b>layout</b></tt></li>
-     * <br/><p>The layout <tt>type</tt> to be used for this container (see list
-     * of valid layout type values above).</p><br/>
-     * <li><tt><b>{@link #layoutConfig}</b></tt></li>
-     * <br/><p>Additional layout specific configuration properties. For complete
-     * details regarding the valid config options for each layout type, see the
-     * layout class corresponding to the <tt>layout</tt> specified.</p>
-     * </ul></div></ul></div>
-     */
-    /**
-     * @cfg {Object} layoutConfig
-     * This is a config object containing properties specific to the chosen
-     * <b><code>{@link #layout}</code></b> if <b><code>{@link #layout}</code></b>
-     * has been specified as a <i>string</i>.</p>
-     */
-    /**
-     * @cfg {Boolean/Number} bufferResize
-     * When set to true (100 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
-     * the frequency it calculates and does a re-layout of components. This is useful for heavy containers or containers
-     * with a large quantity of sub-components for which frequent layout calls would be expensive.
-     */
-    bufferResize: 100,
-    
-    /**
-     * @cfg {String/Number} activeItem
-     * A string component id or the numeric index of the component that should be initially activated within the
-     * container's layout on render.  For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first
-     * item in the container's collection).  activeItem only applies to layout styles that can display
-     * items one at a time (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout} and
-     * {@link Ext.layout.FitLayout}).  Related to {@link Ext.layout.ContainerLayout#activeItem}.
-     */
-    /**
-     * @cfg {Object/Array} items
-     * <pre><b>** IMPORTANT</b>: be sure to specify a <b><code>{@link #layout}</code> ! **</b></pre>
-     * <p>A single item, or an array of child Components to be added to this container,
-     * for example:</p>
-     * <pre><code>
-// specifying a single item
-items: {...},
-layout: 'fit',    // specify a layout!
-
-// specifying multiple items
-items: [{...}, {...}],
-layout: 'anchor', // specify a layout!
-     * </code></pre>
-     * <p>Each item may be:</p>
-     * <div><ul class="mdetail-params">
-     * <li>any type of object based on {@link Ext.Component}</li>
-     * <li>a fully instanciated object or</li>
-     * <li>an object literal that:</li>
-     * <div><ul class="mdetail-params">
-     * <li>has a specified <code>{@link Ext.Component#xtype xtype}</code></li>
-     * <li>the {@link Ext.Component#xtype} specified is associated with the Component
-     * desired and should be chosen from one of the available xtypes as listed
-     * in {@link Ext.Component}.</li>
-     * <li>If an <code>{@link Ext.Component#xtype xtype}</code> is not explicitly
-     * specified, the {@link #defaultType} for that Container is used.</li>
-     * <li>will be "lazily instanciated", avoiding the overhead of constructing a fully
-     * instanciated Component object</li>
-     * </ul></div></ul></div>
-     * <p><b>Notes</b>:</p>
-     * <div><ul class="mdetail-params">
-     * <li>Ext uses lazy rendering. Child Components will only be rendered
-     * should it become necessary. Items are automatically laid out when they are first
-     * shown (no sizing is done while hidden), or in response to a {@link #doLayout} call.</li>
-     * <li>Do not specify <code>{@link Ext.Panel#contentEl contentEl}</code>/
-     * <code>{@link Ext.Panel#html html}</code> with <code>items</code>.</li>
-     * </ul></div>
-     */
-    /**
-     * @cfg {Object} defaults
-     * <p>A config object that will be applied to all components added to this container either via the {@link #items}
-     * config or via the {@link #add} or {@link #insert} methods.  The <tt>defaults</tt> config can contain any
-     * number of name/value property pairs to be added to each item, and should be valid for the types of items
-     * being added to the container.  For example, to automatically apply padding to the body of each of a set of
-     * contained {@link Ext.Panel} items, you could pass: <tt>defaults: {bodyStyle:'padding:15px'}</tt>.</p><br/>
-     * <p><b>Note</b>: <tt>defaults</tt> will not be applied to config objects if the option is already specified.
-     * For example:</p><pre><code>
-defaults: {               // defaults are applied to items, not the container
-    autoScroll:true
-},
-items: [
-    {
-        xtype: 'panel',   // defaults <b>do not</b> have precedence over
-        id: 'panel1',     // options in config objects, so the defaults
-        autoScroll: false // will not be applied here, panel1 will be autoScroll:false
-    },
-    new Ext.Panel({       // defaults <b>do</b> have precedence over options
-        id: 'panel2',     // options in components, so the defaults
-        autoScroll: false // will be applied here, panel2 will be autoScroll:true.
-    })
-]
-     * </code></pre>
-     */
-
-
-    /** @cfg {Boolean} autoDestroy
-     * If true the container will automatically destroy any contained component that is removed from it, else
-     * destruction must be handled manually (defaults to true).
-     */
-    autoDestroy : true,
-
-    /** @cfg {Boolean} forceLayout
-     * If true the container will force a layout initially even if hidden or collapsed. This option
-     * is useful for forcing forms to render in collapsed or hidden containers. (defaults to false).
-     */
-    forceLayout: false,
-
-    /** @cfg {Boolean} hideBorders
-     * True to hide the borders of each contained component, false to defer to the component's existing
-     * border settings (defaults to false).
-     */
-    /** @cfg {String} defaultType
-     * <p>The default {@link Ext.Component xtype} of child Components to create in this Container when
-     * a child item is specified as a raw configuration object, rather than as an instantiated Component.</p>
-     * <p>Defaults to <tt>'panel'</tt>, except {@link Ext.menu.Menu} which defaults to <tt>'menuitem'</tt>,
-     * and {@link Ext.Toolbar} and {@link Ext.ButtonGroup} which default to <tt>'button'</tt>.</p>
-     */
-    defaultType : 'panel',
-
-    // private
-    initComponent : function(){
-        Ext.Container.superclass.initComponent.call(this);
-
-        this.addEvents(
-            /**
-             * @event afterlayout
-             * Fires when the components in this container are arranged by the associated layout manager.
-             * @param {Ext.Container} this
-             * @param {ContainerLayout} layout The ContainerLayout implementation for this container
-             */
-            'afterlayout',
-            /**
-             * @event beforeadd
-             * Fires before any {@link Ext.Component} is added or inserted into the container.
-             * A handler can return false to cancel the add.
-             * @param {Ext.Container} this
-             * @param {Ext.Component} component The component being added
-             * @param {Number} index The index at which the component will be added to the container's items collection
-             */
-            'beforeadd',
-            /**
-             * @event beforeremove
-             * Fires before any {@link Ext.Component} is removed from the container.  A handler can return
-             * false to cancel the remove.
-             * @param {Ext.Container} this
-             * @param {Ext.Component} component The component being removed
-             */
-            'beforeremove',
-            /**
-             * @event add
-             * @bubbles
-             * Fires after any {@link Ext.Component} is added or inserted into the container.
-             * @param {Ext.Container} this
-             * @param {Ext.Component} component The component that was added
-             * @param {Number} index The index at which the component was added to the container's items collection
-             */
-            'add',
-            /**
-             * @event remove
-             * @bubbles
-             * Fires after any {@link Ext.Component} is removed from the container.
-             * @param {Ext.Container} this
-             * @param {Ext.Component} component The component that was removed
-             */
-            'remove'
-        );
-
-               this.enableBubble('add', 'remove');
-
-        /**
-         * The collection of components in this container as a {@link Ext.util.MixedCollection}
-         * @type MixedCollection
-         * @property items
-         */
-        var items = this.items;
-        if(items){
-            delete this.items;
-            if(Ext.isArray(items) && items.length > 0){
-                this.add.apply(this, items);
-            }else{
-                this.add(items);
-            }
-        }
-    },
-
-    // private
-    initItems : function(){
-        if(!this.items){
-            this.items = new Ext.util.MixedCollection(false, this.getComponentId);
-            this.getLayout(); // initialize the layout
-        }
-    },
-
-    // private
-    setLayout : function(layout){
-        if(this.layout && this.layout != layout){
-            this.layout.setContainer(null);
-        }
-        this.initItems();
-        this.layout = layout;
-        layout.setContainer(this);
-    },
-
-    // private
-    render : function(){
-        Ext.Container.superclass.render.apply(this, arguments);
-        if(this.layout){
-            if(Ext.isObject(this.layout) && !this.layout.layout){
-                this.layoutConfig = this.layout;
-                this.layout = this.layoutConfig.type;
-            }
-            if(typeof this.layout == 'string'){
-                this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);
-            }
-            this.setLayout(this.layout);
-
-            if(this.activeItem !== undefined){
-                var item = this.activeItem;
-                delete this.activeItem;
-                this.layout.setActiveItem(item);
-            }
-        }
-        if(!this.ownerCt){
-            // force a layout if no ownerCt is set
-            this.doLayout(false, true);
-        }
-        if(this.monitorResize === true){
-            Ext.EventManager.onWindowResize(this.doLayout, this, [false]);
-        }
-    },
-
-    /**
-     * <p>Returns the Element to be used to contain the child Components of this Container.</p>
-     * <p>An implementation is provided which returns the Container's {@link #getEl Element}, but
-     * if there is a more complex structure to a Container, this may be overridden to return
-     * the element into which the {@link #layout layout} renders child Components.</p>
-     * @return {Ext.Element} The Element to render child Components into.
-     */
-    getLayoutTarget : function(){
-        return this.el;
-    },
-
-    // private - used as the key lookup function for the items collection
-    getComponentId : function(comp){
-        return comp.getItemId();
-    },
-
-    /**
-     * <p>Adds {@link Ext.Component Component}(s) to this Container.</p>
-     * <br><p><b>Description</b></u> :
-     * <div><ul class="mdetail-params">
-     * <li>Fires the {@link #beforeadd} event before adding</li>
-     * <li>The Container's {@link #defaults default config values} will be applied
-     * accordingly (see <code>{@link #defaults}</code> for details).</li>
-     * <li>Fires the {@link #add} event after the component has been added.</li>
-     * </ul></div>
-     * <br><p><b>Notes</b></u> :
-     * <div><ul class="mdetail-params">
-     * <li>If the Container is <i>already rendered</i> when <tt>add</tt>
-     * is called, you may need to call {@link #doLayout} to refresh the view which causes
-     * any unrendered child Components to be rendered. This is required so that you can
-     * <tt>add</tt> multiple child components if needed while only refreshing the layout
-     * once. For example:<pre><code>
-var tb = new {@link Ext.Toolbar}();
-tb.render(document.body);  // toolbar is rendered
-tb.add({text:'Button 1'}); // add multiple items ({@link #defaultType} for {@link Ext.Toolbar Toolbar} is 'button')
-tb.add({text:'Button 2'});
-tb.{@link #doLayout}();             // refresh the layout
-     * </code></pre></li>
-     * <li><i>Warning:</i> Containers directly managed by the BorderLayout layout manager
-     * may not be removed or added.  See the Notes for {@link Ext.layout.BorderLayout BorderLayout}
-     * for more details.</li>
-     * </ul></div>
-     * @param {Object/Array} component
-     * <p>Either a single component or an Array of components to add.  See
-     * <code>{@link #items}</code> for additional information.</p>
-     * @param {Object} (Optional) component_2
-     * @param {Object} (Optional) component_n
-     * @return {Ext.Component} component The Component (or config object) that was added.
-     */
-    add : function(comp){
-        this.initItems();
-        var args = arguments.length > 1;
-        if(args || Ext.isArray(comp)){
-            Ext.each(args ? arguments : comp, function(c){
-                this.add(c);
-            }, this);
-            return;
-        }
-        var c = this.lookupComponent(this.applyDefaults(comp));
-        var pos = this.items.length;
-        if(this.fireEvent('beforeadd', this, c, pos) !== false && this.onBeforeAdd(c) !== false){
-            this.items.add(c);
-            c.ownerCt = this;
-            this.fireEvent('add', this, c, pos);
-        }
-        return c;
-    },
-
-    /**
-     * Inserts a Component into this Container at a specified index. Fires the
-     * {@link #beforeadd} event before inserting, then fires the {@link #add} event after the
-     * Component has been inserted.
-     * @param {Number} index The index at which the Component will be inserted
-     * into the Container's items collection
-     * @param {Ext.Component} component The child Component to insert.<br><br>
-     * Ext uses lazy rendering, and will only render the inserted Component should
-     * it become necessary.<br><br>
-     * A Component config object may be passed in order to avoid the overhead of
-     * constructing a real Component object if lazy rendering might mean that the
-     * inserted Component will not be rendered immediately. To take advantage of
-     * this 'lazy instantiation', set the {@link Ext.Component#xtype} config
-     * property to the registered type of the Component wanted.<br><br>
-     * For a list of all available xtypes, see {@link Ext.Component}.
-     * @return {Ext.Component} component The Component (or config object) that was
-     * inserted with the Container's default config values applied.
-     */
-    insert : function(index, comp){
-        this.initItems();
-        var a = arguments, len = a.length;
-        if(len > 2){
-            for(var i = len-1; i >= 1; --i) {
-                this.insert(index, a[i]);
-            }
-            return;
-        }
-        var c = this.lookupComponent(this.applyDefaults(comp));
-
-        if(c.ownerCt == this && this.items.indexOf(c) < index){
-            --index;
-        }
-
-        if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){
-            this.items.insert(index, c);
-            c.ownerCt = this;
-            this.fireEvent('add', this, c, index);
-        }
-        return c;
-    },
-
-    // private
-    applyDefaults : function(c){
-        if(this.defaults){
-            if(typeof c == 'string'){
-                c = Ext.ComponentMgr.get(c);
-                Ext.apply(c, this.defaults);
-            }else if(!c.events){
-                Ext.applyIf(c, this.defaults);
-            }else{
-                Ext.apply(c, this.defaults);
-            }
-        }
-        return c;
-    },
-
-    // private
-    onBeforeAdd : function(item){
-        if(item.ownerCt){
-            item.ownerCt.remove(item, false);
-        }
-        if(this.hideBorders === true){
-            item.border = (item.border === true);
-        }
-    },
-
-    /**
-     * Removes a component from this container.  Fires the {@link #beforeremove} event before removing, then fires
-     * the {@link #remove} event after the component has been removed.
-     * @param {Component/String} component The component reference or id to remove.
-     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
-     * Defaults to the value of this Container's {@link #autoDestroy} config.
-     * @return {Ext.Component} component The Component that was removed.
-     */
-    remove : function(comp, autoDestroy){
-        this.initItems();
-        var c = this.getComponent(comp);
-        if(c && this.fireEvent('beforeremove', this, c) !== false){
-            this.items.remove(c);
-            delete c.ownerCt;
-            if(autoDestroy === true || (autoDestroy !== false && this.autoDestroy)){
-                c.destroy();
-            }
-            if(this.layout && this.layout.activeItem == c){
-                delete this.layout.activeItem;
-            }
-            this.fireEvent('remove', this, c);
-        }
-        return c;
-    },
-
-    /**
-     * Removes all components from this container.
-     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
-     * Defaults to the value of this Container's {@link #autoDestroy} config.
-     * @return {Array} Array of the destroyed components
-     */
-    removeAll: function(autoDestroy){
-        this.initItems();
-        var item, rem = [], items = [];
-        this.items.each(function(i){
-            rem.push(i);
-        });
-        for (var i = 0, len = rem.length; i < len; ++i){
-            item = rem[i];
-            this.remove(item, autoDestroy);
-            if(item.ownerCt !== this){
-                items.push(item);
-            }
-        }
-        return items;
-    },
-
-    /**
-     * Examines this container's <code>{@link #items}</code> <b>property</b>
-     * and gets a direct child component of this container.
-     * @param {String/Number} comp This parameter may be any of the following:
-     * <div><ul class="mdetail-params">
-     * <li>a <b><tt>String</tt></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
-     * or <code>{@link Ext.Component#id id}</code> of the child component </li>
-     * <li>a <b><tt>Number</tt></b> : representing the position of the child component
-     * within the <code>{@link #items}</code> <b>property</b></li>
-     * </ul></div>
-     * <p>For additional information see {@link Ext.util.MixedCollection#get}.
-     * @return Ext.Component The component (if found).
-     */
-    getComponent : function(comp){
-        if(Ext.isObject(comp)){
-            return comp;
-        }
-        return this.items.get(comp);
-    },
-
-    // private
-    lookupComponent : function(comp){
-        if(typeof comp == 'string'){
-            return Ext.ComponentMgr.get(comp);
-        }else if(!comp.events){
-            return this.createComponent(comp);
-        }
-        return comp;
-    },
-
-    // private
-    createComponent : function(config){
-        return Ext.create(config, this.defaultType);
-    },
-
-    /**
-     * Force this container's layout to be recalculated. A call to this function is required after adding a new component
-     * to an already rendered container, or possibly after changing sizing/position properties of child components.
-     * @param {Boolean} shallow (optional) True to only calc the layout of this component, and let child components auto
-     * calc layouts as required (defaults to false, which calls doLayout recursively for each subcontainer)
-     * @param {Boolean} force (optional) True to force a layout to occur, even if the item is hidden.
-     * @return {Ext.Container} this
-     */
-    doLayout: function(shallow, force){
-        var rendered = this.rendered,
-            forceLayout = this.forceLayout;
-
-        if(!this.isVisible() || this.collapsed){
-            this.deferLayout = this.deferLayout || !shallow;
-            if(!(force || forceLayout)){
-                return;
-            }
-            shallow = shallow && !this.deferLayout;
-        } else {
-            delete this.deferLayout;
-        }
-        if(rendered && this.layout){
-            this.layout.layout();
-        }
-        if(shallow !== true && this.items){
-            var cs = this.items.items;
-            for(var i = 0, len = cs.length; i < len; i++){
-                var c = cs[i];
-                if(c.doLayout){
-                    c.forceLayout = forceLayout;
-                    c.doLayout();
-                }
-            }
-        }
-        if(rendered){
-            this.onLayout(shallow, force);
-        }
-        delete this.forceLayout;
-    },
-
-    //private
-    onLayout : Ext.emptyFn,
-
-    onShow : function(){
-        Ext.Container.superclass.onShow.call(this);
-        if(this.deferLayout !== undefined){
-            this.doLayout(true);
-        }
-    },
-
-    /**
-     * Returns the layout currently in use by the container.  If the container does not currently have a layout
-     * set, a default {@link Ext.layout.ContainerLayout} will be created and set as the container's layout.
-     * @return {ContainerLayout} layout The container's layout
-     */
-    getLayout : function(){
-        if(!this.layout){
-            var layout = new Ext.layout.ContainerLayout(this.layoutConfig);
-            this.setLayout(layout);
-        }
-        return this.layout;
-    },
-
-    // private
-    beforeDestroy : function(){
-        if(this.items){
-            Ext.destroy.apply(Ext, this.items.items);
-        }
-        if(this.monitorResize){
-            Ext.EventManager.removeResizeListener(this.doLayout, this);
-        }
-        Ext.destroy(this.layout);
-        Ext.Container.superclass.beforeDestroy.call(this);
-    },
-
-    /**
-     * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<i>this</i>) of
-     * function call will be the scope provided or the current component. The arguments to the function
-     * will be the args provided or the current component. If the function returns false at any point,
-     * the bubble is stopped.
-     * @param {Function} fn The function to call
-     * @param {Object} scope (optional) The scope of the function (defaults to current node)
-     * @param {Array} args (optional) The args to call the function with (default to passing the current component)
-     * @return {Ext.Container} this
-     */
-    bubble : function(fn, scope, args){
-        var p = this;
-        while(p){
-            if(fn.apply(scope || p, args || [p]) === false){
-                break;
-            }
-            p = p.ownerCt;
-        }
-        return this;
-    },
-
-    /**
-     * Cascades down the component/container heirarchy from this component (called first), calling the specified function with
-     * each component. The scope (<i>this</i>) of
-     * function call will be the scope provided or the current component. The arguments to the function
-     * will be the args provided or the current component. If the function returns false at any point,
-     * the cascade is stopped on that branch.
-     * @param {Function} fn The function to call
-     * @param {Object} scope (optional) The scope of the function (defaults to current component)
-     * @param {Array} args (optional) The args to call the function with (defaults to passing the current component)
-     * @return {Ext.Container} this
-     */
-    cascade : function(fn, scope, args){
-        if(fn.apply(scope || this, args || [this]) !== false){
-            if(this.items){
-                var cs = this.items.items;
-                for(var i = 0, len = cs.length; i < len; i++){
-                    if(cs[i].cascade){
-                        cs[i].cascade(fn, scope, args);
-                    }else{
-                        fn.apply(scope || cs[i], args || [cs[i]]);
-                    }
-                }
-            }
-        }
-        return this;
-    },
-
-    /**
-     * Find a component under this container at any level by id
-     * @param {String} id
-     * @return Ext.Component
-     */
-    findById : function(id){
-        var m, ct = this;
-        this.cascade(function(c){
-            if(ct != c && c.id === id){
-                m = c;
-                return false;
-            }
-        });
-        return m || null;
-    },
-
-    /**
-     * Find a component under this container at any level by xtype or class
-     * @param {String/Class} xtype The xtype string for a component, or the class of the component directly
-     * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
-     * the default), or true to check whether this Component is directly of the specified xtype.
-     * @return {Array} Array of Ext.Components
-     */
-    findByType : function(xtype, shallow){
-        return this.findBy(function(c){
-            return c.isXType(xtype, shallow);
-        });
-    },
-
-    /**
-     * Find a component under this container at any level by property
-     * @param {String} prop
-     * @param {String} value
-     * @return {Array} Array of Ext.Components
-     */
-    find : function(prop, value){
-        return this.findBy(function(c){
-            return c[prop] === value;
-        });
-    },
-
-    /**
-     * Find a component under this container at any level by a custom function. If the passed function returns
-     * true, the component will be included in the results. The passed function is called with the arguments (component, this container).
-     * @param {Function} fn The function to call
-     * @param {Object} scope (optional)
-     * @return {Array} Array of Ext.Components
-     */
-    findBy : function(fn, scope){
-        var m = [], ct = this;
-        this.cascade(function(c){
-            if(ct != c && fn.call(scope || c, c, ct) === true){
-                m.push(c);
-            }
-        });
-        return m;
-    },
-
-    /**
-     * Get a component contained by this container (alias for items.get(key))
-     * @param {String/Number} key The index or id of the component
-     * @return {Ext.Component} Ext.Component
-     */
-    get : function(key){
-        return this.items.get(key);
-    }
-});
-
-Ext.Container.LAYOUTS = {};
-Ext.reg('container', Ext.Container);
-/**
- * @class Ext.layout.ContainerLayout
- * <p>The ContainerLayout class is the default layout manager delegated by {@link Ext.Container} to
- * render any child Components when no <tt>{@link Ext.Container#layout layout}</tt> is configured into
- * a {@link Ext.Container Container}. ContainerLayout provides the basic foundation for all other layout
- * classes in Ext. It simply renders all child Components into the Container, performing no sizing or
- * positioning services. To utilize a layout that provides sizing and positioning of child Components,
- * specify an appropriate <tt>{@link Ext.Container#layout layout}</tt>.</p>
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
- * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- */
-Ext.layout.ContainerLayout = function(config){
-    Ext.apply(this, config);
-};
-
-Ext.layout.ContainerLayout.prototype = {
-    /**
-     * @cfg {String} extraCls
-     * <p>An optional extra CSS class that will be added to the container. This can be useful for adding
-     * customized styles to the container or any of its children using standard CSS rules. See
-     * {@link Ext.Component}.{@link Ext.Component#ctCls ctCls} also.</p>
-     * <p><b>Note</b>: <tt>extraCls</tt> defaults to <tt>''</tt> except for the following classes
-     * which assign a value by default:
-     * <div class="mdetail-params"><ul>
-     * <li>{@link Ext.layout.AbsoluteLayout Absolute Layout} : <tt>'x-abs-layout-item'</tt></li>
-     * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-item'</tt></li>
-     * <li>{@link Ext.layout.ColumnLayout Column Layout} : <tt>'x-column'</tt></li>
-     * </ul></div>
-     * To configure the above Classes with an extra CSS class append to the default.  For example,
-     * for ColumnLayout:<pre><code>
-     * extraCls: 'x-column custom-class'
-     * </code></pre>
-     * </p>
-     */
-    /**
-     * @cfg {Boolean} renderHidden
-     * True to hide each contained item on render (defaults to false).
-     */
-
-    /**
-     * A reference to the {@link Ext.Component} that is active.  For example, <pre><code>
-     * if(myPanel.layout.activeItem.id == 'item-1') { ... }
-     * </code></pre>
-     * <tt>activeItem</tt> only applies to layout styles that can display items one at a time
-     * (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout}
-     * and {@link Ext.layout.FitLayout}).  Read-only.  Related to {@link Ext.Container#activeItem}.
-     * @type {Ext.Component}
-     * @property activeItem
-     */
-
-    // private
-    monitorResize:false,
-    // private
-    activeItem : null,
-
-    // private
-    layout : function(){
-        var target = this.container.getLayoutTarget();
-        this.onLayout(this.container, target);
-        this.container.fireEvent('afterlayout', this.container, this);
-    },
-
-    // private
-    onLayout : function(ct, target){
-        this.renderAll(ct, target);
-    },
-
-    // private
-    isValidParent : function(c, target){
-               return target && c.getDomPositionEl().dom.parentNode == (target.dom || target);
-    },
-
-    // private
-    renderAll : function(ct, target){
-        var items = ct.items.items;
-        for(var i = 0, len = items.length; i < len; i++) {
-            var c = items[i];
-            if(c && (!c.rendered || !this.isValidParent(c, target))){
-                this.renderItem(c, i, target);
-            }
-        }
-    },
-
-    // private
-    renderItem : function(c, position, target){
-        if(c && !c.rendered){
-            c.render(target, position);
-            this.configureItem(c, position);
-        }else if(c && !this.isValidParent(c, target)){
-            if(typeof position == 'number'){
-                position = target.dom.childNodes[position];
-            }
-            target.dom.insertBefore(c.getDomPositionEl().dom, position || null);
-            c.container = target;
-            this.configureItem(c, position);
-        }
-    },
-    
-    // private
-    configureItem: function(c, position){
-        if(this.extraCls){
-            var t = c.getPositionEl ? c.getPositionEl() : c;
-            t.addClass(this.extraCls);
-        }
-        if (this.renderHidden && c != this.activeItem) {
-            c.hide();
-        }
-        if(c.doLayout){
-            c.doLayout(false, this.forceLayout);
-        }
-    },
-
-    // private
-    onResize: function(){
-        if(this.container.collapsed){
-            return;
-        }
-        var b = this.container.bufferResize;
-        if(b){
-            if(!this.resizeTask){
-                this.resizeTask = new Ext.util.DelayedTask(this.runLayout, this);
-                this.resizeBuffer = typeof b == 'number' ? b : 100;
-            }
-            this.resizeTask.delay(this.resizeBuffer);
-        }else{
-            this.runLayout();
-        }
-    },
-    
-    // private
-    runLayout: function(){
-        this.layout();
-        this.container.onLayout();
-    },
-
-    // private
-    setContainer : function(ct){
-        if(this.monitorResize && ct != this.container){
-            if(this.container){
-                this.container.un('resize', this.onResize, this);
-                this.container.un('bodyresize', this.onResize, this);
-            }
-            if(ct){
-                ct.on({
-                    scope: this,
-                    resize: this.onResize,
-                    bodyresize: this.onResize
-                });
-            }
-        }
-        this.container = ct;
-    },
-
-    // private
-    parseMargins : function(v){
-        if(typeof v == 'number'){
-            v = v.toString();
-        }
-        var ms = v.split(' ');
-        var len = ms.length;
-        if(len == 1){
-            ms[1] = ms[0];
-            ms[2] = ms[0];
-            ms[3] = ms[0];
-        }
-        if(len == 2){
-            ms[2] = ms[0];
-            ms[3] = ms[1];
-        }
-        if(len == 3){
-            ms[3] = ms[1];
-        }
-        return {
-            top:parseInt(ms[0], 10) || 0,
-            right:parseInt(ms[1], 10) || 0,
-            bottom:parseInt(ms[2], 10) || 0,
-            left:parseInt(ms[3], 10) || 0
-        };
-    },
-
-    /**
-     * The {@link Template Ext.Template} used by Field rendering layout classes (such as
-     * {@link Ext.layout.FormLayout}) to create the DOM structure of a fully wrapped,
-     * labeled and styled form Field. A default Template is supplied, but this may be
-     * overriden to create custom field structures. The template processes values returned from
-     * {@link Ext.layout.FormLayout#getTemplateArgs}.
-     * @property fieldTpl
-     * @type Ext.Template
-     */
-    fieldTpl: (function() {
-        var t = new Ext.Template(
-            '<div class="x-form-item {itemCls}" tabIndex="-1">',
-                '<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>',
-                '<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">',
-                '</div><div class="{clearCls}"></div>',
-            '</div>'
-        );
-        t.disableFormats = true;
-        return t.compile();
-    })(),
-       
-    /*
-     * Destroys this layout. This is a template method that is empty by default, but should be implemented
-     * by subclasses that require explicit destruction to purge event handlers or remove DOM nodes.
-     * @protected
-     */
-    destroy : Ext.emptyFn
-};
-Ext.Container.LAYOUTS['auto'] = Ext.layout.ContainerLayout;/**\r
- * @class Ext.layout.FitLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's\r
- * container.  This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.Container#layout}\r
- * config, and should generally not need to be created directly via the new keyword.</p>\r
- * <p>FitLayout does not have any direct config options (other than inherited ones).  To fit a panel to a container\r
- * using FitLayout, simply set layout:'fit' on the container and add a single panel to it.  If the container has\r
- * multiple panels, only the first one will be displayed.  Example usage:</p>\r
- * <pre><code>\r
-var p = new Ext.Panel({\r
-    title: 'Fit Layout',\r
-    layout:'fit',\r
-    items: {\r
-        title: 'Inner Panel',\r
-        html: '&lt;p&gt;This is the inner panel content&lt;/p&gt;',\r
-        border: false\r
-    }\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    // private\r
-    monitorResize:true,\r
-\r
-    // private\r
-    onLayout : function(ct, target){\r
-        Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);\r
-        if(!this.container.collapsed){\r
-            var sz = (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getViewSize() : target.getStyleSize();\r
-            this.setItemSize(this.activeItem || ct.items.itemAt(0), sz);\r
-        }\r
-    },\r
-\r
-    // private\r
-    setItemSize : function(item, size){\r
-        if(item && size.height > 0){ // display none?\r
-            item.setSize(size);\r
-        }\r
-    }\r
-});\r
-Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;/**\r
- * @class Ext.layout.CardLayout\r
- * @extends Ext.layout.FitLayout\r
- * <p>This layout manages multiple child Components, each fitted to the Container, where only a single child Component can be\r
- * visible at any given time.  This layout style is most commonly used for wizards, tab implementations, etc.\r
- * This class is intended to be extended or created via the layout:'card' {@link Ext.Container#layout} config,\r
- * and should generally not need to be created directly via the new keyword.</p>\r
- * <p>The CardLayout's focal method is {@link #setActiveItem}.  Since only one panel is displayed at a time,\r
- * the only way to move from one Component to the next is by calling setActiveItem, passing the id or index of\r
- * the next panel to display.  The layout itself does not provide a user interface for handling this navigation,\r
- * so that functionality must be provided by the developer.</p>\r
- * <p>In the following example, a simplistic wizard setup is demonstrated.  A button bar is added\r
- * to the footer of the containing panel to provide navigation buttons.  The buttons will be handled by a\r
- * common navigation routine -- for this example, the implementation of that routine has been ommitted since\r
- * it can be any type of custom logic.  Note that other uses of a CardLayout (like a tab control) would require a\r
- * completely different implementation.  For serious implementations, a better approach would be to extend\r
- * CardLayout to provide the custom functionality needed.  Example usage:</p>\r
- * <pre><code>\r
-var navHandler = function(direction){\r
-    // This routine could contain business logic required to manage the navigation steps.\r
-    // It would call setActiveItem as needed, manage navigation button state, handle any\r
-    // branching logic that might be required, handle alternate actions like cancellation\r
-    // or finalization, etc.  A complete wizard implementation could get pretty\r
-    // sophisticated depending on the complexity required, and should probably be\r
-    // done as a subclass of CardLayout in a real-world implementation.\r
-};\r
-\r
-var card = new Ext.Panel({\r
-    title: 'Example Wizard',\r
-    layout:'card',\r
-    activeItem: 0, // make sure the active item is set on the container config!\r
-    bodyStyle: 'padding:15px',\r
-    defaults: {\r
-        // applied to each contained panel\r
-        border:false\r
-    },\r
-    // just an example of one possible navigation scheme, using buttons\r
-    bbar: [\r
-        {\r
-            id: 'move-prev',\r
-            text: 'Back',\r
-            handler: navHandler.createDelegate(this, [-1]),\r
-            disabled: true\r
-        },\r
-        '->', // greedy spacer so that the buttons are aligned to each side\r
-        {\r
-            id: 'move-next',\r
-            text: 'Next',\r
-            handler: navHandler.createDelegate(this, [1])\r
-        }\r
-    ],\r
-    // the panels (or "cards") within the layout\r
-    items: [{\r
-        id: 'card-0',\r
-        html: '&lt;h1&gt;Welcome to the Wizard!&lt;/h1&gt;&lt;p&gt;Step 1 of 3&lt;/p&gt;'\r
-    },{\r
-        id: 'card-1',\r
-        html: '&lt;p&gt;Step 2 of 3&lt;/p&gt;'\r
-    },{\r
-        id: 'card-2',\r
-        html: '&lt;h1&gt;Congratulations!&lt;/h1&gt;&lt;p&gt;Step 3 of 3 - Complete&lt;/p&gt;'\r
-    }]\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {\r
-    /**\r
-     * @cfg {Boolean} deferredRender\r
-     * True to render each contained item at the time it becomes active, false to render all contained items\r
-     * as soon as the layout is rendered (defaults to false).  If there is a significant amount of content or\r
-     * a lot of heavy controls being rendered into panels that are not displayed by default, setting this to\r
-     * true might improve performance.\r
-     */\r
-    deferredRender : false,\r
-    \r
-    /**\r
-     * @cfg {Boolean} layoutOnCardChange\r
-     * True to force a layout of the active item when the active card is changed. Defaults to false.\r
-     */\r
-    layoutOnCardChange : false,\r
-\r
-    /**\r
-     * @cfg {Boolean} renderHidden @hide\r
-     */\r
-    // private\r
-    renderHidden : true,\r
-    \r
-    constructor: function(config){\r
-        Ext.layout.CardLayout.superclass.constructor.call(this, config);\r
-        this.forceLayout = (this.deferredRender === false);\r
-    },\r
-\r
-    /**\r
-     * Sets the active (visible) item in the layout.\r
-     * @param {String/Number} item The string component id or numeric index of the item to activate\r
-     */\r
-    setActiveItem : function(item){\r
-        item = this.container.getComponent(item);\r
-        if(this.activeItem != item){\r
-            if(this.activeItem){\r
-                this.activeItem.hide();\r
-            }\r
-            this.activeItem = item;\r
-            item.show();\r
-            this.container.doLayout();\r
-            if(this.layoutOnCardChange && item.doLayout){\r
-                item.doLayout();\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    renderAll : function(ct, target){\r
-        if(this.deferredRender){\r
-            this.renderItem(this.activeItem, undefined, target);\r
-        }else{\r
-            Ext.layout.CardLayout.superclass.renderAll.call(this, ct, target);\r
-        }\r
-    }\r
-});\r
-Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout;/**\r
- * @class Ext.layout.AnchorLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>This is a layout that enables anchoring of contained elements relative to the container's dimensions.\r
- * If the container is resized, all anchored items are automatically rerendered according to their\r
- * <b><tt>{@link #anchor}</tt></b> rules.</p>\r
- * <p>This class is intended to be extended or created via the layout:'anchor' {@link Ext.Container#layout}\r
- * config, and should generally not need to be created directly via the new keyword.</p>\r
- * <p>AnchorLayout does not have any direct config options (other than inherited ones). By default,\r
- * AnchorLayout will calculate anchor measurements based on the size of the container itself. However, the\r
- * container using the AnchorLayout can supply an anchoring-specific config property of <b>anchorSize</b>.\r
- * If anchorSize is specifed, the layout will use it as a virtual container for the purposes of calculating\r
- * anchor measurements based on it instead, allowing the container to be sized independently of the anchoring\r
- * logic if necessary.  For example:</p>\r
- * <pre><code>\r
-var viewport = new Ext.Viewport({\r
-    layout:'anchor',\r
-    anchorSize: {width:800, height:600},\r
-    items:[{\r
-        title:'Item 1',\r
-        html:'Content 1',\r
-        width:800,\r
-        anchor:'right 20%'\r
-    },{\r
-        title:'Item 2',\r
-        html:'Content 2',\r
-        width:300,\r
-        anchor:'50% 30%'\r
-    },{\r
-        title:'Item 3',\r
-        html:'Content 3',\r
-        width:600,\r
-        anchor:'-100 50%'\r
-    }]\r
-});\r
- * </code></pre>\r
- */\r
-Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    /**\r
-     * @cfg {String} anchor\r
-     * <p>This configuation option is to be applied to <b>child <tt>items</tt></b> of a container managed by\r
-     * this layout (ie. configured with <tt>layout:'anchor'</tt>).</p><br/>\r
-     * \r
-     * <p>This value is what tells the layout how an item should be anchored to the container. <tt>items</tt>\r
-     * added to an AnchorLayout accept an anchoring-specific config property of <b>anchor</b> which is a string\r
-     * containing two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%').\r
-     * The following types of anchor values are supported:<div class="mdetail-params"><ul>\r
-     * \r
-     * <li><b>Percentage</b> : Any value between 1 and 100, expressed as a percentage.<div class="sub-desc">\r
-     * The first anchor is the percentage width that the item should take up within the container, and the\r
-     * second is the percentage height.  For example:<pre><code>\r
-// two values specified\r
-anchor: '100% 50%' // render item complete width of the container and\r
-                   // 1/2 height of the container\r
-// one value specified\r
-anchor: '100%'     // the width value; the height will default to auto\r
-     * </code></pre></div></li>\r
-     * \r
-     * <li><b>Offsets</b> : Any positive or negative integer value.<div class="sub-desc">\r
-     * This is a raw adjustment where the first anchor is the offset from the right edge of the container,\r
-     * and the second is the offset from the bottom edge. For example:<pre><code>\r
-// two values specified\r
-anchor: '-50 -100' // render item the complete width of the container\r
-                   // minus 50 pixels and\r
-                   // the complete height minus 100 pixels.\r
-// one value specified\r
-anchor: '-50'      // anchor value is assumed to be the right offset value\r
-                   // bottom offset will default to 0\r
-     * </code></pre></div></li>\r
-     * \r
-     * <li><b>Sides</b> : Valid values are <tt>'right'</tt> (or <tt>'r'</tt>) and <tt>'bottom'</tt>\r
-     * (or <tt>'b'</tt>).<div class="sub-desc">\r
-     * Either the container must have a fixed size or an anchorSize config value defined at render time in\r
-     * order for these to have any effect.</div></li>\r
-     *\r
-     * <li><b>Mixed</b> : <div class="sub-desc">\r
-     * Anchor values can also be mixed as needed.  For example, to render the width offset from the container\r
-     * right edge by 50 pixels and 75% of the container's height use:\r
-     * <pre><code>\r
-anchor: '-50 75%' \r
-     * </code></pre></div></li>\r
-     * \r
-     * \r
-     * </ul></div>\r
-     */\r
-    \r
-    // private\r
-    monitorResize:true,\r
-\r
-    // private\r
-    getAnchorViewSize : function(ct, target){\r
-        return target.dom == document.body ?\r
-                   target.getViewSize() : target.getStyleSize();\r
-    },\r
-\r
-    // private\r
-    onLayout : function(ct, target){\r
-        Ext.layout.AnchorLayout.superclass.onLayout.call(this, ct, target);\r
-\r
-        var size = this.getAnchorViewSize(ct, target);\r
-\r
-        var w = size.width, h = size.height;\r
-\r
-        if(w < 20 && h < 20){\r
-            return;\r
-        }\r
-\r
-        // find the container anchoring size\r
-        var aw, ah;\r
-        if(ct.anchorSize){\r
-            if(typeof ct.anchorSize == 'number'){\r
-                aw = ct.anchorSize;\r
-            }else{\r
-                aw = ct.anchorSize.width;\r
-                ah = ct.anchorSize.height;\r
-            }\r
-        }else{\r
-            aw = ct.initialConfig.width;\r
-            ah = ct.initialConfig.height;\r
-        }\r
-\r
-        var cs = ct.items.items, len = cs.length, i, c, a, cw, ch;\r
-        for(i = 0; i < len; i++){\r
-            c = cs[i];\r
-            if(c.anchor){\r
-                a = c.anchorSpec;\r
-                if(!a){ // cache all anchor values\r
-                    var vs = c.anchor.split(' ');\r
-                    c.anchorSpec = a = {\r
-                        right: this.parseAnchor(vs[0], c.initialConfig.width, aw),\r
-                        bottom: this.parseAnchor(vs[1], c.initialConfig.height, ah)\r
-                    };\r
-                }\r
-                cw = a.right ? this.adjustWidthAnchor(a.right(w), c) : undefined;\r
-                ch = a.bottom ? this.adjustHeightAnchor(a.bottom(h), c) : undefined;\r
-\r
-                if(cw || ch){\r
-                    c.setSize(cw || undefined, ch || undefined);\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    parseAnchor : function(a, start, cstart){\r
-        if(a && a != 'none'){\r
-            var last;\r
-            if(/^(r|right|b|bottom)$/i.test(a)){   // standard anchor\r
-                var diff = cstart - start;\r
-                return function(v){\r
-                    if(v !== last){\r
-                        last = v;\r
-                        return v - diff;\r
-                    }\r
-                }\r
-            }else if(a.indexOf('%') != -1){\r
-                var ratio = parseFloat(a.replace('%', ''))*.01;   // percentage\r
-                return function(v){\r
-                    if(v !== last){\r
-                        last = v;\r
-                        return Math.floor(v*ratio);\r
-                    }\r
-                }\r
-            }else{\r
-                a = parseInt(a, 10);\r
-                if(!isNaN(a)){                            // simple offset adjustment\r
-                    return function(v){\r
-                        if(v !== last){\r
-                            last = v;\r
-                            return v + a;\r
-                        }\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        return false;\r
-    },\r
-\r
-    // private\r
-    adjustWidthAnchor : function(value, comp){\r
-        return value;\r
-    },\r
-\r
-    // private\r
-    adjustHeightAnchor : function(value, comp){\r
-        return value;\r
-    }\r
-    \r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout;/**\r
- * @class Ext.layout.ColumnLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>This is the layout style of choice for creating structural layouts in a multi-column format where the width of\r
- * each column can be specified as a percentage or fixed width, but the height is allowed to vary based on the content.\r
- * This class is intended to be extended or created via the layout:'column' {@link Ext.Container#layout} config,\r
- * and should generally not need to be created directly via the new keyword.</p>\r
- * <p>ColumnLayout does not have any direct config options (other than inherited ones), but it does support a\r
- * specific config property of <b><tt>columnWidth</tt></b> that can be included in the config of any panel added to it.  The\r
- * layout will use the columnWidth (if present) or width of each panel during layout to determine how to size each panel.\r
- * If width or columnWidth is not specified for a given panel, its width will default to the panel's width (or auto).</p>\r
- * <p>The width property is always evaluated as pixels, and must be a number greater than or equal to 1.\r
- * The columnWidth property is always evaluated as a percentage, and must be a decimal value greater than 0 and\r
- * less than 1 (e.g., .25).</p>\r
- * <p>The basic rules for specifying column widths are pretty simple.  The logic makes two passes through the\r
- * set of contained panels.  During the first layout pass, all panels that either have a fixed width or none\r
- * specified (auto) are skipped, but their widths are subtracted from the overall container width.  During the second\r
- * pass, all panels with columnWidths are assigned pixel widths in proportion to their percentages based on\r
- * the total <b>remaining</b> container width.  In other words, percentage width panels are designed to fill the space\r
- * left over by all the fixed-width and/or auto-width panels.  Because of this, while you can specify any number of columns\r
- * with different percentages, the columnWidths must always add up to 1 (or 100%) when added together, otherwise your\r
- * layout may not render as expected.  Example usage:</p>\r
- * <pre><code>\r
-// All columns are percentages -- they must add up to 1\r
-var p = new Ext.Panel({\r
-    title: 'Column Layout - Percentage Only',\r
-    layout:'column',\r
-    items: [{\r
-        title: 'Column 1',\r
-        columnWidth: .25 \r
-    },{\r
-        title: 'Column 2',\r
-        columnWidth: .6\r
-    },{\r
-        title: 'Column 3',\r
-        columnWidth: .15\r
-    }]\r
-});\r
-\r
-// Mix of width and columnWidth -- all columnWidth values must add up\r
-// to 1. The first column will take up exactly 120px, and the last two\r
-// columns will fill the remaining container width.\r
-var p = new Ext.Panel({\r
-    title: 'Column Layout - Mixed',\r
-    layout:'column',\r
-    items: [{\r
-        title: 'Column 1',\r
-        width: 120\r
-    },{\r
-        title: 'Column 2',\r
-        columnWidth: .8\r
-    },{\r
-        title: 'Column 3',\r
-        columnWidth: .2\r
-    }]\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    // private\r
-    monitorResize:true,\r
-    \r
-    extraCls: 'x-column',\r
-\r
-    scrollOffset : 0,\r
-\r
-    // private\r
-    isValidParent : function(c, target){\r
-        return (c.getPositionEl ? c.getPositionEl() : c.getEl()).dom.parentNode == this.innerCt.dom;\r
-    },\r
-\r
-    // private\r
-    onLayout : function(ct, target){\r
-        var cs = ct.items.items, len = cs.length, c, i;\r
-\r
-        if(!this.innerCt){\r
-            target.addClass('x-column-layout-ct');\r
-\r
-            // the innerCt prevents wrapping and shuffling while\r
-            // the container is resizing\r
-            this.innerCt = target.createChild({cls:'x-column-inner'});\r
-            this.innerCt.createChild({cls:'x-clear'});\r
-        }\r
-        this.renderAll(ct, this.innerCt);\r
-\r
-        var size = Ext.isIE && target.dom != Ext.getBody().dom ? target.getStyleSize() : target.getViewSize();\r
-\r
-        if(size.width < 1 && size.height < 1){ // display none?\r
-            return;\r
-        }\r
-\r
-        var w = size.width - target.getPadding('lr') - this.scrollOffset,\r
-            h = size.height - target.getPadding('tb'),\r
-            pw = w;\r
-\r
-        this.innerCt.setWidth(w);\r
-        \r
-        // some columns can be percentages while others are fixed\r
-        // so we need to make 2 passes\r
-\r
-        for(i = 0; i < len; i++){\r
-            c = cs[i];\r
-            if(!c.columnWidth){\r
-                pw -= (c.getSize().width + c.getEl().getMargins('lr'));\r
-            }\r
-        }\r
-\r
-        pw = pw < 0 ? 0 : pw;\r
-\r
-        for(i = 0; i < len; i++){\r
-            c = cs[i];\r
-            if(c.columnWidth){\r
-                c.setSize(Math.floor(c.columnWidth*pw) - c.getEl().getMargins('lr'));\r
-            }\r
-        }\r
-    }\r
-    \r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-\r
-Ext.Container.LAYOUTS['column'] = Ext.layout.ColumnLayout;/**
- * @class Ext.layout.BorderLayout
- * @extends Ext.layout.ContainerLayout
- * <p>This is a multi-pane, application-oriented UI layout style that supports multiple
- * nested panels, automatic {@link Ext.layout.BorderLayout.Region#split split} bars between
- * {@link Ext.layout.BorderLayout.Region#BorderLayout.Region regions} and built-in
- * {@link Ext.layout.BorderLayout.Region#collapsible expanding and collapsing} of regions.</p>
- * <p>This class is intended to be extended or created via the <tt>layout:'border'</tt>
- * {@link Ext.Container#layout} config, and should generally not need to be created directly
- * via the new keyword.</p>
- * <p>BorderLayout does not have any direct config options (other than inherited ones).
- * All configuration options available for customizing the BorderLayout are at the
- * {@link Ext.layout.BorderLayout.Region} and {@link Ext.layout.BorderLayout.SplitRegion}
- * levels.</p>
- * <p>Example usage:</p>
- * <pre><code>
-var myBorderPanel = new Ext.Panel({
-    {@link Ext.Component#renderTo renderTo}: document.body,
-    {@link Ext.BoxComponent#width width}: 700,
-    {@link Ext.BoxComponent#height height}: 500,
-    {@link Ext.Panel#title title}: 'Border Layout',
-    {@link Ext.Container#layout layout}: 'border',
-    {@link Ext.Container#items items}: [{
-        {@link Ext.Panel#title title}: 'South Region is resizable',
-        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'south',     // position for region
-        {@link Ext.BoxComponent#height height}: 100,
-        {@link Ext.layout.BorderLayout.Region#split split}: true,         // enable resizing
-        {@link Ext.SplitBar#minSize minSize}: 75,         // defaults to {@link Ext.layout.BorderLayout.Region#minHeight 50} 
-        {@link Ext.SplitBar#maxSize maxSize}: 150,
-        {@link Ext.layout.BorderLayout.Region#margins margins}: '0 5 5 5'
-    },{
-        // xtype: 'panel' implied by default
-        {@link Ext.Panel#title title}: 'West Region is collapsible',
-        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}:'west',
-        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 0 0 5',
-        {@link Ext.BoxComponent#width width}: 200,
-        {@link Ext.layout.BorderLayout.Region#collapsible collapsible}: true,   // make collapsible
-        {@link Ext.layout.BorderLayout.Region#cmargins cmargins}: '5 5 0 5', // adjust top margin when collapsed
-        {@link Ext.Component#id id}: 'west-region-container',
-        {@link Ext.Container#layout layout}: 'fit',
-        {@link Ext.Panel#unstyled unstyled}: true
-    },{
-        {@link Ext.Panel#title title}: 'Center Region',
-        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'center',     // center region is required, no width/height specified
-        {@link Ext.Component#xtype xtype}: 'container',
-        {@link Ext.Container#layout layout}: 'fit',
-        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 5 0 0'
-    }]
-});
+    return new Ext.EventObjectImpl();\r
+}();\r
+/**
+* @class Ext.EventManager
+*/
+Ext.apply(Ext.EventManager, function(){
+   var resizeEvent,
+       resizeTask,
+       textEvent,
+       textSize,
+       D = Ext.lib.Dom,
+       propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,
+       curWidth = 0,
+       curHeight = 0,
+       // note 1: IE fires ONLY the keydown event on specialkey autorepeat
+       // note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat
+       // (research done by @Jan Wolter at http://unixpapa.com/js/key.html)
+       useKeydown = Ext.isWebKit ?
+                   Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]) >= 525 :
+                   !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera);
+
+   return {
+       // private
+       doResizeEvent: function(){
+           var h = D.getViewHeight(),
+               w = D.getViewWidth();
+
+            //whacky problem in IE where the resize event will fire even though the w/h are the same.
+            if(curHeight != h || curWidth != w){
+               resizeEvent.fire(curWidth = w, curHeight = h);
+            }
+       },
+
+       /**
+        * Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds),
+        * passes new viewport width and height to handlers.
+        * @param {Function} fn      The handler function the window resize event invokes.
+        * @param {Object}   scope   The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
+        * @param {boolean}  options Options object as passed to {@link Ext.Element#addListener}
+        */
+       onWindowResize : function(fn, scope, options){
+           if(!resizeEvent){
+               resizeEvent = new Ext.util.Event();
+               resizeTask = new Ext.util.DelayedTask(this.doResizeEvent);
+               Ext.EventManager.on(window, "resize", this.fireWindowResize, this);
+           }
+           resizeEvent.addListener(fn, scope, options);
+       },
+
+       // exposed only to allow manual firing
+       fireWindowResize : function(){
+           if(resizeEvent){
+               resizeTask.delay(100);
+           }
+       },
+
+       /**
+        * Adds a listener to be notified when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
+        * @param {Function} fn      The function the event invokes.
+        * @param {Object}   scope   The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
+        * @param {boolean}  options Options object as passed to {@link Ext.Element#addListener}
+        */
+       onTextResize : function(fn, scope, options){
+           if(!textEvent){
+               textEvent = new Ext.util.Event();
+               var textEl = new Ext.Element(document.createElement('div'));
+               textEl.dom.className = 'x-text-resize';
+               textEl.dom.innerHTML = 'X';
+               textEl.appendTo(document.body);
+               textSize = textEl.dom.offsetHeight;
+               setInterval(function(){
+                   if(textEl.dom.offsetHeight != textSize){
+                       textEvent.fire(textSize, textSize = textEl.dom.offsetHeight);
+                   }
+               }, this.textResizeInterval);
+           }
+           textEvent.addListener(fn, scope, options);
+       },
+
+       /**
+        * Removes the passed window resize listener.
+        * @param {Function} fn        The method the event invokes
+        * @param {Object}   scope    The scope of handler
+        */
+       removeResizeListener : function(fn, scope){
+           if(resizeEvent){
+               resizeEvent.removeListener(fn, scope);
+           }
+       },
+
+       // private
+       fireResize : function(){
+           if(resizeEvent){
+               resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
+           }
+       },
+
+        /**
+        * The frequency, in milliseconds, to check for text resize events (defaults to 50)
+        */
+       textResizeInterval : 50,
+
+       /**
+        * Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL)
+        */
+       ieDeferSrc : false,
+
+       // protected for use inside the framework
+       // detects whether we should use keydown or keypress based on the browser.
+       useKeydown: useKeydown
+   };
+}());
+
+Ext.EventManager.on = Ext.EventManager.addListener;
+
+
+Ext.apply(Ext.EventObjectImpl.prototype, {
+   /** Key constant @type Number */
+   BACKSPACE: 8,
+   /** Key constant @type Number */
+   TAB: 9,
+   /** Key constant @type Number */
+   NUM_CENTER: 12,
+   /** Key constant @type Number */
+   ENTER: 13,
+   /** Key constant @type Number */
+   RETURN: 13,
+   /** Key constant @type Number */
+   SHIFT: 16,
+   /** Key constant @type Number */
+   CTRL: 17,
+   CONTROL : 17, // legacy
+   /** Key constant @type Number */
+   ALT: 18,
+   /** Key constant @type Number */
+   PAUSE: 19,
+   /** Key constant @type Number */
+   CAPS_LOCK: 20,
+   /** Key constant @type Number */
+   ESC: 27,
+   /** Key constant @type Number */
+   SPACE: 32,
+   /** Key constant @type Number */
+   PAGE_UP: 33,
+   PAGEUP : 33, // legacy
+   /** Key constant @type Number */
+   PAGE_DOWN: 34,
+   PAGEDOWN : 34, // legacy
+   /** Key constant @type Number */
+   END: 35,
+   /** Key constant @type Number */
+   HOME: 36,
+   /** Key constant @type Number */
+   LEFT: 37,
+   /** Key constant @type Number */
+   UP: 38,
+   /** Key constant @type Number */
+   RIGHT: 39,
+   /** Key constant @type Number */
+   DOWN: 40,
+   /** Key constant @type Number */
+   PRINT_SCREEN: 44,
+   /** Key constant @type Number */
+   INSERT: 45,
+   /** Key constant @type Number */
+   DELETE: 46,
+   /** Key constant @type Number */
+   ZERO: 48,
+   /** Key constant @type Number */
+   ONE: 49,
+   /** Key constant @type Number */
+   TWO: 50,
+   /** Key constant @type Number */
+   THREE: 51,
+   /** Key constant @type Number */
+   FOUR: 52,
+   /** Key constant @type Number */
+   FIVE: 53,
+   /** Key constant @type Number */
+   SIX: 54,
+   /** Key constant @type Number */
+   SEVEN: 55,
+   /** Key constant @type Number */
+   EIGHT: 56,
+   /** Key constant @type Number */
+   NINE: 57,
+   /** Key constant @type Number */
+   A: 65,
+   /** Key constant @type Number */
+   B: 66,
+   /** Key constant @type Number */
+   C: 67,
+   /** Key constant @type Number */
+   D: 68,
+   /** Key constant @type Number */
+   E: 69,
+   /** Key constant @type Number */
+   F: 70,
+   /** Key constant @type Number */
+   G: 71,
+   /** Key constant @type Number */
+   H: 72,
+   /** Key constant @type Number */
+   I: 73,
+   /** Key constant @type Number */
+   J: 74,
+   /** Key constant @type Number */
+   K: 75,
+   /** Key constant @type Number */
+   L: 76,
+   /** Key constant @type Number */
+   M: 77,
+   /** Key constant @type Number */
+   N: 78,
+   /** Key constant @type Number */
+   O: 79,
+   /** Key constant @type Number */
+   P: 80,
+   /** Key constant @type Number */
+   Q: 81,
+   /** Key constant @type Number */
+   R: 82,
+   /** Key constant @type Number */
+   S: 83,
+   /** Key constant @type Number */
+   T: 84,
+   /** Key constant @type Number */
+   U: 85,
+   /** Key constant @type Number */
+   V: 86,
+   /** Key constant @type Number */
+   W: 87,
+   /** Key constant @type Number */
+   X: 88,
+   /** Key constant @type Number */
+   Y: 89,
+   /** Key constant @type Number */
+   Z: 90,
+   /** Key constant @type Number */
+   CONTEXT_MENU: 93,
+   /** Key constant @type Number */
+   NUM_ZERO: 96,
+   /** Key constant @type Number */
+   NUM_ONE: 97,
+   /** Key constant @type Number */
+   NUM_TWO: 98,
+   /** Key constant @type Number */
+   NUM_THREE: 99,
+   /** Key constant @type Number */
+   NUM_FOUR: 100,
+   /** Key constant @type Number */
+   NUM_FIVE: 101,
+   /** Key constant @type Number */
+   NUM_SIX: 102,
+   /** Key constant @type Number */
+   NUM_SEVEN: 103,
+   /** Key constant @type Number */
+   NUM_EIGHT: 104,
+   /** Key constant @type Number */
+   NUM_NINE: 105,
+   /** Key constant @type Number */
+   NUM_MULTIPLY: 106,
+   /** Key constant @type Number */
+   NUM_PLUS: 107,
+   /** Key constant @type Number */
+   NUM_MINUS: 109,
+   /** Key constant @type Number */
+   NUM_PERIOD: 110,
+   /** Key constant @type Number */
+   NUM_DIVISION: 111,
+   /** Key constant @type Number */
+   F1: 112,
+   /** Key constant @type Number */
+   F2: 113,
+   /** Key constant @type Number */
+   F3: 114,
+   /** Key constant @type Number */
+   F4: 115,
+   /** Key constant @type Number */
+   F5: 116,
+   /** Key constant @type Number */
+   F6: 117,
+   /** Key constant @type Number */
+   F7: 118,
+   /** Key constant @type Number */
+   F8: 119,
+   /** Key constant @type Number */
+   F9: 120,
+   /** Key constant @type Number */
+   F10: 121,
+   /** Key constant @type Number */
+   F11: 122,
+   /** Key constant @type Number */
+   F12: 123,
+
+   /** @private */
+   isNavKeyPress : function(){
+       var me = this,
+           k = this.normalizeKey(me.keyCode);
+       return (k >= 33 && k <= 40) ||  // Page Up/Down, End, Home, Left, Up, Right, Down
+       k == me.RETURN ||
+       k == me.TAB ||
+       k == me.ESC;
+   },
+
+   isSpecialKey : function(){
+       var k = this.normalizeKey(this.keyCode);
+       return (this.type == 'keypress' && this.ctrlKey) ||
+       this.isNavKeyPress() ||
+       (k == this.BACKSPACE) || // Backspace
+       (k >= 16 && k <= 20) || // Shift, Ctrl, Alt, Pause, Caps Lock
+       (k >= 44 && k <= 45);   // Print Screen, Insert
+   },
+
+   getPoint : function(){
+       return new Ext.lib.Point(this.xy[0], this.xy[1]);
+   },
+
+   /**
+    * Returns true if the control, meta, shift or alt key was pressed during this event.
+    * @return {Boolean}
+    */
+   hasModifier : function(){
+       return ((this.ctrlKey || this.altKey) || this.shiftKey);
+   }
+});/**
+ * @class Ext.Element
+ * <p>Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.</p>
+ * <p>All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.</p>
+ * <p>Note that the events documented in this class are not Ext events, they encapsulate browser events. To
+ * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older
+ * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.</p>
+ * Usage:<br>
+<pre><code>
+// by id
+var el = Ext.get("my-div");
+
+// by DOM element reference
+var el = Ext.get(myDivElement);
 </code></pre>
- * <p><b><u>Notes</u></b>:</p><div class="mdetail-params"><ul>
- * <li>Any container using the BorderLayout <b>must</b> have a child item with <tt>region:'center'</tt>.
- * The child item in the center region will always be resized to fill the remaining space not used by
- * the other regions in the layout.</li>
- * <li>Any child items with a region of <tt>west</tt> or <tt>east</tt> must have <tt>width</tt> defined
- * (an integer representing the number of pixels that the region should take up).</li>
- * <li>Any child items with a region of <tt>north</tt> or <tt>south</tt> must have <tt>height</tt> defined.</li>
- * <li>The regions of a BorderLayout are <b>fixed at render time</b> and thereafter, its child Components may not be removed or added</b>.  To add/remove
- * Components within a BorderLayout, have them wrapped by an additional Container which is directly
- * managed by the BorderLayout.  If the region is to be collapsible, the Container used directly
- * by the BorderLayout manager should be a Panel.  In the following example a Container (an Ext.Panel)
- * is added to the west region:
- * <div style="margin-left:16px"><pre><code>
-wrc = {@link Ext#getCmp Ext.getCmp}('west-region-container');
-wrc.{@link Ext.Panel#removeAll removeAll}();
-wrc.{@link Ext.Container#add add}({
-    title: 'Added Panel',
-    html: 'Some content'
-});
-wrc.{@link Ext.Container#doLayout doLayout}();
- * </code></pre></div>
- * </li>
- * <li> To reference a {@link Ext.layout.BorderLayout.Region Region}:
- * <div style="margin-left:16px"><pre><code>
-wr = myBorderPanel.layout.west;
- * </code></pre></div>
- * </li>
- * </ul></div>
+ * <b>Animations</b><br />
+ * <p>When an element is manipulated, by default there is no animation.</p>
+ * <pre><code>
+var el = Ext.get("my-div");
+
+// no animation
+el.setWidth(100);
+ * </code></pre>
+ * <p>Many of the functions for manipulating an element have an optional "animate" parameter.  This
+ * parameter can be specified as boolean (<tt>true</tt>) for default animation effects.</p>
+ * <pre><code>
+// default animation
+el.setWidth(100, true);
+ * </code></pre>
+ *
+ * <p>To configure the effects, an object literal with animation options to use as the Element animation
+ * configuration object can also be specified. Note that the supported Element animation configuration
+ * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects.  The supported
+ * Element animation configuration options are:</p>
+<pre>
+Option    Default   Description
+--------- --------  ---------------------------------------------
+{@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds
+{@link Ext.Fx#easing easing}    easeOut   The easing method
+{@link Ext.Fx#callback callback}  none      A function to execute when the anim completes
+{@link Ext.Fx#scope scope}     this      The scope (this) of the callback function
+</pre>
+ *
+ * <pre><code>
+// Element animation options object
+var opt = {
+    {@link Ext.Fx#duration duration}: 1,
+    {@link Ext.Fx#easing easing}: 'elasticIn',
+    {@link Ext.Fx#callback callback}: this.foo,
+    {@link Ext.Fx#scope scope}: this
+};
+// animation with some options set
+el.setWidth(100, opt);
+ * </code></pre>
+ * <p>The Element animation object being used for the animation will be set on the options
+ * object as "anim", which allows you to stop or manipulate the animation. Here is an example:</p>
+ * <pre><code>
+// using the "anim" property to get the Anim object
+if(opt.anim.isAnimated()){
+    opt.anim.stop();
+}
+ * </code></pre>
+ * <p>Also see the <tt>{@link #animate}</tt> method for another animation technique.</p>
+ * <p><b> Composite (Collections of) Elements</b></p>
+ * <p>For working with collections of Elements, see {@link Ext.CompositeElement}</p>
+ * @constructor Create a new Element directly.
+ * @param {String/HTMLElement} element
+ * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class).
  */
-Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
-    // private
-    monitorResize:true,
-    // private
-    rendered : false,
+(function(){
+var DOC = document;
 
-    // private
-    onLayout : function(ct, target){
-        var collapsed;
-        if(!this.rendered){
-            target.addClass('x-border-layout-ct');
-            var items = ct.items.items;
-            collapsed = [];
-            for(var i = 0, len = items.length; i < len; i++) {
-                var c = items[i];
-                var pos = c.region;
-                if(c.collapsed){
-                    collapsed.push(c);
-                }
-                c.collapsed = false;
-                if(!c.rendered){
-                    c.cls = c.cls ? c.cls +' x-border-panel' : 'x-border-panel';
-                    c.render(target, i);
-                }
-                this[pos] = pos != 'center' && c.split ?
-                    new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
-                    new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
-                this[pos].render(target, c);
-            }
-            this.rendered = true;
-        }
+Ext.Element = function(element, forceNew){
+    var dom = typeof element == "string" ?
+              DOC.getElementById(element) : element,
+        id;
 
-        var size = target.getViewSize();
-        if(size.width < 20 || size.height < 20){ // display none?
-            if(collapsed){
-                this.restoreCollapsed = collapsed;
-            }
-            return;
-        }else if(this.restoreCollapsed){
-            collapsed = this.restoreCollapsed;
-            delete this.restoreCollapsed;
-        }
+    if(!dom) return null;
 
-        var w = size.width, h = size.height;
-        var centerW = w, centerH = h, centerY = 0, centerX = 0;
+    id = dom.id;
 
-        var n = this.north, s = this.south, west = this.west, e = this.east, c = this.center;
-        if(!c && Ext.layout.BorderLayout.WARN !== false){
-            throw 'No center region defined in BorderLayout ' + ct.id;
-        }
+    if(!forceNew && id && Ext.elCache[id]){ // element object already exists
+        return Ext.elCache[id].el;
+    }
 
-        if(n && n.isVisible()){
-            var b = n.getSize();
-            var m = n.getMargins();
-            b.width = w - (m.left+m.right);
-            b.x = m.left;
-            b.y = m.top;
-            centerY = b.height + b.y + m.bottom;
-            centerH -= centerY;
-            n.applyLayout(b);
-        }
-        if(s && s.isVisible()){
-            var b = s.getSize();
-            var m = s.getMargins();
-            b.width = w - (m.left+m.right);
-            b.x = m.left;
-            var totalHeight = (b.height + m.top + m.bottom);
-            b.y = h - totalHeight + m.top;
-            centerH -= totalHeight;
-            s.applyLayout(b);
-        }
-        if(west && west.isVisible()){
-            var b = west.getSize();
-            var m = west.getMargins();
-            b.height = centerH - (m.top+m.bottom);
-            b.x = m.left;
-            b.y = centerY + m.top;
-            var totalWidth = (b.width + m.left + m.right);
-            centerX += totalWidth;
-            centerW -= totalWidth;
-            west.applyLayout(b);
-        }
-        if(e && e.isVisible()){
-            var b = e.getSize();
-            var m = e.getMargins();
-            b.height = centerH - (m.top+m.bottom);
-            var totalWidth = (b.width + m.left + m.right);
-            b.x = w - totalWidth + m.left;
-            b.y = centerY + m.top;
-            centerW -= totalWidth;
-            e.applyLayout(b);
-        }
-        if(c){
-            var m = c.getMargins();
-            var centerBox = {
-                x: centerX + m.left,
-                y: centerY + m.top,
-                width: centerW - (m.left+m.right),
-                height: centerH - (m.top+m.bottom)
-            };
-            c.applyLayout(centerBox);
-        }
-        if(collapsed){
-            for(var i = 0, len = collapsed.length; i < len; i++){
-                collapsed[i].collapse(false);
-            }
-        }
-        if(Ext.isIE && Ext.isStrict){ // workaround IE strict repainting issue
-            target.repaint();
-        }
-    },
+    /**
+     * The DOM element
+     * @type HTMLElement
+     */
+    this.dom = dom;
 
-    destroy: function() {
-        var r = ['north', 'south', 'east', 'west'];
-        for (var i = 0; i < r.length; i++) {
-            var region = this[r[i]];
-            if(region){
-                if(region.destroy){
-                    region.destroy();
-                }else if (region.split){
-                    region.split.destroy(true);
+    /**
+     * The DOM element ID
+     * @type String
+     */
+    this.id = id || Ext.id(dom);
+};
+
+var D = Ext.lib.Dom,
+    DH = Ext.DomHelper,
+    E = Ext.lib.Event,
+    A = Ext.lib.Anim,
+    El = Ext.Element,
+    EC = Ext.elCache;
+
+El.prototype = {
+    /**
+     * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function)
+     * @param {Object} o The object with the attributes
+     * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos.
+     * @return {Ext.Element} this
+     */
+    set : function(o, useSet){
+        var el = this.dom,
+            attr,
+            val,
+            useSet = (useSet !== false) && !!el.setAttribute;
+
+        for(attr in o){
+            if (o.hasOwnProperty(attr)) {
+                val = o[attr];
+                if (attr == 'style') {
+                    DH.applyStyles(el, val);
+                } else if (attr == 'cls') {
+                    el.className = val;
+                } else if (useSet) {
+                    el.setAttribute(attr, val);
+                } else {
+                    el[attr] = val;
                 }
             }
         }
-        Ext.layout.BorderLayout.superclass.destroy.call(this);
-    }
+        return this;
+    },
 
+//  Mouse events
     /**
-     * @property activeItem
-     * @hide
+     * @event click
+     * Fires when a mouse click is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event contextmenu
+     * Fires when a right click is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event dblclick
+     * Fires when a mouse double click is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mousedown
+     * Fires when a mousedown is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mouseup
+     * Fires when a mouseup is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mouseover
+     * Fires when a mouseover is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mousemove
+     * Fires when a mousemove is detected with the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mouseout
+     * Fires when a mouseout is detected with the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mouseenter
+     * Fires when the mouse enters the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event mouseleave
+     * Fires when the mouse leaves the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-});
 
-/**
- * @class Ext.layout.BorderLayout.Region
- * <p>This is a region of a {@link Ext.layout.BorderLayout BorderLayout} that acts as a subcontainer
- * within the layout.  Each region has its own {@link Ext.layout.ContainerLayout layout} that is
- * independent of other regions and the containing BorderLayout, and can be any of the
- * {@link Ext.layout.ContainerLayout valid Ext layout types}.</p>
- * <p>Region size is managed automatically and cannot be changed by the user -- for
- * {@link #split resizable regions}, see {@link Ext.layout.BorderLayout.SplitRegion}.</p>
- * @constructor
- * Create a new Region.
- * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region.
- * @param {Object} config The configuration options
- * @param {String} position The region position.  Valid values are: <tt>north</tt>, <tt>south</tt>,
- * <tt>east</tt>, <tt>west</tt> and <tt>center</tt>.  Every {@link Ext.layout.BorderLayout BorderLayout}
- * <b>must have a center region</b> for the primary content -- all other regions are optional.
- */
-Ext.layout.BorderLayout.Region = function(layout, config, pos){
-    Ext.apply(this, config);
-    this.layout = layout;
-    this.position = pos;
-    this.state = {};
-    if(typeof this.margins == 'string'){
-        this.margins = this.layout.parseMargins(this.margins);
-    }
-    this.margins = Ext.applyIf(this.margins || {}, this.defaultMargins);
-    if(this.collapsible){
-        if(typeof this.cmargins == 'string'){
-            this.cmargins = this.layout.parseMargins(this.cmargins);
-        }
-        if(this.collapseMode == 'mini' && !this.cmargins){
-            this.cmargins = {left:0,top:0,right:0,bottom:0};
-        }else{
-            this.cmargins = Ext.applyIf(this.cmargins || {},
-                pos == 'north' || pos == 'south' ? this.defaultNSCMargins : this.defaultEWCMargins);
-        }
-    }
-};
+//  Keyboard events
+    /**
+     * @event keypress
+     * Fires when a keypress is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event keydown
+     * Fires when a keydown is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event keyup
+     * Fires when a keyup is detected within the element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
 
-Ext.layout.BorderLayout.Region.prototype = {
+
+//  HTML frame/object events
     /**
-     * @cfg {Boolean} animFloat
-     * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated
-     * panel that will close again once the user mouses out of that panel (or clicks out if
-     * <tt>{@link #autoHide} = false</tt>).  Setting <tt>{@link #animFloat} = false</tt> will
-     * prevent the open and close of these floated panels from being animated (defaults to <tt>true</tt>).
+     * @event load
+     * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * @cfg {Boolean} autoHide
-     * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated
-     * panel.  If <tt>autoHide = true</tt>, the panel will automatically hide after the user mouses
-     * out of the panel.  If <tt>autoHide = false</tt>, the panel will continue to display until the
-     * user clicks outside of the panel (defaults to <tt>true</tt>).
+     * @event unload
+     * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * @cfg {String} collapseMode
-     * <tt>collapseMode</tt> supports two configuration values:<div class="mdetail-params"><ul>
-     * <li><b><tt>undefined</tt></b> (default)<div class="sub-desc">By default, {@link #collapsible}
-     * regions are collapsed by clicking the expand/collapse tool button that renders into the region's
-     * title bar.</div></li>
-     * <li><b><tt>'mini'</tt></b><div class="sub-desc">Optionally, when <tt>collapseMode</tt> is set to
-     * <tt>'mini'</tt> the region's split bar will also display a small collapse button in the center of
-     * the bar. In <tt>'mini'</tt> mode the region will collapse to a thinner bar than in normal mode.
-     * </div></li>
-     * </ul></div></p>
-     * <p><b>Note</b>: if a collapsible region does not have a title bar, then set <tt>collapseMode =
-     * 'mini'</tt> and <tt>{@link #split} = true</tt> in order for the region to be {@link #collapsible}
-     * by the user as the expand/collapse tool button (that would go in the title bar) will not be rendered.</p>
-     * <p>See also <tt>{@link #cmargins}</tt>.</p>
+     * @event abort
+     * Fires when an object/image is stopped from loading before completely loaded.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * @cfg {Object} margins
-     * An object containing margins to apply to the region when in the expanded state in the
-     * format:<pre><code>
-{
-    top: (top margin),
-    right: (right margin),
-    bottom: (bottom margin),
-    left: (left margin)
-}</code></pre>
-     * <p>May also be a string containing space-separated, numeric margin values. The order of the
-     * sides associated with each value matches the way CSS processes margin values:</p>
-     * <p><div class="mdetail-params"><ul>
-     * <li>If there is only one value, it applies to all sides.</li>
-     * <li>If there are two values, the top and bottom borders are set to the first value and the
-     * right and left are set to the second.</li>
-     * <li>If there are three values, the top is set to the first value, the left and right are set
-     * to the second, and the bottom is set to the third.</li>
-     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
-     * </ul></div></p>
-     * <p>Defaults to:</p><pre><code>
-     * {top:0, right:0, bottom:0, left:0}
-     * </code></pre>
+     * @event error
+     * Fires when an object/image/frame cannot be loaded properly.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * @cfg {Object} cmargins
-     * An object containing margins to apply to the region when in the collapsed state in the
-     * format:<pre><code>
-{
-    top: (top margin),
-    right: (right margin),
-    bottom: (bottom margin),
-    left: (left margin)
-}</code></pre>
-     * <p>May also be a string containing space-separated, numeric margin values. The order of the
-     * sides associated with each value matches the way CSS processes margin values.</p>
-     * <p><ul>
-     * <li>If there is only one value, it applies to all sides.</li>
-     * <li>If there are two values, the top and bottom borders are set to the first value and the
-     * right and left are set to the second.</li>
-     * <li>If there are three values, the top is set to the first value, the left and right are set
-     * to the second, and the bottom is set to the third.</li>
-     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
-     * </ul></p>
+     * @event resize
+     * Fires when a document view is resized.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * @cfg {Boolean} collapsible
-     * <p><tt>true</tt> to allow the user to collapse this region (defaults to <tt>false</tt>).  If
-     * <tt>true</tt>, an expand/collapse tool button will automatically be rendered into the title
-     * bar of the region, otherwise the button will not be shown.</p>
-     * <p><b>Note</b>: that a title bar is required to display the collapse/expand toggle button -- if
-     * no <tt>title</tt> is specified for the region's panel, the region will only be collapsible if
-     * <tt>{@link #collapseMode} = 'mini'</tt> and <tt>{@link #split} = true</tt>.
+     * @event scroll
+     * Fires when a document view is scrolled.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    collapsible : false,
+
+//  Form events
     /**
-     * @cfg {Boolean} split
-     * <p><tt>true</tt> to create a {@link Ext.layout.BorderLayout.SplitRegion SplitRegion} and 
-     * display a 5px wide {@link Ext.SplitBar} between this region and its neighbor, allowing the user to
-     * resize the regions dynamically.  Defaults to <tt>false</tt> creating a
-     * {@link Ext.layout.BorderLayout.Region Region}.</p><br>
-     * <p><b>Notes</b>:</p><div class="mdetail-params"><ul>
-     * <li>this configuration option is ignored if <tt>region='center'</tt></li> 
-     * <li>when <tt>split == true</tt>, it is common to specify a
-     * <tt>{@link Ext.SplitBar#minSize minSize}</tt> and <tt>{@link Ext.SplitBar#maxSize maxSize}</tt>
-     * for the {@link Ext.BoxComponent BoxComponent} representing the region. These are not native
-     * configs of {@link Ext.BoxComponent BoxComponent}, and are used only by this class.</li>
-     * <li>if <tt>{@link #collapseMode} = 'mini'</tt> requires <tt>split = true</tt> to reserve space
-     * for the collapse tool</tt></li> 
-     * </ul></div> 
+     * @event select
+     * Fires when a user selects some text in a text field, including input and textarea.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    split:false,
     /**
-     * @cfg {Boolean} floatable
-     * <tt>true</tt> to allow clicking a collapsed region's bar to display the region's panel floated
-     * above the layout, <tt>false</tt> to force the user to fully expand a collapsed region by
-     * clicking the expand button to see it again (defaults to <tt>true</tt>).
+     * @event change
+     * Fires when a control loses the input focus and its value has been modified since gaining focus.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    floatable: true,
     /**
-     * @cfg {Number} minWidth
-     * <p>The minimum allowable width in pixels for this region (defaults to <tt>50</tt>).
-     * <tt>maxWidth</tt> may also be specified.</p><br>
-     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> / 
-     * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified 
-     * <tt>minWidth</tt> / <tt>maxWidth</tt>.</p>
+     * @event submit
+     * Fires when a form is submitted.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    minWidth:50,
     /**
-     * @cfg {Number} minHeight
-     * The minimum allowable height in pixels for this region (defaults to <tt>50</tt>)
-     * <tt>maxHeight</tt> may also be specified.</p><br>
-     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> / 
-     * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified 
-     * <tt>minHeight</tt> / <tt>maxHeight</tt>.</p>
+     * @event reset
+     * Fires when a form is reset.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event focus
+     * Fires when an element receives focus either via the pointing device or by tab navigation.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event blur
+     * Fires when an element loses focus either via the pointing device or by tabbing navigation.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    minHeight:50,
 
-    // private
-    defaultMargins : {left:0,top:0,right:0,bottom:0},
-    // private
-    defaultNSCMargins : {left:5,top:5,right:5,bottom:5},
-    // private
-    defaultEWCMargins : {left:5,top:0,right:5,bottom:0},
-    floatingZIndex: 100,
+//  User Interface events
+    /**
+     * @event DOMFocusIn
+     * Where supported. Similar to HTML focus event, but can be applied to any focusable element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event DOMFocusOut
+     * Where supported. Similar to HTML blur event, but can be applied to any focusable element.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event DOMActivate
+     * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
 
+//  DOM Mutation events
+    /**
+     * @event DOMSubtreeModified
+     * Where supported. Fires when the subtree is modified.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event DOMNodeInserted
+     * Where supported. Fires when a node has been added as a child of another node.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
     /**
-     * True if this region is collapsed. Read-only.
-     * @type Boolean
-     * @property
+     * @event DOMNodeRemoved
+     * Where supported. Fires when a descendant node of the element is removed.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
-    isCollapsed : false,
-
     /**
-     * This region's panel.  Read-only.
-     * @type Ext.Panel
-     * @property panel
+     * @event DOMNodeRemovedFromDocument
+     * Where supported. Fires when a node is being removed from a document.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * This region's layout.  Read-only.
-     * @type Layout
-     * @property layout
+     * @event DOMNodeInsertedIntoDocument
+     * Where supported. Fires when a node is being inserted into a document.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
     /**
-     * This region's layout position (north, south, east, west or center).  Read-only.
-     * @type String
-     * @property position
+     * @event DOMAttrModified
+     * Where supported. Fires when an attribute has been modified.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
+     */
+    /**
+     * @event DOMCharacterDataModified
+     * Where supported. Fires when the character data has been modified.
+     * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event.
+     * @param {HtmlElement} t The target of the event.
+     * @param {Object} o The options configuration passed to the {@link #addListener} call.
      */
 
-    // private
-    render : function(ct, p){
-        this.panel = p;
-        p.el.enableDisplayMode();
-        this.targetEl = ct;
-        this.el = p.el;
-
-        var gs = p.getState, ps = this.position;
-        p.getState = function(){
-            return Ext.apply(gs.call(p) || {}, this.state);
-        }.createDelegate(this);
+    /**
+     * The default unit to append to CSS values where a unit isn't provided (defaults to px).
+     * @type String
+     */
+    defaultUnit : "px",
 
-        if(ps != 'center'){
-            p.allowQueuedExpand = false;
-            p.on({
-                beforecollapse: this.beforeCollapse,
-                collapse: this.onCollapse,
-                beforeexpand: this.beforeExpand,
-                expand: this.onExpand,
-                hide: this.onHide,
-                show: this.onShow,
-                scope: this
-            });
-            if(this.collapsible || this.floatable){
-                p.collapseEl = 'el';
-                p.slideAnchor = this.getSlideAnchor();
-            }
-            if(p.tools && p.tools.toggle){
-                p.tools.toggle.addClass('x-tool-collapse-'+ps);
-                p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over');
-            }
-        }
+    /**
+     * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child)
+     * @param {String} selector The simple selector to test
+     * @return {Boolean} True if this element matches the selector, else false
+     */
+    is : function(simpleSelector){
+        return Ext.DomQuery.is(this.dom, simpleSelector);
     },
 
-    // private
-    getCollapsedEl : function(){
-        if(!this.collapsedEl){
-            if(!this.toolTemplate){
-                var tt = new Ext.Template(
-                     '<div class="x-tool x-tool-{id}">&#160;</div>'
-                );
-                tt.disableFormats = true;
-                tt.compile();
-                Ext.layout.BorderLayout.Region.prototype.toolTemplate = tt;
-            }
-            this.collapsedEl = this.targetEl.createChild({
-                cls: "x-layout-collapsed x-layout-collapsed-"+this.position,
-                id: this.panel.id + '-xcollapsed'
-            });
-            this.collapsedEl.enableDisplayMode('block');
-
-            if(this.collapseMode == 'mini'){
-                this.collapsedEl.addClass('x-layout-cmini-'+this.position);
-                this.miniCollapsedEl = this.collapsedEl.createChild({
-                    cls: "x-layout-mini x-layout-mini-"+this.position, html: "&#160;"
-                });
-                this.miniCollapsedEl.addClassOnOver('x-layout-mini-over');
-                this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
-                this.collapsedEl.on('click', this.onExpandClick, this, {stopEvent:true});
-            }else {
-                if(this.collapsible !== false && !this.hideCollapseTool) {
-                    var t = this.toolTemplate.append(
-                            this.collapsedEl.dom,
-                            {id:'expand-'+this.position}, true);
-                    t.addClassOnOver('x-tool-expand-'+this.position+'-over');
-                    t.on('click', this.onExpandClick, this, {stopEvent:true});
-                }
-                if(this.floatable !== false || this.titleCollapse){
-                   this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
-                   this.collapsedEl.on("click", this[this.floatable ? 'collapseClick' : 'onExpandClick'], this);
-                }
+    /**
+     * Tries to focus the element. Any exceptions are caught and ignored.
+     * @param {Number} defer (optional) Milliseconds to defer the focus
+     * @return {Ext.Element} this
+     */
+    focus : function(defer, /* private */ dom) {
+        var me = this,
+            dom = dom || me.dom;
+        try{
+            if(Number(defer)){
+                me.focus.defer(defer, null, [null, dom]);
+            }else{
+                dom.focus();
             }
-        }
-        return this.collapsedEl;
+        }catch(e){}
+        return me;
     },
 
-    // private
-    onExpandClick : function(e){
-        if(this.isSlid){
-            this.afterSlideIn();
-            this.panel.expand(false);
-        }else{
-            this.panel.expand();
-        }
+    /**
+     * Tries to blur the element. Any exceptions are caught and ignored.
+     * @return {Ext.Element} this
+     */
+    blur : function() {
+        try{
+            this.dom.blur();
+        }catch(e){}
+        return this;
     },
 
-    // private
-    onCollapseClick : function(e){
-        this.panel.collapse();
+    /**
+     * Returns the value of the "value" attribute
+     * @param {Boolean} asNumber true to parse the value as a number
+     * @return {String/Number}
+     */
+    getValue : function(asNumber){
+        var val = this.dom.value;
+        return asNumber ? parseInt(val, 10) : val;
     },
 
-    // private
-    beforeCollapse : function(p, animate){
-        this.lastAnim = animate;
-        if(this.splitEl){
-            this.splitEl.hide();
-        }
-        this.getCollapsedEl().show();
-        this.panel.el.setStyle('z-index', 100);
-        this.isCollapsed = true;
-        this.layout.layout();
+    /**
+     * Appends an event handler to this element.  The shorthand version {@link #on} is equivalent.
+     * @param {String} eventName The name of event to handle.
+     * @param {Function} fn The handler function the event invokes. This function is passed
+     * the following parameters:<ul>
+     * <li><b>evt</b> : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>
+     * <li><b>el</b> : HtmlElement<div class="sub-desc">The DOM element which was the target of the event.
+     * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
+     * <li><b>o</b> : Object<div class="sub-desc">The options object from the addListener call.</div></li>
+     * </ul>
+     * @param {Object} scope (optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
+     * <b>If omitted, defaults to this Element.</b>.
+     * @param {Object} options (optional) An object containing handler configuration properties.
+     * This may contain any of the following properties:<ul>
+     * <li><b>scope</b> Object : <div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
+     * <b>If omitted, defaults to this Element.</b></div></li>
+     * <li><b>delegate</b> String: <div class="sub-desc">A simple selector to filter the target or look for a descendant of the target. See below for additional details.</div></li>
+     * <li><b>stopEvent</b> Boolean: <div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>
+     * <li><b>preventDefault</b> Boolean: <div class="sub-desc">True to prevent the default action</div></li>
+     * <li><b>stopPropagation</b> Boolean: <div class="sub-desc">True to prevent event propagation</div></li>
+     * <li><b>normalized</b> Boolean: <div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>
+     * <li><b>target</b> Ext.Element: <div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>
+     * <li><b>delay</b> Number: <div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
+     * <li><b>single</b> Boolean: <div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
+     * <li><b>buffer</b> Number: <div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
+     * by the specified number of milliseconds. If the event fires again within that time, the original
+     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
+     * </ul><br>
+     * <p>
+     * <b>Combining Options</b><br>
+     * In the following examples, the shorthand form {@link #on} is used rather than the more verbose
+     * addListener.  The two are equivalent.  Using the options argument, it is possible to combine different
+     * types of listeners:<br>
+     * <br>
+     * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the
+     * options object. The options object is available as the third parameter in the handler function.<div style="margin: 5px 20px 20px;">
+     * Code:<pre><code>
+el.on('click', this.onClick, this, {
+    single: true,
+    delay: 100,
+    stopEvent : true,
+    forumId: 4
+});</code></pre></p>
+     * <p>
+     * <b>Attaching multiple handlers in 1 call</b><br>
+     * The method also allows for a single argument to be passed which is a config object containing properties
+     * which specify multiple handlers.</p>
+     * <p>
+     * Code:<pre><code>
+el.on({
+    'click' : {
+        fn: this.onClick,
+        scope: this,
+        delay: 100
     },
-
-    // private
-    onCollapse : function(animate){
-        this.panel.el.setStyle('z-index', 1);
-        if(this.lastAnim === false || this.panel.animCollapse === false){
-            this.getCollapsedEl().dom.style.visibility = 'visible';
-        }else{
-            this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2});
-        }
-        this.state.collapsed = true;
-        this.panel.saveState();
+    'mouseover' : {
+        fn: this.onMouseOver,
+        scope: this
     },
-
-    // private
-    beforeExpand : function(animate){
-        var c = this.getCollapsedEl();
-        this.el.show();
-        if(this.position == 'east' || this.position == 'west'){
-            this.panel.setSize(undefined, c.getHeight());
-        }else{
-            this.panel.setSize(c.getWidth(), undefined);
-        }
-        c.hide();
-        c.dom.style.visibility = 'hidden';
-        this.panel.el.setStyle('z-index', this.floatingZIndex);
+    'mouseout' : {
+        fn: this.onMouseOut,
+        scope: this
+    }
+});</code></pre>
+     * <p>
+     * Or a shorthand syntax:<br>
+     * Code:<pre><code></p>
+el.on({
+    'click' : this.onClick,
+    'mouseover' : this.onMouseOver,
+    'mouseout' : this.onMouseOut,
+    scope: this
+});
+     * </code></pre></p>
+     * <p><b>delegate</b></p>
+     * <p>This is a configuration option that you can pass along when registering a handler for
+     * an event to assist with event delegation. Event delegation is a technique that is used to
+     * reduce memory consumption and prevent exposure to memory-leaks. By registering an event
+     * for a container element as opposed to each element within a container. By setting this
+     * configuration option to a simple selector, the target element will be filtered to look for
+     * a descendant of the target.
+     * For example:<pre><code>
+// using this markup:
+&lt;div id='elId'>
+    &lt;p id='p1'>paragraph one&lt;/p>
+    &lt;p id='p2' class='clickable'>paragraph two&lt;/p>
+    &lt;p id='p3'>paragraph three&lt;/p>
+&lt;/div>
+// utilize event delegation to registering just one handler on the container element:
+el = Ext.get('elId');
+el.on(
+    'click',
+    function(e,t) {
+        // handle click
+        console.info(t.id); // 'p2'
+    },
+    this,
+    {
+        // filter the target element to be a descendant with the class 'clickable'
+        delegate: '.clickable'
+    }
+);
+     * </code></pre></p>
+     * @return {Ext.Element} this
+     */
+    addListener : function(eventName, fn, scope, options){
+        Ext.EventManager.on(this.dom,  eventName, fn, scope || this, options);
+        return this;
     },
 
-    // private
-    onExpand : function(){
-        this.isCollapsed = false;
-        if(this.splitEl){
-            this.splitEl.show();
-        }
-        this.layout.layout();
-        this.panel.el.setStyle('z-index', 1);
-        this.state.collapsed = false;
-        this.panel.saveState();
+    /**
+     * Removes an event handler from this element.  The shorthand version {@link #un} is equivalent.
+     * <b>Note</b>: if a <i>scope</i> was explicitly specified when {@link #addListener adding} the
+     * listener, the same scope must be specified here.
+     * Example:
+     * <pre><code>
+el.removeListener('click', this.handlerFn);
+// or
+el.un('click', this.handlerFn);
+</code></pre>
+     * @param {String} eventName The name of the event from which to remove the handler.
+     * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
+     * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,
+     * then this must refer to the same object.
+     * @return {Ext.Element} this
+     */
+    removeListener : function(eventName, fn, scope){
+        Ext.EventManager.removeListener(this.dom,  eventName, fn, scope || this);
+        return this;
     },
 
-    // private
-    collapseClick : function(e){
-        if(this.isSlid){
-           e.stopPropagation();
-           this.slideIn();
-        }else{
-           e.stopPropagation();
-           this.slideOut();
-        }
+    /**
+     * Removes all previous added listeners from this element
+     * @return {Ext.Element} this
+     */
+    removeAllListeners : function(){
+        Ext.EventManager.removeAll(this.dom);
+        return this;
     },
 
-    // private
-    onHide : function(){
-        if(this.isCollapsed){
-            this.getCollapsedEl().hide();
-        }else if(this.splitEl){
-            this.splitEl.hide();
+    /**
+     * Recursively removes all previous added listeners from this element and its children
+     * @return {Ext.Element} this
+     */
+    purgeAllListeners : function() {
+        Ext.EventManager.purgeElement(this, true);
+        return this;
+    },
+    /**
+     * @private Test if size has a unit, otherwise appends the default
+     */
+    addUnits : function(size){
+        if(size === "" || size == "auto" || size === undefined){
+            size = size || '';
+        } else if(!isNaN(size) || !unitPattern.test(size)){
+            size = size + (this.defaultUnit || 'px');
         }
+        return size;
     },
 
-    // private
-    onShow : function(){
-        if(this.isCollapsed){
-            this.getCollapsedEl().show();
-        }else if(this.splitEl){
-            this.splitEl.show();
-        }
+    /**
+     * <p>Updates the <a href="http://developer.mozilla.org/en/DOM/element.innerHTML">innerHTML</a> of this Element
+     * from a specified URL. Note that this is subject to the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">Same Origin Policy</a></p>
+     * <p>Updating innerHTML of an element will <b>not</b> execute embedded <tt>&lt;script></tt> elements. This is a browser restriction.</p>
+     * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying
+     * exactly how to request the HTML.
+     * @return {Ext.Element} this
+     */
+    load : function(url, params, cb){
+        Ext.Ajax.request(Ext.apply({
+            params: params,
+            url: url.url || url,
+            callback: cb,
+            el: this.dom,
+            indicatorText: url.indicatorText || ''
+        }, Ext.isObject(url) ? url : {}));
+        return this;
     },
 
     /**
-     * True if this region is currently visible, else false.
+     * Tests various css rules/browsers to determine if this element uses a border box
      * @return {Boolean}
      */
-    isVisible : function(){
-        return !this.panel.hidden;
+    isBorderBox : function(){
+        return noBoxAdjust[(this.dom.tagName || "").toLowerCase()] || Ext.isBorderBox;
     },
 
     /**
-     * Returns the current margins for this region.  If the region is collapsed, the
-     * {@link #cmargins} (collapsed margins) value will be returned, otherwise the
-     * {@link #margins} value will be returned.
-     * @return {Object} An object containing the element's margins: <tt>{left: (left
-     * margin), top: (top margin), right: (right margin), bottom: (bottom margin)}</tt>
+     * <p>Removes this element's dom reference.  Note that event and cache removal is handled at {@link Ext#removeNode}</p>
      */
-    getMargins : function(){
-        return this.isCollapsed && this.cmargins ? this.cmargins : this.margins;
+    remove : function(){
+        var me = this,
+            dom = me.dom;
+
+        if (dom) {
+            delete me.dom;
+            Ext.removeNode(dom);
+        }
     },
 
     /**
-     * Returns the current size of this region.  If the region is collapsed, the size of the
-     * collapsedEl will be returned, otherwise the size of the region's panel will be returned.
-     * @return {Object} An object containing the element's size: <tt>{width: (element width),
-     * height: (element height)}</tt>
+     * Sets up event handlers to call the passed functions when the mouse is moved into and out of the Element.
+     * @param {Function} overFn The function to call when the mouse enters the Element.
+     * @param {Function} outFn The function to call when the mouse leaves the Element.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the functions are executed. Defaults to the Element's DOM element.
+     * @param {Object} options (optional) Options for the listener. See {@link Ext.util.Observable#addListener the <tt>options</tt> parameter}.
+     * @return {Ext.Element} this
      */
-    getSize : function(){
-        return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize();
+    hover : function(overFn, outFn, scope, options){
+        var me = this;
+        me.on('mouseenter', overFn, scope || me.dom, options);
+        me.on('mouseleave', outFn, scope || me.dom, options);
+        return me;
     },
 
     /**
-     * Sets the specified panel as the container element for this region.
-     * @param {Ext.Panel} panel The new panel
+     * Returns true if this element is an ancestor of the passed element
+     * @param {HTMLElement/String} el The element to check
+     * @return {Boolean} True if this element is an ancestor of el, else false
      */
-    setPanel : function(panel){
-        this.panel = panel;
+    contains : function(el){
+        return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el);
     },
 
     /**
-     * Returns the minimum allowable width for this region.
-     * @return {Number} The minimum width
+     * Returns the value of a namespaced attribute from the element's underlying DOM node.
+     * @param {String} namespace The namespace in which to look for the attribute
+     * @param {String} name The attribute name
+     * @return {String} The attribute value
+     * @deprecated
      */
-    getMinWidth: function(){
-        return this.minWidth;
+    getAttributeNS : function(ns, name){
+        return this.getAttribute(name, ns);
     },
 
     /**
-     * Returns the minimum allowable height for this region.
-     * @return {Number} The minimum height
+     * Returns the value of an attribute from the element's underlying DOM node.
+     * @param {String} name The attribute name
+     * @param {String} namespace (optional) The namespace in which to look for the attribute
+     * @return {String} The attribute value
      */
-    getMinHeight: function(){
-        return this.minHeight;
-    },
+    getAttribute : Ext.isIE ? function(name, ns){
+        var d = this.dom,
+            type = typeof d[ns + ":" + name];
 
-    // private
-    applyLayoutCollapsed : function(box){
-        var ce = this.getCollapsedEl();
-        ce.setLeftTop(box.x, box.y);
-        ce.setSize(box.width, box.height);
+        if(['undefined', 'unknown'].indexOf(type) == -1){
+            return d[ns + ":" + name];
+        }
+        return d[name];
+    } : function(name, ns){
+        var d = this.dom;
+        return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name];
     },
 
-    // private
-    applyLayout : function(box){
-        if(this.isCollapsed){
-            this.applyLayoutCollapsed(box);
-        }else{
-            this.panel.setPosition(box.x, box.y);
-            this.panel.setSize(box.width, box.height);
+    /**
+    * Update the innerHTML of this element
+    * @param {String} html The new HTML
+    * @return {Ext.Element} this
+     */
+    update : function(html) {
+        if (this.dom) {
+            this.dom.innerHTML = html;
         }
-    },
+        return this;
+    }
+};
 
-    // private
-    beforeSlide: function(){
-        this.panel.beforeEffect();
+var ep = El.prototype;
+
+El.addMethods = function(o){
+   Ext.apply(ep, o);
+};
+
+/**
+ * Appends an event handler (shorthand for {@link #addListener}).
+ * @param {String} eventName The name of event to handle.
+ * @param {Function} fn The handler function the event invokes.
+ * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function is executed.
+ * @param {Object} options (optional) An object containing standard {@link #addListener} options
+ * @member Ext.Element
+ * @method on
+ */
+ep.on = ep.addListener;
+
+/**
+ * Removes an event handler from this element (see {@link #removeListener} for additional notes).
+ * @param {String} eventName The name of the event from which to remove the handler.
+ * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
+ * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,
+ * then this must refer to the same object.
+ * @return {Ext.Element} this
+ * @member Ext.Element
+ * @method un
+ */
+ep.un = ep.removeListener;
+
+/**
+ * true to automatically adjust width and height settings for box-model issues (default to true)
+ */
+ep.autoBoxAdjust = true;
+
+// private
+var unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,
+    docEl;
+
+/**
+ * @private
+ */
+
+/**
+ * Retrieves Ext.Element objects.
+ * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method
+ * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by
+ * its ID, use {@link Ext.ComponentMgr#get}.</p>
+ * <p>Uses simple caching to consistently return the same object. Automatically fixes if an
+ * object was recreated with the same id via AJAX or DOM.</p>
+ * @param {Mixed} el The id of the node, a DOM Node or an existing Element.
+ * @return {Element} The Element object (or null if no matching element was found)
+ * @static
+ * @member Ext.Element
+ * @method get
+ */
+El.get = function(el){
+    var ex,
+        elm,
+        id;
+    if(!el){ return null; }
+    if (typeof el == "string") { // element id
+        if (!(elm = DOC.getElementById(el))) {
+            return null;
+        }
+        if (EC[el] && EC[el].el) {
+            ex = EC[el].el;
+            ex.dom = elm;
+        } else {
+            ex = El.addToCache(new El(elm));
+        }
+        return ex;
+    } else if (el.tagName) { // dom element
+        if(!(id = el.id)){
+            id = Ext.id(el);
+        }
+        if (EC[id] && EC[id].el) {
+            ex = EC[id].el;
+            ex.dom = el;
+        } else {
+            ex = El.addToCache(new El(el));
+        }
+        return ex;
+    } else if (el instanceof El) {
+        if(el != docEl){
+            el.dom = DOC.getElementById(el.id) || el.dom; // refresh dom element in case no longer valid,
+                                                          // catch case where it hasn't been appended
+        }
+        return el;
+    } else if(el.isComposite) {
+        return el;
+    } else if(Ext.isArray(el)) {
+        return El.select(el);
+    } else if(el == DOC) {
+        // create a bogus element object representing the document object
+        if(!docEl){
+            var f = function(){};
+            f.prototype = El.prototype;
+            docEl = new f();
+            docEl.dom = DOC;
+        }
+        return docEl;
+    }
+    return null;
+};
+
+El.addToCache = function(el, id){
+    id = id || el.id;
+    EC[id] = {
+        el:  el,
+        data: {},
+        events: {}
+    };
+    return el;
+};
+
+// private method for getting and setting element data
+El.data = function(el, key, value){
+    el = El.get(el);
+    if (!el) {
+        return null;
+    }
+    var c = EC[el.id].data;
+    if(arguments.length == 2){
+        return c[key];
+    }else{
+        return (c[key] = value);
+    }
+};
+
+// private
+// Garbage collection - uncache elements/purge listeners on orphaned elements
+// so we don't hold a reference and cause the browser to retain them
+function garbageCollect(){
+    if(!Ext.enableGarbageCollector){
+        clearInterval(El.collectorThreadId);
+    } else {
+        var eid,
+            el,
+            d,
+            o;
+
+        for(eid in EC){
+            o = EC[eid];
+            if(o.skipGC){
+                continue;
+            }
+            el = o.el;
+            d = el.dom;
+            // -------------------------------------------------------
+            // Determining what is garbage:
+            // -------------------------------------------------------
+            // !d
+            // dom node is null, definitely garbage
+            // -------------------------------------------------------
+            // !d.parentNode
+            // no parentNode == direct orphan, definitely garbage
+            // -------------------------------------------------------
+            // !d.offsetParent && !document.getElementById(eid)
+            // display none elements have no offsetParent so we will
+            // also try to look it up by it's id. However, check
+            // offsetParent first so we don't do unneeded lookups.
+            // This enables collection of elements that are not orphans
+            // directly, but somewhere up the line they have an orphan
+            // parent.
+            // -------------------------------------------------------
+            if(!d || !d.parentNode || (!d.offsetParent && !DOC.getElementById(eid))){
+                if(Ext.enableListenerCollection){
+                    Ext.EventManager.removeAll(d);
+                }
+                delete EC[eid];
+            }
+        }
+        // Cleanup IE Object leaks
+        if (Ext.isIE) {
+            var t = {};
+            for (eid in EC) {
+                t[eid] = EC[eid];
+            }
+            EC = Ext.elCache = t;
+        }
+    }
+}
+El.collectorThreadId = setInterval(garbageCollect, 30000);
+
+var flyFn = function(){};
+flyFn.prototype = El.prototype;
+
+// dom is optional
+El.Flyweight = function(dom){
+    this.dom = dom;
+};
+
+El.Flyweight.prototype = new flyFn();
+El.Flyweight.prototype.isFlyweight = true;
+El._flyweights = {};
+
+/**
+ * <p>Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
+ * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}</p>
+ * <p>Use this to make one-time references to DOM elements which are not going to be accessed again either by
+ * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get}
+ * will be more appropriate to take advantage of the caching provided by the Ext.Element class.</p>
+ * @param {String/HTMLElement} el The dom node or id
+ * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts
+ * (e.g. internally Ext uses "_global")
+ * @return {Element} The shared Element object (or null if no matching element was found)
+ * @member Ext.Element
+ * @method fly
+ */
+El.fly = function(el, named){
+    var ret = null;
+    named = named || '_global';
+
+    if (el = Ext.getDom(el)) {
+        (El._flyweights[named] = El._flyweights[named] || new El.Flyweight()).dom = el;
+        ret = El._flyweights[named];
+    }
+    return ret;
+};
+
+/**
+ * Retrieves Ext.Element objects.
+ * <p><b>This method does not retrieve {@link Ext.Component Component}s.</b> This method
+ * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by
+ * its ID, use {@link Ext.ComponentMgr#get}.</p>
+ * <p>Uses simple caching to consistently return the same object. Automatically fixes if an
+ * object was recreated with the same id via AJAX or DOM.</p>
+ * Shorthand of {@link Ext.Element#get}
+ * @param {Mixed} el The id of the node, a DOM Node or an existing Element.
+ * @return {Element} The Element object (or null if no matching element was found)
+ * @member Ext
+ * @method get
+ */
+Ext.get = El.get;
+
+/**
+ * <p>Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
+ * the dom node can be overwritten by other code. Shorthand of {@link Ext.Element#fly}</p>
+ * <p>Use this to make one-time references to DOM elements which are not going to be accessed again either by
+ * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get}
+ * will be more appropriate to take advantage of the caching provided by the Ext.Element class.</p>
+ * @param {String/HTMLElement} el The dom node or id
+ * @param {String} named (optional) Allows for creation of named reusable flyweights to prevent conflicts
+ * (e.g. internally Ext uses "_global")
+ * @return {Element} The shared Element object (or null if no matching element was found)
+ * @member Ext
+ * @method fly
+ */
+Ext.fly = El.fly;
+
+// speedy lookup for elements never to box adjust
+var noBoxAdjust = Ext.isStrict ? {
+    select:1
+} : {
+    input:1, select:1, textarea:1
+};
+if(Ext.isIE || Ext.isGecko){
+    noBoxAdjust['button'] = 1;
+}
+
+})();
+/**
+ * @class Ext.Element
+ */
+Ext.Element.addMethods({
+    /**
+     * Stops the specified event(s) from bubbling and optionally prevents the default action
+     * @param {String/Array} eventName an event / array of events to stop from bubbling
+     * @param {Boolean} preventDefault (optional) true to prevent the default action too
+     * @return {Ext.Element} this
+     */
+    swallowEvent : function(eventName, preventDefault){
+        var me = this;
+        function fn(e){
+            e.stopPropagation();
+            if(preventDefault){
+                e.preventDefault();
+            }
+        }
+        if(Ext.isArray(eventName)){
+            Ext.each(eventName, function(e) {
+                 me.on(e, fn);
+            });
+            return me;
+        }
+        me.on(eventName, fn);
+        return me;
     },
 
-    // private
-    afterSlide : function(){
-        this.panel.afterEffect();
+    /**
+     * Create an event handler on this element such that when the event fires and is handled by this element,
+     * it will be relayed to another object (i.e., fired again as if it originated from that object instead).
+     * @param {String} eventName The type of event to relay
+     * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context
+     * for firing the relayed event
+     */
+    relayEvent : function(eventName, observable){
+        this.on(eventName, function(e){
+            observable.fireEvent(eventName, e);
+        });
     },
 
-    // private
-    initAutoHide : function(){
-        if(this.autoHide !== false){
-            if(!this.autoHideHd){
-                var st = new Ext.util.DelayedTask(this.slideIn, this);
-                this.autoHideHd = {
-                    "mouseout": function(e){
-                        if(!e.within(this.el, true)){
-                            st.delay(500);
-                        }
-                    },
-                    "mouseover" : function(e){
-                        st.cancel();
-                    },
-                    scope : this
-                };
+    /**
+     * Removes worthless text nodes
+     * @param {Boolean} forceReclean (optional) By default the element
+     * keeps track if it has been cleaned already so
+     * you can call this over and over. However, if you update the element and
+     * need to force a reclean, you can pass true.
+     */
+    clean : function(forceReclean){
+        var me = this,
+            dom = me.dom,
+            n = dom.firstChild,
+            ni = -1;
+
+        if(Ext.Element.data(dom, 'isCleaned') && forceReclean !== true){
+            return me;
+        }
+
+        while(n){
+            var nx = n.nextSibling;
+            if(n.nodeType == 3 && !/\S/.test(n.nodeValue)){
+                dom.removeChild(n);
+            }else{
+                n.nodeIndex = ++ni;
             }
-            this.el.on(this.autoHideHd);
+            n = nx;
         }
+        Ext.Element.data(dom, 'isCleaned', true);
+        return me;
     },
 
-    // private
-    clearAutoHide : function(){
-        if(this.autoHide !== false){
-            this.el.un("mouseout", this.autoHideHd.mouseout);
-            this.el.un("mouseover", this.autoHideHd.mouseover);
-        }
+    /**
+     * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object
+     * parameter as {@link Ext.Updater#update}
+     * @return {Ext.Element} this
+     */
+    load : function(){
+        var um = this.getUpdater();
+        um.update.apply(um, arguments);
+        return this;
     },
 
-    // private
-    clearMonitor : function(){
-        Ext.getDoc().un("click", this.slideInIf, this);
+    /**
+    * Gets this element's {@link Ext.Updater Updater}
+    * @return {Ext.Updater} The Updater
+    */
+    getUpdater : function(){
+        return this.updateManager || (this.updateManager = new Ext.Updater(this));
     },
 
     /**
-     * If this Region is {@link #floatable}, this method slides this Region into full visibility <i>over the top
-     * of the center Region</i> where it floats until either {@link #slideIn} is called, or other regions of the layout
-     * are clicked, or the mouse exits the Region.
+    * Update the innerHTML of this element, optionally searching for and processing scripts
+    * @param {String} html The new HTML
+    * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false)
+    * @param {Function} callback (optional) For async script loading you can be notified when the update completes
+    * @return {Ext.Element} this
      */
-    slideOut : function(){
-        if(this.isSlid || this.el.hasActiveFx()){
-            return;
-        }
-        this.isSlid = true;
-        var ts = this.panel.tools;
-        if(ts && ts.toggle){
-            ts.toggle.hide();
+    update : function(html, loadScripts, callback){
+        if (!this.dom) {
+            return this;
         }
-        this.el.show();
-        if(this.position == 'east' || this.position == 'west'){
-            this.panel.setSize(undefined, this.collapsedEl.getHeight());
-        }else{
-            this.panel.setSize(this.collapsedEl.getWidth(), undefined);
+        html = html || "";
+
+        if(loadScripts !== true){
+            this.dom.innerHTML = html;
+            if(Ext.isFunction(callback)){
+                callback();
+            }
+            return this;
         }
-        this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top];
-        this.el.alignTo(this.collapsedEl, this.getCollapseAnchor());
-        this.el.setStyle("z-index", this.floatingZIndex+2);
-        this.panel.el.replaceClass('x-panel-collapsed', 'x-panel-floating');
-        if(this.animFloat !== false){
-            this.beforeSlide();
-            this.el.slideIn(this.getSlideAnchor(), {
-                callback: function(){
-                    this.afterSlide();
-                    this.initAutoHide();
-                    Ext.getDoc().on("click", this.slideInIf, this);
-                },
-                scope: this,
-                block: true
-            });
-        }else{
-            this.initAutoHide();
-             Ext.getDoc().on("click", this.slideInIf, this);
+
+        var id = Ext.id(),
+            dom = this.dom;
+
+        html += '<span id="' + id + '"></span>';
+
+        Ext.lib.Event.onAvailable(id, function(){
+            var DOC = document,
+                hd = DOC.getElementsByTagName("head")[0],
+                re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
+                srcRe = /\ssrc=([\'\"])(.*?)\1/i,
+                typeRe = /\stype=([\'\"])(.*?)\1/i,
+                match,
+                attrs,
+                srcMatch,
+                typeMatch,
+                el,
+                s;
+
+            while((match = re.exec(html))){
+                attrs = match[1];
+                srcMatch = attrs ? attrs.match(srcRe) : false;
+                if(srcMatch && srcMatch[2]){
+                   s = DOC.createElement("script");
+                   s.src = srcMatch[2];
+                   typeMatch = attrs.match(typeRe);
+                   if(typeMatch && typeMatch[2]){
+                       s.type = typeMatch[2];
+                   }
+                   hd.appendChild(s);
+                }else if(match[2] && match[2].length > 0){
+                    if(window.execScript) {
+                       window.execScript(match[2]);
+                    } else {
+                       window.eval(match[2]);
+                    }
+                }
+            }
+            el = DOC.getElementById(id);
+            if(el){Ext.removeNode(el);}
+            if(Ext.isFunction(callback)){
+                callback();
+            }
+        });
+        dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
+        return this;
+    },
+
+    // inherit docs, overridden so we can add removeAnchor
+    removeAllListeners : function(){
+        this.removeAnchor();
+        Ext.EventManager.removeAll(this.dom);
+        return this;
+    },
+
+    /**
+     * Creates a proxy element of this element
+     * @param {String/Object} config The class name of the proxy element or a DomHelper config object
+     * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body)
+     * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false)
+     * @return {Ext.Element} The new proxy element
+     */
+    createProxy : function(config, renderTo, matchBox){
+        config = Ext.isObject(config) ? config : {tag : "div", cls: config};
+
+        var me = this,
+            proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) :
+                               Ext.DomHelper.insertBefore(me.dom, config, true);
+
+        if(matchBox && me.setBox && me.getBox){ // check to make sure Element.position.js is loaded
+           proxy.setBox(me.getBox());
         }
+        return proxy;
+    }
+});
+
+Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater;
+/**
+ * @class Ext.Element
+ */
+Ext.Element.addMethods({
+    /**
+     * Gets the x,y coordinates specified by the anchor position on the element.
+     * @param {String} anchor (optional) The specified anchor position (defaults to "c").  See {@link #alignTo}
+     * for details on supported anchor positions.
+     * @param {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead
+     * of page coordinates
+     * @param {Object} size (optional) An object containing the size to use for calculating anchor position
+     * {width: (target width), height: (target height)} (defaults to the element's current size)
+     * @return {Array} [x, y] An array containing the element's x and y coordinates
+     */
+    getAnchorXY : function(anchor, local, s){
+        //Passing a different size is useful for pre-calculating anchors,
+        //especially for anchored animations that change the el size.
+               anchor = (anchor || "tl").toLowerCase();
+        s = s || {};
+        
+        var me = this,        
+               vp = me.dom == document.body || me.dom == document,
+               w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(),
+               h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(),                              
+               xy,             
+               r = Math.round,
+               o = me.getXY(),
+               scroll = me.getScroll(),
+               extraX = vp ? scroll.left : !local ? o[0] : 0,
+               extraY = vp ? scroll.top : !local ? o[1] : 0,
+               hash = {
+                       c  : [r(w * 0.5), r(h * 0.5)],
+                       t  : [r(w * 0.5), 0],
+                       l  : [0, r(h * 0.5)],
+                       r  : [w, r(h * 0.5)],
+                       b  : [r(w * 0.5), h],
+                       tl : [0, 0],    
+                       bl : [0, h],
+                       br : [w, h],
+                       tr : [w, 0]
+               };
+        
+        xy = hash[anchor];     
+        return [xy[0] + extraX, xy[1] + extraY]; 
     },
 
-    // private
-    afterSlideIn : function(){
-        this.clearAutoHide();
-        this.isSlid = false;
-        this.clearMonitor();
-        this.el.setStyle("z-index", "");
-        this.panel.el.replaceClass('x-panel-floating', 'x-panel-collapsed');
-        this.el.dom.style.left = this.restoreLT[0];
-        this.el.dom.style.top = this.restoreLT[1];
+    /**
+     * Anchors an element to another element and realigns it when the window is resized.
+     * @param {Mixed} element The element to align to.
+     * @param {String} position The position to align to.
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @param {Boolean/Object} animate (optional) True for the default animation or a standard Element animation config object
+     * @param {Boolean/Number} monitorScroll (optional) True to monitor body scroll and reposition. If this parameter
+     * is a number, it is used as the buffer delay (defaults to 50ms).
+     * @param {Function} callback The function to call after the animation finishes
+     * @return {Ext.Element} this
+     */
+    anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){        
+           var me = this,
+            dom = me.dom,
+            scroll = !Ext.isEmpty(monitorScroll),
+            action = function(){
+                Ext.fly(dom).alignTo(el, alignment, offsets, animate);
+                Ext.callback(callback, Ext.fly(dom));
+            },
+            anchor = this.getAnchor();
+            
+        // previous listener anchor, remove it
+        this.removeAnchor();
+        Ext.apply(anchor, {
+            fn: action,
+            scroll: scroll
+        });
 
-        var ts = this.panel.tools;
-        if(ts && ts.toggle){
-            ts.toggle.show();
+        Ext.EventManager.onWindowResize(action, null);
+        
+        if(scroll){
+            Ext.EventManager.on(window, 'scroll', action, null,
+                {buffer: !isNaN(monitorScroll) ? monitorScroll : 50});
+        }
+        action.call(me); // align immediately
+        return me;
+    },
+    
+    /**
+     * Remove any anchor to this element. See {@link #anchorTo}.
+     * @return {Ext.Element} this
+     */
+    removeAnchor : function(){
+        var me = this,
+            anchor = this.getAnchor();
+            
+        if(anchor && anchor.fn){
+            Ext.EventManager.removeResizeListener(anchor.fn);
+            if(anchor.scroll){
+                Ext.EventManager.un(window, 'scroll', anchor.fn);
+            }
+            delete anchor.fn;
+        }
+        return me;
+    },
+    
+    // private
+    getAnchor : function(){
+        var data = Ext.Element.data,
+            dom = this.dom;
+            if (!dom) {
+                return;
+            }
+            var anchor = data(dom, '_anchor');
+            
+        if(!anchor){
+            anchor = data(dom, '_anchor', {});
         }
+        return anchor;
     },
 
     /**
-     * If this Region is {@link #floatable}, and this Region has been slid into floating visibility, then this method slides
-     * this region back into its collapsed state.
+     * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the
+     * supported position values.
+     * @param {Mixed} element The element to align to.
+     * @param {String} position (optional, defaults to "tl-bl?") The position to align to.
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @return {Array} [x, y]
      */
-    slideIn : function(cb){
-        if(!this.isSlid || this.el.hasActiveFx()){
-            Ext.callback(cb);
-            return;
+    getAlignToXY : function(el, p, o){     
+        el = Ext.get(el);
+        
+        if(!el || !el.dom){
+            throw "Element.alignToXY with an element that doesn't exist";
         }
-        this.isSlid = false;
-        if(this.animFloat !== false){
-            this.beforeSlide();
-            this.el.slideOut(this.getSlideAnchor(), {
-                callback: function(){
-                    this.el.hide();
-                    this.afterSlide();
-                    this.afterSlideIn();
-                    Ext.callback(cb);
-                },
-                scope: this,
-                block: true
-            });
-        }else{
-            this.el.hide();
-            this.afterSlideIn();
+        
+        o = o || [0,0];
+        p = (!p || p == "?" ? "tl-bl?" : (!/-/.test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase();       
+                
+        var me = this,
+               d = me.dom,
+               a1,
+               a2,
+               x,
+               y,
+               //constrain the aligned el to viewport if necessary
+               w,
+               h,
+               r,
+               dw = Ext.lib.Dom.getViewWidth() -10, // 10px of margin for ie
+               dh = Ext.lib.Dom.getViewHeight()-10, // 10px of margin for ie
+               p1y,
+               p1x,            
+               p2y,
+               p2x,
+               swapY,
+               swapX,
+               doc = document,
+               docElement = doc.documentElement,
+               docBody = doc.body,
+               scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5,
+               scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5,
+               c = false, //constrain to viewport
+               p1 = "", 
+               p2 = "",
+               m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
+        
+        if(!m){
+           throw "Element.alignTo with an invalid alignment " + p;
         }
-    },
-
-    // private
-    slideInIf : function(e){
-        if(!e.within(this.el)){
-            this.slideIn();
+        
+        p1 = m[1]; 
+        p2 = m[2]; 
+        c = !!m[3];
+
+        //Subtract the aligned el's internal xy from the target's offset xy
+        //plus custom offset to get the aligned el's new offset xy
+        a1 = me.getAnchorXY(p1, true);
+        a2 = el.getAnchorXY(p2, false);
+
+        x = a2[0] - a1[0] + o[0];
+        y = a2[1] - a1[1] + o[1];
+
+        if(c){    
+              w = me.getWidth();
+           h = me.getHeight();
+           r = el.getRegion();       
+           //If we are at a viewport boundary and the aligned el is anchored on a target border that is
+           //perpendicular to the vp border, allow the aligned el to slide on that border,
+           //otherwise swap the aligned el to the opposite border of the target.
+           p1y = p1.charAt(0);
+           p1x = p1.charAt(p1.length-1);
+           p2y = p2.charAt(0);
+           p2x = p2.charAt(p2.length-1);
+           swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t"));
+           swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r"));          
+           
+
+           if (x + w > dw + scrollX) {
+                x = swapX ? r.left-w : dw+scrollX-w;
+           }
+           if (x < scrollX) {
+               x = swapX ? r.right : scrollX;
+           }
+           if (y + h > dh + scrollY) {
+                y = swapY ? r.top-h : dh+scrollY-h;
+            }
+           if (y < scrollY){
+               y = swapY ? r.bottom : scrollY;
+           }
         }
+        return [x,y];
     },
 
-    // private
-    anchors : {
-        "west" : "left",
-        "east" : "right",
-        "north" : "top",
-        "south" : "bottom"
-    },
+    /**
+     * Aligns this element with another element relative to the specified anchor points. If the other element is the
+     * document it aligns it to the viewport.
+     * The position parameter is optional, and can be specified in any one of the following formats:
+     * <ul>
+     *   <li><b>Blank</b>: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").</li>
+     *   <li><b>One anchor (deprecated)</b>: The passed anchor position is used as the target element's anchor point.
+     *       The element being aligned will position its top-left corner (tl) to that point.  <i>This method has been
+     *       deprecated in favor of the newer two anchor syntax below</i>.</li>
+     *   <li><b>Two anchors</b>: If two values from the table below are passed separated by a dash, the first value is used as the
+     *       element's anchor point, and the second value is used as the target's anchor point.</li>
+     * </ul>
+     * In addition to the anchor points, the position parameter also supports the "?" character.  If "?" is passed at the end of
+     * the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to
+     * the viewport if necessary.  Note that the element being aligned might be swapped to align to a different position than
+     * that specified in order to enforce the viewport constraints.
+     * Following are all of the supported anchor positions:
+<pre>
+Value  Description
+-----  -----------------------------
+tl     The top left corner (default)
+t      The center of the top edge
+tr     The top right corner
+l      The center of the left edge
+c      In the center of the element
+r      The center of the right edge
+bl     The bottom left corner
+b      The center of the bottom edge
+br     The bottom right corner
+</pre>
+Example Usage:
+<pre><code>
+// align el to other-el using the default positioning ("tl-bl", non-constrained)
+el.alignTo("other-el");
 
-    // private
-    sanchors : {
-        "west" : "l",
-        "east" : "r",
-        "north" : "t",
-        "south" : "b"
-    },
+// align the top left corner of el with the top right corner of other-el (constrained to viewport)
+el.alignTo("other-el", "tr?");
 
-    // private
-    canchors : {
-        "west" : "tl-tr",
-        "east" : "tr-tl",
-        "north" : "tl-bl",
-        "south" : "bl-tl"
-    },
+// align the bottom right corner of el with the center left edge of other-el
+el.alignTo("other-el", "br-l?");
 
-    // private
-    getAnchor : function(){
-        return this.anchors[this.position];
+// align the center of el with the bottom left corner of other-el and
+// adjust the x position by -6 pixels (and the y position by 0)
+el.alignTo("other-el", "c-bl", [-6, 0]);
+</code></pre>
+     * @param {Mixed} element The element to align to.
+     * @param {String} position (optional, defaults to "tl-bl?") The position to align to.
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+     * @return {Ext.Element} this
+     */
+    alignTo : function(element, position, offsets, animate){
+           var me = this;
+        return me.setXY(me.getAlignToXY(element, position, offsets),
+                               me.preanim && !!animate ? me.preanim(arguments, 3) : false);
     },
-
-    // private
-    getCollapseAnchor : function(){
-        return this.canchors[this.position];
+    
+    // private ==>  used outside of core
+    adjustForConstraints : function(xy, parent, offsets){
+        return this.getConstrainToXY(parent || document, false, offsets, xy) ||  xy;
     },
 
-    // private
-    getSlideAnchor : function(){
-        return this.sanchors[this.position];
-    },
+    // private ==>  used outside of core
+    getConstrainToXY : function(el, local, offsets, proposedXY){   
+           var os = {top:0, left:0, bottom:0, right: 0};
 
-    // private
-    getAlignAdj : function(){
-        var cm = this.cmargins;
-        switch(this.position){
-            case "west":
-                return [0, 0];
-            break;
-            case "east":
-                return [0, 0];
-            break;
-            case "north":
-                return [0, 0];
-            break;
-            case "south":
-                return [0, 0];
-            break;
-        }
-    },
+        return function(el, local, offsets, proposedXY){
+            el = Ext.get(el);
+            offsets = offsets ? Ext.applyIf(offsets, os) : os;
 
-    // private
-    getExpandAdj : function(){
-        var c = this.collapsedEl, cm = this.cmargins;
-        switch(this.position){
-            case "west":
-                return [-(cm.right+c.getWidth()+cm.left), 0];
-            break;
-            case "east":
-                return [cm.right+c.getWidth()+cm.left, 0];
-            break;
-            case "north":
-                return [0, -(cm.top+cm.bottom+c.getHeight())];
-            break;
-            case "south":
-                return [0, cm.top+cm.bottom+c.getHeight()];
-            break;
-        }
-    }
-};
+            var vw, vh, vx = 0, vy = 0;
+            if(el.dom == document.body || el.dom == document){
+                vw =Ext.lib.Dom.getViewWidth();
+                vh = Ext.lib.Dom.getViewHeight();
+            }else{
+                vw = el.dom.clientWidth;
+                vh = el.dom.clientHeight;
+                if(!local){
+                    var vxy = el.getXY();
+                    vx = vxy[0];
+                    vy = vxy[1];
+                }
+            }
 
-/**
- * @class Ext.layout.BorderLayout.SplitRegion
- * @extends Ext.layout.BorderLayout.Region
- * <p>This is a specialized type of {@link Ext.layout.BorderLayout.Region BorderLayout region} that
- * has a built-in {@link Ext.SplitBar} for user resizing of regions.  The movement of the split bar
- * is configurable to move either {@link #tickSize smooth or incrementally}.</p>
- * @constructor
- * Create a new SplitRegion.
- * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region.
- * @param {Object} config The configuration options
- * @param {String} position The region position.  Valid values are: north, south, east, west and center.  Every
- * BorderLayout must have a center region for the primary content -- all other regions are optional.
+            var s = el.getScroll();
+
+            vx += offsets.left + s.left;
+            vy += offsets.top + s.top;
+
+            vw -= offsets.right;
+            vh -= offsets.bottom;
+
+            var vr = vx+vw;
+            var vb = vy+vh;
+
+            var xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]);
+            var x = xy[0], y = xy[1];
+            var w = this.dom.offsetWidth, h = this.dom.offsetHeight;
+
+            // only move it if it needs it
+            var moved = false;
+
+            // first validate right/bottom
+            if((x + w) > vr){
+                x = vr - w;
+                moved = true;
+            }
+            if((y + h) > vb){
+                y = vb - h;
+                moved = true;
+            }
+            // then make sure top/left isn't negative
+            if(x < vx){
+                x = vx;
+                moved = true;
+            }
+            if(y < vy){
+                y = vy;
+                moved = true;
+            }
+            return moved ? [x, y] : false;
+        };
+    }(),
+           
+           
+               
+//         el = Ext.get(el);
+//         offsets = Ext.applyIf(offsets || {}, {top : 0, left : 0, bottom : 0, right : 0});
+
+//         var me = this,
+//             doc = document,
+//             s = el.getScroll(),
+//             vxy = el.getXY(),
+//             vx = offsets.left + s.left, 
+//             vy = offsets.top + s.top,               
+//             vw = -offsets.right, 
+//             vh = -offsets.bottom, 
+//             vr,
+//             vb,
+//             xy = proposedXY || (!local ? me.getXY() : [me.getLeft(true), me.getTop(true)]),
+//             x = xy[0],
+//             y = xy[1],
+//             w = me.dom.offsetWidth, h = me.dom.offsetHeight,
+//             moved = false; // only move it if it needs it
+//       
+//             
+//         if(el.dom == doc.body || el.dom == doc){
+//             vw += Ext.lib.Dom.getViewWidth();
+//             vh += Ext.lib.Dom.getViewHeight();
+//         }else{
+//             vw += el.dom.clientWidth;
+//             vh += el.dom.clientHeight;
+//             if(!local){                    
+//                 vx += vxy[0];
+//                 vy += vxy[1];
+//             }
+//         }
+
+//         // first validate right/bottom
+//         if(x + w > vx + vw){
+//             x = vx + vw - w;
+//             moved = true;
+//         }
+//         if(y + h > vy + vh){
+//             y = vy + vh - h;
+//             moved = true;
+//         }
+//         // then make sure top/left isn't negative
+//         if(x < vx){
+//             x = vx;
+//             moved = true;
+//         }
+//         if(y < vy){
+//             y = vy;
+//             moved = true;
+//         }
+//         return moved ? [x, y] : false;
+//    },
+    
+    /**
+    * Calculates the x, y to center this element on the screen
+    * @return {Array} The x, y values [x, y]
+    */
+    getCenterXY : function(){
+        return this.getAlignToXY(document, 'c-c');
+    },
+
+    /**
+    * Centers the Element in either the viewport, or another Element.
+    * @param {Mixed} centerIn (optional) The element in which to center the element.
+    */
+    center : function(centerIn){
+        return this.alignTo(centerIn || document, 'c-c');        
+    }    
+});
+/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods(function(){\r
+       var PARENTNODE = 'parentNode',\r
+               NEXTSIBLING = 'nextSibling',\r
+               PREVIOUSSIBLING = 'previousSibling',\r
+               DQ = Ext.DomQuery,\r
+               GET = Ext.get;\r
+       \r
+       return {\r
+               /**\r
+            * Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
+            * @param {String} selector The simple selector to test\r
+            * @param {Number/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 50 || document.body)\r
+            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
+            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
+            */\r
+           findParent : function(simpleSelector, maxDepth, returnEl){\r
+               var p = this.dom,\r
+                       b = document.body, \r
+                       depth = 0,                      \r
+                       stopEl;         \r
+            if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') {\r
+                return null;\r
+            }\r
+               maxDepth = maxDepth || 50;\r
+               if (isNaN(maxDepth)) {\r
+                   stopEl = Ext.getDom(maxDepth);\r
+                   maxDepth = Number.MAX_VALUE;\r
+               }\r
+               while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){\r
+                   if(DQ.is(p, simpleSelector)){\r
+                       return returnEl ? GET(p) : p;\r
+                   }\r
+                   depth++;\r
+                   p = p.parentNode;\r
+               }\r
+               return null;\r
+           },\r
+       \r
+           /**\r
+            * Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
+            * @param {String} selector The simple selector to test\r
+            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
+                   search as a number or element (defaults to 10 || document.body)\r
+            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
+            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
+            */\r
+           findParentNode : function(simpleSelector, maxDepth, returnEl){\r
+               var p = Ext.fly(this.dom.parentNode, '_internal');\r
+               return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null;\r
+           },\r
+       \r
+           /**\r
+            * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).\r
+            * This is a shortcut for findParentNode() that always returns an Ext.Element.\r
+            * @param {String} selector The simple selector to test\r
+            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
+                   search as a number or element (defaults to 10 || document.body)\r
+            * @return {Ext.Element} The matching DOM node (or null if no match was found)\r
+            */\r
+           up : function(simpleSelector, maxDepth){\r
+               return this.findParentNode(simpleSelector, maxDepth, true);\r
+           },\r
+       \r
+           /**\r
+            * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id).\r
+            * @param {String} selector The CSS selector\r
+            * @return {CompositeElement/CompositeElementLite} The composite element\r
+            */\r
+           select : function(selector){\r
+               return Ext.Element.select(selector, this.dom);\r
+           },\r
+       \r
+           /**\r
+            * Selects child nodes based on the passed CSS selector (the selector should not contain an id).\r
+            * @param {String} selector The CSS selector\r
+            * @return {Array} An array of the matched nodes\r
+            */\r
+           query : function(selector){\r
+               return DQ.select(selector, this.dom);\r
+           },\r
+       \r
+           /**\r
+            * Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).\r
+            * @param {String} selector The CSS selector\r
+            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
+            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
+            */\r
+           child : function(selector, returnDom){\r
+               var n = DQ.selectNode(selector, this.dom);\r
+               return returnDom ? n : GET(n);\r
+           },\r
+       \r
+           /**\r
+            * Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).\r
+            * @param {String} selector The CSS selector\r
+            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
+            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
+            */\r
+           down : function(selector, returnDom){\r
+               var n = DQ.selectNode(" > " + selector, this.dom);\r
+               return returnDom ? n : GET(n);\r
+           },\r
+       \r
+                /**\r
+            * Gets the parent node for this element, optionally chaining up trying to match a selector\r
+            * @param {String} selector (optional) Find a parent node that matches the passed simple selector\r
+            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
+            * @return {Ext.Element/HTMLElement} The parent node or null\r
+                */\r
+           parent : function(selector, returnDom){\r
+               return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom);\r
+           },\r
+       \r
+            /**\r
+            * Gets the next sibling, skipping text nodes\r
+            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
+            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
+            * @return {Ext.Element/HTMLElement} The next sibling or null\r
+                */\r
+           next : function(selector, returnDom){\r
+               return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom);\r
+           },\r
+       \r
+           /**\r
+            * Gets the previous sibling, skipping text nodes\r
+            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
+            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
+            * @return {Ext.Element/HTMLElement} The previous sibling or null\r
+                */\r
+           prev : function(selector, returnDom){\r
+               return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom);\r
+           },\r
+       \r
+       \r
+           /**\r
+            * Gets the first child, skipping text nodes\r
+            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
+            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
+            * @return {Ext.Element/HTMLElement} The first child or null\r
+                */\r
+           first : function(selector, returnDom){\r
+               return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom);\r
+           },\r
+       \r
+           /**\r
+            * Gets the last child, skipping text nodes\r
+            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
+            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
+            * @return {Ext.Element/HTMLElement} The last child or null\r
+                */\r
+           last : function(selector, returnDom){\r
+               return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom);\r
+           },\r
+           \r
+           matchNode : function(dir, start, selector, returnDom){\r
+               var n = this.dom[start];\r
+               while(n){\r
+                   if(n.nodeType == 1 && (!selector || DQ.is(n, selector))){\r
+                       return !returnDom ? GET(n) : n;\r
+                   }\r
+                   n = n[dir];\r
+               }\r
+               return null;\r
+           }   \r
+    }\r
+}());/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id).\r
+     * @param {String} selector The CSS selector\r
+     * @param {Boolean} unique (optional) True to create a unique Ext.Element for each child (defaults to false, which creates a single shared flyweight object)\r
+     * @return {CompositeElement/CompositeElementLite} The composite element\r
+     */\r
+    select : function(selector, unique){\r
+        return Ext.Element.select(selector, unique, this.dom);\r
+    }\r
+});/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods(\r
+function() {\r
+       var GETDOM = Ext.getDom,\r
+               GET = Ext.get,\r
+               DH = Ext.DomHelper;\r
+       \r
+       return {\r
+           /**\r
+            * Appends the passed element(s) to this element\r
+            * @param {String/HTMLElement/Array/Element/CompositeElement} el\r
+            * @return {Ext.Element} this\r
+            */\r
+           appendChild: function(el){        \r
+               return GET(el).appendTo(this);        \r
+           },\r
+       \r
+           /**\r
+            * Appends this element to the passed element\r
+            * @param {Mixed} el The new parent element\r
+            * @return {Ext.Element} this\r
+            */\r
+           appendTo: function(el){        \r
+               GETDOM(el).appendChild(this.dom);        \r
+               return this;\r
+           },\r
+       \r
+           /**\r
+            * Inserts this element before the passed element in the DOM\r
+            * @param {Mixed} el The element before which this element will be inserted\r
+            * @return {Ext.Element} this\r
+            */\r
+           insertBefore: function(el){                   \r
+               (el = GETDOM(el)).parentNode.insertBefore(this.dom, el);\r
+               return this;\r
+           },\r
+       \r
+           /**\r
+            * Inserts this element after the passed element in the DOM\r
+            * @param {Mixed} el The element to insert after\r
+            * @return {Ext.Element} this\r
+            */\r
+           insertAfter: function(el){\r
+               (el = GETDOM(el)).parentNode.insertBefore(this.dom, el.nextSibling);\r
+               return this;\r
+           },\r
+       \r
+           /**\r
+            * Inserts (or creates) an element (or DomHelper config) as the first child of this element\r
+            * @param {Mixed/Object} el The id or element to insert or a DomHelper config to create and insert\r
+            * @return {Ext.Element} The new child\r
+            */\r
+           insertFirst: function(el, returnDom){\r
+            el = el || {};\r
+            if(el.nodeType || el.dom || typeof el == 'string'){ // element\r
+                el = GETDOM(el);\r
+                this.dom.insertBefore(el, this.dom.firstChild);\r
+                return !returnDom ? GET(el) : el;\r
+            }else{ // dh config\r
+                return this.createChild(el, this.dom.firstChild, returnDom);\r
+            }\r
+        },\r
+       \r
+           /**\r
+            * Replaces the passed element with this element\r
+            * @param {Mixed} el The element to replace\r
+            * @return {Ext.Element} this\r
+            */\r
+           replace: function(el){\r
+               el = GET(el);\r
+               this.insertBefore(el);\r
+               el.remove();\r
+               return this;\r
+           },\r
+       \r
+           /**\r
+            * Replaces this element with the passed element\r
+            * @param {Mixed/Object} el The new element or a DomHelper config of an element to create\r
+            * @return {Ext.Element} this\r
+            */\r
+           replaceWith: function(el){\r
+                   var me = this;\r
+                \r
+            if(el.nodeType || el.dom || typeof el == 'string'){\r
+                el = GETDOM(el);\r
+                me.dom.parentNode.insertBefore(el, me.dom);\r
+            }else{\r
+                el = DH.insertBefore(me.dom, el);\r
+            }\r
+               \r
+               delete Ext.elCache[me.id];\r
+               Ext.removeNode(me.dom);      \r
+               me.id = Ext.id(me.dom = el);\r
+               Ext.Element.addToCache(me.isFlyweight ? new Ext.Element(me.dom) : me);     \r
+            return me;\r
+           },\r
+           \r
+               /**\r
+                * Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child element.\r
+                * @param {Object} config DomHelper element config object.  If no tag is specified (e.g., {tag:'input'}) then a div will be\r
+                * automatically generated with the specified attributes.\r
+                * @param {HTMLElement} insertBefore (optional) a child element of this element\r
+                * @param {Boolean} returnDom (optional) true to return the dom node instead of creating an Element\r
+                * @return {Ext.Element} The new child element\r
+                */\r
+               createChild: function(config, insertBefore, returnDom){\r
+                   config = config || {tag:'div'};\r
+                   return insertBefore ? \r
+                          DH.insertBefore(insertBefore, config, returnDom !== true) :  \r
+                          DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config,  returnDom !== true);\r
+               },\r
+               \r
+               /**\r
+                * Creates and wraps this element with another element\r
+                * @param {Object} config (optional) DomHelper element config object for the wrapper element or null for an empty div\r
+                * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element\r
+                * @return {HTMLElement/Element} The newly created wrapper element\r
+                */\r
+               wrap: function(config, returnDom){        \r
+                   var newEl = DH.insertBefore(this.dom, config || {tag: "div"}, !returnDom);\r
+                   newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom);\r
+                   return newEl;\r
+               },\r
+               \r
+               /**\r
+                * Inserts an html fragment into this element\r
+                * @param {String} where Where to insert the html in relation to this element - beforeBegin, afterBegin, beforeEnd, afterEnd.\r
+                * @param {String} html The HTML fragment\r
+                * @param {Boolean} returnEl (optional) True to return an Ext.Element (defaults to false)\r
+                * @return {HTMLElement/Ext.Element} The inserted node (or nearest related if more than 1 inserted)\r
+                */\r
+               insertHtml : function(where, html, returnEl){\r
+                   var el = DH.insertHtml(where, this.dom, html);\r
+                   return returnEl ? Ext.get(el) : el;\r
+               }\r
+       }\r
+}());/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.apply(Ext.Element.prototype, function() {\r
+       var GETDOM = Ext.getDom,\r
+               GET = Ext.get,\r
+               DH = Ext.DomHelper;\r
+       \r
+       return {        \r
+               /**\r
+            * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element\r
+            * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those.\r
+            * @param {String} where (optional) 'before' or 'after' defaults to before\r
+            * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element\r
+            * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned.\r
+            */\r
+           insertSibling: function(el, where, returnDom){\r
+               var me = this,\r
+                       rt,\r
+                isAfter = (where || 'before').toLowerCase() == 'after',\r
+                insertEl;\r
+                       \r
+               if(Ext.isArray(el)){\r
+                insertEl = me;\r
+                   Ext.each(el, function(e) {\r
+                           rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom);\r
+                    if(isAfter){\r
+                        insertEl = rt;\r
+                    }\r
+                   });\r
+                   return rt;\r
+               }\r
+                       \r
+               el = el || {};\r
+               \r
+            if(el.nodeType || el.dom){\r
+                rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom);\r
+                if (!returnDom) {\r
+                    rt = GET(rt);\r
+                }\r
+            }else{\r
+                if (isAfter && !me.dom.nextSibling) {\r
+                    rt = DH.append(me.dom.parentNode, el, !returnDom);\r
+                } else {                    \r
+                    rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom);\r
+                }\r
+            }\r
+               return rt;\r
+           }\r
+    };\r
+}());/**
+ * @class Ext.Element
  */
-Ext.layout.BorderLayout.SplitRegion = function(layout, config, pos){
-    Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, layout, config, pos);
-    // prevent switch
-    this.applyLayout = this.applyFns[pos];
-};
-
-Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, {
-    /**
-     * @cfg {Number} tickSize
-     * The increment, in pixels by which to move this Region's {@link Ext.SplitBar SplitBar}.
-     * By default, the {@link Ext.SplitBar SplitBar} moves smoothly.
-     */
-    /**
-     * @cfg {String} splitTip
-     * The tooltip to display when the user hovers over a
-     * {@link Ext.layout.BorderLayout.Region#collapsible non-collapsible} region's split bar
-     * (defaults to <tt>"Drag to resize."</tt>).  Only applies if
-     * <tt>{@link #useSplitTips} = true</tt>.
-     */
-    splitTip : "Drag to resize.",
-    /**
-     * @cfg {String} collapsibleSplitTip
-     * The tooltip to display when the user hovers over a
-     * {@link Ext.layout.BorderLayout.Region#collapsible collapsible} region's split bar
-     * (defaults to "Drag to resize. Double click to hide."). Only applies if
-     * <tt>{@link #useSplitTips} = true</tt>.
-     */
-    collapsibleSplitTip : "Drag to resize. Double click to hide.",
-    /**
-     * @cfg {Boolean} useSplitTips
-     * <tt>true</tt> to display a tooltip when the user hovers over a region's split bar
-     * (defaults to <tt>false</tt>).  The tooltip text will be the value of either
-     * <tt>{@link #splitTip}</tt> or <tt>{@link #collapsibleSplitTip}</tt> as appropriate.
-     */
-    useSplitTips : false,
+Ext.Element.addMethods(function(){
+    // local style camelizing for speed
+    var propCache = {},
+        camelRe = /(-[a-z])/gi,
+        classReCache = {},
+        view = document.defaultView,
+        propFloat = Ext.isIE ? 'styleFloat' : 'cssFloat',
+        opacityRe = /alpha\(opacity=(.*)\)/i,
+        trimRe = /^\s+|\s+$/g,
+        EL = Ext.Element,
+        PADDING = "padding",
+        MARGIN = "margin",
+        BORDER = "border",
+        LEFT = "-left",
+        RIGHT = "-right",
+        TOP = "-top",
+        BOTTOM = "-bottom",
+        WIDTH = "-width",
+        MATH = Math,
+        HIDDEN = 'hidden',
+        ISCLIPPED = 'isClipped',
+        OVERFLOW = 'overflow',
+        OVERFLOWX = 'overflow-x',
+        OVERFLOWY = 'overflow-y',
+        ORIGINALCLIP = 'originalClip',
+        // special markup used throughout Ext when box wrapping elements
+        borders = {l: BORDER + LEFT + WIDTH, r: BORDER + RIGHT + WIDTH, t: BORDER + TOP + WIDTH, b: BORDER + BOTTOM + WIDTH},
+        paddings = {l: PADDING + LEFT, r: PADDING + RIGHT, t: PADDING + TOP, b: PADDING + BOTTOM},
+        margins = {l: MARGIN + LEFT, r: MARGIN + RIGHT, t: MARGIN + TOP, b: MARGIN + BOTTOM},
+        data = Ext.Element.data;
+
+
+    // private
+    function camelFn(m, a) {
+        return a.charAt(1).toUpperCase();
+    }
 
-    // private
-    splitSettings : {
-        north : {
-            orientation: Ext.SplitBar.VERTICAL,
-            placement: Ext.SplitBar.TOP,
-            maxFn : 'getVMaxSize',
-            minProp: 'minHeight',
-            maxProp: 'maxHeight'
-        },
-        south : {
-            orientation: Ext.SplitBar.VERTICAL,
-            placement: Ext.SplitBar.BOTTOM,
-            maxFn : 'getVMaxSize',
-            minProp: 'minHeight',
-            maxProp: 'maxHeight'
-        },
-        east : {
-            orientation: Ext.SplitBar.HORIZONTAL,
-            placement: Ext.SplitBar.RIGHT,
-            maxFn : 'getHMaxSize',
-            minProp: 'minWidth',
-            maxProp: 'maxWidth'
-        },
-        west : {
-            orientation: Ext.SplitBar.HORIZONTAL,
-            placement: Ext.SplitBar.LEFT,
-            maxFn : 'getHMaxSize',
-            minProp: 'minWidth',
-            maxProp: 'maxWidth'
-        }
-    },
+    function chkCache(prop) {
+        return propCache[prop] || (propCache[prop] = prop == 'float' ? propFloat : prop.replace(camelRe, camelFn));
+    }
 
-    // private
-    applyFns : {
-        west : function(box){
-            if(this.isCollapsed){
-                return this.applyLayoutCollapsed(box);
-            }
-            var sd = this.splitEl.dom, s = sd.style;
-            this.panel.setPosition(box.x, box.y);
-            var sw = sd.offsetWidth;
-            s.left = (box.x+box.width-sw)+'px';
-            s.top = (box.y)+'px';
-            s.height = Math.max(0, box.height)+'px';
-            this.panel.setSize(box.width-sw, box.height);
-        },
-        east : function(box){
-            if(this.isCollapsed){
-                return this.applyLayoutCollapsed(box);
+    return {
+        // private  ==> used by Fx
+        adjustWidth : function(width) {
+            var me = this;
+            var isNum = Ext.isNumber(width);
+            if(isNum && me.autoBoxAdjust && !me.isBorderBox()){
+               width -= (me.getBorderWidth("lr") + me.getPadding("lr"));
             }
-            var sd = this.splitEl.dom, s = sd.style;
-            var sw = sd.offsetWidth;
-            this.panel.setPosition(box.x+sw, box.y);
-            s.left = (box.x)+'px';
-            s.top = (box.y)+'px';
-            s.height = Math.max(0, box.height)+'px';
-            this.panel.setSize(box.width-sw, box.height);
+            return (isNum && width < 0) ? 0 : width;
         },
-        north : function(box){
-            if(this.isCollapsed){
-                return this.applyLayoutCollapsed(box);
+
+        // private   ==> used by Fx
+        adjustHeight : function(height) {
+            var me = this;
+            var isNum = Ext.isNumber(height);
+            if(isNum && me.autoBoxAdjust && !me.isBorderBox()){
+               height -= (me.getBorderWidth("tb") + me.getPadding("tb"));
             }
-            var sd = this.splitEl.dom, s = sd.style;
-            var sh = sd.offsetHeight;
-            this.panel.setPosition(box.x, box.y);
-            s.left = (box.x)+'px';
-            s.top = (box.y+box.height-sh)+'px';
-            s.width = Math.max(0, box.width)+'px';
-            this.panel.setSize(box.width, box.height-sh);
+            return (isNum && height < 0) ? 0 : height;
         },
-        south : function(box){
-            if(this.isCollapsed){
-                return this.applyLayoutCollapsed(box);
-            }
-            var sd = this.splitEl.dom, s = sd.style;
-            var sh = sd.offsetHeight;
-            this.panel.setPosition(box.x, box.y+sh);
-            s.left = (box.x)+'px';
-            s.top = (box.y)+'px';
-            s.width = Math.max(0, box.width)+'px';
-            this.panel.setSize(box.width, box.height-sh);
-        }
-    },
-
-    // private
-    render : function(ct, p){
-        Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this, ct, p);
-
-        var ps = this.position;
-
-        this.splitEl = ct.createChild({
-            cls: "x-layout-split x-layout-split-"+ps, html: "&#160;",
-            id: this.panel.id + '-xsplit'
-        });
-
-        if(this.collapseMode == 'mini'){
-            this.miniSplitEl = this.splitEl.createChild({
-                cls: "x-layout-mini x-layout-mini-"+ps, html: "&#160;"
-            });
-            this.miniSplitEl.addClassOnOver('x-layout-mini-over');
-            this.miniSplitEl.on('click', this.onCollapseClick, this, {stopEvent:true});
-        }
-
-        var s = this.splitSettings[ps];
-
-        this.split = new Ext.SplitBar(this.splitEl.dom, p.el, s.orientation);
-        this.split.tickSize = this.tickSize;
-        this.split.placement = s.placement;
-        this.split.getMaximumSize = this[s.maxFn].createDelegate(this);
-        this.split.minSize = this.minSize || this[s.minProp];
-        this.split.on("beforeapply", this.onSplitMove, this);
-        this.split.useShim = this.useShim === true;
-        this.maxSize = this.maxSize || this[s.maxProp];
-
-        if(p.hidden){
-            this.splitEl.hide();
-        }
 
-        if(this.useSplitTips){
-            this.splitEl.dom.title = this.collapsible ? this.collapsibleSplitTip : this.splitTip;
-        }
-        if(this.collapsible){
-            this.splitEl.on("dblclick", this.onCollapseClick,  this);
-        }
-    },
 
-    //docs inherit from superclass
-    getSize : function(){
-        if(this.isCollapsed){
-            return this.collapsedEl.getSize();
-        }
-        var s = this.panel.getSize();
-        if(this.position == 'north' || this.position == 'south'){
-            s.height += this.splitEl.dom.offsetHeight;
-        }else{
-            s.width += this.splitEl.dom.offsetWidth;
-        }
-        return s;
-    },
+        /**
+         * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.
+         * @param {String/Array} className The CSS class to add, or an array of classes
+         * @return {Ext.Element} this
+         */
+        addClass : function(className){
+            var me = this, i, len, v;
+            className = Ext.isArray(className) ? className : [className];
+            for (i=0, len = className.length; i < len; i++) {
+                v = className[i];
+                if (v) {
+                    me.dom.className += (!me.hasClass(v) && v ? " " + v : "");
+                };
+            };
+            return me;
+        },
 
-    // private
-    getHMaxSize : function(){
-         var cmax = this.maxSize || 10000;
-         var center = this.layout.center;
-         return Math.min(cmax, (this.el.getWidth()+center.el.getWidth())-center.getMinWidth());
-    },
+        /**
+         * Adds one or more CSS classes to this element and removes the same class(es) from all siblings.
+         * @param {String/Array} className The CSS class to add, or an array of classes
+         * @return {Ext.Element} this
+         */
+        radioClass : function(className){
+            var cn = this.dom.parentNode.childNodes, v;
+            className = Ext.isArray(className) ? className : [className];
+            for (var i=0, len = cn.length; i < len; i++) {
+                v = cn[i];
+                if(v && v.nodeType == 1) {
+                    Ext.fly(v, '_internal').removeClass(className);
+                }
+            };
+            return this.addClass(className);
+        },
 
-    // private
-    getVMaxSize : function(){
-        var cmax = this.maxSize || 10000;
-        var center = this.layout.center;
-        return Math.min(cmax, (this.el.getHeight()+center.el.getHeight())-center.getMinHeight());
-    },
+        /**
+         * Removes one or more CSS classes from the element.
+         * @param {String/Array} className The CSS class to remove, or an array of classes
+         * @return {Ext.Element} this
+         */
+        removeClass : function(className){
+            var me = this, v;
+            className = Ext.isArray(className) ? className : [className];
+            if (me.dom && me.dom.className) {
+                for (var i=0, len=className.length; i < len; i++) {
+                    v = className[i];
+                    if(v) {
+                        me.dom.className = me.dom.className.replace(
+                            classReCache[v] = classReCache[v] || new RegExp('(?:^|\\s+)' + v + '(?:\\s+|$)', "g"), " "
+                        );
+                    }
+                };
+            }
+            return me;
+        },
 
-    // private
-    onSplitMove : function(split, newSize){
-        var s = this.panel.getSize();
-        this.lastSplitSize = newSize;
-        if(this.position == 'north' || this.position == 'south'){
-            this.panel.setSize(s.width, newSize);
-            this.state.height = newSize;
-        }else{
-            this.panel.setSize(newSize, s.height);
-            this.state.width = newSize;
-        }
-        this.layout.layout();
-        this.panel.saveState();
-        return false;
-    },
+        /**
+         * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it).
+         * @param {String} className The CSS class to toggle
+         * @return {Ext.Element} this
+         */
+        toggleClass : function(className){
+            return this.hasClass(className) ? this.removeClass(className) : this.addClass(className);
+        },
 
-    /**
-     * Returns a reference to the split bar in use by this region.
-     * @return {Ext.SplitBar} The split bar
-     */
-    getSplitBar : function(){
-        return this.split;
-    },
+        /**
+         * Checks if the specified CSS class exists on this element's DOM node.
+         * @param {String} className The CSS class to check for
+         * @return {Boolean} True if the class exists, else false
+         */
+        hasClass : function(className){
+            return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1;
+        },
 
-    // inherit docs
-    destroy : function() {
-        Ext.destroy(
-            this.miniSplitEl,
-            this.split,
-            this.splitEl
-        );
-    }
-});
+        /**
+         * Replaces a CSS class on the element with another.  If the old name does not exist, the new name will simply be added.
+         * @param {String} oldClassName The CSS class to replace
+         * @param {String} newClassName The replacement CSS class
+         * @return {Ext.Element} this
+         */
+        replaceClass : function(oldClassName, newClassName){
+            return this.removeClass(oldClassName).addClass(newClassName);
+        },
 
-Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout;/**
- * @class Ext.layout.FormLayout
- * @extends Ext.layout.AnchorLayout
- * <p>This layout manager is specifically designed for rendering and managing child Components of
- * {@link Ext.form.FormPanel forms}. It is responsible for rendering the labels of
- * {@link Ext.form.Field Field}s.</p>
- *
- * <p>This layout manager is used when a Container is configured with the <tt>layout:'form'</tt>
- * {@link Ext.Container#layout layout} config option, and should generally not need to be created directly
- * via the new keyword. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
- *
- * <p>In an application, it will usually be preferrable to use a {@link Ext.form.FormPanel FormPanel}
- * (which is configured with FormLayout as its layout class by default) since it also provides built-in
- * functionality for {@link Ext.form.BasicForm#doAction loading, validating and submitting} the form.</p>
- *
- * <p>A {@link Ext.Container Container} <i>using</i> the FormLayout layout manager (e.g.
- * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) can also accept the following
- * layout-specific config properties:<div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.form.FormPanel#hideLabels hideLabels}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelAlign labelAlign}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelPad labelPad}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelSeparator labelSeparator}</tt></b></li>
- * <li><b><tt>{@link Ext.form.FormPanel#labelWidth labelWidth}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Any Component (including Fields) managed by FormLayout accepts the following as a config option:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.Component#anchor anchor}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Any Component managed by FormLayout may be rendered as a form field (with an associated label) by
- * configuring it with a non-null <b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b>. Components configured
- * in this way may be configured with the following options which affect the way the FormLayout renders them:
- * <div class="mdetail-params"><ul>
- * <li><b><tt>{@link Ext.Component#clearCls clearCls}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#hideLabel hideLabel}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#itemCls itemCls}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#labelSeparator labelSeparator}</tt></b></li>
- * <li><b><tt>{@link Ext.Component#labelStyle labelStyle}</tt></b></li>
- * </ul></div></p>
- *
- * <p>Example usage:</p>
- * <pre><code>
-// Required if showing validation messages
-Ext.QuickTips.init();
+        isStyle : function(style, val) {
+            return this.getStyle(style) == val;
+        },
 
-// While you can create a basic Panel with layout:'form', practically
-// you should usually use a FormPanel to also get its form functionality
-// since it already creates a FormLayout internally.
-var form = new Ext.form.FormPanel({
-    title: 'Form Layout',
-    bodyStyle: 'padding:15px',
-    width: 350,
-    defaultType: 'textfield',
-    defaults: {
-        // applied to each contained item
-        width: 230,
-        msgTarget: 'side'
-    },
-    items: [{
-            fieldLabel: 'First Name',
-            name: 'first',
-            allowBlank: false,
-            {@link Ext.Component#labelSeparator labelSeparator}: ':' // override labelSeparator layout config
-        },{
-            fieldLabel: 'Last Name',
-            name: 'last'
-        },{
-            fieldLabel: 'Email',
-            name: 'email',
-            vtype:'email'
-        }, {
-            xtype: 'textarea',
-            hideLabel: true,     // override hideLabels layout config
-            name: 'msg',
-            anchor: '100% -53'
-        }
-    ],
-    buttons: [
-        {text: 'Save'},
-        {text: 'Cancel'}
-    ],
-    layoutConfig: {
-        {@link #labelSeparator}: '~' // superseded by assignment below
-    },
-    // config options applicable to container when layout='form':
-    hideLabels: false,
-    labelAlign: 'left',   // or 'right' or 'top'
-    {@link Ext.form.FormPanel#labelSeparator labelSeparator}: '>>', // takes precedence over layoutConfig value
-    labelWidth: 65,       // defaults to 100
-    labelPad: 8           // defaults to 5, must specify labelWidth to be honored
-});
-</code></pre>
- */
-Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
+        /**
+         * Normalizes currentStyle and computedStyle.
+         * @param {String} property The style property whose value is returned.
+         * @return {String} The current value of the style property for this element.
+         */
+        getStyle : function(){
+            return view && view.getComputedStyle ?
+                function(prop){
+                    var el = this.dom,
+                        v,
+                        cs,
+                        out,
+                        display,
+                        wk = Ext.isWebKit,
+                        display;
+                        
+                    if(el == document){
+                        return null;
+                    }
+                    prop = chkCache(prop);
+                    // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
+                    if(wk && /marginRight/.test(prop)){
+                        display = this.getStyle('display');
+                        el.style.display = 'inline-block';
+                    }
+                    out = (v = el.style[prop]) ? v :
+                           (cs = view.getComputedStyle(el, "")) ? cs[prop] : null;
+
+                    // Webkit returns rgb values for transparent.
+                    if(wk){
+                        if(out == 'rgba(0, 0, 0, 0)'){
+                            out = 'transparent';
+                        }else if(display){
+                            el.style.display = display;
+                        }
+                    }
+                    return out;
+                } :
+                function(prop){
+                    var el = this.dom,
+                        m,
+                        cs;
+
+                    if(el == document) return null;
+                    if (prop == 'opacity') {
+                        if (el.style.filter.match) {
+                            if(m = el.style.filter.match(opacityRe)){
+                                var fv = parseFloat(m[1]);
+                                if(!isNaN(fv)){
+                                    return fv ? fv / 100 : 0;
+                                }
+                            }
+                        }
+                        return 1;
+                    }
+                    prop = chkCache(prop);
+                    return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);
+                };
+        }(),
 
-    /**
-     * @cfg {String} labelSeparator
-     * See {@link Ext.form.FormPanel}.{@link Ext.form.FormPanel#labelSeparator labelSeparator}.  Configuration
-     * of this property at the <b>container</b> level takes precedence.
-     */
-    labelSeparator : ':',
+        /**
+         * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values
+         * are convert to standard 6 digit hex color.
+         * @param {String} attr The css attribute
+         * @param {String} defaultValue The default value to use when a valid color isn't found
+         * @param {String} prefix (optional) defaults to #. Use an empty string when working with
+         * color anims.
+         */
+        getColor : function(attr, defaultValue, prefix){
+            var v = this.getStyle(attr),
+                color = Ext.isDefined(prefix) ? prefix : '#',
+                h;
+
+            if(!v || /transparent|inherit/.test(v)){
+                return defaultValue;
+            }
+            if(/^r/.test(v)){
+                Ext.each(v.slice(4, v.length -1).split(','), function(s){
+                    h = parseInt(s, 10);
+                    color += (h < 16 ? '0' : '') + h.toString(16);
+                });
+            }else{
+                v = v.replace('#', '');
+                color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
+            }
+            return(color.length > 5 ? color.toLowerCase() : defaultValue);
+        },
 
-    /**
-     * Read only. The CSS style specification string added to field labels in this layout if not
-     * otherwise {@link Ext.Component#labelStyle specified by each contained field}.
-     * @type String
-     * @property labelStyle
-     */
+        /**
+         * Wrapper for setting style properties, also takes single object parameter of multiple styles.
+         * @param {String/Object} property The style property to be set, or an object of multiple styles.
+         * @param {String} value (optional) The value to apply to the given property, or null if an object was passed.
+         * @return {Ext.Element} this
+         */
+        setStyle : function(prop, value){
+            var tmp,
+                style,
+                camel;
+            if (!Ext.isObject(prop)) {
+                tmp = {};
+                tmp[prop] = value;
+                prop = tmp;
+            }
+            for (style in prop) {
+                value = prop[style];
+                style == 'opacity' ?
+                    this.setOpacity(value) :
+                    this.dom.style[chkCache(style)] = value;
+            }
+            return this;
+        },
 
-    // private
-    setContainer : function(ct){
-        Ext.layout.FormLayout.superclass.setContainer.call(this, ct);
-        if(ct.labelAlign){
-            ct.addClass('x-form-label-'+ct.labelAlign);
-        }
+        /**
+         * Set the opacity of the element
+         * @param {Float} opacity The new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
+         * @param {Boolean/Object} animate (optional) a standard Element animation config object or <tt>true</tt> for
+         * the default animation (<tt>{duration: .35, easing: 'easeIn'}</tt>)
+         * @return {Ext.Element} this
+         */
+         setOpacity : function(opacity, animate){
+            var me = this,
+                s = me.dom.style;
 
-        if(ct.hideLabels){
-            this.labelStyle = "display:none";
-            this.elementStyle = "padding-left:0;";
-            this.labelAdjust = 0;
-        }else{
-            this.labelSeparator = ct.labelSeparator || this.labelSeparator;
-            ct.labelWidth = ct.labelWidth || 100;
-            if(typeof ct.labelWidth == 'number'){
-                var pad = (typeof ct.labelPad == 'number' ? ct.labelPad : 5);
-                this.labelAdjust = ct.labelWidth+pad;
-                this.labelStyle = "width:"+ct.labelWidth+"px;";
-                this.elementStyle = "padding-left:"+(ct.labelWidth+pad)+'px';
-            }
-            if(ct.labelAlign == 'top'){
-                this.labelStyle = "width:auto;";
-                this.labelAdjust = 0;
-                this.elementStyle = "padding-left:0;";
-            }
-        }
-    },
+            if(!animate || !me.anim){
+                if(Ext.isIE){
+                    var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '',
+                    val = s.filter.replace(opacityRe, '').replace(trimRe, '');
 
-    //private
-    getLabelStyle: function(s){
-        var ls = '', items = [this.labelStyle, s];
-        for (var i = 0, len = items.length; i < len; ++i){
-            if (items[i]){
-                ls += items[i];
-                if (ls.substr(-1, 1) != ';'){
-                    ls += ';'
+                    s.zoom = 1;
+                    s.filter = val + (val.length > 0 ? ' ' : '') + opac;
+                }else{
+                    s.opacity = opacity;
                 }
+            }else{
+                me.anim({opacity: {to: opacity}}, me.preanim(arguments, 1), null, .35, 'easeIn');
             }
-        }
-        return ls;
-    },
-
-    /**
-     * @cfg {Ext.Template} fieldTpl
-     * A {@link Ext.Template#compile compile}d {@link Ext.Template} for rendering
-     * the fully wrapped, labeled and styled form Field. Defaults to:</p><pre><code>
-new Ext.Template(
-    &#39;&lt;div class="x-form-item {itemCls}" tabIndex="-1">&#39;,
-        &#39;&lt;&#108;abel for="{id}" style="{labelStyle}" class="x-form-item-&#108;abel">{&#108;abel}{labelSeparator}&lt;/&#108;abel>&#39;,
-        &#39;&lt;div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">&#39;,
-        &#39;&lt;/div>&lt;div class="{clearCls}">&lt;/div>&#39;,
-    '&lt;/div>'
-);
-</code></pre>
-     * <p>This may be specified to produce a different DOM structure when rendering form Fields.</p>
-     * <p>A description of the properties within the template follows:</p><div class="mdetail-params"><ul>
-     * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
-     * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
-     * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
-     * supplied at the container level.</div></li>
-     * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
-     * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
-     * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
-     * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
-     * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
-     * field (defaults to <tt>''</tt>)</div></li>
-     * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
-     * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
-     * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
-     * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
-     * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
-     * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
-     * </ul></div>
-     * <p>Also see <tt>{@link #getTemplateArgs}</tt></p>
-     */
+            return me;
+        },
 
-    // private
-    renderItem : function(c, position, target){
-        if(c && !c.rendered && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
-            var args = this.getTemplateArgs(c);
-            if(typeof position == 'number'){
-                position = target.dom.childNodes[position] || null;
-            }
-            if(position){
-                this.fieldTpl.insertBefore(position, args);
+        /**
+         * Clears any opacity settings from this element. Required in some cases for IE.
+         * @return {Ext.Element} this
+         */
+        clearOpacity : function(){
+            var style = this.dom.style;
+            if(Ext.isIE){
+                if(!Ext.isEmpty(style.filter)){
+                    style.filter = style.filter.replace(opacityRe, '').replace(trimRe, '');
+                }
             }else{
-                this.fieldTpl.append(target, args);
+                style.opacity = style['-moz-opacity'] = style['-khtml-opacity'] = '';
             }
-            c.render('x-form-el-'+c.id);
-        }else {
-            Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
-        }
-    },
+            return this;
+        },
 
-    /**
-     * <p>Provides template arguments for rendering the fully wrapped, labeled and styled form Field.</p>
-     * <p>This method returns an object hash containing properties used by the layout's {@link #fieldTpl}
-     * to create a correctly wrapped, labeled and styled form Field. This may be overriden to
-     * create custom layouts. The properties which must be returned are:</p><div class="mdetail-params"><ul>
-     * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
-     * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
-     * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
-     * supplied at the container level.</div></li>
-     * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
-     * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
-     * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
-     * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
-     * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
-     * field (defaults to <tt>''</tt>)</div></li>
-     * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
-     * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
-     * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
-     * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
-     * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
-     * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
-     * </ul></div>
-     * @param field The {@link Field Ext.form.Field} being rendered.
-     * @return An object hash containing the properties required to render the Field.
-     */
-    getTemplateArgs: function(field) {
-        var noLabelSep = !field.fieldLabel || field.hideLabel;
-        return {
-            id: field.id,
-            label: field.fieldLabel,
-            labelStyle: field.labelStyle||this.labelStyle||'',
-            elementStyle: this.elementStyle||'',
-            labelSeparator: noLabelSep ? '' : (typeof field.labelSeparator == 'undefined' ? this.labelSeparator : field.labelSeparator),
-            itemCls: (field.itemCls||this.container.itemCls||'') + (field.hideLabel ? ' x-hide-label' : ''),
-            clearCls: field.clearCls || 'x-form-clear-left'
-        };
-    },
+        /**
+         * Returns the offset height of the element
+         * @param {Boolean} contentHeight (optional) true to get the height minus borders and padding
+         * @return {Number} The element's height
+         */
+        getHeight : function(contentHeight){
+            var me = this,
+                dom = me.dom,
+                hidden = Ext.isIE && me.isStyle('display', 'none'),
+                h = MATH.max(dom.offsetHeight, hidden ? 0 : dom.clientHeight) || 0;
 
-    // private
-    adjustWidthAnchor : function(value, comp){
-        return value - (comp.isFormField || comp.fieldLabel  ? (comp.hideLabel ? 0 : this.labelAdjust) : 0);
-    },
+            h = !contentHeight ? h : h - me.getBorderWidth("tb") - me.getPadding("tb");
+            return h < 0 ? 0 : h;
+        },
+
+        /**
+         * Returns the offset width of the element
+         * @param {Boolean} contentWidth (optional) true to get the width minus borders and padding
+         * @return {Number} The element's width
+         */
+        getWidth : function(contentWidth){
+            var me = this,
+                dom = me.dom,
+                hidden = Ext.isIE && me.isStyle('display', 'none'),
+                w = MATH.max(dom.offsetWidth, hidden ? 0 : dom.clientWidth) || 0;
+            w = !contentWidth ? w : w - me.getBorderWidth("lr") - me.getPadding("lr");
+            return w < 0 ? 0 : w;
+        },
 
-    // private
-    isValidParent : function(c, target){
-        return true;
-    }
+        /**
+         * Set the width of this Element.
+         * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>
+         * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>
+         * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.
+         * </ul></div>
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Ext.Element} this
+         */
+        setWidth : function(width, animate){
+            var me = this;
+            width = me.adjustWidth(width);
+            !animate || !me.anim ?
+                me.dom.style.width = me.addUnits(width) :
+                me.anim({width : {to : width}}, me.preanim(arguments, 1));
+            return me;
+        },
 
-    /**
-     * @property activeItem
-     * @hide
-     */
+        /**
+         * Set the height of this Element.
+         * <pre><code>
+// change the height to 200px and animate with default configuration
+Ext.fly('elementId').setHeight(200, true);
+
+// change the height to 150px and animate with a custom configuration
+Ext.fly('elId').setHeight(150, {
+    duration : .5, // animation will have a duration of .5 seconds
+    // will change the content to "finished"
+    callback: function(){ this.{@link #update}("finished"); }
 });
+         * </code></pre>
+         * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>
+         * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels.)</li>
+         * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
+         * </ul></div>
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Ext.Element} this
+         */
+         setHeight : function(height, animate){
+            var me = this;
+            height = me.adjustHeight(height);
+            !animate || !me.anim ?
+                me.dom.style.height = me.addUnits(height) :
+                me.anim({height : {to : height}}, me.preanim(arguments, 1));
+            return me;
+        },
 
-Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout;/**\r
- * @class Ext.layout.AccordionLayout\r
- * @extends Ext.layout.FitLayout\r
- * <p>This is a layout that contains multiple panels in an expandable accordion style such that only\r
- * <b>one panel can be open at any given time</b>.  Each panel has built-in support for expanding and collapsing.\r
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>\r
- * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>\r
- * <p>Example usage:</p>\r
- * <pre><code>\r
-var accordion = new Ext.Panel({\r
-    title: 'Accordion Layout',\r
-    layout:'accordion',\r
-    defaults: {\r
-        // applied to each contained panel\r
-        bodyStyle: 'padding:15px'\r
+        /**
+         * Gets the width of the border(s) for the specified side(s)
+         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+         * passing <tt>'lr'</tt> would get the border <b><u>l</u></b>eft width + the border <b><u>r</u></b>ight width.
+         * @return {Number} The width of the sides passed added together
+         */
+        getBorderWidth : function(side){
+            return this.addStyles(side, borders);
+        },
+
+        /**
+         * Gets the width of the padding(s) for the specified side(s)
+         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+         * passing <tt>'lr'</tt> would get the padding <b><u>l</u></b>eft + the padding <b><u>r</u></b>ight.
+         * @return {Number} The padding of the sides passed added together
+         */
+        getPadding : function(side){
+            return this.addStyles(side, paddings);
+        },
+
+        /**
+         *  Store the current overflow setting and clip overflow on the element - use <tt>{@link #unclip}</tt> to remove
+         * @return {Ext.Element} this
+         */
+        clip : function(){
+            var me = this,
+                dom = me.dom;
+
+            if(!data(dom, ISCLIPPED)){
+                data(dom, ISCLIPPED, true);
+                data(dom, ORIGINALCLIP, {
+                    o: me.getStyle(OVERFLOW),
+                    x: me.getStyle(OVERFLOWX),
+                    y: me.getStyle(OVERFLOWY)
+                });
+                me.setStyle(OVERFLOW, HIDDEN);
+                me.setStyle(OVERFLOWX, HIDDEN);
+                me.setStyle(OVERFLOWY, HIDDEN);
+            }
+            return me;
+        },
+
+        /**
+         *  Return clipping (overflow) to original clipping before <tt>{@link #clip}</tt> was called
+         * @return {Ext.Element} this
+         */
+        unclip : function(){
+            var me = this,
+                dom = me.dom;
+
+            if(data(dom, ISCLIPPED)){
+                data(dom, ISCLIPPED, false);
+                var o = data(dom, ORIGINALCLIP);
+                if(o.o){
+                    me.setStyle(OVERFLOW, o.o);
+                }
+                if(o.x){
+                    me.setStyle(OVERFLOWX, o.x);
+                }
+                if(o.y){
+                    me.setStyle(OVERFLOWY, o.y);
+                }
+            }
+            return me;
+        },
+
+        // private
+        addStyles : function(sides, styles){
+            var val = 0,
+                m = sides.match(/\w/g),
+                s;
+            for (var i=0, len=m.length; i<len; i++) {
+                s = m[i] && parseInt(this.getStyle(styles[m[i]]), 10);
+                if (s) {
+                    val += MATH.abs(s);
+                }
+            }
+            return val;
+        },
+
+        margins : margins
+    }
+}()
+);
+/**\r
+ * @class Ext.Element\r
+ */\r
+\r
+// special markup used throughout Ext when box wrapping elements\r
+Ext.Element.boxMarkup = '<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';\r
+\r
+Ext.Element.addMethods(function(){\r
+    var INTERNAL = "_internal",\r
+        pxMatch = /(\d+\.?\d+)px/;\r
+    return {\r
+        /**\r
+         * More flexible version of {@link #setStyle} for setting style properties.\r
+         * @param {String/Object/Function} styles A style specification string, e.g. "width:100px", or object in the form {width:"100px"}, or\r
+         * a function which returns such a specification.\r
+         * @return {Ext.Element} this\r
+         */\r
+        applyStyles : function(style){\r
+            Ext.DomHelper.applyStyles(this.dom, style);\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Returns an object with properties matching the styles requested.\r
+         * For example, el.getStyles('color', 'font-size', 'width') might return\r
+         * {'color': '#FFFFFF', 'font-size': '13px', 'width': '100px'}.\r
+         * @param {String} style1 A style name\r
+         * @param {String} style2 A style name\r
+         * @param {String} etc.\r
+         * @return {Object} The style object\r
+         */\r
+        getStyles : function(){\r
+            var ret = {};\r
+            Ext.each(arguments, function(v) {\r
+               ret[v] = this.getStyle(v);\r
+            },\r
+            this);\r
+            return ret;\r
+        },\r
+\r
+        // private  ==> used by ext full\r
+        setOverflow : function(v){\r
+            var dom = this.dom;\r
+            if(v=='auto' && Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug\r
+                dom.style.overflow = 'hidden';\r
+                (function(){dom.style.overflow = 'auto';}).defer(1);\r
+            }else{\r
+                dom.style.overflow = v;\r
+            }\r
+        },\r
+\r
+       /**\r
+        * <p>Wraps the specified element with a special 9 element markup/CSS block that renders by default as\r
+        * a gray container with a gradient background, rounded corners and a 4-way shadow.</p>\r
+        * <p>This special markup is used throughout Ext when box wrapping elements ({@link Ext.Button},\r
+        * {@link Ext.Panel} when <tt>{@link Ext.Panel#frame frame=true}</tt>, {@link Ext.Window}).  The markup\r
+        * is of this form:</p>\r
+        * <pre><code>\r
+    Ext.Element.boxMarkup =\r
+    &#39;&lt;div class="{0}-tl">&lt;div class="{0}-tr">&lt;div class="{0}-tc">&lt;/div>&lt;/div>&lt;/div>\r
+     &lt;div class="{0}-ml">&lt;div class="{0}-mr">&lt;div class="{0}-mc">&lt;/div>&lt;/div>&lt;/div>\r
+     &lt;div class="{0}-bl">&lt;div class="{0}-br">&lt;div class="{0}-bc">&lt;/div>&lt;/div>&lt;/div>&#39;;\r
+        * </code></pre>\r
+        * <p>Example usage:</p>\r
+        * <pre><code>\r
+    // Basic box wrap\r
+    Ext.get("foo").boxWrap();\r
+\r
+    // You can also add a custom class and use CSS inheritance rules to customize the box look.\r
+    // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example\r
+    // for how to create a custom box wrap style.\r
+    Ext.get("foo").boxWrap().addClass("x-box-blue");\r
+        * </code></pre>\r
+        * @param {String} class (optional) A base CSS class to apply to the containing wrapper element\r
+        * (defaults to <tt>'x-box'</tt>). Note that there are a number of CSS rules that are dependent on\r
+        * this name to make the overall effect work, so if you supply an alternate base class, make sure you\r
+        * also supply all of the necessary rules.\r
+        * @return {Ext.Element} The outermost wrapping element of the created box structure.\r
+        */\r
+        boxWrap : function(cls){\r
+            cls = cls || 'x-box';\r
+            var el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "'>" + String.format(Ext.Element.boxMarkup, cls) + "</div>"));        //String.format('<div class="{0}">'+Ext.Element.boxMarkup+'</div>', cls)));\r
+            Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom);\r
+            return el;\r
+        },\r
+\r
+        /**\r
+         * Set the size of this Element. If animation is true, both width and height will be animated concurrently.\r
+         * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>\r
+         * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).</li>\r
+         * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.\r
+         * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>\r
+         * </ul></div>\r
+         * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>\r
+         * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels).</li>\r
+         * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>\r
+         * </ul></div>\r
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+         * @return {Ext.Element} this\r
+         */\r
+        setSize : function(width, height, animate){\r
+            var me = this;\r
+            if(Ext.isObject(width)){ // in case of object from getSize()\r
+                height = width.height;\r
+                width = width.width;\r
+            }\r
+            width = me.adjustWidth(width);\r
+            height = me.adjustHeight(height);\r
+            if(!animate || !me.anim){\r
+                me.dom.style.width = me.addUnits(width);\r
+                me.dom.style.height = me.addUnits(height);\r
+            }else{\r
+                me.anim({width: {to: width}, height: {to: height}}, me.preanim(arguments, 2));\r
+            }\r
+            return me;\r
+        },\r
+\r
+        /**\r
+         * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders\r
+         * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements\r
+         * if a height has not been set using CSS.\r
+         * @return {Number}\r
+         */\r
+        getComputedHeight : function(){\r
+            var me = this,\r
+                h = Math.max(me.dom.offsetHeight, me.dom.clientHeight);\r
+            if(!h){\r
+                h = parseFloat(me.getStyle('height')) || 0;\r
+                if(!me.isBorderBox()){\r
+                    h += me.getFrameWidth('tb');\r
+                }\r
+            }\r
+            return h;\r
+        },\r
+\r
+        /**\r
+         * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders\r
+         * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements\r
+         * if a width has not been set using CSS.\r
+         * @return {Number}\r
+         */\r
+        getComputedWidth : function(){\r
+            var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth);\r
+            if(!w){\r
+                w = parseFloat(this.getStyle('width')) || 0;\r
+                if(!this.isBorderBox()){\r
+                    w += this.getFrameWidth('lr');\r
+                }\r
+            }\r
+            return w;\r
+        },\r
+\r
+        /**\r
+         * Returns the sum width of the padding and borders for the passed "sides". See getBorderWidth()\r
+         for more information about the sides.\r
+         * @param {String} sides\r
+         * @return {Number}\r
+         */\r
+        getFrameWidth : function(sides, onlyContentBox){\r
+            return onlyContentBox && this.isBorderBox() ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides));\r
+        },\r
+\r
+        /**\r
+         * Sets up event handlers to add and remove a css class when the mouse is over this element\r
+         * @param {String} className\r
+         * @return {Ext.Element} this\r
+         */\r
+        addClassOnOver : function(className){\r
+            this.hover(\r
+                function(){\r
+                    Ext.fly(this, INTERNAL).addClass(className);\r
+                },\r
+                function(){\r
+                    Ext.fly(this, INTERNAL).removeClass(className);\r
+                }\r
+            );\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Sets up event handlers to add and remove a css class when this element has the focus\r
+         * @param {String} className\r
+         * @return {Ext.Element} this\r
+         */\r
+        addClassOnFocus : function(className){\r
+            this.on("focus", function(){\r
+                Ext.fly(this, INTERNAL).addClass(className);\r
+            }, this.dom);\r
+            this.on("blur", function(){\r
+                Ext.fly(this, INTERNAL).removeClass(className);\r
+            }, this.dom);\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect)\r
+         * @param {String} className\r
+         * @return {Ext.Element} this\r
+         */\r
+        addClassOnClick : function(className){\r
+            var dom = this.dom;\r
+            this.on("mousedown", function(){\r
+                Ext.fly(dom, INTERNAL).addClass(className);\r
+                var d = Ext.getDoc(),\r
+                    fn = function(){\r
+                        Ext.fly(dom, INTERNAL).removeClass(className);\r
+                        d.removeListener("mouseup", fn);\r
+                    };\r
+                d.on("mouseup", fn);\r
+            });\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * <p>Returns the dimensions of the element available to lay content out in.<p>\r
+         * <p>If the element (or any ancestor element) has CSS style <code>display : none</code>, the dimensions will be zero.</p>\r
+         * example:<pre><code>\r
+        var vpSize = Ext.getBody().getViewSize();\r
+\r
+        // all Windows created afterwards will have a default value of 90% height and 95% width\r
+        Ext.Window.override({\r
+            width: vpSize.width * 0.9,\r
+            height: vpSize.height * 0.95\r
+        });\r
+        // To handle window resizing you would have to hook onto onWindowResize.\r
+        * </code></pre>\r
+        *\r
+        * getViewSize utilizes clientHeight/clientWidth which excludes sizing of scrollbars.\r
+        * To obtain the size including scrollbars, use getStyleSize\r
+        *\r
+        * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.\r
+        */\r
+\r
+        getViewSize : function(){\r
+            var doc = document,\r
+                d = this.dom,\r
+                isDoc = (d == doc || d == doc.body);\r
+\r
+            // If the body, use Ext.lib.Dom\r
+            if (isDoc) {\r
+                var extdom = Ext.lib.Dom;\r
+                return {\r
+                    width : extdom.getViewWidth(),\r
+                    height : extdom.getViewHeight()\r
+                }\r
+\r
+            // Else use clientHeight/clientWidth\r
+            } else {\r
+                return {\r
+                    width : d.clientWidth,\r
+                    height : d.clientHeight\r
+                }\r
+            }\r
+        },\r
+\r
+        /**\r
+        * <p>Returns the dimensions of the element available to lay content out in.<p>\r
+        *\r
+        * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and offsetWidth/clientWidth.\r
+        * To obtain the size excluding scrollbars, use getViewSize\r
+        *\r
+        * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc.\r
+        */\r
+\r
+        getStyleSize : function(){\r
+            var me = this,\r
+                w, h,\r
+                doc = document,\r
+                d = this.dom,\r
+                isDoc = (d == doc || d == doc.body),\r
+                s = d.style;\r
+\r
+            // If the body, use Ext.lib.Dom\r
+            if (isDoc) {\r
+                var extdom = Ext.lib.Dom;\r
+                return {\r
+                    width : extdom.getViewWidth(),\r
+                    height : extdom.getViewHeight()\r
+                }\r
+            }\r
+            // Use Styles if they are set\r
+            if(s.width && s.width != 'auto'){\r
+                w = parseFloat(s.width);\r
+                if(me.isBorderBox()){\r
+                   w -= me.getFrameWidth('lr');\r
+                }\r
+            }\r
+            // Use Styles if they are set\r
+            if(s.height && s.height != 'auto'){\r
+                h = parseFloat(s.height);\r
+                if(me.isBorderBox()){\r
+                   h -= me.getFrameWidth('tb');\r
+                }\r
+            }\r
+            // Use getWidth/getHeight if style not set.\r
+            return {width: w || me.getWidth(true), height: h || me.getHeight(true)};\r
+        },\r
+\r
+        /**\r
+         * Returns the size of the element.\r
+         * @param {Boolean} contentSize (optional) true to get the width/size minus borders and padding\r
+         * @return {Object} An object containing the element's size {width: (element width), height: (element height)}\r
+         */\r
+        getSize : function(contentSize){\r
+            return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)};\r
+        },\r
+\r
+        /**\r
+         * Forces the browser to repaint this element\r
+         * @return {Ext.Element} this\r
+         */\r
+        repaint : function(){\r
+            var dom = this.dom;\r
+            this.addClass("x-repaint");\r
+            setTimeout(function(){\r
+                Ext.fly(dom).removeClass("x-repaint");\r
+            }, 1);\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Disables text selection for this element (normalized across browsers)\r
+         * @return {Ext.Element} this\r
+         */\r
+        unselectable : function(){\r
+            this.dom.unselectable = "on";\r
+            return this.swallowEvent("selectstart", true).\r
+                        applyStyles("-moz-user-select:none;-khtml-user-select:none;").\r
+                        addClass("x-unselectable");\r
+        },\r
+\r
+        /**\r
+         * Returns an object with properties top, left, right and bottom representing the margins of this element unless sides is passed,\r
+         * then it returns the calculated width of the sides (see getPadding)\r
+         * @param {String} sides (optional) Any combination of l, r, t, b to get the sum of those sides\r
+         * @return {Object/Number}\r
+         */\r
+        getMargins : function(side){\r
+            var me = this,\r
+                key,\r
+                hash = {t:"top", l:"left", r:"right", b: "bottom"},\r
+                o = {};\r
+\r
+            if (!side) {\r
+                for (key in me.margins){\r
+                    o[hash[key]] = parseFloat(me.getStyle(me.margins[key])) || 0;\r
+                }\r
+                return o;\r
+            } else {\r
+                return me.addStyles.call(me, side, me.margins);\r
+            }\r
+        }\r
+    };\r
+}());\r
+/**\r
+ * @class Ext.Element\r
+ */\r
+(function(){\r
+var D = Ext.lib.Dom,\r
+        LEFT = "left",\r
+        RIGHT = "right",\r
+        TOP = "top",\r
+        BOTTOM = "bottom",\r
+        POSITION = "position",\r
+        STATIC = "static",\r
+        RELATIVE = "relative",\r
+        AUTO = "auto",\r
+        ZINDEX = "z-index";\r
+\r
+Ext.Element.addMethods({\r
+       /**\r
+      * Gets the current X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+      * @return {Number} The X position of the element\r
+      */\r
+    getX : function(){\r
+        return D.getX(this.dom);\r
+    },\r
+\r
+    /**\r
+      * Gets the current Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+      * @return {Number} The Y position of the element\r
+      */\r
+    getY : function(){\r
+        return D.getY(this.dom);\r
+    },\r
+\r
+    /**\r
+      * Gets the current position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+      * @return {Array} The XY position of the element\r
+      */\r
+    getXY : function(){\r
+        return D.getXY(this.dom);\r
+    },\r
+\r
+    /**\r
+      * Returns the offsets of this element from the passed element. Both element must be part of the DOM tree and not have display:none to have page coordinates.\r
+      * @param {Mixed} element The element to get the offsets from.\r
+      * @return {Array} The XY page offsets (e.g. [100, -200])\r
+      */\r
+    getOffsetsTo : function(el){\r
+        var o = this.getXY(),\r
+               e = Ext.fly(el, '_internal').getXY();\r
+        return [o[0]-e[0],o[1]-e[1]];\r
+    },\r
+\r
+    /**\r
+     * Sets the X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+     * @param {Number} The X position of the element\r
+     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setX : function(x, animate){           \r
+           return this.setXY([x, this.getY()], this.animTest(arguments, animate, 1));\r
+    },\r
+\r
+    /**\r
+     * Sets the Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+     * @param {Number} The Y position of the element\r
+     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setY : function(y, animate){           \r
+           return this.setXY([this.getX(), y], this.animTest(arguments, animate, 1));\r
+    },\r
+\r
+    /**\r
+     * Sets the element's left position directly using CSS style (instead of {@link #setX}).\r
+     * @param {String} left The left CSS property value\r
+     * @return {Ext.Element} this\r
+     */\r
+    setLeft : function(left){\r
+        this.setStyle(LEFT, this.addUnits(left));\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the element's top position directly using CSS style (instead of {@link #setY}).\r
+     * @param {String} top The top CSS property value\r
+     * @return {Ext.Element} this\r
+     */\r
+    setTop : function(top){\r
+        this.setStyle(TOP, this.addUnits(top));\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the element's CSS right style.\r
+     * @param {String} right The right CSS property value\r
+     * @return {Ext.Element} this\r
+     */\r
+    setRight : function(right){\r
+        this.setStyle(RIGHT, this.addUnits(right));\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the element's CSS bottom style.\r
+     * @param {String} bottom The bottom CSS property value\r
+     * @return {Ext.Element} this\r
+     */\r
+    setBottom : function(bottom){\r
+        this.setStyle(BOTTOM, this.addUnits(bottom));\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
+     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+     * @param {Array} pos Contains X & Y [x, y] values for new position (coordinates are page-based)\r
+     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setXY : function(pos, animate){\r
+           var me = this;\r
+        if(!animate || !me.anim){\r
+            D.setXY(me.dom, pos);\r
+        }else{\r
+            me.anim({points: {to: pos}}, me.preanim(arguments, 1), 'motion');\r
+        }\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
+     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+     * @param {Number} x X value for new position (coordinates are page-based)\r
+     * @param {Number} y Y value for new position (coordinates are page-based)\r
+     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setLocation : function(x, y, animate){\r
+        return this.setXY([x, y], this.animTest(arguments, animate, 2));\r
+    },\r
+\r
+    /**\r
+     * Sets the position of the element in page coordinates, regardless of how the element is positioned.\r
+     * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).\r
+     * @param {Number} x X value for new position (coordinates are page-based)\r
+     * @param {Number} y Y value for new position (coordinates are page-based)\r
+     * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    moveTo : function(x, y, animate){\r
+        return this.setXY([x, y], this.animTest(arguments, animate, 2));        \r
+    },    \r
+    \r
+    /**\r
+     * Gets the left X coordinate\r
+     * @param {Boolean} local True to get the local css position instead of page coordinate\r
+     * @return {Number}\r
+     */\r
+    getLeft : function(local){\r
+           return !local ? this.getX() : parseInt(this.getStyle(LEFT), 10) || 0;\r
+    },\r
+\r
+    /**\r
+     * Gets the right X coordinate of the element (element X position + element width)\r
+     * @param {Boolean} local True to get the local css position instead of page coordinate\r
+     * @return {Number}\r
+     */\r
+    getRight : function(local){\r
+           var me = this;\r
+           return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.getWidth()) || 0;\r
+    },\r
+\r
+    /**\r
+     * Gets the top Y coordinate\r
+     * @param {Boolean} local True to get the local css position instead of page coordinate\r
+     * @return {Number}\r
+     */\r
+    getTop : function(local) {\r
+           return !local ? this.getY() : parseInt(this.getStyle(TOP), 10) || 0;\r
+    },\r
+\r
+    /**\r
+     * Gets the bottom Y coordinate of the element (element Y position + element height)\r
+     * @param {Boolean} local True to get the local css position instead of page coordinate\r
+     * @return {Number}\r
+     */\r
+    getBottom : function(local){\r
+           var me = this;\r
+           return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.getHeight()) || 0;\r
+    },\r
+\r
+    /**\r
+    * Initializes positioning on this element. If a desired position is not passed, it will make the\r
+    * the element positioned relative IF it is not already positioned.\r
+    * @param {String} pos (optional) Positioning to use "relative", "absolute" or "fixed"\r
+    * @param {Number} zIndex (optional) The zIndex to apply\r
+    * @param {Number} x (optional) Set the page X position\r
+    * @param {Number} y (optional) Set the page Y position\r
+    */\r
+    position : function(pos, zIndex, x, y){\r
+           var me = this;\r
+           \r
+        if(!pos && me.isStyle(POSITION, STATIC)){           \r
+            me.setStyle(POSITION, RELATIVE);           \r
+        } else if(pos) {\r
+            me.setStyle(POSITION, pos);\r
+        }\r
+        if(zIndex){\r
+            me.setStyle(ZINDEX, zIndex);\r
+        }\r
+        if(x || y) me.setXY([x || false, y || false]);\r
+    },\r
+\r
+    /**\r
+    * Clear positioning back to the default when the document was loaded\r
+    * @param {String} value (optional) The value to use for the left,right,top,bottom, defaults to '' (empty string). You could use 'auto'.\r
+    * @return {Ext.Element} this\r
+     */\r
+    clearPositioning : function(value){\r
+        value = value || '';\r
+        this.setStyle({\r
+            left : value,\r
+            right : value,\r
+            top : value,\r
+            bottom : value,\r
+            "z-index" : "",\r
+            position : STATIC\r
+        });\r
+        return this;\r
+    },\r
+\r
+    /**\r
+    * Gets an object with all CSS positioning properties. Useful along with setPostioning to get\r
+    * snapshot before performing an update and then restoring the element.\r
+    * @return {Object}\r
+    */\r
+    getPositioning : function(){\r
+        var l = this.getStyle(LEFT);\r
+        var t = this.getStyle(TOP);\r
+        return {\r
+            "position" : this.getStyle(POSITION),\r
+            "left" : l,\r
+            "right" : l ? "" : this.getStyle(RIGHT),\r
+            "top" : t,\r
+            "bottom" : t ? "" : this.getStyle(BOTTOM),\r
+            "z-index" : this.getStyle(ZINDEX)\r
+        };\r
+    },\r
+    \r
+    /**\r
+    * Set positioning with an object returned by getPositioning().\r
+    * @param {Object} posCfg\r
+    * @return {Ext.Element} this\r
+     */\r
+    setPositioning : function(pc){\r
+           var me = this,\r
+               style = me.dom.style;\r
+               \r
+        me.setStyle(pc);\r
+        \r
+        if(pc.right == AUTO){\r
+            style.right = "";\r
+        }\r
+        if(pc.bottom == AUTO){\r
+            style.bottom = "";\r
+        }\r
+        \r
+        return me;\r
+    },    \r
+       \r
+    /**\r
+     * Translates the passed page coordinates into left/top css values for this element\r
+     * @param {Number/Array} x The page x or an array containing [x, y]\r
+     * @param {Number} y (optional) The page y, required if x is not an array\r
+     * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)}\r
+     */\r
+    translatePoints : function(x, y){               \r
+           y = isNaN(x[1]) ? y : x[1];\r
+        x = isNaN(x[0]) ? x : x[0];\r
+        var me = this,\r
+               relative = me.isStyle(POSITION, RELATIVE),\r
+               o = me.getXY(),\r
+               l = parseInt(me.getStyle(LEFT), 10),\r
+               t = parseInt(me.getStyle(TOP), 10);\r
+        \r
+        l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft);\r
+        t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop);        \r
+\r
+        return {left: (x - o[0] + l), top: (y - o[1] + t)}; \r
+    },\r
+    \r
+    animTest : function(args, animate, i) {\r
+        return !!animate && this.preanim ? this.preanim(args, i) : false;\r
+    }\r
+});\r
+})();/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.\r
+     * @param {Object} box The box to fill {x, y, width, height}\r
+     * @param {Boolean} adjust (optional) Whether to adjust for box-model issues automatically\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setBox : function(box, adjust, animate){\r
+        var me = this,\r
+               w = box.width, \r
+               h = box.height;\r
+        if((adjust && !me.autoBoxAdjust) && !me.isBorderBox()){\r
+           w -= (me.getBorderWidth("lr") + me.getPadding("lr"));\r
+           h -= (me.getBorderWidth("tb") + me.getPadding("tb"));\r
+        }\r
+        me.setBounds(box.x, box.y, w, h, me.animTest.call(me, arguments, animate, 2));\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Return an object defining the area of this Element which can be passed to {@link #setBox} to\r
+     * set another Element's size/location to match this element.\r
+     * @param {Boolean} contentBox (optional) If true a box for the content of the element is returned.\r
+     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page x/y.\r
+     * @return {Object} box An object in the format<pre><code>\r
+{\r
+    x: &lt;Element's X position>,\r
+    y: &lt;Element's Y position>,\r
+    width: &lt;Element's width>,\r
+    height: &lt;Element's height>,\r
+    bottom: &lt;Element's lower bound>,\r
+    right: &lt;Element's rightmost bound>\r
+}\r
+</code></pre>\r
+     * The returned object may also be addressed as an Array where index 0 contains the X position\r
+     * and index 1 contains the Y position. So the result may also be used for {@link #setXY}\r
+     */\r
+       getBox : function(contentBox, local) {      \r
+           var me = this,\r
+               xy,\r
+               left,\r
+               top,\r
+               getBorderWidth = me.getBorderWidth,\r
+               getPadding = me.getPadding, \r
+               l,\r
+               r,\r
+               t,\r
+               b;\r
+        if(!local){\r
+            xy = me.getXY();\r
+        }else{\r
+            left = parseInt(me.getStyle("left"), 10) || 0;\r
+            top = parseInt(me.getStyle("top"), 10) || 0;\r
+            xy = [left, top];\r
+        }\r
+        var el = me.dom, w = el.offsetWidth, h = el.offsetHeight, bx;\r
+        if(!contentBox){\r
+            bx = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: w, height: h};\r
+        }else{\r
+            l = getBorderWidth.call(me, "l") + getPadding.call(me, "l");\r
+            r = getBorderWidth.call(me, "r") + getPadding.call(me, "r");\r
+            t = getBorderWidth.call(me, "t") + getPadding.call(me, "t");\r
+            b = getBorderWidth.call(me, "b") + getPadding.call(me, "b");\r
+            bx = {x: xy[0]+l, y: xy[1]+t, 0: xy[0]+l, 1: xy[1]+t, width: w-(l+r), height: h-(t+b)};\r
+        }\r
+        bx.right = bx.x + bx.width;\r
+        bx.bottom = bx.y + bx.height;\r
+        return bx;\r
+       },\r
+       \r
+    /**\r
+     * Move this element relative to its current position.\r
+     * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down").\r
+     * @param {Number} distance How far to move the element in pixels\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+     move : function(direction, distance, animate){\r
+        var me = this,         \r
+               xy = me.getXY(),\r
+               x = xy[0],\r
+               y = xy[1],              \r
+               left = [x - distance, y],\r
+               right = [x + distance, y],\r
+               top = [x, y - distance],\r
+               bottom = [x, y + distance],\r
+               hash = {\r
+                       l :     left,\r
+                       left : left,\r
+                       r : right,\r
+                       right : right,\r
+                       t : top,\r
+                       top : top,\r
+                       up : top,\r
+                       b : bottom, \r
+                       bottom : bottom,\r
+                       down : bottom                           \r
+               };\r
+        \r
+           direction = direction.toLowerCase();    \r
+           me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2));\r
+    },\r
+    \r
+    /**\r
+     * Quick set left and top adding default units\r
+     * @param {String} left The left CSS property value\r
+     * @param {String} top The top CSS property value\r
+     * @return {Ext.Element} this\r
+     */\r
+     setLeftTop : function(left, top){\r
+           var me = this,\r
+               style = me.dom.style;\r
+        style.left = me.addUnits(left);\r
+        style.top = me.addUnits(top);\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+     * Returns the region of the given element.\r
+     * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).\r
+     * @return {Region} A Ext.lib.Region containing "top, left, bottom, right" member data.\r
+     */\r
+    getRegion : function(){\r
+        return Ext.lib.Dom.getRegion(this.dom);\r
+    },\r
+    \r
+    /**\r
+     * Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.\r
+     * @param {Number} x X value for new position (coordinates are page-based)\r
+     * @param {Number} y Y value for new position (coordinates are page-based)\r
+     * @param {Mixed} width The new width. This may be one of:<div class="mdetail-params"><ul>\r
+     * <li>A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels)</li>\r
+     * <li>A String used to set the CSS width style. Animation may <b>not</b> be used.\r
+     * </ul></div>\r
+     * @param {Mixed} height The new height. This may be one of:<div class="mdetail-params"><ul>\r
+     * <li>A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels)</li>\r
+     * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>\r
+     * </ul></div>\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setBounds : function(x, y, width, height, animate){\r
+           var me = this;\r
+        if (!animate || !me.anim) {\r
+            me.setSize(width, height);\r
+            me.setLocation(x, y);\r
+        } else {\r
+            me.anim({points: {to: [x, y]}, \r
+                        width: {to: me.adjustWidth(width)}, \r
+                        height: {to: me.adjustHeight(height)}},\r
+                     me.preanim(arguments, 4), \r
+                     'motion');\r
+        }\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Sets the element's position and size the specified region. If animation is true then width, height, x and y will be animated concurrently.\r
+     * @param {Ext.lib.Region} region The region to fill\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Ext.Element} this\r
+     */\r
+    setRegion : function(region, animate) {\r
+        return this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.animTest.call(this, arguments, animate, 1));\r
+    }\r
+});/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Returns true if this element is scrollable.\r
+     * @return {Boolean}\r
+     */\r
+    isScrollable : function(){\r
+        var dom = this.dom;\r
+        return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;\r
+    },\r
+\r
+    /**\r
+     * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().\r
+     * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.\r
+     * @param {Number} value The new scroll value.\r
+     * @return {Element} this\r
+     */\r
+    scrollTo : function(side, value){\r
+        this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Returns the current scroll position of the element.\r
+     * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}\r
+     */\r
+    getScroll : function(){\r
+        var d = this.dom, \r
+            doc = document,\r
+            body = doc.body,\r
+            docElement = doc.documentElement,\r
+            l,\r
+            t,\r
+            ret;\r
+\r
+        if(d == doc || d == body){\r
+            if(Ext.isIE && Ext.isStrict){\r
+                l = docElement.scrollLeft; \r
+                t = docElement.scrollTop;\r
+            }else{\r
+                l = window.pageXOffset;\r
+                t = window.pageYOffset;\r
+            }\r
+            ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};\r
+        }else{\r
+            ret = {left: d.scrollLeft, top: d.scrollTop};\r
+        }\r
+        return ret;\r
+    }\r
+});/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().\r
+     * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.\r
+     * @param {Number} value The new scroll value\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Element} this\r
+     */\r
+    scrollTo : function(side, value, animate){\r
+        var top = /top/i.test(side), //check if we're scrolling top or left\r
+               me = this,\r
+               dom = me.dom,\r
+            prop;\r
+        if (!animate || !me.anim) {\r
+            prop = 'scroll' + (top ? 'Top' : 'Left'), // just setting the value, so grab the direction\r
+            dom[prop] = value;\r
+        }else{\r
+            prop = 'scroll' + (top ? 'Left' : 'Top'), // if scrolling top, we need to grab scrollLeft, if left, scrollTop\r
+            me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}},\r
+                        me.preanim(arguments, 2), 'scroll');\r
+        }\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+     * Scrolls this element into view within the passed container.\r
+     * @param {Mixed} container (optional) The container element to scroll (defaults to document.body).  Should be a\r
+     * string (id), dom node, or Ext.Element.\r
+     * @param {Boolean} hscroll (optional) False to disable horizontal scroll (defaults to true)\r
+     * @return {Ext.Element} this\r
+     */\r
+    scrollIntoView : function(container, hscroll){\r
+        var c = Ext.getDom(container) || Ext.getBody().dom,\r
+               el = this.dom,\r
+               o = this.getOffsetsTo(c),\r
+            l = o[0] + c.scrollLeft,\r
+            t = o[1] + c.scrollTop,\r
+            b = t + el.offsetHeight,\r
+            r = l + el.offsetWidth,\r
+               ch = c.clientHeight,\r
+               ct = parseInt(c.scrollTop, 10),\r
+               cl = parseInt(c.scrollLeft, 10),\r
+               cb = ct + ch,\r
+               cr = cl + c.clientWidth;\r
+\r
+        if (el.offsetHeight > ch || t < ct) {\r
+               c.scrollTop = t;\r
+        } else if (b > cb){\r
+            c.scrollTop = b-ch;\r
+        }\r
+        c.scrollTop = c.scrollTop; // corrects IE, other browsers will ignore\r
+\r
+        if(hscroll !== false){\r
+                       if(el.offsetWidth > c.clientWidth || l < cl){\r
+                c.scrollLeft = l;\r
+            }else if(r > cr){\r
+                c.scrollLeft = r - c.clientWidth;\r
+            }\r
+            c.scrollLeft = c.scrollLeft;\r
+        }\r
+        return this;\r
+    },\r
+\r
+    // private\r
+    scrollChildIntoView : function(child, hscroll){\r
+        Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll);\r
+    },\r
+    \r
+    /**\r
+     * Scrolls this element the specified direction. Does bounds checking to make sure the scroll is\r
+     * within this element's scrollable range.\r
+     * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down").\r
+     * @param {Number} distance How far to scroll the element in pixels\r
+     * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+     * @return {Boolean} Returns true if a scroll was triggered or false if the element\r
+     * was scrolled as far as it could go.\r
+     */\r
+     scroll : function(direction, distance, animate){\r
+         if(!this.isScrollable()){\r
+             return;\r
+         }\r
+         var el = this.dom,\r
+            l = el.scrollLeft, t = el.scrollTop,\r
+            w = el.scrollWidth, h = el.scrollHeight,\r
+            cw = el.clientWidth, ch = el.clientHeight,\r
+            scrolled = false, v,\r
+            hash = {\r
+                l: Math.min(l + distance, w-cw),\r
+                r: v = Math.max(l - distance, 0),\r
+                t: Math.max(t - distance, 0),\r
+                b: Math.min(t + distance, h-ch)\r
+            };\r
+            hash.d = hash.b;\r
+            hash.u = hash.t;\r
+            \r
+         direction = direction.substr(0, 1);\r
+         if((v = hash[direction]) > -1){\r
+            scrolled = true;\r
+            this.scrollTo(direction == 'l' || direction == 'r' ? 'left' : 'top', v, this.preanim(arguments, 2));\r
+         }\r
+         return scrolled;\r
+    }\r
+});/**\r
+ * @class Ext.Element\r
+ */\r
+/**\r
+ * Visibility mode constant for use with {@link #setVisibilityMode}. Use visibility to hide element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.Element.VISIBILITY = 1;\r
+/**\r
+ * Visibility mode constant for use with {@link #setVisibilityMode}. Use display to hide element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.Element.DISPLAY = 2;\r
+\r
+Ext.Element.addMethods(function(){\r
+    var VISIBILITY = "visibility",\r
+        DISPLAY = "display",\r
+        HIDDEN = "hidden",\r
+        NONE = "none",      \r
+        ORIGINALDISPLAY = 'originalDisplay',\r
+        VISMODE = 'visibilityMode',\r
+        ELDISPLAY = Ext.Element.DISPLAY,\r
+        data = Ext.Element.data,\r
+        getDisplay = function(dom){\r
+            var d = data(dom, ORIGINALDISPLAY);\r
+            if(d === undefined){\r
+                data(dom, ORIGINALDISPLAY, d = '');\r
+            }\r
+            return d;\r
+        },\r
+        getVisMode = function(dom){\r
+            var m = data(dom, VISMODE);\r
+            if(m === undefined){\r
+                data(dom, VISMODE, m = 1)\r
+            }\r
+            return m;\r
+        };\r
+    \r
+    return {\r
+        /**\r
+         * The element's default display mode  (defaults to "")\r
+         * @type String\r
+         */\r
+        originalDisplay : "",\r
+        visibilityMode : 1,\r
+        \r
+        /**\r
+         * Sets the element's visibility mode. When setVisible() is called it\r
+         * will use this to determine whether to set the visibility or the display property.\r
+         * @param {Number} visMode Ext.Element.VISIBILITY or Ext.Element.DISPLAY\r
+         * @return {Ext.Element} this\r
+         */\r
+        setVisibilityMode : function(visMode){  \r
+            data(this.dom, VISMODE, visMode);\r
+            return this;\r
+        },\r
+        \r
+        /**\r
+         * Perform custom animation on this element.\r
+         * <div><ul class="mdetail-params">\r
+         * <li><u>Animation Properties</u></li>\r
+         * \r
+         * <p>The Animation Control Object enables gradual transitions for any member of an\r
+         * element's style object that takes a numeric value including but not limited to\r
+         * these properties:</p><div><ul class="mdetail-params">\r
+         * <li><tt>bottom, top, left, right</tt></li>\r
+         * <li><tt>height, width</tt></li>\r
+         * <li><tt>margin, padding</tt></li>\r
+         * <li><tt>borderWidth</tt></li>\r
+         * <li><tt>opacity</tt></li>\r
+         * <li><tt>fontSize</tt></li>\r
+         * <li><tt>lineHeight</tt></li>\r
+         * </ul></div>\r
+         * \r
+         * \r
+         * <li><u>Animation Property Attributes</u></li>\r
+         * \r
+         * <p>Each Animation Property is a config object with optional properties:</p>\r
+         * <div><ul class="mdetail-params">\r
+         * <li><tt>by</tt>*  : relative change - start at current value, change by this value</li>\r
+         * <li><tt>from</tt> : ignore current value, start from this value</li>\r
+         * <li><tt>to</tt>*  : start at current value, go to this value</li>\r
+         * <li><tt>unit</tt> : any allowable unit specification</li>\r
+         * <p>* do not specify both <tt>to</tt> and <tt>by</tt> for an animation property</p>\r
+         * </ul></div>\r
+         * \r
+         * <li><u>Animation Types</u></li>\r
+         * \r
+         * <p>The supported animation types:</p><div><ul class="mdetail-params">\r
+         * <li><tt>'run'</tt> : Default\r
+         * <pre><code>\r
+var el = Ext.get('complexEl');\r
+el.animate(\r
+    // animation control object\r
+    {\r
+        borderWidth: {to: 3, from: 0},\r
+        opacity: {to: .3, from: 1},\r
+        height: {to: 50, from: el.getHeight()},\r
+        width: {to: 300, from: el.getWidth()},\r
+        top  : {by: - 100, unit: 'px'},\r
+    },\r
+    0.35,      // animation duration\r
+    null,      // callback\r
+    'easeOut', // easing method\r
+    'run'      // animation type ('run','color','motion','scroll')    \r
+);\r
+         * </code></pre>\r
+         * </li>\r
+         * <li><tt>'color'</tt>\r
+         * <p>Animates transition of background, text, or border colors.</p>\r
+         * <pre><code>\r
+el.animate(\r
+    // animation control object\r
+    {\r
+        color: { to: '#06e' },\r
+        backgroundColor: { to: '#e06' }\r
+    },\r
+    0.35,      // animation duration\r
+    null,      // callback\r
+    'easeOut', // easing method\r
+    'color'    // animation type ('run','color','motion','scroll')    \r
+);\r
+         * </code></pre> \r
+         * </li>\r
+         * \r
+         * <li><tt>'motion'</tt>\r
+         * <p>Animates the motion of an element to/from specific points using optional bezier\r
+         * way points during transit.</p>\r
+         * <pre><code>\r
+el.animate(\r
+    // animation control object\r
+    {\r
+        borderWidth: {to: 3, from: 0},\r
+        opacity: {to: .3, from: 1},\r
+        height: {to: 50, from: el.getHeight()},\r
+        width: {to: 300, from: el.getWidth()},\r
+        top  : {by: - 100, unit: 'px'},\r
+        points: {\r
+            to: [50, 100],  // go to this point\r
+            control: [      // optional bezier way points\r
+                [ 600, 800],\r
+                [-100, 200]\r
+            ]\r
+        }\r
+    },\r
+    3000,      // animation duration (milliseconds!)\r
+    null,      // callback\r
+    'easeOut', // easing method\r
+    'motion'   // animation type ('run','color','motion','scroll')    \r
+);\r
+         * </code></pre> \r
+         * </li>\r
+         * <li><tt>'scroll'</tt>\r
+         * <p>Animate horizontal or vertical scrolling of an overflowing page element.</p>\r
+         * <pre><code>\r
+el.animate(\r
+    // animation control object\r
+    {\r
+        scroll: {to: [400, 300]}\r
+    },\r
+    0.35,      // animation duration\r
+    null,      // callback\r
+    'easeOut', // easing method\r
+    'scroll'   // animation type ('run','color','motion','scroll')    \r
+);\r
+         * </code></pre> \r
+         * </li>\r
+         * </ul></div>\r
+         * \r
+         * </ul></div>\r
+         * \r
+         * @param {Object} args The animation control args\r
+         * @param {Float} duration (optional) How long the animation lasts in seconds (defaults to <tt>.35</tt>)\r
+         * @param {Function} onComplete (optional) Function to call when animation completes\r
+         * @param {String} easing (optional) {@link Ext.Fx#easing} method to use (defaults to <tt>'easeOut'</tt>)\r
+         * @param {String} animType (optional) <tt>'run'</tt> is the default. Can also be <tt>'color'</tt>,\r
+         * <tt>'motion'</tt>, or <tt>'scroll'</tt>\r
+         * @return {Ext.Element} this\r
+         */\r
+        animate : function(args, duration, onComplete, easing, animType){       \r
+            this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType);\r
+            return this;\r
+        },\r
+    \r
+        /*\r
+         * @private Internal animation call\r
+         */\r
+        anim : function(args, opt, animType, defaultDur, defaultEase, cb){\r
+            animType = animType || 'run';\r
+            opt = opt || {};\r
+            var me = this,              \r
+                anim = Ext.lib.Anim[animType](\r
+                    me.dom, \r
+                    args,\r
+                    (opt.duration || defaultDur) || .35,\r
+                    (opt.easing || defaultEase) || 'easeOut',\r
+                    function(){\r
+                        if(cb) cb.call(me);\r
+                        if(opt.callback) opt.callback.call(opt.scope || me, me, opt);\r
+                    },\r
+                    me\r
+                );\r
+            opt.anim = anim;\r
+            return anim;\r
+        },\r
+    \r
+        // private legacy anim prep\r
+        preanim : function(a, i){\r
+            return !a[i] ? false : (Ext.isObject(a[i]) ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]});\r
+        },\r
+        \r
+        /**\r
+         * Checks whether the element is currently visible using both visibility and display properties.         \r
+         * @return {Boolean} True if the element is currently visible, else false\r
+         */\r
+        isVisible : function() {\r
+            return !this.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE);\r
+        },\r
+        \r
+        /**\r
+         * Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use\r
+         * the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the visibility property.\r
+         * @param {Boolean} visible Whether the element is visible\r
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+         * @return {Ext.Element} this\r
+         */\r
+         setVisible : function(visible, animate){\r
+            var me = this,\r
+                dom = me.dom,\r
+                isDisplay = getVisMode(this.dom) == ELDISPLAY;\r
+                \r
+            if (!animate || !me.anim) {\r
+                if(isDisplay){\r
+                    me.setDisplayed(visible);\r
+                }else{\r
+                    me.fixDisplay();\r
+                    dom.style.visibility = visible ? "visible" : HIDDEN;\r
+                }\r
+            }else{\r
+                // closure for composites            \r
+                if(visible){\r
+                    me.setOpacity(.01);\r
+                    me.setVisible(true);\r
+                }\r
+                me.anim({opacity: { to: (visible?1:0) }},\r
+                        me.preanim(arguments, 1),\r
+                        null,\r
+                        .35,\r
+                        'easeIn',\r
+                        function(){\r
+                             if(!visible){\r
+                                 dom.style[isDisplay ? DISPLAY : VISIBILITY] = (isDisplay) ? NONE : HIDDEN;                     \r
+                                 Ext.fly(dom).setOpacity(1);\r
+                             }\r
+                        });\r
+            }\r
+            return me;\r
+        },\r
+    \r
+        /**\r
+         * Toggles the element's visibility or display, depending on visibility mode.\r
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object\r
+         * @return {Ext.Element} this\r
+         */\r
+        toggle : function(animate){\r
+            var me = this;\r
+            me.setVisible(!me.isVisible(), me.preanim(arguments, 0));\r
+            return me;\r
+        },\r
+    \r
+        /**\r
+         * Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true.\r
+         * @param {Mixed} value Boolean value to display the element using its default display, or a string to set the display directly.\r
+         * @return {Ext.Element} this\r
+         */\r
+        setDisplayed : function(value) {            \r
+            if(typeof value == "boolean"){\r
+               value = value ? getDisplay(this.dom) : NONE;\r
+            }\r
+            this.setStyle(DISPLAY, value);\r
+            return this;\r
+        },\r
+        \r
+        // private\r
+        fixDisplay : function(){\r
+            var me = this;\r
+            if(me.isStyle(DISPLAY, NONE)){\r
+                me.setStyle(VISIBILITY, HIDDEN);\r
+                me.setStyle(DISPLAY, getDisplay(this.dom)); // first try reverting to default\r
+                if(me.isStyle(DISPLAY, NONE)){ // if that fails, default to block\r
+                    me.setStyle(DISPLAY, "block");\r
+                }\r
+            }\r
+        },\r
+    \r
+        /**\r
+         * Hide this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.\r
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+         * @return {Ext.Element} this\r
+         */\r
+        hide : function(animate){\r
+            this.setVisible(false, this.preanim(arguments, 0));\r
+            return this;\r
+        },\r
+    \r
+        /**\r
+        * Show this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.\r
+        * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object\r
+         * @return {Ext.Element} this\r
+         */\r
+        show : function(animate){\r
+            this.setVisible(true, this.preanim(arguments, 0));\r
+            return this;\r
+        }\r
+    }\r
+}());/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods(\r
+function(){\r
+    var VISIBILITY = "visibility",\r
+        DISPLAY = "display",\r
+        HIDDEN = "hidden",\r
+        NONE = "none",\r
+           XMASKED = "x-masked",\r
+               XMASKEDRELATIVE = "x-masked-relative",\r
+        data = Ext.Element.data;\r
+\r
+       return {\r
+               /**\r
+            * Checks whether the element is currently visible using both visibility and display properties.\r
+            * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false)\r
+            * @return {Boolean} True if the element is currently visible, else false\r
+            */\r
+           isVisible : function(deep) {\r
+               var vis = !this.isStyle(VISIBILITY,HIDDEN) && !this.isStyle(DISPLAY,NONE),\r
+                       p = this.dom.parentNode;\r
+               if(deep !== true || !vis){\r
+                   return vis;\r
+               }\r
+               while(p && !/^body/i.test(p.tagName)){\r
+                   if(!Ext.fly(p, '_isVisible').isVisible()){\r
+                       return false;\r
+                   }\r
+                   p = p.parentNode;\r
+               }\r
+               return true;\r
+           },\r
+\r
+           /**\r
+            * Returns true if display is not "none"\r
+            * @return {Boolean}\r
+            */\r
+           isDisplayed : function() {\r
+               return !this.isStyle(DISPLAY, NONE);\r
+           },\r
+\r
+               /**\r
+            * Convenience method for setVisibilityMode(Element.DISPLAY)\r
+            * @param {String} display (optional) What to set display to when visible\r
+            * @return {Ext.Element} this\r
+            */\r
+           enableDisplayMode : function(display){\r
+               this.setVisibilityMode(Ext.Element.DISPLAY);\r
+               if(!Ext.isEmpty(display)){\r
+                data(this.dom, 'originalDisplay', display);\r
+            }\r
+               return this;\r
+           },\r
+\r
+               /**\r
+            * Puts a mask over this element to disable user interaction. Requires core.css.\r
+            * This method can only be applied to elements which accept child nodes.\r
+            * @param {String} msg (optional) A message to display in the mask\r
+            * @param {String} msgCls (optional) A css class to apply to the msg element\r
+            * @return {Element} The mask element\r
+            */\r
+           mask : function(msg, msgCls){\r
+                   var me = this,\r
+                       dom = me.dom,\r
+                       dh = Ext.DomHelper,\r
+                       EXTELMASKMSG = "ext-el-mask-msg",\r
+                el,\r
+                mask;\r
+\r
+               if(me.getStyle("position") == "static"){\r
+                   me.addClass(XMASKEDRELATIVE);\r
+               }\r
+               if((el = data(dom, 'maskMsg'))){\r
+                   el.remove();\r
+               }\r
+               if((el = data(dom, 'mask'))){\r
+                   el.remove();\r
+               }\r
+\r
+            mask = dh.append(dom, {cls : "ext-el-mask"}, true);\r
+               data(dom, 'mask', mask);\r
+\r
+               me.addClass(XMASKED);\r
+               mask.setDisplayed(true);\r
+               if(typeof msg == 'string'){\r
+                var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true);\r
+                data(dom, 'maskMsg', mm);\r
+                   mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG;\r
+                   mm.dom.firstChild.innerHTML = msg;\r
+                   mm.setDisplayed(true);\r
+                   mm.center(me);\r
+               }\r
+               if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto'){ // ie will not expand full height automatically\r
+                   mask.setSize(undefined, me.getHeight());\r
+               }\r
+               return mask;\r
+           },\r
+\r
+           /**\r
+            * Removes a previously applied mask.\r
+            */\r
+           unmask : function(){\r
+                   var me = this,\r
+                dom = me.dom,\r
+                       mask = data(dom, 'mask'),\r
+                       maskMsg = data(dom, 'maskMsg');\r
+               if(mask){\r
+                   if(maskMsg){\r
+                       maskMsg.remove();\r
+                    data(dom, 'maskMsg', undefined);\r
+                   }\r
+                   mask.remove();\r
+                data(dom, 'mask', undefined);\r
+               }\r
+               me.removeClass([XMASKED, XMASKEDRELATIVE]);\r
+           },\r
+\r
+           /**\r
+            * Returns true if this element is masked\r
+            * @return {Boolean}\r
+            */\r
+           isMasked : function(){\r
+            var m = data(this.dom, 'mask');\r
+               return m && m.isVisible();\r
+           },\r
+\r
+           /**\r
+            * Creates an iframe shim for this element to keep selects and other windowed objects from\r
+            * showing through.\r
+            * @return {Ext.Element} The new shim element\r
+            */\r
+           createShim : function(){\r
+               var el = document.createElement('iframe'),\r
+                       shim;\r
+               el.frameBorder = '0';\r
+               el.className = 'ext-shim';\r
+               el.src = Ext.SSL_SECURE_URL;\r
+               shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));\r
+               shim.autoBoxAdjust = false;\r
+               return shim;\r
+           }\r
+    };\r
+}());/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Convenience method for constructing a KeyMap\r
+     * @param {Number/Array/Object/String} key Either a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options:\r
+     * <code>{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}</code>\r
+     * @param {Function} fn The function to call\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the specified function is executed. Defaults to this Element.\r
+     * @return {Ext.KeyMap} The KeyMap created\r
+     */\r
+    addKeyListener : function(key, fn, scope){\r
+        var config;\r
+        if(!Ext.isObject(key) || Ext.isArray(key)){\r
+            config = {\r
+                key: key,\r
+                fn: fn,\r
+                scope: scope\r
+            };\r
+        }else{\r
+            config = {\r
+                key : key.key,\r
+                shift : key.shift,\r
+                ctrl : key.ctrl,\r
+                alt : key.alt,\r
+                fn: fn,\r
+                scope: scope\r
+            };\r
+        }\r
+        return new Ext.KeyMap(this, config);\r
+    },\r
+\r
+    /**\r
+     * Creates a KeyMap for this element\r
+     * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details\r
+     * @return {Ext.KeyMap} The KeyMap created\r
+     */\r
+    addKeyMap : function(config){\r
+        return new Ext.KeyMap(this, config);\r
+    }\r
+});(function(){\r
+    // contants\r
+    var NULL = null,\r
+        UNDEFINED = undefined,\r
+        TRUE = true,\r
+        FALSE = false,\r
+        SETX = "setX",\r
+        SETY = "setY",\r
+        SETXY = "setXY",\r
+        LEFT = "left",\r
+        BOTTOM = "bottom",\r
+        TOP = "top",\r
+        RIGHT = "right",\r
+        HEIGHT = "height",\r
+        WIDTH = "width",\r
+        POINTS = "points",\r
+        HIDDEN = "hidden",\r
+        ABSOLUTE = "absolute",\r
+        VISIBLE = "visible",\r
+        MOTION = "motion",\r
+        POSITION = "position",\r
+        EASEOUT = "easeOut",\r
+        /*\r
+         * Use a light flyweight here since we are using so many callbacks and are always assured a DOM element\r
+         */\r
+        flyEl = new Ext.Element.Flyweight(),\r
+        queues = {},\r
+        getObject = function(o){\r
+            return o || {};\r
+        },\r
+        fly = function(dom){\r
+            flyEl.dom = dom;\r
+            flyEl.id = Ext.id(dom);\r
+            return flyEl;\r
+        },\r
+        /*\r
+         * Queueing now stored outside of the element due to closure issues\r
+         */\r
+        getQueue = function(id){\r
+            if(!queues[id]){\r
+                queues[id] = [];\r
+            }\r
+            return queues[id];\r
+        },\r
+        setQueue = function(id, value){\r
+            queues[id] = value;\r
+        };\r
+        \r
+//Notifies Element that fx methods are available\r
+Ext.enableFx = TRUE;\r
+\r
+/**\r
+ * @class Ext.Fx\r
+ * <p>A class to provide basic animation and visual effects support.  <b>Note:</b> This class is automatically applied\r
+ * to the {@link Ext.Element} interface when included, so all effects calls should be performed via {@link Ext.Element}.\r
+ * Conversely, since the effects are not actually defined in {@link Ext.Element}, Ext.Fx <b>must</b> be\r
+ * {@link Ext#enableFx included} in order for the Element effects to work.</p><br/>\r
+ * \r
+ * <p><b><u>Method Chaining</u></b></p>\r
+ * <p>It is important to note that although the Fx methods and many non-Fx Element methods support "method chaining" in that\r
+ * they return the Element object itself as the method return value, it is not always possible to mix the two in a single\r
+ * method chain.  The Fx methods use an internal effects queue so that each effect can be properly timed and sequenced.\r
+ * Non-Fx methods, on the other hand, have no such internal queueing and will always execute immediately.  For this reason,\r
+ * while it may be possible to mix certain Fx and non-Fx method calls in a single chain, it may not always provide the\r
+ * expected results and should be done with care.  Also see <tt>{@link #callback}</tt>.</p><br/>\r
+ *\r
+ * <p><b><u>Anchor Options for Motion Effects</u></b></p>\r
+ * <p>Motion effects support 8-way anchoring, meaning that you can choose one of 8 different anchor points on the Element\r
+ * that will serve as either the start or end point of the animation.  Following are all of the supported anchor positions:</p>\r
+<pre>\r
+Value  Description\r
+-----  -----------------------------\r
+tl     The top left corner\r
+t      The center of the top edge\r
+tr     The top right corner\r
+l      The center of the left edge\r
+r      The center of the right edge\r
+bl     The bottom left corner\r
+b      The center of the bottom edge\r
+br     The bottom right corner\r
+</pre>\r
+ * <b>Note</b>: some Fx methods accept specific custom config parameters.  The options shown in the Config Options\r
+ * section below are common options that can be passed to any Fx method unless otherwise noted.</b>\r
+ * \r
+ * @cfg {Function} callback A function called when the effect is finished.  Note that effects are queued internally by the\r
+ * Fx class, so a callback is not required to specify another effect -- effects can simply be chained together\r
+ * and called in sequence (see note for <b><u>Method Chaining</u></b> above), for example:<pre><code>\r
+ * el.slideIn().highlight();\r
+ * </code></pre>\r
+ * The callback is intended for any additional code that should run once a particular effect has completed. The Element\r
+ * being operated upon is passed as the first parameter.\r
+ * \r
+ * @cfg {Object} scope The scope (<code>this</code> reference) in which the <tt>{@link #callback}</tt> function is executed. Defaults to the browser window.\r
+ * \r
+ * @cfg {String} easing A valid Ext.lib.Easing value for the effect:</p><div class="mdetail-params"><ul>\r
+ * <li><b><tt>backBoth</tt></b></li>\r
+ * <li><b><tt>backIn</tt></b></li>\r
+ * <li><b><tt>backOut</tt></b></li>\r
+ * <li><b><tt>bounceBoth</tt></b></li>\r
+ * <li><b><tt>bounceIn</tt></b></li>\r
+ * <li><b><tt>bounceOut</tt></b></li>\r
+ * <li><b><tt>easeBoth</tt></b></li>\r
+ * <li><b><tt>easeBothStrong</tt></b></li>\r
+ * <li><b><tt>easeIn</tt></b></li>\r
+ * <li><b><tt>easeInStrong</tt></b></li>\r
+ * <li><b><tt>easeNone</tt></b></li>\r
+ * <li><b><tt>easeOut</tt></b></li>\r
+ * <li><b><tt>easeOutStrong</tt></b></li>\r
+ * <li><b><tt>elasticBoth</tt></b></li>\r
+ * <li><b><tt>elasticIn</tt></b></li>\r
+ * <li><b><tt>elasticOut</tt></b></li>\r
+ * </ul></div>\r
+ *\r
+ * @cfg {String} afterCls A css class to apply after the effect\r
+ * @cfg {Number} duration The length of time (in seconds) that the effect should last\r
+ * \r
+ * @cfg {Number} endOpacity Only applicable for {@link #fadeIn} or {@link #fadeOut}, a number between\r
+ * <tt>0</tt> and <tt>1</tt> inclusive to configure the ending opacity value.\r
+ *  \r
+ * @cfg {Boolean} remove Whether the Element should be removed from the DOM and destroyed after the effect finishes\r
+ * @cfg {Boolean} useDisplay Whether to use the <i>display</i> CSS property instead of <i>visibility</i> when hiding Elements (only applies to \r
+ * effects that end with the element being visually hidden, ignored otherwise)\r
+ * @cfg {String/Object/Function} afterStyle A style specification string, e.g. <tt>"width:100px"</tt>, or an object\r
+ * in the form <tt>{width:"100px"}</tt>, or a function which returns such a specification that will be applied to the\r
+ * Element after the effect finishes.\r
+ * @cfg {Boolean} block Whether the effect should block other effects from queueing while it runs\r
+ * @cfg {Boolean} concurrent Whether to allow subsequently-queued effects to run at the same time as the current effect, or to ensure that they run in sequence\r
+ * @cfg {Boolean} stopFx Whether preceding effects should be stopped and removed before running current effect (only applies to non blocking effects)\r
+ */\r
+Ext.Fx = {\r
+    \r
+    // private - calls the function taking arguments from the argHash based on the key.  Returns the return value of the function.\r
+    //           this is useful for replacing switch statements (for example).\r
+    switchStatements : function(key, fn, argHash){\r
+        return fn.apply(this, argHash[key]);\r
+    },\r
+    \r
+    /**\r
+     * Slides the element into view.  An anchor point can be optionally passed to set the point of\r
+     * origin for the slide effect.  This function automatically handles wrapping the element with\r
+     * a fixed-size container if needed.  See the Fx class overview for valid anchor point options.\r
+     * Usage:\r
+     *<pre><code>\r
+// default: slide the element in from the top\r
+el.slideIn();\r
+\r
+// custom: slide the element in from the right with a 2-second duration\r
+el.slideIn('r', { duration: 2 });\r
+\r
+// common config options shown with default values\r
+el.slideIn('t', {\r
+    easing: 'easeOut',\r
+    duration: .5\r
+});\r
+</code></pre>\r
+     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    slideIn : function(anchor, o){ \r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            st = dom.style,\r
+            xy,\r
+            r,\r
+            b,              \r
+            wrap,               \r
+            after,\r
+            st,\r
+            args, \r
+            pt,\r
+            bw,\r
+            bh;\r
+            \r
+        anchor = anchor || "t";\r
+\r
+        me.queueFx(o, function(){            \r
+            xy = fly(dom).getXY();\r
+            // fix display to visibility\r
+            fly(dom).fixDisplay();            \r
+            \r
+            // restore values after effect\r
+            r = fly(dom).getFxRestore();      \r
+            b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight};\r
+            b.right = b.x + b.width;\r
+            b.bottom = b.y + b.height;\r
+            \r
+            // fixed size for slide\r
+            fly(dom).setWidth(b.width).setHeight(b.height);            \r
+            \r
+            // wrap if needed\r
+            wrap = fly(dom).fxWrap(r.pos, o, HIDDEN);\r
+            \r
+            st.visibility = VISIBLE;\r
+            st.position = ABSOLUTE;\r
+            \r
+            // clear out temp styles after slide and unwrap\r
+            function after(){\r
+                 fly(dom).fxUnwrap(wrap, r.pos, o);\r
+                 st.width = r.width;\r
+                 st.height = r.height;\r
+                 fly(dom).afterFx(o);\r
+            }\r
+            \r
+            // time to calculate the positions        \r
+            pt = {to: [b.x, b.y]}; \r
+            bw = {to: b.width};\r
+            bh = {to: b.height};\r
+                \r
+            function argCalc(wrap, style, ww, wh, sXY, sXYval, s1, s2, w, h, p){                    \r
+                var ret = {};\r
+                fly(wrap).setWidth(ww).setHeight(wh);\r
+                if(fly(wrap)[sXY]){\r
+                    fly(wrap)[sXY](sXYval);                  \r
+                }\r
+                style[s1] = style[s2] = "0";                    \r
+                if(w){\r
+                    ret.width = w\r
+                };\r
+                if(h){\r
+                    ret.height = h;\r
+                }\r
+                if(p){\r
+                    ret.points = p;\r
+                }\r
+                return ret;\r
+            };\r
+\r
+            args = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, {\r
+                    t  : [wrap, st, b.width, 0, NULL, NULL, LEFT, BOTTOM, NULL, bh, NULL],\r
+                    l  : [wrap, st, 0, b.height, NULL, NULL, RIGHT, TOP, bw, NULL, NULL],\r
+                    r  : [wrap, st, b.width, b.height, SETX, b.right, LEFT, TOP, NULL, NULL, pt],\r
+                    b  : [wrap, st, b.width, b.height, SETY, b.bottom, LEFT, TOP, NULL, bh, pt],\r
+                    tl : [wrap, st, 0, 0, NULL, NULL, RIGHT, BOTTOM, bw, bh, pt],\r
+                    bl : [wrap, st, 0, 0, SETY, b.y + b.height, RIGHT, TOP, bw, bh, pt],\r
+                    br : [wrap, st, 0, 0, SETXY, [b.right, b.bottom], LEFT, TOP, bw, bh, pt],\r
+                    tr : [wrap, st, 0, 0, SETX, b.x + b.width, LEFT, BOTTOM, bw, bh, pt]\r
+                });\r
+            \r
+            st.visibility = VISIBLE;\r
+            fly(wrap).show();\r
+\r
+            arguments.callee.anim = fly(wrap).fxanim(args,\r
+                o,\r
+                MOTION,\r
+                .5,\r
+                EASEOUT, \r
+                after);\r
+        });\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+     * Slides the element out of view.  An anchor point can be optionally passed to set the end point\r
+     * for the slide effect.  When the effect is completed, the element will be hidden (visibility = \r
+     * 'hidden') but block elements will still take up space in the document.  The element must be removed\r
+     * from the DOM using the 'remove' config option if desired.  This function automatically handles \r
+     * wrapping the element with a fixed-size container if needed.  See the Fx class overview for valid anchor point options.\r
+     * Usage:\r
+     *<pre><code>\r
+// default: slide the element out to the top\r
+el.slideOut();\r
+\r
+// custom: slide the element out to the right with a 2-second duration\r
+el.slideOut('r', { duration: 2 });\r
+\r
+// common config options shown with default values\r
+el.slideOut('t', {\r
+    easing: 'easeOut',\r
+    duration: .5,\r
+    remove: false,\r
+    useDisplay: false\r
+});\r
+</code></pre>\r
+     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    slideOut : function(anchor, o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            st = dom.style,\r
+            xy = me.getXY(),\r
+            wrap,\r
+            r,\r
+            b,\r
+            a,\r
+            zero = {to: 0}; \r
+                    \r
+        anchor = anchor || "t";\r
+\r
+        me.queueFx(o, function(){\r
+            \r
+            // restore values after effect\r
+            r = fly(dom).getFxRestore(); \r
+            b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight};\r
+            b.right = b.x + b.width;\r
+            b.bottom = b.y + b.height;\r
+                \r
+            // fixed size for slide   \r
+            fly(dom).setWidth(b.width).setHeight(b.height);\r
+\r
+            // wrap if needed\r
+            wrap = fly(dom).fxWrap(r.pos, o, VISIBLE);\r
+                \r
+            st.visibility = VISIBLE;\r
+            st.position = ABSOLUTE;\r
+            fly(wrap).setWidth(b.width).setHeight(b.height);            \r
+\r
+            function after(){\r
+                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();                \r
+                fly(dom).fxUnwrap(wrap, r.pos, o);\r
+                st.width = r.width;\r
+                st.height = r.height;\r
+                fly(dom).afterFx(o);\r
+            }            \r
+            \r
+            function argCalc(style, s1, s2, p1, v1, p2, v2, p3, v3){                    \r
+                var ret = {};\r
+                \r
+                style[s1] = style[s2] = "0";\r
+                ret[p1] = v1;               \r
+                if(p2){\r
+                    ret[p2] = v2;               \r
+                }\r
+                if(p3){\r
+                    ret[p3] = v3;\r
+                }\r
+                \r
+                return ret;\r
+            };\r
+            \r
+            a = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, {\r
+                t  : [st, LEFT, BOTTOM, HEIGHT, zero],\r
+                l  : [st, RIGHT, TOP, WIDTH, zero],\r
+                r  : [st, LEFT, TOP, WIDTH, zero, POINTS, {to : [b.right, b.y]}],\r
+                b  : [st, LEFT, TOP, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}],\r
+                tl : [st, RIGHT, BOTTOM, WIDTH, zero, HEIGHT, zero],\r
+                bl : [st, RIGHT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}],\r
+                br : [st, LEFT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x + b.width, b.bottom]}],\r
+                tr : [st, LEFT, BOTTOM, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.right, b.y]}]\r
+            });\r
+            \r
+            arguments.callee.anim = fly(wrap).fxanim(a,\r
+                o,\r
+                MOTION,\r
+                .5,\r
+                EASEOUT, \r
+                after);\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Fades the element out while slowly expanding it in all directions.  When the effect is completed, the \r
+     * element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. \r
+     * The element must be removed from the DOM using the 'remove' config option if desired.\r
+     * Usage:\r
+     *<pre><code>\r
+// default\r
+el.puff();\r
+\r
+// common config options shown with default values\r
+el.puff({\r
+    easing: 'easeOut',\r
+    duration: .5,\r
+    remove: false,\r
+    useDisplay: false\r
+});\r
+</code></pre>\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    puff : function(o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            st = dom.style,\r
+            width,\r
+            height,\r
+            r;\r
+\r
+        me.queueFx(o, function(){\r
+            width = fly(dom).getWidth();\r
+            height = fly(dom).getHeight();\r
+            fly(dom).clearOpacity();\r
+            fly(dom).show();\r
+\r
+            // restore values after effect\r
+            r = fly(dom).getFxRestore();                   \r
+            \r
+            function after(){\r
+                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();                  \r
+                fly(dom).clearOpacity();  \r
+                fly(dom).setPositioning(r.pos);\r
+                st.width = r.width;\r
+                st.height = r.height;\r
+                st.fontSize = '';\r
+                fly(dom).afterFx(o);\r
+            }   \r
+\r
+            arguments.callee.anim = fly(dom).fxanim({\r
+                    width : {to : fly(dom).adjustWidth(width * 2)},\r
+                    height : {to : fly(dom).adjustHeight(height * 2)},\r
+                    points : {by : [-width * .5, -height * .5]},\r
+                    opacity : {to : 0},\r
+                    fontSize: {to : 200, unit: "%"}\r
+                },\r
+                o,\r
+                MOTION,\r
+                .5,\r
+                EASEOUT,\r
+                 after);\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).\r
+     * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still \r
+     * take up space in the document. The element must be removed from the DOM using the 'remove' config option if desired.\r
+     * Usage:\r
+     *<pre><code>\r
+// default\r
+el.switchOff();\r
+\r
+// all config options shown with default values\r
+el.switchOff({\r
+    easing: 'easeIn',\r
+    duration: .3,\r
+    remove: false,\r
+    useDisplay: false\r
+});\r
+</code></pre>\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    switchOff : function(o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            st = dom.style,\r
+            r;\r
+\r
+        me.queueFx(o, function(){\r
+            fly(dom).clearOpacity();\r
+            fly(dom).clip();\r
+\r
+            // restore values after effect\r
+            r = fly(dom).getFxRestore();\r
+                \r
+            function after(){\r
+                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();  \r
+                fly(dom).clearOpacity();\r
+                fly(dom).setPositioning(r.pos);\r
+                st.width = r.width;\r
+                st.height = r.height;   \r
+                fly(dom).afterFx(o);\r
+            };\r
+\r
+            fly(dom).fxanim({opacity : {to : 0.3}}, \r
+                NULL, \r
+                NULL, \r
+                .1, \r
+                NULL, \r
+                function(){                                 \r
+                    fly(dom).clearOpacity();\r
+                        (function(){                            \r
+                            fly(dom).fxanim({\r
+                                height : {to : 1},\r
+                                points : {by : [0, fly(dom).getHeight() * .5]}\r
+                            }, \r
+                            o, \r
+                            MOTION, \r
+                            0.3, \r
+                            'easeIn', \r
+                            after);\r
+                        }).defer(100);\r
+                });\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Highlights the Element by setting a color (applies to the background-color by default, but can be\r
+     * changed using the "attr" config option) and then fading back to the original color. If no original\r
+     * color is available, you should provide the "endColor" config option which will be cleared after the animation.\r
+     * Usage:\r
+<pre><code>\r
+// default: highlight background to yellow\r
+el.highlight();\r
+\r
+// custom: highlight foreground text to blue for 2 seconds\r
+el.highlight("0000ff", { attr: 'color', duration: 2 });\r
+\r
+// common config options shown with default values\r
+el.highlight("ffff9c", {\r
+    attr: "background-color", //can be any valid CSS property (attribute) that supports a color value\r
+    endColor: (current color) or "ffffff",\r
+    easing: 'easeIn',\r
+    duration: 1\r
+});\r
+</code></pre>\r
+     * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */ \r
+    highlight : function(color, o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            attr = o.attr || "backgroundColor",\r
+            a = {},\r
+            restore;\r
+\r
+        me.queueFx(o, function(){\r
+            fly(dom).clearOpacity();\r
+            fly(dom).show();\r
+\r
+            function after(){\r
+                dom.style[attr] = restore;\r
+                fly(dom).afterFx(o);\r
+            }            \r
+            restore = dom.style[attr];\r
+            a[attr] = {from: color || "ffff9c", to: o.endColor || fly(dom).getColor(attr) || "ffffff"};\r
+            arguments.callee.anim = fly(dom).fxanim(a,\r
+                o,\r
+                'color',\r
+                1,\r
+                'easeIn', \r
+                after);\r
+        });\r
+        return me;\r
+    },\r
+\r
+   /**\r
+    * Shows a ripple of exploding, attenuating borders to draw attention to an Element.\r
+    * Usage:\r
+<pre><code>\r
+// default: a single light blue ripple\r
+el.frame();\r
+\r
+// custom: 3 red ripples lasting 3 seconds total\r
+el.frame("ff0000", 3, { duration: 3 });\r
+\r
+// common config options shown with default values\r
+el.frame("C3DAF9", 1, {\r
+    duration: 1 //duration of each individual ripple.\r
+    // Note: Easing is not configurable and will be ignored if included\r
+});\r
+</code></pre>\r
+    * @param {String} color (optional) The color of the border.  Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9').\r
+    * @param {Number} count (optional) The number of ripples to display (defaults to 1)\r
+    * @param {Object} options (optional) Object literal with any of the Fx config options\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    frame : function(color, count, o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            proxy,\r
+            active;\r
+\r
+        me.queueFx(o, function(){\r
+            color = color || '#C3DAF9';\r
+            if(color.length == 6){\r
+                color = '#' + color;\r
+            }            \r
+            count = count || 1;\r
+            fly(dom).show();\r
+\r
+            var xy = fly(dom).getXY(),\r
+                b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight},\r
+                queue = function(){\r
+                    proxy = fly(document.body || document.documentElement).createChild({\r
+                        style:{\r
+                            position : ABSOLUTE,\r
+                            'z-index': 35000, // yee haw\r
+                            border : '0px solid ' + color\r
+                        }\r
+                    });\r
+                    return proxy.queueFx({}, animFn);\r
+                };\r
+            \r
+            \r
+            arguments.callee.anim = {\r
+                isAnimated: true,\r
+                stop: function() {\r
+                    count = 0;\r
+                    proxy.stopFx();\r
+                }\r
+            };\r
+            \r
+            function animFn(){\r
+                var scale = Ext.isBorderBox ? 2 : 1;\r
+                active = proxy.anim({\r
+                    top : {from : b.y, to : b.y - 20},\r
+                    left : {from : b.x, to : b.x - 20},\r
+                    borderWidth : {from : 0, to : 10},\r
+                    opacity : {from : 1, to : 0},\r
+                    height : {from : b.height, to : b.height + 20 * scale},\r
+                    width : {from : b.width, to : b.width + 20 * scale}\r
+                },{\r
+                    duration: o.duration || 1,\r
+                    callback: function() {\r
+                        proxy.remove();\r
+                        --count > 0 ? queue() : fly(dom).afterFx(o);\r
+                    }\r
+                });\r
+                arguments.callee.anim = {\r
+                    isAnimated: true,\r
+                    stop: function(){\r
+                        active.stop();\r
+                    }\r
+                };\r
+            };\r
+            queue();\r
+        });\r
+        return me;\r
+    },\r
+\r
+   /**\r
+    * Creates a pause before any subsequent queued effects begin.  If there are\r
+    * no effects queued after the pause it will have no effect.\r
+    * Usage:\r
+<pre><code>\r
+el.pause(1);\r
+</code></pre>\r
+    * @param {Number} seconds The length of time to pause (in seconds)\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    pause : function(seconds){        \r
+        var dom = this.dom,\r
+            t;\r
+\r
+        this.queueFx({}, function(){\r
+            t = setTimeout(function(){\r
+                fly(dom).afterFx({});\r
+            }, seconds * 1000);\r
+            arguments.callee.anim = {\r
+                isAnimated: true,\r
+                stop: function(){\r
+                    clearTimeout(t);\r
+                    fly(dom).afterFx({});\r
+                }\r
+            };\r
+        });\r
+        return this;\r
+    },\r
+\r
+   /**\r
+    * Fade an element in (from transparent to opaque).  The ending opacity can be specified\r
+    * using the <tt>{@link #endOpacity}</tt> config option.\r
+    * Usage:\r
+<pre><code>\r
+// default: fade in from opacity 0 to 100%\r
+el.fadeIn();\r
+\r
+// custom: fade in from opacity 0 to 75% over 2 seconds\r
+el.fadeIn({ endOpacity: .75, duration: 2});\r
+\r
+// common config options shown with default values\r
+el.fadeIn({\r
+    endOpacity: 1, //can be any value between 0 and 1 (e.g. .5)\r
+    easing: 'easeOut',\r
+    duration: .5\r
+});\r
+</code></pre>\r
+    * @param {Object} options (optional) Object literal with any of the Fx config options\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    fadeIn : function(o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            to = o.endOpacity || 1;\r
+        \r
+        me.queueFx(o, function(){\r
+            fly(dom).setOpacity(0);\r
+            fly(dom).fixDisplay();\r
+            dom.style.visibility = VISIBLE;\r
+            arguments.callee.anim = fly(dom).fxanim({opacity:{to:to}},\r
+                o, NULL, .5, EASEOUT, function(){\r
+                if(to == 1){\r
+                    fly(dom).clearOpacity();\r
+                }\r
+                fly(dom).afterFx(o);\r
+            });\r
+        });\r
+        return me;\r
+    },\r
+\r
+   /**\r
+    * Fade an element out (from opaque to transparent).  The ending opacity can be specified\r
+    * using the <tt>{@link #endOpacity}</tt> config option.  Note that IE may require\r
+    * <tt>{@link #useDisplay}:true</tt> in order to redisplay correctly.\r
+    * Usage:\r
+<pre><code>\r
+// default: fade out from the element's current opacity to 0\r
+el.fadeOut();\r
+\r
+// custom: fade out from the element's current opacity to 25% over 2 seconds\r
+el.fadeOut({ endOpacity: .25, duration: 2});\r
+\r
+// common config options shown with default values\r
+el.fadeOut({\r
+    endOpacity: 0, //can be any value between 0 and 1 (e.g. .5)\r
+    easing: 'easeOut',\r
+    duration: .5,\r
+    remove: false,\r
+    useDisplay: false\r
+});\r
+</code></pre>\r
+    * @param {Object} options (optional) Object literal with any of the Fx config options\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    fadeOut : function(o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            style = dom.style,\r
+            to = o.endOpacity || 0;         \r
+        \r
+        me.queueFx(o, function(){  \r
+            arguments.callee.anim = fly(dom).fxanim({ \r
+                opacity : {to : to}},\r
+                o, \r
+                NULL, \r
+                .5, \r
+                EASEOUT, \r
+                function(){\r
+                    if(to == 0){\r
+                        Ext.Element.data(dom, 'visibilityMode') == Ext.Element.DISPLAY || o.useDisplay ? \r
+                            style.display = "none" :\r
+                            style.visibility = HIDDEN;\r
+                            \r
+                        fly(dom).clearOpacity();\r
+                    }\r
+                    fly(dom).afterFx(o);\r
+            });\r
+        });\r
+        return me;\r
     },\r
-    layoutConfig: {\r
-        // layout-specific configs go here\r
-        titleCollapse: false,\r
-        animate: true,\r
-        activeOnTop: true\r
+\r
+   /**\r
+    * Animates the transition of an element's dimensions from a starting height/width\r
+    * to an ending height/width.  This method is a convenience implementation of {@link shift}.\r
+    * Usage:\r
+<pre><code>\r
+// change height and width to 100x100 pixels\r
+el.scale(100, 100);\r
+\r
+// common config options shown with default values.  The height and width will default to\r
+// the element&#39;s existing values if passed as null.\r
+el.scale(\r
+    [element&#39;s width],\r
+    [element&#39;s height], {\r
+        easing: 'easeOut',\r
+        duration: .35\r
+    }\r
+);\r
+</code></pre>\r
+    * @param {Number} width  The new width (pass undefined to keep the original width)\r
+    * @param {Number} height  The new height (pass undefined to keep the original height)\r
+    * @param {Object} options (optional) Object literal with any of the Fx config options\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    scale : function(w, h, o){\r
+        this.shift(Ext.apply({}, o, {\r
+            width: w,\r
+            height: h\r
+        }));\r
+        return this;\r
     },\r
-    items: [{\r
-        title: 'Panel 1',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    },{\r
-        title: 'Panel 2',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    },{\r
-        title: 'Panel 3',\r
-        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
-    }]\r
+\r
+   /**\r
+    * Animates the transition of any combination of an element's dimensions, xy position and/or opacity.\r
+    * Any of these properties not specified in the config object will not be changed.  This effect \r
+    * requires that at least one new dimension, position or opacity setting must be passed in on\r
+    * the config object in order for the function to have any effect.\r
+    * Usage:\r
+<pre><code>\r
+// slide the element horizontally to x position 200 while changing the height and opacity\r
+el.shift({ x: 200, height: 50, opacity: .8 });\r
+\r
+// common config options shown with default values.\r
+el.shift({\r
+    width: [element&#39;s width],\r
+    height: [element&#39;s height],\r
+    x: [element&#39;s x position],\r
+    y: [element&#39;s y position],\r
+    opacity: [element&#39;s opacity],\r
+    easing: 'easeOut',\r
+    duration: .35\r
+});\r
+</code></pre>\r
+    * @param {Object} options  Object literal with any of the Fx config options\r
+    * @return {Ext.Element} The Element\r
+    */\r
+    shift : function(o){\r
+        o = getObject(o);\r
+        var dom = this.dom,\r
+            a = {};\r
+                \r
+        this.queueFx(o, function(){\r
+            for (var prop in o) {\r
+                if (o[prop] != UNDEFINED) {                                                 \r
+                    a[prop] = {to : o[prop]};                   \r
+                }\r
+            } \r
+            \r
+            a.width ? a.width.to = fly(dom).adjustWidth(o.width) : a;\r
+            a.height ? a.height.to = fly(dom).adjustWidth(o.height) : a;   \r
+            \r
+            if (a.x || a.y || a.xy) {\r
+                a.points = a.xy || \r
+                           {to : [ a.x ? a.x.to : fly(dom).getX(),\r
+                                   a.y ? a.y.to : fly(dom).getY()]};                  \r
+            }\r
+\r
+            arguments.callee.anim = fly(dom).fxanim(a,\r
+                o, \r
+                MOTION, \r
+                .35, \r
+                EASEOUT, \r
+                function(){\r
+                    fly(dom).afterFx(o);\r
+                });\r
+        });\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Slides the element while fading it out of view.  An anchor point can be optionally passed to set the \r
+     * ending point of the effect.\r
+     * Usage:\r
+     *<pre><code>\r
+// default: slide the element downward while fading out\r
+el.ghost();\r
+\r
+// custom: slide the element out to the right with a 2-second duration\r
+el.ghost('r', { duration: 2 });\r
+\r
+// common config options shown with default values\r
+el.ghost('b', {\r
+    easing: 'easeOut',\r
+    duration: .5,\r
+    remove: false,\r
+    useDisplay: false\r
 });\r
 </code></pre>\r
+     * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to bottom: 'b')\r
+     * @param {Object} options (optional) Object literal with any of the Fx config options\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    ghost : function(anchor, o){\r
+        o = getObject(o);\r
+        var me = this,\r
+            dom = me.dom,\r
+            st = dom.style,\r
+            a = {opacity: {to: 0}, points: {}},\r
+            pt = a.points,\r
+            r,\r
+            w,\r
+            h;\r
+            \r
+        anchor = anchor || "b";\r
+\r
+        me.queueFx(o, function(){\r
+            // restore values after effect\r
+            r = fly(dom).getFxRestore();\r
+            w = fly(dom).getWidth();\r
+            h = fly(dom).getHeight();\r
+            \r
+            function after(){\r
+                o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide();   \r
+                fly(dom).clearOpacity();\r
+                fly(dom).setPositioning(r.pos);\r
+                st.width = r.width;\r
+                st.height = r.height;\r
+                fly(dom).afterFx(o);\r
+            }\r
+                \r
+            pt.by = fly(dom).switchStatements(anchor.toLowerCase(), function(v1,v2){ return [v1, v2];}, {\r
+               t  : [0, -h],\r
+               l  : [-w, 0],\r
+               r  : [w, 0],\r
+               b  : [0, h],\r
+               tl : [-w, -h],\r
+               bl : [-w, h],\r
+               br : [w, h],\r
+               tr : [w, -h] \r
+            });\r
+                \r
+            arguments.callee.anim = fly(dom).fxanim(a,\r
+                o,\r
+                MOTION,\r
+                .5,\r
+                EASEOUT, after);\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Ensures that all effects queued after syncFx is called on the element are\r
+     * run concurrently.  This is the opposite of {@link #sequenceFx}.\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    syncFx : function(){\r
+        var me = this;\r
+        me.fxDefaults = Ext.apply(me.fxDefaults || {}, {\r
+            block : FALSE,\r
+            concurrent : TRUE,\r
+            stopFx : FALSE\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /**\r
+     * Ensures that all effects queued after sequenceFx is called on the element are\r
+     * run in sequence.  This is the opposite of {@link #syncFx}.\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    sequenceFx : function(){\r
+        var me = this;\r
+        me.fxDefaults = Ext.apply(me.fxDefaults || {}, {\r
+            block : FALSE,\r
+            concurrent : FALSE,\r
+            stopFx : FALSE\r
+        });\r
+        return me;\r
+    },\r
+\r
+    /* @private */\r
+    nextFx : function(){        \r
+        var ef = getQueue(this.dom.id)[0];\r
+        if(ef){\r
+            ef.call(this);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Returns true if the element has any effects actively running or queued, else returns false.\r
+     * @return {Boolean} True if element has active effects, else false\r
+     */\r
+    hasActiveFx : function(){\r
+        return getQueue(this.dom.id)[0];\r
+    },\r
+\r
+    /**\r
+     * Stops any running effects and clears the element's internal effects queue if it contains\r
+     * any additional effects that haven't started yet.\r
+     * @return {Ext.Element} The Element\r
+     */\r
+    stopFx : function(finish){\r
+        var me = this,\r
+            id = me.dom.id;\r
+        if(me.hasActiveFx()){\r
+            var cur = getQueue(id)[0];\r
+            if(cur && cur.anim){\r
+                if(cur.anim.isAnimated){\r
+                    setQueue(id, [cur]); //clear\r
+                    cur.anim.stop(finish !== undefined ? finish : TRUE);\r
+                }else{\r
+                    setQueue(id, []);\r
+                }\r
+            }\r
+        }\r
+        return me;\r
+    },\r
+\r
+    /* @private */\r
+    beforeFx : function(o){\r
+        if(this.hasActiveFx() && !o.concurrent){\r
+           if(o.stopFx){\r
+               this.stopFx();\r
+               return TRUE;\r
+           }\r
+           return FALSE;\r
+        }\r
+        return TRUE;\r
+    },\r
+\r
+    /**\r
+     * Returns true if the element is currently blocking so that no other effect can be queued\r
+     * until this effect is finished, else returns false if blocking is not set.  This is commonly\r
+     * used to ensure that an effect initiated by a user action runs to completion prior to the\r
+     * same effect being restarted (e.g., firing only one effect even if the user clicks several times).\r
+     * @return {Boolean} True if blocking, else false\r
+     */\r
+    hasFxBlock : function(){\r
+        var q = getQueue(this.dom.id);\r
+        return q && q[0] && q[0].block;\r
+    },\r
+\r
+    /* @private */\r
+    queueFx : function(o, fn){\r
+        var me = fly(this.dom);\r
+        if(!me.hasFxBlock()){\r
+            Ext.applyIf(o, me.fxDefaults);\r
+            if(!o.concurrent){\r
+                var run = me.beforeFx(o);\r
+                fn.block = o.block;\r
+                getQueue(me.dom.id).push(fn);\r
+                if(run){\r
+                    me.nextFx();\r
+                }\r
+            }else{\r
+                fn.call(me);\r
+            }\r
+        }\r
+        return me;\r
+    },\r
+\r
+    /* @private */\r
+    fxWrap : function(pos, o, vis){ \r
+        var dom = this.dom,\r
+            wrap,\r
+            wrapXY;\r
+        if(!o.wrap || !(wrap = Ext.getDom(o.wrap))){            \r
+            if(o.fixPosition){\r
+                wrapXY = fly(dom).getXY();\r
+            }\r
+            var div = document.createElement("div");\r
+            div.style.visibility = vis;\r
+            wrap = dom.parentNode.insertBefore(div, dom);\r
+            fly(wrap).setPositioning(pos);\r
+            if(fly(wrap).isStyle(POSITION, "static")){\r
+                fly(wrap).position("relative");\r
+            }\r
+            fly(dom).clearPositioning('auto');\r
+            fly(wrap).clip();\r
+            wrap.appendChild(dom);\r
+            if(wrapXY){\r
+                fly(wrap).setXY(wrapXY);\r
+            }\r
+        }\r
+        return wrap;\r
+    },\r
+\r
+    /* @private */\r
+    fxUnwrap : function(wrap, pos, o){      \r
+        var dom = this.dom;\r
+        fly(dom).clearPositioning();\r
+        fly(dom).setPositioning(pos);\r
+        if(!o.wrap){\r
+            var pn = fly(wrap).dom.parentNode;
+            pn.insertBefore(dom, wrap); \r
+            fly(wrap).remove();\r
+        }\r
+    },\r
+\r
+    /* @private */\r
+    getFxRestore : function(){\r
+        var st = this.dom.style;\r
+        return {pos: this.getPositioning(), width: st.width, height : st.height};\r
+    },\r
+\r
+    /* @private */\r
+    afterFx : function(o){\r
+        var dom = this.dom,\r
+            id = dom.id;\r
+        if(o.afterStyle){\r
+            fly(dom).setStyle(o.afterStyle);            \r
+        }\r
+        if(o.afterCls){\r
+            fly(dom).addClass(o.afterCls);\r
+        }\r
+        if(o.remove == TRUE){\r
+            fly(dom).remove();\r
+        }\r
+        if(o.callback){\r
+            o.callback.call(o.scope, fly(dom));\r
+        }\r
+        if(!o.concurrent){\r
+            getQueue(id).shift();\r
+            fly(dom).nextFx();\r
+        }\r
+    },\r
+\r
+    /* @private */\r
+    fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){\r
+        animType = animType || 'run';\r
+        opt = opt || {};\r
+        var anim = Ext.lib.Anim[animType](\r
+                this.dom, \r
+                args,\r
+                (opt.duration || defaultDur) || .35,\r
+                (opt.easing || defaultEase) || EASEOUT,\r
+                cb,            \r
+                this\r
+            );\r
+        opt.anim = anim;\r
+        return anim;\r
+    }\r
+};\r
+\r
+// backwards compat\r
+Ext.Fx.resize = Ext.Fx.scale;\r
+\r
+//When included, Ext.Fx is automatically applied to Element so that all basic\r
+//effects are available directly via the Element API\r
+Ext.Element.addMethods(Ext.Fx);\r
+})();
+/**\r
+ * @class Ext.CompositeElementLite\r
+ * <p>This class encapsulates a <i>collection</i> of DOM elements, providing methods to filter\r
+ * members, or to perform collective actions upon the whole set.</p>\r
+ * <p>Although they are not listed, this class supports all of the methods of {@link Ext.Element} and\r
+ * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.</p>\r
+ * Example:<pre><code>\r
+var els = Ext.select("#some-el div.some-class");\r
+// or select directly from an existing element\r
+var el = Ext.get('some-el');\r
+el.select('div.some-class');\r
+\r
+els.setWidth(100); // all elements become 100 width\r
+els.hide(true); // all elements fade out and hide\r
+// or\r
+els.setWidth(100).hide(true);\r
+</code>\r
  */\r
-Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, {\r
+Ext.CompositeElementLite = function(els, root){\r
+    /**\r
+     * <p>The Array of DOM elements which this CompositeElement encapsulates. Read-only.</p>\r
+     * <p>This will not <i>usually</i> be accessed in developers' code, but developers wishing\r
+     * to augment the capabilities of the CompositeElementLite class may use it when adding\r
+     * methods to the class.</p>\r
+     * <p>For example to add the <code>nextAll</code> method to the class to <b>add</b> all\r
+     * following siblings of selected elements, the code would be</p><code><pre>\r
+Ext.override(Ext.CompositeElementLite, {\r
+    nextAll: function() {\r
+        var els = this.elements, i, l = els.length, n, r = [], ri = -1;\r
+\r
+//      Loop through all elements in this Composite, accumulating\r
+//      an Array of all siblings.\r
+        for (i = 0; i < l; i++) {\r
+            for (n = els[i].nextSibling; n; n = n.nextSibling) {\r
+                r[++ri] = n;\r
+            }\r
+        }\r
+\r
+//      Add all found siblings to this Composite\r
+        return this.add(r);\r
+    }\r
+});</pre></code>\r
+     * @type Array\r
+     * @property elements\r
+     */\r
+    this.elements = [];\r
+    this.add(els, root);\r
+    this.el = new Ext.Element.Flyweight();\r
+};\r
+\r
+Ext.CompositeElementLite.prototype = {\r
+    isComposite: true,    \r
+    \r
+    // private\r
+    getElement : function(el){\r
+        // Set the shared flyweight dom property to the current element\r
+        var e = this.el;\r
+        e.dom = el;\r
+        e.id = el.id;\r
+        return e;\r
+    },\r
+    \r
+    // private\r
+    transformElement : function(el){\r
+        return Ext.getDom(el);\r
+    },\r
+    \r
+    /**\r
+     * Returns the number of elements in this Composite.\r
+     * @return Number\r
+     */\r
+    getCount : function(){\r
+        return this.elements.length;\r
+    },    \r
+    /**\r
+     * Adds elements to this Composite object.\r
+     * @param {Mixed} els Either an Array of DOM elements to add, or another Composite object who's elements should be added.\r
+     * @return {CompositeElement} This Composite object.\r
+     */\r
+    add : function(els, root){\r
+        var me = this,\r
+            elements = me.elements;\r
+        if(!els){\r
+            return this;\r
+        }\r
+        if(Ext.isString(els)){\r
+            els = Ext.Element.selectorFunction(els, root);\r
+        }else if(els.isComposite){\r
+            els = els.elements;\r
+        }else if(!Ext.isIterable(els)){\r
+            els = [els];\r
+        }\r
+        \r
+        for(var i = 0, len = els.length; i < len; ++i){\r
+            elements.push(me.transformElement(els[i]));\r
+        }\r
+        return me;\r
+    },\r
+    \r
+    invoke : function(fn, args){\r
+        var me = this,\r
+            els = me.elements,\r
+            len = els.length, \r
+            e, \r
+            i;\r
+            \r
+        for(i = 0; i < len; i++) {\r
+            e = els[i];\r
+            if(e){\r
+                Ext.Element.prototype[fn].apply(me.getElement(e), args);\r
+            }\r
+        }\r
+        return me;\r
+    },\r
+    /**\r
+     * Returns a flyweight Element of the dom element object at the specified index\r
+     * @param {Number} index\r
+     * @return {Ext.Element}\r
+     */\r
+    item : function(index){\r
+        var me = this,\r
+            el = me.elements[index],\r
+            out = null;\r
+\r
+        if(el){\r
+            out = me.getElement(el);\r
+        }\r
+        return out;\r
+    },\r
+\r
+    // fixes scope with flyweight\r
+    addListener : function(eventName, handler, scope, opt){\r
+        var els = this.elements,\r
+            len = els.length,\r
+            i, e;\r
+        \r
+        for(i = 0; i<len; i++) {\r
+            e = els[i];\r
+            if(e) {\r
+                Ext.EventManager.on(e, eventName, handler, scope || e, opt);\r
+            }\r
+        }\r
+        return this;\r
+    },\r
+    /**\r
+     * <p>Calls the passed function for each element in this composite.</p>\r
+     * @param {Function} fn The function to call. The function is passed the following parameters:<ul>\r
+     * <li><b>el</b> : Element<div class="sub-desc">The current Element in the iteration.\r
+     * <b>This is the flyweight (shared) Ext.Element instance, so if you require a\r
+     * a reference to the dom node, use el.dom.</b></div></li>\r
+     * <li><b>c</b> : Composite<div class="sub-desc">This Composite object.</div></li>\r
+     * <li><b>idx</b> : Number<div class="sub-desc">The zero-based index in the iteration.</div></li>\r
+     * </ul>\r
+     * @param {Object} scope (optional) The scope (<i>this</i> reference) in which the function is executed. (defaults to the Element)\r
+     * @return {CompositeElement} this\r
+     */\r
+    each : function(fn, scope){       \r
+        var me = this,\r
+            els = me.elements,\r
+            len = els.length,\r
+            i, e;\r
+        \r
+        for(i = 0; i<len; i++) {\r
+            e = els[i];\r
+            if(e){\r
+                e = this.getElement(e);\r
+                if(fn.call(scope || e, e, me, i) === false){\r
+                    break;\r
+                }\r
+            }\r
+        }\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+    * Clears this Composite and adds the elements passed.\r
+    * @param {Mixed} els Either an array of DOM elements, or another Composite from which to fill this Composite.\r
+    * @return {CompositeElement} this\r
+    */\r
+    fill : function(els){\r
+        var me = this;\r
+        me.elements = [];\r
+        me.add(els);\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+     * Filters this composite to only elements that match the passed selector.\r
+     * @param {String/Function} selector A string CSS selector or a comparison function.\r
+     * The comparison function will be called with the following arguments:<ul>\r
+     * <li><code>el</code> : Ext.Element<div class="sub-desc">The current DOM element.</div></li>\r
+     * <li><code>index</code> : Number<div class="sub-desc">The current index within the collection.</div></li>\r
+     * </ul>\r
+     * @return {CompositeElement} this\r
+     */\r
+    filter : function(selector){\r
+        var els = [],\r
+            me = this,\r
+            elements = me.elements,\r
+            fn = Ext.isFunction(selector) ? selector\r
+                : function(el){\r
+                    return el.is(selector);\r
+                };\r
+                \r
+        \r
+        me.each(function(el, self, i){\r
+            if(fn(el, i) !== false){\r
+                els[els.length] = me.transformElement(el);\r
+            }\r
+        });\r
+        me.elements = els;\r
+        return me;\r
+    },\r
+    \r
+    /**\r
+     * Find the index of the passed element within the composite collection.\r
+     * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.\r
+     * @return Number The index of the passed Ext.Element in the composite collection, or -1 if not found.\r
+     */\r
+    indexOf : function(el){\r
+        return this.elements.indexOf(this.transformElement(el));\r
+    },\r
+    \r
+    /**\r
+    * Replaces the specified element with the passed element.\r
+    * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite\r
+    * to replace.\r
+    * @param {Mixed} replacement The id of an element or the Element itself.\r
+    * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too.\r
+    * @return {CompositeElement} this\r
+    */    \r
+    replaceElement : function(el, replacement, domReplace){\r
+        var index = !isNaN(el) ? el : this.indexOf(el),\r
+            d;\r
+        if(index > -1){\r
+            replacement = Ext.getDom(replacement);\r
+            if(domReplace){\r
+                d = this.elements[index];\r
+                d.parentNode.insertBefore(replacement, d);\r
+                Ext.removeNode(d);\r
+            }\r
+            this.elements.splice(index, 1, replacement);\r
+        }\r
+        return this;\r
+    },\r
+    \r
     /**\r
-     * @cfg {Boolean} fill\r
-     * True to adjust the active item's height to fill the available space in the container, false to use the\r
-     * item's current height, or auto height if not explicitly set (defaults to true).\r
+     * Removes all elements.\r
      */\r
-    fill : true,\r
+    clear : function(){\r
+        this.elements = [];\r
+    }\r
+};\r
+\r
+Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;\r
+\r
+(function(){\r
+var fnName,\r
+    ElProto = Ext.Element.prototype,\r
+    CelProto = Ext.CompositeElementLite.prototype;\r
+    \r
+for(fnName in ElProto){\r
+    if(Ext.isFunction(ElProto[fnName])){\r
+        (function(fnName){ \r
+            CelProto[fnName] = CelProto[fnName] || function(){\r
+                return this.invoke(fnName, arguments);\r
+            };\r
+        }).call(CelProto, fnName);\r
+        \r
+    }\r
+}\r
+})();\r
+\r
+if(Ext.DomQuery){\r
+    Ext.Element.selectorFunction = Ext.DomQuery.select;\r
+} \r
+\r
+/**\r
+ * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
+ * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
+ * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
+ * @param {String/Array} selector The CSS selector or an array of elements\r
+ * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
+ * @return {CompositeElementLite/CompositeElement}\r
+ * @member Ext.Element\r
+ * @method select\r
+ */\r
+Ext.Element.select = function(selector, root){\r
+    var els;\r
+    if(typeof selector == "string"){\r
+        els = Ext.Element.selectorFunction(selector, root);\r
+    }else if(selector.length !== undefined){\r
+        els = selector;\r
+    }else{\r
+        throw "Invalid selector";\r
+    }\r
+    return new Ext.CompositeElementLite(els);\r
+};\r
+/**\r
+ * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
+ * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
+ * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
+ * @param {String/Array} selector The CSS selector or an array of elements\r
+ * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
+ * @return {CompositeElementLite/CompositeElement}\r
+ * @member Ext\r
+ * @method select\r
+ */\r
+Ext.select = Ext.Element.select;/**\r
+ * @class Ext.CompositeElementLite\r
+ */\r
+Ext.apply(Ext.CompositeElementLite.prototype, {        \r
+       addElements : function(els, root){\r
+        if(!els){\r
+            return this;\r
+        }\r
+        if(typeof els == "string"){\r
+            els = Ext.Element.selectorFunction(els, root);\r
+        }\r
+        var yels = this.elements;        \r
+           Ext.each(els, function(e) {\r
+               yels.push(Ext.get(e));\r
+        });\r
+        return this;\r
+    },\r
+    \r
     /**\r
-     * @cfg {Boolean} autoWidth\r
-     * True to set each contained item's width to 'auto', false to use the item's current width (defaults to true).\r
-     * Note that some components, in particular the {@link Ext.grid.GridPanel grid}, will not function properly within\r
-     * layouts if they have auto width, so in such cases this config should be set to false.\r
+     * Returns the first Element\r
+     * @return {Ext.Element}\r
      */\r
-    autoWidth : true,\r
+    first : function(){\r
+        return this.item(0);\r
+    },   \r
+    \r
     /**\r
-     * @cfg {Boolean} titleCollapse\r
-     * True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow\r
-     * expand/collapse only when the toggle tool button is clicked (defaults to true).  When set to false,\r
-     * {@link #hideCollapseTool} should be false also.\r
+     * Returns the last Element\r
+     * @return {Ext.Element}\r
      */\r
-    titleCollapse : true,\r
+    last : function(){\r
+        return this.item(this.getCount()-1);\r
+    },\r
+    \r
     /**\r
-     * @cfg {Boolean} hideCollapseTool\r
-     * True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false).\r
-     * When set to true, {@link #titleCollapse} should be true also.\r
+     * Returns true if this composite contains the passed element\r
+     * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.\r
+     * @return Boolean\r
      */\r
-    hideCollapseTool : false,\r
+    contains : function(el){\r
+        return this.indexOf(el) != -1;\r
+    },
+    
     /**\r
-     * @cfg {Boolean} collapseFirst\r
-     * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools\r
-     * in the contained panels' title bars, false to render it last (defaults to false).\r
-     */\r
-    collapseFirst : false,\r
+    * Removes the specified element(s).\r
+    * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite\r
+    * or an array of any of those.\r
+    * @param {Boolean} removeDom (optional) True to also remove the element from the document\r
+    * @return {CompositeElement} this\r
+    */\r
+    removeElement : function(keys, removeDom){\r
+        var me = this,\r
+               els = this.elements,        \r
+               el;             \r
+           Ext.each(keys, function(val){\r
+                   if ((el = (els[val] || els[val = me.indexOf(val)]))) {\r
+                       if(removeDom){\r
+                    if(el.dom){\r
+                        el.remove();\r
+                    }else{\r
+                        Ext.removeNode(el);\r
+                    }\r
+                }\r
+                       els.splice(val, 1);                     \r
+                       }\r
+           });\r
+        return this;\r
+    }    \r
+});
+/**\r
+ * @class Ext.CompositeElement\r
+ * @extends Ext.CompositeElementLite\r
+ * <p>This class encapsulates a <i>collection</i> of DOM elements, providing methods to filter\r
+ * members, or to perform collective actions upon the whole set.</p>\r
+ * <p>Although they are not listed, this class supports all of the methods of {@link Ext.Element} and\r
+ * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.</p>\r
+ * <p>All methods return <i>this</i> and can be chained.</p>\r
+ * Usage:\r
+<pre><code>\r
+var els = Ext.select("#some-el div.some-class", true);\r
+// or select directly from an existing element\r
+var el = Ext.get('some-el');\r
+el.select('div.some-class', true);\r
+\r
+els.setWidth(100); // all elements become 100 width\r
+els.hide(true); // all elements fade out and hide\r
+// or\r
+els.setWidth(100).hide(true);\r
+</code></pre>\r
+ */\r
+Ext.CompositeElement = function(els, root){\r
+    this.elements = [];\r
+    this.add(els, root);\r
+};\r
+\r
+Ext.extend(Ext.CompositeElement, Ext.CompositeElementLite, {\r
+    \r
+    // private\r
+    getElement : function(el){\r
+        // In this case just return it, since we already have a reference to it\r
+        return el;\r
+    },\r
+    \r
+    // private\r
+    transformElement : function(el){\r
+        return Ext.get(el);\r
+    }\r
+\r
     /**\r
-     * @cfg {Boolean} animate\r
-     * True to slide the contained panels open and closed during expand/collapse using animation, false to open and\r
-     * close directly with no animation (defaults to false).  Note: to defer to the specific config setting of each\r
-     * contained panel for this property, set this to undefined at the layout level.\r
-     */\r
-    animate : false,\r
+    * Adds elements to this composite.\r
+    * @param {String/Array} els A string CSS selector, an array of elements or an element\r
+    * @return {CompositeElement} this\r
+    */\r
+\r
     /**\r
-     * @cfg {Boolean} sequence\r
-     * <b>Experimental</b>. If animate is set to true, this will result in each animation running in sequence.\r
+     * Returns the Element object at the specified index\r
+     * @param {Number} index\r
+     * @return {Ext.Element}\r
      */\r
-    sequence : false,\r
+\r
     /**\r
-     * @cfg {Boolean} activeOnTop\r
-     * True to swap the position of each panel as it is expanded so that it becomes the first item in the container,\r
-     * false to keep the panels in the rendered order. <b>This is NOT compatible with "animate:true"</b> (defaults to false).\r
+     * Iterates each <code>element</code> in this <code>composite</code>\r
+     * calling the supplied function using {@link Ext#each}.\r
+     * @param {Function} fn The function to be called with each\r
+     * <code>element</code>. If the supplied function returns <tt>false</tt>,\r
+     * iteration stops. This function is called with the following arguments:\r
+     * <div class="mdetail-params"><ul>\r
+     * <li><code>element</code> : <i>Ext.Element</i><div class="sub-desc">The element at the current <code>index</code>\r
+     * in the <code>composite</code></div></li>\r
+     * <li><code>composite</code> : <i>Object</i> <div class="sub-desc">This composite.</div></li>\r
+     * <li><code>index</code> : <i>Number</i> <div class="sub-desc">The current index within the <code>composite</code> </div></li>\r
+     * </ul></div>\r
+     * @param {Object} scope (optional) The scope (<code><this</code> reference) in which the specified function is executed.\r
+     * Defaults to the <code>element</code> at the current <code>index</code>\r
+     * within the composite.\r
+     * @return {CompositeElement} this\r
      */\r
-    activeOnTop : false,\r
+});\r
 \r
-    renderItem : function(c){\r
-        if(this.animate === false){\r
-            c.animCollapse = false;\r
-        }\r
-        c.collapsible = true;\r
-        if(this.autoWidth){\r
-            c.autoWidth = true;\r
-        }\r
-        if(this.titleCollapse){\r
-            c.titleCollapse = true;\r
-        }\r
-        if(this.hideCollapseTool){\r
-            c.hideCollapseTool = true;\r
-        }\r
-        if(this.collapseFirst !== undefined){\r
-            c.collapseFirst = this.collapseFirst;\r
-        }\r
-        if(!this.activeItem && !c.collapsed){\r
-            this.activeItem = c;\r
-        }else if(this.activeItem && this.activeItem != c){\r
-            c.collapsed = true;\r
-        }\r
-        Ext.layout.AccordionLayout.superclass.renderItem.apply(this, arguments);\r
-        c.header.addClass('x-accordion-hd');\r
-        c.on('beforeexpand', this.beforeExpand, this);\r
-    },\r
+/**\r
+ * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
+ * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
+ * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
+ * @param {String/Array} selector The CSS selector or an array of elements\r
+ * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)\r
+ * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
+ * @return {CompositeElementLite/CompositeElement}\r
+ * @member Ext.Element\r
+ * @method select\r
+ */\r
+Ext.Element.select = function(selector, unique, root){\r
+    var els;\r
+    if(typeof selector == "string"){\r
+        els = Ext.Element.selectorFunction(selector, root);\r
+    }else if(selector.length !== undefined){\r
+        els = selector;\r
+    }else{\r
+        throw "Invalid selector";\r
+    }\r
 \r
-    // private\r
-    beforeExpand : function(p, anim){\r
-        var ai = this.activeItem;\r
-        if(ai){\r
-            if(this.sequence){\r
-                delete this.activeItem;\r
-                if (!ai.collapsed){\r
-                    ai.collapse({callback:function(){\r
-                        p.expand(anim || true);\r
-                    }, scope: this});\r
-                    return false;\r
-                }\r
-            }else{\r
-                ai.collapse(this.animate);\r
-            }\r
-        }\r
-        this.activeItem = p;\r
-        if(this.activeOnTop){\r
-            p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild);\r
-        }\r
-        this.layout();\r
-    },\r
+    return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els);\r
+};\r
 \r
-    // private\r
-    setItemSize : function(item, size){\r
-        if(this.fill && item){\r
-            var hh = 0;\r
-            this.container.items.each(function(p){\r
-                if(p != item){\r
-                    hh += p.header.getHeight();\r
-                }    \r
-            });\r
-            size.height -= hh;\r
-            item.setSize(size);\r
-        }\r
-    },\r
+/**\r
+ * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods\r
+ * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or\r
+ * {@link Ext.CompositeElementLite CompositeElementLite} object.\r
+ * @param {String/Array} selector The CSS selector or an array of elements\r
+ * @param {Boolean} unique (optional) true to create a unique Ext.Element for each element (defaults to a shared flyweight object)\r
+ * @param {HTMLElement/String} root (optional) The root element of the query or id of the root\r
+ * @return {CompositeElementLite/CompositeElement}\r
+ * @member Ext.Element\r
+ * @method select\r
+ */\r
+Ext.select = Ext.Element.select;(function(){\r
+    var BEFOREREQUEST = "beforerequest",\r
+        REQUESTCOMPLETE = "requestcomplete",\r
+        REQUESTEXCEPTION = "requestexception",\r
+        UNDEFINED = undefined,\r
+        LOAD = 'load',\r
+        POST = 'POST',\r
+        GET = 'GET',\r
+        WINDOW = window;\r
 \r
     /**\r
-     * Sets the active (expanded) item in the layout.\r
-     * @param {String/Number} item The string component id or numeric index of the item to activate\r
+     * @class Ext.data.Connection\r
+     * @extends Ext.util.Observable\r
+     * <p>The class encapsulates a connection to the page's originating domain, allowing requests to be made\r
+     * either to a configured URL, or to a URL specified at request time.</p>\r
+     * <p>Requests made by this class are asynchronous, and will return immediately. No data from\r
+     * the server will be available to the statement immediately following the {@link #request} call.\r
+     * To process returned data, use a\r
+     * <a href="#request-option-success" ext:member="request-option-success" ext:cls="Ext.data.Connection">success callback</a>\r
+     * in the request options object,\r
+     * or an {@link #requestcomplete event listener}.</p>\r
+     * <p><h3>File Uploads</h3><a href="#request-option-isUpload" ext:member="request-option-isUpload" ext:cls="Ext.data.Connection">File uploads</a> are not performed using normal "Ajax" techniques, that\r
+     * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard\r
+     * manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its\r
+     * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer\r
+     * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document\r
+     * but removed after the return data has been gathered.</p>\r
+     * <p>The server response is parsed by the browser to create the document for the IFRAME. If the\r
+     * server is using JSON to send the return object, then the\r
+     * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header\r
+     * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>\r
+     * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode\r
+     * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>\r
+     * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object\r
+     * is created containing a <tt>responseText</tt> property in order to conform to the\r
+     * requirements of event handlers and callbacks.</p>\r
+     * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>\r
+     * and some server technologies (notably JEE) may require some custom processing in order to\r
+     * retrieve parameter names and parameter values from the packet content.</p>\r
+     * @constructor\r
+     * @param {Object} config a configuration object.\r
      */\r
-    setActiveItem : function(item){\r
-        item = this.container.getComponent(item);\r
-        if(this.activeItem != item){\r
-            if(item.rendered && item.collapsed){\r
-                item.expand();\r
-            }else{\r
-                this.activeItem = item;\r
-            }\r
-        }\r
+    Ext.data.Connection = function(config){\r
+        Ext.apply(this, config);\r
+        this.addEvents(\r
+            /**\r
+             * @event beforerequest\r
+             * Fires before a network request is made to retrieve a data object.\r
+             * @param {Connection} conn This Connection object.\r
+             * @param {Object} options The options config object passed to the {@link #request} method.\r
+             */\r
+            BEFOREREQUEST,\r
+            /**\r
+             * @event requestcomplete\r
+             * Fires if the request was successfully completed.\r
+             * @param {Connection} conn This Connection object.\r
+             * @param {Object} response The XHR object containing the response data.\r
+             * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>\r
+             * for details.\r
+             * @param {Object} options The options config object passed to the {@link #request} method.\r
+             */\r
+            REQUESTCOMPLETE,\r
+            /**\r
+             * @event requestexception\r
+             * Fires if an error HTTP status was returned from the server.\r
+             * See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>\r
+             * for details of HTTP status codes.\r
+             * @param {Connection} conn This Connection object.\r
+             * @param {Object} response The XHR object containing the response data.\r
+             * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>\r
+             * for details.\r
+             * @param {Object} options The options config object passed to the {@link #request} method.\r
+             */\r
+            REQUESTEXCEPTION\r
+        );\r
+        Ext.data.Connection.superclass.constructor.call(this);\r
+    };\r
+\r
+    Ext.extend(Ext.data.Connection, Ext.util.Observable, {\r
+        /**\r
+         * @cfg {String} url (Optional) <p>The default URL to be used for requests to the server. Defaults to undefined.</p>\r
+         * <p>The <code>url</code> config may be a function which <i>returns</i> the URL to use for the Ajax request. The scope\r
+         * (<code><b>this</b></code> reference) of the function is the <code>scope</code> option passed to the {@link #request} method.</p>\r
+         */\r
+        /**\r
+         * @cfg {Object} extraParams (Optional) An object containing properties which are used as\r
+         * extra parameters to each request made by this object. (defaults to undefined)\r
+         */\r
+        /**\r
+         * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added\r
+         *  to each request made by this object. (defaults to undefined)\r
+         */\r
+        /**\r
+         * @cfg {String} method (Optional) The default HTTP method to be used for requests.\r
+         * (defaults to undefined; if not set, but {@link #request} params are present, POST will be used;\r
+         * otherwise, GET will be used.)\r
+         */\r
+        /**\r
+         * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)\r
+         */\r
+        timeout : 30000,\r
+        /**\r
+         * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false)\r
+         * @type Boolean\r
+         */\r
+        autoAbort:false,\r
+\r
+        /**\r
+         * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)\r
+         * @type Boolean\r
+         */\r
+        disableCaching: true,\r
+\r
+        /**\r
+         * @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching\r
+         * through a cache buster. Defaults to '_dc'\r
+         * @type String\r
+         */\r
+        disableCachingParam: '_dc',\r
+\r
+        /**\r
+         * <p>Sends an HTTP request to a remote server.</p>\r
+         * <p><b>Important:</b> Ajax server requests are asynchronous, and this call will\r
+         * return before the response has been received. Process any returned data\r
+         * in a callback function.</p>\r
+         * <pre><code>\r
+Ext.Ajax.request({\r
+   url: 'ajax_demo/sample.json',\r
+   success: function(response, opts) {\r
+      var obj = Ext.decode(response.responseText);\r
+      console.dir(obj);\r
+   },\r
+   failure: function(response, opts) {\r
+      console.log('server-side failure with status code ' + response.status);\r
+   }\r
+});\r
+         * </code></pre>\r
+         * <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p>\r
+         * @param {Object} options An object which may contain the following properties:<ul>\r
+         * <li><b>url</b> : String/Function (Optional)<div class="sub-desc">The URL to\r
+         * which to send the request, or a function to call which returns a URL string. The scope of the\r
+         * function is specified by the <tt>scope</tt> option. Defaults to the configured\r
+         * <tt>{@link #url}</tt>.</div></li>\r
+         * <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">\r
+         * An object containing properties which are used as parameters to the\r
+         * request, a url encoded string or a function to call to get either. The scope of the function\r
+         * is specified by the <tt>scope</tt> option.</div></li>\r
+         * <li><b>method</b> : String (Optional)<div class="sub-desc">The HTTP method to use\r
+         * for the request. Defaults to the configured method, or if no method was configured,\r
+         * "GET" if no parameters are being sent, and "POST" if parameters are being sent.  Note that\r
+         * the method name is case-sensitive and should be all caps.</div></li>\r
+         * <li><b>callback</b> : Function (Optional)<div class="sub-desc">The\r
+         * function to be called upon receipt of the HTTP response. The callback is\r
+         * called regardless of success or failure and is passed the following\r
+         * parameters:<ul>\r
+         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
+         * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>\r
+         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.\r
+         * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about\r
+         * accessing elements of the response.</div></li>\r
+         * </ul></div></li>\r
+         * <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function\r
+         * to be called upon success of the request. The callback is passed the following\r
+         * parameters:<ul>\r
+         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>\r
+         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
+         * </ul></div></li>\r
+         * <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function\r
+         * to be called upon failure of the request. The callback is passed the\r
+         * following parameters:<ul>\r
+         * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>\r
+         * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
+         * </ul></div></li>\r
+         * <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in\r
+         * which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were\r
+         * specified as functions from which to draw values, then this also serves as the scope for those function calls.\r
+         * Defaults to the browser window.</div></li>\r
+         * <li><b>timeout</b> : Number (Optional)<div class="sub-desc">The timeout in milliseconds to be used for this request. Defaults to 30 seconds.</div></li>\r
+         * <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt>&lt;form&gt;</tt>\r
+         * Element or the id of the <tt>&lt;form&gt;</tt> to pull parameters from.</div></li>\r
+         * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used\r
+         * with the <tt>form</tt> option</b>.\r
+         * <p>True if the form object is a file upload (will be set automatically if the form was\r
+         * configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>\r
+         * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>\r
+         * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the\r
+         * DOM <tt>&lt;form></tt> element temporarily modified to have its\r
+         * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer\r
+         * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document\r
+         * but removed after the return data has been gathered.</p>\r
+         * <p>The server response is parsed by the browser to create the document for the IFRAME. If the\r
+         * server is using JSON to send the return object, then the\r
+         * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header\r
+         * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>\r
+         * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object\r
+         * is created containing a <tt>responseText</tt> property in order to conform to the\r
+         * requirements of event handlers and callbacks.</p>\r
+         * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>\r
+         * and some server technologies (notably JEE) may require some custom processing in order to\r
+         * retrieve parameter names and parameter values from the packet content.</p>\r
+         * </div></li>\r
+         * <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request\r
+         * headers to set for the request.</div></li>\r
+         * <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document\r
+         * to use for the post. Note: This will be used instead of params for the post\r
+         * data. Any params will be appended to the URL.</div></li>\r
+         * <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON\r
+         * data to use as the post. Note: This will be used instead of params for the post\r
+         * data. Any params will be appended to the URL.</div></li>\r
+         * <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True\r
+         * to add a unique cache-buster param to GET requests.</div></li>\r
+         * </ul></p>\r
+         * <p>The options object may also contain any other property which might be needed to perform\r
+         * postprocessing in a callback because it is passed to callback functions.</p>\r
+         * @return {Number} transactionId The id of the server transaction. This may be used\r
+         * to cancel the request.\r
+         */\r
+        request : function(o){\r
+            var me = this;\r
+            if(me.fireEvent(BEFOREREQUEST, me, o)){\r
+                if (o.el) {\r
+                    if(!Ext.isEmpty(o.indicatorText)){\r
+                        me.indicatorText = '<div class="loading-indicator">'+o.indicatorText+"</div>";\r
+                    }\r
+                    if(me.indicatorText) {\r
+                        Ext.getDom(o.el).innerHTML = me.indicatorText;\r
+                    }\r
+                    o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) {\r
+                        Ext.getDom(o.el).innerHTML = response.responseText;\r
+                    });\r
+                }\r
+\r
+                var p = o.params,\r
+                    url = o.url || me.url,\r
+                    method,\r
+                    cb = {success: me.handleResponse,\r
+                          failure: me.handleFailure,\r
+                          scope: me,\r
+                          argument: {options: o},\r
+                          timeout : o.timeout || me.timeout\r
+                    },\r
+                    form,\r
+                    serForm;\r
 \r
-    }\r
-});\r
-Ext.Container.LAYOUTS.accordion = Ext.layout.AccordionLayout;\r
 \r
-//backwards compat\r
-Ext.layout.Accordion = Ext.layout.AccordionLayout;/**\r
- * @class Ext.layout.TableLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>This layout allows you to easily render content into an HTML table.  The total number of columns can be\r
- * specified, and rowspan and colspan can be used to create complex layouts within the table.\r
- * This class is intended to be extended or created via the layout:'table' {@link Ext.Container#layout} config,\r
- * and should generally not need to be created directly via the new keyword.</p>\r
- * <p>Note that when creating a layout via config, the layout-specific config properties must be passed in via\r
- * the {@link Ext.Container#layoutConfig} object which will then be applied internally to the layout.  In the\r
- * case of TableLayout, the only valid layout config property is {@link #columns}.  However, the items added to a\r
- * TableLayout can supply the following table-specific config properties:</p>\r
- * <ul>\r
- * <li><b>rowspan</b> Applied to the table cell containing the item.</li>\r
- * <li><b>colspan</b> Applied to the table cell containing the item.</li>\r
- * <li><b>cellId</b> An id applied to the table cell containing the item.</li>\r
- * <li><b>cellCls</b> A CSS class name added to the table cell containing the item.</li>\r
- * </ul>\r
- * <p>The basic concept of building up a TableLayout is conceptually very similar to building up a standard\r
- * HTML table.  You simply add each panel (or "cell") that you want to include along with any span attributes\r
- * specified as the special config properties of rowspan and colspan which work exactly like their HTML counterparts.\r
- * Rather than explicitly creating and nesting rows and columns as you would in HTML, you simply specify the\r
- * total column count in the layoutConfig and start adding panels in their natural order from left to right,\r
- * top to bottom.  The layout will automatically figure out, based on the column count, rowspans and colspans,\r
- * how to position each panel within the table.  Just like with HTML tables, your rowspans and colspans must add\r
- * up correctly in your overall layout or you'll end up with missing and/or extra cells!  Example usage:</p>\r
- * <pre><code>\r
-// This code will generate a layout table that is 3 columns by 2 rows\r
-// with some spanning included.  The basic layout will be:\r
-// +--------+-----------------+\r
-// |   A    |   B             |\r
-// |        |--------+--------|\r
-// |        |   C    |   D    |\r
-// +--------+--------+--------+\r
-var table = new Ext.Panel({\r
-    title: 'Table Layout',\r
-    layout:'table',\r
-    defaults: {\r
-        // applied to each contained panel\r
-        bodyStyle:'padding:20px'\r
-    },\r
-    layoutConfig: {\r
-        // The total column count must be specified here\r
-        columns: 3\r
-    },\r
-    items: [{\r
-        html: '&lt;p&gt;Cell A content&lt;/p&gt;',\r
-        rowspan: 2\r
-    },{\r
-        html: '&lt;p&gt;Cell B content&lt;/p&gt;',\r
-        colspan: 2\r
-    },{\r
-        html: '&lt;p&gt;Cell C content&lt;/p&gt;',\r
-        cellCls: 'highlight'\r
-    },{\r
-        html: '&lt;p&gt;Cell D content&lt;/p&gt;'\r
-    }]\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    /**\r
-     * @cfg {Number} columns\r
-     * The total number of columns to create in the table for this layout.  If not specified, all Components added to\r
-     * this layout will be rendered into a single row using one column per Component.\r
-     */\r
+                if (Ext.isFunction(p)) {\r
+                    p = p.call(o.scope||WINDOW, o);\r
+                }\r
 \r
-    // private\r
-    monitorResize:false,\r
+                p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p);\r
 \r
-    /**\r
-     * @cfg {Object} tableAttrs\r
-     * <p>An object containing properties which are added to the {@link Ext.DomHelper DomHelper} specification\r
-     * used to create the layout's <tt>&lt;table&gt;</tt> element. Example:</p><pre><code>\r
-{\r
-    xtype: 'panel',\r
-    layout: 'table',\r
-    layoutConfig: {\r
-        tableAttrs: {\r
-               style: {\r
-                       width: '100%'\r
-               }\r
-        },\r
-        columns: 3\r
-    }\r
-}</code></pre>\r
-     */\r
-    tableAttrs:null,\r
-    \r
-    // private\r
-    setContainer : function(ct){\r
-        Ext.layout.TableLayout.superclass.setContainer.call(this, ct);\r
+                if (Ext.isFunction(url)) {\r
+                    url = url.call(o.scope || WINDOW, o);\r
+                }\r
 \r
-        this.currentRow = 0;\r
-        this.currentColumn = 0;\r
-        this.cells = [];\r
-    },\r
+                if((form = Ext.getDom(o.form))){\r
+                    url = url || form.action;\r
+                     if(o.isUpload || /multipart\/form-data/i.test(form.getAttribute("enctype"))) {\r
+                         return me.doFormUpload.call(me, o, p, url);\r
+                     }\r
+                    serForm = Ext.lib.Ajax.serializeForm(form);\r
+                    p = p ? (p + '&' + serForm) : serForm;\r
+                }\r
 \r
-    // private\r
-    onLayout : function(ct, target){\r
-        var cs = ct.items.items, len = cs.length, c, i;\r
+                method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET);\r
 \r
-        if(!this.table){\r
-            target.addClass('x-table-layout-ct');\r
+                if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){\r
+                    var dcp = o.disableCachingParam || me.disableCachingParam;\r
+                    url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));\r
+                }\r
 \r
-            this.table = target.createChild(\r
-                Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true);\r
-        }\r
-        this.renderAll(ct, target);\r
-    },\r
+                o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {});\r
 \r
-    // private\r
-    getRow : function(index){\r
-        var row = this.table.tBodies[0].childNodes[index];\r
-        if(!row){\r
-            row = document.createElement('tr');\r
-            this.table.tBodies[0].appendChild(row);\r
-        }\r
-        return row;\r
-    },\r
+                if(o.autoAbort === true || me.autoAbort) {\r
+                    me.abort();\r
+                }\r
 \r
-    // private\r
-    getNextCell : function(c){\r
-        var cell = this.getNextNonSpan(this.currentColumn, this.currentRow);\r
-        var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1];\r
-        for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){\r
-            if(!this.cells[rowIndex]){\r
-                this.cells[rowIndex] = [];\r
-            }\r
-            for(var colIndex = curCol; colIndex < curCol + (c.colspan || 1); colIndex++){\r
-                this.cells[rowIndex][colIndex] = true;\r
-            }\r
-        }\r
-        var td = document.createElement('td');\r
-        if(c.cellId){\r
-            td.id = c.cellId;\r
-        }\r
-        var cls = 'x-table-layout-cell';\r
-        if(c.cellCls){\r
-            cls += ' ' + c.cellCls;\r
-        }\r
-        td.className = cls;\r
-        if(c.colspan){\r
-            td.colSpan = c.colspan;\r
-        }\r
-        if(c.rowspan){\r
-            td.rowSpan = c.rowspan;\r
-        }\r
-        this.getRow(curRow).appendChild(td);\r
-        return td;\r
-    },\r
-    \r
-    // private\r
-    getNextNonSpan: function(colIndex, rowIndex){\r
-        var cols = this.columns;\r
-        while((cols && colIndex >= cols) || (this.cells[rowIndex] && this.cells[rowIndex][colIndex])) {\r
-            if(cols && colIndex >= cols){\r
-                rowIndex++;\r
-                colIndex = 0;\r
+                if((method == GET || o.xmlData || o.jsonData) && p){\r
+                    url = Ext.urlAppend(url, p);\r
+                    p = '';\r
+                }\r
+                return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o));\r
             }else{\r
-                colIndex++;\r
-            }\r
-        }\r
-        return [colIndex, rowIndex];\r
-    },\r
-\r
-    // private\r
-    renderItem : function(c, position, target){\r
-        if(c && !c.rendered){\r
-            c.render(this.getNextCell(c));\r
-            if(this.extraCls){\r
-                var t = c.getPositionEl ? c.getPositionEl() : c;\r
-                t.addClass(this.extraCls);\r
+                return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : null;\r
             }\r
-        }\r
-    },\r
-\r
-    // private\r
-    isValidParent : function(c, target){\r
-        return true;\r
-    }\r
-\r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-\r
-Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;/**\r
- * @class Ext.layout.AbsoluteLayout\r
- * @extends Ext.layout.AnchorLayout\r
- * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the\r
- * ability for x/y positioning using the standard x and y component config options.</p>\r
- * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>\r
- * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>\r
- * <p>Example usage:</p>\r
- * <pre><code>\r
-var form = new Ext.form.FormPanel({\r
-    title: 'Absolute Layout',\r
-    layout:'absolute',\r
-    layoutConfig: {\r
-        // layout-specific configs go here\r
-        extraCls: 'x-abs-layout-item',\r
-    },\r
-    baseCls: 'x-plain',\r
-    url:'save-form.php',\r
-    defaultType: 'textfield',\r
-    items: [{\r
-        x: 0,\r
-        y: 5,\r
-        xtype:'label',\r
-        text: 'Send To:'\r
-    },{\r
-        x: 60,\r
-        y: 0,\r
-        name: 'to',\r
-        anchor:'100%'  // anchor width by percentage\r
-    },{\r
-        x: 0,\r
-        y: 35,\r
-        xtype:'label',\r
-        text: 'Subject:'\r
-    },{\r
-        x: 60,\r
-        y: 30,\r
-        name: 'subject',\r
-        anchor: '100%'  // anchor width by percentage\r
-    },{\r
-        x:0,\r
-        y: 60,\r
-        xtype: 'textarea',\r
-        name: 'msg',\r
-        anchor: '100% 100%'  // anchor width and height\r
-    }]\r
-});\r
-</code></pre>\r
- */\r
-Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {\r
-\r
-    extraCls: 'x-abs-layout-item',\r
-\r
-    onLayout : function(ct, target){\r
-        target.position();\r
-        this.paddingLeft = target.getPadding('l');\r
-        this.paddingTop = target.getPadding('t');\r
+        },\r
 \r
-        Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);\r
-    },\r
+        /**\r
+         * Determine whether this object has a request outstanding.\r
+         * @param {Number} transactionId (Optional) defaults to the last transaction\r
+         * @return {Boolean} True if there is an outstanding request.\r
+         */\r
+        isLoading : function(transId){\r
+            return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId;\r
+        },\r
 \r
-    // private\r
-    adjustWidthAnchor : function(value, comp){\r
-        return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value;\r
-    },\r
+        /**\r
+         * Aborts any outstanding request.\r
+         * @param {Number} transactionId (Optional) defaults to the last transaction\r
+         */\r
+        abort : function(transId){\r
+            if(transId || this.isLoading()){\r
+                Ext.lib.Ajax.abort(transId || this.transId);\r
+            }\r
+        },\r
 \r
-    // private\r
-    adjustHeightAnchor : function(value, comp){\r
-        return  value ? value - comp.getPosition(true)[1] + this.paddingTop : value;\r
-    }\r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;
-/**\r
- * @class Ext.layout.BoxLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly.</p>\r
- */\r
-Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    /**\r
-     * @cfg {Object} defaultMargins\r
-     * <p>If the individual contained items do not have a <tt>margins</tt>\r
-     * property specified, the default margins from this property will be\r
-     * applied to each item.</p>\r
-     * <br><p>This property may be specified as an object containing margins\r
-     * to apply in the format:</p><pre><code>\r
-{\r
-    top: (top margin),\r
-    right: (right margin),\r
-    bottom: (bottom margin),\r
-    left: (left margin)\r
-}</code></pre>\r
-     * <p>This property may also be specified as a string containing\r
-     * space-separated, numeric margin values. The order of the sides associated\r
-     * with each value matches the way CSS processes margin values:</p>\r
-     * <div class="mdetail-params"><ul>\r
-     * <li>If there is only one value, it applies to all sides.</li>\r
-     * <li>If there are two values, the top and bottom borders are set to the\r
-     * first value and the right and left are set to the second.</li>\r
-     * <li>If there are three values, the top is set to the first value, the left\r
-     * and right are set to the second, and the bottom is set to the third.</li>\r
-     * <li>If there are four values, they apply to the top, right, bottom, and\r
-     * left, respectively.</li>\r
-     * </ul></div>\r
-     * <p>Defaults to:</p><pre><code>\r
-     * {top:0, right:0, bottom:0, left:0}\r
-     * </code></pre>\r
-     */\r
-    defaultMargins : {left:0,top:0,right:0,bottom:0},\r
-    /**\r
-     * @cfg {String} padding\r
-     * Defaults to <tt>'0'</tt>. Sets the padding to be applied to all child items managed by this\r
-     * container's layout. \r
-     */\r
-    padding : '0',\r
-    // documented in subclasses\r
-    pack : 'start',\r
+        // private\r
+        handleResponse : function(response){\r
+            this.transId = false;\r
+            var options = response.argument.options;\r
+            response.argument = options ? options.argument : null;\r
+            this.fireEvent(REQUESTCOMPLETE, this, response, options);\r
+            if(options.success){\r
+                options.success.call(options.scope, response, options);\r
+            }\r
+            if(options.callback){\r
+                options.callback.call(options.scope, options, true, response);\r
+            }\r
+        },\r
 \r
-    // private\r
-    monitorResize : true,\r
-    scrollOffset : 0,\r
-    extraCls : 'x-box-item',\r
-    ctCls : 'x-box-layout-ct',\r
-    innerCls : 'x-box-inner',\r
+        // private\r
+        handleFailure : function(response, e){\r
+            this.transId = false;\r
+            var options = response.argument.options;\r
+            response.argument = options ? options.argument : null;\r
+            this.fireEvent(REQUESTEXCEPTION, this, response, options, e);\r
+            if(options.failure){\r
+                options.failure.call(options.scope, response, options);\r
+            }\r
+            if(options.callback){\r
+                options.callback.call(options.scope, options, false, response);\r
+            }\r
+        },\r
 \r
-    // private\r
-    isValidParent : function(c, target){\r
-        return c.getEl().dom.parentNode == this.innerCt.dom;\r
-    },\r
+        // private\r
+        doFormUpload : function(o, ps, url){\r
+            var id = Ext.id(),\r
+                doc = document,\r
+                frame = doc.createElement('iframe'),\r
+                form = Ext.getDom(o.form),\r
+                hiddens = [],\r
+                hd,\r
+                encoding = 'multipart/form-data',\r
+                buf = {\r
+                    target: form.target,\r
+                    method: form.method,\r
+                    encoding: form.encoding,\r
+                    enctype: form.enctype,\r
+                    action: form.action\r
+                };\r
 \r
-    // private\r
-    onLayout : function(ct, target){\r
-        var cs = ct.items.items, len = cs.length, c, i, last = len-1, cm;\r
+            Ext.fly(frame).set({\r
+                id: id,\r
+                name: id,\r
+                cls: 'x-hidden'\r
 \r
-        if(!this.innerCt){\r
-            target.addClass(this.ctCls);\r
+            });\r
 \r
-            // the innerCt prevents wrapping and shuffling while\r
-            // the container is resizing\r
-            this.innerCt = target.createChild({cls:this.innerCls});\r
-            this.padding = this.parseMargins(this.padding); \r
-        }\r
-        this.renderAll(ct, this.innerCt);\r
-    },\r
+            doc.body.appendChild(frame);\r
 \r
-    // private\r
-    renderItem : function(c){\r
-        if(typeof c.margins == 'string'){\r
-            c.margins = this.parseMargins(c.margins);\r
-        }else if(!c.margins){\r
-            c.margins = this.defaultMargins;\r
-        }\r
-        Ext.layout.BoxLayout.superclass.renderItem.apply(this, arguments);\r
-    },\r
+            //Reset the Frame to neutral domain\r
+            Ext.fly(frame).set({\r
+               src : Ext.SSL_SECURE_URL\r
+            });\r
 \r
-    getTargetSize : function(target){
-        return (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getStyleSize() : target.getViewSize();\r
-    },\r
-    \r
-    getItems: function(ct){\r
-        var items = [];\r
-        ct.items.each(function(c){\r
-            if(c.isVisible()){\r
-                items.push(c);\r
+            // This is required so that IE doesn't pop the response up in a new window.\r
+            if(Ext.isIE){\r
+               document.frames[id].name = id;\r
             }\r
-        });\r
-        return items;\r
-    }\r
 \r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
 \r
-/**\r
- * @class Ext.layout.VBoxLayout\r
- * @extends Ext.layout.BoxLayout\r
- * A layout that arranges items vertically\r
- */\r
-Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {\r
-    /**\r
-     * @cfg {String} align\r
-     * Controls how the child items of the container are aligned. Acceptable configuration values for this\r
-     * property are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally\r
-     * at the <b>left</b> side of the container</div></li>\r
-     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the\r
-     * <b>mid-width</b> of the container</div></li>\r
-     * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill\r
-     * the width of the container</div></li>\r
-     * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to\r
-     * the size of the largest item.</div></li>\r
-     * </ul></div>\r
-     */\r
-    align : 'left', // left, center, stretch, strechmax\r
-    /**\r
-     * @cfg {String} pack\r
-     * Controls how the child items of the container are packed together. Acceptable configuration values\r
-     * for this property are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at\r
-     * <b>top</b> side of container</div></li>\r
-     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at\r
-     * <b>mid-height</b> of container</div></li>\r
-     * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>bottom</b>\r
-     * side of container</div></li>\r
-     * </ul></div>\r
-     */\r
-    /**\r
-     * @cfg {Number} flex\r
-     * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed\r
-     * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>vertically</b>\r
-     * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with\r
-     * a <tt>flex</tt> value specified.  Any child items that have either a <tt>flex = 0</tt> or\r
-     * <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).\r
-     */\r
+            Ext.fly(form).set({\r
+                target: id,\r
+                method: POST,\r
+                enctype: encoding,\r
+                encoding: encoding,\r
+                action: url || buf.action\r
+            });\r
 \r
-    // private\r
-    onLayout : function(ct, target){\r
-        Ext.layout.VBoxLayout.superclass.onLayout.call(this, ct, target);\r
-                    \r
-        \r
-        var cs = this.getItems(ct), cm, ch, margin,\r
-            size = this.getTargetSize(target),\r
-            w = size.width - target.getPadding('lr') - this.scrollOffset,\r
-            h = size.height - target.getPadding('tb'),\r
-            l = this.padding.left, t = this.padding.top,\r
-            isStart = this.pack == 'start',\r
-            isRestore = ['stretch', 'stretchmax'].indexOf(this.align) == -1,\r
-            stretchWidth = w - (this.padding.left + this.padding.right),\r
-            extraHeight = 0,\r
-            maxWidth = 0,\r
-            totalFlex = 0,\r
-            flexHeight = 0,\r
-            usedHeight = 0;\r
-            \r
-        Ext.each(cs, function(c){\r
-            cm = c.margins;\r
-            totalFlex += c.flex || 0;\r
-            ch = c.getHeight();\r
-            margin = cm.top + cm.bottom;\r
-            extraHeight += ch + margin;\r
-            flexHeight += margin + (c.flex ? 0 : ch);\r
-            maxWidth = Math.max(maxWidth, c.getWidth() + cm.left + cm.right);\r
-        });\r
-        extraHeight = h - extraHeight - this.padding.top - this.padding.bottom;\r
-        \r
-        var innerCtWidth = maxWidth + this.padding.left + this.padding.right;\r
-        switch(this.align){\r
-            case 'stretch':\r
-                this.innerCt.setSize(w, h);\r
-                break;\r
-            case 'stretchmax':\r
-            case 'left':\r
-                this.innerCt.setSize(innerCtWidth, h);\r
-                break;\r
-            case 'center':\r
-                this.innerCt.setSize(w = Math.max(w, innerCtWidth), h);\r
-                break;\r
-        }\r
+            // add dynamic params\r
+            Ext.iterate(Ext.urlDecode(ps, false), function(k, v){\r
+                hd = doc.createElement('input');\r
+                Ext.fly(hd).set({\r
+                    type: 'hidden',\r
+                    value: v,\r
+                    name: k\r
+                });\r
+                form.appendChild(hd);\r
+                hiddens.push(hd);\r
+            });\r
 \r
-        var availHeight = Math.max(0, h - this.padding.top - this.padding.bottom - flexHeight),\r
-            leftOver = availHeight,\r
-            heights = [],\r
-            restore = [],\r
-            idx = 0,\r
-            availableWidth = Math.max(0, w - this.padding.left - this.padding.right);\r
-            \r
+            function cb(){\r
+                var me = this,\r
+                    // bogus response object\r
+                    r = {responseText : '',\r
+                         responseXML : null,\r
+                         argument : o.argument},\r
+                    doc,\r
+                    firstChild;\r
 \r
-        Ext.each(cs, function(c){\r
-            if(isStart && c.flex){\r
-                ch = Math.floor(availHeight * (c.flex / totalFlex));\r
-                leftOver -= ch;\r
-                heights.push(ch);\r
-            }\r
-        }); \r
-        \r
-        if(this.pack == 'center'){\r
-            t += extraHeight ? extraHeight / 2 : 0;\r
-        }else if(this.pack == 'end'){\r
-            t += extraHeight;\r
-        }\r
-        Ext.each(cs, function(c){\r
-            cm = c.margins;\r
-            t += cm.top;\r
-            c.setPosition(l + cm.left, t);\r
-            if(isStart && c.flex){\r
-                ch = Math.max(0, heights[idx++] + (leftOver-- > 0 ? 1 : 0));\r
-                if(isRestore){\r
-                    restore.push(c.getWidth());\r
-                }\r
-                c.setSize(availableWidth, ch);\r
-            }else{\r
-                ch = c.getHeight();\r
-            }\r
-            t += ch + cm.bottom;\r
-        });\r
-        \r
-        idx = 0;\r
-        Ext.each(cs, function(c){\r
-            cm = c.margins;\r
-            if(this.align == 'stretch'){\r
-                c.setWidth((stretchWidth - (cm.left + cm.right)).constrain(\r
-                    c.minWidth || 0, c.maxWidth || 1000000));\r
-            }else if(this.align == 'stretchmax'){\r
-                c.setWidth((maxWidth - (cm.left + cm.right)).constrain(\r
-                    c.minWidth || 0, c.maxWidth || 1000000));\r
-            }else{\r
-                if(this.align == 'center'){\r
-                    var diff = availableWidth - (c.getWidth() + cm.left + cm.right);\r
-                    if(diff > 0){\r
-                        c.setPosition(l + cm.left + (diff/2), c.y);\r
+                try{\r
+                    doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;\r
+                    if(doc){\r
+                        if(doc.body){\r
+                            if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea\r
+                                r.responseText = firstChild.value;\r
+                            }else{\r
+                                r.responseText = doc.body.innerHTML;\r
+                            }\r
+                        }\r
+                        //in IE the document may still have a body even if returns XML.\r
+                        r.responseXML = doc.XMLDocument || doc;\r
                     }\r
                 }\r
-                if(isStart && c.flex){\r
-                    c.setWidth(restore[idx++]);\r
-                }\r
-            }\r
-        }, this);\r
-    }\r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-\r
-Ext.Container.LAYOUTS.vbox = Ext.layout.VBoxLayout;\r
-\r
-/**\r
- * @class Ext.layout.HBoxLayout\r
- * @extends Ext.layout.BoxLayout\r
- * A layout that arranges items horizontally\r
- */\r
-Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {\r
-    /**\r
-     * @cfg {String} align\r
-     * Controls how the child items of the container are aligned. Acceptable configuration values for this\r
-     * property are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>top</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned vertically\r
-     * at the <b>left</b> side of the container</div></li>\r
-     * <li><b><tt>middle</tt></b> : <div class="sub-desc">child items are aligned vertically at the\r
-     * <b>mid-height</b> of the container</div></li>\r
-     * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched vertically to fill\r
-     * the height of the container</div></li>\r
-     * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched vertically to\r
-     * the size of the largest item.</div></li>\r
-     */\r
-    align : 'top', // top, middle, stretch, strechmax\r
-    /**\r
-     * @cfg {String} pack\r
-     * Controls how the child items of the container are packed together. Acceptable configuration values\r
-     * for this property are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at\r
-     * <b>left</b> side of container</div></li>\r
-     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at\r
-     * <b>mid-width</b> of container</div></li>\r
-     * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>right</b>\r
-     * side of container</div></li>\r
-     * </ul></div>\r
-     */\r
-    /**\r
-     * @cfg {Number} flex\r
-     * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed\r
-     * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>horizontally</b>\r
-     * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with\r
-     * a <tt>flex</tt> value specified.  Any child items that have either a <tt>flex = 0</tt> or\r
-     * <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).\r
-     */\r
+                catch(e) {}\r
 \r
-    // private\r
-    onLayout : function(ct, target){\r
-        Ext.layout.HBoxLayout.superclass.onLayout.call(this, ct, target);\r
-        \r
-        var cs = this.getItems(ct), cm, cw, margin,\r
-            size = this.getTargetSize(target),\r
-            w = size.width - target.getPadding('lr') - this.scrollOffset,\r
-            h = size.height - target.getPadding('tb'),\r
-            l = this.padding.left, t = this.padding.top,\r
-            isStart = this.pack == 'start',\r
-            isRestore = ['stretch', 'stretchmax'].indexOf(this.align) == -1,\r
-            stretchHeight = h - (this.padding.top + this.padding.bottom),\r
-            extraWidth = 0,\r
-            maxHeight = 0,\r
-            totalFlex = 0,\r
-            flexWidth = 0,\r
-            usedWidth = 0;\r
-        \r
-        Ext.each(cs, function(c){\r
-            cm = c.margins;\r
-            totalFlex += c.flex || 0;\r
-            cw = c.getWidth();\r
-            margin = cm.left + cm.right;\r
-            extraWidth += cw + margin;\r
-            flexWidth += margin + (c.flex ? 0 : cw);\r
-            maxHeight = Math.max(maxHeight, c.getHeight() + cm.top + cm.bottom);\r
-        });\r
-        extraWidth = w - extraWidth - this.padding.left - this.padding.right;\r
-        \r
-        var innerCtHeight = maxHeight + this.padding.top + this.padding.bottom;\r
-        switch(this.align){\r
-            case 'stretch':\r
-                this.innerCt.setSize(w, h);\r
-                break;\r
-            case 'stretchmax':\r
-            case 'top':\r
-                this.innerCt.setSize(w, innerCtHeight);\r
-                break;\r
-            case 'middle':\r
-                this.innerCt.setSize(w, h = Math.max(h, innerCtHeight));\r
-                break;\r
-        }\r
-        \r
+                Ext.EventManager.removeListener(frame, LOAD, cb, me);\r
 \r
-        var availWidth = Math.max(0, w - this.padding.left - this.padding.right - flexWidth),\r
-            leftOver = availWidth,\r
-            widths = [],\r
-            restore = [],\r
-            idx = 0,\r
-            availableHeight = Math.max(0, h - this.padding.top - this.padding.bottom);\r
-            \r
+                me.fireEvent(REQUESTCOMPLETE, me, r, o);\r
 \r
-        Ext.each(cs, function(c){\r
-            if(isStart && c.flex){\r
-                cw = Math.floor(availWidth * (c.flex / totalFlex));\r
-                leftOver -= cw;\r
-                widths.push(cw);\r
-            }\r
-        }); \r
-        \r
-        if(this.pack == 'center'){\r
-            l += extraWidth ? extraWidth / 2 : 0;\r
-        }else if(this.pack == 'end'){\r
-            l += extraWidth;\r
-        }\r
-        Ext.each(cs, function(c){\r
-            cm = c.margins;\r
-            l += cm.left;\r
-            c.setPosition(l, t + cm.top);\r
-            if(isStart && c.flex){\r
-                cw = Math.max(0, widths[idx++] + (leftOver-- > 0 ? 1 : 0));\r
-                if(isRestore){\r
-                    restore.push(c.getHeight());\r
-                }\r
-                c.setSize(cw, availableHeight);\r
-            }else{\r
-                cw = c.getWidth();\r
-            }\r
-            l += cw + cm.right;\r
-        });\r
-        \r
-        idx = 0;\r
-        Ext.each(cs, function(c){\r
-            var cm = c.margins;\r
-            if(this.align == 'stretch'){\r
-                c.setHeight((stretchHeight - (cm.top + cm.bottom)).constrain(\r
-                    c.minHeight || 0, c.maxHeight || 1000000));\r
-            }else if(this.align == 'stretchmax'){\r
-                c.setHeight((maxHeight - (cm.top + cm.bottom)).constrain(\r
-                    c.minHeight || 0, c.maxHeight || 1000000));\r
-            }else{\r
-                if(this.align == 'middle'){\r
-                    var diff = availableHeight - (c.getHeight() + cm.top + cm.bottom);\r
-                    if(diff > 0){\r
-                        c.setPosition(c.x, t + cm.top + (diff/2));\r
+                function runCallback(fn, scope, args){\r
+                    if(Ext.isFunction(fn)){\r
+                        fn.apply(scope, args);\r
                     }\r
                 }\r
-                if(isStart && c.flex){\r
-                    c.setHeight(restore[idx++]);\r
+\r
+                runCallback(o.success, o.scope, [r, o]);\r
+                runCallback(o.callback, o.scope, [o, true, r]);\r
+\r
+                if(!me.debugUploads){\r
+                    setTimeout(function(){Ext.removeNode(frame);}, 100);\r
                 }\r
             }\r
-        }, this);\r
-    }\r
 \r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
+            Ext.EventManager.on(frame, LOAD, cb, this);\r
+            form.submit();\r
 \r
-Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout;
-/**\r
- * @class Ext.Viewport\r
- * @extends Ext.Container\r
- * <p>A specialized container representing the viewable application area (the browser viewport).</p>\r
- * <p>The Viewport renders itself to the document body, and automatically sizes itself to the size of\r
- * the browser viewport and manages window resizing. There may only be one Viewport created\r
- * in a page. Inner layouts are available by virtue of the fact that all {@link Ext.Panel Panel}s\r
- * added to the Viewport, either through its {@link #items}, or through the items, or the {@link #add}\r
- * method of any of its child Panels may themselves have a layout.</p>\r
- * <p>The Viewport does not provide scrolling, so child Panels within the Viewport should provide\r
- * for scrolling if needed using the {@link #autoScroll} config.</p>\r
- * <p>An example showing a classic application border layout:</p><pre><code>\r
-new Ext.Viewport({\r
-    layout: 'border',\r
-    items: [{\r
-        region: 'north',\r
-        html: '&lt;h1 class="x-panel-header">Page Title&lt;/h1>',\r
-        autoHeight: true,\r
-        border: false,\r
-        margins: '0 0 5 0'\r
-    }, {\r
-        region: 'west',\r
-        collapsible: true,\r
-        title: 'Navigation',\r
-        width: 200\r
-        // the west region might typically utilize a {@link Ext.tree.TreePanel TreePanel} or a Panel with {@link Ext.layout.AccordionLayout Accordion layout} \r
-    }, {\r
-        region: 'south',\r
-        title: 'Title for Panel',\r
-        collapsible: true,\r
-        html: 'Information goes here',\r
-        split: true,\r
-        height: 100,\r
-        minHeight: 100\r
-    }, {\r
-        region: 'east',\r
-        title: 'Title for the Grid Panel',\r
-        collapsible: true,\r
-        split: true,\r
-        width: 200,\r
-        xtype: 'grid',\r
-        // remaining grid configuration not shown ...\r
-        // notice that the GridPanel is added directly as the region\r
-        // it is not "overnested" inside another Panel\r
-    }, {\r
-        region: 'center',\r
-        xtype: 'tabpanel', // TabPanel itself has no title\r
-        items: {\r
-            title: 'Default Tab',\r
-            html: 'The first tab\'s content. Others may be added dynamically'\r
+            Ext.fly(form).set(buf);\r
+            Ext.each(hiddens, function(h) {\r
+                Ext.removeNode(h);\r
+            });\r
         }\r
-    }]\r
+    });\r
+})();\r
+\r
+/**\r
+ * @class Ext.Ajax\r
+ * @extends Ext.data.Connection\r
+ * <p>The global Ajax request class that provides a simple way to make Ajax requests\r
+ * with maximum flexibility.</p>\r
+ * <p>Since Ext.Ajax is a singleton, you can set common properties/events for it once\r
+ * and override them at the request function level only if necessary.</p>\r
+ * <p>Common <b>Properties</b> you may want to set are:<div class="mdetail-params"><ul>\r
+ * <li><b><tt>{@link #method}</tt></b><p class="sub-desc"></p></li>\r
+ * <li><b><tt>{@link #extraParams}</tt></b><p class="sub-desc"></p></li>\r
+ * <li><b><tt>{@link #url}</tt></b><p class="sub-desc"></p></li>\r
+ * </ul></div>\r
+ * <pre><code>\r
+// Default headers to pass in every request\r
+Ext.Ajax.defaultHeaders = {\r
+    'Powered-By': 'Ext'\r
+};\r
+ * </code></pre>\r
+ * </p>\r
+ * <p>Common <b>Events</b> you may want to set are:<div class="mdetail-params"><ul>\r
+ * <li><b><tt>{@link Ext.data.Connection#beforerequest beforerequest}</tt></b><p class="sub-desc"></p></li>\r
+ * <li><b><tt>{@link Ext.data.Connection#requestcomplete requestcomplete}</tt></b><p class="sub-desc"></p></li>\r
+ * <li><b><tt>{@link Ext.data.Connection#requestexception requestexception}</tt></b><p class="sub-desc"></p></li>\r
+ * </ul></div>\r
+ * <pre><code>\r
+// Example: show a spinner during all Ajax requests\r
+Ext.Ajax.on('beforerequest', this.showSpinner, this);\r
+Ext.Ajax.on('requestcomplete', this.hideSpinner, this);\r
+Ext.Ajax.on('requestexception', this.hideSpinner, this);\r
+ * </code></pre>\r
+ * </p>\r
+ * <p>An example request:</p>\r
+ * <pre><code>\r
+// Basic request\r
+Ext.Ajax.{@link Ext.data.Connection#request request}({\r
+   url: 'foo.php',\r
+   success: someFn,\r
+   failure: otherFn,\r
+   headers: {\r
+       'my-header': 'foo'\r
+   },\r
+   params: { foo: 'bar' }\r
 });\r
-</code></pre>\r
- * @constructor\r
- * Create a new Viewport\r
- * @param {Object} config The config object\r
- * @xtype viewport\r
+\r
+// Simple ajax form submission\r
+Ext.Ajax.{@link Ext.data.Connection#request request}({\r
+    form: 'some-form',\r
+    params: 'foo=bar'\r
+});\r
+ * </code></pre>\r
+ * </p>\r
+ * @singleton\r
  */\r
-Ext.Viewport = Ext.extend(Ext.Container, {\r
-       /*\r
-        * Privatize config options which, if used, would interfere with the\r
-        * correct operation of the Viewport as the sole manager of the\r
-        * layout of the document body.\r
-        */\r
+Ext.Ajax = new Ext.data.Connection({\r
+    /**\r
+     * @cfg {String} url @hide\r
+     */\r
+    /**\r
+     * @cfg {Object} extraParams @hide\r
+     */\r
     /**\r
-     * @cfg {Mixed} applyTo @hide\r
-        */\r
+     * @cfg {Object} defaultHeaders @hide\r
+     */\r
     /**\r
-     * @cfg {Boolean} allowDomMove @hide\r
-        */\r
+     * @cfg {String} method (Optional) @hide\r
+     */\r
     /**\r
-     * @cfg {Boolean} hideParent @hide\r
-        */\r
+     * @cfg {Number} timeout (Optional) @hide\r
+     */\r
     /**\r
-     * @cfg {Mixed} renderTo @hide\r
-        */\r
+     * @cfg {Boolean} autoAbort (Optional) @hide\r
+     */\r
+\r
     /**\r
-     * @cfg {Boolean} hideParent @hide\r
-        */\r
+     * @cfg {Boolean} disableCaching (Optional) @hide\r
+     */\r
+\r
     /**\r
-     * @cfg {Number} height @hide\r
-        */\r
+     * @property  disableCaching\r
+     * True to add a unique cache-buster param to GET requests. (defaults to true)\r
+     * @type Boolean\r
+     */\r
     /**\r
-     * @cfg {Number} width @hide\r
-        */\r
+     * @property  url\r
+     * The default URL to be used for requests to the server. (defaults to undefined)\r
+     * If the server receives all requests through one URL, setting this once is easier than\r
+     * entering it on every request.\r
+     * @type String\r
+     */\r
     /**\r
-     * @cfg {Boolean} autoHeight @hide\r
-        */\r
+     * @property  extraParams\r
+     * An object containing properties which are used as extra parameters to each request made\r
+     * by this object (defaults to undefined). Session information and other data that you need\r
+     * to pass with each request are commonly put here.\r
+     * @type Object\r
+     */\r
     /**\r
-     * @cfg {Boolean} autoWidth @hide\r
-        */\r
+     * @property  defaultHeaders\r
+     * An object containing request headers which are added to each request made by this object\r
+     * (defaults to undefined).\r
+     * @type Object\r
+     */\r
     /**\r
-     * @cfg {Boolean} deferHeight @hide\r
-        */\r
+     * @property  method\r
+     * The default HTTP method to be used for requests. Note that this is case-sensitive and\r
+     * should be all caps (defaults to undefined; if not set but params are present will use\r
+     * <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)\r
+     * @type String\r
+     */\r
     /**\r
-     * @cfg {Boolean} monitorResize @hide\r
-        */\r
-    initComponent : function() {\r
-        Ext.Viewport.superclass.initComponent.call(this);\r
-        document.getElementsByTagName('html')[0].className += ' x-viewport';\r
-        this.el = Ext.getBody();\r
-        this.el.setHeight = Ext.emptyFn;\r
-        this.el.setWidth = Ext.emptyFn;\r
-        this.el.setSize = Ext.emptyFn;\r
-        this.el.dom.scroll = 'no';\r
-        this.allowDomMove = false;\r
-        this.autoWidth = true;\r
-        this.autoHeight = true;\r
-        Ext.EventManager.onWindowResize(this.fireResize, this);\r
-        this.renderTo = this.el;\r
-    },\r
+     * @property  timeout\r
+     * The timeout in milliseconds to be used for requests. (defaults to 30000)\r
+     * @type Number\r
+     */\r
 \r
-    fireResize : function(w, h){\r
-        this.fireEvent('resize', this, w, h, w, h);\r
+    /**\r
+     * @property  autoAbort\r
+     * Whether a new request should abort any pending requests. (defaults to false)\r
+     * @type Boolean\r
+     */\r
+    autoAbort : false,\r
+\r
+    /**\r
+     * Serialize the passed form into a url encoded string\r
+     * @param {String/HTMLElement} form\r
+     * @return {String}\r
+     */\r
+    serializeForm : function(form){\r
+        return Ext.lib.Ajax.serializeForm(form);\r
     }\r
 });\r
-Ext.reg('viewport', Ext.Viewport);/**
- * @class Ext.Panel
- * @extends Ext.Container
- * <p>Panel is a container that has specific functionality and structural components that make
- * it the perfect building block for application-oriented user interfaces.</p>
- * <p>Panels are, by virtue of their inheritance from {@link Ext.Container}, capable
- * of being configured with a {@link Ext.Container#layout layout}, and containing child Components.</p>
- * <p>When either specifying child {@link Ext.Component#items items} of a Panel, or dynamically {@link Ext.Container#add adding} Components
- * to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether
- * those child elements need to be sized using one of Ext's built-in <tt><b>{@link Ext.Container#layout layout}</b></tt> schemes. By
- * default, Panels use the {@link Ext.layout.ContainerLayout ContainerLayout} scheme. This simply renders
- * child components, appending them one after the other inside the Container, and <b>does not apply any sizing</b>
- * at all.</p>
- * <p>A Panel may also contain {@link #bbar bottom} and {@link #tbar top} toolbars, along with separate
- * {@link #header}, {@link #footer} and {@link #body} sections (see {@link #frame} for additional
- * information).</p>
- * <p>Panel also provides built-in {@link #collapsible expandable and collapsible behavior}, along with
- * a variety of {@link #tools prebuilt tool buttons} that can be wired up to provide other customized
- * behavior.  Panels can be easily dropped into any {@link Ext.Container Container} or layout, and the
- * layout and rendering pipeline is {@link Ext.Container#add completely managed by the framework}.</p>
+/**
+ * @class Ext.Updater
+ * @extends Ext.util.Observable
+ * Provides AJAX-style update capabilities for Element objects.  Updater can be used to {@link #update}
+ * an {@link Ext.Element} once, or you can use {@link #startAutoRefresh} to set up an auto-updating
+ * {@link Ext.Element Element} on a specific interval.<br><br>
+ * Usage:<br>
+ * <pre><code>
+ * var el = Ext.get("foo"); // Get Ext.Element object
+ * var mgr = el.getUpdater();
+ * mgr.update({
+        url: "http://myserver.com/index.php",
+        params: {
+            param1: "foo",
+            param2: "bar"
+        }
+ * });
+ * ...
+ * mgr.formUpdate("myFormId", "http://myserver.com/index.php");
+ * <br>
+ * // or directly (returns the same Updater instance)
+ * var mgr = new Ext.Updater("myElementId");
+ * mgr.startAutoRefresh(60, "http://myserver.com/index.php");
+ * mgr.on("update", myFcnNeedsToKnow);
+ * <br>
+ * // short handed call directly from the element object
+ * Ext.get("foo").load({
+        url: "bar.php",
+        scripts: true,
+        params: "param1=foo&amp;param2=bar",
+        text: "Loading Foo..."
+ * });
+ * </code></pre>
  * @constructor
- * @param {Object} config The config object
- * @xtype panel
+ * Create new Updater directly.
+ * @param {Mixed} el The element to update
+ * @param {Boolean} forceNew (optional) By default the constructor checks to see if the passed element already
+ * has an Updater and if it does it returns the same instance. This will skip that check (useful for extending this class).
+ */
+Ext.UpdateManager = Ext.Updater = Ext.extend(Ext.util.Observable, 
+function() {
+       var BEFOREUPDATE = "beforeupdate",
+               UPDATE = "update",
+               FAILURE = "failure";
+               
+       // private
+    function processSuccess(response){     
+           var me = this;
+        me.transaction = null;
+        if (response.argument.form && response.argument.reset) {
+            try { // put in try/catch since some older FF releases had problems with this
+                response.argument.form.reset();
+            } catch(e){}
+        }
+        if (me.loadScripts) {
+            me.renderer.render(me.el, response, me,
+               updateComplete.createDelegate(me, [response]));
+        } else {
+            me.renderer.render(me.el, response, me);
+            updateComplete.call(me, response);
+        }
+    }
+    
+    // private
+    function updateComplete(response, type, success){
+        this.fireEvent(type || UPDATE, this.el, response);
+        if(Ext.isFunction(response.argument.callback)){
+            response.argument.callback.call(response.argument.scope, this.el, Ext.isEmpty(success) ? true : false, response, response.argument.options);
+        }
+    }
+
+    // private
+    function processFailure(response){             
+        updateComplete.call(this, response, FAILURE, !!(this.transaction = null));
+    }
+           
+       return {
+           constructor: function(el, forceNew){
+                   var me = this;
+               el = Ext.get(el);
+               if(!forceNew && el.updateManager){
+                   return el.updateManager;
+               }
+               /**
+                * The Element object
+                * @type Ext.Element
+                */
+               me.el = el;
+               /**
+                * Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
+                * @type String
+                */
+               me.defaultUrl = null;
+       
+               me.addEvents(
+                   /**
+                    * @event beforeupdate
+                    * Fired before an update is made, return false from your handler and the update is cancelled.
+                    * @param {Ext.Element} el
+                    * @param {String/Object/Function} url
+                    * @param {String/Object} params
+                    */
+                   BEFOREUPDATE,
+                   /**
+                    * @event update
+                    * Fired after successful update is made.
+                    * @param {Ext.Element} el
+                    * @param {Object} oResponseObject The response Object
+                    */
+                   UPDATE,
+                   /**
+                    * @event failure
+                    * Fired on update failure.
+                    * @param {Ext.Element} el
+                    * @param {Object} oResponseObject The response Object
+                    */
+                   FAILURE
+               );
+       
+               Ext.apply(me, Ext.Updater.defaults);
+               /**
+                * Blank page URL to use with SSL file uploads (defaults to {@link Ext.Updater.defaults#sslBlankUrl}).
+                * @property sslBlankUrl
+                * @type String
+                */
+               /**
+                * Whether to append unique parameter on get request to disable caching (defaults to {@link Ext.Updater.defaults#disableCaching}).
+                * @property disableCaching
+                * @type Boolean
+                */
+               /**
+                * Text for loading indicator (defaults to {@link Ext.Updater.defaults#indicatorText}).
+                * @property indicatorText
+                * @type String
+                */
+               /**
+                * Whether to show indicatorText when loading (defaults to {@link Ext.Updater.defaults#showLoadIndicator}).
+                * @property showLoadIndicator
+                * @type String
+                */
+               /**
+                * Timeout for requests or form posts in seconds (defaults to {@link Ext.Updater.defaults#timeout}).
+                * @property timeout
+                * @type Number
+                */
+               /**
+                * True to process scripts in the output (defaults to {@link Ext.Updater.defaults#loadScripts}).
+                * @property loadScripts
+                * @type Boolean
+                */
+       
+               /**
+                * Transaction object of the current executing transaction, or null if there is no active transaction.
+                */
+               me.transaction = null;
+               /**
+                * Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
+                * @type Function
+                */
+               me.refreshDelegate = me.refresh.createDelegate(me);
+               /**
+                * Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments
+                * @type Function
+                */
+               me.updateDelegate = me.update.createDelegate(me);
+               /**
+                * Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments
+                * @type Function
+                */
+               me.formUpdateDelegate = (me.formUpdate || function(){}).createDelegate(me);     
+               
+                       /**
+                        * The renderer for this Updater (defaults to {@link Ext.Updater.BasicRenderer}).
+                        */
+               me.renderer = me.renderer || me.getDefaultRenderer();
+               
+               Ext.Updater.superclass.constructor.call(me);
+           },
+        
+               /**
+            * Sets the content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
+            * @param {Object} renderer The object implementing the render() method
+            */
+           setRenderer : function(renderer){
+               this.renderer = renderer;
+           },  
+        
+           /**
+            * Returns the current content renderer for this Updater. See {@link Ext.Updater.BasicRenderer#render} for more details.
+            * @return {Object}
+            */
+           getRenderer : function(){
+              return this.renderer;
+           },
+
+           /**
+            * This is an overrideable method which returns a reference to a default
+            * renderer class if none is specified when creating the Ext.Updater.
+            * Defaults to {@link Ext.Updater.BasicRenderer}
+            */
+           getDefaultRenderer: function() {
+               return new Ext.Updater.BasicRenderer();
+           },
+                
+           /**
+            * Sets the default URL used for updates.
+            * @param {String/Function} defaultUrl The url or a function to call to get the url
+            */
+           setDefaultUrl : function(defaultUrl){
+               this.defaultUrl = defaultUrl;
+           },
+        
+           /**
+            * Get the Element this Updater is bound to
+            * @return {Ext.Element} The element
+            */
+           getEl : function(){
+               return this.el;
+           },
+       
+               /**
+            * Performs an <b>asynchronous</b> request, updating this element with the response.
+            * If params are specified it uses POST, otherwise it uses GET.<br><br>
+            * <b>Note:</b> Due to the asynchronous nature of remote server requests, the Element
+            * will not have been fully updated when the function returns. To post-process the returned
+            * data, use the callback option, or an <b><code>update</code></b> event handler.
+            * @param {Object} options A config object containing any of the following options:<ul>
+            * <li>url : <b>String/Function</b><p class="sub-desc">The URL to request or a function which
+            * <i>returns</i> the URL (defaults to the value of {@link Ext.Ajax#url} if not specified).</p></li>
+            * <li>method : <b>String</b><p class="sub-desc">The HTTP method to
+            * use. Defaults to POST if the <code>params</code> argument is present, otherwise GET.</p></li>
+            * <li>params : <b>String/Object/Function</b><p class="sub-desc">The
+            * parameters to pass to the server (defaults to none). These may be specified as a url-encoded
+            * string, or as an object containing properties which represent parameters,
+            * or as a function, which returns such an object.</p></li>
+            * <li>scripts : <b>Boolean</b><p class="sub-desc">If <code>true</code>
+            * any &lt;script&gt; tags embedded in the response text will be extracted
+            * and executed (defaults to {@link Ext.Updater.defaults#loadScripts}). If this option is specified,
+            * the callback will be called <i>after</i> the execution of the scripts.</p></li>
+            * <li>callback : <b>Function</b><p class="sub-desc">A function to
+            * be called when the response from the server arrives. The following
+            * parameters are passed:<ul>
+            * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
+            * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
+            * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li>
+            * <li><b>options</b> : Object<p class="sub-desc">The config object passed to the update call.</p></li></ul>
+            * </p></li>
+            * <li>scope : <b>Object</b><p class="sub-desc">The scope in which
+            * to execute the callback (The callback's <code>this</code> reference.) If the
+            * <code>params</code> argument is a function, this scope is used for that function also.</p></li>
+            * <li>discardUrl : <b>Boolean</b><p class="sub-desc">By default, the URL of this request becomes
+            * the default URL for this Updater object, and will be subsequently used in {@link #refresh}
+            * calls.  To bypass this behavior, pass <code>discardUrl:true</code> (defaults to false).</p></li>
+            * <li>timeout : <b>Number</b><p class="sub-desc">The number of seconds to wait for a response before
+            * timing out (defaults to {@link Ext.Updater.defaults#timeout}).</p></li>
+            * <li>text : <b>String</b><p class="sub-desc">The text to use as the innerHTML of the
+            * {@link Ext.Updater.defaults#indicatorText} div (defaults to 'Loading...').  To replace the entire div, not
+            * just the text, override {@link Ext.Updater.defaults#indicatorText} directly.</p></li>
+            * <li>nocache : <b>Boolean</b><p class="sub-desc">Only needed for GET
+            * requests, this option causes an extra, auto-generated parameter to be appended to the request
+            * to defeat caching (defaults to {@link Ext.Updater.defaults#disableCaching}).</p></li></ul>
+            * <p>
+            * For example:
+       <pre><code>
+       um.update({
+           url: "your-url.php",
+           params: {param1: "foo", param2: "bar"}, // or a URL encoded string
+           callback: yourFunction,
+           scope: yourObject, //(optional scope)
+           discardUrl: true,
+           nocache: true,
+           text: "Loading...",
+           timeout: 60,
+           scripts: false // Save time by avoiding RegExp execution.
+       });
+       </code></pre>
+            */
+           update : function(url, params, callback, discardUrl){
+                   var me = this,
+                       cfg, 
+                       callerScope;
+                       
+               if(me.fireEvent(BEFOREUPDATE, me.el, url, params) !== false){               
+                   if(Ext.isObject(url)){ // must be config object
+                       cfg = url;
+                       url = cfg.url;
+                       params = params || cfg.params;
+                       callback = callback || cfg.callback;
+                       discardUrl = discardUrl || cfg.discardUrl;
+                       callerScope = cfg.scope;                        
+                       if(!Ext.isEmpty(cfg.nocache)){me.disableCaching = cfg.nocache;};
+                       if(!Ext.isEmpty(cfg.text)){me.indicatorText = '<div class="loading-indicator">'+cfg.text+"</div>";};
+                       if(!Ext.isEmpty(cfg.scripts)){me.loadScripts = cfg.scripts;};
+                       if(!Ext.isEmpty(cfg.timeout)){me.timeout = cfg.timeout;};
+                   }
+                   me.showLoading();
+       
+                   if(!discardUrl){
+                       me.defaultUrl = url;
+                   }
+                   if(Ext.isFunction(url)){
+                       url = url.call(me);
+                   }
+       
+                   var o = Ext.apply({}, {
+                       url : url,
+                       params: (Ext.isFunction(params) && callerScope) ? params.createDelegate(callerScope) : params,
+                       success: processSuccess,
+                       failure: processFailure,
+                       scope: me,
+                       callback: undefined,
+                       timeout: (me.timeout*1000),
+                       disableCaching: me.disableCaching,
+                       argument: {
+                           "options": cfg,
+                           "url": url,
+                           "form": null,
+                           "callback": callback,
+                           "scope": callerScope || window,
+                           "params": params
+                       }
+                   }, cfg);
+       
+                   me.transaction = Ext.Ajax.request(o);
+               }
+           },          
+
+               /**
+            * <p>Performs an asynchronous form post, updating this element with the response. If the form has the attribute
+            * enctype="<a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>", it assumes it's a file upload.
+            * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.</p>
+            * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
+            * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
+            * DOM <code>&lt;form></code> element temporarily modified to have its
+            * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
+            * to a dynamically generated, hidden <code>&lt;iframe></code> which is inserted into the document
+            * but removed after the return data has been gathered.</p>
+            * <p>Be aware that file upload packets, sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form-data</a>
+            * and some server technologies (notably JEE) may require some custom processing in order to
+            * retrieve parameter names and parameter values from the packet content.</p>
+            * @param {String/HTMLElement} form The form Id or form element
+            * @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
+            * @param {Boolean} reset (optional) Whether to try to reset the form after the update
+            * @param {Function} callback (optional) Callback when transaction is complete. The following
+            * parameters are passed:<ul>
+            * <li><b>el</b> : Ext.Element<p class="sub-desc">The Element being updated.</p></li>
+            * <li><b>success</b> : Boolean<p class="sub-desc">True for success, false for failure.</p></li>
+            * <li><b>response</b> : XMLHttpRequest<p class="sub-desc">The XMLHttpRequest which processed the update.</p></li></ul>
+            */
+           formUpdate : function(form, url, reset, callback){
+                   var me = this;
+               if(me.fireEvent(BEFOREUPDATE, me.el, form, url) !== false){
+                   if(Ext.isFunction(url)){
+                       url = url.call(me);
+                   }
+                   form = Ext.getDom(form)
+                   me.transaction = Ext.Ajax.request({
+                       form: form,
+                       url:url,
+                       success: processSuccess,
+                       failure: processFailure,
+                       scope: me,
+                       timeout: (me.timeout*1000),
+                       argument: {
+                           "url": url,
+                           "form": form,
+                           "callback": callback,
+                           "reset": reset
+                       }
+                   });
+                   me.showLoading.defer(1, me);
+               }
+           },
+                       
+           /**
+            * Set this element to auto refresh.  Can be canceled by calling {@link #stopAutoRefresh}.
+            * @param {Number} interval How often to update (in seconds).
+            * @param {String/Object/Function} url (optional) The url for this request, a config object in the same format
+            * supported by {@link #load}, or a function to call to get the url (defaults to the last used url).  Note that while
+            * the url used in a load call can be reused by this method, other load config options will not be reused and must be
+            * sepcified as part of a config object passed as this paramter if needed.
+            * @param {String/Object} params (optional) The parameters to pass as either a url encoded string
+            * "&param1=1&param2=2" or as an object {param1: 1, param2: 2}
+            * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+            * @param {Boolean} refreshNow (optional) Whether to execute the refresh now, or wait the interval
+            */
+           startAutoRefresh : function(interval, url, params, callback, refreshNow){
+                   var me = this;
+               if(refreshNow){
+                   me.update(url || me.defaultUrl, params, callback, true);
+               }
+               if(me.autoRefreshProcId){
+                   clearInterval(me.autoRefreshProcId);
+               }
+               me.autoRefreshProcId = setInterval(me.update.createDelegate(me, [url || me.defaultUrl, params, callback, true]), interval * 1000);
+           },
+       
+           /**
+            * Stop auto refresh on this element.
+            */
+           stopAutoRefresh : function(){
+               if(this.autoRefreshProcId){
+                   clearInterval(this.autoRefreshProcId);
+                   delete this.autoRefreshProcId;
+               }
+           },
+       
+           /**
+            * Returns true if the Updater is currently set to auto refresh its content (see {@link #startAutoRefresh}), otherwise false.
+            */
+           isAutoRefreshing : function(){
+              return !!this.autoRefreshProcId;
+           },
+       
+           /**
+            * Display the element's "loading" state. By default, the element is updated with {@link #indicatorText}. This
+            * method may be overridden to perform a custom action while this Updater is actively updating its contents.
+            */
+           showLoading : function(){
+               if(this.showLoadIndicator){
+               this.el.dom.innerHTML = this.indicatorText;
+               }
+           },
+       
+           /**
+            * Aborts the currently executing transaction, if any.
+            */
+           abort : function(){
+               if(this.transaction){
+                   Ext.Ajax.abort(this.transaction);
+               }
+           },
+       
+           /**
+            * Returns true if an update is in progress, otherwise false.
+            * @return {Boolean}
+            */
+           isUpdating : function(){        
+               return this.transaction ? Ext.Ajax.isLoading(this.transaction) : false;        
+           },
+           
+           /**
+            * Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
+            * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+            */
+           refresh : function(callback){
+               if(this.defaultUrl){
+                       this.update(this.defaultUrl, null, callback, true);
+               }
+           }
+    }
+}());
+
+/**
+ * @class Ext.Updater.defaults
+ * The defaults collection enables customizing the default properties of Updater
  */
-Ext.Panel = Ext.extend(Ext.Container, {
-    /**
-     * The Panel's header {@link Ext.Element Element}. Read-only.
-     * <p>This Element is used to house the {@link #title} and {@link #tools}</p>
-     * <br><p><b>Note</b>: see the Note for <tt>{@link Ext.Component#el el} also.</p>
-     * @type Ext.Element
-     * @property header
+Ext.Updater.defaults = {
+   /**
+     * Timeout for requests or form posts in seconds (defaults to 30 seconds).
+     * @type Number
      */
+    timeout : 30,    
     /**
-     * The Panel's body {@link Ext.Element Element} which may be used to contain HTML content.
-     * The content may be specified in the {@link #html} config, or it may be loaded using the
-     * {@link autoLoad} config, or through the Panel's {@link #getUpdater Updater}. Read-only.
-     * <p>If this is used to load visible HTML elements in either way, then
-     * the Panel may not be used as a Layout for hosting nested Panels.</p>
-     * <p>If this Panel is intended to be used as the host of a Layout (See {@link #layout}
-     * then the body Element must not be loaded or changed - it is under the control
-     * of the Panel's Layout.
-     * <br><p><b>Note</b>: see the Note for <tt>{@link Ext.Component#el el} also.</p>
-     * @type Ext.Element
-     * @property body
+     * True to append a unique parameter to GET requests to disable caching (defaults to false).
+     * @type Boolean
      */
+    disableCaching : false,
     /**
-     * The Panel's bwrap {@link Ext.Element Element} used to contain other Panel elements
-     * (tbar, body, bbar, footer). See {@link #bodyCfg}. Read-only.
-     * @type Ext.Element
-     * @property bwrap
+     * Whether or not to show {@link #indicatorText} during loading (defaults to true).
+     * @type Boolean
      */
+    showLoadIndicator : true,
     /**
-     * True if this panel is collapsed. Read-only.
+     * Text for loading indicator (defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
+     * @type String
+     */
+    indicatorText : '<div class="loading-indicator">Loading...</div>',
+     /**
+     * True to process scripts by default (defaults to false).
      * @type Boolean
-     * @property collapsed
      */
+    loadScripts : false,
     /**
-     * @cfg {Object} bodyCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object may be specified for any
-     * Panel Element.</p>
-     * <p>By default, the Default element in the table below will be used for the html markup to
-     * create a child element with the commensurate Default class name (<tt>baseCls</tt> will be
-     * replaced by <tt>{@link #baseCls}</tt>):</p>
-     * <pre>
-     * Panel      Default  Default             Custom      Additional       Additional
-     * Element    element  class               element     class            style
-     * ========   ==========================   =========   ==============   ===========
-     * {@link #header}     div      {@link #baseCls}+'-header'   {@link #headerCfg}   headerCssClass   headerStyle
-     * {@link #bwrap}      div      {@link #baseCls}+'-bwrap'     {@link #bwrapCfg}    bwrapCssClass    bwrapStyle
-     * + tbar     div      {@link #baseCls}+'-tbar'       {@link #tbarCfg}     tbarCssClass     tbarStyle
-     * + {@link #body}     div      {@link #baseCls}+'-body'       {@link #bodyCfg}     {@link #bodyCssClass}     {@link #bodyStyle}
-     * + bbar     div      {@link #baseCls}+'-bbar'       {@link #bbarCfg}     bbarCssClass     bbarStyle
-     * + {@link #footer}   div      {@link #baseCls}+'-footer'   {@link #footerCfg}   footerCssClass   footerStyle
-     * </pre>
-     * <p>Configuring a Custom element may be used, for example, to force the {@link #body} Element
-     * to use a different form of markup than is created by default. An example of this might be
-     * to {@link Ext.Element#createChild create a child} Panel containing a custom content, such as
-     * a header, or forcing centering of all Panel content by having the body be a &lt;center&gt;
-     * element:</p>
-     * <pre><code>
-new Ext.Panel({
-    title: 'Message Title',
-    renderTo: Ext.getBody(),
-    width: 200, height: 130,
-    <b>bodyCfg</b>: {
-        tag: 'center',
-        cls: 'x-panel-body',  // Default class not applied if Custom element specified
-        html: 'Message'
-    },
-    footerCfg: {
-        tag: 'h2',
-        cls: 'x-panel-footer'        // same as the Default class
-        html: 'footer html'
-    },
-    footerCssClass: 'custom-footer', // additional css class, see {@link Ext.element#addClass addClass}
-    footerStyle:    'background-color:red' // see {@link #bodyStyle}
-});
-     * </code></pre>
-     * <p>The example above also explicitly creates a <tt>{@link #footer}</tt> with custom markup and
-     * styling applied.</p>
+    * Blank page URL to use with SSL file uploads (defaults to {@link Ext#SSL_SECURE_URL} if set, or "javascript:false").
+    * @type String
+    */
+    sslBlankUrl : Ext.SSL_SECURE_URL      
+};
+
+
+/**
+ * Static convenience method. <b>This method is deprecated in favor of el.load({url:'foo.php', ...})</b>.
+ * Usage:
+ * <pre><code>Ext.Updater.updateElement("my-div", "stuff.php");</code></pre>
+ * @param {Mixed} el The element to update
+ * @param {String} url The url
+ * @param {String/Object} params (optional) Url encoded param string or an object of name/value pairs
+ * @param {Object} options (optional) A config object with any of the Updater properties you want to set - for
+ * example: {disableCaching:true, indicatorText: "Loading data..."}
+ * @static
+ * @deprecated
+ * @member Ext.Updater
+ */
+Ext.Updater.updateElement = function(el, url, params, options){
+    var um = Ext.get(el).getUpdater();
+    Ext.apply(um, options);
+    um.update(url, params, options ? options.callback : null);
+};
+
+/**
+ * @class Ext.Updater.BasicRenderer
+ * <p>This class is a base class implementing a simple render method which updates an element using results from an Ajax request.</p>
+ * <p>The BasicRenderer updates the element's innerHTML with the responseText. To perform a custom render (i.e. XML or JSON processing),
+ * create an object with a conforming {@link #render} method and pass it to setRenderer on the Updater.</p>
+ */
+Ext.Updater.BasicRenderer = function(){};
+
+Ext.Updater.BasicRenderer.prototype = {
+    /**
+     * This method is called when an Ajax response is received, and an Element needs updating.
+     * @param {Ext.Element} el The element being rendered
+     * @param {Object} xhr The XMLHttpRequest object
+     * @param {Updater} updateManager The calling update manager
+     * @param {Function} callback A callback that will need to be called if loadScripts is true on the Updater
+     */
+     render : function(el, response, updateManager, callback){      
+        el.update(response.responseText, updateManager.loadScripts, callback);
+    }
+};/**
+ * @class Date
+ *
+ * The date parsing and formatting syntax contains a subset of
+ * <a href="http://www.php.net/date">PHP's date() function</a>, and the formats that are
+ * supported will provide results equivalent to their PHP versions.
+ *
+ * The following is a list of all currently supported formats:
+ * <pre>
+Format  Description                                                               Example returned values
+------  -----------------------------------------------------------------------   -----------------------
+  d     Day of the month, 2 digits with leading zeros                             01 to 31
+  D     A short textual representation of the day of the week                     Mon to Sun
+  j     Day of the month without leading zeros                                    1 to 31
+  l     A full textual representation of the day of the week                      Sunday to Saturday
+  N     ISO-8601 numeric representation of the day of the week                    1 (for Monday) through 7 (for Sunday)
+  S     English ordinal suffix for the day of the month, 2 characters             st, nd, rd or th. Works well with j
+  w     Numeric representation of the day of the week                             0 (for Sunday) to 6 (for Saturday)
+  z     The day of the year (starting from 0)                                     0 to 364 (365 in leap years)
+  W     ISO-8601 week number of year, weeks starting on Monday                    01 to 53
+  F     A full textual representation of a month, such as January or March        January to December
+  m     Numeric representation of a month, with leading zeros                     01 to 12
+  M     A short textual representation of a month                                 Jan to Dec
+  n     Numeric representation of a month, without leading zeros                  1 to 12
+  t     Number of days in the given month                                         28 to 31
+  L     Whether it's a leap year                                                  1 if it is a leap year, 0 otherwise.
+  o     ISO-8601 year number (identical to (Y), but if the ISO week number (W)    Examples: 1998 or 2004
+        belongs to the previous or next year, that year is used instead)
+  Y     A full numeric representation of a year, 4 digits                         Examples: 1999 or 2003
+  y     A two digit representation of a year                                      Examples: 99 or 03
+  a     Lowercase Ante meridiem and Post meridiem                                 am or pm
+  A     Uppercase Ante meridiem and Post meridiem                                 AM or PM
+  g     12-hour format of an hour without leading zeros                           1 to 12
+  G     24-hour format of an hour without leading zeros                           0 to 23
+  h     12-hour format of an hour with leading zeros                              01 to 12
+  H     24-hour format of an hour with leading zeros                              00 to 23
+  i     Minutes, with leading zeros                                               00 to 59
+  s     Seconds, with leading zeros                                               00 to 59
+  u     Decimal fraction of a second                                              Examples:
+        (minimum 1 digit, arbitrary number of digits allowed)                     001 (i.e. 0.001s) or
+                                                                                  100 (i.e. 0.100s) or
+                                                                                  999 (i.e. 0.999s) or
+                                                                                  999876543210 (i.e. 0.999876543210s)
+  O     Difference to Greenwich time (GMT) in hours and minutes                   Example: +1030
+  P     Difference to Greenwich time (GMT) with colon between hours and minutes   Example: -08:00
+  T     Timezone abbreviation of the machine running the code                     Examples: EST, MDT, PDT ...
+  Z     Timezone offset in seconds (negative if west of UTC, positive if east)    -43200 to 50400
+  c     ISO 8601 date
+        Notes:                                                                    Examples:
+        1) If unspecified, the month / day defaults to the current month / day,   1991 or
+           the time defaults to midnight, while the timezone defaults to the      1992-10 or
+           browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
+           and minutes. The "T" delimiter, seconds, milliseconds and timezone     1994-08-19T16:20+01:00 or
+           are optional.                                                          1995-07-18T17:21:28-02:00 or
+        2) The decimal fraction of a second, if specified, must contain at        1996-06-17T18:22:29.98765+03:00 or
+           least 1 digit (there is no limit to the maximum number                 1997-05-16T19:23:30,12345-0400 or
+           of digits allowed), and may be delimited by either a '.' or a ','      1998-04-15T20:24:31.2468Z or
+        Refer to the examples on the right for the various levels of              1999-03-14T20:24:32Z or
+        date-time granularity which are supported, or see                         2000-02-13T21:25:33
+        http://www.w3.org/TR/NOTE-datetime for more info.                         2001-01-12 22:26:34
+  U     Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)                1193432466 or -2138434463
+  M$    Microsoft AJAX serialized dates                                           \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
+                                                                                  \/Date(1238606590509+0800)\/
+</pre>
+ *
+ * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
+ * <pre><code>
+// Sample date:
+// 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
+
+var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
+document.write(dt.format('Y-m-d'));                           // 2007-01-10
+document.write(dt.format('F j, Y, g:i a'));                   // January 10, 2007, 3:05 pm
+document.write(dt.format('l, \\t\\he jS \\of F Y h:i:s A'));  // Wednesday, the 10th of January 2007 03:05:01 PM
+</code></pre>
+ *
+ * Here are some standard date/time patterns that you might find helpful.  They
+ * are not part of the source of Date.js, but to use them you can simply copy this
+ * block of code into any script that is included after Date.js and they will also become
+ * globally available on the Date object.  Feel free to add or remove patterns as needed in your code.
+ * <pre><code>
+Date.patterns = {
+    ISO8601Long:"Y-m-d H:i:s",
+    ISO8601Short:"Y-m-d",
+    ShortDate: "n/j/Y",
+    LongDate: "l, F d, Y",
+    FullDateTime: "l, F d, Y g:i:s A",
+    MonthDay: "F d",
+    ShortTime: "g:i A",
+    LongTime: "g:i:s A",
+    SortableDateTime: "Y-m-d\\TH:i:s",
+    UniversalSortableDateTime: "Y-m-d H:i:sO",
+    YearMonth: "F, Y"
+};
+</code></pre>
+ *
+ * Example usage:
+ * <pre><code>
+var dt = new Date();
+document.write(dt.format(Date.patterns.ShortDate));
+</code></pre>
+ * <p>Developer-written, custom formats may be used by supplying both a formatting and a parsing function
+ * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.</p>
+ */
+
+/*
+ * Most of the date-formatting functions below are the excellent work of Baron Schwartz.
+ * (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
+ * They generate precompiled functions from format patterns instead of parsing and
+ * processing each pattern every time a date is formatted. These functions are available
+ * on every Date object.
+ */
+
+(function() {
+
+/**
+ * Global flag which determines if strict date parsing should be used.
+ * Strict date parsing will not roll-over invalid dates, which is the
+ * default behaviour of javascript Date objects.
+ * (see {@link #parseDate} for more information)
+ * Defaults to <tt>false</tt>.
+ * @static
+ * @type Boolean
+*/
+Date.useStrict = false;
+
+
+// create private copy of Ext's String.format() method
+// - to remove unnecessary dependency
+// - to resolve namespace conflict with M$-Ajax's implementation
+function xf(format) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    return format.replace(/\{(\d+)\}/g, function(m, i) {
+        return args[i];
+    });
+}
+
+
+// private
+Date.formatCodeToRegex = function(character, currentGroup) {
+    // Note: currentGroup - position in regex result array (see notes for Date.parseCodes below)
+    var p = Date.parseCodes[character];
+
+    if (p) {
+      p = typeof p == 'function'? p() : p;
+      Date.parseCodes[character] = p; // reassign function result to prevent repeated execution
+    }
+
+    return p? Ext.applyIf({
+      c: p.c? xf(p.c, currentGroup || "{0}") : p.c
+    }, p) : {
+        g:0,
+        c:null,
+        s:Ext.escapeRe(character) // treat unrecognised characters as literals
+    }
+}
+
+// private shorthand for Date.formatCodeToRegex since we'll be using it fairly often
+var $f = Date.formatCodeToRegex;
+
+Ext.apply(Date, {
+    /**
+     * <p>An object hash in which each property is a date parsing function. The property name is the
+     * format string which that function parses.</p>
+     * <p>This object is automatically populated with date parsing functions as
+     * date formats are requested for Ext standard formatting strings.</p>
+     * <p>Custom parsing functions may be inserted into this object, keyed by a name which from then on
+     * may be used as a format string to {@link #parseDate}.<p>
+     * <p>Example:</p><pre><code>
+Date.parseFunctions['x-date-format'] = myDateParser;
+</code></pre>
+     * <p>A parsing function should return a Date object, and is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><code>date</code> : String<div class="sub-desc">The date string to parse.</div></li>
+     * <li><code>strict</code> : Boolean<div class="sub-desc">True to validate date strings while parsing
+     * (i.e. prevent javascript Date "rollover") (The default must be false).
+     * Invalid date strings should return null when parsed.</div></li>
+     * </ul></div></p>
+     * <p>To enable Dates to also be <i>formatted</i> according to that format, a corresponding
+     * formatting function must be placed into the {@link #formatFunctions} property.
+     * @property parseFunctions
+     * @static
+     * @type Object
      */
+    parseFunctions: {
+        "M$": function(input, strict) {
+            // note: the timezone offset is ignored since the M$ Ajax server sends
+            // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
+            var re = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/');
+            var r = (input || '').match(re);
+            return r? new Date(((r[1] || '') + r[2]) * 1) : null;
+        }
+    },
+    parseRegexes: [],
+
     /**
-     * @cfg {Object} headerCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
-     * of this Panel's {@link #header} Element.  See <tt>{@link #bodyCfg}</tt> also.</p>
+     * <p>An object hash in which each property is a date formatting function. The property name is the
+     * format string which corresponds to the produced formatted date string.</p>
+     * <p>This object is automatically populated with date formatting functions as
+     * date formats are requested for Ext standard formatting strings.</p>
+     * <p>Custom formatting functions may be inserted into this object, keyed by a name which from then on
+     * may be used as a format string to {@link #format}. Example:</p><pre><code>
+Date.formatFunctions['x-date-format'] = myDateFormatter;
+</code></pre>
+     * <p>A formatting function should return a string repesentation of the passed Date object:<div class="mdetail-params"><ul>
+     * <li><code>date</code> : Date<div class="sub-desc">The Date to format.</div></li>
+     * </ul></div></p>
+     * <p>To enable date strings to also be <i>parsed</i> according to that format, a corresponding
+     * parsing function must be placed into the {@link #parseFunctions} property.
+     * @property formatFunctions
+     * @static
+     * @type Object
      */
+    formatFunctions: {
+        "M$": function() {
+            // UTC milliseconds since Unix epoch (M$-AJAX serialized date format (MRSF))
+            return '\\/Date(' + this.getTime() + ')\\/';
+        }
+    },
+
+    y2kYear : 50,
+
     /**
-     * @cfg {Object} bwrapCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
-     * of this Panel's {@link #bwrap} Element.  See <tt>{@link #bodyCfg}</tt> also.</p>
+     * Date interval constant
+     * @static
+     * @type String
      */
+    MILLI : "ms",
+
     /**
-     * @cfg {Object} tbarCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
-     * of this Panel's {@link #tbar} Element.  See <tt>{@link #bodyCfg}</tt> also.</p>
+     * Date interval constant
+     * @static
+     * @type String
      */
+    SECOND : "s",
+
     /**
-     * @cfg {Object} bbarCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
-     * of this Panel's {@link #bbar} Element.  See <tt>{@link #bodyCfg}</tt> also.</p>
+     * Date interval constant
+     * @static
+     * @type String
      */
+    MINUTE : "mi",
+
+    /** Date interval constant
+     * @static
+     * @type String
+     */
+    HOUR : "h",
+
     /**
-     * @cfg {Object} footerCfg
-     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
-     * of this Panel's {@link #footer} Element.  See <tt>{@link #bodyCfg}</tt> also.</p>
+     * Date interval constant
+     * @static
+     * @type String
      */
+    DAY : "d",
+
     /**
-     * @cfg {Boolean} closable
-     * Panels themselves do not directly support being closed, but some Panel subclasses do (like
-     * {@link Ext.Window}) or a Panel Class within an {@link Ext.TabPanel}.  Specify <tt>true</tt>
-     * to enable closing in such situations. Defaults to <tt>false</tt>.
+     * Date interval constant
+     * @static
+     * @type String
      */
+    MONTH : "mo",
+
     /**
-     * The Panel's footer {@link Ext.Element Element}. Read-only.
-     * <p>This Element is used to house the Panel's <tt>{@link #buttons}</tt> or <tt>{@link #fbar}</tt>.</p>
-     * <br><p><b>Note</b>: see the Note for <tt>{@link Ext.Component#el el} also.</p>
-     * @type Ext.Element
-     * @property footer
+     * Date interval constant
+     * @static
+     * @type String
      */
+    YEAR : "y",
+
     /**
-     * @cfg {Mixed} applyTo
-     * <p>The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in
-     * the document that specifies some panel-specific structural markup.  When <tt>applyTo</tt> is used,
-     * constituent parts of the panel can be specified by CSS class name within the main element, and the panel
-     * will automatically create those components from that markup. Any required components not specified in the
-     * markup will be autogenerated if necessary.</p>
-     * <p>The following class names are supported (baseCls will be replaced by {@link #baseCls}):</p>
-     * <ul><li>baseCls + '-header'</li>
-     * <li>baseCls + '-header-text'</li>
-     * <li>baseCls + '-bwrap'</li>
-     * <li>baseCls + '-tbar'</li>
-     * <li>baseCls + '-body'</li>
-     * <li>baseCls + '-bbar'</li>
-     * <li>baseCls + '-footer'</li></ul>
-     * <p>Using this config, a call to render() is not required.  If applyTo is specified, any value passed for
-     * {@link #renderTo} will be ignored and the target element's parent node will automatically be used as the
-     * panel's container.</p>
+     * <p>An object hash containing default date values used during date parsing.</p>
+     * <p>The following properties are available:<div class="mdetail-params"><ul>
+     * <li><code>y</code> : Number<div class="sub-desc">The default year value. (defaults to undefined)</div></li>
+     * <li><code>m</code> : Number<div class="sub-desc">The default 1-based month value. (defaults to undefined)</div></li>
+     * <li><code>d</code> : Number<div class="sub-desc">The default day value. (defaults to undefined)</div></li>
+     * <li><code>h</code> : Number<div class="sub-desc">The default hour value. (defaults to undefined)</div></li>
+     * <li><code>i</code> : Number<div class="sub-desc">The default minute value. (defaults to undefined)</div></li>
+     * <li><code>s</code> : Number<div class="sub-desc">The default second value. (defaults to undefined)</div></li>
+     * <li><code>ms</code> : Number<div class="sub-desc">The default millisecond value. (defaults to undefined)</div></li>
+     * </ul></div></p>
+     * <p>Override these properties to customize the default date values used by the {@link #parseDate} method.</p>
+     * <p><b>Note: In countries which experience Daylight Saving Time (i.e. DST), the <tt>h</tt>, <tt>i</tt>, <tt>s</tt>
+     * and <tt>ms</tt> properties may coincide with the exact time in which DST takes effect.
+     * It is the responsiblity of the developer to account for this.</b></p>
+     * Example Usage:
+     * <pre><code>
+// set default day value to the first day of the month
+Date.defaults.d = 1;
+
+// parse a February date string containing only year and month values.
+// setting the default day value to 1 prevents weird date rollover issues
+// when attempting to parse the following date string on, for example, March 31st 2009.
+Date.parseDate('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
+</code></pre>
+     * @property defaults
+     * @static
+     * @type Object
      */
+    defaults: {},
+
     /**
-     * @cfg {Object/Array} tbar
-     * <p>The top toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
-     * buttons/button configs to be added to the toolbar.  Note that this is not available as a property after render.
-     * To access the top toolbar after render, use {@link #getTopToolbar}.</p>
-     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> be updated by a load
-     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
-     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
-     * submission parameters are collected from the DOM tree.</p>
+     * An array of textual day names.
+     * Override these values for international dates.
+     * Example:
+     * <pre><code>
+Date.dayNames = [
+    'SundayInYourLang',
+    'MondayInYourLang',
+    ...
+];
+</code></pre>
+     * @type Array
+     * @static
      */
+    dayNames : [
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+    ],
+
     /**
-     * @cfg {Object/Array} bbar
-     * <p>The bottom toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
-     * buttons/button configs to be added to the toolbar.  Note that this is not available as a property after render.
-     * To access the bottom toolbar after render, use {@link #getBottomToolbar}.</p>
-     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not<b> be updated by a load
-     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
-     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
-     * submission parameters are collected from the DOM tree.</p>
+     * An array of textual month names.
+     * Override these values for international dates.
+     * Example:
+     * <pre><code>
+Date.monthNames = [
+    'JanInYourLang',
+    'FebInYourLang',
+    ...
+];
+</code></pre>
+     * @type Array
+     * @static
      */
-    /** @cfg {Object/Array} fbar
-     * <p>A {@link Ext.Toolbar Toolbar} object, a Toolbar config, or an array of
-     * {@link Ext.Button Button}s/{@link Ext.Button Button} configs, describing a {@link Ext.Toolbar Toolbar} to be rendered into this Panel's footer element.</p>
-     * <p>After render, the <code>fbar</code> property will be an {@link Ext.Toolbar Toolbar} instance.</p>
-     * <p>If <tt>{@link #buttons}</tt> are specified, they will supersede the <tt>fbar</tt> configuration property.</p>
-     * The Panel's <tt>{@link #buttonAlign}</tt> configuration affects the layout of these items, for example:
+    monthNames : [
+        "January",
+        "February",
+        "March",
+        "April",
+        "May",
+        "June",
+        "July",
+        "August",
+        "September",
+        "October",
+        "November",
+        "December"
+    ],
+
+    /**
+     * An object hash of zero-based javascript month numbers (with short month names as keys. note: keys are case-sensitive).
+     * Override these values for international dates.
+     * Example:
      * <pre><code>
-var w = new Ext.Window({
-    height: 250,
-    width: 500,
-    bbar: new Ext.Toolbar({
-        items: [{
-            text: 'bbar Left'
-        },'->',{
-            text: 'bbar Right'
-        }]
-    }),
-    {@link #buttonAlign}: 'left', // anything but 'center' or 'right' and you can use "-", and "->"
-                                  // to control the alignment of fbar items
-    fbar: [{
-        text: 'fbar Left'
-    },'->',{
-        text: 'fbar Right'
-    }]
-}).show();
-     * </code></pre>
-     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not<b> be updated by a load
-     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
-     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
-     * submission parameters are collected from the DOM tree.</p>
+Date.monthNumbers = {
+    'ShortJanNameInYourLang':0,
+    'ShortFebNameInYourLang':1,
+    ...
+};
+</code></pre>
+     * @type Object
+     * @static
      */
+    monthNumbers : {
+        Jan:0,
+        Feb:1,
+        Mar:2,
+        Apr:3,
+        May:4,
+        Jun:5,
+        Jul:6,
+        Aug:7,
+        Sep:8,
+        Oct:9,
+        Nov:10,
+        Dec:11
+    },
+
     /**
-     * @cfg {Boolean} header
-     * <tt>true</tt> to create the Panel's header element explicitly, <tt>false</tt> to skip creating
-     * it.  If a <tt>{@link #title}</tt> is set the header will be created automatically, otherwise it will not.
-     * If a <tt>{@link #title}</tt> is set but <tt>header</tt> is explicitly set to <tt>false</tt>, the header
-     * will not be rendered.
+     * Get the short month name for the given month number.
+     * Override this function for international dates.
+     * @param {Number} month A zero-based javascript month number.
+     * @return {String} The short month name.
+     * @static
      */
+    getShortMonthName : function(month) {
+        return Date.monthNames[month].substring(0, 3);
+    },
+
     /**
-     * @cfg {Boolean} footer
-     * <tt>true</tt> to create the footer element explicitly, false to skip creating it. The footer
-     * will be created automatically if <tt>{@link #buttons}</tt> or a <tt>{@link #fbar}</tt> have
-     * been configured.  See <tt>{@link #bodyCfg}</tt> for an example.
+     * Get the short day name for the given day number.
+     * Override this function for international dates.
+     * @param {Number} day A zero-based javascript day number.
+     * @return {String} The short day name.
+     * @static
      */
+    getShortDayName : function(day) {
+        return Date.dayNames[day].substring(0, 3);
+    },
+
     /**
-     * @cfg {String} title
-     * The title text to be used as innerHTML (html tags are accepted) to display in the panel
-     * <tt>{@link #header}</tt> (defaults to ''). When a <tt>title</tt> is specified the
-     * <tt>{@link #header}</tt> element will automatically be created and displayed unless
-     * {@link #header} is explicitly set to <tt>false</tt>.  If you do not want to specify a
-     * <tt>title</tt> at config time, but you may want one later, you must either specify a non-empty
-     * <tt>title</tt> (a blank space ' ' will do) or <tt>header:true</tt> so that the container
-     * element will get created.
+     * Get the zero-based javascript month number for the given short/full month name.
+     * Override this function for international dates.
+     * @param {String} name The short/full month name.
+     * @return {Number} The zero-based javascript month number.
+     * @static
      */
+    getMonthNumber : function(name) {
+        // handle camel casing for english month names (since the keys for the Date.monthNumbers hash are case sensitive)
+        return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
+    },
+
     /**
-     * @cfg {Array} buttons
-     * <tt>buttons</tt> will be used as <tt>{@link Ext.Container#items items}</tt> for the toolbar in
-     * the footer (<tt>{@link #fbar}</tt>). Typically the value of this configuration property will be
-     * an array of {@link Ext.Button}s or {@link Ext.Button} configuration objects.
-     * If an item is configured with <tt>minWidth</tt> or the Panel is configured with <tt>minButtonWidth</tt>,
-     * that width will be applied to the item.
+     * The base format-code to formatting-function hashmap used by the {@link #format} method.
+     * Formatting functions are strings (or functions which return strings) which
+     * will return the appropriate value when evaluated in the context of the Date object
+     * from which the {@link #format} method is called.
+     * Add to / override these mappings for custom date formatting.
+     * Note: Date.format() treats characters as literals if an appropriate mapping cannot be found.
+     * Example:
+     * <pre><code>
+Date.formatCodes.x = "String.leftPad(this.getDate(), 2, '0')";
+(new Date()).format("X"); // returns the current day of the month
+</code></pre>
+     * @type Object
+     * @static
      */
+    formatCodes : {
+        d: "String.leftPad(this.getDate(), 2, '0')",
+        D: "Date.getShortDayName(this.getDay())", // get localised short day name
+        j: "this.getDate()",
+        l: "Date.dayNames[this.getDay()]",
+        N: "(this.getDay() ? this.getDay() : 7)",
+        S: "this.getSuffix()",
+        w: "this.getDay()",
+        z: "this.getDayOfYear()",
+        W: "String.leftPad(this.getWeekOfYear(), 2, '0')",
+        F: "Date.monthNames[this.getMonth()]",
+        m: "String.leftPad(this.getMonth() + 1, 2, '0')",
+        M: "Date.getShortMonthName(this.getMonth())", // get localised short month name
+        n: "(this.getMonth() + 1)",
+        t: "this.getDaysInMonth()",
+        L: "(this.isLeapYear() ? 1 : 0)",
+        o: "(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",
+        Y: "this.getFullYear()",
+        y: "('' + this.getFullYear()).substring(2, 4)",
+        a: "(this.getHours() < 12 ? 'am' : 'pm')",
+        A: "(this.getHours() < 12 ? 'AM' : 'PM')",
+        g: "((this.getHours() % 12) ? this.getHours() % 12 : 12)",
+        G: "this.getHours()",
+        h: "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",
+        H: "String.leftPad(this.getHours(), 2, '0')",
+        i: "String.leftPad(this.getMinutes(), 2, '0')",
+        s: "String.leftPad(this.getSeconds(), 2, '0')",
+        u: "String.leftPad(this.getMilliseconds(), 3, '0')",
+        O: "this.getGMTOffset()",
+        P: "this.getGMTOffset(true)",
+        T: "this.getTimezone()",
+        Z: "(this.getTimezoneOffset() * -60)",
+
+        c: function() { // ISO-8601 -- GMT format
+            for (var c = "Y-m-dTH:i:sP", code = [], i = 0, l = c.length; i < l; ++i) {
+                var e = c.charAt(i);
+                code.push(e == "T" ? "'T'" : Date.getFormatCode(e)); // treat T as a character literal
+            }
+            return code.join(" + ");
+        },
+        /*
+        c: function() { // ISO-8601 -- UTC format
+            return [
+              "this.getUTCFullYear()", "'-'",
+              "String.leftPad(this.getUTCMonth() + 1, 2, '0')", "'-'",
+              "String.leftPad(this.getUTCDate(), 2, '0')",
+              "'T'",
+              "String.leftPad(this.getUTCHours(), 2, '0')", "':'",
+              "String.leftPad(this.getUTCMinutes(), 2, '0')", "':'",
+              "String.leftPad(this.getUTCSeconds(), 2, '0')",
+              "'Z'"
+            ].join(" + ");
+        },
+        */
+
+        U: "Math.round(this.getTime() / 1000)"
+    },
+
     /**
-     * @cfg {Object/String/Function} autoLoad
-     * A valid url spec according to the Updater {@link Ext.Updater#update} method.
-     * If autoLoad is not null, the panel will attempt to load its contents
-     * immediately upon render.<p>
-     * The URL will become the default URL for this panel's {@link #body} element,
-     * so it may be {@link Ext.Element#refresh refresh}ed at any time.</p>
+     * Checks if the passed Date parameters will cause a javascript Date "rollover".
+     * @param {Number} year 4-digit year
+     * @param {Number} month 1-based month-of-year
+     * @param {Number} day Day of month
+     * @param {Number} hour (optional) Hour
+     * @param {Number} minute (optional) Minute
+     * @param {Number} second (optional) Second
+     * @param {Number} millisecond (optional) Millisecond
+     * @return {Boolean} true if the passed parameters do not cause a Date "rollover", false otherwise.
+     * @static
      */
+    isValid : function(y, m, d, h, i, s, ms) {
+        // setup defaults
+        h = h || 0;
+        i = i || 0;
+        s = s || 0;
+        ms = ms || 0;
+
+        var dt = new Date(y, m - 1, d, h, i, s, ms);
+
+        return y == dt.getFullYear() &&
+            m == dt.getMonth() + 1 &&
+            d == dt.getDate() &&
+            h == dt.getHours() &&
+            i == dt.getMinutes() &&
+            s == dt.getSeconds() &&
+            ms == dt.getMilliseconds();
+    },
+
     /**
-     * @cfg {Boolean} frame
-     * <tt>false</tt> by default to render with plain 1px square borders. <tt>true</tt> to render with
-     * 9 elements, complete with custom rounded corners (also see {@link Ext.Element#boxWrap}).
-     * <p>The template generated for each condition is depicted below:</p><pre><code>
-     *
-// frame = false
-&lt;div id="developer-specified-id-goes-here" class="x-panel">
+     * Parses the passed string using the specified date format.
+     * Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January).
+     * The {@link #defaults} hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond)
+     * which cannot be found in the passed string. If a corresponding default date value has not been specified in the {@link #defaults} hash,
+     * the current date's year, month, day or DST-adjusted zero-hour time value will be used instead.
+     * Keep in mind that the input date string must precisely match the specified format string
+     * in order for the parse operation to be successful (failed parse operations return a null value).
+     * <p>Example:</p><pre><code>
+//dt = Fri May 25 2007 (current date)
+var dt = new Date();
+
+//dt = Thu May 25 2006 (today&#39;s month/day in 2006)
+dt = Date.parseDate("2006", "Y");
+
+//dt = Sun Jan 15 2006 (all date parts specified)
+dt = Date.parseDate("2006-01-15", "Y-m-d");
+
+//dt = Sun Jan 15 2006 15:20:01
+dt = Date.parseDate("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
+
+// attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
+dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
+</code></pre>
+     * @param {String} input The raw date string.
+     * @param {String} format The expected date string format.
+     * @param {Boolean} strict (optional) True to validate date strings while parsing (i.e. prevents javascript Date "rollover")
+                        (defaults to false). Invalid date strings will return null when parsed.
+     * @return {Date} The parsed Date.
+     * @static
+     */
+    parseDate : function(input, format, strict) {
+        var p = Date.parseFunctions;
+        if (p[format] == null) {
+            Date.createParser(format);
+        }
+        return p[format](input, Ext.isDefined(strict) ? strict : Date.useStrict);
+    },
+
+    // private
+    getFormatCode : function(character) {
+        var f = Date.formatCodes[character];
+
+        if (f) {
+          f = typeof f == 'function'? f() : f;
+          Date.formatCodes[character] = f; // reassign function result to prevent repeated execution
+        }
+
+        // note: unknown characters are treated as literals
+        return f || ("'" + String.escape(character) + "'");
+    },
+
+    // private
+    createFormat : function(format) {
+        var code = [],
+            special = false,
+            ch = '';
+
+        for (var i = 0; i < format.length; ++i) {
+            ch = format.charAt(i);
+            if (!special && ch == "\\") {
+                special = true;
+            } else if (special) {
+                special = false;
+                code.push("'" + String.escape(ch) + "'");
+            } else {
+                code.push(Date.getFormatCode(ch))
+            }
+        }
+        Date.formatFunctions[format] = new Function("return " + code.join('+'));
+    },
+
+    // private
+    createParser : function() {
+        var code = [
+            "var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,",
+                "def = Date.defaults,",
+                "results = String(input).match(Date.parseRegexes[{0}]);", // either null, or an array of matched strings
+
+            "if(results){",
+                "{1}",
+
+                "if(u != null){", // i.e. unix time is defined
+                    "v = new Date(u * 1000);", // give top priority to UNIX time
+                "}else{",
+                    // create Date object representing midnight of the current day;
+                    // this will provide us with our date defaults
+                    // (note: clearTime() handles Daylight Saving Time automatically)
+                    "dt = (new Date()).clearTime();",
+
+                    // date calculations (note: these calculations create a dependency on Ext.num())
+                    "y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));",
+                    "m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));",
+                    "d = Ext.num(d, Ext.num(def.d, dt.getDate()));",
+
+                    // time calculations (note: these calculations create a dependency on Ext.num())
+                    "h  = Ext.num(h, Ext.num(def.h, dt.getHours()));",
+                    "i  = Ext.num(i, Ext.num(def.i, dt.getMinutes()));",
+                    "s  = Ext.num(s, Ext.num(def.s, dt.getSeconds()));",
+                    "ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));",
+
+                    "if(z >= 0 && y >= 0){",
+                        // both the year and zero-based day of year are defined and >= 0.
+                        // these 2 values alone provide sufficient info to create a full date object
+
+                        // create Date object representing January 1st for the given year
+                        "v = new Date(y, 0, 1, h, i, s, ms);",
+
+                        // then add day of year, checking for Date "rollover" if necessary
+                        "v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);",
+                    "}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){", // check for Date "rollover"
+                        "v = null;", // invalid date, so return null
+                    "}else{",
+                        // plain old Date object
+                        "v = new Date(y, m, d, h, i, s, ms);",
+                    "}",
+                "}",
+            "}",
+
+            "if(v){",
+                // favour UTC offset over GMT offset
+                "if(zz != null){",
+                    // reset to UTC, then add offset
+                    "v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);",
+                "}else if(o){",
+                    // reset to GMT, then add offset
+                    "v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
+                "}",
+            "}",
+
+            "return v;"
+        ].join('\n');
+
+        return function(format) {
+            var regexNum = Date.parseRegexes.length,
+                currentGroup = 1,
+                calc = [],
+                regex = [],
+                special = false,
+                ch = "";
+
+            for (var i = 0; i < format.length; ++i) {
+                ch = format.charAt(i);
+                if (!special && ch == "\\") {
+                    special = true;
+                } else if (special) {
+                    special = false;
+                    regex.push(String.escape(ch));
+                } else {
+                    var obj = $f(ch, currentGroup);
+                    currentGroup += obj.g;
+                    regex.push(obj.s);
+                    if (obj.g && obj.c) {
+                        calc.push(obj.c);
+                    }
+                }
+            }
+
+            Date.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", "i");
+            Date.parseFunctions[format] = new Function("input", "strict", xf(code, regexNum, calc.join('')));
+        }
+    }(),
+
+    // private
+    parseCodes : {
+        /*
+         * Notes:
+         * g = {Number} calculation group (0 or 1. only group 1 contributes to date calculations.)
+         * c = {String} calculation method (required for group 1. null for group 0. {0} = currentGroup - position in regex result array)
+         * s = {String} regex pattern. all matches are stored in results[], and are accessible by the calculation mapped to 'c'
+         */
+        d: {
+            g:1,
+            c:"d = parseInt(results[{0}], 10);\n",
+            s:"(\\d{2})" // day of month with leading zeroes (01 - 31)
+        },
+        j: {
+            g:1,
+            c:"d = parseInt(results[{0}], 10);\n",
+            s:"(\\d{1,2})" // day of month without leading zeroes (1 - 31)
+        },
+        D: function() {
+            for (var a = [], i = 0; i < 7; a.push(Date.getShortDayName(i)), ++i); // get localised short day names
+            return {
+                g:0,
+                c:null,
+                s:"(?:" + a.join("|") +")"
+            }
+        },
+        l: function() {
+            return {
+                g:0,
+                c:null,
+                s:"(?:" + Date.dayNames.join("|") + ")"
+            }
+        },
+        N: {
+            g:0,
+            c:null,
+            s:"[1-7]" // ISO-8601 day number (1 (monday) - 7 (sunday))
+        },
+        S: {
+            g:0,
+            c:null,
+            s:"(?:st|nd|rd|th)"
+        },
+        w: {
+            g:0,
+            c:null,
+            s:"[0-6]" // javascript day number (0 (sunday) - 6 (saturday))
+        },
+        z: {
+            g:1,
+            c:"z = parseInt(results[{0}], 10);\n",
+            s:"(\\d{1,3})" // day of the year (0 - 364 (365 in leap years))
+        },
+        W: {
+            g:0,
+            c:null,
+            s:"(?:\\d{2})" // ISO-8601 week number (with leading zero)
+        },
+        F: function() {
+            return {
+                g:1,
+                c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n", // get localised month number
+                s:"(" + Date.monthNames.join("|") + ")"
+            }
+        },
+        M: function() {
+            for (var a = [], i = 0; i < 12; a.push(Date.getShortMonthName(i)), ++i); // get localised short month names
+            return Ext.applyIf({
+                s:"(" + a.join("|") + ")"
+            }, $f("F"));
+        },
+        m: {
+            g:1,
+            c:"m = parseInt(results[{0}], 10) - 1;\n",
+            s:"(\\d{2})" // month number with leading zeros (01 - 12)
+        },
+        n: {
+            g:1,
+            c:"m = parseInt(results[{0}], 10) - 1;\n",
+            s:"(\\d{1,2})" // month number without leading zeros (1 - 12)
+        },
+        t: {
+            g:0,
+            c:null,
+            s:"(?:\\d{2})" // no. of days in the month (28 - 31)
+        },
+        L: {
+            g:0,
+            c:null,
+            s:"(?:1|0)"
+        },
+        o: function() {
+            return $f("Y");
+        },
+        Y: {
+            g:1,
+            c:"y = parseInt(results[{0}], 10);\n",
+            s:"(\\d{4})" // 4-digit year
+        },
+        y: {
+            g:1,
+            c:"var ty = parseInt(results[{0}], 10);\n"
+                + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", // 2-digit year
+            s:"(\\d{1,2})"
+        },
+        a: {
+            g:1,
+            c:"if (results[{0}] == 'am') {\n"
+                + "if (!h || h == 12) { h = 0; }\n"
+                + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
+            s:"(am|pm)"
+        },
+        A: {
+            g:1,
+            c:"if (results[{0}] == 'AM') {\n"
+                + "if (!h || h == 12) { h = 0; }\n"
+                + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
+            s:"(AM|PM)"
+        },
+        g: function() {
+            return $f("G");
+        },
+        G: {
+            g:1,
+            c:"h = parseInt(results[{0}], 10);\n",
+            s:"(\\d{1,2})" // 24-hr format of an hour without leading zeroes (0 - 23)
+        },
+        h: function() {
+            return $f("H");
+        },
+        H: {
+            g:1,
+            c:"h = parseInt(results[{0}], 10);\n",
+            s:"(\\d{2})" //  24-hr format of an hour with leading zeroes (00 - 23)
+        },
+        i: {
+            g:1,
+            c:"i = parseInt(results[{0}], 10);\n",
+            s:"(\\d{2})" // minutes with leading zeros (00 - 59)
+        },
+        s: {
+            g:1,
+            c:"s = parseInt(results[{0}], 10);\n",
+            s:"(\\d{2})" // seconds with leading zeros (00 - 59)
+        },
+        u: {
+            g:1,
+            c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
+            s:"(\\d+)" // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
+        },
+        O: {
+            g:1,
+            c:[
+                "o = results[{0}];",
+                "var sn = o.substring(0,1),", // get + / - sign
+                    "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),", // get hours (performs minutes-to-hour conversion also, just in case)
+                    "mn = o.substring(3,5) % 60;", // get minutes
+                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs
+            ].join("\n"),
+            s: "([+\-]\\d{4})" // GMT offset in hrs and mins
+        },
+        P: {
+            g:1,
+            c:[
+                "o = results[{0}];",
+                "var sn = o.substring(0,1),", // get + / - sign
+                    "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),", // get hours (performs minutes-to-hour conversion also, just in case)
+                    "mn = o.substring(4,6) % 60;", // get minutes
+                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n" // -12hrs <= GMT offset <= 14hrs
+            ].join("\n"),
+            s: "([+\-]\\d{2}:\\d{2})" // GMT offset in hrs and mins (with colon separator)
+        },
+        T: {
+            g:0,
+            c:null,
+            s:"[A-Z]{1,4}" // timezone abbrev. may be between 1 - 4 chars
+        },
+        Z: {
+            g:1,
+            c:"zz = results[{0}] * 1;\n" // -43200 <= UTC offset <= 50400
+                  + "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
+            s:"([+\-]?\\d{1,5})" // leading '+' sign is optional for UTC offset
+        },
+        c: function() {
+            var calc = [],
+                arr = [
+                    $f("Y", 1), // year
+                    $f("m", 2), // month
+                    $f("d", 3), // day
+                    $f("h", 4), // hour
+                    $f("i", 5), // minute
+                    $f("s", 6), // second
+                    {c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"}, // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
+                    {c:[ // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified
+                        "if(results[8]) {", // timezone specified
+                            "if(results[8] == 'Z'){",
+                                "zz = 0;", // UTC
+                            "}else if (results[8].indexOf(':') > -1){",
+                                $f("P", 8).c, // timezone offset with colon separator
+                            "}else{",
+                                $f("O", 8).c, // timezone offset without colon separator
+                            "}",
+                        "}"
+                    ].join('\n')}
+                ];
 
-    &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:false)&lt;/span>&lt;/div>
+            for (var i = 0, l = arr.length; i < l; ++i) {
+                calc.push(arr[i].c);
+            }
 
-    &lt;div class="x-panel-bwrap">
-        &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
-    &lt;/div>
-&lt;/div>
+            return {
+                g:1,
+                c:calc.join(""),
+                s:[
+                    arr[0].s, // year (required)
+                    "(?:", "-", arr[1].s, // month (optional)
+                        "(?:", "-", arr[2].s, // day (optional)
+                            "(?:",
+                                "(?:T| )?", // time delimiter -- either a "T" or a single blank space
+                                arr[3].s, ":", arr[4].s,  // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
+                                "(?::", arr[5].s, ")?", // seconds (optional)
+                                "(?:(?:\\.|,)(\\d+))?", // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
+                                "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?", // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
+                            ")?",
+                        ")?",
+                    ")?"
+                ].join("")
+            }
+        },
+        U: {
+            g:1,
+            c:"u = parseInt(results[{0}], 10);\n",
+            s:"(-?\\d+)" // leading minus sign indicates seconds before UNIX epoch
+        }
+    }
+});
 
-// frame = true (create 9 elements)
-&lt;div id="developer-specified-id-goes-here" class="x-panel">
-    &lt;div class="x-panel-tl">&lt;div class="x-panel-tr">&lt;div class="x-panel-tc">
-        &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:true)&lt;/span>&lt;/div>
-    &lt;/div>&lt;/div>&lt;/div>
+}());
 
-    &lt;div class="x-panel-bwrap">
-        &lt;div class="x-panel-ml">&lt;div class="x-panel-mr">&lt;div class="x-panel-mc">
-            &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
-        &lt;/div>&lt;/div>&lt;/div>
+Ext.apply(Date.prototype, {
+    // private
+    dateFormat : function(format) {
+        if (Date.formatFunctions[format] == null) {
+            Date.createFormat(format);
+        }
+        return Date.formatFunctions[format].call(this);
+    },
 
-        &lt;div class="x-panel-bl">&lt;div class="x-panel-br">&lt;div class="x-panel-bc"/>
-        &lt;/div>&lt;/div>&lt;/div>
-&lt;/div>
-     * </code></pre>
-     */
-    /**
-     * @cfg {Boolean} border
-     * True to display the borders of the panel's body element, false to hide them (defaults to true).  By default,
-     * the border is a 2px wide inset border, but this can be further altered by setting {@link #bodyBorder} to false.
-     */
-    /**
-     * @cfg {Boolean} bodyBorder
-     * True to display an interior border on the body element of the panel, false to hide it (defaults to true).
-     * This only applies when {@link #border} == true.  If border == true and bodyBorder == false, the border will display
-     * as a 1px wide inset border, giving the entire body element an inset appearance.
-     */
-    /**
-     * @cfg {String/Object/Function} bodyCssClass
-     * Additional css class selector to be applied to the {@link #body} element in the format expected by
-     * {@link Ext.Element#addClass} (defaults to null). See {@link #bodyCfg}.
-     */
     /**
-     * @cfg {String/Object/Function} bodyStyle
-     * Custom CSS styles to be applied to the {@link #body} element in the format expected by
-     * {@link Ext.Element#applyStyles} (defaults to null). See {@link #bodyCfg}.
+     * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
+     *
+     * Note: The date string returned by the javascript Date object's toString() method varies
+     * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
+     * For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
+     * getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses
+     * (which may or may not be present), failing which it proceeds to get the timezone abbreviation
+     * from the GMT offset portion of the date string.
+     * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
      */
-    /**
-     * @cfg {String} iconCls
-     * The CSS class selector that specifies a background image to be used as the header icon (defaults to '').
-     * <p>An example of specifying a custom icon class would be something like:
-     * </p><pre><code>
-// specify the property in the config for the class:
-     ...
-     iconCls: 'my-icon'
+    getTimezone : function() {
+        // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
+        //
+        // Opera  : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
+        // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF)
+        // FF     : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
+        // IE     : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
+        // IE     : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
+        //
+        // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
+        // step 1: (?:\((.*)\) -- find timezone in parentheses
+        // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string
+        // step 3: remove all non uppercase characters found in step 1 and 2
+        return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
+    },
 
-// css class that specifies background image to be used as the icon image:
-.my-icon { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }
-</code></pre>
-     */
-    /**
-     * @cfg {Boolean} collapsible
-     * True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into
-     * the header tool button area, false to keep the panel statically sized with no button (defaults to false).
-     */
-    /**
-     * @cfg {Array} tools
-     * An array of tool button configs to be added to the header tool area. When rendered, each tool is
-     * stored as an {@link Ext.Element Element} referenced by a public property called <tt><b></b>tools.<i>&lt;tool-type&gt;</i></tt>
-     * <p>Each tool config may contain the following properties:
-     * <div class="mdetail-params"><ul>
-     * <li><b>id</b> : String<div class="sub-desc"><b>Required.</b> The type
-     * of tool to create. By default, this assigns a CSS class of the form <tt>x-tool-<i>&lt;tool-type&gt;</i></tt> to the
-     * resulting tool Element. Ext provides CSS rules, and an icon sprite containing images for the tool types listed below.
-     * The developer may implement custom tools by supplying alternate CSS rules and background images:
-     * <ul>
-     * <div class="x-tool x-tool-toggle" style="float:left; margin-right:5;"> </div><div><tt> toggle</tt> (Created by default when {@link #collapsible} is <tt>true</tt>)</div>
-     * <div class="x-tool x-tool-close" style="float:left; margin-right:5;"> </div><div><tt> close</tt></div>
-     * <div class="x-tool x-tool-minimize" style="float:left; margin-right:5;"> </div><div><tt> minimize</tt></div>
-     * <div class="x-tool x-tool-maximize" style="float:left; margin-right:5;"> </div><div><tt> maximize</tt></div>
-     * <div class="x-tool x-tool-restore" style="float:left; margin-right:5;"> </div><div><tt> restore</tt></div>
-     * <div class="x-tool x-tool-gear" style="float:left; margin-right:5;"> </div><div><tt> gear</tt></div>
-     * <div class="x-tool x-tool-pin" style="float:left; margin-right:5;"> </div><div><tt> pin</tt></div>
-     * <div class="x-tool x-tool-unpin" style="float:left; margin-right:5;"> </div><div><tt> unpin</tt></div>
-     * <div class="x-tool x-tool-right" style="float:left; margin-right:5;"> </div><div><tt> right</tt></div>
-     * <div class="x-tool x-tool-left" style="float:left; margin-right:5;"> </div><div><tt> left</tt></div>
-     * <div class="x-tool x-tool-up" style="float:left; margin-right:5;"> </div><div><tt> up</tt></div>
-     * <div class="x-tool x-tool-down" style="float:left; margin-right:5;"> </div><div><tt> down</tt></div>
-     * <div class="x-tool x-tool-refresh" style="float:left; margin-right:5;"> </div><div><tt> refresh</tt></div>
-     * <div class="x-tool x-tool-minus" style="float:left; margin-right:5;"> </div><div><tt> minus</tt></div>
-     * <div class="x-tool x-tool-plus" style="float:left; margin-right:5;"> </div><div><tt> plus</tt></div>
-     * <div class="x-tool x-tool-help" style="float:left; margin-right:5;"> </div><div><tt> help</tt></div>
-     * <div class="x-tool x-tool-search" style="float:left; margin-right:5;"> </div><div><tt> search</tt></div>
-     * <div class="x-tool x-tool-save" style="float:left; margin-right:5;"> </div><div><tt> save</tt></div>
-     * <div class="x-tool x-tool-print" style="float:left; margin-right:5;"> </div><div><tt> print</tt></div>
-     * </ul></div></li>
-     * <li><b>handler</b> : Function<div class="sub-desc"><b>Required.</b> The function to
-     * call when clicked. Arguments passed are:<ul>
-     * <li><b>event</b> : Ext.EventObject<div class="sub-desc">The click event.</div></li>
-     * <li><b>toolEl</b> : Ext.Element<div class="sub-desc">The tool Element.</div></li>
-     * <li><b>panel</b> : Ext.Panel<div class="sub-desc">The host Panel</div></li>
-     * <li><b>tc</b> : Ext.Panel<div class="sub-desc">The tool configuration object</div></li>
-     * </ul></div></li>
-     * <li><b>stopEvent</b> : Boolean<div class="sub-desc">Defaults to true. Specify as false to allow click event to propagate.</div></li>
-     * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the handler.</div></li>
-     * <li><b>qtip</b> : String/Object<div class="sub-desc">A tip string, or
-     * a config argument to {@link Ext.QuickTip#register}</div></li>
-     * <li><b>hidden</b> : Boolean<div class="sub-desc">True to initially render hidden.</div></li>
-     * <li><b>on</b> : Object<div class="sub-desc">A listener config object specifiying
-     * event listeners in the format of an argument to {@link #addListener}</div></li>
-     * </ul></div>
-     * <p>Note that, apart from the toggle tool which is provided when a panel is collapsible, these
-     * tools only provide the visual button. Any required functionality must be provided by adding
-     * handlers that implement the necessary behavior.</p>
-     * <p>Example usage:</p>
-     * <pre><code>
-tools:[{
-    id:'refresh',
-    qtip: 'Refresh form Data',
-    // hidden:true,
-    handler: function(event, toolEl, panel){
-        // refresh logic
-    }
-},
-{
-    id:'help',
-    qtip: 'Get Help',
-    handler: function(event, toolEl, panel){
-        // whatever
-    }
-}]
-</code></pre>
-     * <p>For the custom id of <tt>'help'</tt> define two relevant css classes with a link to
-     * a 15x15 image:</p>
-     * <pre><code>
-.x-tool-help {background-image: url(images/help.png);}
-.x-tool-help-over {background-image: url(images/help_over.png);}
-// if using an image sprite:
-.x-tool-help {background-image: url(images/help.png) no-repeat 0 0;}
-.x-tool-help-over {background-position:-15px 0;}
-</code></pre>
-     */
-    /**
-     * @cfg {Ext.Template/Ext.XTemplate} toolTemplate
-     * <p>A Template used to create {@link #tools} in the {@link #header} Element. Defaults to:</p><pre><code>
-new Ext.Template('&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>')</code></pre>
-     * <p>This may may be overridden to provide a custom DOM structure for tools based upon a more
-     * complex XTemplate. The template's data is a single tool configuration object (Not the entire Array)
-     * as specified in {@link #tools}.  In the following example an &lt;a> tag is used to provide a
-     * visual indication when hovering over the tool:</p><pre><code>
-var win = new Ext.Window({
-    tools: [{
-        id: 'download',
-        href: '/MyPdfDoc.pdf'
-    }],
-    toolTemplate: new Ext.XTemplate(
-        '&lt;tpl if="id==\'download\'">',
-            '&lt;a class="x-tool x-tool-pdf" href="{href}">&lt;/a>',
-        '&lt;/tpl>',
-        '&lt;tpl if="id!=\'download\'">',
-            '&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>',
-        '&lt;/tpl>'
-    ),
-    width:500,
-    height:300,
-    closeAction:'hide'
-});</code></pre>
-     * <p>Note that the CSS class "x-tool-pdf" should have an associated style rule which provides an
-     * appropriate background image, something like:</p>
-    <pre><code>
-    a.x-tool-pdf {background-image: url(../shared/extjs/images/pdf.gif)!important;}
-    </code></pre>
-     */
-    /**
-     * @cfg {Boolean} hideCollapseTool
-     * <tt>true</tt> to hide the expand/collapse toggle button when <code>{@link #collapsible} == true</code>,
-     * <tt>false</tt> to display it (defaults to <tt>false</tt>).
-     */
-    /**
-     * @cfg {Boolean} titleCollapse
-     * <tt>true</tt> to allow expanding and collapsing the panel (when <tt>{@link #collapsible} = true</tt>)
-     * by clicking anywhere in the header bar, <tt>false</tt>) to allow it only by clicking to tool button
-     * (defaults to <tt>false</tt>)). If this panel is a child item of a border layout also see the
-     * {@link Ext.layout.BorderLayout.Region BorderLayout.Region}
-     * <tt>{@link Ext.layout.BorderLayout.Region#floatable floatable}</tt> config option.
-     */
-    /**
-     * @cfg {Boolean} autoScroll
-     * <tt>true</tt> to use overflow:'auto' on the panel's body element and show scroll bars automatically when
-     * necessary, <tt>false</tt> to clip any overflowing content (defaults to <tt>false</tt>).
-     */
-    /**
-     * @cfg {Mixed} floating
-     * <p>This property is used to configure the underlying {@link Ext.Layer}. Acceptable values for this
-     * configuration property are:</p><div class="mdetail-params"><ul>
-     * <li><b><tt>false</tt></b> : <b>Default.</b><div class="sub-desc">Display the panel inline where it is
-     * rendered.</div></li>
-     * <li><b><tt>true</tt></b> : <div class="sub-desc">Float the panel (absolute position it with automatic
-     * shimming and shadow).<ul>
-     * <div class="sub-desc">Setting floating to true will create an Ext.Layer for this panel and display the
-     * panel at negative offsets so that it is hidden.</div>
-     * <div class="sub-desc">Since the panel will be absolute positioned, the position must be set explicitly
-     * <i>after</i> render (e.g., <tt>myPanel.setPosition(100,100);</tt>).</div>
-     * <div class="sub-desc"><b>Note</b>: when floating a panel you should always assign a fixed width,
-     * otherwise it will be auto width and will expand to fill to the right edge of the viewport.</div>
-     * </ul></div></li>
-     * <li><b><tt>{@link Ext.Layer object}</tt></b> : <div class="sub-desc">The specified object will be used
-     * as the configuration object for the {@link Ext.Layer} that will be created.</div></li>
-     * </ul></div>
-     */
-    /**
-     * @cfg {Boolean/String} shadow
-     * <tt>true</tt> (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the
-     * panel, <tt>false</tt> to display no shadow (defaults to <tt>'sides'</tt>).  Note that this option
-     * only applies when <tt>{@link #floating} = true</tt>.
-     */
-    /**
-     * @cfg {Number} shadowOffset
-     * The number of pixels to offset the shadow if displayed (defaults to <tt>4</tt>). Note that this
-     * option only applies when <tt>{@link #floating} = true</tt>.
-     */
-    /**
-     * @cfg {Boolean} shim
-     * <tt>false</tt> to disable the iframe shim in browsers which need one (defaults to <tt>true</tt>).
-     * Note that this option only applies when <tt>{@link #floating} = true</tt>.
-     */
     /**
-     * @cfg {String/Object} html
-     * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use as the panel's body
-     * content (defaults to ''). The HTML content is added by the Panel's {@link #afterRender} method,
-     * and so the document will not contain this HTML at the time the {@link #render} event is fired.
-     * This content is inserted into the body <i>before</i> any configured {@link #contentEl} is appended.
+     * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
+     * @param {Boolean} colon (optional) true to separate the hours and minutes with a colon (defaults to false).
+     * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
      */
+    getGMTOffset : function(colon) {
+        return (this.getTimezoneOffset() > 0 ? "-" : "+")
+            + String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset()) / 60), 2, "0")
+            + (colon ? ":" : "")
+            + String.leftPad(Math.abs(this.getTimezoneOffset() % 60), 2, "0");
+    },
+
     /**
-     * @cfg {String} contentEl
-     * <p>Specify the <tt>id</tt> of an existing HTML node to use as the panel's body content
-     * (defaults to '').</p><div><ul>
-     * <li><b>Description</b> : <ul>
-     * <div class="sub-desc">This config option is used to take an existing HTML element and place it in the body
-     * of a new panel (it simply moves the specified DOM element into the body element of the Panel
-     * <i>when the Panel is rendered</i> to use as the content (it is not going to be the
-     * actual panel itself).</div>
-     * </ul></li>
-     * <li><b>Notes</b> : <ul>
-     * <div class="sub-desc">The specified HTML Element is appended to the Panel's {@link #body} Element by the
-     * Panel's {@link #afterRender} method <i>after any configured {@link #html HTML} has
-     * been inserted</i>, and so the document will not contain this HTML at the time the
-     * {@link #render} event is fired.</div>
-     * <div class="sub-desc">The specified HTML element used will not participate in any layout scheme that the
-     * Panel may use. It's just HTML. Layouts operate on child items.</div>
-     * <div class="sub-desc">Add either the <tt>x-hidden</tt> or the <tt>x-hide-display</tt> CSS class to
-     * prevent a brief flicker of the content before it is rendered to the panel.</div>
-     * </ul></li>
-     * </ul></div>
+     * Get the numeric day number of the year, adjusted for leap year.
+     * @return {Number} 0 to 364 (365 in leap years).
      */
+    getDayOfYear: function() {
+        var num = 0,
+            d = this.clone(),
+            m = this.getMonth(),
+            i;
+
+        for (i = 0, d.setDate(1), d.setMonth(0); i < m; d.setMonth(++i)) {
+            num += d.getDaysInMonth();
+        }
+        return num + this.getDate() - 1;
+    },
+
     /**
-     * @cfg {Object/Array} keys
-     * A {@link Ext.KeyMap} config object (in the format expected by {@link Ext.KeyMap#addBinding}
-     * used to assign custom key handling to this panel (defaults to <tt>null</tt>).
+     * Get the numeric ISO-8601 week number of the year.
+     * (equivalent to the format specifier 'W', but without a leading zero).
+     * @return {Number} 1 to 53
      */
-    /**
-     * @cfg {Boolean/Object} draggable
-     * <p><tt>true</tt> to enable dragging of this Panel (defaults to <tt>false</tt>).</p>
-     * <p>For custom drag/drop implementations, an <b>Ext.Panel.DD</b> config could also be passed
-     * in this config instead of <tt>true</tt>. Ext.Panel.DD is an internal, undocumented class which
-     * moves a proxy Element around in place of the Panel's element, but provides no other behaviour
-     * during dragging or on drop. It is a subclass of {@link Ext.dd.DragSource}, so behaviour may be
-     * added by implementing the interface methods of {@link Ext.dd.DragDrop} e.g.:
-     * <pre><code>
-new Ext.Panel({
-    title: 'Drag me',
-    x: 100,
-    y: 100,
-    renderTo: Ext.getBody(),
-    floating: true,
-    frame: true,
-    width: 400,
-    height: 200,
-    draggable: {
-//      Config option of Ext.Panel.DD class.
-//      It&#39;s a floating Panel, so do not show a placeholder proxy in the original position.
-        insertProxy: false,
-
-//      Called for each mousemove event while dragging the DD object.
-        onDrag : function(e){
-//          Record the x,y position of the drag proxy so that we can
-//          position the Panel at end of drag.
-            var pel = this.proxy.getEl();
-            this.x = pel.getLeft(true);
-            this.y = pel.getTop(true);
+    getWeekOfYear : function() {
+        // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
+        var ms1d = 864e5, // milliseconds in a day
+            ms7d = 7 * ms1d; // milliseconds in a week
 
-//          Keep the Shadow aligned if there is one.
-            var s = this.panel.getEl().shadow;
-            if (s) {
-                s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
-            }
-        },
+        return function() { // return a closure so constants get calculated only once
+            var DC3 = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate() + 3) / ms1d, // an Absolute Day Number
+                AWN = Math.floor(DC3 / 7), // an Absolute Week Number
+                Wyr = new Date(AWN * ms7d).getUTCFullYear();
 
-//      Called on the mouseup event.
-        endDrag : function(e){
-            this.panel.setPosition(this.x, this.y);
+            return AWN - Math.floor(Date.UTC(Wyr, 0, 7) / ms7d) + 1;
         }
-    }
-}).show();
-</code></pre>
-     */
+    }(),
+
     /**
-     * @cfg {String} tabTip
-     * A string to be used as innerHTML (html tags are accepted) to show in a tooltip when mousing over
-     * the tab of a Ext.Panel which is an item of a {@link Ext.TabPanel}. {@link Ext.QuickTips}.init()
-     * must be called in order for the tips to render.
+     * Checks if the current date falls within a leap year.
+     * @return {Boolean} True if the current date falls within a leap year, false otherwise.
      */
+    isLeapYear : function() {
+        var year = this.getFullYear();
+        return !!((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
+    },
+
     /**
-     * @cfg {Boolean} disabled
-     * Render this panel disabled (default is <tt>false</tt>). An important note when using the disabled
-     * config on panels is that IE will often fail to initialize the disabled mask element correectly if
-     * the panel's layout has not yet completed by the time the Panel is disabled during the render process.
-     * If you experience this issue, you may need to instead use the {@link #afterlayout} event to initialize
-     * the disabled state:
+     * Get the first day of the current month, adjusted for leap year.  The returned value
+     * is the numeric day index within the week (0-6) which can be used in conjunction with
+     * the {@link #monthNames} array to retrieve the textual day name.
+     * Example:
      * <pre><code>
-new Ext.Panel({
-    ...
-    listeners: {
-        'afterlayout': {
-            fn: function(p){
-                p.disable();
-            },
-            single: true // important, as many layouts can occur
-        }
-    }
-});
+var dt = new Date('1/10/2007');
+document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
 </code></pre>
+     * @return {Number} The day number (0-6).
      */
+    getFirstDayOfMonth : function() {
+        var day = (this.getDay() - (this.getDate() - 1)) % 7;
+        return (day < 0) ? (day + 7) : day;
+    },
+
     /**
-     * @cfg {Boolean} autoHeight
-     * <tt>true</tt> to use height:'auto', <tt>false</tt> to use fixed height (defaults to <tt>false</tt>).
-     * <b>Note</b>: Setting <tt>autoHeight:true</tt> means that the browser will manage the panel's height
-     * based on its contents, and that Ext will not manage it at all. If the panel is within a layout that
-     * manages dimensions (<tt>fit</tt>, <tt>border</tt>, etc.) then setting <tt>autoHeight:true</tt>
-     * can cause issues with scrolling and will not generally work as expected since the panel will take
-     * on the height of its contents rather than the height required by the Ext layout.
+     * Get the last day of the current month, adjusted for leap year.  The returned value
+     * is the numeric day index within the week (0-6) which can be used in conjunction with
+     * the {@link #monthNames} array to retrieve the textual day name.
+     * Example:
+     * <pre><code>
+var dt = new Date('1/10/2007');
+document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
+</code></pre>
+     * @return {Number} The day number (0-6).
      */
+    getLastDayOfMonth : function() {
+        return this.getLastDateOfMonth().getDay();
+    },
 
 
     /**
-     * @cfg {String} baseCls
-     * The base CSS class to apply to this panel's element (defaults to <tt>'x-panel'</tt>).
-     * <p>Another option available by default is to specify <tt>'x-plain'</tt> which strips all styling
-     * except for required attributes for Ext layouts to function (e.g. overflow:hidden).
-     * See <tt>{@link #unstyled}</tt> also.</p>
-     */
-    baseCls : 'x-panel',
-    /**
-     * @cfg {String} collapsedCls
-     * A CSS class to add to the panel's element after it has been collapsed (defaults to
-     * <tt>'x-panel-collapsed'</tt>).
-     */
-    collapsedCls : 'x-panel-collapsed',
-    /**
-     * @cfg {Boolean} maskDisabled
-     * <tt>true</tt> to mask the panel when it is {@link #disabled}, <tt>false</tt> to not mask it (defaults
-     * to <tt>true</tt>).  Either way, the panel will always tell its contained elements to disable themselves
-     * when it is disabled, but masking the panel can provide an additional visual cue that the panel is
-     * disabled.
-     */
-    maskDisabled : true,
-    /**
-     * @cfg {Boolean} animCollapse
-     * <tt>true</tt> to animate the transition when the panel is collapsed, <tt>false</tt> to skip the
-     * animation (defaults to <tt>true</tt> if the {@link Ext.Fx} class is available, otherwise <tt>false</tt>).
-     */
-    animCollapse : Ext.enableFx,
-    /**
-     * @cfg {Boolean} headerAsText
-     * <tt>true</tt> to display the panel <tt>{@link #title}</tt> in the <tt>{@link #header}</tt>,
-     * <tt>false</tt> to hide it (defaults to <tt>true</tt>).
-     */
-    headerAsText : true,
-    /**
-     * @cfg {String} buttonAlign
-     * The alignment of any {@link #buttons} added to this panel.  Valid values are <tt>'right'</tt>,
-     * <tt>'left'</tt> and <tt>'center'</tt> (defaults to <tt>'right'</tt>).
+     * Get the date of the first day of the month in which this date resides.
+     * @return {Date}
      */
-    buttonAlign : 'right',
+    getFirstDateOfMonth : function() {
+        return new Date(this.getFullYear(), this.getMonth(), 1);
+    },
+
     /**
-     * @cfg {Boolean} collapsed
-     * <tt>true</tt> to render the panel collapsed, <tt>false</tt> to render it expanded (defaults to
-     * <tt>false</tt>).
+     * Get the date of the last day of the month in which this date resides.
+     * @return {Date}
      */
-    collapsed : false,
+    getLastDateOfMonth : function() {
+        return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth());
+    },
+
     /**
-     * @cfg {Boolean} collapseFirst
-     * <tt>true</tt> to make sure the collapse/expand toggle button always renders first (to the left of)
-     * any other tools in the panel's title bar, <tt>false</tt> to render it last (defaults to <tt>true</tt>).
+     * Get the number of days in the current month, adjusted for leap year.
+     * @return {Number} The number of days in the month.
      */
-    collapseFirst : true,
+    getDaysInMonth: function() {
+        var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+
+        return function() { // return a closure for efficiency
+            var m = this.getMonth();
+
+            return m == 1 && this.isLeapYear() ? 29 : daysInMonth[m];
+        }
+    }(),
+
     /**
-     * @cfg {Number} minButtonWidth
-     * Minimum width in pixels of all {@link #buttons} in this panel (defaults to <tt>75</tt>)
+     * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
+     * @return {String} 'st, 'nd', 'rd' or 'th'.
      */
-    minButtonWidth : 75,
+    getSuffix : function() {
+        switch (this.getDate()) {
+            case 1:
+            case 21:
+            case 31:
+                return "st";
+            case 2:
+            case 22:
+                return "nd";
+            case 3:
+            case 23:
+                return "rd";
+            default:
+                return "th";
+        }
+    },
+
     /**
-     * @cfg {Boolean} unstyled
-     * Overrides the <tt>{@link #baseCls}</tt> setting to <tt>{@link #baseCls} = 'x-plain'</tt> which renders
-     * the panel unstyled except for required attributes for Ext layouts to function (e.g. overflow:hidden).
+     * Creates and returns a new Date instance with the exact same date value as the called instance.
+     * Dates are copied and passed by reference, so if a copied date variable is modified later, the original
+     * variable will also be changed.  When the intention is to create a new variable that will not
+     * modify the original instance, you should create a clone.
+     *
+     * Example of correctly cloning a date:
+     * <pre><code>
+//wrong way:
+var orig = new Date('10/1/2006');
+var copy = orig;
+copy.setDate(5);
+document.write(orig);  //returns 'Thu Oct 05 2006'!
+
+//correct way:
+var orig = new Date('10/1/2006');
+var copy = orig.clone();
+copy.setDate(5);
+document.write(orig);  //returns 'Thu Oct 01 2006'
+</code></pre>
+     * @return {Date} The new Date instance.
      */
+    clone : function() {
+        return new Date(this.getTime());
+    },
+
     /**
-     * @cfg {String} elements
-     * A comma-delimited list of panel elements to initialize when the panel is rendered.  Normally, this list will be
-     * generated automatically based on the items added to the panel at config time, but sometimes it might be useful to
-     * make sure a structural element is rendered even if not specified at config time (for example, you may want
-     * to add a button or toolbar dynamically after the panel has been rendered).  Adding those elements to this
-     * list will allocate the required placeholders in the panel when it is rendered.  Valid values are<div class="mdetail-params"><ul>
-     * <li><tt>header</tt></li>
-     * <li><tt>tbar</tt> (top bar)</li>
-     * <li><tt>body</tt></li>
-     * <li><tt>bbar</tt> (bottom bar)</li>
-     * <li><tt>footer</tt></li>
-     * </ul></div>
-     * Defaults to '<tt>body</tt>'.
+     * Checks if the current date is affected by Daylight Saving Time (DST).
+     * @return {Boolean} True if the current date is affected by DST.
      */
-    elements : 'body',
+    isDST : function() {
+        // adapted from http://extjs.com/forum/showthread.php?p=247172#post247172
+        // courtesy of @geoffrey.mcgill
+        return new Date(this.getFullYear(), 0, 1).getTimezoneOffset() != this.getTimezoneOffset();
+    },
+
     /**
-     * @cfg {Boolean} preventBodyReset
-     * Defaults to <tt>false</tt>.  When set to <tt>true</tt>, an extra css class <tt>'x-panel-normal'</tt>
-     * will be added to the panel's element, effectively applying css styles suggested by the W3C
-     * (see http://www.w3.org/TR/CSS21/sample.html) to the Panel's <b>body</b> element (not the header,
-     * footer, etc.).
+     * Attempts to clear all time information from this Date by setting the time to midnight of the same day,
+     * automatically adjusting for Daylight Saving Time (DST) where applicable.
+     * (note: DST timezone information for the browser's host operating system is assumed to be up-to-date)
+     * @param {Boolean} clone true to create a clone of this date, clear the time and return it (defaults to false).
+     * @return {Date} this or the clone.
      */
-    preventBodyReset : false,
+    clearTime : function(clone) {
+        if (clone) {
+            return this.clone().clearTime();
+        }
 
-    // protected - these could be used to customize the behavior of the window,
-    // but changing them would not be useful without further mofifications and
-    // could lead to unexpected or undesirable results.
-    toolTarget : 'header',
-    collapseEl : 'bwrap',
-    slideAnchor : 't',
-    disabledClass : '',
+        // get current date before clearing time
+        var d = this.getDate();
 
-    // private, notify box this class will handle heights
-    deferHeight : true,
-    // private
-    expandDefaults: {
-        duration : 0.25
-    },
-    // private
-    collapseDefaults : {
-        duration : 0.25
-    },
+        // clear time
+        this.setHours(0);
+        this.setMinutes(0);
+        this.setSeconds(0);
+        this.setMilliseconds(0);
 
-    // private
-    initComponent : function(){
-        Ext.Panel.superclass.initComponent.call(this);
+        if (this.getDate() != d) { // account for DST (i.e. day of month changed when setting hour = 0)
+            // note: DST adjustments are assumed to occur in multiples of 1 hour (this is almost always the case)
+            // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions to this rule
 
-        this.addEvents(
-            /**
-             * @event bodyresize
-             * Fires after the Panel has been resized.
-             * @param {Ext.Panel} p the Panel which has been resized.
-             * @param {Number} width The Panel's new width.
-             * @param {Number} height The Panel's new height.
-             */
-            'bodyresize',
-            /**
-             * @event titlechange
-             * Fires after the Panel title has been {@link #title set} or {@link #setTitle changed}.
-             * @param {Ext.Panel} p the Panel which has had its title changed.
-             * @param {String} The new title.
-             */
-            'titlechange',
-            /**
-             * @event iconchange
-             * Fires after the Panel icon class has been {@link #iconCls set} or {@link #setIconClass changed}.
-             * @param {Ext.Panel} p the Panel which has had its {@link #iconCls icon class} changed.
-             * @param {String} The new icon class.
-             * @param {String} The old icon class.
-             */
-            'iconchange',
-            /**
-             * @event collapse
-             * Fires after the Panel has been collapsed.
-             * @param {Ext.Panel} p the Panel that has been collapsed.
-             */
-            'collapse',
-            /**
-             * @event expand
-             * Fires after the Panel has been expanded.
-             * @param {Ext.Panel} p The Panel that has been expanded.
-             */
-            'expand',
-            /**
-             * @event beforecollapse
-             * Fires before the Panel is collapsed.  A handler can return false to cancel the collapse.
-             * @param {Ext.Panel} p the Panel being collapsed.
-             * @param {Boolean} animate True if the collapse is animated, else false.
-             */
-            'beforecollapse',
-            /**
-             * @event beforeexpand
-             * Fires before the Panel is expanded.  A handler can return false to cancel the expand.
-             * @param {Ext.Panel} p The Panel being expanded.
-             * @param {Boolean} animate True if the expand is animated, else false.
-             */
-            'beforeexpand',
-            /**
-             * @event beforeclose
-             * Fires before the Panel is closed.  Note that Panels do not directly support being closed, but some
-             * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel.  This event only
-             * applies to such subclasses.
-             * A handler can return false to cancel the close.
-             * @param {Ext.Panel} p The Panel being closed.
-             */
-            'beforeclose',
-            /**
-             * @event close
-             * Fires after the Panel is closed.  Note that Panels do not directly support being closed, but some
-             * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel.
-             * @param {Ext.Panel} p The Panel that has been closed.
-             */
-            'close',
-            /**
-             * @event activate
-             * Fires after the Panel has been visually activated.
-             * Note that Panels do not directly support being activated, but some Panel subclasses
-             * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
-             * activate and deactivate events under the control of the TabPanel.
-             * @param {Ext.Panel} p The Panel that has been activated.
-             */
-            'activate',
-            /**
-             * @event deactivate
-             * Fires after the Panel has been visually deactivated.
-             * Note that Panels do not directly support being deactivated, but some Panel subclasses
-             * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
-             * activate and deactivate events under the control of the TabPanel.
-             * @param {Ext.Panel} p The Panel that has been deactivated.
-             */
-            'deactivate'
-        );
+            // increment hour until cloned date == current date
+            for (var hr = 1, c = this.add(Date.HOUR, hr); c.getDate() != d; hr++, c = this.add(Date.HOUR, hr));
 
-        if(this.unstyled){
-            this.baseCls = 'x-plain';
+            this.setDate(d);
+            this.setHours(c.getHours());
         }
 
-        // shortcuts
-        if(this.tbar){
-            this.elements += ',tbar';
-            if(Ext.isObject(this.tbar)){
-                this.topToolbar = this.tbar;
-            }
-            delete this.tbar;
-        }
-        if(this.bbar){
-            this.elements += ',bbar';
-            if(Ext.isObject(this.bbar)){
-                this.bottomToolbar = this.bbar;
-            }
-            delete this.bbar;
-        }
+        return this;
+    },
 
-        if(this.header === true){
-            this.elements += ',header';
-            delete this.header;
-        }else if(this.headerCfg || (this.title && this.header !== false)){
-            this.elements += ',header';
-        }
+    /**
+     * Provides a convenient method for performing basic date arithmetic. This method
+     * does not modify the Date instance being called - it creates and returns
+     * a new Date instance containing the resulting date value.
+     *
+     * Examples:
+     * <pre><code>
+// Basic usage:
+var dt = new Date('10/29/2006').add(Date.DAY, 5);
+document.write(dt); //returns 'Fri Nov 03 2006 00:00:00'
 
-        if(this.footerCfg || this.footer === true){
-            this.elements += ',footer';
-            delete this.footer;
-        }
+// Negative values will be subtracted:
+var dt2 = new Date('10/1/2006').add(Date.DAY, -5);
+document.write(dt2); //returns 'Tue Sep 26 2006 00:00:00'
 
-        if(this.buttons){
-            this.elements += ',footer';
-            var btns = this.buttons;
-            /**
-             * This Panel's Array of buttons as created from the <tt>{@link #buttons}</tt>
-             * config property. Read only.
-             * @type Array
-             * @property buttons
-             */
-            this.buttons = [];
-            for(var i = 0, len = btns.length; i < len; i++) {
-                if(btns[i].render){ // button instance
-                    this.buttons.push(btns[i]);
-                }else if(btns[i].xtype){
-                    this.buttons.push(Ext.create(btns[i], 'button'));
-                }else{
-                    this.addButton(btns[i]);
+// You can even chain several calls together in one line:
+var dt3 = new Date('10/1/2006').add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
+document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
+</code></pre>
+     *
+     * @param {String} interval A valid date interval enum value.
+     * @param {Number} value The amount to add to the current date.
+     * @return {Date} The new Date instance.
+     */
+    add : function(interval, value) {
+        var d = this.clone();
+        if (!interval || value === 0) return d;
+
+        switch(interval.toLowerCase()) {
+            case Date.MILLI:
+                d.setMilliseconds(this.getMilliseconds() + value);
+                break;
+            case Date.SECOND:
+                d.setSeconds(this.getSeconds() + value);
+                break;
+            case Date.MINUTE:
+                d.setMinutes(this.getMinutes() + value);
+                break;
+            case Date.HOUR:
+                d.setHours(this.getHours() + value);
+                break;
+            case Date.DAY:
+                d.setDate(this.getDate() + value);
+                break;
+            case Date.MONTH:
+                var day = this.getDate();
+                if (day > 28) {
+                    day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
                 }
-            }
-        }
-        if(this.fbar){
-            this.elements += ',footer';
-        }
-        if(this.autoLoad){
-            this.on('render', this.doAutoLoad, this, {delay:10});
+                d.setDate(day);
+                d.setMonth(this.getMonth() + value);
+                break;
+            case Date.YEAR:
+                d.setFullYear(this.getFullYear() + value);
+                break;
         }
+        return d;
     },
 
-    // private
-    createElement : function(name, pnode){
-        if(this[name]){
-            pnode.appendChild(this[name].dom);
-            return;
-        }
-
-        if(name === 'bwrap' || this.elements.indexOf(name) != -1){
-            if(this[name+'Cfg']){
-                this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']);
-            }else{
-                var el = document.createElement('div');
-                el.className = this[name+'Cls'];
-                this[name] = Ext.get(pnode.appendChild(el));
-            }
-            if(this[name+'CssClass']){
-                this[name].addClass(this[name+'CssClass']);
-            }
-            if(this[name+'Style']){
-                this[name].applyStyles(this[name+'Style']);
-            }
-        }
-    },
+    /**
+     * Checks if this date falls on or between the given start and end dates.
+     * @param {Date} start Start date
+     * @param {Date} end End date
+     * @return {Boolean} true if this date falls on or between the given start and end dates.
+     */
+    between : function(start, end) {
+        var t = this.getTime();
+        return start.getTime() <= t && t <= end.getTime();
+    }
+});
 
-    // private
-    onRender : function(ct, position){
-        Ext.Panel.superclass.onRender.call(this, ct, position);
-        this.createClasses();
 
-        var el = this.el,
-            d = el.dom,
-            bw;
-        el.addClass(this.baseCls);
-        if(d.firstChild){ // existing markup
-            this.header = el.down('.'+this.headerCls);
-            this.bwrap = el.down('.'+this.bwrapCls);
-            var cp = this.bwrap ? this.bwrap : el;
-            this.tbar = cp.down('.'+this.tbarCls);
-            this.body = cp.down('.'+this.bodyCls);
-            this.bbar = cp.down('.'+this.bbarCls);
-            this.footer = cp.down('.'+this.footerCls);
-            this.fromMarkup = true;
-        }
-        if (this.preventBodyReset === true) {
-            el.addClass('x-panel-reset');
-        }
-        if(this.cls){
-            el.addClass(this.cls);
-        }
+/**
+ * Formats a date given the supplied format string.
+ * @param {String} format The format string.
+ * @return {String} The formatted date.
+ * @method format
+ */
+Date.prototype.format = Date.prototype.dateFormat;
 
-        if(this.buttons){
-            this.elements += ',footer';
-        }
 
-        // This block allows for maximum flexibility and performance when using existing markup
+// private
+if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420) {
+    Ext.apply(Date.prototype, {
+        _xMonth : Date.prototype.setMonth,
+        _xDate  : Date.prototype.setDate,
 
-        // framing requires special markup
-        if(this.frame){
-            el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls));
+        // Bug in Safari 1.3, 2.0 (WebKit build < 420)
+        // Date.setMonth does not work consistently if iMonth is not 0-11
+        setMonth : function(num) {
+            if (num <= -1) {
+                var n = Math.ceil(-num),
+                    back_year = Math.ceil(n / 12),
+                    month = (n % 12) ? 12 - n % 12 : 0;
 
-            this.createElement('header', d.firstChild.firstChild.firstChild);
-            this.createElement('bwrap', d);
+                this.setFullYear(this.getFullYear() - back_year);
 
-            // append the mid and bottom frame to the bwrap
-            bw = this.bwrap.dom;
-            var ml = d.childNodes[1], bl = d.childNodes[2];
-            bw.appendChild(ml);
-            bw.appendChild(bl);
+                return this._xMonth(month);
+            } else {
+                return this._xMonth(num);
+            }
+        },
 
-            var mc = bw.firstChild.firstChild.firstChild;
-            this.createElement('tbar', mc);
-            this.createElement('body', mc);
-            this.createElement('bbar', mc);
-            this.createElement('footer', bw.lastChild.firstChild.firstChild);
+        // Bug in setDate() method (resolved in WebKit build 419.3, so to be safe we target Webkit builds < 420)
+        // The parameter for Date.setDate() is converted to a signed byte integer in Safari
+        // http://brianary.blogspot.com/2006/03/safari-date-bug.html
+        setDate : function(d) {
+            // use setTime() to workaround setDate() bug
+            // subtract current day of month in milliseconds, then add desired day of month in milliseconds
+            return this.setTime(this.getTime() - (this.getDate() - d) * 864e5);
+        }
+    });
+}
 
-            if(!this.footer){
-                this.bwrap.dom.lastChild.className += ' x-panel-nofooter';
-            }
-        }else{
-            this.createElement('header', d);
-            this.createElement('bwrap', d);
 
-            // append the mid and bottom frame to the bwrap
-            bw = this.bwrap.dom;
-            this.createElement('tbar', bw);
-            this.createElement('body', bw);
-            this.createElement('bbar', bw);
-            this.createElement('footer', bw);
 
-            if(!this.header){
-                this.body.addClass(this.bodyCls + '-noheader');
-                if(this.tbar){
-                    this.tbar.addClass(this.tbarCls + '-noheader');
-                }
-            }
-        }
+/* Some basic Date tests... (requires Firebug)
 
-        if(this.padding !== undefined) {
-            this.body.setStyle('padding', this.body.addUnits(this.padding));
-        }
+Date.parseDate('', 'c'); // call Date.parseDate() once to force computation of regex string so we can console.log() it
+console.log('Insane Regex for "c" format: %o', Date.parseCodes.c.s); // view the insane regex for the "c" format specifier
 
-        if(this.border === false){
-            this.el.addClass(this.baseCls + '-noborder');
-            this.body.addClass(this.bodyCls + '-noborder');
-            if(this.header){
-                this.header.addClass(this.headerCls + '-noborder');
-            }
-            if(this.footer){
-                this.footer.addClass(this.footerCls + '-noborder');
-            }
-            if(this.tbar){
-                this.tbar.addClass(this.tbarCls + '-noborder');
-            }
-            if(this.bbar){
-                this.bbar.addClass(this.bbarCls + '-noborder');
-            }
-        }
+// standard tests
+console.group('Standard Date.parseDate() Tests');
+    console.log('Date.parseDate("2009-01-05T11:38:56", "c")               = %o', Date.parseDate("2009-01-05T11:38:56", "c")); // assumes browser's timezone setting
+    console.log('Date.parseDate("2009-02-04T12:37:55.001000", "c")        = %o', Date.parseDate("2009-02-04T12:37:55.001000", "c")); // assumes browser's timezone setting
+    console.log('Date.parseDate("2009-03-03T13:36:54,101000Z", "c")       = %o', Date.parseDate("2009-03-03T13:36:54,101000Z", "c")); // UTC
+    console.log('Date.parseDate("2009-04-02T14:35:53.901000-0530", "c")   = %o', Date.parseDate("2009-04-02T14:35:53.901000-0530", "c")); // GMT-0530
+    console.log('Date.parseDate("2009-05-01T15:34:52,9876000+08:00", "c") = %o', Date.parseDate("2009-05-01T15:34:52,987600+08:00", "c")); // GMT+08:00
+console.groupEnd();
 
-        if(this.bodyBorder === false){
-           this.body.addClass(this.bodyCls + '-noborder');
-        }
+// ISO-8601 format as specified in http://www.w3.org/TR/NOTE-datetime
+// -- accepts ALL 6 levels of date-time granularity
+console.group('ISO-8601 Granularity Test (see http://www.w3.org/TR/NOTE-datetime)');
+    console.log('Date.parseDate("1997", "c")                              = %o', Date.parseDate("1997", "c")); // YYYY (e.g. 1997)
+    console.log('Date.parseDate("1997-07", "c")                           = %o', Date.parseDate("1997-07", "c")); // YYYY-MM (e.g. 1997-07)
+    console.log('Date.parseDate("1997-07-16", "c")                        = %o', Date.parseDate("1997-07-16", "c")); // YYYY-MM-DD (e.g. 1997-07-16)
+    console.log('Date.parseDate("1997-07-16T19:20+01:00", "c")            = %o', Date.parseDate("1997-07-16T19:20+01:00", "c")); // YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00)
+    console.log('Date.parseDate("1997-07-16T19:20:30+01:00", "c")         = %o', Date.parseDate("1997-07-16T19:20:30+01:00", "c")); // YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00)
+    console.log('Date.parseDate("1997-07-16T19:20:30.45+01:00", "c")      = %o', Date.parseDate("1997-07-16T19:20:30.45+01:00", "c")); // YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00)
+    console.log('Date.parseDate("1997-07-16 19:20:30.45+01:00", "c")      = %o', Date.parseDate("1997-07-16 19:20:30.45+01:00", "c")); // YYYY-MM-DD hh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00)
+    console.log('Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)= %o', Date.parseDate("1997-13-16T19:20:30.45+01:00", "c", true)); // strict date parsing with invalid month value
+console.groupEnd();
 
-        this.bwrap.enableDisplayMode('block');
+//*//**
+ * @class Ext.util.MixedCollection
+ * @extends Ext.util.Observable
+ * A Collection class that maintains both numeric indexes and keys and exposes events.
+ * @constructor
+ * @param {Boolean} allowFunctions Specify <tt>true</tt> if the {@link #addAll}
+ * function should add function references to the collection. Defaults to
+ * <tt>false</tt>.
+ * @param {Function} keyFn A function that can accept an item of the type(s) stored in this MixedCollection
+ * and return the key value for that item.  This is used when available to look up the key on items that
+ * were passed without an explicit key parameter to a MixedCollection method.  Passing this parameter is
+ * equivalent to providing an implementation for the {@link #getKey} method.
+ */
+Ext.util.MixedCollection = function(allowFunctions, keyFn){
+    this.items = [];
+    this.map = {};
+    this.keys = [];
+    this.length = 0;
+    this.addEvents(
+        /**
+         * @event clear
+         * Fires when the collection is cleared.
+         */
+        'clear',
+        /**
+         * @event add
+         * Fires when an item is added to the collection.
+         * @param {Number} index The index at which the item was added.
+         * @param {Object} o The item added.
+         * @param {String} key The key associated with the added item.
+         */
+        'add',
+        /**
+         * @event replace
+         * Fires when an item is replaced in the collection.
+         * @param {String} key he key associated with the new added.
+         * @param {Object} old The item being replaced.
+         * @param {Object} new The new item.
+         */
+        'replace',
+        /**
+         * @event remove
+         * Fires when an item is removed from the collection.
+         * @param {Object} o The item being removed.
+         * @param {String} key (optional) The key associated with the removed item.
+         */
+        'remove',
+        'sort'
+    );
+    this.allowFunctions = allowFunctions === true;
+    if(keyFn){
+        this.getKey = keyFn;
+    }
+    Ext.util.MixedCollection.superclass.constructor.call(this);
+};
 
-        if(this.header){
-            this.header.unselectable();
+Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {
 
-            // for tools, we need to wrap any existing header markup
-            if(this.headerAsText){
-                this.header.dom.innerHTML =
-                    '<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>';
+    /**
+     * @cfg {Boolean} allowFunctions Specify <tt>true</tt> if the {@link #addAll}
+     * function should add function references to the collection. Defaults to
+     * <tt>false</tt>.
+     */
+    allowFunctions : false,
 
-                if(this.iconCls){
-                    this.setIconClass(this.iconCls);
-                }
+    /**
+     * Adds an item to the collection. Fires the {@link #add} event when complete.
+     * @param {String} key <p>The key to associate with the item, or the new item.</p>
+     * <p>If a {@link #getKey} implementation was specified for this MixedCollection,
+     * or if the key of the stored items is in a property called <tt><b>id</b></tt>,
+     * the MixedCollection will be able to <i>derive</i> the key for the new item.
+     * In this case just pass the new item in this parameter.</p>
+     * @param {Object} o The item to add.
+     * @return {Object} The item added.
+     */
+    add : function(key, o){
+        if(arguments.length == 1){
+            o = arguments[0];
+            key = this.getKey(o);
+        }
+        if(typeof key != 'undefined' && key !== null){
+            var old = this.map[key];
+            if(typeof old != 'undefined'){
+                return this.replace(key, o);
             }
+            this.map[key] = o;
         }
+        this.length++;
+        this.items.push(o);
+        this.keys.push(key);
+        this.fireEvent('add', this.length-1, o, key);
+        return o;
+    },
 
-        if(this.floating){
-            this.makeFloating(this.floating);
-        }
+    /**
+      * MixedCollection has a generic way to fetch keys if you implement getKey.  The default implementation
+      * simply returns <b><code>item.id</code></b> but you can provide your own implementation
+      * to return a different value as in the following examples:<pre><code>
+// normal way
+var mc = new Ext.util.MixedCollection();
+mc.add(someEl.dom.id, someEl);
+mc.add(otherEl.dom.id, otherEl);
+//and so on
 
-        if(this.collapsible){
-            this.tools = this.tools ? this.tools.slice(0) : [];
-            if(!this.hideCollapseTool){
-                this.tools[this.collapseFirst?'unshift':'push']({
-                    id: 'toggle',
-                    handler : this.toggleCollapse,
-                    scope: this
-                });
-            }
-            if(this.titleCollapse && this.header){
-                this.mon(this.header, 'click', this.toggleCollapse, this);
-                this.header.setStyle('cursor', 'pointer');
-            }
-        }
-        if(this.tools){
-            var ts = this.tools;
-            this.tools = {};
-            this.addTool.apply(this, ts);
-        }else{
-            this.tools = {};
-        }
+// using getKey
+var mc = new Ext.util.MixedCollection();
+mc.getKey = function(el){
+   return el.dom.id;
+};
+mc.add(someEl);
+mc.add(otherEl);
+
+// or via the constructor
+var mc = new Ext.util.MixedCollection(false, function(el){
+   return el.dom.id;
+});
+mc.add(someEl);
+mc.add(otherEl);
+     * </code></pre>
+     * @param {Object} item The item for which to find the key.
+     * @return {Object} The key for the passed item.
+     */
+    getKey : function(o){
+         return o.id;
+    },
 
-        if(this.buttons && this.buttons.length > 0){
-            this.fbar = new Ext.Toolbar({
-                items: this.buttons,
-                toolbarCls: 'x-panel-fbar'
-            });
+    /**
+     * Replaces an item in the collection. Fires the {@link #replace} event when complete.
+     * @param {String} key <p>The key associated with the item to replace, or the replacement item.</p>
+     * <p>If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key
+     * of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection
+     * will be able to <i>derive</i> the key of the replacement item. If you want to replace an item
+     * with one having the same key value, then just pass the replacement item in this parameter.</p>
+     * @param o {Object} o (optional) If the first parameter passed was a key, the item to associate
+     * with that key.
+     * @return {Object}  The new item.
+     */
+    replace : function(key, o){
+        if(arguments.length == 1){
+            o = arguments[0];
+            key = this.getKey(o);
         }
-        this.toolbars = [];
-        if(this.fbar){
-            this.fbar = Ext.create(this.fbar, 'toolbar');
-            this.fbar.enableOverflow = false;
-            if(this.fbar.items){
-                this.fbar.items.each(function(c){
-                    c.minWidth = c.minWidth || this.minButtonWidth;
-                }, this);
-            }
-            this.fbar.toolbarCls = 'x-panel-fbar';
-
-            var bct = this.footer.createChild({cls: 'x-panel-btns x-panel-btns-'+this.buttonAlign});
-            this.fbar.ownerCt = this;
-            this.fbar.render(bct);
-            bct.createChild({cls:'x-clear'});
-            this.toolbars.push(this.fbar);
+        var old = this.map[key];
+        if(typeof key == 'undefined' || key === null || typeof old == 'undefined'){
+             return this.add(key, o);
         }
+        var index = this.indexOfKey(key);
+        this.items[index] = o;
+        this.map[key] = o;
+        this.fireEvent('replace', key, old, o);
+        return o;
+    },
 
-        if(this.tbar && this.topToolbar){
-            if(Ext.isArray(this.topToolbar)){
-                this.topToolbar = new Ext.Toolbar(this.topToolbar);
-            }else if(!this.topToolbar.events){
-                this.topToolbar = Ext.create(this.topToolbar, 'toolbar');
+    /**
+     * Adds all elements of an Array or an Object to the collection.
+     * @param {Object/Array} objs An Object containing properties which will be added
+     * to the collection, or an Array of values, each of which are added to the collection.
+     * Functions references will be added to the collection if <code>{@link #allowFunctions}</code>
+     * has been set to <tt>true</tt>.
+     */
+    addAll : function(objs){
+        if(arguments.length > 1 || Ext.isArray(objs)){
+            var args = arguments.length > 1 ? arguments : objs;
+            for(var i = 0, len = args.length; i < len; i++){
+                this.add(args[i]);
             }
-            this.topToolbar.ownerCt = this;
-            this.topToolbar.render(this.tbar);
-            this.toolbars.push(this.topToolbar);
-        }
-        if(this.bbar && this.bottomToolbar){
-            if(Ext.isArray(this.bottomToolbar)){
-                this.bottomToolbar = new Ext.Toolbar(this.bottomToolbar);
-            }else if(!this.bottomToolbar.events){
-                this.bottomToolbar = Ext.create(this.bottomToolbar, 'toolbar');
+        }else{
+            for(var key in objs){
+                if(this.allowFunctions || typeof objs[key] != 'function'){
+                    this.add(key, objs[key]);
+                }
             }
-            this.bottomToolbar.ownerCt = this;
-            this.bottomToolbar.render(this.bbar);
-            this.toolbars.push(this.bottomToolbar);
         }
-        Ext.each(this.toolbars, function(tb){
-            tb.on({
-                scope: this,
-                afterlayout: this.syncHeight,
-                remove: this.syncHeight
-            });
-        }, this);
     },
 
     /**
-     * Sets the CSS class that provides the icon image for this panel.  This method will replace any existing
-     * icon class if one has already been set and fire the {@link #iconchange} event after completion.
-     * @param {String} cls The new CSS class name
+     * Executes the specified function once for every item in the collection, passing the following arguments:
+     * <div class="mdetail-params"><ul>
+     * <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li>
+     * <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li>
+     * <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li>
+     * </ul></div>
+     * The function should return a boolean value. Returning false from the function will stop the iteration.
+     * @param {Function} fn The function to execute for each item.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current item in the iteration.
      */
-    setIconClass : function(cls){
-        var old = this.iconCls;
-        this.iconCls = cls;
-        if(this.rendered && this.header){
-            if(this.frame){
-                this.header.addClass('x-panel-icon');
-                this.header.replaceClass(old, this.iconCls);
-            }else{
-                var hd = this.header.dom;
-                var img = hd.firstChild && String(hd.firstChild.tagName).toLowerCase() == 'img' ? hd.firstChild : null;
-                if(img){
-                    Ext.fly(img).replaceClass(old, this.iconCls);
-                }else{
-                    Ext.DomHelper.insertBefore(hd.firstChild, {
-                        tag:'img', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls
-                    });
-                 }
+    each : function(fn, scope){
+        var items = [].concat(this.items); // each safe for removal
+        for(var i = 0, len = items.length; i < len; i++){
+            if(fn.call(scope || items[i], items[i], i, len) === false){
+                break;
             }
         }
-        this.fireEvent('iconchange', this, cls, old);
-    },
-
-    // private
-    makeFloating : function(cfg){
-        this.floating = true;
-        this.el = new Ext.Layer(
-            Ext.isObject(cfg) ? cfg : {
-                shadow: this.shadow !== undefined ? this.shadow : 'sides',
-                shadowOffset: this.shadowOffset,
-                constrain:false,
-                shim: this.shim === false ? false : undefined
-            }, this.el
-        );
     },
 
     /**
-     * Returns the {@link Ext.Toolbar toolbar} from the top (<tt>{@link #tbar}</tt>) section of the panel.
-     * @return {Ext.Toolbar} The toolbar
+     * Executes the specified function once for every key in the collection, passing each
+     * key, and its associated item as the first two parameters.
+     * @param {Function} fn The function to execute for each item.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the browser window.
      */
-    getTopToolbar : function(){
-        return this.topToolbar;
+    eachKey : function(fn, scope){
+        for(var i = 0, len = this.keys.length; i < len; i++){
+            fn.call(scope || window, this.keys[i], this.items[i], i, len);
+        }
     },
 
     /**
-     * Returns the {@link Ext.Toolbar toolbar} from the bottom (<tt>{@link #bbar}</tt>) section of the panel.
-     * @return {Ext.Toolbar} The toolbar
+     * Returns the first item in the collection which elicits a true return value from the
+     * passed selection function.
+     * @param {Function} fn The selection function to execute for each item.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the browser window.
+     * @return {Object} The first item in the collection which returned true from the selection function.
      */
-    getBottomToolbar : function(){
-        return this.bottomToolbar;
+    find : function(fn, scope){
+        for(var i = 0, len = this.items.length; i < len; i++){
+            if(fn.call(scope || window, this.items[i], this.keys[i])){
+                return this.items[i];
+            }
+        }
+        return null;
     },
 
     /**
-     * Adds a button to this panel.  Note that this method must be called prior to rendering.  The preferred
-     * approach is to add buttons via the {@link #buttons} config.
-     * @param {String/Object} config A valid {@link Ext.Button} config.  A string will become the text for a default
-     * button config, an object will be treated as a button config object.
-     * @param {Function} handler The function to be called on button {@link Ext.Button#click}
-     * @param {Object} scope The scope to use for the button handler function
-     * @return {Ext.Button} The button that was added
+     * Inserts an item at the specified index in the collection. Fires the {@link #add} event when complete.
+     * @param {Number} index The index to insert the item at.
+     * @param {String} key The key to associate with the new item, or the item itself.
+     * @param {Object} o (optional) If the second parameter was a key, the new item.
+     * @return {Object} The item inserted.
      */
-    addButton : function(config, handler, scope){
-        var bc = {
-            handler: handler,
-            scope: scope,
-            minWidth: this.minButtonWidth,
-            hideParent:true
-        };
-        if(typeof config == "string"){
-            bc.text = config;
-        }else{
-            Ext.apply(bc, config);
+    insert : function(index, key, o){
+        if(arguments.length == 2){
+            o = arguments[1];
+            key = this.getKey(o);
         }
-        var btn = new Ext.Button(bc);
-        if(!this.buttons){
-            this.buttons = [];
-        }
-        this.buttons.push(btn);
-        return btn;
-    },
-
-    // private
-    addTool : function(){
-        if(!this[this.toolTarget]) { // no where to render tools!
-            return;
+        if(this.containsKey(key)){
+            this.suspendEvents();
+            this.removeKey(key);
+            this.resumeEvents();
         }
-        if(!this.toolTemplate){
-            // initialize the global tool template on first use
-            var tt = new Ext.Template(
-                 '<div class="x-tool x-tool-{id}">&#160;</div>'
-            );
-            tt.disableFormats = true;
-            tt.compile();
-            Ext.Panel.prototype.toolTemplate = tt;
+        if(index >= this.length){
+            return this.add(key, o);
         }
-        for(var i = 0, a = arguments, len = a.length; i < len; i++) {
-            var tc = a[i];
-            if(!this.tools[tc.id]){
-                var overCls = 'x-tool-'+tc.id+'-over';
-                var t = this.toolTemplate.insertFirst((tc.align !== 'left') ? this[this.toolTarget] : this[this.toolTarget].child('span'), tc, true);
-                this.tools[tc.id] = t;
-                t.enableDisplayMode('block');
-                this.mon(t, 'click',  this.createToolHandler(t, tc, overCls, this));
-                if(tc.on){
-                    this.mon(t, tc.on);
-                }
-                if(tc.hidden){
-                    t.hide();
-                }
-                if(tc.qtip){
-                    if(Ext.isObject(tc.qtip)){
-                        Ext.QuickTips.register(Ext.apply({
-                              target: t.id
-                        }, tc.qtip));
-                    } else {
-                        t.dom.qtip = tc.qtip;
-                    }
-                }
-                t.addClassOnOver(overCls);
-            }
+        this.length++;
+        this.items.splice(index, 0, o);
+        if(typeof key != 'undefined' && key !== null){
+            this.map[key] = o;
         }
+        this.keys.splice(index, 0, key);
+        this.fireEvent('add', index, o, key);
+        return o;
     },
 
-    onLayout : function(){
-        if(this.toolbars.length > 0){
-            this.duringLayout = true;
-            Ext.each(this.toolbars, function(tb){
-                tb.doLayout();
-            });
-            delete this.duringLayout;
-            this.syncHeight();
-        }
+    /**
+     * Remove an item from the collection.
+     * @param {Object} o The item to remove.
+     * @return {Object} The item removed or false if no item was removed.
+     */
+    remove : function(o){
+        return this.removeAt(this.indexOf(o));
     },
 
-    syncHeight : function(){
-        if(!(this.autoHeight || this.duringLayout)){
-            var last = this.lastSize;
-            if(last && !Ext.isEmpty(last.height)){
-                var old = last.height, h = this.el.getHeight();
-                if(old != 'auto' && old != h){
-                    var bd = this.body, bdh = bd.getHeight();
-                    h = Math.max(bdh + old - h, 0);
-                    if(bdh > 0 && bdh != h){
-                        bd.setHeight(h);
-                        if(Ext.isIE && h <= 0){
-                            return;
-                        }
-                        var sz = bd.getSize();
-                        this.fireEvent('bodyresize', sz.width, sz.height);
-                    }
-                }
-            }
+    /**
+     * Remove an item from a specified index in the collection. Fires the {@link #remove} event when complete.
+     * @param {Number} index The index within the collection of the item to remove.
+     * @return {Object} The item removed or false if no item was removed.
+     */
+    removeAt : function(index){
+        if(index < this.length && index >= 0){
+            this.length--;
+            var o = this.items[index];
+            this.items.splice(index, 1);
+            var key = this.keys[index];
+            if(typeof key != 'undefined'){
+                delete this.map[key];
+            }
+            this.keys.splice(index, 1);
+            this.fireEvent('remove', o, key);
+            return o;
         }
+        return false;
     },
 
-    // private
-    onShow : function(){
-        if(this.floating){
-            return this.el.show();
-        }
-        Ext.Panel.superclass.onShow.call(this);
+    /**
+     * Removed an item associated with the passed key fom the collection.
+     * @param {String} key The key of the item to remove.
+     * @return {Object} The item removed or false if no item was removed.
+     */
+    removeKey : function(key){
+        return this.removeAt(this.indexOfKey(key));
     },
 
-    // private
-    onHide : function(){
-        if(this.floating){
-            return this.el.hide();
-        }
-        Ext.Panel.superclass.onHide.call(this);
+    /**
+     * Returns the number of items in the collection.
+     * @return {Number} the number of items in the collection.
+     */
+    getCount : function(){
+        return this.length;
     },
 
-    // private
-    createToolHandler : function(t, tc, overCls, panel){
-        return function(e){
-            t.removeClass(overCls);
-            if(tc.stopEvent !== false){
-                e.stopEvent();
-            }
-            if(tc.handler){
-                tc.handler.call(tc.scope || t, e, t, panel, tc);
-            }
-        };
+    /**
+     * Returns index within the collection of the passed Object.
+     * @param {Object} o The item to find the index of.
+     * @return {Number} index of the item. Returns -1 if not found.
+     */
+    indexOf : function(o){
+        return this.items.indexOf(o);
     },
 
-    // private
-    afterRender : function(){
-        if(this.floating && !this.hidden){
-            this.el.show();
-        }
-        if(this.title){
-            this.setTitle(this.title);
-        }
-        this.setAutoScroll();
-        if(this.html){
-            this.body.update(Ext.isObject(this.html) ?
-                             Ext.DomHelper.markup(this.html) :
-                             this.html);
-            delete this.html;
-        }
-        if(this.contentEl){
-            var ce = Ext.getDom(this.contentEl);
-            Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']);
-            this.body.dom.appendChild(ce);
-        }
-        if(this.collapsed){
-            this.collapsed = false;
-            this.collapse(false);
-        }
-        Ext.Panel.superclass.afterRender.call(this); // do sizing calcs last
-        this.initEvents();
+    /**
+     * Returns index within the collection of the passed key.
+     * @param {String} key The key to find the index of.
+     * @return {Number} index of the key.
+     */
+    indexOfKey : function(key){
+        return this.keys.indexOf(key);
     },
 
-    // private
-    setAutoScroll : function(){
-        if(this.rendered && this.autoScroll){
-            var el = this.body || this.el;
-            if(el){
-                el.setOverflow('auto');
-            }
-        }
+    /**
+     * Returns the item associated with the passed key OR index.
+     * Key has priority over index.  This is the equivalent
+     * of calling {@link #key} first, then if nothing matched calling {@link #itemAt}.
+     * @param {String/Number} key The key or index of the item.
+     * @return {Object} If the item is found, returns the item.  If the item was not found, returns <tt>undefined</tt>.
+     * If an item was found, but is a Class, returns <tt>null</tt>.
+     */
+    item : function(key){
+        var mk = this.map[key],
+            item = mk !== undefined ? mk : (typeof key == 'number') ? this.items[key] : undefined;
+        return !Ext.isFunction(item) || this.allowFunctions ? item : null; // for prototype!
     },
 
-    // private
-    getKeyMap : function(){
-        if(!this.keyMap){
-            this.keyMap = new Ext.KeyMap(this.el, this.keys);
-        }
-        return this.keyMap;
+    /**
+     * Returns the item at the specified index.
+     * @param {Number} index The index of the item.
+     * @return {Object} The item at the specified index.
+     */
+    itemAt : function(index){
+        return this.items[index];
     },
 
-    // private
-    initEvents : function(){
-        if(this.keys){
-            this.getKeyMap();
-        }
-        if(this.draggable){
-            this.initDraggable();
-        }
+    /**
+     * Returns the item associated with the passed key.
+     * @param {String/Number} key The key of the item.
+     * @return {Object} The item associated with the passed key.
+     */
+    key : function(key){
+        return this.map[key];
     },
 
-    // private
-    initDraggable : function(){
-        /**
-         * <p>If this Panel is configured {@link #draggable}, this property will contain
-         * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.</p>
-         * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
-         * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}.
-         * @type Ext.dd.DragSource.
-         * @property dd
-         */
-        this.dd = new Ext.Panel.DD(this, typeof this.draggable == 'boolean' ? null : this.draggable);
+    /**
+     * Returns true if the collection contains the passed Object as an item.
+     * @param {Object} o  The Object to look for in the collection.
+     * @return {Boolean} True if the collection contains the Object as an item.
+     */
+    contains : function(o){
+        return this.indexOf(o) != -1;
     },
 
-    // private
-    beforeEffect : function(){
-        if(this.floating){
-            this.el.beforeAction();
-        }
-        this.el.addClass('x-panel-animated');
+    /**
+     * Returns true if the collection contains the passed Object as a key.
+     * @param {String} key The key to look for in the collection.
+     * @return {Boolean} True if the collection contains the Object as a key.
+     */
+    containsKey : function(key){
+        return typeof this.map[key] != 'undefined';
     },
 
-    // private
-    afterEffect : function(){
-        this.syncShadow();
-        this.el.removeClass('x-panel-animated');
+    /**
+     * Removes all items from the collection.  Fires the {@link #clear} event when complete.
+     */
+    clear : function(){
+        this.length = 0;
+        this.items = [];
+        this.keys = [];
+        this.map = {};
+        this.fireEvent('clear');
     },
 
-    // private - wraps up an animation param with internal callbacks
-    createEffect : function(a, cb, scope){
-        var o = {
-            scope:scope,
-            block:true
-        };
-        if(a === true){
-            o.callback = cb;
-            return o;
-        }else if(!a.callback){
-            o.callback = cb;
-        }else { // wrap it up
-            o.callback = function(){
-                cb.call(scope);
-                Ext.callback(a.callback, a.scope);
-            };
-        }
-        return Ext.applyIf(o, a);
+    /**
+     * Returns the first item in the collection.
+     * @return {Object} the first item in the collection..
+     */
+    first : function(){
+        return this.items[0];
     },
 
     /**
-     * Collapses the panel body so that it becomes hidden.  Fires the {@link #beforecollapse} event which will
-     * cancel the collapse action if it returns false.
-     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
-     * {@link #animCollapse} panel config)
-     * @return {Ext.Panel} this
+     * Returns the last item in the collection.
+     * @return {Object} the last item in the collection..
      */
-    collapse : function(animate){
-        if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){
-            return;
-        }
-        var doAnim = animate === true || (animate !== false && this.animCollapse);
-        this.beforeEffect();
-        this.onCollapse(doAnim, animate);
-        return this;
+    last : function(){
+        return this.items[this.length-1];
     },
 
-    // private
-    onCollapse : function(doAnim, animArg){
-        if(doAnim){
-            this[this.collapseEl].slideOut(this.slideAnchor,
-                    Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this),
-                        this.collapseDefaults));
-        }else{
-            this[this.collapseEl].hide();
-            this.afterCollapse();
+    /**
+     * @private
+     * @param {String} property Property to sort by ('key', 'value', or 'index')
+     * @param {String} dir (optional) Direction to sort 'ASC' or 'DESC'. Defaults to 'ASC'.
+     * @param {Function} fn (optional) Comparison function that defines the sort order.
+     * Defaults to sorting by numeric value.
+     */
+    _sort : function(property, dir, fn){
+        var i,
+            len,
+            dsc = String(dir).toUpperCase() == 'DESC' ? -1 : 1,
+            c = [], k = this.keys, items = this.items;
+
+        fn = fn || function(a, b){
+            return a-b;
+        };
+        for(i = 0, len = items.length; i < len; i++){
+            c[c.length] = {key: k[i], value: items[i], index: i};
+        }
+        c.sort(function(a, b){
+            var v = fn(a[property], b[property]) * dsc;
+            if(v === 0){
+                v = (a.index < b.index ? -1 : 1);
+            }
+            return v;
+        });
+        for(i = 0, len = c.length; i < len; i++){
+            items[i] = c[i].value;
+            k[i] = c[i].key;
         }
+        this.fireEvent('sort', this);
     },
 
-    // private
-    afterCollapse : function(){
-        this.collapsed = true;
-        this.el.addClass(this.collapsedCls);
-        this.afterEffect();
-        this.fireEvent('collapse', this);
+    /**
+     * Sorts this collection by <b>item</b> value with the passed comparison function.
+     * @param {String} direction (optional) 'ASC' or 'DESC'. Defaults to 'ASC'.
+     * @param {Function} fn (optional) Comparison function that defines the sort order.
+     * Defaults to sorting by numeric value.
+     */
+    sort : function(dir, fn){
+        this._sort('value', dir, fn);
     },
 
     /**
-     * Expands the panel body so that it becomes visible.  Fires the {@link #beforeexpand} event which will
-     * cancel the expand action if it returns false.
-     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
-     * {@link #animCollapse} panel config)
-     * @return {Ext.Panel} this
+     * Sorts this collection by <b>key</b>s.
+     * @param {String} direction (optional) 'ASC' or 'DESC'. Defaults to 'ASC'.
+     * @param {Function} fn (optional) Comparison function that defines the sort order.
+     * Defaults to sorting by case insensitive string.
      */
-    expand : function(animate){
-        if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){
-            return;
-        }
-        var doAnim = animate === true || (animate !== false && this.animCollapse);
-        this.el.removeClass(this.collapsedCls);
-        this.beforeEffect();
-        this.onExpand(doAnim, animate);
-        return this;
+    keySort : function(dir, fn){
+        this._sort('key', dir, fn || function(a, b){
+            var v1 = String(a).toUpperCase(), v2 = String(b).toUpperCase();
+            return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
+        });
     },
 
-    // private
-    onExpand : function(doAnim, animArg){
-        if(doAnim){
-            this[this.collapseEl].slideIn(this.slideAnchor,
-                    Ext.apply(this.createEffect(animArg||true, this.afterExpand, this),
-                        this.expandDefaults));
+    /**
+     * Returns a range of items in this collection
+     * @param {Number} startIndex (optional) The starting index. Defaults to 0.
+     * @param {Number} endIndex (optional) The ending index. Defaults to the last item.
+     * @return {Array} An array of items
+     */
+    getRange : function(start, end){
+        var items = this.items;
+        if(items.length < 1){
+            return [];
+        }
+        start = start || 0;
+        end = Math.min(typeof end == 'undefined' ? this.length-1 : end, this.length-1);
+        var i, r = [];
+        if(start <= end){
+            for(i = start; i <= end; i++) {
+                r[r.length] = items[i];
+            }
         }else{
-            this[this.collapseEl].show();
-            this.afterExpand();
+            for(i = start; i >= end; i--) {
+                r[r.length] = items[i];
+            }
         }
+        return r;
     },
 
-    // private
-    afterExpand : function(){
-        this.collapsed = false;
-        this.afterEffect();
-        if(this.deferLayout !== undefined){
-            this.doLayout(true);
+    /**
+     * Filter the <i>objects</i> in this collection by a specific property.
+     * Returns a new collection that has been filtered.
+     * @param {String} property A property on your objects
+     * @param {String/RegExp} value Either string that the property values
+     * should start with or a RegExp to test against the property
+     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning
+     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison (defaults to False).
+     * @return {MixedCollection} The new filtered collection
+     */
+    filter : function(property, value, anyMatch, caseSensitive){
+        if(Ext.isEmpty(value, false)){
+            return this.clone();
         }
-        this.fireEvent('expand', this);
+        value = this.createValueMatcher(value, anyMatch, caseSensitive);
+        return this.filterBy(function(o){
+            return o && value.test(o[property]);
+        });
     },
 
     /**
-     * Shortcut for performing an {@link #expand} or {@link #collapse} based on the current state of the panel.
-     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
-     * {@link #animCollapse} panel config)
-     * @return {Ext.Panel} this
+     * Filter by a function. Returns a <i>new</i> collection that has been filtered.
+     * The passed function will be called with each object in the collection.
+     * If the function returns true, the value is included otherwise it is filtered.
+     * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key)
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this MixedCollection.
+     * @return {MixedCollection} The new filtered collection
      */
-    toggleCollapse : function(animate){
-        this[this.collapsed ? 'expand' : 'collapse'](animate);
-        return this;
+    filterBy : function(fn, scope){
+        var r = new Ext.util.MixedCollection();
+        r.getKey = this.getKey;
+        var k = this.keys, it = this.items;
+        for(var i = 0, len = it.length; i < len; i++){
+            if(fn.call(scope||this, it[i], k[i])){
+                r.add(k[i], it[i]);
+            }
+        }
+        return r;
     },
 
-    // private
-    onDisable : function(){
-        if(this.rendered && this.maskDisabled){
-            this.el.mask();
+    /**
+     * Finds the index of the first matching object in this collection by a specific property/value.
+     * @param {String} property The name of a property on your objects.
+     * @param {String/RegExp} value A string that the property values
+     * should start with or a RegExp to test against the property.
+     * @param {Number} start (optional) The index to start searching at (defaults to 0).
+     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning.
+     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison.
+     * @return {Number} The matched index or -1
+     */
+    findIndex : function(property, value, start, anyMatch, caseSensitive){
+        if(Ext.isEmpty(value, false)){
+            return -1;
         }
-        Ext.Panel.superclass.onDisable.call(this);
+        value = this.createValueMatcher(value, anyMatch, caseSensitive);
+        return this.findIndexBy(function(o){
+            return o && value.test(o[property]);
+        }, null, start);
+    },
+
+    /**
+     * Find the index of the first matching object in this collection by a function.
+     * If the function returns <i>true</i> it is considered a match.
+     * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key).
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this MixedCollection.
+     * @param {Number} start (optional) The index to start searching at (defaults to 0).
+     * @return {Number} The matched index or -1
+     */
+    findIndexBy : function(fn, scope, start){
+        var k = this.keys, it = this.items;
+        for(var i = (start||0), len = it.length; i < len; i++){
+            if(fn.call(scope||this, it[i], k[i])){
+                return i;
+            }
+        }
+        return -1;
     },
 
     // private
-    onEnable : function(){
-        if(this.rendered && this.maskDisabled){
-            this.el.unmask();
+    createValueMatcher : function(value, anyMatch, caseSensitive, exactMatch) {
+        if (!value.exec) { // not a regex
+            var er = Ext.escapeRe;
+            value = String(value);
+            if (anyMatch === true) {
+                value = er(value);
+            } else {
+                value = '^' + er(value);
+                if (exactMatch === true) {
+                    value += '$';
+                }
+            }
+            value = new RegExp(value, caseSensitive ? '' : 'i');
+         }
+         return value;
+    },
+
+    /**
+     * Creates a shallow copy of this collection
+     * @return {MixedCollection}
+     */
+    clone : function(){
+        var r = new Ext.util.MixedCollection();
+        var k = this.keys, it = this.items;
+        for(var i = 0, len = it.length; i < len; i++){
+            r.add(k[i], it[i]);
+        }
+        r.getKey = this.getKey;
+        return r;
+    }
+});
+/**
+ * This method calls {@link #item item()}.
+ * Returns the item associated with the passed key OR index. Key has priority
+ * over index.  This is the equivalent of calling {@link #key} first, then if
+ * nothing matched calling {@link #itemAt}.
+ * @param {String/Number} key The key or index of the item.
+ * @return {Object} If the item is found, returns the item.  If the item was
+ * not found, returns <tt>undefined</tt>. If an item was found, but is a Class,
+ * returns <tt>null</tt>.
+ */
+Ext.util.MixedCollection.prototype.get = Ext.util.MixedCollection.prototype.item;/**
+ * @class Ext.util.JSON
+ * Modified version of Douglas Crockford"s json.js that doesn"t
+ * mess with the Object prototype
+ * http://www.json.org/js.html
+ * @singleton
+ */
+Ext.util.JSON = new (function(){
+    var useHasOwn = !!{}.hasOwnProperty,
+        isNative = function() {
+            var useNative = null;
+
+            return function() {
+                if (useNative === null) {
+                    useNative = Ext.USE_NATIVE_JSON && window.JSON && JSON.toString() == '[object JSON]';
+                }
+        
+                return useNative;
+            };
+        }(),
+        pad = function(n) {
+            return n < 10 ? "0" + n : n;
+        },
+        doDecode = function(json){
+            return eval("(" + json + ')');    
+        },
+        doEncode = function(o){
+            if(!Ext.isDefined(o) || o === null){
+                return "null";
+            }else if(Ext.isArray(o)){
+                return encodeArray(o);
+            }else if(Ext.isDate(o)){
+                return Ext.util.JSON.encodeDate(o);
+            }else if(Ext.isString(o)){
+                return encodeString(o);
+            }else if(typeof o == "number"){
+                //don't use isNumber here, since finite checks happen inside isNumber
+                return isFinite(o) ? String(o) : "null";
+            }else if(Ext.isBoolean(o)){
+                return String(o);
+            }else {
+                var a = ["{"], b, i, v;
+                for (i in o) {
+                    // don't encode DOM objects
+                    if(!o.getElementsByTagName){
+                        if(!useHasOwn || o.hasOwnProperty(i)) {
+                            v = o[i];
+                            switch (typeof v) {
+                            case "undefined":
+                            case "function":
+                            case "unknown":
+                                break;
+                            default:
+                                if(b){
+                                    a.push(',');
+                                }
+                                a.push(doEncode(i), ":",
+                                        v === null ? "null" : doEncode(v));
+                                b = true;
+                            }
+                        }
+                    }
+                }
+                a.push("}");
+                return a.join("");
+            }    
+        },
+        m = {
+            "\b": '\\b',
+            "\t": '\\t',
+            "\n": '\\n',
+            "\f": '\\f',
+            "\r": '\\r',
+            '"' : '\\"',
+            "\\": '\\\\'
+        },
+        encodeString = function(s){
+            if (/["\\\x00-\x1f]/.test(s)) {
+                return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
+                    var c = m[b];
+                    if(c){
+                        return c;
+                    }
+                    c = b.charCodeAt();
+                    return "\\u00" +
+                        Math.floor(c / 16).toString(16) +
+                        (c % 16).toString(16);
+                }) + '"';
+            }
+            return '"' + s + '"';
+        },
+        encodeArray = function(o){
+            var a = ["["], b, i, l = o.length, v;
+                for (i = 0; i < l; i += 1) {
+                    v = o[i];
+                    switch (typeof v) {
+                        case "undefined":
+                        case "function":
+                        case "unknown":
+                            break;
+                        default:
+                            if (b) {
+                                a.push(',');
+                            }
+                            a.push(v === null ? "null" : Ext.util.JSON.encode(v));
+                            b = true;
+                    }
+                }
+                a.push("]");
+                return a.join("");
+        };
+
+    /**
+     * <p>Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal expression.
+     * <b>The returned value includes enclosing double quotation marks.</b></p>
+     * <p>The default return format is "yyyy-mm-ddThh:mm:ss".</p>
+     * <p>To override this:</p><pre><code>
+Ext.util.JSON.encodeDate = function(d) {
+    return d.format('"Y-m-d"');
+};
+</code></pre>
+     * @param {Date} d The Date to encode
+     * @return {String} The string literal to use in a JSON string.
+     */
+    this.encodeDate = function(o){
+        return '"' + o.getFullYear() + "-" +
+                pad(o.getMonth() + 1) + "-" +
+                pad(o.getDate()) + "T" +
+                pad(o.getHours()) + ":" +
+                pad(o.getMinutes()) + ":" +
+                pad(o.getSeconds()) + '"';
+    };
+
+    /**
+     * Encodes an Object, Array or other value
+     * @param {Mixed} o The variable to encode
+     * @return {String} The JSON string
+     */
+    this.encode = function() {
+        var ec;
+        return function(o) {
+            if (!ec) {
+                // setup encoding function on first access
+                ec = isNative() ? JSON.stringify : doEncode;
+            }
+            return ec(o);
+        };
+    }();
+
+
+    /**
+     * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set.
+     * @param {String} json The JSON string
+     * @return {Object} The resulting object
+     */
+    this.decode = function() {
+        var dc;
+        return function(json) {
+            if (!dc) {
+                // setup decoding function on first access
+                dc = isNative() ? JSON.parse : doDecode;
+            }
+            return dc(json);
+        };
+    }();
+
+})();
+/**
+ * Shorthand for {@link Ext.util.JSON#encode}
+ * @param {Mixed} o The variable to encode
+ * @return {String} The JSON string
+ * @member Ext
+ * @method encode
+ */
+Ext.encode = Ext.util.JSON.encode;
+/**
+ * Shorthand for {@link Ext.util.JSON#decode}
+ * @param {String} json The JSON string
+ * @param {Boolean} safe (optional) Whether to return null or throw an exception if the JSON is invalid.
+ * @return {Object} The resulting object
+ * @member Ext
+ * @method decode
+ */
+Ext.decode = Ext.util.JSON.decode;
+/**\r
+ * @class Ext.util.Format\r
+ * Reusable data formatting functions\r
+ * @singleton\r
+ */\r
+Ext.util.Format = function(){\r
+    var trimRe = /^\s+|\s+$/g,\r
+        stripTagsRE = /<\/?[^>]+>/gi,\r
+        stripScriptsRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,\r
+        nl2brRe = /\r?\n/g;\r
+        \r
+    return {\r
+        /**\r
+         * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length\r
+         * @param {String} value The string to truncate\r
+         * @param {Number} length The maximum length to allow before truncating\r
+         * @param {Boolean} word True to try to find a common work break\r
+         * @return {String} The converted text\r
+         */\r
+        ellipsis : function(value, len, word){\r
+            if(value && value.length > len){\r
+                if(word){\r
+                    var vs = value.substr(0, len - 2),\r
+                        index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));\r
+                    if(index == -1 || index < (len - 15)){\r
+                        return value.substr(0, len - 3) + "...";\r
+                    }else{\r
+                        return vs.substr(0, index) + "...";\r
+                    }\r
+                } else{\r
+                    return value.substr(0, len - 3) + "...";\r
+                }\r
+            }\r
+            return value;\r
+        },\r
+\r
+        /**\r
+         * Checks a reference and converts it to empty string if it is undefined\r
+         * @param {Mixed} value Reference to check\r
+         * @return {Mixed} Empty string if converted, otherwise the original value\r
+         */\r
+        undef : function(value){\r
+            return value !== undefined ? value : "";\r
+        },\r
+\r
+        /**\r
+         * Checks a reference and converts it to the default value if it's empty\r
+         * @param {Mixed} value Reference to check\r
+         * @param {String} defaultValue The value to insert of it's undefined (defaults to "")\r
+         * @return {String}\r
+         */\r
+        defaultValue : function(value, defaultValue){\r
+            return value !== undefined && value !== '' ? value : defaultValue;\r
+        },\r
+\r
+        /**\r
+         * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.\r
+         * @param {String} value The string to encode\r
+         * @return {String} The encoded text\r
+         */\r
+        htmlEncode : function(value){\r
+            return !value ? value : String(value).replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");\r
+        },\r
+\r
+        /**\r
+         * Convert certain characters (&, <, >, and ') from their HTML character equivalents.\r
+         * @param {String} value The string to decode\r
+         * @return {String} The decoded text\r
+         */\r
+        htmlDecode : function(value){\r
+            return !value ? value : String(value).replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");\r
+        },\r
+\r
+        /**\r
+         * Trims any whitespace from either side of a string\r
+         * @param {String} value The text to trim\r
+         * @return {String} The trimmed text\r
+         */\r
+        trim : function(value){\r
+            return String(value).replace(trimRe, "");\r
+        },\r
+\r
+        /**\r
+         * Returns a substring from within an original string\r
+         * @param {String} value The original text\r
+         * @param {Number} start The start index of the substring\r
+         * @param {Number} length The length of the substring\r
+         * @return {String} The substring\r
+         */\r
+        substr : function(value, start, length){\r
+            return String(value).substr(start, length);\r
+        },\r
+\r
+        /**\r
+         * Converts a string to all lower case letters\r
+         * @param {String} value The text to convert\r
+         * @return {String} The converted text\r
+         */\r
+        lowercase : function(value){\r
+            return String(value).toLowerCase();\r
+        },\r
+\r
+        /**\r
+         * Converts a string to all upper case letters\r
+         * @param {String} value The text to convert\r
+         * @return {String} The converted text\r
+         */\r
+        uppercase : function(value){\r
+            return String(value).toUpperCase();\r
+        },\r
+\r
+        /**\r
+         * Converts the first character only of a string to upper case\r
+         * @param {String} value The text to convert\r
+         * @return {String} The converted text\r
+         */\r
+        capitalize : function(value){\r
+            return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase();\r
+        },\r
+\r
+        // private\r
+        call : function(value, fn){\r
+            if(arguments.length > 2){\r
+                var args = Array.prototype.slice.call(arguments, 2);\r
+                args.unshift(value);\r
+                return eval(fn).apply(window, args);\r
+            }else{\r
+                return eval(fn).call(window, value);\r
+            }\r
+        },\r
+\r
+        /**\r
+         * Format a number as US currency\r
+         * @param {Number/String} value The numeric value to format\r
+         * @return {String} The formatted currency string\r
+         */\r
+        usMoney : function(v){\r
+            v = (Math.round((v-0)*100))/100;\r
+            v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);\r
+            v = String(v);\r
+            var ps = v.split('.'),\r
+                whole = ps[0],\r
+                sub = ps[1] ? '.'+ ps[1] : '.00',\r
+                r = /(\d+)(\d{3})/;\r
+            while (r.test(whole)) {\r
+                whole = whole.replace(r, '$1' + ',' + '$2');\r
+            }\r
+            v = whole + sub;\r
+            if(v.charAt(0) == '-'){\r
+                return '-$' + v.substr(1);\r
+            }\r
+            return "$" +  v;\r
+        },\r
+\r
+        /**\r
+         * Parse a value into a formatted date using the specified format pattern.\r
+         * @param {String/Date} value The value to format (Strings must conform to the format expected by the javascript Date object's <a href="http://www.w3schools.com/jsref/jsref_parse.asp">parse()</a> method)\r
+         * @param {String} format (optional) Any valid date format string (defaults to 'm/d/Y')\r
+         * @return {String} The formatted date string\r
+         */\r
+        date : function(v, format){\r
+            if(!v){\r
+                return "";\r
+            }\r
+            if(!Ext.isDate(v)){\r
+                v = new Date(Date.parse(v));\r
+            }\r
+            return v.dateFormat(format || "m/d/Y");\r
+        },\r
+\r
+        /**\r
+         * Returns a date rendering function that can be reused to apply a date format multiple times efficiently\r
+         * @param {String} format Any valid date format string\r
+         * @return {Function} The date formatting function\r
+         */\r
+        dateRenderer : function(format){\r
+            return function(v){\r
+                return Ext.util.Format.date(v, format);\r
+            };\r
+        },\r
+        \r
+        /**\r
+         * Strips all HTML tags\r
+         * @param {Mixed} value The text from which to strip tags\r
+         * @return {String} The stripped text\r
+         */\r
+        stripTags : function(v){\r
+            return !v ? v : String(v).replace(stripTagsRE, "");\r
+        },\r
+\r
+        /**\r
+         * Strips all script tags\r
+         * @param {Mixed} value The text from which to strip script tags\r
+         * @return {String} The stripped text\r
+         */\r
+        stripScripts : function(v){\r
+            return !v ? v : String(v).replace(stripScriptsRe, "");\r
+        },\r
+\r
+        /**\r
+         * Simple format for a file size (xxx bytes, xxx KB, xxx MB)\r
+         * @param {Number/String} size The numeric value to format\r
+         * @return {String} The formatted file size\r
+         */\r
+        fileSize : function(size){\r
+            if(size < 1024) {\r
+                return size + " bytes";\r
+            } else if(size < 1048576) {\r
+                return (Math.round(((size*10) / 1024))/10) + " KB";\r
+            } else {\r
+                return (Math.round(((size*10) / 1048576))/10) + " MB";\r
+            }\r
+        },\r
+\r
+        /**\r
+         * It does simple math for use in a template, for example:<pre><code>\r
+         * var tpl = new Ext.Template('{value} * 10 = {value:math("* 10")}');\r
+         * </code></pre>\r
+         * @return {Function} A function that operates on the passed value.\r
+         */\r
+        math : function(){\r
+            var fns = {};\r
+            return function(v, a){\r
+                if(!fns[a]){\r
+                    fns[a] = new Function('v', 'return v ' + a + ';');\r
+                }\r
+                return fns[a](v);\r
+            }\r
+        }(),\r
+\r
+        /**\r
+         * Rounds the passed number to the required decimal precision.\r
+         * @param {Number/String} value The numeric value to round.\r
+         * @param {Number} precision The number of decimal places to which to round the first parameter's value.\r
+         * @return {Number} The rounded value.\r
+         */\r
+        round : function(value, precision) {\r
+            var result = Number(value);\r
+            if (typeof precision == 'number') {\r
+                precision = Math.pow(10, precision);\r
+                result = Math.round(value * precision) / precision;\r
+            }\r
+            return result;\r
+        },\r
+\r
+        /**\r
+         * Formats the number according to the format string.\r
+         * <div style="margin-left:40px">examples (123456.789):\r
+         * <div style="margin-left:10px">\r
+         * 0 - (123456) show only digits, no precision<br>\r
+         * 0.00 - (123456.78) show only digits, 2 precision<br>\r
+         * 0.0000 - (123456.7890) show only digits, 4 precision<br>\r
+         * 0,000 - (123,456) show comma and digits, no precision<br>\r
+         * 0,000.00 - (123,456.78) show comma and digits, 2 precision<br>\r
+         * 0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision<br>\r
+         * To reverse the grouping (,) and decimal (.) for international numbers, add /i to the end.\r
+         * For example: 0.000,00/i\r
+         * </div></div>\r
+         * @param {Number} v The number to format.\r
+         * @param {String} format The way you would like to format this text.\r
+         * @return {String} The formatted number.\r
+         */\r
+        number: function(v, format) {\r
+            if(!format){\r
+                       return v;\r
+                   }\r
+                   v = Ext.num(v, NaN);\r
+            if (isNaN(v)){\r
+                return '';\r
+            }\r
+                   var comma = ',',\r
+                       dec = '.',\r
+                       i18n = false,\r
+                       neg = v < 0;\r
+               \r
+                   v = Math.abs(v);\r
+                   if(format.substr(format.length - 2) == '/i'){\r
+                       format = format.substr(0, format.length - 2);\r
+                       i18n = true;\r
+                       comma = '.';\r
+                       dec = ',';\r
+                   }\r
+               \r
+                   var hasComma = format.indexOf(comma) != -1, \r
+                       psplit = (i18n ? format.replace(/[^\d\,]/g, '') : format.replace(/[^\d\.]/g, '')).split(dec);\r
+               \r
+                   if(1 < psplit.length){\r
+                       v = v.toFixed(psplit[1].length);\r
+                   }else if(2 < psplit.length){\r
+                       throw ('NumberFormatException: invalid format, formats should have no more than 1 period: ' + format);\r
+                   }else{\r
+                       v = v.toFixed(0);\r
+                   }\r
+               \r
+                   var fnum = v.toString();\r
+                   if(hasComma){\r
+                       psplit = fnum.split('.');\r
+               \r
+                       var cnum = psplit[0], parr = [], j = cnum.length, m = Math.floor(j / 3), n = cnum.length % 3 || 3;\r
+               \r
+                       for(var i = 0; i < j; i += n){\r
+                           if(i != 0){\r
+                               n = 3;\r
+                           }\r
+                           parr[parr.length] = cnum.substr(i, n);\r
+                           m -= 1;\r
+                       }\r
+                       fnum = parr.join(comma);\r
+                       if(psplit[1]){\r
+                           fnum += dec + psplit[1];\r
+                       }\r
+                   }\r
+               \r
+                   return (neg ? '-' : '') + format.replace(/[\d,?\.?]+/, fnum);\r
+        },\r
+\r
+        /**\r
+         * Returns a number rendering function that can be reused to apply a number format multiple times efficiently\r
+         * @param {String} format Any valid number format string for {@link #number}\r
+         * @return {Function} The number formatting function\r
+         */\r
+        numberRenderer : function(format){\r
+            return function(v){\r
+                return Ext.util.Format.number(v, format);\r
+            };\r
+        },\r
+\r
+        /**\r
+         * Selectively do a plural form of a word based on a numeric value. For example, in a template,\r
+         * {commentCount:plural("Comment")}  would result in "1 Comment" if commentCount was 1 or would be "x Comments"\r
+         * if the value is 0 or greater than 1.\r
+         * @param {Number} value The value to compare against\r
+         * @param {String} singular The singular form of the word\r
+         * @param {String} plural (optional) The plural form of the word (defaults to the singular with an "s")\r
+         */\r
+        plural : function(v, s, p){\r
+            return v +' ' + (v == 1 ? s : (p ? p : s+'s'));\r
+        },\r
+        \r
+        /**\r
+         * Converts newline characters to the HTML tag &lt;br/>\r
+         * @param {String} The string value to format.\r
+         * @return {String} The string with embedded &lt;br/> tags in place of newlines.\r
+         */\r
+        nl2br : function(v){\r
+            return Ext.isEmpty(v) ? '' : v.replace(nl2brRe, '<br/>');\r
+        }\r
+    }\r
+}();\r
+/**
+ * @class Ext.XTemplate
+ * @extends Ext.Template
+ * <p>A template class that supports advanced functionality like:<div class="mdetail-params"><ul>
+ * <li>Autofilling arrays using templates and sub-templates</li>
+ * <li>Conditional processing with basic comparison operators</li>
+ * <li>Basic math function support</li>
+ * <li>Execute arbitrary inline code with special built-in template variables</li>
+ * <li>Custom member functions</li>
+ * <li>Many special tags and built-in operators that aren't defined as part of
+ * the API, but are supported in the templates that can be created</li>
+ * </ul></div></p>
+ * <p>XTemplate provides the templating mechanism built into:<div class="mdetail-params"><ul>
+ * <li>{@link Ext.DataView}</li>
+ * <li>{@link Ext.ListView}</li>
+ * <li>{@link Ext.form.ComboBox}</li>
+ * <li>{@link Ext.grid.TemplateColumn}</li>
+ * <li>{@link Ext.grid.GroupingView}</li>
+ * <li>{@link Ext.menu.Item}</li>
+ * <li>{@link Ext.layout.MenuLayout}</li>
+ * <li>{@link Ext.ColorPalette}</li>
+ * </ul></div></p>
+ * 
+ * <p>For example usage {@link #XTemplate see the constructor}.</p>  
+ *   
+ * @constructor
+ * The {@link Ext.Template#Template Ext.Template constructor} describes
+ * the acceptable parameters to pass to the constructor. The following
+ * examples demonstrate all of the supported features.</p>
+ * 
+ * <div class="mdetail-params"><ul>
+ * 
+ * <li><b><u>Sample Data</u></b> 
+ * <div class="sub-desc">
+ * <p>This is the data object used for reference in each code example:</p>
+ * <pre><code>
+var data = {
+    name: 'Jack Slocum',
+    title: 'Lead Developer',
+    company: 'Ext JS, LLC',
+    email: 'jack@extjs.com',
+    address: '4 Red Bulls Drive',
+    city: 'Cleveland',
+    state: 'Ohio',
+    zip: '44102',
+    drinks: ['Red Bull', 'Coffee', 'Water'],
+    kids: [{
+        name: 'Sara Grace',
+        age:3
+    },{
+        name: 'Zachary',
+        age:2
+    },{
+        name: 'John James',
+        age:0
+    }]
+};
+ * </code></pre>
+ * </div>
+ * </li>
+ * 
+ * 
+ * <li><b><u>Auto filling of arrays</u></b> 
+ * <div class="sub-desc">
+ * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>for</tt></b> operator are used
+ * to process the provided data object:
+ * <ul>
+ * <li>If the value specified in <tt>for</tt> is an array, it will auto-fill,
+ * repeating the template block inside the <tt>tpl</tt> tag for each item in the
+ * array.</li>
+ * <li>If <tt>for="."</tt> is specified, the data object provided is examined.</li>
+ * <li>While processing an array, the special variable <tt>{#}</tt>
+ * will provide the current array index + 1 (starts at 1, not 0).</li>
+ * </ul>
+ * </p>
+ * <pre><code>
+&lt;tpl <b>for</b>=".">...&lt;/tpl>       // loop through array at root node
+&lt;tpl <b>for</b>="foo">...&lt;/tpl>     // loop through array at foo node
+&lt;tpl <b>for</b>="foo.bar">...&lt;/tpl> // loop through array at foo.bar node
+ * </code></pre>
+ * Using the sample data above:
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Kids: ',
+    '&lt;tpl <b>for</b>=".">',       // process the data.kids node
+        '&lt;p>{#}. {name}&lt;/p>',  // use current array index to autonumber
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data.kids); // pass the kids property of the data object
+ * </code></pre>
+ * <p>An example illustrating how the <b><tt>for</tt></b> property can be leveraged
+ * to access specified members of the provided data object to populate the template:</p>
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Title: {title}&lt;/p>',
+    '&lt;p>Company: {company}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl <b>for="kids"</b>>',     // interrogate the kids property within the data
+        '&lt;p>{name}&lt;/p>',
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data);  // pass the root node of the data object
+ * </code></pre>
+ * <p>Flat arrays that contain values (and not objects) can be auto-rendered
+ * using the special <b><tt>{.}</tt></b> variable inside a loop.  This variable
+ * will represent the value of the array at the current index:</p>
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>{name}\&#39;s favorite beverages:&lt;/p>',
+    '&lt;tpl for="drinks">',
+       '&lt;div> - {.}&lt;/div>',
+    '&lt;/tpl>'
+);
+tpl.overwrite(panel.body, data);
+ * </code></pre>
+ * <p>When processing a sub-template, for example while looping through a child array,
+ * you can access the parent object's members via the <b><tt>parent</tt></b> object:</p>
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl for="kids">',
+        '&lt;tpl if="age > 1">',
+            '&lt;p>{name}&lt;/p>',
+            '&lt;p>Dad: {<b>parent</b>.name}&lt;/p>',
+        '&lt;/tpl>',
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data);
+ * </code></pre>
+ * </div>
+ * </li>
+ * 
+ * 
+ * <li><b><u>Conditional processing with basic comparison operators</u></b> 
+ * <div class="sub-desc">
+ * <p>The <b><tt>tpl</tt></b> tag and the <b><tt>if</tt></b> operator are used
+ * to provide conditional checks for deciding whether or not to render specific
+ * parts of the template. Notes:<div class="sub-desc"><ul>
+ * <li>Double quotes must be encoded if used within the conditional</li>
+ * <li>There is no <tt>else</tt> operator &mdash; if needed, two opposite
+ * <tt>if</tt> statements should be used.</li>
+ * </ul></div>
+ * <pre><code>
+&lt;tpl if="age &gt; 1 &amp;&amp; age &lt; 10">Child&lt;/tpl>
+&lt;tpl if="age >= 10 && age < 18">Teenager&lt;/tpl>
+&lt;tpl <b>if</b>="this.isGirl(name)">...&lt;/tpl>
+&lt;tpl <b>if</b>="id==\'download\'">...&lt;/tpl>
+&lt;tpl <b>if</b>="needsIcon">&lt;img src="{icon}" class="{iconCls}"/>&lt;/tpl>
+// no good:
+&lt;tpl if="name == "Jack"">Hello&lt;/tpl>
+// encode &#34; if it is part of the condition, e.g.
+&lt;tpl if="name == &#38;quot;Jack&#38;quot;">Hello&lt;/tpl>
+ * </code></pre>
+ * Using the sample data above:
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl for="kids">',
+        '&lt;tpl if="age > 1">',
+            '&lt;p>{name}&lt;/p>',
+        '&lt;/tpl>',
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data);
+ * </code></pre>
+ * </div>
+ * </li>
+ * 
+ * 
+ * <li><b><u>Basic math support</u></b> 
+ * <div class="sub-desc">
+ * <p>The following basic math operators may be applied directly on numeric
+ * data values:</p><pre>
+ * + - * /
+ * </pre>
+ * For example:
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl for="kids">',
+        '&lt;tpl if="age &amp;gt; 1">',  // <-- Note that the &gt; is encoded
+            '&lt;p>{#}: {name}&lt;/p>',  // <-- Auto-number each item
+            '&lt;p>In 5 Years: {age+5}&lt;/p>',  // <-- Basic math
+            '&lt;p>Dad: {parent.name}&lt;/p>',
+        '&lt;/tpl>',
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data);
+</code></pre>
+ * </div>
+ * </li>
+ *
+ * 
+ * <li><b><u>Execute arbitrary inline code with special built-in template variables</u></b> 
+ * <div class="sub-desc">
+ * <p>Anything between <code>{[ ... ]}</code> is considered code to be executed
+ * in the scope of the template. There are some special variables available in that code:
+ * <ul>
+ * <li><b><tt>values</tt></b>: The values in the current scope. If you are using
+ * scope changing sub-templates, you can change what <tt>values</tt> is.</li>
+ * <li><b><tt>parent</tt></b>: The scope (values) of the ancestor template.</li>
+ * <li><b><tt>xindex</tt></b>: If you are in a looping template, the index of the
+ * loop you are in (1-based).</li>
+ * <li><b><tt>xcount</tt></b>: If you are in a looping template, the total length
+ * of the array you are looping.</li>
+ * <li><b><tt>fm</tt></b>: An alias for <tt>Ext.util.Format</tt>.</li>
+ * </ul>
+ * This example demonstrates basic row striping using an inline code block and the
+ * <tt>xindex</tt> variable:</p>
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Company: {[values.company.toUpperCase() + ", " + values.title]}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl for="kids">',
+       '&lt;div class="{[xindex % 2 === 0 ? "even" : "odd"]}">',
+        '{name}',
+        '&lt;/div>',
+    '&lt;/tpl>&lt;/p>'
+);
+tpl.overwrite(panel.body, data);
+ * </code></pre>
+ * </div>
+ * </li>
+ * 
+ * <li><b><u>Template member functions</u></b> 
+ * <div class="sub-desc">
+ * <p>One or more member functions can be specified in a configuration
+ * object passed into the XTemplate constructor for more complex processing:</p>
+ * <pre><code>
+var tpl = new Ext.XTemplate(
+    '&lt;p>Name: {name}&lt;/p>',
+    '&lt;p>Kids: ',
+    '&lt;tpl for="kids">',
+        '&lt;tpl if="this.isGirl(name)">',
+            '&lt;p>Girl: {name} - {age}&lt;/p>',
+        '&lt;/tpl>',
+        // use opposite if statement to simulate 'else' processing:
+        '&lt;tpl if="this.isGirl(name) == false">',
+            '&lt;p>Boy: {name} - {age}&lt;/p>',
+        '&lt;/tpl>',
+        '&lt;tpl if="this.isBaby(age)">',
+            '&lt;p>{name} is a baby!&lt;/p>',
+        '&lt;/tpl>',
+    '&lt;/tpl>&lt;/p>',
+    {
+        // XTemplate configuration:
+        compiled: true,
+        disableFormats: true,
+        // member functions:
+        isGirl: function(name){
+            return name == 'Sara Grace';
+        },
+        isBaby: function(age){
+            return age < 1;
         }
-        Ext.Panel.superclass.onEnable.call(this);
-    },
+    }
+);
+tpl.overwrite(panel.body, data);
+ * </code></pre>
+ * </div>
+ * </li>
+ * 
+ * </ul></div>
+ * 
+ * @param {Mixed} config
+ */
+Ext.XTemplate = function(){
+    Ext.XTemplate.superclass.constructor.apply(this, arguments);
 
-    // private
-    onResize : function(w, h){
-        if(w !== undefined || h !== undefined){
-            if(!this.collapsed){
-                if(typeof w == 'number'){
-                    w = this.adjustBodyWidth(w - this.getFrameWidth());
-                    if(this.tbar){
-                        this.tbar.setWidth(w);
-                        if(this.topToolbar){
-                            this.topToolbar.setSize(w);
-                        }
-                    }
-                    if(this.bbar){
-                        this.bbar.setWidth(w);
-                        if(this.bottomToolbar){
-                            this.bottomToolbar.setSize(w);
-                        }
-                    }
-                    if(this.fbar){
-                        var f = this.fbar,
-                            fWidth = 1,
-                            strict = Ext.isStrict;
-                        if(this.buttonAlign == 'left'){
-                           fWidth = w - f.container.getFrameWidth('lr');
-                        }else{
-                            //center/right alignment off in webkit
-                            if(Ext.isIE || Ext.isWebKit){
-                                //center alignment ok on webkit.
-                                //right broken in both, center on IE
-                                if(!(this.buttonAlign == 'center' && Ext.isWebKit) && (!strict || (!Ext.isIE8 && strict))){
-                                    (function(){
-                                        f.setWidth(f.getEl().child('.x-toolbar-ct').getWidth());
-                                    }).defer(1);
-                                }else{
-                                    fWidth = 'auto';
-                                }
-                            }else{
-                                fWidth = 'auto';
-                            }
-                        }
-                        f.setWidth(fWidth);
-                    }
-                    this.body.setWidth(w);
-                }else if(w == 'auto'){
-                    this.body.setWidth(w);
-                }
+    var me = this,
+       s = me.html,
+       re = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,
+       nameRe = /^<tpl\b[^>]*?for="(.*?)"/,
+       ifRe = /^<tpl\b[^>]*?if="(.*?)"/,
+       execRe = /^<tpl\b[^>]*?exec="(.*?)"/,
+       m,
+       id = 0,
+       tpls = [],
+       VALUES = 'values',
+       PARENT = 'parent',
+       XINDEX = 'xindex',
+       XCOUNT = 'xcount',
+       RETURN = 'return ',
+       WITHVALUES = 'with(values){ ';
 
-                if(typeof h == 'number'){
-                    h = Math.max(0, this.adjustBodyHeight(h - this.getFrameHeight()));
-                    this.body.setHeight(h);
-                }else if(h == 'auto'){
-                    this.body.setHeight(h);
-                }
+    s = ['<tpl>', s, '</tpl>'].join('');
 
-                if(this.disabled && this.el._mask){
-                    this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight());
-                }
-            }else{
-                this.queuedBodySize = {width: w, height: h};
-                if(!this.queuedExpand && this.allowQueuedExpand !== false){
-                    this.queuedExpand = true;
-                    this.on('expand', function(){
-                        delete this.queuedExpand;
-                        this.onResize(this.queuedBodySize.width, this.queuedBodySize.height);
-                        this.doLayout();
-                    }, this, {single:true});
-                }
-            }
-            this.fireEvent('bodyresize', this, w, h);
-        }
-        this.syncShadow();
-    },
+    while((m = s.match(re))){
+               var m2 = m[0].match(nameRe),
+                       m3 = m[0].match(ifRe),
+                       m4 = m[0].match(execRe),
+                       exp = null,
+                       fn = null,
+                       exec = null,
+                       name = m2 && m2[1] ? m2[1] : '';
 
+       if (m3) {
+           exp = m3 && m3[1] ? m3[1] : null;
+           if(exp){
+               fn = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES + RETURN +(Ext.util.Format.htmlDecode(exp))+'; }');
+           }
+       }
+       if (m4) {
+           exp = m4 && m4[1] ? m4[1] : null;
+           if(exp){
+               exec = new Function(VALUES, PARENT, XINDEX, XCOUNT, WITHVALUES +(Ext.util.Format.htmlDecode(exp))+'; }');
+           }
+       }
+       if(name){
+           switch(name){
+               case '.': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + VALUES + '; }'); break;
+               case '..': name = new Function(VALUES, PARENT, WITHVALUES + RETURN + PARENT + '; }'); break;
+               default: name = new Function(VALUES, PARENT, WITHVALUES + RETURN + name + '; }');
+           }
+       }
+       tpls.push({
+            id: id,
+            target: name,
+            exec: exec,
+            test: fn,
+            body: m[1]||''
+        });
+       s = s.replace(m[0], '{xtpl'+ id + '}');
+       ++id;
+    }
+       Ext.each(tpls, function(t) {
+        me.compileTpl(t);
+    });
+    me.master = tpls[tpls.length-1];
+    me.tpls = tpls;
+};
+Ext.extend(Ext.XTemplate, Ext.Template, {
     // private
-    adjustBodyHeight : function(h){
-        return h;
-    },
-
+    re : /\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,
     // private
-    adjustBodyWidth : function(w){
-        return w;
-    },
+    codeRe : /\{\[((?:\\\]|.|\n)*?)\]\}/g,
 
     // private
-    onPosition : function(){
-        this.syncShadow();
-    },
-
-    /**
-     * Returns the width in pixels of the framing elements of this panel (not including the body width).  To
-     * retrieve the body width see {@link #getInnerWidth}.
-     * @return {Number} The frame width
-     */
-    getFrameWidth : function(){
-        var w = this.el.getFrameWidth('lr')+this.bwrap.getFrameWidth('lr');
-
-        if(this.frame){
-            var l = this.bwrap.dom.firstChild;
-            w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r'));
-            var mc = this.bwrap.dom.firstChild.firstChild.firstChild;
-            w += Ext.fly(mc).getFrameWidth('lr');
-        }
-        return w;
-    },
-
-    /**
-     * Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and
-     * header and footer elements, but not including the body height).  To retrieve the body height see {@link #getInnerHeight}.
-     * @return {Number} The frame height
-     */
-    getFrameHeight : function(){
-        var h  = this.el.getFrameWidth('tb')+this.bwrap.getFrameWidth('tb');
-        h += (this.tbar ? this.tbar.getHeight() : 0) +
-             (this.bbar ? this.bbar.getHeight() : 0);
-
-        if(this.frame){
-            var hd = this.el.dom.firstChild;
-            var ft = this.bwrap.dom.lastChild;
-            h += (hd.offsetHeight + ft.offsetHeight);
-            var mc = this.bwrap.dom.firstChild.firstChild.firstChild;
-            h += Ext.fly(mc).getFrameWidth('tb');
-        }else{
-            h += (this.header ? this.header.getHeight() : 0) +
-                (this.footer ? this.footer.getHeight() : 0);
+    applySubTemplate : function(id, values, parent, xindex, xcount){
+        var me = this,
+               len,
+               t = me.tpls[id],
+               vs,
+               buf = [];
+        if ((t.test && !t.test.call(me, values, parent, xindex, xcount)) ||
+            (t.exec && t.exec.call(me, values, parent, xindex, xcount))) {
+            return '';
         }
-        return h;
-    },
-
-    /**
-     * Returns the width in pixels of the body element (not including the width of any framing elements).
-     * For the frame width see {@link #getFrameWidth}.
-     * @return {Number} The body width
-     */
-    getInnerWidth : function(){
-        return this.getSize().width - this.getFrameWidth();
-    },
-
-    /**
-     * Returns the height in pixels of the body element (not including the height of any framing elements).
-     * For the frame height see {@link #getFrameHeight}.
-     * @return {Number} The body height
-     */
-    getInnerHeight : function(){
-        return this.getSize().height - this.getFrameHeight();
-    },
-
-    // private
-    syncShadow : function(){
-        if(this.floating){
-            this.el.sync(true);
+        vs = t.target ? t.target.call(me, values, parent) : values;
+        len = vs.length;
+        parent = t.target ? values : parent;
+        if(t.target && Ext.isArray(vs)){
+               Ext.each(vs, function(v, i) {
+                buf[buf.length] = t.compiled.call(me, v, parent, i+1, len);
+            });
+            return buf.join('');
         }
+        return t.compiled.call(me, vs, parent, xindex, xcount);
     },
 
     // private
-    getLayoutTarget : function(){
-        return this.body;
-    },
-
-    /**
-     * <p>Sets the title text for the panel and optionally the {@link #iconCls icon class}.</p>
-     * <p>In order to be able to set the title, a header element must have been created
-     * for the Panel. This is triggered either by configuring the Panel with a non-blank <tt>{@link #title}</tt>,
-     * or configuring it with <tt><b>{@link #header}: true</b></tt>.</p>
-     * @param {String} title The title text to set
-     * @param {String} iconCls (optional) {@link #iconCls iconCls} A user-defined CSS class that provides the icon image for this panel
-     */
-    setTitle : function(title, iconCls){
-        this.title = title;
-        if(this.header && this.headerAsText){
-            this.header.child('span').update(title);
-        }
-        if(iconCls){
-            this.setIconClass(iconCls);
-        }
-        this.fireEvent('titlechange', this, title);
-        return this;
-    },
-
-    /**
-     * Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body.
-     * @return {Ext.Updater} The Updater
-     */
-    getUpdater : function(){
-        return this.body.getUpdater();
-    },
-
-     /**
-     * Loads this content panel immediately with content returned from an XHR call.
-     * @param {Object/String/Function} config A config object containing any of the following options:
-<pre><code>
-panel.load({
-    url: "your-url.php",
-    params: {param1: "foo", param2: "bar"}, // or a URL encoded string
-    callback: yourFunction,
-    scope: yourObject, // optional scope for the callback
-    discardUrl: false,
-    nocache: false,
-    text: "Loading...",
-    timeout: 30,
-    scripts: false
-});
-</code></pre>
-     * The only required property is url. The optional properties nocache, text and scripts
-     * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their
-     * associated property on this panel Updater instance.
-     * @return {Ext.Panel} this
-     */
-    load : function(){
-        var um = this.body.getUpdater();
-        um.update.apply(um, arguments);
-        return this;
-    },
+    compileTpl : function(tpl){
+        var fm = Ext.util.Format,
+                       useF = this.disableFormats !== true,
+            sep = Ext.isGecko ? "+" : ",",
+            body;
 
-    // private
-    beforeDestroy : function(){
-        if(this.header){
-            this.header.removeAllListeners();
-            if(this.headerAsText){
-                Ext.Element.uncache(this.header.child('span'));
+        function fn(m, name, format, args, math){
+            if(name.substr(0, 4) == 'xtpl'){
+                return "'"+ sep +'this.applySubTemplate('+name.substr(4)+', values, parent, xindex, xcount)'+sep+"'";
             }
-        }
-        Ext.Element.uncache(
-            this.header,
-            this.tbar,
-            this.bbar,
-            this.footer,
-            this.body,
-            this.bwrap
-        );
-        if(this.tools){
-            for(var k in this.tools){
-                Ext.destroy(this.tools[k]);
+            var v;
+            if(name === '.'){
+                v = 'values';
+            }else if(name === '#'){
+                v = 'xindex';
+            }else if(name.indexOf('.') != -1){
+                v = name;
+            }else{
+                v = "values['" + name + "']";
             }
-        }
-        if(this.buttons){
-            for(var b in this.buttons){
-                Ext.destroy(this.buttons[b]);
+            if(math){
+                v = '(' + v + math + ')';
             }
+            if (format && useF) {
+                args = args ? ',' + args : "";
+                if(format.substr(0, 5) != "this."){
+                    format = "fm." + format + '(';
+                }else{
+                    format = 'this.call("'+ format.substr(5) + '", ';
+                    args = ", values";
+                }
+            } else {
+                args= ''; format = "("+v+" === undefined ? '' : ";
+            }
+            return "'"+ sep + format + v + args + ")"+sep+"'";
         }
-        Ext.destroy(this.toolbars);
-        Ext.Panel.superclass.beforeDestroy.call(this);
-    },
-
-    // private
-    createClasses : function(){
-        this.headerCls = this.baseCls + '-header';
-        this.headerTextCls = this.baseCls + '-header-text';
-        this.bwrapCls = this.baseCls + '-bwrap';
-        this.tbarCls = this.baseCls + '-tbar';
-        this.bodyCls = this.baseCls + '-body';
-        this.bbarCls = this.baseCls + '-bbar';
-        this.footerCls = this.baseCls + '-footer';
-    },
-
-    // private
-    createGhost : function(cls, useShim, appendTo){
-        var el = document.createElement('div');
-        el.className = 'x-panel-ghost ' + (cls ? cls : '');
-        if(this.header){
-            el.appendChild(this.el.dom.firstChild.cloneNode(true));
-        }
-        Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight());
-        el.style.width = this.el.dom.offsetWidth + 'px';;
-        if(!appendTo){
-            this.container.dom.appendChild(el);
-        }else{
-            Ext.getDom(appendTo).appendChild(el);
-        }
-        if(useShim !== false && this.el.useShim !== false){
-            var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el);
-            layer.show();
-            return layer;
-        }else{
-            return new Ext.Element(el);
-        }
-    },
-
-    // private
-    doAutoLoad : function(){
-        var u = this.body.getUpdater();
-        if(this.renderer){
-            u.setRenderer(this.renderer);
-        }
-        u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad});
-    },
-
-    /**
-     * Retrieve a tool by id.
-     * @param {String} id
-     * @return {Object} tool
-     */
-    getTool : function(id) {
-        return this.tools[id];
-    }
-
-/**
- * @cfg {String} autoEl @hide
- */
-});
-Ext.reg('panel', Ext.Panel);
-/**
- * @class Ext.Editor
- * @extends Ext.Component
- * A base editor field that handles displaying/hiding on demand and has some built-in sizing and event handling logic.
- * @constructor
- * Create a new Editor
- * @param {Object} config The config object
- * @xtype editor
- */
-Ext.Editor = function(field, config){
-    if(field.field){
-        this.field = Ext.create(field.field, 'textfield');
-        config = Ext.apply({}, field); // copy so we don't disturb original config
-        delete config.field;
-    }else{
-        this.field = field;
-    }
-    Ext.Editor.superclass.constructor.call(this, config);
-};
-
-Ext.extend(Ext.Editor, Ext.Component, {
-    /**
-    * @cfg {Ext.form.Field} field
-    * The Field object (or descendant) or config object for field
-    */
-    /**
-     * @cfg {Boolean} allowBlur
-     * True to {@link #completeEdit complete the editing process} if in edit mode when the
-     * field is blurred. Defaults to <tt>false</tt>.
-     */
-    /**
-     * @cfg {Boolean/String} autoSize
-     * True for the editor to automatically adopt the size of the element being edited, "width" to adopt the width only,
-     * or "height" to adopt the height only (defaults to false)
-     */
-    /**
-     * @cfg {Boolean} revertInvalid
-     * True to automatically revert the field value and cancel the edit when the user completes an edit and the field
-     * validation fails (defaults to true)
-     */
-    /**
-     * @cfg {Boolean} ignoreNoChange
-     * True to skip the edit completion process (no save, no events fired) if the user completes an edit and
-     * the value has not changed (defaults to false).  Applies only to string values - edits for other data types
-     * will never be ignored.
-     */
-    /**
-     * @cfg {Boolean} hideEl
-     * False to keep the bound element visible while the editor is displayed (defaults to true)
-     */
-    /**
-     * @cfg {Mixed} value
-     * The data value of the underlying field (defaults to "")
-     */
-    value : "",
-    /**
-     * @cfg {String} alignment
-     * The position to align to (see {@link Ext.Element#alignTo} for more details, defaults to "c-c?").
-     */
-    alignment: "c-c?",
-    /**
-     * @cfg {Boolean/String} shadow "sides" for sides/bottom only, "frame" for 4-way shadow, and "drop"
-     * for bottom-right shadow (defaults to "frame")
-     */
-    shadow : "frame",
-    /**
-     * @cfg {Boolean} constrain True to constrain the editor to the viewport
-     */
-    constrain : false,
-    /**
-     * @cfg {Boolean} swallowKeys Handle the keydown/keypress events so they don't propagate (defaults to true)
-     */
-    swallowKeys : true,
-    /**
-     * @cfg {Boolean} completeOnEnter True to complete the edit when the enter key is pressed (defaults to false)
-     */
-    completeOnEnter : false,
-    /**
-     * @cfg {Boolean} cancelOnEsc True to cancel the edit when the escape key is pressed (defaults to false)
-     */
-    cancelOnEsc : false,
-    /**
-     * @cfg {Boolean} updateEl True to update the innerHTML of the bound element when the update completes (defaults to false)
-     */
-    updateEl : false,
-
-    initComponent : function(){
-        Ext.Editor.superclass.initComponent.call(this);
-        this.addEvents(
-            /**
-             * @event beforestartedit
-             * Fires when editing is initiated, but before the value changes.  Editing can be canceled by returning
-             * false from the handler of this event.
-             * @param {Editor} this
-             * @param {Ext.Element} boundEl The underlying element bound to this editor
-             * @param {Mixed} value The field value being set
-             */
-            "beforestartedit",
-            /**
-             * @event startedit
-             * Fires when this editor is displayed
-             * @param {Ext.Element} boundEl The underlying element bound to this editor
-             * @param {Mixed} value The starting field value
-             */
-            "startedit",
-            /**
-             * @event beforecomplete
-             * Fires after a change has been made to the field, but before the change is reflected in the underlying
-             * field.  Saving the change to the field can be canceled by returning false from the handler of this event.
-             * Note that if the value has not changed and ignoreNoChange = true, the editing will still end but this
-             * event will not fire since no edit actually occurred.
-             * @param {Editor} this
-             * @param {Mixed} value The current field value
-             * @param {Mixed} startValue The original field value
-             */
-            "beforecomplete",
-            /**
-             * @event complete
-             * Fires after editing is complete and any changed value has been written to the underlying field.
-             * @param {Editor} this
-             * @param {Mixed} value The current field value
-             * @param {Mixed} startValue The original field value
-             */
-            "complete",
-            /**
-             * @event canceledit
-             * Fires after editing has been canceled and the editor's value has been reset.
-             * @param {Editor} this
-             * @param {Mixed} value The user-entered field value that was discarded
-             * @param {Mixed} startValue The original field value that was set back into the editor after cancel
-             */
-            "canceledit",
-            /**
-             * @event specialkey
-             * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed.  You can check
-             * {@link Ext.EventObject#getKey} to determine which key was pressed.
-             * @param {Ext.form.Field} this
-             * @param {Ext.EventObject} e The event object
-             */
-            "specialkey"
-        );
-    },
-
-    // private
-    onRender : function(ct, position){
-        this.el = new Ext.Layer({
-            shadow: this.shadow,
-            cls: "x-editor",
-            parentEl : ct,
-            shim : this.shim,
-            shadowOffset: this.shadowOffset || 4,
-            id: this.id,
-            constrain: this.constrain
-        });
-        if(this.zIndex){
-            this.el.setZIndex(this.zIndex);
-        }
-        this.el.setStyle("overflow", Ext.isGecko ? "auto" : "hidden");
-        if(this.field.msgTarget != 'title'){
-            this.field.msgTarget = 'qtip';
-        }
-        this.field.inEditor = true;
-        this.field.render(this.el);
-        if(Ext.isGecko){
-            this.field.el.dom.setAttribute('autocomplete', 'off');
-        }
-        this.mon(this.field, "specialkey", this.onSpecialKey, this);
-        if(this.swallowKeys){
-            this.field.el.swallowEvent(['keydown','keypress']);
-        }
-        this.field.show();
-        this.mon(this.field, "blur", this.onBlur, this);
-        if(this.field.grow){
-               this.mon(this.field, "autosize", this.el.sync,  this.el, {delay:1});
+
+        function codeFn(m, code){
+            // Single quotes get escaped when the template is compiled, however we want to undo this when running code.
+            return "'" + sep + '(' + code.replace(/\\'/g, "'") + ')' + sep + "'";
         }
-    },
 
-    // private
-    onSpecialKey : function(field, e){
-        var key = e.getKey();
-        if(this.completeOnEnter && key == e.ENTER){
-            e.stopEvent();
-            this.completeEdit();
-        }else if(this.cancelOnEsc && key == e.ESC){
-            this.cancelEdit();
+        // branched to use + in gecko and [].join() in others
+        if(Ext.isGecko){
+            body = "tpl.compiled = function(values, parent, xindex, xcount){ return '" +
+                   tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn) +
+                    "';};";
         }else{
-            this.fireEvent('specialkey', field, e);
-        }
-        if(this.field.triggerBlur && (key == e.ENTER || key == e.ESC || key == e.TAB)){
-            this.field.triggerBlur();
+            body = ["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];
+            body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn).replace(this.codeRe, codeFn));
+            body.push("'].join('');};");
+            body = body.join('');
         }
+        eval(body);
+        return this;
     },
 
     /**
-     * Starts the editing process and shows the editor.
-     * @param {Mixed} el The element to edit
-     * @param {String} value (optional) A value to initialize the editor with. If a value is not provided, it defaults
-      * to the innerHTML of el.
+     * Returns an HTML fragment of this template with the specified values applied.
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @return {String} The HTML fragment
      */
-    startEdit : function(el, value){
-        if(this.editing){
-            this.completeEdit();
-        }
-        this.boundEl = Ext.get(el);
-        var v = value !== undefined ? value : this.boundEl.dom.innerHTML;
-        if(!this.rendered){
-            this.render(this.parentEl || document.body);
-        }
-        if(this.fireEvent("beforestartedit", this, this.boundEl, v) === false){
-            return;
-        }
-        this.startValue = v;
-        this.field.setValue(v);
-        this.doAutoSize();
-        this.el.alignTo(this.boundEl, this.alignment);
-        this.editing = true;
-        this.show();
-    },
-
-    // private
-    doAutoSize : function(){
-        if(this.autoSize){
-            var sz = this.boundEl.getSize();
-            switch(this.autoSize){
-                case "width":
-                    this.setSize(sz.width,  "");
-                break;
-                case "height":
-                    this.setSize("",  sz.height);
-                break;
-                default:
-                    this.setSize(sz.width,  sz.height);
-            }
-        }
+    applyTemplate : function(values){
+        return this.master.compiled.call(this, values, {}, 1, 1);
     },
 
     /**
-     * Sets the height and width of this editor.
-     * @param {Number} width The new width
-     * @param {Number} height The new height
+     * Compile the template to a function for optimized performance.  Recommended if the template will be used frequently.
+     * @return {Function} The compiled function
      */
-    setSize : function(w, h){
-        delete this.field.lastSize;
-        this.field.setSize(w, h);
-        if(this.el){
-            if(Ext.isGecko2 || Ext.isOpera){
-                // prevent layer scrollbars
-                this.el.setSize(w, h);
-            }
-            this.el.sync();
-        }
-    },
+    compile : function(){return this;}
 
     /**
-     * Realigns the editor to the bound field based on the current alignment config value.
+     * @property re
+     * @hide
      */
-    realign : function(){
-        this.el.alignTo(this.boundEl, this.alignment);
-    },
-
     /**
-     * Ends the editing process, persists the changed value to the underlying field, and hides the editor.
-     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after edit (defaults to false)
+     * @property disableFormats
+     * @hide
+     */
+    /**
+     * @method set
+     * @hide
      */
-    completeEdit : function(remainVisible){
-        if(!this.editing){
-            return;
-        }
-        var v = this.getValue();
-        if(!this.field.isValid()){
-            if(this.revertInvalid !== false){
-                this.cancelEdit(remainVisible);
-            }
-            return;
-        }
-        if(String(v) === String(this.startValue) && this.ignoreNoChange){
-            this.hideEdit(remainVisible);
-            return;
-        }
-        if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){
-            v = this.getValue();
-            if(this.updateEl && this.boundEl){
-                this.boundEl.update(v);
-            }
-            this.hideEdit(remainVisible);
-            this.fireEvent("complete", this, v, this.startValue);
-        }
-    },
 
-    // private
-    onShow : function(){
-        this.el.show();
-        if(this.hideEl !== false){
-            this.boundEl.hide();
-        }
-        this.field.show();
-        if(Ext.isIE && !this.fixIEFocus){ // IE has problems with focusing the first time
-            this.fixIEFocus = true;
-            this.deferredFocus.defer(50, this);
-        }else{
-            this.field.focus();
-        }
-        this.fireEvent("startedit", this.boundEl, this.startValue);
-    },
+});
+/**
+ * Alias for {@link #applyTemplate}
+ * Returns an HTML fragment of this template with the specified values applied.
+ * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+ * @return {String} The HTML fragment
+ * @member Ext.XTemplate
+ * @method apply
+ */
+Ext.XTemplate.prototype.apply = Ext.XTemplate.prototype.applyTemplate;
 
-    deferredFocus : function(){
-        if(this.editing){
-            this.field.focus();
-        }
-    },
+/**
+ * Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.
+ * @param {String/HTMLElement} el A DOM element or its id
+ * @return {Ext.Template} The created template
+ * @static
+ */
+Ext.XTemplate.from = function(el){
+    el = Ext.getDom(el);
+    return new Ext.XTemplate(el.value || el.innerHTML);
+};/**\r
+ * @class Ext.util.CSS\r
+ * Utility class for manipulating CSS rules\r
+ * @singleton\r
+ */\r
+Ext.util.CSS = function(){\r
+       var rules = null;\r
+       var doc = document;\r
+\r
+    var camelRe = /(-[a-z])/gi;\r
+    var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); };\r
+\r
+   return {\r
+   /**\r
+    * Creates a stylesheet from a text blob of rules.\r
+    * These rules will be wrapped in a STYLE tag and appended to the HEAD of the document.\r
+    * @param {String} cssText The text containing the css rules\r
+    * @param {String} id An id to add to the stylesheet for later removal\r
+    * @return {StyleSheet}\r
+    */\r
+   createStyleSheet : function(cssText, id){\r
+       var ss;\r
+       var head = doc.getElementsByTagName("head")[0];\r
+       var rules = doc.createElement("style");\r
+       rules.setAttribute("type", "text/css");\r
+       if(id){\r
+           rules.setAttribute("id", id);\r
+       }\r
+       if(Ext.isIE){\r
+           head.appendChild(rules);\r
+           ss = rules.styleSheet;\r
+           ss.cssText = cssText;\r
+       }else{\r
+           try{\r
+                rules.appendChild(doc.createTextNode(cssText));\r
+           }catch(e){\r
+               rules.cssText = cssText;\r
+           }\r
+           head.appendChild(rules);\r
+           ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]);\r
+       }\r
+       this.cacheStyleSheet(ss);\r
+       return ss;\r
+   },\r
+\r
+   /**\r
+    * Removes a style or link tag by id\r
+    * @param {String} id The id of the tag\r
+    */\r
+   removeStyleSheet : function(id){\r
+       var existing = doc.getElementById(id);\r
+       if(existing){\r
+           existing.parentNode.removeChild(existing);\r
+       }\r
+   },\r
+\r
+   /**\r
+    * Dynamically swaps an existing stylesheet reference for a new one\r
+    * @param {String} id The id of an existing link tag to remove\r
+    * @param {String} url The href of the new stylesheet to include\r
+    */\r
+   swapStyleSheet : function(id, url){\r
+       this.removeStyleSheet(id);\r
+       var ss = doc.createElement("link");\r
+       ss.setAttribute("rel", "stylesheet");\r
+       ss.setAttribute("type", "text/css");\r
+       ss.setAttribute("id", id);\r
+       ss.setAttribute("href", url);\r
+       doc.getElementsByTagName("head")[0].appendChild(ss);\r
+   },\r
+   \r
+   /**\r
+    * Refresh the rule cache if you have dynamically added stylesheets\r
+    * @return {Object} An object (hash) of rules indexed by selector\r
+    */\r
+   refreshCache : function(){\r
+       return this.getRules(true);\r
+   },\r
+\r
+   // private\r
+   cacheStyleSheet : function(ss){\r
+       if(!rules){\r
+           rules = {};\r
+       }\r
+       try{// try catch for cross domain access issue\r
+           var ssRules = ss.cssRules || ss.rules;\r
+           for(var j = ssRules.length-1; j >= 0; --j){\r
+               rules[ssRules[j].selectorText.toLowerCase()] = ssRules[j];\r
+           }\r
+       }catch(e){}\r
+   },\r
+   \r
+   /**\r
+    * Gets all css rules for the document\r
+    * @param {Boolean} refreshCache true to refresh the internal cache\r
+    * @return {Object} An object (hash) of rules indexed by selector\r
+    */\r
+   getRules : function(refreshCache){\r
+               if(rules === null || refreshCache){\r
+                       rules = {};\r
+                       var ds = doc.styleSheets;\r
+                       for(var i =0, len = ds.length; i < len; i++){\r
+                           try{\r
+                       this.cacheStyleSheet(ds[i]);\r
+                   }catch(e){} \r
+               }\r
+               }\r
+               return rules;\r
+       },\r
+       \r
+       /**\r
+    * Gets an an individual CSS rule by selector(s)\r
+    * @param {String/Array} selector The CSS selector or an array of selectors to try. The first selector that is found is returned.\r
+    * @param {Boolean} refreshCache true to refresh the internal cache if you have recently updated any rules or added styles dynamically\r
+    * @return {CSSRule} The CSS rule or null if one is not found\r
+    */\r
+   getRule : function(selector, refreshCache){\r
+               var rs = this.getRules(refreshCache);\r
+               if(!Ext.isArray(selector)){\r
+                   return rs[selector.toLowerCase()];\r
+               }\r
+               for(var i = 0; i < selector.length; i++){\r
+                       if(rs[selector[i]]){\r
+                               return rs[selector[i].toLowerCase()];\r
+                       }\r
+               }\r
+               return null;\r
+       },\r
+       \r
+       \r
+       /**\r
+    * Updates a rule property\r
+    * @param {String/Array} selector If it's an array it tries each selector until it finds one. Stops immediately once one is found.\r
+    * @param {String} property The css property\r
+    * @param {String} value The new value for the property\r
+    * @return {Boolean} true If a rule was found and updated\r
+    */\r
+   updateRule : function(selector, property, value){\r
+               if(!Ext.isArray(selector)){\r
+                       var rule = this.getRule(selector);\r
+                       if(rule){\r
+                               rule.style[property.replace(camelRe, camelFn)] = value;\r
+                               return true;\r
+                       }\r
+               }else{\r
+                       for(var i = 0; i < selector.length; i++){\r
+                               if(this.updateRule(selector[i], property, value)){\r
+                                       return true;\r
+                               }\r
+                       }\r
+               }\r
+               return false;\r
+       }\r
+   };  \r
+}();/**
+ @class Ext.util.ClickRepeater
+ @extends Ext.util.Observable
 
-    /**
-     * Cancels the editing process and hides the editor without persisting any changes.  The field value will be
-     * reverted to the original starting value.
-     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after
-     * cancel (defaults to false)
-     */
-    cancelEdit : function(remainVisible){
-        if(this.editing){
-            var v = this.getValue();
-            this.setValue(this.startValue);
-            this.hideEdit(remainVisible);
-            this.fireEvent("canceledit", this, v, this.startValue);
-        }
-    },
-    
-    // private
-    hideEdit: function(remainVisible){
-        if(remainVisible !== true){
-            this.editing = false;
-            this.hide();
-        }
-    },
+ A wrapper class which can be applied to any element. Fires a "click" event while the
+ mouse is pressed. The interval between firings may be specified in the config but
+ defaults to 20 milliseconds.
 
-    // private
-    onBlur : function(){
-        if(this.allowBlur !== true && this.editing){
-            this.completeEdit();
-        }
-    },
+ Optionally, a CSS class may be applied to the element during the time it is pressed.
 
-    // private
-    onHide : function(){
-        if(this.editing){
-            this.completeEdit();
-            return;
-        }
-        this.field.blur();
-        if(this.field.collapse){
-            this.field.collapse();
-        }
-        this.el.hide();
-        if(this.hideEl !== false){
-            this.boundEl.show();
-        }
-    },
+ @cfg {Mixed} el The element to act as a button.
+ @cfg {Number} delay The initial delay before the repeating event begins firing.
+ Similar to an autorepeat key delay.
+ @cfg {Number} interval The interval between firings of the "click" event. Default 20 ms.
+ @cfg {String} pressClass A CSS class name to be applied to the element while pressed.
+ @cfg {Boolean} accelerate True if autorepeating should start slowly and accelerate.
+           "interval" and "delay" are ignored.
+ @cfg {Boolean} preventDefault True to prevent the default click event
+ @cfg {Boolean} stopDefault True to stop the default click event
+
+ @history
+    2007-02-02 jvs Original code contributed by Nige "Animal" White
+    2007-02-02 jvs Renamed to ClickRepeater
+    2007-02-03 jvs Modifications for FF Mac and Safari
+
+ @constructor
+ @param {Mixed} el The element to listen on
+ @param {Object} config
+ */
+Ext.util.ClickRepeater = function(el, config)
+{
+    this.el = Ext.get(el);
+    this.el.unselectable();
+
+    Ext.apply(this, config);
 
+    this.addEvents(
     /**
-     * Sets the data value of the editor
-     * @param {Mixed} value Any valid value supported by the underlying field
+     * @event mousedown
+     * Fires when the mouse button is depressed.
+     * @param {Ext.util.ClickRepeater} this
      */
-    setValue : function(v){
-        this.field.setValue(v);
-    },
-
+        "mousedown",
     /**
-     * Gets the data value of the editor
-     * @return {Mixed} The data value
+     * @event click
+     * Fires on a specified interval during the time the element is pressed.
+     * @param {Ext.util.ClickRepeater} this
      */
-    getValue : function(){
-        return this.field.getValue();
-    },
+        "click",
+    /**
+     * @event mouseup
+     * Fires when the mouse key is released.
+     * @param {Ext.util.ClickRepeater} this
+     */
+        "mouseup"
+    );
 
-    beforeDestroy : function(){
-        Ext.destroy(this.field);
-        this.field = null;
+    if(!this.disabled){
+        this.disabled = true;
+        this.enable();
     }
-});
-Ext.reg('editor', Ext.Editor);/**
- * @class Ext.ColorPalette
- * @extends Ext.Component
- * Simple color palette class for choosing colors.  The palette can be rendered to any container.<br />
- * Here's an example of typical usage:
- * <pre><code>
-var cp = new Ext.ColorPalette({value:'993300'});  // initial selected color
-cp.render('my-div');
-
-cp.on('select', function(palette, selColor){
-    // do something with selColor
-});
-</code></pre>
- * @constructor
- * Create a new ColorPalette
- * @param {Object} config The config object
- * @xtype colorpalette
- */
-Ext.ColorPalette = function(config){
-    Ext.ColorPalette.superclass.constructor.call(this, config);
-    this.addEvents(
-        /**
-            * @event select
-            * Fires when a color is selected
-            * @param {ColorPalette} this
-            * @param {String} color The 6-digit color hex code (without the # symbol)
-            */
-        'select'
-    );
 
+    // allow inline handler
     if(this.handler){
-        this.on("select", this.handler, this.scope, true);
+        this.on("click", this.handler,  this.scope || this);
     }
+
+    Ext.util.ClickRepeater.superclass.constructor.call(this);
 };
-Ext.extend(Ext.ColorPalette, Ext.Component, {
-       /**
-        * @cfg {String} tpl An existing XTemplate instance to be used in place of the default template for rendering the component.
-        */
+
+Ext.extend(Ext.util.ClickRepeater, Ext.util.Observable, {
+    interval : 20,
+    delay: 250,
+    preventDefault : true,
+    stopDefault : false,
+    timer : 0,
+
     /**
-     * @cfg {String} itemCls
-     * The CSS class to apply to the containing element (defaults to "x-color-palette")
+     * Enables the repeater and allows events to fire.
+     */
+    enable: function(){
+        if(this.disabled){
+            this.el.on('mousedown', this.handleMouseDown, this);
+            if(this.preventDefault || this.stopDefault){
+                this.el.on('click', this.eventOptions, this);
+            }
+        }
+        this.disabled = false;
+    },
+    
+    /**
+     * Disables the repeater and stops events from firing.
      */
-    itemCls : "x-color-palette",
+    disable: function(/* private */ force){
+        if(force || !this.disabled){
+            clearTimeout(this.timer);
+            if(this.pressClass){
+                this.el.removeClass(this.pressClass);
+            }
+            Ext.getDoc().un('mouseup', this.handleMouseUp, this);
+            this.el.removeAllListeners();
+        }
+        this.disabled = true;
+    },
+    
     /**
-     * @cfg {String} value
-     * The initial color to highlight (should be a valid 6-digit color hex code without the # symbol).  Note that
-     * the hex codes are case-sensitive.
+     * Convenience function for setting disabled/enabled by boolean.
+     * @param {Boolean} disabled
      */
-    value : null,
-    clickEvent:'click',
+    setDisabled: function(disabled){
+        this[disabled ? 'disable' : 'enable']();    
+    },
+    
+    eventOptions: function(e){
+        if(this.preventDefault){
+            e.preventDefault();
+        }
+        if(this.stopDefault){
+            e.stopEvent();
+        }       
+    },
+    
+    // private
+    destroy : function() {
+        this.disable(true);
+        Ext.destroy(this.el);
+        this.purgeListeners();
+    },
+    
     // private
-    ctype: "Ext.ColorPalette",
+    handleMouseDown : function(){
+        clearTimeout(this.timer);
+        this.el.blur();
+        if(this.pressClass){
+            this.el.addClass(this.pressClass);
+        }
+        this.mousedownTime = new Date();
 
-    /**
-     * @cfg {Boolean} allowReselect If set to true then reselecting a color that is already selected fires the {@link #select} event
-     */
-    allowReselect : false,
+        Ext.getDoc().on("mouseup", this.handleMouseUp, this);
+        this.el.on("mouseout", this.handleMouseOut, this);
 
-    /**
-     * <p>An array of 6-digit color hex code strings (without the # symbol).  This array can contain any number
-     * of colors, and each hex code should be unique.  The width of the palette is controlled via CSS by adjusting
-     * the width property of the 'x-color-palette' class (or assigning a custom class), so you can balance the number
-     * of colors with the width setting until the box is symmetrical.</p>
-     * <p>You can override individual colors if needed:</p>
-     * <pre><code>
-var cp = new Ext.ColorPalette();
-cp.colors[0] = "FF0000";  // change the first box to red
-</code></pre>
+        this.fireEvent("mousedown", this);
+        this.fireEvent("click", this);
 
-Or you can provide a custom array of your own for complete control:
-<pre><code>
-var cp = new Ext.ColorPalette();
-cp.colors = ["000000", "993300", "333300"];
-</code></pre>
-     * @type Array
-     */
-    colors : [
-        "000000", "993300", "333300", "003300", "003366", "000080", "333399", "333333",
-        "800000", "FF6600", "808000", "008000", "008080", "0000FF", "666699", "808080",
-        "FF0000", "FF9900", "99CC00", "339966", "33CCCC", "3366FF", "800080", "969696",
-        "FF00FF", "FFCC00", "FFFF00", "00FF00", "00FFFF", "00CCFF", "993366", "C0C0C0",
-        "FF99CC", "FFCC99", "FFFF99", "CCFFCC", "CCFFFF", "99CCFF", "CC99FF", "FFFFFF"
-    ],
+//      Do not honor delay or interval if acceleration wanted.
+        if (this.accelerate) {
+            this.delay = 400;
+           }
+        this.timer = this.click.defer(this.delay || this.interval, this);
+    },
 
     // private
-    onRender : function(container, position){
-        var t = this.tpl || new Ext.XTemplate(
-            '<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>'
-        );
-        var el = document.createElement("div");
-        el.id = this.getId();
-        el.className = this.itemCls;
-        t.overwrite(el, this.colors);
-        container.dom.insertBefore(el, position);
-        this.el = Ext.get(el);
-        this.mon(this.el, this.clickEvent, this.handleClick, this, {delegate: 'a'});
-        if(this.clickEvent != 'click'){
-               this.mon(this.el, 'click', Ext.emptyFn, this, {delegate: 'a', preventDefault: true});
-        }
+    click : function(){
+        this.fireEvent("click", this);
+        this.timer = this.click.defer(this.accelerate ?
+            this.easeOutExpo(this.mousedownTime.getElapsed(),
+                400,
+                -390,
+                12000) :
+            this.interval, this);
+    },
+
+    easeOutExpo : function (t, b, c, d) {
+        return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
     },
 
     // private
-    afterRender : function(){
-        Ext.ColorPalette.superclass.afterRender.call(this);
-        if(this.value){
-            var s = this.value;
-            this.value = null;
-            this.select(s);
+    handleMouseOut : function(){
+        clearTimeout(this.timer);
+        if(this.pressClass){
+            this.el.removeClass(this.pressClass);
         }
+        this.el.on("mouseover", this.handleMouseReturn, this);
     },
 
     // private
-    handleClick : function(e, t){
-        e.preventDefault();
-        if(!this.disabled){
-            var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
-            this.select(c.toUpperCase());
+    handleMouseReturn : function(){
+        this.el.un("mouseover", this.handleMouseReturn, this);
+        if(this.pressClass){
+            this.el.addClass(this.pressClass);
         }
+        this.click();
     },
 
-    /**
-     * Selects the specified color in the palette (fires the {@link #select} event)
-     * @param {String} color A valid 6-digit color hex code (# will be stripped if included)
-     */
-    select : function(color){
-        color = color.replace("#", "");
-        if(color != this.value || this.allowReselect){
-            var el = this.el;
-            if(this.value){
-                el.child("a.color-"+this.value).removeClass("x-color-palette-sel");
-            }
-            el.child("a.color-"+color).addClass("x-color-palette-sel");
-            this.value = color;
-            this.fireEvent("select", this, color);
-        }
+    // private
+    handleMouseUp : function(){
+        clearTimeout(this.timer);
+        this.el.un("mouseover", this.handleMouseReturn, this);
+        this.el.un("mouseout", this.handleMouseOut, this);
+        Ext.getDoc().un("mouseup", this.handleMouseUp, this);
+        this.el.removeClass(this.pressClass);
+        this.fireEvent("mouseup", this);
     }
-
-    /**
-     * @cfg {String} autoEl @hide
-     */
+});/**
+ * @class Ext.KeyNav
+ * <p>Provides a convenient wrapper for normalized keyboard navigation.  KeyNav allows you to bind
+ * navigation keys to function calls that will get called when the keys are pressed, providing an easy
+ * way to implement custom navigation schemes for any UI component.</p>
+ * <p>The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc,
+ * pageUp, pageDown, del, home, end.  Usage:</p>
+ <pre><code>
+var nav = new Ext.KeyNav("my-element", {
+    "left" : function(e){
+        this.moveLeft(e.ctrlKey);
+    },
+    "right" : function(e){
+        this.moveRight(e.ctrlKey);
+    },
+    "enter" : function(e){
+        this.save();
+    },
+    scope : this
 });
-Ext.reg('colorpalette', Ext.ColorPalette);/**\r
- * @class Ext.DatePicker\r
- * @extends Ext.Component\r
- * Simple date picker class.\r
- * @constructor\r
- * Create a new DatePicker\r
- * @param {Object} config The config object\r
- * @xtype datepicker\r
- */\r
-Ext.DatePicker = Ext.extend(Ext.BoxComponent, {\r
-    /**\r
-     * @cfg {String} todayText\r
-     * The text to display on the button that selects the current date (defaults to <tt>'Today'</tt>)\r
-     */\r
-    todayText : 'Today',\r
-    /**\r
-     * @cfg {String} okText\r
-     * The text to display on the ok button (defaults to <tt>'&#160;OK&#160;'</tt> to give the user extra clicking room)\r
-     */\r
-    okText : '&#160;OK&#160;',\r
-    /**\r
-     * @cfg {String} cancelText\r
-     * The text to display on the cancel button (defaults to <tt>'Cancel'</tt>)\r
-     */\r
-    cancelText : 'Cancel',\r
-    /**\r
-     * @cfg {String} todayTip\r
-     * The tooltip to display for the button that selects the current date (defaults to <tt>'{current date} (Spacebar)'</tt>)\r
-     */\r
-    todayTip : '{0} (Spacebar)',\r
-    /**\r
-     * @cfg {String} minText\r
-     * The error text to display if the minDate validation fails (defaults to <tt>'This date is before the minimum date'</tt>)\r
-     */\r
-    minText : 'This date is before the minimum date',\r
-    /**\r
-     * @cfg {String} maxText\r
-     * The error text to display if the maxDate validation fails (defaults to <tt>'This date is after the maximum date'</tt>)\r
-     */\r
-    maxText : 'This date is after the maximum date',\r
-    /**\r
-     * @cfg {String} format\r
-     * The default date format string which can be overriden for localization support.  The format must be\r
-     * valid according to {@link Date#parseDate} (defaults to <tt>'m/d/y'</tt>).\r
-     */\r
-    format : 'm/d/y',\r
-    /**\r
-     * @cfg {String} disabledDaysText\r
-     * The tooltip to display when the date falls on a disabled day (defaults to <tt>'Disabled'</tt>)\r
-     */\r
-    disabledDaysText : 'Disabled',\r
-    /**\r
-     * @cfg {String} disabledDatesText\r
-     * The tooltip text to display when the date falls on a disabled date (defaults to <tt>'Disabled'</tt>)\r
-     */\r
-    disabledDatesText : 'Disabled',\r
-    /**\r
-     * @cfg {Array} monthNames\r
-     * An array of textual month names which can be overriden for localization support (defaults to Date.monthNames)\r
-     */\r
-    monthNames : Date.monthNames,\r
-    /**\r
-     * @cfg {Array} dayNames\r
-     * An array of textual day names which can be overriden for localization support (defaults to Date.dayNames)\r
-     */\r
-    dayNames : Date.dayNames,\r
-    /**\r
-     * @cfg {String} nextText\r
-     * The next month navigation button tooltip (defaults to <tt>'Next Month (Control+Right)'</tt>)\r
-     */\r
-    nextText : 'Next Month (Control+Right)',\r
-    /**\r
-     * @cfg {String} prevText\r
-     * The previous month navigation button tooltip (defaults to <tt>'Previous Month (Control+Left)'</tt>)\r
-     */\r
-    prevText : 'Previous Month (Control+Left)',\r
-    /**\r
-     * @cfg {String} monthYearText\r
-     * The header month selector tooltip (defaults to <tt>'Choose a month (Control+Up/Down to move years)'</tt>)\r
-     */\r
-    monthYearText : 'Choose a month (Control+Up/Down to move years)',\r
-    /**\r
-     * @cfg {Number} startDay\r
-     * Day index at which the week should begin, 0-based (defaults to 0, which is Sunday)\r
-     */\r
-    startDay : 0,\r
-    /**\r
-     * @cfg {Boolean} showToday\r
-     * False to hide the footer area containing the Today button and disable the keyboard handler for spacebar\r
-     * that selects the current date (defaults to <tt>true</tt>).\r
-     */\r
-    showToday : true,\r
-    /**\r
-     * @cfg {Date} minDate\r
-     * Minimum allowable date (JavaScript date object, defaults to null)\r
-     */\r
-    /**\r
-     * @cfg {Date} maxDate\r
-     * Maximum allowable date (JavaScript date object, defaults to null)\r
-     */\r
-    /**\r
-     * @cfg {Array} disabledDays\r
-     * An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday (defaults to null).\r
-     */\r
-    /**\r
-     * @cfg {RegExp} disabledDatesRE\r
-     * JavaScript regular expression used to disable a pattern of dates (defaults to null).  The {@link #disabledDates}\r
-     * config will generate this regex internally, but if you specify disabledDatesRE it will take precedence over the\r
-     * disabledDates value.\r
-     */\r
-    /**\r
-     * @cfg {Array} disabledDates\r
-     * An array of 'dates' to disable, as strings. These strings will be used to build a dynamic regular\r
-     * expression so they are very powerful. Some examples:\r
-     * <ul>\r
-     * <li>['03/08/2003', '09/16/2003'] would disable those exact dates</li>\r
-     * <li>['03/08', '09/16'] would disable those days for every year</li>\r
-     * <li>['^03/08'] would only match the beginning (useful if you are using short years)</li>\r
-     * <li>['03/../2006'] would disable every day in March 2006</li>\r
-     * <li>['^03'] would disable every day in every March</li>\r
-     * </ul>\r
-     * Note that the format of the dates included in the array should exactly match the {@link #format} config.\r
-     * In order to support regular expressions, if you are using a date format that has '.' in it, you will have to\r
-     * escape the dot when restricting dates. For example: ['03\\.08\\.03'].\r
-     */\r
-\r
-    // private\r
-    initComponent : function(){\r
-        Ext.DatePicker.superclass.initComponent.call(this);\r
-\r
-        this.value = this.value ?\r
-                 this.value.clearTime() : new Date().clearTime();\r
-\r
-        this.addEvents(\r
-            /**\r
-             * @event select\r
-             * Fires when a date is selected\r
-             * @param {DatePicker} this\r
-             * @param {Date} date The selected date\r
-             */\r
-            'select'\r
-        );\r
-\r
-        if(this.handler){\r
-            this.on('select', this.handler,  this.scope || this);\r
-        }\r
-\r
-        this.initDisabledDays();\r
-    },\r
-\r
-    // private\r
-    initDisabledDays : function(){\r
-        if(!this.disabledDatesRE && this.disabledDates){\r
-            var dd = this.disabledDates,\r
-                len = dd.length - 1,\r
-                re = '(?:';\r
-                \r
-            Ext.each(dd, function(d, i){\r
-                re += Ext.isDate(d) ? '^' + Ext.escapeRe(d.dateFormat(this.format)) + '$' : dd[i];\r
-                if(i != len){\r
-                    re += '|';\r
-                }\r
-            }, this);\r
-            this.disabledDatesRE = new RegExp(re + ')');\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Replaces any existing disabled dates with new values and refreshes the DatePicker.\r
-     * @param {Array/RegExp} disabledDates An array of date strings (see the {@link #disabledDates} config\r
-     * for details on supported values), or a JavaScript regular expression used to disable a pattern of dates.\r
-     */\r
-    setDisabledDates : function(dd){\r
-        if(Ext.isArray(dd)){\r
-            this.disabledDates = dd;\r
-            this.disabledDatesRE = null;\r
-        }else{\r
-            this.disabledDatesRE = dd;\r
-        }\r
-        this.initDisabledDays();\r
-        this.update(this.value, true);\r
-    },\r
-\r
-    /**\r
-     * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the DatePicker.\r
-     * @param {Array} disabledDays An array of disabled day indexes. See the {@link #disabledDays} config\r
-     * for details on supported values.\r
-     */\r
-    setDisabledDays : function(dd){\r
-        this.disabledDays = dd;\r
-        this.update(this.value, true);\r
-    },\r
-\r
-    /**\r
-     * Replaces any existing {@link #minDate} with the new value and refreshes the DatePicker.\r
-     * @param {Date} value The minimum date that can be selected\r
-     */\r
-    setMinDate : function(dt){\r
-        this.minDate = dt;\r
-        this.update(this.value, true);\r
-    },\r
-\r
-    /**\r
-     * Replaces any existing {@link #maxDate} with the new value and refreshes the DatePicker.\r
-     * @param {Date} value The maximum date that can be selected\r
-     */\r
-    setMaxDate : function(dt){\r
-        this.maxDate = dt;\r
-        this.update(this.value, true);\r
-    },\r
-\r
-    /**\r
-     * Sets the value of the date field\r
-     * @param {Date} value The date to set\r
-     */\r
-    setValue : function(value){\r
-        var old = this.value;\r
-        this.value = value.clearTime(true);\r
-        if(this.el){\r
-            this.update(this.value);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Gets the current selected value of the date field\r
-     * @return {Date} The selected date\r
-     */\r
-    getValue : function(){\r
-        return this.value;\r
-    },\r
-\r
-    // private\r
-    focus : function(){\r
-        if(this.el){\r
-            this.update(this.activeDate);\r
-        }\r
-    },\r
-    \r
-    // private\r
-    onEnable: function(initial){\r
-        Ext.DatePicker.superclass.onEnable.call(this);    \r
-        this.doDisabled(false);\r
-        this.update(initial ? this.value : this.activeDate);\r
-        if(Ext.isIE){\r
-            this.el.repaint();\r
-        }\r
-        \r
-    },\r
-    \r
-    // private\r
-    onDisable: function(){\r
-        Ext.DatePicker.superclass.onDisable.call(this);   \r
-        this.doDisabled(true);\r
-        if(Ext.isIE && !Ext.isIE8){\r
-            /* Really strange problem in IE6/7, when disabled, have to explicitly\r
-             * repaint each of the nodes to get them to display correctly, simply\r
-             * calling repaint on the main element doesn't appear to be enough.\r
-             */\r
-             Ext.each([].concat(this.textNodes, this.el.query('th span')), function(el){\r
-                 Ext.fly(el).repaint();\r
-             });\r
-        }\r
-    },\r
-    \r
-    // private\r
-    doDisabled: function(disabled){\r
-        this.keyNav.setDisabled(disabled);\r
-        this.prevRepeater.setDisabled(disabled);\r
-        this.nextRepeater.setDisabled(disabled);\r
-        if(this.showToday){\r
-            this.todayKeyListener.setDisabled(disabled);\r
-            this.todayBtn.setDisabled(disabled);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onRender : function(container, position){\r
-        var m = [\r
-             '<table cellspacing="0">',\r
-                '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">&#160;</a></td></tr>',\r
-                '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],\r
-                dn = this.dayNames,\r
-                i;\r
-        for(i = 0; i < 7; i++){\r
-            var d = this.startDay+i;\r
-            if(d > 6){\r
-                d = d-7;\r
-            }\r
-            m.push('<th><span>', dn[d].substr(0,1), '</span></th>');\r
-        }\r
-        m[m.length] = '</tr></thead><tbody><tr>';\r
-        for(i = 0; i < 42; i++) {\r
-            if(i % 7 === 0 && i !== 0){\r
-                m[m.length] = '</tr><tr>';\r
-            }\r
-            m[m.length] = '<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>';\r
-        }\r
-        m.push('</tr></tbody></table></td></tr>',\r
-                this.showToday ? '<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>' : '',\r
-                '</table><div class="x-date-mp"></div>');\r
-\r
-        var el = document.createElement('div');\r
-        el.className = 'x-date-picker';\r
-        el.innerHTML = m.join('');\r
-\r
-        container.dom.insertBefore(el, position);\r
-\r
-        this.el = Ext.get(el);\r
-        this.eventEl = Ext.get(el.firstChild);\r
-\r
-        this.prevRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-left a'), {\r
-            handler: this.showPrevMonth,\r
-            scope: this,\r
-            preventDefault:true,\r
-            stopDefault:true\r
-        });\r
-\r
-        this.nextRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-right a'), {\r
-            handler: this.showNextMonth,\r
-            scope: this,\r
-            preventDefault:true,\r
-            stopDefault:true\r
-        });\r
-\r
-        this.monthPicker = this.el.down('div.x-date-mp');\r
-        this.monthPicker.enableDisplayMode('block');\r
-\r
-        this.keyNav = new Ext.KeyNav(this.eventEl, {\r
-            'left' : function(e){\r
-                if(e.ctrlKey){\r
-                    this.showPrevMonth();\r
-                }else{\r
-                    this.update(this.activeDate.add('d', -1));    \r
-                }\r
-            },\r
-\r
-            'right' : function(e){\r
-                if(e.ctrlKey){\r
-                    this.showNextMonth();\r
-                }else{\r
-                    this.update(this.activeDate.add('d', 1));    \r
-                }\r
-            },\r
-\r
-            'up' : function(e){\r
-                if(e.ctrlKey){\r
-                    this.showNextYear();\r
-                }else{\r
-                    this.update(this.activeDate.add('d', -7));\r
-                }\r
-            },\r
-\r
-            'down' : function(e){\r
-                if(e.ctrlKey){\r
-                    this.showPrevYear();\r
-                }else{\r
-                    this.update(this.activeDate.add('d', 7));\r
-                }\r
-            },\r
-\r
-            'pageUp' : function(e){\r
-                this.showNextMonth();\r
-            },\r
-\r
-            'pageDown' : function(e){\r
-                this.showPrevMonth();\r
-            },\r
-\r
-            'enter' : function(e){\r
-                e.stopPropagation();\r
-                return true;\r
-            },\r
-\r
-            scope : this\r
-        });\r
-\r
-        this.el.unselectable();\r
-\r
-        this.cells = this.el.select('table.x-date-inner tbody td');\r
-        this.textNodes = this.el.query('table.x-date-inner tbody span');\r
-\r
-        this.mbtn = new Ext.Button({\r
-            text: '&#160;',\r
-            tooltip: this.monthYearText,\r
-            renderTo: this.el.child('td.x-date-middle', true)\r
-        });\r
-        this.mbtn.el.child('em').addClass('x-btn-arrow');\r
-\r
-        if(this.showToday){\r
-            this.todayKeyListener = this.eventEl.addKeyListener(Ext.EventObject.SPACE, this.selectToday,  this);\r
-            var today = (new Date()).dateFormat(this.format);\r
-            this.todayBtn = new Ext.Button({\r
-                renderTo: this.el.child('td.x-date-bottom', true),\r
-                text: String.format(this.todayText, today),\r
-                tooltip: String.format(this.todayTip, today),\r
-                handler: this.selectToday,\r
-                scope: this\r
-            });\r
-        }\r
-        this.mon(this.eventEl, 'mousewheel', this.handleMouseWheel, this);\r
-        this.mon(this.eventEl, 'click', this.handleDateClick,  this, {delegate: 'a.x-date-date'});\r
-        this.mon(this.mbtn, 'click', this.showMonthPicker, this);\r
-        this.onEnable(true);\r
-    },\r
-\r
-    // private\r
-    createMonthPicker : function(){\r
-        if(!this.monthPicker.dom.firstChild){\r
-            var buf = ['<table border="0" cellspacing="0">'];\r
-            for(var i = 0; i < 6; i++){\r
-                buf.push(\r
-                    '<tr><td class="x-date-mp-month"><a href="#">', Date.getShortMonthName(i), '</a></td>',\r
-                    '<td class="x-date-mp-month x-date-mp-sep"><a href="#">', Date.getShortMonthName(i + 6), '</a></td>',\r
-                    i === 0 ?\r
-                    '<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>' :\r
-                    '<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>'\r
-                );\r
-            }\r
-            buf.push(\r
-                '<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',\r
-                    this.okText,\r
-                    '</button><button type="button" class="x-date-mp-cancel">',\r
-                    this.cancelText,\r
-                    '</button></td></tr>',\r
-                '</table>'\r
-            );\r
-            this.monthPicker.update(buf.join(''));\r
-\r
-            this.mon(this.monthPicker, 'click', this.onMonthClick, this);\r
-            this.mon(this.monthPicker, 'dblclick', this.onMonthDblClick, this);\r
-\r
-            this.mpMonths = this.monthPicker.select('td.x-date-mp-month');\r
-            this.mpYears = this.monthPicker.select('td.x-date-mp-year');\r
-\r
-            this.mpMonths.each(function(m, a, i){\r
-                i += 1;\r
-                if((i%2) === 0){\r
-                    m.dom.xmonth = 5 + Math.round(i * 0.5);\r
-                }else{\r
-                    m.dom.xmonth = Math.round((i-1) * 0.5);\r
-                }\r
-            });\r
-        }\r
-    },\r
-\r
-    // private\r
-    showMonthPicker : function(){\r
-        if(!this.disabled){\r
-            this.createMonthPicker();\r
-            var size = this.el.getSize();\r
-            this.monthPicker.setSize(size);\r
-            this.monthPicker.child('table').setSize(size);\r
-\r
-            this.mpSelMonth = (this.activeDate || this.value).getMonth();\r
-            this.updateMPMonth(this.mpSelMonth);\r
-            this.mpSelYear = (this.activeDate || this.value).getFullYear();\r
-            this.updateMPYear(this.mpSelYear);\r
-\r
-            this.monthPicker.slideIn('t', {duration:0.2});\r
-        }\r
-    },\r
-\r
-    // private\r
-    updateMPYear : function(y){\r
-        this.mpyear = y;\r
-        var ys = this.mpYears.elements;\r
-        for(var i = 1; i <= 10; i++){\r
-            var td = ys[i-1], y2;\r
-            if((i%2) === 0){\r
-                y2 = y + Math.round(i * 0.5);\r
-                td.firstChild.innerHTML = y2;\r
-                td.xyear = y2;\r
-            }else{\r
-                y2 = y - (5-Math.round(i * 0.5));\r
-                td.firstChild.innerHTML = y2;\r
-                td.xyear = y2;\r
-            }\r
-            this.mpYears.item(i-1)[y2 == this.mpSelYear ? 'addClass' : 'removeClass']('x-date-mp-sel');\r
-        }\r
-    },\r
-\r
-    // private\r
-    updateMPMonth : function(sm){\r
-        this.mpMonths.each(function(m, a, i){\r
-            m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel');\r
-        });\r
-    },\r
-\r
-    // private\r
-    selectMPMonth : function(m){\r
-\r
-    },\r
-\r
-    // private\r
-    onMonthClick : function(e, t){\r
-        e.stopEvent();\r
-        var el = new Ext.Element(t), pn;\r
-        if(el.is('button.x-date-mp-cancel')){\r
-            this.hideMonthPicker();\r
-        }\r
-        else if(el.is('button.x-date-mp-ok')){\r
-            var d = new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate());\r
-            if(d.getMonth() != this.mpSelMonth){\r
-                // 'fix' the JS rolling date conversion if needed\r
-                d = new Date(this.mpSelYear, this.mpSelMonth, 1).getLastDateOfMonth();\r
-            }\r
-            this.update(d);\r
-            this.hideMonthPicker();\r
-        }\r
-        else if((pn = el.up('td.x-date-mp-month', 2))){\r
-            this.mpMonths.removeClass('x-date-mp-sel');\r
-            pn.addClass('x-date-mp-sel');\r
-            this.mpSelMonth = pn.dom.xmonth;\r
-        }\r
-        else if((pn = el.up('td.x-date-mp-year', 2))){\r
-            this.mpYears.removeClass('x-date-mp-sel');\r
-            pn.addClass('x-date-mp-sel');\r
-            this.mpSelYear = pn.dom.xyear;\r
-        }\r
-        else if(el.is('a.x-date-mp-prev')){\r
-            this.updateMPYear(this.mpyear-10);\r
-        }\r
-        else if(el.is('a.x-date-mp-next')){\r
-            this.updateMPYear(this.mpyear+10);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onMonthDblClick : function(e, t){\r
-        e.stopEvent();\r
-        var el = new Ext.Element(t), pn;\r
-        if((pn = el.up('td.x-date-mp-month', 2))){\r
-            this.update(new Date(this.mpSelYear, pn.dom.xmonth, (this.activeDate || this.value).getDate()));\r
-            this.hideMonthPicker();\r
-        }\r
-        else if((pn = el.up('td.x-date-mp-year', 2))){\r
-            this.update(new Date(pn.dom.xyear, this.mpSelMonth, (this.activeDate || this.value).getDate()));\r
-            this.hideMonthPicker();\r
-        }\r
-    },\r
-\r
-    // private\r
-    hideMonthPicker : function(disableAnim){\r
-        if(this.monthPicker){\r
-            if(disableAnim === true){\r
-                this.monthPicker.hide();\r
-            }else{\r
-                this.monthPicker.slideOut('t', {duration:0.2});\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    showPrevMonth : function(e){\r
-        this.update(this.activeDate.add('mo', -1));\r
-    },\r
-\r
-    // private\r
-    showNextMonth : function(e){\r
-        this.update(this.activeDate.add('mo', 1));\r
-    },\r
-\r
-    // private\r
-    showPrevYear : function(){\r
-        this.update(this.activeDate.add('y', -1));\r
-    },\r
-\r
-    // private\r
-    showNextYear : function(){\r
-        this.update(this.activeDate.add('y', 1));\r
-    },\r
-\r
-    // private\r
-    handleMouseWheel : function(e){\r
-        e.stopEvent();\r
-        if(!this.disabled){\r
-            var delta = e.getWheelDelta();\r
-            if(delta > 0){\r
-                this.showPrevMonth();\r
-            } else if(delta < 0){\r
-                this.showNextMonth();\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    handleDateClick : function(e, t){\r
-        e.stopEvent();\r
-        if(!this.disabled && t.dateValue && !Ext.fly(t.parentNode).hasClass('x-date-disabled')){\r
-            this.setValue(new Date(t.dateValue));\r
-            this.fireEvent('select', this, this.value);\r
-        }\r
-    },\r
-\r
-    // private\r
-    selectToday : function(){\r
-        if(this.todayBtn && !this.todayBtn.disabled){\r
-            this.setValue(new Date().clearTime());\r
-            this.fireEvent('select', this, this.value);\r
-        }\r
-    },\r
-\r
-    // private\r
-    update : function(date, forceRefresh){\r
-        var vd = this.activeDate, vis = this.isVisible();\r
-        this.activeDate = date;\r
-        if(!forceRefresh && vd && this.el){\r
-            var t = date.getTime();\r
-            if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){\r
-                this.cells.removeClass('x-date-selected');\r
-                this.cells.each(function(c){\r
-                   if(c.dom.firstChild.dateValue == t){\r
-                       c.addClass('x-date-selected');\r
-                       if(vis){\r
-                           Ext.fly(c.dom.firstChild).focus(50);\r
-                       }\r
-                       return false;\r
-                   }\r
-                });\r
-                return;\r
-            }\r
-        }\r
-        var days = date.getDaysInMonth();\r
-        var firstOfMonth = date.getFirstDateOfMonth();\r
-        var startingPos = firstOfMonth.getDay()-this.startDay;\r
-\r
-        if(startingPos <= this.startDay){\r
-            startingPos += 7;\r
-        }\r
-\r
-        var pm = date.add('mo', -1);\r
-        var prevStart = pm.getDaysInMonth()-startingPos;\r
-\r
-        var cells = this.cells.elements;\r
-        var textEls = this.textNodes;\r
-        days += startingPos;\r
-\r
-        // convert everything to numbers so it's fast\r
-        var day = 86400000;\r
-        var d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart)).clearTime();\r
-        var today = new Date().clearTime().getTime();\r
-        var sel = date.clearTime().getTime();\r
-        var min = this.minDate ? this.minDate.clearTime() : Number.NEGATIVE_INFINITY;\r
-        var max = this.maxDate ? this.maxDate.clearTime() : Number.POSITIVE_INFINITY;\r
-        var ddMatch = this.disabledDatesRE;\r
-        var ddText = this.disabledDatesText;\r
-        var ddays = this.disabledDays ? this.disabledDays.join('') : false;\r
-        var ddaysText = this.disabledDaysText;\r
-        var format = this.format;\r
-\r
-        if(this.showToday){\r
-            var td = new Date().clearTime();\r
-            var disable = (td < min || td > max ||\r
-                (ddMatch && format && ddMatch.test(td.dateFormat(format))) ||\r
-                (ddays && ddays.indexOf(td.getDay()) != -1));\r
-\r
-            if(!this.disabled){\r
-                this.todayBtn.setDisabled(disable);\r
-                this.todayKeyListener[disable ? 'disable' : 'enable']();\r
-            }\r
-        }\r
-\r
-        var setCellClass = function(cal, cell){\r
-            cell.title = '';\r
-            var t = d.getTime();\r
-            cell.firstChild.dateValue = t;\r
-            if(t == today){\r
-                cell.className += ' x-date-today';\r
-                cell.title = cal.todayText;\r
-            }\r
-            if(t == sel){\r
-                cell.className += ' x-date-selected';\r
-                if(vis){\r
-                    Ext.fly(cell.firstChild).focus(50);\r
-                }\r
-            }\r
-            // disabling\r
-            if(t < min) {\r
-                cell.className = ' x-date-disabled';\r
-                cell.title = cal.minText;\r
-                return;\r
-            }\r
-            if(t > max) {\r
-                cell.className = ' x-date-disabled';\r
-                cell.title = cal.maxText;\r
-                return;\r
-            }\r
-            if(ddays){\r
-                if(ddays.indexOf(d.getDay()) != -1){\r
-                    cell.title = ddaysText;\r
-                    cell.className = ' x-date-disabled';\r
-                }\r
-            }\r
-            if(ddMatch && format){\r
-                var fvalue = d.dateFormat(format);\r
-                if(ddMatch.test(fvalue)){\r
-                    cell.title = ddText.replace('%0', fvalue);\r
-                    cell.className = ' x-date-disabled';\r
-                }\r
-            }\r
-        };\r
-\r
-        var i = 0;\r
-        for(; i < startingPos; i++) {\r
-            textEls[i].innerHTML = (++prevStart);\r
-            d.setDate(d.getDate()+1);\r
-            cells[i].className = 'x-date-prevday';\r
-            setCellClass(this, cells[i]);\r
-        }\r
-        for(; i < days; i++){\r
-            var intDay = i - startingPos + 1;\r
-            textEls[i].innerHTML = (intDay);\r
-            d.setDate(d.getDate()+1);\r
-            cells[i].className = 'x-date-active';\r
-            setCellClass(this, cells[i]);\r
-        }\r
-        var extraDays = 0;\r
-        for(; i < 42; i++) {\r
-             textEls[i].innerHTML = (++extraDays);\r
-             d.setDate(d.getDate()+1);\r
-             cells[i].className = 'x-date-nextday';\r
-             setCellClass(this, cells[i]);\r
-        }\r
-\r
-        this.mbtn.setText(this.monthNames[date.getMonth()] + ' ' + date.getFullYear());\r
-\r
-        if(!this.internalRender){\r
-            var main = this.el.dom.firstChild;\r
-            var w = main.offsetWidth;\r
-            this.el.setWidth(w + this.el.getBorderWidth('lr'));\r
-            Ext.fly(main).setWidth(w);\r
-            this.internalRender = true;\r
-            // opera does not respect the auto grow header center column\r
-            // then, after it gets a width opera refuses to recalculate\r
-            // without a second pass\r
-            if(Ext.isOpera && !this.secondPass){\r
-                main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + 'px';\r
-                this.secondPass = true;\r
-                this.update.defer(10, this, [date]);\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    beforeDestroy : function() {\r
-        if(this.rendered){\r
-            this.keyNav.disable();\r
-            this.keyNav = null;\r
-            Ext.destroy(\r
-                this.leftClickRpt,\r
-                this.rightClickRpt,\r
-                this.monthPicker,\r
-                this.eventEl,\r
-                this.mbtn,\r
-                this.todayBtn\r
-            );\r
-        }\r
-    }\r
-\r
-    /**\r
-     * @cfg {String} autoEl @hide\r
-     */\r
-});\r
-\r
-Ext.reg('datepicker', Ext.DatePicker);\r
-/**
- * @class Ext.LoadMask
- * A simple utility class for generically masking elements while loading data.  If the {@link #store}
- * config option is specified, the masking will be automatically synchronized with the store's loading
- * process and the mask element will be cached for reuse.  For all other elements, this mask will replace the
- * element's Updater load indicator and will be destroyed after the initial load.
- * <p>Example usage:</p>
- *<pre><code>
-// Basic mask:
-var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
-myMask.show();
 </code></pre>
  * @constructor
- * Create a new LoadMask
- * @param {Mixed} el The element or DOM node, or its id
- * @param {Object} config The config object
+ * @param {Mixed} el The element to bind to
+ * @param {Object} config The config
  */
-Ext.LoadMask = function(el, config){
+Ext.KeyNav = function(el, config){
     this.el = Ext.get(el);
     Ext.apply(this, config);
-    if(this.store){
-        this.store.on('beforeload', this.onBeforeLoad, this);
-        this.store.on('load', this.onLoad, this);
-        this.store.on('exception', this.onLoad, this);
-        this.removeMask = Ext.value(this.removeMask, false);
-    }else{
-        var um = this.el.getUpdater();
-        um.showLoadIndicator = false; // disable the default indicator
-        um.on('beforeupdate', this.onBeforeLoad, this);
-        um.on('update', this.onLoad, this);
-        um.on('failure', this.onLoad, this);
-        this.removeMask = Ext.value(this.removeMask, true);
+    if(!this.disabled){
+        this.disabled = true;
+        this.enable();
     }
 };
 
-Ext.LoadMask.prototype = {
-    /**
-     * @cfg {Ext.data.Store} store
-     * Optional Store to which the mask is bound. The mask is displayed when a load request is issued, and
-     * hidden on either load sucess, or load fail.
-     */
+Ext.KeyNav.prototype = {
     /**
-     * @cfg {Boolean} removeMask
-     * True to create a single-use mask that is automatically destroyed after loading (useful for page loads),
-     * False to persist the mask element reference for multiple uses (e.g., for paged data widgets).  Defaults to false.
+     * @cfg {Boolean} disabled
+     * True to disable this KeyNav instance (defaults to false)
      */
+    disabled : false,
     /**
-     * @cfg {String} msg
-     * The text to display in a centered loading message box (defaults to 'Loading...')
+     * @cfg {String} defaultEventAction
+     * The method to call on the {@link Ext.EventObject} after this KeyNav intercepts a key.  Valid values are
+     * {@link Ext.EventObject#stopEvent}, {@link Ext.EventObject#preventDefault} and
+     * {@link Ext.EventObject#stopPropagation} (defaults to 'stopEvent')
      */
-    msg : 'Loading...',
+    defaultEventAction: "stopEvent",
     /**
-     * @cfg {String} msgCls
-     * The CSS class to apply to the loading message element (defaults to "x-mask-loading")
+     * @cfg {Boolean} forceKeyDown
+     * Handle the keydown event instead of keypress (defaults to false).  KeyNav automatically does this for IE since
+     * IE does not propagate special keys on keypress, but setting this to true will force other browsers to also
+     * handle keydown instead of keypress.
      */
-    msgCls : 'x-mask-loading',
+    forceKeyDown : false,
 
-    /**
-     * Read-only. True if the mask is currently disabled so that it will not be displayed (defaults to false)
-     * @type Boolean
-     */
-    disabled: false,
+    // private
+    relay : function(e){
+        var k = e.getKey();
+        var h = this.keyToHandler[k];
+        if(h && this[h]){
+            if(this.doRelay(e, this[h], h) !== true){
+                e[this.defaultEventAction]();
+            }
+        }
+    },
 
-    /**
-     * Disables the mask to prevent it from being displayed
-     */
-    disable : function(){
-       this.disabled = true;
+    // private
+    doRelay : function(e, h, hname){
+        return h.call(this.scope || this, e);
+    },
+
+    // possible handlers
+    enter : false,
+    left : false,
+    right : false,
+    up : false,
+    down : false,
+    tab : false,
+    esc : false,
+    pageUp : false,
+    pageDown : false,
+    del : false,
+    home : false,
+    end : false,
+
+    // quick lookup hash
+    keyToHandler : {
+        37 : "left",
+        39 : "right",
+        38 : "up",
+        40 : "down",
+        33 : "pageUp",
+        34 : "pageDown",
+        46 : "del",
+        36 : "home",
+        35 : "end",
+        13 : "enter",
+        27 : "esc",
+        9  : "tab"
     },
+    
+    stopKeyUp: function(e) {
+        var k = e.getKey();
 
+        if (k >= 37 && k <= 40) {
+            // *** bugfix - safari 2.x fires 2 keyup events on cursor keys
+            // *** (note: this bugfix sacrifices the "keyup" event originating from keyNav elements in Safari 2)
+            e.stopEvent();
+        }
+    },
+    
     /**
-     * Enables the mask so that it can be displayed
+     * Destroy this KeyNav (this is the same as calling disable).
      */
-    enable : function(){
-        this.disabled = false;
+    destroy: function(){
+        this.disable();    
     },
 
-    // private
-    onLoad : function(){
-        this.el.unmask(this.removeMask);
-    },
+       /**
+        * Enable this KeyNav
+        */
+       enable: function() {
+        if (this.disabled) {
+            if (Ext.isSafari2) {
+                // call stopKeyUp() on "keyup" event
+                this.el.on('keyup', this.stopKeyUp, this);
+            }
 
-    // private
-    onBeforeLoad : function(){
-        if(!this.disabled){
-            this.el.mask(this.msg, this.msgCls);
+            this.el.on(this.isKeydown()? 'keydown' : 'keypress', this.relay, this);
+            this.disabled = false;
         }
     },
 
-    /**
-     * Show this LoadMask over the configured Element.
-     */
-    show: function(){
-        this.onBeforeLoad();
-    },
+       /**
+        * Disable this KeyNav
+        */
+       disable: function() {
+        if (!this.disabled) {
+            if (Ext.isSafari2) {
+                // remove "keyup" event handler
+                this.el.un('keyup', this.stopKeyUp, this);
+            }
 
+            this.el.un(this.isKeydown()? 'keydown' : 'keypress', this.relay, this);
+            this.disabled = true;
+        }
+    },
+    
     /**
-     * Hide this LoadMask.
+     * Convenience function for setting disabled/enabled by boolean.
+     * @param {Boolean} disabled
      */
-    hide: function(){
-        this.onLoad();
+    setDisabled : function(disabled){
+        this[disabled ? "disable" : "enable"]();
     },
-
+    
     // private
-    destroy : function(){
-        if(this.store){
-            this.store.un('beforeload', this.onBeforeLoad, this);
-            this.store.un('load', this.onLoad, this);
-            this.store.un('exception', this.onLoad, this);
-        }else{
-            var um = this.el.getUpdater();
-            um.un('beforeupdate', this.onBeforeLoad, this);
-            um.un('update', this.onLoad, this);
-            um.un('failure', this.onLoad, this);
-        }
+    isKeydown: function(){
+        return this.forceKeyDown || Ext.EventManager.useKeydown;
     }
-};/**\r
- * @class Ext.Slider\r
- * @extends Ext.BoxComponent\r
- * Slider which supports vertical or horizontal orientation, keyboard adjustments,\r
- * configurable snapping, axis clicking and animation. Can be added as an item to\r
- * any container. Example usage:\r
-<pre><code>\r
-new Ext.Slider({\r
-    renderTo: Ext.getBody(),\r
-    width: 200,\r
-    value: 50,\r
-    increment: 10,\r
-    minValue: 0,\r
-    maxValue: 100\r
-});\r
-</code></pre>\r
- */\r
-Ext.Slider = Ext.extend(Ext.BoxComponent, {\r
-       /**\r
-        * @cfg {Number} value The value to initialize the slider with. Defaults to minValue.\r
-        */\r
-       /**\r
-        * @cfg {Boolean} vertical Orient the Slider vertically rather than horizontally, defaults to false.\r
-        */\r
-    vertical: false,\r
-       /**\r
-        * @cfg {Number} minValue The minimum value for the Slider. Defaults to 0.\r
-        */\r
-    minValue: 0,\r
-       /**\r
-        * @cfg {Number} maxValue The maximum value for the Slider. Defaults to 100.\r
-        */\r
-    maxValue: 100,\r
-    /**\r
-     * @cfg {Number/Boolean} decimalPrecision.\r
-     * <p>The number of decimal places to which to round the Slider's value. Defaults to 0.</p>\r
-     * <p>To disable rounding, configure as <tt><b>false</b></tt>.</p>\r
-     */\r
-    decimalPrecision: 0,\r
-       /**\r
-        * @cfg {Number} keyIncrement How many units to change the Slider when adjusting with keyboard navigation. Defaults to 1. If the increment config is larger, it will be used instead.\r
-        */\r
-    keyIncrement: 1,\r
-       /**\r
-        * @cfg {Number} increment How many units to change the slider when adjusting by drag and drop. Use this option to enable 'snapping'.\r
-        */\r
-    increment: 0,\r
-       // private\r
-    clickRange: [5,15],\r
-       /**\r
-        * @cfg {Boolean} clickToChange Determines whether or not clicking on the Slider axis will change the slider. Defaults to true\r
-        */\r
-    clickToChange : true,\r
-       /**\r
-        * @cfg {Boolean} animate Turn on or off animation. Defaults to true\r
-        */\r
-    animate: true,\r
-\r
-    /**\r
-     * True while the thumb is in a drag operation\r
-     * @type boolean\r
-     */\r
-    dragging: false,\r
-\r
-    // private override\r
-    initComponent : function(){\r
-        if(!Ext.isDefined(this.value)){\r
-            this.value = this.minValue;\r
-        }\r
-        Ext.Slider.superclass.initComponent.call(this);\r
-        this.keyIncrement = Math.max(this.increment, this.keyIncrement);\r
-        this.addEvents(\r
-            /**\r
-             * @event beforechange\r
-             * Fires before the slider value is changed. By returning false from an event handler,\r
-             * you can cancel the event and prevent the slider from changing.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Number} newValue The new value which the slider is being changed to.\r
-                        * @param {Number} oldValue The old value which the slider was previously.\r
-             */\r
-                       'beforechange',\r
-                       /**\r
-                        * @event change\r
-                        * Fires when the slider value is changed.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Number} newValue The new value which the slider has been changed to.\r
-                        */\r
-                       'change',\r
-                       /**\r
-                        * @event changecomplete\r
-                        * Fires when the slider value is changed by the user and any drag operations have completed.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Number} newValue The new value which the slider has been changed to.\r
-                        */\r
-                       'changecomplete',\r
-                       /**\r
-                        * @event dragstart\r
-             * Fires after a drag operation has started.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
-                        */\r
-                       'dragstart',\r
-                       /**\r
-                        * @event drag\r
-             * Fires continuously during the drag operation while the mouse is moving.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
-                        */\r
-                       'drag',\r
-                       /**\r
-                        * @event dragend\r
-             * Fires after the drag operation has completed.\r
-                        * @param {Ext.Slider} slider The slider\r
-                        * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
-                        */\r
-                       'dragend'\r
-               );\r
-\r
-        if(this.vertical){\r
-            Ext.apply(this, Ext.Slider.Vertical);\r
-        }\r
-    },\r
-\r
-       // private override\r
-    onRender : function(){\r
-        this.autoEl = {\r
-            cls: 'x-slider ' + (this.vertical ? 'x-slider-vert' : 'x-slider-horz'),\r
-            cn:{cls:'x-slider-end',cn:{cls:'x-slider-inner',cn:[{cls:'x-slider-thumb'},{tag:'a', cls:'x-slider-focus', href:"#", tabIndex: '-1', hidefocus:'on'}]}}\r
-        };\r
-        Ext.Slider.superclass.onRender.apply(this, arguments);\r
-        this.endEl = this.el.first();\r
-        this.innerEl = this.endEl.first();\r
-        this.thumb = this.innerEl.first();\r
-        this.halfThumb = (this.vertical ? this.thumb.getHeight() : this.thumb.getWidth())/2;\r
-        this.focusEl = this.thumb.next();\r
-        this.initEvents();\r
-    },\r
-\r
-       // private override\r
-    initEvents : function(){\r
-        this.thumb.addClassOnOver('x-slider-thumb-over');\r
-        this.mon(this.el, {\r
-            scope: this,\r
-            mousedown: this.onMouseDown,\r
-            keydown: this.onKeyDown\r
-        });\r
-\r
-        this.focusEl.swallowEvent("click", true);\r
-\r
-        this.tracker = new Ext.dd.DragTracker({\r
-            onBeforeStart: this.onBeforeDragStart.createDelegate(this),\r
-            onStart: this.onDragStart.createDelegate(this),\r
-            onDrag: this.onDrag.createDelegate(this),\r
-            onEnd: this.onDragEnd.createDelegate(this),\r
-            tolerance: 3,\r
-            autoStart: 300\r
-        });\r
-        this.tracker.initEl(this.thumb);\r
-        this.on('beforedestroy', this.tracker.destroy, this.tracker);\r
-    },\r
-\r
-       // private override\r
-    onMouseDown : function(e){\r
-        if(this.disabled) {return;}\r
-        if(this.clickToChange && e.target != this.thumb.dom){\r
-            var local = this.innerEl.translatePoints(e.getXY());\r
-            this.onClickChange(local);\r
-        }\r
-        this.focus();\r
-    },\r
-\r
-       // private\r
-    onClickChange : function(local){\r
-        if(local.top > this.clickRange[0] && local.top < this.clickRange[1]){\r
-            this.setValue(Ext.util.Format.round(this.reverseValue(local.left), this.decimalPrecision), undefined, true);\r
-        }\r
-    },\r
-\r
-       // private\r
-    onKeyDown : function(e){\r
-        if(this.disabled){e.preventDefault();return;}\r
-        var k = e.getKey();\r
-        switch(k){\r
-            case e.UP:\r
-            case e.RIGHT:\r
-                e.stopEvent();\r
-                if(e.ctrlKey){\r
-                    this.setValue(this.maxValue, undefined, true);\r
-                }else{\r
-                    this.setValue(this.value+this.keyIncrement, undefined, true);\r
-                }\r
-            break;\r
-            case e.DOWN:\r
-            case e.LEFT:\r
-                e.stopEvent();\r
-                if(e.ctrlKey){\r
-                    this.setValue(this.minValue, undefined, true);\r
-                }else{\r
-                    this.setValue(this.value-this.keyIncrement, undefined, true);\r
-                }\r
-            break;\r
-            default:\r
-                e.preventDefault();\r
-        }\r
-    },\r
-\r
-       // private\r
-    doSnap : function(value){\r
-        if(!this.increment || this.increment == 1 || !value) {\r
-            return value;\r
-        }\r
-        var newValue = value, inc = this.increment;\r
-        var m = value % inc;\r
-        if(m != 0){\r
-            newValue -= m;\r
-            if(m * 2 > inc){\r
-                newValue += inc;\r
-            }else if(m * 2 < -inc){\r
-                newValue -= inc;\r
-            }\r
-        }\r
-        return newValue.constrain(this.minValue,  this.maxValue);\r
-    },\r
-\r
-       // private\r
-    afterRender : function(){\r
-        Ext.Slider.superclass.afterRender.apply(this, arguments);\r
-        if(this.value !== undefined){\r
-            var v = this.normalizeValue(this.value);\r
-            if(v !== this.value){\r
-                delete this.value;\r
-                this.setValue(v, false);\r
-            }else{\r
-                this.moveThumb(this.translateValue(v), false);\r
-            }\r
-        }\r
-    },\r
-\r
-       // private\r
-    getRatio : function(){\r
-        var w = this.innerEl.getWidth();\r
-        var v = this.maxValue - this.minValue;\r
-        return v == 0 ? w : (w/v);\r
-    },\r
-\r
-       // private\r
-    normalizeValue : function(v){\r
-        v = this.doSnap(v);\r
-        v = Ext.util.Format.round(v, this.decimalPrecision);\r
-        v = v.constrain(this.minValue, this.maxValue);\r
-        return v;\r
-    },\r
-\r
-       /**\r
-        * Programmatically sets the value of the Slider. Ensures that the value is constrained within\r
-        * the minValue and maxValue.\r
-        * @param {Number} value The value to set the slider to. (This will be constrained within minValue and maxValue)\r
-        * @param {Boolean} animate Turn on or off animation, defaults to true\r
-        */\r
-    setValue : function(v, animate, changeComplete){\r
-        v = this.normalizeValue(v);\r
-        if(v !== this.value && this.fireEvent('beforechange', this, v, this.value) !== false){\r
-            this.value = v;\r
-            this.moveThumb(this.translateValue(v), animate !== false);\r
-            this.fireEvent('change', this, v);\r
-            if(changeComplete){\r
-                this.fireEvent('changecomplete', this, v);\r
-            }\r
-        }\r
-    },\r
-\r
-       // private\r
-    translateValue : function(v){\r
-        var ratio = this.getRatio();\r
-        return (v * ratio)-(this.minValue * ratio)-this.halfThumb;\r
-    },\r
-\r
-       reverseValue : function(pos){\r
-        var ratio = this.getRatio();\r
-        return (pos+this.halfThumb+(this.minValue * ratio))/ratio;\r
-    },\r
-\r
-       // private\r
-    moveThumb: function(v, animate){\r
-        if(!animate || this.animate === false){\r
-            this.thumb.setLeft(v);\r
-        }else{\r
-            this.thumb.shift({left: v, stopFx: true, duration:.35});\r
-        }\r
-    },\r
-\r
-       // private\r
-    focus : function(){\r
-        this.focusEl.focus(10);\r
-    },\r
-\r
-       // private\r
-    onBeforeDragStart : function(e){\r
-        return !this.disabled;\r
-    },\r
-\r
-       // private\r
-    onDragStart: function(e){\r
-        this.thumb.addClass('x-slider-thumb-drag');\r
-        this.dragging = true;\r
-        this.dragStartValue = this.value;\r
-        this.fireEvent('dragstart', this, e);\r
-    },\r
-\r
-       // private\r
-    onDrag: function(e){\r
-        var pos = this.innerEl.translatePoints(this.tracker.getXY());\r
-        this.setValue(Ext.util.Format.round(this.reverseValue(pos.left), this.decimalPrecision), false);\r
-        this.fireEvent('drag', this, e);\r
-    },\r
-\r
-       // private\r
-    onDragEnd: function(e){\r
-        this.thumb.removeClass('x-slider-thumb-drag');\r
-        this.dragging = false;\r
-        this.fireEvent('dragend', this, e);\r
-        if(this.dragStartValue != this.value){\r
-            this.fireEvent('changecomplete', this, this.value);\r
-        }\r
-    },\r
-\r
-       // private\r
-    onResize : function(w, h){\r
-        this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r')));\r
-        this.syncThumb();\r
-    },\r
-    \r
-    //private\r
-    onDisable: function(){\r
-        Ext.Slider.superclass.onDisable.call(this);\r
-        this.thumb.addClass(this.disabledClass);\r
-        if(Ext.isIE){\r
-            //IE breaks when using overflow visible and opacity other than 1.\r
-            //Create a place holder for the thumb and display it.\r
-            var xy = this.thumb.getXY();\r
-            this.thumb.hide();\r
-            this.innerEl.addClass(this.disabledClass).dom.disabled = true;\r
-            if (!this.thumbHolder){\r
-                this.thumbHolder = this.endEl.createChild({cls: 'x-slider-thumb ' + this.disabledClass});    \r
-            }\r
-            this.thumbHolder.show().setXY(xy);\r
-        }\r
-    },\r
-    \r
-    //private\r
-    onEnable: function(){\r
-        Ext.Slider.superclass.onEnable.call(this);\r
-        this.thumb.removeClass(this.disabledClass);\r
-        if(Ext.isIE){\r
-            this.innerEl.removeClass(this.disabledClass).dom.disabled = false;\r
-            if (this.thumbHolder){\r
-                this.thumbHolder.hide();\r
-            }\r
-            this.thumb.show();\r
-            this.syncThumb();\r
-        }\r
-    },\r
-    \r
-    /**\r
-     * Synchronizes the thumb position to the proper proportion of the total component width based\r
-     * on the current slider {@link #value}.  This will be called automatically when the Slider\r
-     * is resized by a layout, but if it is rendered auto width, this method can be called from\r
-     * another resize handler to sync the Slider if necessary.\r
-     */\r
-    syncThumb : function(){\r
-        if(this.rendered){\r
-            this.moveThumb(this.translateValue(this.value));\r
-        }\r
-    },\r
-\r
-       /**\r
-        * Returns the current value of the slider\r
-        * @return {Number} The current value of the slider\r
-        */\r
-    getValue : function(){\r
-        return this.value;\r
-    }\r
-});\r
-Ext.reg('slider', Ext.Slider);\r
-\r
-// private class to support vertical sliders\r
-Ext.Slider.Vertical = {\r
-    onResize : function(w, h){\r
-        this.innerEl.setHeight(h - (this.el.getPadding('t') + this.endEl.getPadding('b')));\r
-        this.syncThumb();\r
-    },\r
-\r
-    getRatio : function(){\r
-        var h = this.innerEl.getHeight();\r
-        var v = this.maxValue - this.minValue;\r
-        return h/v;\r
-    },\r
-\r
-    moveThumb: function(v, animate){\r
-        if(!animate || this.animate === false){\r
-            this.thumb.setBottom(v);\r
-        }else{\r
-            this.thumb.shift({bottom: v, stopFx: true, duration:.35});\r
-        }\r
-    },\r
-\r
-    onDrag: function(e){\r
-        var pos = this.innerEl.translatePoints(this.tracker.getXY());\r
-        var bottom = this.innerEl.getHeight()-pos.top;\r
-        this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), false);\r
-        this.fireEvent('drag', this, e);\r
-    },\r
-\r
-    onClickChange : function(local){\r
-        if(local.left > this.clickRange[0] && local.left < this.clickRange[1]){\r
-            var bottom = this.innerEl.getHeight()-local.top;\r
-            this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), undefined, true);\r
-        }\r
-    }\r
-};/**\r
- * @class Ext.ProgressBar\r
- * @extends Ext.BoxComponent\r
- * <p>An updateable progress bar component.  The progress bar supports two different modes: manual and automatic.</p>\r
- * <p>In manual mode, you are responsible for showing, updating (via {@link #updateProgress}) and clearing the\r
- * progress bar as needed from your own code.  This method is most appropriate when you want to show progress\r
- * throughout an operation that has predictable points of interest at which you can update the control.</p>\r
- * <p>In automatic mode, you simply call {@link #wait} and let the progress bar run indefinitely, only clearing it\r
- * once the operation is complete.  You can optionally have the progress bar wait for a specific amount of time\r
- * and then clear itself.  Automatic mode is most appropriate for timed operations or asynchronous operations in\r
- * which you have no need for indicating intermediate progress.</p>\r
- * @cfg {Float} value A floating point value between 0 and 1 (e.g., .5, defaults to 0)\r
- * @cfg {String} text The progress bar text (defaults to '')\r
- * @cfg {Mixed} textEl The element to render the progress text to (defaults to the progress\r
- * bar's internal text element)\r
- * @cfg {String} id The progress bar element's id (defaults to an auto-generated id)\r
- * @xtype progress\r
- */\r
-Ext.ProgressBar = Ext.extend(Ext.BoxComponent, {\r
-   /**\r
-    * @cfg {String} baseCls\r
-    * The base CSS class to apply to the progress bar's wrapper element (defaults to 'x-progress')\r
-    */\r
-    baseCls : 'x-progress',\r
-    \r
-    /**\r
-    * @cfg {Boolean} animate\r
-    * True to animate the progress bar during transitions (defaults to false)\r
-    */\r
-    animate : false,\r
-\r
-    // private\r
-    waitTimer : null,\r
-\r
-    // private\r
-    initComponent : function(){\r
-        Ext.ProgressBar.superclass.initComponent.call(this);\r
-        this.addEvents(\r
-            /**\r
-             * @event update\r
-             * Fires after each update interval\r
-             * @param {Ext.ProgressBar} this\r
-             * @param {Number} The current progress value\r
-             * @param {String} The current progress text\r
-             */\r
-            "update"\r
-        );\r
-    },\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        var tpl = new Ext.Template(\r
-            '<div class="{cls}-wrap">',\r
-                '<div class="{cls}-inner">',\r
-                    '<div class="{cls}-bar">',\r
-                        '<div class="{cls}-text">',\r
-                            '<div>&#160;</div>',\r
-                        '</div>',\r
-                    '</div>',\r
-                    '<div class="{cls}-text {cls}-text-back">',\r
-                        '<div>&#160;</div>',\r
-                    '</div>',\r
-                '</div>',\r
-            '</div>'\r
-        );\r
-\r
-        this.el = position ? tpl.insertBefore(position, {cls: this.baseCls}, true)\r
-               : tpl.append(ct, {cls: this.baseCls}, true);\r
-                       \r
-        if(this.id){\r
-            this.el.dom.id = this.id;\r
-        }\r
-        var inner = this.el.dom.firstChild;\r
-        this.progressBar = Ext.get(inner.firstChild);\r
-\r
-        if(this.textEl){\r
-            //use an external text el\r
-            this.textEl = Ext.get(this.textEl);\r
-            delete this.textTopEl;\r
-        }else{\r
-            //setup our internal layered text els\r
-            this.textTopEl = Ext.get(this.progressBar.dom.firstChild);\r
-            var textBackEl = Ext.get(inner.childNodes[1]);\r
-            this.textTopEl.setStyle("z-index", 99).addClass('x-hidden');\r
-            this.textEl = new Ext.CompositeElement([this.textTopEl.dom.firstChild, textBackEl.dom.firstChild]);\r
-            this.textEl.setWidth(inner.offsetWidth);\r
-        }\r
-        this.progressBar.setHeight(inner.offsetHeight);\r
-    },\r
-    \r
-    // private\r
-    afterRender : function(){\r
-        Ext.ProgressBar.superclass.afterRender.call(this);\r
-        if(this.value){\r
-            this.updateProgress(this.value, this.text);\r
-        }else{\r
-            this.updateText(this.text);\r
-        }\r
-    },\r
+};
+/**\r
+ * @class Ext.KeyMap\r
+ * Handles mapping keys to actions for an element. One key map can be used for multiple actions.\r
+ * The constructor accepts the same config object as defined by {@link #addBinding}.\r
+ * If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key\r
+ * combination it will call the function with this signature (if the match is a multi-key\r
+ * combination the callback will still be called only once): (String key, Ext.EventObject e)\r
+ * A KeyMap can also handle a string representation of keys.<br />\r
+ * Usage:\r
+ <pre><code>\r
+// map one key by key code\r
+var map = new Ext.KeyMap("my-element", {\r
+    key: 13, // or Ext.EventObject.ENTER\r
+    fn: myHandler,\r
+    scope: myObject\r
+});\r
+\r
+// map multiple keys to one action by string\r
+var map = new Ext.KeyMap("my-element", {\r
+    key: "a\r\n\t",\r
+    fn: myHandler,\r
+    scope: myObject\r
+});\r
+\r
+// map multiple keys to multiple actions by strings and array of codes\r
+var map = new Ext.KeyMap("my-element", [\r
+    {\r
+        key: [10,13],\r
+        fn: function(){ alert("Return was pressed"); }\r
+    }, {\r
+        key: "abc",\r
+        fn: function(){ alert('a, b or c was pressed'); }\r
+    }, {\r
+        key: "\t",\r
+        ctrl:true,\r
+        shift:true,\r
+        fn: function(){ alert('Control + shift + tab was pressed.'); }\r
+    }\r
+]);\r
+</code></pre>\r
+ * <b>Note: A KeyMap starts enabled</b>\r
+ * @constructor\r
+ * @param {Mixed} el The element to bind to\r
+ * @param {Object} config The config (see {@link #addBinding})\r
+ * @param {String} eventName (optional) The event to bind to (defaults to "keydown")\r
+ */\r
+Ext.KeyMap = function(el, config, eventName){\r
+    this.el  = Ext.get(el);\r
+    this.eventName = eventName || "keydown";\r
+    this.bindings = [];\r
+    if(config){\r
+        this.addBinding(config);\r
+    }\r
+    this.enable();\r
+};\r
 \r
+Ext.KeyMap.prototype = {\r
     /**\r
-     * Updates the progress bar value, and optionally its text.  If the text argument is not specified,\r
-     * any existing text value will be unchanged.  To blank out existing text, pass ''.  Note that even\r
-     * if the progress bar value exceeds 1, it will never automatically reset -- you are responsible for\r
-     * determining when the progress is complete and calling {@link #reset} to clear and/or hide the control.\r
-     * @param {Float} value (optional) A floating point value between 0 and 1 (e.g., .5, defaults to 0)\r
-     * @param {String} text (optional) The string to display in the progress text element (defaults to '')\r
-     * @param {Boolean} animate (optional) Whether to animate the transition of the progress bar. If this value is\r
-     * not specified, the default for the class is used (default to false)\r
-     * @return {Ext.ProgressBar} this\r
+     * True to stop the event from bubbling and prevent the default browser action if the\r
+     * key was handled by the KeyMap (defaults to false)\r
+     * @type Boolean\r
      */\r
-    updateProgress : function(value, text, animate){\r
-        this.value = value || 0;\r
-        if(text){\r
-            this.updateText(text);\r
-        }\r
-        if(this.rendered){\r
-            var w = Math.floor(value*this.el.dom.firstChild.offsetWidth);\r
-            this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));\r
-            if(this.textTopEl){\r
-                //textTopEl should be the same width as the bar so overflow will clip as the bar moves\r
-                this.textTopEl.removeClass('x-hidden').setWidth(w);\r
-            }\r
-        }\r
-        this.fireEvent('update', this, value, text);\r
-        return this;\r
-    },\r
+    stopEvent : false,\r
 \r
     /**\r
-     * Initiates an auto-updating progress bar.  A duration can be specified, in which case the progress\r
-     * bar will automatically reset after a fixed amount of time and optionally call a callback function\r
-     * if specified.  If no duration is passed in, then the progress bar will run indefinitely and must\r
-     * be manually cleared by calling {@link #reset}.  The wait method accepts a config object with\r
-     * the following properties:\r
+     * Add a new binding to this KeyMap. The following config object properties are supported:\r
      * <pre>\r
-Property   Type          Description\r
----------- ------------  ----------------------------------------------------------------------\r
-duration   Number        The length of time in milliseconds that the progress bar should\r
-                         run before resetting itself (defaults to undefined, in which case it\r
-                         will run indefinitely until reset is called)\r
-interval   Number        The length of time in milliseconds between each progress update\r
-                         (defaults to 1000 ms)\r
-animate    Boolean       Whether to animate the transition of the progress bar. If this value is\r
-                         not specified, the default for the class is used.                                                   \r
-increment  Number        The number of progress update segments to display within the progress\r
-                         bar (defaults to 10).  If the bar reaches the end and is still\r
-                         updating, it will automatically wrap back to the beginning.\r
-text       String        Optional text to display in the progress bar element (defaults to '').\r
-fn         Function      A callback function to execute after the progress bar finishes auto-\r
-                         updating.  The function will be called with no arguments.  This function\r
-                         will be ignored if duration is not specified since in that case the\r
-                         progress bar can only be stopped programmatically, so any required function\r
-                         should be called by the same code after it resets the progress bar.\r
-scope      Object        The scope that is passed to the callback function (only applies when\r
-                         duration and fn are both passed).\r
+Property    Type             Description\r
+----------  ---------------  ----------------------------------------------------------------------\r
+key         String/Array     A single keycode or an array of keycodes to handle\r
+shift       Boolean          True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)\r
+ctrl        Boolean          True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)\r
+alt         Boolean          True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)\r
+handler     Function         The function to call when KeyMap finds the expected key combination\r
+fn          Function         Alias of handler (for backwards-compatibility)\r
+scope       Object           The scope of the callback function\r
+stopEvent   Boolean          True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false)\r
 </pre>\r
-         *\r
-         * Example usage:\r
-         * <pre><code>\r
-var p = new Ext.ProgressBar({\r
-   renderTo: 'my-el'\r
-});\r
-\r
-//Wait for 5 seconds, then update the status el (progress bar will auto-reset)\r
-p.wait({\r
-   interval: 100, //bar will move fast!\r
-   duration: 5000,\r
-   increment: 15,\r
-   text: 'Updating...',\r
-   scope: this,\r
-   fn: function(){\r
-      Ext.fly('status').update('Done!');\r
-   }\r
+     *\r
+     * Usage:\r
+     * <pre><code>\r
+// Create a KeyMap\r
+var map = new Ext.KeyMap(document, {\r
+    key: Ext.EventObject.ENTER,\r
+    fn: handleKey,\r
+    scope: this\r
 });\r
 \r
-//Or update indefinitely until some async action completes, then reset manually\r
-p.wait();\r
-myAction.on('complete', function(){\r
-    p.reset();\r
-    Ext.fly('status').update('Done!');\r
+//Add a new binding to the existing KeyMap later\r
+map.addBinding({\r
+    key: 'abc',\r
+    shift: true,\r
+    fn: handleKey,\r
+    scope: this\r
 });\r
 </code></pre>\r
-     * @param {Object} config (optional) Configuration options\r
-     * @return {Ext.ProgressBar} this\r
+     * @param {Object/Array} config A single KeyMap config or an array of configs\r
      */\r
-    wait : function(o){\r
-        if(!this.waitTimer){\r
-            var scope = this;\r
-            o = o || {};\r
-            this.updateText(o.text);\r
-            this.waitTimer = Ext.TaskMgr.start({\r
-                run: function(i){\r
-                    var inc = o.increment || 10;\r
-                    this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01, null, o.animate);\r
-                },\r
-                interval: o.interval || 1000,\r
-                duration: o.duration,\r
-                onStop: function(){\r
-                    if(o.fn){\r
-                        o.fn.apply(o.scope || this);\r
+       addBinding : function(config){\r
+        if(Ext.isArray(config)){\r
+            Ext.each(config, function(c){\r
+                this.addBinding(c);\r
+            }, this);\r
+            return;\r
+        }\r
+        var keyCode = config.key,\r
+            fn = config.fn || config.handler,\r
+            scope = config.scope;\r
+\r
+       if (config.stopEvent) {\r
+           this.stopEvent = config.stopEvent;    \r
+       }       \r
+\r
+        if(typeof keyCode == "string"){\r
+            var ks = [];\r
+            var keyString = keyCode.toUpperCase();\r
+            for(var j = 0, len = keyString.length; j < len; j++){\r
+                ks.push(keyString.charCodeAt(j));\r
+            }\r
+            keyCode = ks;\r
+        }\r
+        var keyArray = Ext.isArray(keyCode);\r
+        \r
+        var handler = function(e){\r
+            if(this.checkModifiers(config, e)){\r
+                var k = e.getKey();\r
+                if(keyArray){\r
+                    for(var i = 0, len = keyCode.length; i < len; i++){\r
+                        if(keyCode[i] == k){\r
+                          if(this.stopEvent){\r
+                              e.stopEvent();\r
+                          }\r
+                          fn.call(scope || window, k, e);\r
+                          return;\r
+                        }\r
                     }\r
-                    this.reset();\r
-                },\r
-                scope: scope\r
-            });\r
+                }else{\r
+                    if(k == keyCode){\r
+                        if(this.stopEvent){\r
+                           e.stopEvent();\r
+                        }\r
+                        fn.call(scope || window, k, e);\r
+                    }\r
+                }\r
+            }\r
+        };\r
+        this.bindings.push(handler);\r
+       },\r
+    \r
+    // private\r
+    checkModifiers: function(config, e){\r
+        var val, key, keys = ['shift', 'ctrl', 'alt'];\r
+        for (var i = 0, len = keys.length; i < len; ++i){\r
+            key = keys[i];\r
+            val = config[key];\r
+            if(!(val === undefined || (val === e[key + 'Key']))){\r
+                return false;\r
+            }\r
         }\r
-        return this;\r
+        return true;\r
     },\r
 \r
     /**\r
-     * Returns true if the progress bar is currently in a {@link #wait} operation\r
-     * @return {Boolean} True if waiting, else false\r
+     * Shorthand for adding a single key listener\r
+     * @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the\r
+     * following options:\r
+     * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}\r
+     * @param {Function} fn The function to call\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the browser window.\r
      */\r
-    isWaiting : function(){\r
-        return this.waitTimer !== null;\r
+    on : function(key, fn, scope){\r
+        var keyCode, shift, ctrl, alt;\r
+        if(typeof key == "object" && !Ext.isArray(key)){\r
+            keyCode = key.key;\r
+            shift = key.shift;\r
+            ctrl = key.ctrl;\r
+            alt = key.alt;\r
+        }else{\r
+            keyCode = key;\r
+        }\r
+        this.addBinding({\r
+            key: keyCode,\r
+            shift: shift,\r
+            ctrl: ctrl,\r
+            alt: alt,\r
+            fn: fn,\r
+            scope: scope\r
+        });\r
     },\r
 \r
+    // private\r
+    handleKeyDown : function(e){\r
+           if(this.enabled){ //just in case\r
+           var b = this.bindings;\r
+           for(var i = 0, len = b.length; i < len; i++){\r
+               b[i].call(this, e);\r
+           }\r
+           }\r
+       },\r
+\r
+       /**\r
+        * Returns true if this KeyMap is enabled\r
+        * @return {Boolean}\r
+        */\r
+       isEnabled : function(){\r
+           return this.enabled;\r
+       },\r
+\r
+       /**\r
+        * Enables this KeyMap\r
+        */\r
+       enable: function(){\r
+               if(!this.enabled){\r
+                   this.el.on(this.eventName, this.handleKeyDown, this);\r
+                   this.enabled = true;\r
+               }\r
+       },\r
+\r
+       /**\r
+        * Disable this KeyMap\r
+        */\r
+       disable: function(){\r
+               if(this.enabled){\r
+                   this.el.removeListener(this.eventName, this.handleKeyDown, this);\r
+                   this.enabled = false;\r
+               }\r
+       },\r
+    \r
     /**\r
-     * Updates the progress bar text.  If specified, textEl will be updated, otherwise the progress\r
-     * bar itself will display the updated text.\r
-     * @param {String} text (optional) The string to display in the progress text element (defaults to '')\r
-     * @return {Ext.ProgressBar} this\r
+     * Convenience function for setting disabled/enabled by boolean.\r
+     * @param {Boolean} disabled\r
      */\r
-    updateText : function(text){\r
-        this.text = text || '&#160;';\r
-        if(this.rendered){\r
-            this.textEl.update(this.text);\r
-        }\r
-        return this;\r
-    },\r
-    \r
+    setDisabled : function(disabled){\r
+        this[disabled ? "disable" : "enable"]();\r
+    }\r
+};/**
+ * @class Ext.util.TextMetrics
+ * Provides precise pixel measurements for blocks of text so that you can determine exactly how high and
+ * wide, in pixels, a given block of text will be. Note that when measuring text, it should be plain text and
+ * should not contain any HTML, otherwise it may not be measured correctly.
+ * @singleton
+ */
+Ext.util.TextMetrics = function(){
+    var shared;
+    return {
+        /**
+         * Measures the size of the specified text
+         * @param {String/HTMLElement} el The element, dom node or id from which to copy existing CSS styles
+         * that can affect the size of the rendered text
+         * @param {String} text The text to measure
+         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
+         * in order to accurately measure the text height
+         * @return {Object} An object containing the text's size {width: (width), height: (height)}
+         */
+        measure : function(el, text, fixedWidth){
+            if(!shared){
+                shared = Ext.util.TextMetrics.Instance(el, fixedWidth);
+            }
+            shared.bind(el);
+            shared.setFixedWidth(fixedWidth || 'auto');
+            return shared.getSize(text);
+        },
+
+        /**
+         * Return a unique TextMetrics instance that can be bound directly to an element and reused.  This reduces
+         * the overhead of multiple calls to initialize the style properties on each measurement.
+         * @param {String/HTMLElement} el The element, dom node or id that the instance will be bound to
+         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
+         * in order to accurately measure the text height
+         * @return {Ext.util.TextMetrics.Instance} instance The new instance
+         */
+        createInstance : function(el, fixedWidth){
+            return Ext.util.TextMetrics.Instance(el, fixedWidth);
+        }
+    };
+}();
+
+Ext.util.TextMetrics.Instance = function(bindTo, fixedWidth){
+    var ml = new Ext.Element(document.createElement('div'));
+    document.body.appendChild(ml.dom);
+    ml.position('absolute');
+    ml.setLeftTop(-1000, -1000);
+    ml.hide();
+
+    if(fixedWidth){
+        ml.setWidth(fixedWidth);
+    }
+
+    var instance = {
+        /**
+         * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
+         * Returns the size of the specified text based on the internal element's style and width properties
+         * @param {String} text The text to measure
+         * @return {Object} An object containing the text's size {width: (width), height: (height)}
+         */
+        getSize : function(text){
+            ml.update(text);
+            var s = ml.getSize();
+            ml.update('');
+            return s;
+        },
+
+        /**
+         * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
+         * Binds this TextMetrics instance to an element from which to copy existing CSS styles
+         * that can affect the size of the rendered text
+         * @param {String/HTMLElement} el The element, dom node or id
+         */
+        bind : function(el){
+            ml.setStyle(
+                Ext.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height', 'text-transform', 'letter-spacing')
+            );
+        },
+
+        /**
+         * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
+         * Sets a fixed width on the internal measurement element.  If the text will be multiline, you have
+         * to set a fixed width in order to accurately measure the text height.
+         * @param {Number} width The width to set on the element
+         */
+        setFixedWidth : function(width){
+            ml.setWidth(width);
+        },
+
+        /**
+         * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
+         * Returns the measured width of the specified text
+         * @param {String} text The text to measure
+         * @return {Number} width The width in pixels
+         */
+        getWidth : function(text){
+            ml.dom.style.width = 'auto';
+            return this.getSize(text).width;
+        },
+
+        /**
+         * <p><b>Only available on the instance returned from {@link #createInstance}, <u>not</u> on the singleton.</b></p>
+         * Returns the measured height of the specified text.  For multiline text, be sure to call
+         * {@link #setFixedWidth} if necessary.
+         * @param {String} text The text to measure
+         * @return {Number} height The height in pixels
+         */
+        getHeight : function(text){
+            return this.getSize(text).height;
+        }
+    };
+
+    instance.bind(bindTo);
+
+    return instance;
+};
+
+Ext.Element.addMethods({
+    /**
+     * Returns the width in pixels of the passed text, or the width of the text in this Element.
+     * @param {String} text The text to measure. Defaults to the innerHTML of the element.
+     * @param {Number} min (Optional) The minumum value to return.
+     * @param {Number} max (Optional) The maximum value to return.
+     * @return {Number} The text width in pixels.
+     * @member Ext.Element getTextWidth
+     */
+    getTextWidth : function(text, min, max){
+        return (Ext.util.TextMetrics.measure(this.dom, Ext.value(text, this.dom.innerHTML, true)).width).constrain(min || 0, max || 1000000);
+    }
+});
+/**\r
+ * @class Ext.util.Cookies\r
+ * Utility class for managing and interacting with cookies.\r
+ * @singleton\r
+ */\r
+Ext.util.Cookies = {\r
     /**\r
-     * Synchronizes the inner bar width to the proper proportion of the total componet width based\r
-     * on the current progress {@link #value}.  This will be called automatically when the ProgressBar\r
-     * is resized by a layout, but if it is rendered auto width, this method can be called from\r
-     * another resize handler to sync the ProgressBar if necessary.\r
+     * Create a cookie with the specified name and value. Additional settings\r
+     * for the cookie may be optionally specified (for example: expiration,\r
+     * access restriction, SSL).\r
+     * @param {String} name The name of the cookie to set. \r
+     * @param {Mixed} value The value to set for the cookie.\r
+     * @param {Object} expires (Optional) Specify an expiration date the\r
+     * cookie is to persist until.  Note that the specified Date object will\r
+     * be converted to Greenwich Mean Time (GMT). \r
+     * @param {String} path (Optional) Setting a path on the cookie restricts\r
+     * access to pages that match that path. Defaults to all pages (<tt>'/'</tt>). \r
+     * @param {String} domain (Optional) Setting a domain restricts access to\r
+     * pages on a given domain (typically used to allow cookie access across\r
+     * subdomains). For example, "extjs.com" will create a cookie that can be\r
+     * accessed from any subdomain of extjs.com, including www.extjs.com,\r
+     * support.extjs.com, etc.\r
+     * @param {Boolean} secure (Optional) Specify true to indicate that the cookie\r
+     * should only be accessible via SSL on a page using the HTTPS protocol.\r
+     * Defaults to <tt>false</tt>. Note that this will only work if the page\r
+     * calling this code uses the HTTPS protocol, otherwise the cookie will be\r
+     * created with default options.\r
      */\r
-    syncProgressBar : function(){\r
-        if(this.value){\r
-            this.updateProgress(this.value, this.text);\r
-        }\r
-        return this;\r
+    set : function(name, value){\r
+        var argv = arguments;\r
+        var argc = arguments.length;\r
+        var expires = (argc > 2) ? argv[2] : null;\r
+        var path = (argc > 3) ? argv[3] : '/';\r
+        var domain = (argc > 4) ? argv[4] : null;\r
+        var secure = (argc > 5) ? argv[5] : false;\r
+        document.cookie = name + "=" + escape(value) + ((expires === null) ? "" : ("; expires=" + expires.toGMTString())) + ((path === null) ? "" : ("; path=" + path)) + ((domain === null) ? "" : ("; domain=" + domain)) + ((secure === true) ? "; secure" : "");\r
     },\r
 \r
     /**\r
-     * Sets the size of the progress bar.\r
-     * @param {Number} width The new width in pixels\r
-     * @param {Number} height The new height in pixels\r
-     * @return {Ext.ProgressBar} this\r
+     * Retrieves cookies that are accessible by the current page. If a cookie\r
+     * does not exist, <code>get()</code> returns <tt>null</tt>.  The following\r
+     * example retrieves the cookie called "valid" and stores the String value\r
+     * in the variable <tt>validStatus</tt>.\r
+     * <pre><code>\r
+     * var validStatus = Ext.util.Cookies.get("valid");\r
+     * </code></pre>\r
+     * @param {String} name The name of the cookie to get\r
+     * @return {Mixed} Returns the cookie value for the specified name;\r
+     * null if the cookie name does not exist.\r
      */\r
-    setSize : function(w, h){\r
-        Ext.ProgressBar.superclass.setSize.call(this, w, h);\r
-        if(this.textTopEl){\r
-            var inner = this.el.dom.firstChild;\r
-            this.textEl.setSize(inner.offsetWidth, inner.offsetHeight);\r
+    get : function(name){\r
+        var arg = name + "=";\r
+        var alen = arg.length;\r
+        var clen = document.cookie.length;\r
+        var i = 0;\r
+        var j = 0;\r
+        while(i < clen){\r
+            j = i + alen;\r
+            if(document.cookie.substring(i, j) == arg){\r
+                return Ext.util.Cookies.getCookieVal(j);\r
+            }\r
+            i = document.cookie.indexOf(" ", i) + 1;\r
+            if(i === 0){\r
+                break;\r
+            }\r
         }\r
-        this.syncProgressBar();\r
-        return this;\r
+        return null;\r
     },\r
 \r
     /**\r
-     * Resets the progress bar value to 0 and text to empty string.  If hide = true, the progress\r
-     * bar will also be hidden (using the {@link #hideMode} property internally).\r
-     * @param {Boolean} hide (optional) True to hide the progress bar (defaults to false)\r
-     * @return {Ext.ProgressBar} this\r
+     * Removes a cookie with the provided name from the browser\r
+     * if found by setting its expiration date to sometime in the past. \r
+     * @param {String} name The name of the cookie to remove\r
      */\r
-    reset : function(hide){\r
-        this.updateProgress(0);\r
-        if(this.textTopEl){\r
-            this.textTopEl.addClass('x-hidden');\r
-        }\r
-        if(this.waitTimer){\r
-            this.waitTimer.onStop = null; //prevent recursion\r
-            Ext.TaskMgr.stop(this.waitTimer);\r
-            this.waitTimer = null;\r
+    clear : function(name){\r
+        if(Ext.util.Cookies.get(name)){\r
+            document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";\r
         }\r
-        if(hide === true){\r
-            this.hide();\r
+    },\r
+    /**\r
+     * @private\r
+     */\r
+    getCookieVal : function(offset){\r
+        var endstr = document.cookie.indexOf(";", offset);\r
+        if(endstr == -1){\r
+            endstr = document.cookie.length;\r
         }\r
-        return this;\r
+        return unescape(document.cookie.substring(offset, endstr));\r
     }\r
-});\r
-Ext.reg('progress', Ext.ProgressBar);/*
- * These classes are derivatives of the similarly named classes in the YUI Library.
- * The original license:
- * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
- * Code licensed under the BSD License:
- * http://developer.yahoo.net/yui/license.txt
+};/**
+ * Framework-wide error-handler.  Developers can override this method to provide
+ * custom exception-handling.  Framework errors will often extend from the base
+ * Ext.Error class.
+ * @param {Object/Error} e The thrown exception object.
  */
-
-(function() {
-
-var Event=Ext.EventManager;
-var Dom=Ext.lib.Dom;
+Ext.handleError = function(e) {
+    throw e;
+};
 
 /**
- * @class Ext.dd.DragDrop
- * 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 and 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 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 Ext.dd.DD}.  setDragElId() lets you define
- * a separate element that would be moved, as in {@link Ext.dd.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 Ext.dd.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);
- *  }
+ * @class Ext.Error
+ * @extends Error
+ * <p>A base error class. Future implementations are intended to provide more
+ * robust error handling throughout the framework (<b>in the debug build only</b>)
+ * to check for common errors and problems. The messages issued by this class
+ * will aid error checking. Error checks will be automatically removed in the
+ * production build so that performance is not negatively impacted.</p>
+ * <p>Some sample messages currently implemented:</p><pre>
+"DataProxy attempted to execute an API-action but found an undefined
+url / function. Please review your Proxy url/api-configuration."
+ * </pre><pre>
+"Could not locate your "root" property in your server response.
+Please review your JsonReader config to ensure the config-property
+"root" matches the property your server-response.  See the JsonReader
+docs for additional assistance."
  * </pre>
- * @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
+ * <p>An example of the code used for generating error messages:</p><pre><code>
+try {
+    generateError({
+        foo: 'bar'
+    });
+}
+catch (e) {
+    console.error(e);
+}
+function generateError(data) {
+    throw new Ext.Error('foo-error', data);
+}
+ * </code></pre>
+ * @param {String} message
  */
-Ext.dd.DragDrop = function(id, sGroup, config) {
-    if(id) {
-        this.init(id, sGroup, config);
-    }
-};
-
-Ext.dd.DragDrop.prototype = {
+Ext.Error = function(message) {
+    // Try to read the message from Ext.Error.lang
+    this.message = (this.lang[message]) ? this.lang[message] : message;
+}
+Ext.Error.prototype = new Error();
+Ext.apply(Ext.Error.prototype, {
+    // protected.  Extensions place their error-strings here.
+    lang: {},
 
+    name: 'Ext.Error',
     /**
-     * Set to false to enable a DragDrop object to fire drag events while dragging
-     * over its own Element. Defaults to true - DragDrop objects do not by default
-     * fire drag events to themselves.
-     * @property ignoreSelf
-     * @type Boolean
+     * getName
+     * @return {String}
      */
-
+    getName : function() {
+        return this.name;
+    },
     /**
-     * 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
+     * getMessage
+     * @return {String}
      */
-    id: null,
-
+    getMessage : function() {
+        return this.message;
+    },
     /**
-     * Configuration attributes passed into the constructor
-     * @property config
-     * @type object
+     * toJson
+     * @return {String}
      */
-    config: null,
+    toJson : function() {
+        return Ext.encode(this);
+    }
+});
 
-    /**
-     * 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:
-     * Ext.dd.DDProxy
-     * @property dragElId
-     * @type String
-     * @private
-     */
-    dragElId: null,
+/**
+ * @class Ext.ComponentMgr
+ * <p>Provides a registry of all Components (instances of {@link Ext.Component} or any subclass
+ * thereof) on a page so that they can be easily accessed by {@link Ext.Component component}
+ * {@link Ext.Component#id id} (see {@link #get}, or the convenience method {@link Ext#getCmp Ext.getCmp}).</p>
+ * <p>This object also provides a registry of available Component <i>classes</i>
+ * indexed by a mnemonic code known as the Component's {@link Ext.Component#xtype xtype}.
+ * The <code>{@link Ext.Component#xtype xtype}</code> provides a way to avoid instantiating child Components
+ * when creating a full, nested config object for a complete Ext page.</p>
+ * <p>A child Component may be specified simply as a <i>config object</i>
+ * as long as the correct <code>{@link Ext.Component#xtype xtype}</code> is specified so that if and when the Component
+ * needs rendering, the correct type can be looked up for lazy instantiation.</p>
+ * <p>For a list of all available <code>{@link Ext.Component#xtype xtypes}</code>, see {@link Ext.Component}.</p>
+ * @singleton
+ */
+Ext.ComponentMgr = function(){
+    var all = new Ext.util.MixedCollection();
+    var types = {};
+    var ptypes = {};
 
-    /**
-     * 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,
+    return {
+        /**
+         * Registers a component.
+         * @param {Ext.Component} c The component
+         */
+        register : function(c){
+            all.add(c);
+        },
+
+        /**
+         * Unregisters a component.
+         * @param {Ext.Component} c The component
+         */
+        unregister : function(c){
+            all.remove(c);
+        },
+
+        /**
+         * Returns a component by {@link Ext.Component#id id}.
+         * For additional details see {@link Ext.util.MixedCollection#get}.
+         * @param {String} id The component {@link Ext.Component#id id}
+         * @return Ext.Component The Component, <code>undefined</code> if not found, or <code>null</code> if a
+         * Class was found.
+         */
+        get : function(id){
+            return all.get(id);
+        },
+
+        /**
+         * Registers a function that will be called when a Component with the specified id is added to ComponentMgr. This will happen on instantiation.
+         * @param {String} id The component {@link Ext.Component#id id}
+         * @param {Function} fn The callback function
+         * @param {Object} scope The scope (<code>this</code> reference) in which the callback is executed. Defaults to the Component.
+         */
+        onAvailable : function(id, fn, scope){
+            all.on("add", function(index, o){
+                if(o.id == id){
+                    fn.call(scope || o, o);
+                    all.un("add", fn, scope);
+                }
+            });
+        },
+
+        /**
+         * The MixedCollection used internally for the component cache. An example usage may be subscribing to
+         * events on the MixedCollection to monitor addition or removal.  Read-only.
+         * @type {MixedCollection}
+         */
+        all : all,
+        
+        /**
+         * The xtypes that have been registered with the component manager.
+         * @type {Object}
+         */
+        types : types,
+        
+        /**
+         * The ptypes that have been registered with the component manager.
+         * @type {Object}
+         */
+        ptypes: ptypes,
+        
+        /**
+         * Checks if a Component type is registered.
+         * @param {Ext.Component} xtype The mnemonic string by which the Component class may be looked up
+         * @return {Boolean} Whether the type is registered.
+         */
+        isRegistered : function(xtype){
+            return types[xtype] !== undefined;    
+        },
+        
+        /**
+         * Checks if a Plugin type is registered.
+         * @param {Ext.Component} ptype The mnemonic string by which the Plugin class may be looked up
+         * @return {Boolean} Whether the type is registered.
+         */
+        isPluginRegistered : function(ptype){
+            return ptypes[ptype] !== undefined;    
+        },        
+
+        /**
+         * <p>Registers a new Component constructor, keyed by a new
+         * {@link Ext.Component#xtype}.</p>
+         * <p>Use this method (or its alias {@link Ext#reg Ext.reg}) to register new
+         * subclasses of {@link Ext.Component} so that lazy instantiation may be used when specifying
+         * child Components.
+         * see {@link Ext.Container#items}</p>
+         * @param {String} xtype The mnemonic string by which the Component class may be looked up.
+         * @param {Constructor} cls The new Component class.
+         */
+        registerType : function(xtype, cls){
+            types[xtype] = cls;
+            cls.xtype = xtype;
+        },
+
+        /**
+         * Creates a new Component from the specified config object using the
+         * config object's {@link Ext.component#xtype xtype} to determine the class to instantiate.
+         * @param {Object} config A configuration object for the Component you wish to create.
+         * @param {Constructor} defaultType The constructor to provide the default Component type if
+         * the config object does not contain a <code>xtype</code>. (Optional if the config contains a <code>xtype</code>).
+         * @return {Ext.Component} The newly instantiated Component.
+         */
+        create : function(config, defaultType){
+            return config.render ? config : new types[config.xtype || defaultType](config);
+        },
+
+        /**
+         * <p>Registers a new Plugin constructor, keyed by a new
+         * {@link Ext.Component#ptype}.</p>
+         * <p>Use this method (or its alias {@link Ext#preg Ext.preg}) to register new
+         * plugins for {@link Ext.Component}s so that lazy instantiation may be used when specifying
+         * Plugins.</p>
+         * @param {String} ptype The mnemonic string by which the Plugin class may be looked up.
+         * @param {Constructor} cls The new Plugin class.
+         */
+        registerPlugin : function(ptype, cls){
+            ptypes[ptype] = cls;
+            cls.ptype = ptype;
+        },
+
+        /**
+         * Creates a new Plugin from the specified config object using the
+         * config object's {@link Ext.component#ptype ptype} to determine the class to instantiate.
+         * @param {Object} config A configuration object for the Plugin you wish to create.
+         * @param {Constructor} defaultType The constructor to provide the default Plugin type if
+         * the config object does not contain a <code>ptype</code>. (Optional if the config contains a <code>ptype</code>).
+         * @return {Ext.Component} The newly instantiated Plugin.
+         */
+        createPlugin : function(config, defaultType){
+            var PluginCls = ptypes[config.ptype || defaultType];
+            if (PluginCls.init) {
+                return PluginCls;                
+            } else {
+                return new PluginCls(config);
+            }            
+        }
+    };
+}();
+
+/**
+ * Shorthand for {@link Ext.ComponentMgr#registerType}
+ * @param {String} xtype The {@link Ext.component#xtype mnemonic string} by which the Component class
+ * may be looked up.
+ * @param {Constructor} cls The new Component class.
+ * @member Ext
+ * @method reg
+ */
+Ext.reg = Ext.ComponentMgr.registerType; // this will be called a lot internally, shorthand to keep the bytes down
+/**
+ * Shorthand for {@link Ext.ComponentMgr#registerPlugin}
+ * @param {String} ptype The {@link Ext.component#ptype mnemonic string} by which the Plugin class
+ * may be looked up.
+ * @param {Constructor} cls The new Plugin class.
+ * @member Ext
+ * @method preg
+ */
+Ext.preg = Ext.ComponentMgr.registerPlugin;
+/**
+ * Shorthand for {@link Ext.ComponentMgr#create}
+ * Creates a new Component from the specified config object using the
+ * config object's {@link Ext.component#xtype xtype} to determine the class to instantiate.
+ * @param {Object} config A configuration object for the Component you wish to create.
+ * @param {Constructor} defaultType The constructor to provide the default Component type if
+ * the config object does not contain a <code>xtype</code>. (Optional if the config contains a <code>xtype</code>).
+ * @return {Ext.Component} The newly instantiated Component.
+ * @member Ext
+ * @method create
+ */
+Ext.create = Ext.ComponentMgr.create;/**
+ * @class Ext.Component
+ * @extends Ext.util.Observable
+ * <p>Base class for all Ext components.  All subclasses of Component may participate in the automated
+ * Ext component lifecycle of creation, rendering and destruction which is provided by the {@link Ext.Container Container} class.
+ * Components may be added to a Container through the {@link Ext.Container#items items} config option at the time the Container is created,
+ * or they may be added dynamically via the {@link Ext.Container#add add} method.</p>
+ * <p>The Component base class has built-in support for basic hide/show and enable/disable behavior.</p>
+ * <p>All Components are registered with the {@link Ext.ComponentMgr} on construction so that they can be referenced at any time via
+ * {@link Ext#getCmp}, passing the {@link #id}.</p>
+ * <p>All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component (or
+ * {@link Ext.BoxComponent} if managed box model handling is required, ie height and width management).</p>
+ * <p>See the <a href="http://extjs.com/learn/Tutorial:Creating_new_UI_controls">Creating new UI controls</a> tutorial for details on how
+ * and to either extend or augment ExtJs base classes to create custom Components.</p>
+ * <p>Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the
+ * xtype like {@link #getXType} and {@link #isXType}. This is the list of all valid xtypes:</p>
+ * <pre>
+xtype            Class
+-------------    ------------------
+box              {@link Ext.BoxComponent}
+button           {@link Ext.Button}
+buttongroup      {@link Ext.ButtonGroup}
+colorpalette     {@link Ext.ColorPalette}
+component        {@link Ext.Component}
+container        {@link Ext.Container}
+cycle            {@link Ext.CycleButton}
+dataview         {@link Ext.DataView}
+datepicker       {@link Ext.DatePicker}
+editor           {@link Ext.Editor}
+editorgrid       {@link Ext.grid.EditorGridPanel}
+flash            {@link Ext.FlashComponent}
+grid             {@link Ext.grid.GridPanel}
+listview         {@link Ext.ListView}
+panel            {@link Ext.Panel}
+progress         {@link Ext.ProgressBar}
+propertygrid     {@link Ext.grid.PropertyGrid}
+slider           {@link Ext.Slider}
+spacer           {@link Ext.Spacer}
+splitbutton      {@link Ext.SplitButton}
+tabpanel         {@link Ext.TabPanel}
+treepanel        {@link Ext.tree.TreePanel}
+viewport         {@link Ext.ViewPort}
+window           {@link Ext.Window}
+
+Toolbar components
+---------------------------------------
+paging           {@link Ext.PagingToolbar}
+toolbar          {@link Ext.Toolbar}
+tbbutton         {@link Ext.Toolbar.Button}        (deprecated; use button)
+tbfill           {@link Ext.Toolbar.Fill}
+tbitem           {@link Ext.Toolbar.Item}
+tbseparator      {@link Ext.Toolbar.Separator}
+tbspacer         {@link Ext.Toolbar.Spacer}
+tbsplit          {@link Ext.Toolbar.SplitButton}   (deprecated; use splitbutton)
+tbtext           {@link Ext.Toolbar.TextItem}
+
+Menu components
+---------------------------------------
+menu             {@link Ext.menu.Menu}
+colormenu        {@link Ext.menu.ColorMenu}
+datemenu         {@link Ext.menu.DateMenu}
+menubaseitem     {@link Ext.menu.BaseItem}
+menucheckitem    {@link Ext.menu.CheckItem}
+menuitem         {@link Ext.menu.Item}
+menuseparator    {@link Ext.menu.Separator}
+menutextitem     {@link Ext.menu.TextItem}
+
+Form components
+---------------------------------------
+form             {@link Ext.form.FormPanel}
+checkbox         {@link Ext.form.Checkbox}
+checkboxgroup    {@link Ext.form.CheckboxGroup}
+combo            {@link Ext.form.ComboBox}
+datefield        {@link Ext.form.DateField}
+displayfield     {@link Ext.form.DisplayField}
+field            {@link Ext.form.Field}
+fieldset         {@link Ext.form.FieldSet}
+hidden           {@link Ext.form.Hidden}
+htmleditor       {@link Ext.form.HtmlEditor}
+label            {@link Ext.form.Label}
+numberfield      {@link Ext.form.NumberField}
+radio            {@link Ext.form.Radio}
+radiogroup       {@link Ext.form.RadioGroup}
+textarea         {@link Ext.form.TextArea}
+textfield        {@link Ext.form.TextField}
+timefield        {@link Ext.form.TimeField}
+trigger          {@link Ext.form.TriggerField}
+
+Chart components
+---------------------------------------
+chart            {@link Ext.chart.Chart}
+barchart         {@link Ext.chart.BarChart}
+cartesianchart   {@link Ext.chart.CartesianChart}
+columnchart      {@link Ext.chart.ColumnChart}
+linechart        {@link Ext.chart.LineChart}
+piechart         {@link Ext.chart.PieChart}
+
+Store xtypes
+---------------------------------------
+arraystore       {@link Ext.data.ArrayStore}
+directstore      {@link Ext.data.DirectStore}
+groupingstore    {@link Ext.data.GroupingStore}
+jsonstore        {@link Ext.data.JsonStore}
+simplestore      {@link Ext.data.SimpleStore}      (deprecated; use arraystore)
+store            {@link Ext.data.Store}
+xmlstore         {@link Ext.data.XmlStore}
+</pre>
+ * @constructor
+ * @param {Ext.Element/String/Object} config The configuration options may be specified as either:
+ * <div class="mdetail-params"><ul>
+ * <li><b>an element</b> :
+ * <p class="sub-desc">it is set as the internal element and its id used as the component id</p></li>
+ * <li><b>a string</b> :
+ * <p class="sub-desc">it is assumed to be the id of an existing element and is used as the component id</p></li>
+ * <li><b>anything else</b> :
+ * <p class="sub-desc">it is assumed to be a standard config object and is applied to the component</p></li>
+ * </ul></div>
+ */
+Ext.Component = function(config){
+    config = config || {};
+    if(config.initialConfig){
+        if(config.isAction){           // actions
+            this.baseAction = config;
+        }
+        config = config.initialConfig; // component cloning / action set up
+    }else if(config.tagName || config.dom || Ext.isString(config)){ // element object
+        config = {applyTo: config, id: config.id || config};
+    }
 
     /**
-     * An object who's property names identify HTML tags to be considered invalid as drag handles.
-     * A non-null property value identifies the tag as invalid. Defaults to the 
-     * following value which prevents drag operations from being initiated by &lt;a> elements:<pre><code>
-{
-    A: "A"
-}</code></pre>
-     * @property invalidHandleTypes
+     * This Component's initial configuration specification. Read-only.
      * @type Object
+     * @property initialConfig
      */
-    invalidHandleTypes: null,
+    this.initialConfig = config;
+
+    Ext.apply(this, config);
+    this.addEvents(
+        /**
+         * @event added
+         * Fires when a component is added to an Ext.Container
+         * @param {Ext.Component} this
+         * @param {Ext.Container} ownerCt Container which holds the component
+         * @param {number} index Position at which the component was added
+         */
+        'added',
+        /**
+         * @event disable
+         * Fires after the component is disabled.
+         * @param {Ext.Component} this
+         */
+        'disable',
+        /**
+         * @event enable
+         * Fires after the component is enabled.
+         * @param {Ext.Component} this
+         */
+        'enable',
+        /**
+         * @event beforeshow
+         * Fires before the component is shown by calling the {@link #show} method.
+         * Return false from an event handler to stop the show.
+         * @param {Ext.Component} this
+         */
+        'beforeshow',
+        /**
+         * @event show
+         * Fires after the component is shown when calling the {@link #show} method.
+         * @param {Ext.Component} this
+         */
+        'show',
+        /**
+         * @event beforehide
+         * Fires before the component is hidden by calling the {@link #hide} method.
+         * Return false from an event handler to stop the hide.
+         * @param {Ext.Component} this
+         */
+        'beforehide',
+        /**
+         * @event hide
+         * Fires after the component is hidden.
+         * Fires after the component is hidden when calling the {@link #hide} method.
+         * @param {Ext.Component} this
+         */
+        'hide',
+        /**
+         * @event removed
+         * Fires when a component is removed from an Ext.Container
+         * @param {Ext.Component} this
+         * @param {Ext.Container} ownerCt Container which holds the component
+         */
+        'removed',
+        /**
+         * @event beforerender
+         * Fires before the component is {@link #rendered}. Return false from an
+         * event handler to stop the {@link #render}.
+         * @param {Ext.Component} this
+         */
+        'beforerender',
+        /**
+         * @event render
+         * Fires after the component markup is {@link #rendered}.
+         * @param {Ext.Component} this
+         */
+        'render',
+        /**
+         * @event afterrender
+         * <p>Fires after the component rendering is finished.</p>
+         * <p>The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed
+         * by any afterRender method defined for the Component, and, if {@link #stateful}, after state
+         * has been restored.</p>
+         * @param {Ext.Component} this
+         */
+        'afterrender',
+        /**
+         * @event beforedestroy
+         * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}.
+         * @param {Ext.Component} this
+         */
+        'beforedestroy',
+        /**
+         * @event destroy
+         * Fires after the component is {@link #destroy}ed.
+         * @param {Ext.Component} this
+         */
+        'destroy',
+        /**
+         * @event beforestaterestore
+         * Fires before the state of the component is restored. Return false from an event handler to stop the restore.
+         * @param {Ext.Component} this
+         * @param {Object} state The hash of state values returned from the StateProvider. If this
+         * event is not vetoed, then the state object is passed to <b><tt>applyState</tt></b>. By default,
+         * that simply copies property values into this Component. The method maybe overriden to
+         * provide custom state restoration.
+         */
+        'beforestaterestore',
+        /**
+         * @event staterestore
+         * Fires after the state of the component is restored.
+         * @param {Ext.Component} this
+         * @param {Object} state The hash of state values returned from the StateProvider. This is passed
+         * to <b><tt>applyState</tt></b>. By default, that simply copies property values into this
+         * Component. The method maybe overriden to provide custom state restoration.
+         */
+        'staterestore',
+        /**
+         * @event beforestatesave
+         * Fires before the state of the component is saved to the configured state provider. Return false to stop the save.
+         * @param {Ext.Component} this
+         * @param {Object} state The hash of state values. This is determined by calling
+         * <b><tt>getState()</tt></b> on the Component. This method must be provided by the
+         * developer to return whetever representation of state is required, by default, Ext.Component
+         * has a null implementation.
+         */
+        'beforestatesave',
+        /**
+         * @event statesave
+         * Fires after the state of the component is saved to the configured state provider.
+         * @param {Ext.Component} this
+         * @param {Object} state The hash of state values. This is determined by calling
+         * <b><tt>getState()</tt></b> on the Component. This method must be provided by the
+         * developer to return whetever representation of state is required, by default, Ext.Component
+         * has a null implementation.
+         */
+        'statesave'
+    );
+    this.getId();
+    Ext.ComponentMgr.register(this);
+    Ext.Component.superclass.constructor.call(this);
 
-    /**
-     * An object who's property names identify the IDs of elements to be considered invalid as drag handles.
-     * A non-null property value identifies the ID as invalid. For example, to prevent
-     * dragging from being initiated on element ID "foo", use:<pre><code>
-{
-    foo: true
-}</code></pre>
-     * @property invalidHandleIds
-     * @type Object
-     */
-    invalidHandleIds: null,
+    if(this.baseAction){
+        this.baseAction.addComponent(this);
+    }
 
-    /**
-     * An Array of CSS class names for elements to be considered in valid as drag handles.
-     * @property invalidHandleClasses
-     * @type Array
-     */
-    invalidHandleClasses: null,
+    this.initComponent();
 
-    /**
-     * The linked element's absolute X position at the time the drag was
-     * started
-     * @property startPageX
-     * @type int
-     * @private
-     */
-    startPageX: 0,
+    if(this.plugins){
+        if(Ext.isArray(this.plugins)){
+            for(var i = 0, len = this.plugins.length; i < len; i++){
+                this.plugins[i] = this.initPlugin(this.plugins[i]);
+            }
+        }else{
+            this.plugins = this.initPlugin(this.plugins);
+        }
+    }
 
-    /**
-     * The linked element's absolute X position at the time the drag was
-     * started
-     * @property startPageY
-     * @type int
-     * @private
-     */
-    startPageY: 0,
+    if(this.stateful !== false){
+        this.initState();
+    }
 
-    /**
-     * 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 object An object in the format {'group1':true, 'group2':true}
-     */
-    groups: null,
+    if(this.applyTo){
+        this.applyToMarkup(this.applyTo);
+        delete this.applyTo;
+    }else if(this.renderTo){
+        this.render(this.renderTo);
+        delete this.renderTo;
+    }
+};
 
-    /**
-     * Individual drag/drop instances can be locked.  This will prevent
-     * onmousedown start drag.
-     * @property locked
-     * @type boolean
-     * @private
-     */
-    locked: false,
+// private
+Ext.Component.AUTO_ID = 1000;
 
+Ext.extend(Ext.Component, Ext.util.Observable, {
+    // Configs below are used for all Components when rendered by FormLayout.
     /**
-     * Lock this instance
-     * @method lock
+     * @cfg {String} fieldLabel <p>The label text to display next to this Component (defaults to '').</p>
+     * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container which
+     * has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout manager (e.g.
+     * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>).</p><br>
+     * <p>Also see <tt>{@link #hideLabel}</tt> and
+     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
+     * Example use:<pre><code>
+new Ext.FormPanel({
+    height: 100,
+    renderTo: Ext.getBody(),
+    items: [{
+        xtype: 'textfield',
+        fieldLabel: 'Name'
+    }]
+});
+</code></pre>
      */
-    lock: function() { this.locked = true; },
-
     /**
-     * When set to true, other DD objects in cooperating DDGroups do not receive
-     * notification events when this DD object is dragged over them. Defaults to false.
-     * @property moveOnly
-     * @type boolean
+     * @cfg {String} labelStyle <p>A CSS style specification string to apply directly to this field's
+     * label.  Defaults to the container's labelStyle value if set (e.g.,
+     * <tt>{@link Ext.layout.FormLayout#labelStyle}</tt> , or '').</p>
+     * <br><p><b>Note</b>: see the note for <code>{@link #clearCls}</code>.</p><br>
+     * <p>Also see <code>{@link #hideLabel}</code> and
+     * <code>{@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</code></p>
+     * Example use:<pre><code>
+new Ext.FormPanel({
+    height: 100,
+    renderTo: Ext.getBody(),
+    items: [{
+        xtype: 'textfield',
+        fieldLabel: 'Name',
+        labelStyle: 'font-weight:bold;'
+    }]
+});
+</code></pre>
      */
-    moveOnly: false,
-
     /**
-     * Unlock this instace
-     * @method unlock
+     * @cfg {String} labelSeparator <p>The separator to display after the text of each
+     * <tt>{@link #fieldLabel}</tt>.  This property may be configured at various levels.
+     * The order of precedence is:
+     * <div class="mdetail-params"><ul>
+     * <li>field / component level</li>
+     * <li>container level</li>
+     * <li>{@link Ext.layout.FormLayout#labelSeparator layout level} (defaults to colon <tt>':'</tt>)</li>
+     * </ul></div>
+     * To display no separator for this field's label specify empty string ''.</p>
+     * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
+     * <p>Also see <tt>{@link #hideLabel}</tt> and
+     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.</p>
+     * Example use:<pre><code>
+new Ext.FormPanel({
+    height: 100,
+    renderTo: Ext.getBody(),
+    layoutConfig: {
+        labelSeparator: '~'   // layout config has lowest priority (defaults to ':')
+    },
+    {@link Ext.layout.FormLayout#labelSeparator labelSeparator}: '>>',     // config at container level
+    items: [{
+        xtype: 'textfield',
+        fieldLabel: 'Field 1',
+        labelSeparator: '...' // field/component level config supersedes others
+    },{
+        xtype: 'textfield',
+        fieldLabel: 'Field 2' // labelSeparator will be '='
+    }]
+});
+</code></pre>
      */
-    unlock: function() { this.locked = false; },
-
     /**
-     * By default, all instances can be a drop target.  This can be disabled by
-     * setting isTarget to false.
-     * @property isTarget
-     * @type boolean
+     * @cfg {Boolean} hideLabel <p><tt>true</tt> to completely hide the label element
+     * ({@link #fieldLabel label} and {@link #labelSeparator separator}). Defaults to <tt>false</tt>.
+     * By default, even if you do not specify a <tt>{@link #fieldLabel}</tt> the space will still be
+     * reserved so that the field will line up with other fields that do have labels.
+     * Setting this to <tt>true</tt> will cause the field to not reserve that space.</p>
+     * <br><p><b>Note</b>: see the note for <tt>{@link #clearCls}</tt>.</p><br>
+     * Example use:<pre><code>
+new Ext.FormPanel({
+    height: 100,
+    renderTo: Ext.getBody(),
+    items: [{
+        xtype: 'textfield'
+        hideLabel: true
+    }]
+});
+</code></pre>
      */
-    isTarget: true,
-
     /**
-     * The padding configured for this drag and drop object for calculating
-     * the drop zone intersection with this object.
-     * @property padding
-     * @type int[] An array containing the 4 padding values: [top, right, bottom, left]
+     * @cfg {String} clearCls <p>The CSS class used to to apply to the special clearing div rendered
+     * directly after each form field wrapper to provide field clearing (defaults to
+     * <tt>'x-form-clear-left'</tt>).</p>
+     * <br><p><b>Note</b>: this config is only used when this Component is rendered by a Container
+     * which has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout
+     * manager (e.g. {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) and either a
+     * <tt>{@link #fieldLabel}</tt> is specified or <tt>isFormField=true</tt> is specified.</p><br>
+     * <p>See {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} also.</p>
      */
-    padding: null,
-
     /**
-     * Cached reference to the linked element
-     * @property _domRef
-     * @private
-     */
-    _domRef: null,
+     * @cfg {String} itemCls
+     * <p><b>Note</b>: this config is only used when this Component is rendered by a Container which
+     * has been configured to use the <b>{@link Ext.layout.FormLayout FormLayout}</b> layout manager (e.g.
+     * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>).</p><br>
+     * <p>An additional CSS class to apply to the div wrapping the form item
+     * element of this field.  If supplied, <tt>itemCls</tt> at the <b>field</b> level will override
+     * the default <tt>itemCls</tt> supplied at the <b>container</b> level. The value specified for
+     * <tt>itemCls</tt> will be added to the default class (<tt>'x-form-item'</tt>).</p>
+     * <p>Since it is applied to the item wrapper (see
+     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}), it allows
+     * you to write standard CSS rules that can apply to the field, the label (if specified), or
+     * any other element within the markup for the field.</p>
+     * <br><p><b>Note</b>: see the note for <tt>{@link #fieldLabel}</tt>.</p><br>
+     * Example use:<pre><code>
+// Apply a style to the field&#39;s label:
+&lt;style>
+    .required .x-form-item-label {font-weight:bold;color:red;}
+&lt;/style>
 
-    /**
-     * Internal typeof flag
-     * @property __ygDragDrop
-     * @private
+new Ext.FormPanel({
+    height: 100,
+    renderTo: Ext.getBody(),
+    items: [{
+        xtype: 'textfield',
+        fieldLabel: 'Name',
+        itemCls: 'required' //this label will be styled
+    },{
+        xtype: 'textfield',
+        fieldLabel: 'Favorite Color'
+    }]
+});
+</code></pre>
      */
-    __ygDragDrop: true,
 
     /**
-     * Set to true when horizontal contraints are applied
-     * @property constrainX
-     * @type boolean
-     * @private
+     * @cfg {String} id
+     * <p>The <b>unique</b> id of this component (defaults to an {@link #getId auto-assigned id}).
+     * You should assign an id if you need to be able to access the component later and you do
+     * not have an object reference available (e.g., using {@link Ext}.{@link Ext#getCmp getCmp}).</p>
+     * <p>Note that this id will also be used as the element id for the containing HTML element
+     * that is rendered to the page for this component. This allows you to write id-based CSS
+     * rules to style the specific instance of this component uniquely, and also to select
+     * sub-elements using this component's id as the parent.</p>
+     * <p><b>Note</b>: to avoid complications imposed by a unique <tt>id</tt> also see
+     * <code>{@link #itemId}</code> and <code>{@link #ref}</code>.</p>
+     * <p><b>Note</b>: to access the container of an item see <code>{@link #ownerCt}</code>.</p>
      */
-    constrainX: false,
-
     /**
-     * Set to true when vertical contraints are applied
-     * @property constrainY
-     * @type boolean
-     * @private
+     * @cfg {String} itemId
+     * <p>An <tt>itemId</tt> can be used as an alternative way to get a reference to a component
+     * when no object reference is available.  Instead of using an <code>{@link #id}</code> with
+     * {@link Ext}.{@link Ext#getCmp getCmp}, use <code>itemId</code> with
+     * {@link Ext.Container}.{@link Ext.Container#getComponent getComponent} which will retrieve
+     * <code>itemId</code>'s or <tt>{@link #id}</tt>'s. Since <code>itemId</code>'s are an index to the
+     * container's internal MixedCollection, the <code>itemId</code> is scoped locally to the container --
+     * avoiding potential conflicts with {@link Ext.ComponentMgr} which requires a <b>unique</b>
+     * <code>{@link #id}</code>.</p>
+     * <pre><code>
+var c = new Ext.Panel({ //
+    {@link Ext.BoxComponent#height height}: 300,
+    {@link #renderTo}: document.body,
+    {@link Ext.Container#layout layout}: 'auto',
+    {@link Ext.Container#items items}: [
+        {
+            itemId: 'p1',
+            {@link Ext.Panel#title title}: 'Panel 1',
+            {@link Ext.BoxComponent#height height}: 150
+        },
+        {
+            itemId: 'p2',
+            {@link Ext.Panel#title title}: 'Panel 2',
+            {@link Ext.BoxComponent#height height}: 150
+        }
+    ]
+})
+p1 = c.{@link Ext.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
+p2 = p1.{@link #ownerCt}.{@link Ext.Container#getComponent getComponent}('p2'); // reference via a sibling
+     * </code></pre>
+     * <p>Also see <tt>{@link #id}</tt> and <code>{@link #ref}</code>.</p>
+     * <p><b>Note</b>: to access the container of an item see <tt>{@link #ownerCt}</tt>.</p>
      */
-    constrainY: false,
-
     /**
-     * The left constraint
-     * @property minX
-     * @type int
-     * @private
+     * @cfg {String} xtype
+     * The registered <tt>xtype</tt> to create. This config option is not used when passing
+     * a config object into a constructor. This config option is used only when
+     * lazy instantiation is being used, and a child item of a Container is being
+     * specified not as a fully instantiated Component, but as a <i>Component config
+     * object</i>. The <tt>xtype</tt> will be looked up at render time up to determine what
+     * type of child Component to create.<br><br>
+     * The predefined xtypes are listed {@link Ext.Component here}.
+     * <br><br>
+     * If you subclass Components to create your own Components, you may register
+     * them using {@link Ext.ComponentMgr#registerType} in order to be able to
+     * take advantage of lazy instantiation and rendering.
      */
-    minX: 0,
-
     /**
-     * The right constraint
-     * @property maxX
-     * @type int
-     * @private
+     * @cfg {String} ptype
+     * The registered <tt>ptype</tt> to create. This config option is not used when passing
+     * a config object into a constructor. This config option is used only when
+     * lazy instantiation is being used, and a Plugin is being
+     * specified not as a fully instantiated Component, but as a <i>Component config
+     * object</i>. The <tt>ptype</tt> will be looked up at render time up to determine what
+     * type of Plugin to create.<br><br>
+     * If you create your own Plugins, you may register them using
+     * {@link Ext.ComponentMgr#registerPlugin} in order to be able to
+     * take advantage of lazy instantiation and rendering.
      */
-    maxX: 0,
-
     /**
-     * The up constraint
-     * @property minY
-     * @type int
-     * @type int
-     * @private
+     * @cfg {String} cls
+     * An optional extra CSS class that will be added to this component's Element (defaults to '').  This can be
+     * useful for adding customized styles to the component or any of its children using standard CSS rules.
      */
-    minY: 0,
-
     /**
-     * The down constraint
-     * @property maxY
-     * @type int
-     * @private
+     * @cfg {String} overCls
+     * An optional extra CSS class that will be added to this component's Element when the mouse moves
+     * over the Element, and removed when the mouse moves out. (defaults to '').  This can be
+     * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
      */
-    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
+     * @cfg {String} style
+     * A custom style specification to be applied to this component's Element.  Should be a valid argument to
+     * {@link Ext.Element#applyStyles}.
+     * <pre><code>
+new Ext.Panel({
+    title: 'Some Title',
+    renderTo: Ext.getBody(),
+    width: 400, height: 300,
+    layout: 'form',
+    items: [{
+        xtype: 'textarea',
+        style: {
+            width: '95%',
+            marginBottom: '10px'
+        }
+    },
+        new Ext.Button({
+            text: 'Send',
+            minWidth: '100',
+            style: {
+                marginBottom: '10px'
+            }
+        })
+    ]
+});
+     * </code></pre>
      */
-    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[]
+     * @cfg {String} ctCls
+     * <p>An optional extra CSS class that will be added to this component's container. This can be useful for
+     * adding customized styles to the container or any of its children using standard CSS rules.  See
+     * {@link Ext.layout.ContainerLayout}.{@link Ext.layout.ContainerLayout#extraCls extraCls} also.</p>
+     * <p><b>Note</b>: <tt>ctCls</tt> defaults to <tt>''</tt> except for the following class
+     * which assigns a value by default:
+     * <div class="mdetail-params"><ul>
+     * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-layout-ct'</tt></li>
+     * </ul></div>
+     * To configure the above Class with an extra CSS class append to the default.  For example,
+     * for BoxLayout (Hbox and Vbox):<pre><code>
+     * ctCls: 'x-box-layout-ct custom-class'
+     * </code></pre>
+     * </p>
      */
-    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[]
+     * @cfg {Boolean} disabled
+     * Render this component disabled (default is false).
      */
-    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
+    disabled : false,
+    /**
+     * @cfg {Boolean} hidden
+     * Render this component hidden (default is false). If <tt>true</tt>, the
+     * {@link #hide} method will be called internally.
      */
-    primaryButtonOnly: true,
-
+    hidden : false,
     /**
-     * The availabe property is false until the linked dom element is accessible.
-     * @property available
-     * @type boolean
+     * @cfg {Object/Array} plugins
+     * An object or array of objects that will provide custom functionality for this component.  The only
+     * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component.
+     * When a component is created, if any plugins are available, the component will call the init method on each
+     * plugin, passing a reference to itself.  Each plugin can then call methods or respond to events on the
+     * component as needed to provide its functionality.
      */
-    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
+     * @cfg {Mixed} applyTo
+     * <p>Specify the id of the element, a DOM element or an existing Element corresponding to a DIV
+     * that is already present in the document that specifies some structural markup for this
+     * component.</p><div><ul>
+     * <li><b>Description</b> : <ul>
+     * <div class="sub-desc">When <tt>applyTo</tt> is used, constituent parts of the component can also be specified
+     * by id or CSS class name within the main element, and the component being created may attempt
+     * to create its subcomponents from that markup if applicable.</div>
+     * </ul></li>
+     * <li><b>Notes</b> : <ul>
+     * <div class="sub-desc">When using this config, a call to render() is not required.</div>
+     * <div class="sub-desc">If applyTo is specified, any value passed for {@link #renderTo} will be ignored and the target
+     * element's parent node will automatically be used as the component's container.</div>
+     * </ul></li>
+     * </ul></div>
      */
-    hasOuterHandles: false,
-
     /**
-     * Code that executes immediately before the startDrag event
-     * @method b4StartDrag
-     * @private
+     * @cfg {Mixed} renderTo
+     * <p>Specify the id of the element, a DOM element or an existing Element that this component
+     * will be rendered into.</p><div><ul>
+     * <li><b>Notes</b> : <ul>
+     * <div class="sub-desc">Do <u>not</u> use this option if the Component is to be a child item of
+     * a {@link Ext.Container Container}. It is the responsibility of the
+     * {@link Ext.Container Container}'s {@link Ext.Container#layout layout manager}
+     * to render and manage its child items.</div>
+     * <div class="sub-desc">When using this config, a call to render() is not required.</div>
+     * </ul></li>
+     * </ul></div>
+     * <p>See <tt>{@link #render}</tt> also.</p>
      */
-    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
+     * @cfg {Boolean} stateful
+     * <p>A flag which causes the Component to attempt to restore the state of
+     * internal properties from a saved state on startup. The component must have
+     * either a <code>{@link #stateId}</code> or <code>{@link #id}</code> assigned
+     * for state to be managed. Auto-generated ids are not guaranteed to be stable
+     * across page loads and cannot be relied upon to save and restore the same
+     * state for a component.<p>
+     * <p>For state saving to work, the state manager's provider must have been
+     * set to an implementation of {@link Ext.state.Provider} which overrides the
+     * {@link Ext.state.Provider#set set} and {@link Ext.state.Provider#get get}
+     * methods to save and recall name/value pairs. A built-in implementation,
+     * {@link Ext.state.CookieProvider} is available.</p>
+     * <p>To set the state provider for the current page:</p>
+     * <pre><code>
+Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
+    expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
+}));
+     * </code></pre>
+     * <p>A stateful Component attempts to save state when one of the events
+     * listed in the <code>{@link #stateEvents}</code> configuration fires.</p>
+     * <p>To save state, a stateful Component first serializes its state by
+     * calling <b><code>getState</code></b>. By default, this function does
+     * nothing. The developer must provide an implementation which returns an
+     * object hash which represents the Component's restorable state.</p>
+     * <p>The value yielded by getState is passed to {@link Ext.state.Manager#set}
+     * which uses the configured {@link Ext.state.Provider} to save the object
+     * keyed by the Component's <code>{@link stateId}</code>, or, if that is not
+     * specified, its <code>{@link #id}</code>.</p>
+     * <p>During construction, a stateful Component attempts to <i>restore</i>
+     * its state by calling {@link Ext.state.Manager#get} passing the
+     * <code>{@link #stateId}</code>, or, if that is not specified, the
+     * <code>{@link #id}</code>.</p>
+     * <p>The resulting object is passed to <b><code>applyState</code></b>.
+     * The default implementation of <code>applyState</code> simply copies
+     * properties into the object, but a developer may override this to support
+     * more behaviour.</p>
+     * <p>You can perform extra processing on state save and restore by attaching
+     * handlers to the {@link #beforestaterestore}, {@link #staterestore},
+     * {@link #beforestatesave} and {@link #statesave} events.</p>
      */
-    startDrag: function(x, y) { /* override this */ },
-
     /**
-     * Code that executes immediately before the onDrag event
-     * @method b4Drag
-     * @private
+     * @cfg {String} stateId
+     * The unique id for this component to use for state management purposes
+     * (defaults to the component id if one was set, otherwise null if the
+     * component is using a generated id).
+     * <p>See <code>{@link #stateful}</code> for an explanation of saving and
+     * restoring Component state.</p>
      */
-    b4Drag: function(e) { },
-
     /**
-     * Abstract method called during the onMouseMove event while dragging an
-     * object.
-     * @method onDrag
-     * @param {Event} e the mousemove event
+     * @cfg {Array} stateEvents
+     * <p>An array of events that, when fired, should trigger this component to
+     * save its state (defaults to none). <code>stateEvents</code> may be any type
+     * of event supported by this component, including browser or custom events
+     * (e.g., <tt>['click', 'customerchange']</tt>).</p>
+     * <p>See <code>{@link #stateful}</code> for an explanation of saving and
+     * restoring Component state.</p>
      */
-    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.
+     * @cfg {Mixed} autoEl
+     * <p>A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
+     * encapsulate this Component.</p>
+     * <p>You do not normally need to specify this. For the base classes {@link Ext.Component}, {@link Ext.BoxComponent},
+     * and {@link Ext.Container}, this defaults to <b><tt>'div'</tt></b>. The more complex Ext classes use a more complex
+     * DOM structure created by their own onRender methods.</p>
+     * <p>This is intended to allow the developer to create application-specific utility Components encapsulated by
+     * different DOM elements. Example usage:</p><pre><code>
+{
+    xtype: 'box',
+    autoEl: {
+        tag: 'img',
+        src: 'http://www.example.com/example.jpg'
+    }
+}, {
+    xtype: 'box',
+    autoEl: {
+        tag: 'blockquote',
+        html: 'autoEl is cool!'
+    }
+}, {
+    xtype: 'container',
+    autoEl: 'ul',
+    cls: 'ux-unordered-list',
+    items: {
+        xtype: 'box',
+        autoEl: 'li',
+        html: 'First list item'
+    }
+}
+</code></pre>
      */
-    onDragEnter: function(e, id) { /* override this */ },
+    autoEl : 'div',
 
     /**
-     * Code that executes immediately before the onDragOver event
-     * @method b4DragOver
-     * @private
+     * @cfg {String} disabledClass
+     * CSS class added to the component when it is disabled (defaults to 'x-item-disabled').
      */
-    b4DragOver: function(e) { },
-
+    disabledClass : 'x-item-disabled',
     /**
-     * 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.
+     * @cfg {Boolean} allowDomMove
+     * Whether the component can move the Dom node when rendering (defaults to true).
      */
-    onDragOver: function(e, id) { /* override this */ },
-
+    allowDomMove : true,
     /**
-     * Code that executes immediately before the onDragOut event
-     * @method b4DragOut
-     * @private
+     * @cfg {Boolean} autoShow
+     * True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
+     * them on render (defaults to false).
      */
-    b4DragOut: function(e) { },
-
+    autoShow : false,
     /**
-     * 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.
+     * @cfg {String} hideMode
+     * <p>How this component should be hidden. Supported values are <tt>'visibility'</tt>
+     * (css visibility), <tt>'offsets'</tt> (negative offset position) and <tt>'display'</tt>
+     * (css display).</p>
+     * <br><p><b>Note</b>: the default of <tt>'display'</tt> is generally preferred
+     * since items are automatically laid out when they are first shown (no sizing
+     * is done while hidden).</p>
      */
-    onDragOut: function(e, id) { /* override this */ },
-
+    hideMode : 'display',
     /**
-     * Code that executes immediately before the onDragDrop event
-     * @method b4DragDrop
-     * @private
+     * @cfg {Boolean} hideParent
+     * True to hide and show the component's container when hide/show is called on the component, false to hide
+     * and show the component itself (defaults to false).  For example, this can be used as a shortcut for a hide
+     * button on a window by setting hide:true on the button when adding it to its parent container.
      */
-    b4DragDrop: function(e) { },
-
+    hideParent : false,
     /**
-     * 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.
+     * <p>The {@link Ext.Element} which encapsulates this Component. Read-only.</p>
+     * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
+     * that may be overridden using the <code>{@link #autoEl}</code> config.</p>
+     * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
+     * <p>To add listeners for <b>DOM events</b> to this Component (as opposed to listeners
+     * for this Component's own Observable events), see the {@link Ext.util.Observable#listeners listeners}
+     * config for a suggestion, or use a render listener directly:</p><pre><code>
+new Ext.Panel({
+    title: 'The Clickable Panel',
+    listeners: {
+        render: function(p) {
+            // Append the Panel to the click handler&#39;s argument list.
+            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
+        },
+        single: true  // Remove the listener after first invocation
+    }
+});
+</code></pre>
+     * <p>See also <tt>{@link #getEl getEl}</p>
+     * @type Ext.Element
+     * @property el
      */
-    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
+     * This Component's owner {@link Ext.Container Container} (defaults to undefined, and is set automatically when
+     * this Component is added to a Container).  Read-only.
+     * <p><b>Note</b>: to access items within the Container see <tt>{@link #itemId}</tt>.</p>
+     * @type Ext.Container
+     * @property ownerCt
      */
-    onInvalidDrop: function(e) { /* override this */ },
-
     /**
-     * Code that executes immediately before the endDrag event
-     * @method b4EndDrag
-     * @private
+     * True if this component is hidden. Read-only.
+     * @type Boolean
+     * @property hidden
      */
-    b4EndDrag: function(e) { },
-
     /**
-     * Fired when we are done dragging the object
-     * @method endDrag
-     * @param {Event} e the mouseup event
+     * True if this component is disabled. Read-only.
+     * @type Boolean
+     * @property disabled
      */
-    endDrag: function(e) { /* override this */ },
-
     /**
-     * Code executed immediately before the onMouseDown event
-     * @method b4MouseDown
-     * @param {Event} e the mousedown event
-     * @private
+     * True if this component has been rendered. Read-only.
+     * @type Boolean
+     * @property rendered
      */
-    b4MouseDown: function(e) {  },
+    rendered : false,
 
     /**
-     * Event handler that fires when a drag/drop obj gets a mousedown
-     * @method onMouseDown
-     * @param {Event} e the mousedown event
+     * @cfg {String} contentEl
+     * <p>Optional. Specify an existing HTML element, or the <code>id</code> of an existing HTML element to use as the content
+     * for this component.</p>
+     * <ul>
+     * <li><b>Description</b> :
+     * <div class="sub-desc">This config option is used to take an existing HTML element and place it in the layout element
+     * of a new component (it simply moves the specified DOM element <i>after the Component is rendered</i> to use as the content.</div></li>
+     * <li><b>Notes</b> :
+     * <div class="sub-desc">The specified HTML element is appended to the layout element of the component <i>after any configured
+     * {@link #html HTML} has been inserted</i>, and so the document will not contain this element at the time the {@link #render} event is fired.</div>
+     * <div class="sub-desc">The specified HTML element used will not participate in any <code><b>{@link Ext.Container#layout layout}</b></code>
+     * scheme that the Component may use. It is just HTML. Layouts operate on child <code><b>{@link Ext.Container#items items}</b></code>.</div>
+     * <div class="sub-desc">Add either the <code>x-hidden</code> or the <code>x-hide-display</code> CSS class to
+     * prevent a brief flicker of the content before it is rendered to the panel.</div></li>
+     * </ul>
      */
-    onMouseDown: function(e) { /* override this */ },
-
     /**
-     * Event handler that fires when a drag/drop obj gets a mouseup
-     * @method onMouseUp
-     * @param {Event} e the mouseup event
+     * @cfg {String/Object} html
+     * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use as the layout element
+     * content (defaults to ''). The HTML content is added after the component is rendered,
+     * so the document will not contain this HTML at the time the {@link #render} event is fired.
+     * This content is inserted into the body <i>before</i> any configured {@link #contentEl} is appended.
      */
-    onMouseUp: function(e) { /* override this */ },
 
     /**
-     * Override the onAvailable method to do what is needed after the initial
-     * position was determined.
-     * @method onAvailable
+     * @cfg {Mixed} tpl
+     * An <bold>{@link Ext.Template}</bold>, <bold>{@link Ext.XTemplate}</bold>
+     * or an array of strings to form an Ext.XTemplate.
+     * Used in conjunction with the <code>{@link #data}</code> and
+     * <code>{@link #tplWriteMode}</code> configurations.
      */
-    onAvailable: function () {
-    },
 
     /**
-     * Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}).
-     * @type Object
+     * @cfg {String} tplWriteMode The Ext.(X)Template method to use when
+     * updating the content area of the Component. Defaults to <tt>'overwrite'</tt>
+     * (see <code>{@link Ext.XTemplate#overwrite}</code>).
      */
-    defaultPadding : {left:0, right:0, top:0, bottom:0},
+    tplWriteMode : 'overwrite',
 
     /**
-     * Initializes the drag drop object's constraints to restrict movement to a certain element.
- *
- * Usage:
- <pre><code>
- var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
-                { dragElId: "existingProxyDiv" });
- dd.startDrag = function(){
-     this.constrainTo("parent-id");
- };
- </code></pre>
- * Or you can initalize it using the {@link Ext.Element} object:
- <pre><code>
- Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
-     startDrag : function(){
-         this.constrainTo("parent-id");
-     }
- });
- </code></pre>
-     * @param {Mixed} constrainTo The element to constrain to.
-     * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
-     * and can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}) or
-     * an object containing the sides to pad. For example: {right:10, bottom:10}
-     * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders)
+     * @cfg {Mixed} data
+     * The initial set of data to apply to the <code>{@link #tpl}</code> to
+     * update the content area of the Component.
      */
-    constrainTo : function(constrainTo, pad, inContent){
-        if(typeof pad == "number"){
-            pad = {left: pad, right:pad, top:pad, bottom:pad};
-        }
-        pad = pad || this.defaultPadding;
-        var b = Ext.get(this.getEl()).getBox();
-        var ce = Ext.get(constrainTo);
-        var s = ce.getScroll();
-        var c, cd = ce.dom;
-        if(cd == document.body){
-            c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()};
-        }else{
-            var xy = ce.getXY();
-            c = {x : xy[0]+s.left, y: xy[1]+s.top, width: cd.clientWidth, height: cd.clientHeight};
-        }
 
 
-        var topSpace = b.y - c.y;
-        var leftSpace = b.x - c.x;
+    // private
+    ctype : 'Ext.Component',
 
-        this.resetConstraints();
-        this.setXConstraint(leftSpace - (pad.left||0), // left
-                c.width - leftSpace - b.width - (pad.right||0), //right
-                               this.xTickSize
-        );
-        this.setYConstraint(topSpace - (pad.top||0), //top
-                c.height - topSpace - b.height - (pad.bottom||0), //bottom
-                               this.yTickSize
-        );
+    // private
+    actionMode : 'el',
+
+    // private
+    getActionEl : function(){
+        return this[this.actionMode];
     },
 
-    /**
-     * Returns a reference to the linked element
-     * @method getEl
-     * @return {HTMLElement} the html element
-     */
-    getEl: function() {
-        if (!this._domRef) {
-            this._domRef = Ext.getDom(this.id);
+    initPlugin : function(p){
+        if(p.ptype && !Ext.isFunction(p.init)){
+            p = Ext.ComponentMgr.createPlugin(p);
+        }else if(Ext.isString(p)){
+            p = Ext.ComponentMgr.createPlugin({
+                ptype: p
+            });
         }
-
-        return this._domRef;
+        p.init(this);
+        return p;
     },
 
-    /**
-     * 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 Ext.dd.DDProxy
-     * @method getDragEl
-     * @return {HTMLElement} the html element
-     */
-    getDragEl: function() {
-        return Ext.getDom(this.dragElId);
-    },
+    /* // protected
+     * Function to be implemented by Component subclasses to be part of standard component initialization flow (it is empty by default).
+     * <pre><code>
+// Traditional constructor:
+Ext.Foo = function(config){
+    // call superclass constructor:
+    Ext.Foo.superclass.constructor.call(this, config);
 
-    /**
-     * Sets up the DragDrop object.  Must be called in the constructor of any
-     * Ext.dd.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
+    this.addEvents({
+        // add events
+    });
+};
+Ext.extend(Ext.Foo, Ext.Bar, {
+   // class body
+}
+
+// initComponent replaces the constructor:
+Ext.Foo = Ext.extend(Ext.Bar, {
+    initComponent : function(){
+        // call superclass initComponent
+        Ext.Container.superclass.initComponent.call(this);
+
+        this.addEvents({
+            // add events
+        });
+    }
+}
+</code></pre>
      */
-    init: function(id, sGroup, config) {
-        this.initTarget(id, sGroup, config);
-        Event.on(this.id, "mousedown", this.handleMouseDown, this);
-        // Event.on(this.id, "selectstart", Event.preventDefault);
-    },
+    initComponent : Ext.emptyFn,
 
     /**
-     * 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
+     * <p>Render this Component into the passed HTML element.</p>
+     * <p><b>If you are using a {@link Ext.Container Container} object to house this Component, then
+     * do not use the render method.</b></p>
+     * <p>A Container's child Components are rendered by that Container's
+     * {@link Ext.Container#layout layout} manager when the Container is first rendered.</p>
+     * <p>Certain layout managers allow dynamic addition of child components. Those that do
+     * include {@link Ext.layout.CardLayout}, {@link Ext.layout.AnchorLayout},
+     * {@link Ext.layout.FormLayout}, {@link Ext.layout.TableLayout}.</p>
+     * <p>If the Container is already rendered when a new child Component is added, you may need to call
+     * the Container's {@link Ext.Container#doLayout doLayout} to refresh the view which causes any
+     * unrendered child Components to be rendered. This is required so that you can add multiple
+     * child components if needed while only refreshing the layout once.</p>
+     * <p>When creating complex UIs, it is important to remember that sizing and positioning
+     * of child items is the responsibility of the Container's {@link Ext.Container#layout layout} manager.
+     * If you expect child items to be sized in response to user interactions, you must
+     * configure the Container with a layout manager which creates and manages the type of layout you
+     * have in mind.</p>
+     * <p><b>Omitting the Container's {@link Ext.Container#layout layout} config means that a basic
+     * layout manager is used which does nothing but render child components sequentially into the
+     * Container. No sizing or positioning will be performed in this situation.</b></p>
+     * @param {Element/HTMLElement/String} container (optional) The element this Component should be
+     * rendered into. If it is being created from existing markup, this should be omitted.
+     * @param {String/Number} position (optional) The element ID or DOM node index within the container <b>before</b>
+     * which this component will be inserted (defaults to appending to the end of the container)
      */
-    initTarget: function(id, sGroup, config) {
-
-        // configuration attributes
-        this.config = config || {};
-
-        // create a local reference to the drag and drop manager
-        this.DDM = Ext.dd.DDM;
-        // initialize the groups array
-        this.groups = {};
-
-        // assume that we have an element reference instead of an id if the
-        // parameter is not a string
-        if (typeof id !== "string") {
-            id = Ext.id(id);
-        }
-
-        // set the id
-        this.id = id;
-
-        // add to an interaction group
-        this.addToGroup((sGroup) ? sGroup : "default");
+    render : function(container, position){
+        if(!this.rendered && this.fireEvent('beforerender', this) !== false){
+            if(!container && this.el){
+                this.el = Ext.get(this.el);
+                container = this.el.dom.parentNode;
+                this.allowDomMove = false;
+            }
+            this.container = Ext.get(container);
+            if(this.ctCls){
+                this.container.addClass(this.ctCls);
+            }
+            this.rendered = true;
+            if(position !== undefined){
+                if(Ext.isNumber(position)){
+                    position = this.container.dom.childNodes[position];
+                }else{
+                    position = Ext.getDom(position);
+                }
+            }
+            this.onRender(this.container, position || null);
+            if(this.autoShow){
+                this.el.removeClass(['x-hidden','x-hide-' + this.hideMode]);
+            }
+            if(this.cls){
+                this.el.addClass(this.cls);
+                delete this.cls;
+            }
+            if(this.style){
+                this.el.applyStyles(this.style);
+                delete this.style;
+            }
+            if(this.overCls){
+                this.el.addClassOnOver(this.overCls);
+            }
+            this.fireEvent('render', this);
 
-        // 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;
 
-        // the linked element is the element that gets dragged by default
-        this.setDragElId(id);
+            // Populate content of the component with html, contentEl or
+            // a tpl.
+            var contentTarget = this.getContentTarget();
+            if (this.html){
+                contentTarget.update(Ext.DomHelper.markup(this.html));
+                delete this.html;
+            }
+            if (this.contentEl){
+                var ce = Ext.getDom(this.contentEl);
+                Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']);
+                contentTarget.appendChild(ce);
+            }
+            if (this.tpl) {
+                if (!this.tpl.compile) {
+                    this.tpl = new Ext.XTemplate(this.tpl);
+                }
+                if (this.data) {
+                    this.tpl[this.tplWriteMode](contentTarget, this.data);
+                    delete this.data;
+                }
+            }
+            this.afterRender(this.container);
 
-        // by default, clicked anchors will not start drag operations.
-        this.invalidHandleTypes = { A: "A" };
-        this.invalidHandleIds = {};
-        this.invalidHandleClasses = [];
 
-        this.applyConfig();
+            if(this.hidden){
+                // call this so we don't fire initial hide events.
+                this.doHide();
+            }
+            if(this.disabled){
+                // pass silent so the event doesn't fire the first time.
+                this.disable(true);
+            }
 
-        this.handleOnAvailable();
+            if(this.stateful !== false){
+                this.initStateEvents();
+            }
+            this.fireEvent('afterrender', this);
+        }
+        return this;
     },
 
+
     /**
-     * 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
+     * Update the content area of a component.
+     * @param {Mixed} htmlOrData
+     * If this component has been configured with a template via the tpl config
+     * then it will use this argument as data to populate the template.
+     * If this component was not configured with a template, the components
+     * content area will be updated via Ext.Element update
+     * @param {Boolean} loadScripts
+     * (optional) Only legitimate when using the html configuration. Defaults to false
+     * @param {Function} callback
+     * (optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
      */
-    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);
-
+    update: function(htmlOrData, loadScripts, cb) {
+        var contentTarget = this.getContentTarget();
+        if (this.tpl && typeof htmlOrData !== "string") {
+            this.tpl[this.tplWriteMode](contentTarget, htmlOrData || {});
+        } else {
+            var html = Ext.isObject(htmlOrData) ? Ext.DomHelper.markup(htmlOrData) : htmlOrData;
+            contentTarget.update(html, loadScripts, cb);
+        }
     },
 
+
     /**
-     * Executed when the linked element is available
-     * @method handleOnAvailable
      * @private
+     * Method to manage awareness of when components are added to their
+     * respective Container, firing an added event.
+     * References are established at add time rather than at render time.
+     * @param {Ext.Container} container Container which holds the component
+     * @param {number} pos Position at which the component was added
      */
-    handleOnAvailable: function() {
-        this.available = true;
-        this.resetConstraints();
-        this.onAvailable();
+    onAdded : function(container, pos) {
+        this.ownerCt = container;
+        this.initRef();
+        this.fireEvent('added', this, container, pos);
     },
 
-     /**
-     * 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
+    /**
+     * @private
+     * Method to manage awareness of when components are removed from their
+     * respective Container, firing an removed event. References are properly
+     * cleaned up after removing a component from its owning container.
      */
-    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];
-        }
+    onRemoved : function() {
+        this.removeRef();
+        this.fireEvent('removed', this, this.ownerCt);
+        delete this.ownerCt;
     },
 
     /**
-     * Stores the initial placement of the linked element.
-     * @method setInitPosition
-     * @param {int} diffX   the X offset, default 0
-     * @param {int} diffY   the Y offset, default 0
+     * @private
+     * Method to establish a reference to a component.
      */
-    setInitPosition: function(diffX, diffY) {
-        var el = this.getEl();
-
-        if (!this.DDM.verifyEl(el)) {
-            return;
+    initRef : function() {
+        /**
+         * @cfg {String} ref
+         * <p>A path specification, relative to the Component's <code>{@link #ownerCt}</code>
+         * specifying into which ancestor Container to place a named reference to this Component.</p>
+         * <p>The ancestor axis can be traversed by using '/' characters in the path.
+         * For example, to put a reference to a Toolbar Button into <i>the Panel which owns the Toolbar</i>:</p><pre><code>
+var myGrid = new Ext.grid.EditorGridPanel({
+    title: 'My EditorGridPanel',
+    store: myStore,
+    colModel: myColModel,
+    tbar: [{
+        text: 'Save',
+        handler: saveChanges,
+        disabled: true,
+        ref: '../saveButton'
+    }],
+    listeners: {
+        afteredit: function() {
+//          The button reference is in the GridPanel
+            myGrid.saveButton.enable();
         }
+    }
+});
+</code></pre>
+         * <p>In the code above, if the <code>ref</code> had been <code>'saveButton'</code>
+         * the reference would have been placed into the Toolbar. Each '/' in the <code>ref</code>
+         * moves up one level from the Component's <code>{@link #ownerCt}</code>.</p>
+         * <p>Also see the <code>{@link #added}</code> and <code>{@link #removed}</code> events.</p>
+         */
+        if(this.ref && !this.refOwner){
+            var levels = this.ref.split('/'),
+                last = levels.length,
+                i = 0,
+                t = this;
 
-        var dx = diffX || 0;
-        var dy = diffY || 0;
-
-        var p = Dom.getXY( el );
-
-        this.initPageX = p[0] - dx;
-        this.initPageY = p[1] - dy;
+            while(t && i < last){
+                t = t.ownerCt;
+                ++i;
+            }
+            if(t){
+                t[this.refName = levels[--i]] = this;
+                /**
+                 * @type Ext.Container
+                 * @property refOwner
+                 * The ancestor Container into which the {@link #ref} reference was inserted if this Component
+                 * is a child of a Container, and has been configured with a <code>ref</code>.
+                 */
+                this.refOwner = t;
+            }
+        }
+    },
 
-        this.lastPageX = p[0];
-        this.lastPageY = p[1];
+    removeRef : function() {
+        if (this.refOwner && this.refName) {
+            delete this.refOwner[this.refName];
+            delete this.refOwner;
+        }
+    },
 
+    // private
+    initState : function(){
+        if(Ext.state.Manager){
+            var id = this.getStateId();
+            if(id){
+                var state = Ext.state.Manager.get(id);
+                if(state){
+                    if(this.fireEvent('beforestaterestore', this, state) !== false){
+                        this.applyState(Ext.apply({}, state));
+                        this.fireEvent('staterestore', this, state);
+                    }
+                }
+            }
+        }
+    },
 
-        this.setStartPosition(p);
+    // private
+    getStateId : function(){
+        return this.stateId || ((/^(ext-comp-|ext-gen)/).test(String(this.id)) ? null : this.id);
     },
 
-    /**
-     * 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() );
-        this.deltaSetXY = null;
+    // private
+    initStateEvents : function(){
+        if(this.stateEvents){
+            for(var i = 0, e; e = this.stateEvents[i]; i++){
+                this.on(e, this.saveState, this, {delay:100});
+            }
+        }
+    },
 
-        this.startPageX = p[0];
-        this.startPageY = p[1];
+    // private
+    applyState : function(state){
+        if(state){
+            Ext.apply(this, state);
+        }
     },
 
-    /**
-     * 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);
+    // private
+    getState : function(){
+        return null;
     },
 
-    /**
-     * 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];
+    // private
+    saveState : function(){
+        if(Ext.state.Manager && this.stateful !== false){
+            var id = this.getStateId();
+            if(id){
+                var state = this.getState();
+                if(this.fireEvent('beforestatesave', this, state) !== false){
+                    Ext.state.Manager.set(id, state);
+                    this.fireEvent('statesave', this, state);
+                }
+            }
         }
-
-        this.DDM.removeDDFromGroup(this, sGroup);
     },
 
     /**
-     * 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
+     * Apply this component to existing markup that is valid. With this function, no call to render() is required.
+     * @param {String/HTMLElement} el
      */
-    setDragElId: function(id) {
-        this.dragElId = id;
+    applyToMarkup : function(el){
+        this.allowDomMove = false;
+        this.el = Ext.get(el);
+        this.render(this.el.dom.parentNode);
     },
 
     /**
-     * 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.
+     * Adds a CSS class to the component's underlying element.
+     * @param {string} cls The CSS class name to add
+     * @return {Ext.Component} this
      */
-    setHandleElId: function(id) {
-        if (typeof id !== "string") {
-            id = Ext.id(id);
+    addClass : function(cls){
+        if(this.el){
+            this.el.addClass(cls);
+        }else{
+            this.cls = this.cls ? this.cls + ' ' + cls : cls;
         }
-        this.handleElId = id;
-        this.DDM.regHandle(this.id, id);
+        return this;
     },
 
     /**
-     * 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
+     * Removes a CSS class from the component's underlying element.
+     * @param {string} cls The CSS class name to remove
+     * @return {Ext.Component} this
      */
-    setOuterHandleElId: function(id) {
-        if (typeof id !== "string") {
-            id = Ext.id(id);
+    removeClass : function(cls){
+        if(this.el){
+            this.el.removeClass(cls);
+        }else if(this.cls){
+            this.cls = this.cls.split(' ').remove(cls).join(' ');
         }
-        Event.on(id, "mousedown",
-                this.handleMouseDown, this);
-        this.setHandleElId(id);
-
-        this.hasOuterHandles = true;
+        return this;
     },
 
-    /**
-     * Remove all drag and drop hooks for this element
-     * @method unreg
-     */
-    unreg: function() {
-        Event.un(this.id, "mousedown",
-                this.handleMouseDown);
-        this._domRef = null;
-        this.DDM._remove(this);
+    // private
+    // default function is not really useful
+    onRender : function(ct, position){
+        if(!this.el && this.autoEl){
+            if(Ext.isString(this.autoEl)){
+                this.el = document.createElement(this.autoEl);
+            }else{
+                var div = document.createElement('div');
+                Ext.DomHelper.overwrite(div, this.autoEl);
+                this.el = div.firstChild;
+            }
+            if (!this.el.id) {
+                this.el.id = this.getId();
+            }
+        }
+        if(this.el){
+            this.el = Ext.get(this.el);
+            if(this.allowDomMove !== false){
+                ct.dom.insertBefore(this.el.dom, position);
+                if (div) {
+                    Ext.removeNode(div);
+                    div = null;
+                }
+            }
+        }
     },
 
-    destroy : function(){
-        this.unreg();
+    // private
+    getAutoCreate : function(){
+        var cfg = Ext.isObject(this.autoCreate) ?
+                      this.autoCreate : Ext.apply({}, this.defaultAutoCreate);
+        if(this.id && !cfg.id){
+            cfg.id = this.id;
+        }
+        return cfg;
     },
 
-    /**
-     * 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);
-    },
+    // private
+    afterRender : Ext.emptyFn,
 
     /**
-     * Fired when this object is clicked
-     * @method handleMouseDown
-     * @param {Event} e
-     * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj)
-     * @private
+     * Destroys this component by purging any event listeners, removing the component's element from the DOM,
+     * removing the component from its {@link Ext.Container} (if applicable) and unregistering it from
+     * {@link Ext.ComponentMgr}.  Destruction is generally handled automatically by the framework and this method
+     * should usually not need to be called directly.
+     *
      */
-    handleMouseDown: function(e, oDD){
-        if (this.primaryButtonOnly && e.button != 0) {
-            return;
-        }
-
-        if (this.isLocked()) {
-            return;
-        }
-
-        this.DDM.refreshCache(this.groups);
-
-        var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e));
-        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
-        } else {
-            if (this.clickValidator(e)) {
-
-                // set the initial element position
-                this.setStartPosition();
-
-
-                this.b4MouseDown(e);
-                this.onMouseDown(e);
-
-                this.DDM.handleMouseDown(e, this);
-
-                this.DDM.stopEvent(e);
-            } else {
-
-
+    destroy : function(){
+        if(!this.isDestroyed){
+            if(this.fireEvent('beforedestroy', this) !== false){
+                this.destroying = true;
+                this.beforeDestroy();
+                if(this.ownerCt && this.ownerCt.remove){
+                    this.ownerCt.remove(this, false);
+                }
+                if(this.rendered){
+                    this.el.remove();
+                    if(this.actionMode == 'container' || this.removeMode == 'container'){
+                        this.container.remove();
+                    }
+                }
+                this.onDestroy();
+                Ext.ComponentMgr.unregister(this);
+                this.fireEvent('destroy', this);
+                this.purgeListeners();
+                this.destroying = false;
+                this.isDestroyed = true;
             }
         }
     },
 
-    clickValidator: function(e) {
-        var target = e.getTarget();
-        return ( this.isValidHandleChild(target) &&
-                    (this.id == this.handleElId ||
-                        this.DDM.handleWasClicked(target, this.id)) );
+    deleteMembers : function(){
+        var args = arguments;
+        for(var i = 0, len = args.length; i < len; ++i){
+            delete this[args[i]];
+        }
     },
 
+    // private
+    beforeDestroy : Ext.emptyFn,
+
+    // private
+    onDestroy  : Ext.emptyFn,
+
     /**
-     * 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
+     * <p>Returns the {@link Ext.Element} which encapsulates this Component.</p>
+     * <p>This will <i>usually</i> be a &lt;DIV> element created by the class's onRender method, but
+     * that may be overridden using the {@link #autoEl} config.</p>
+     * <br><p><b>Note</b>: this element will not be available until this Component has been rendered.</p><br>
+     * <p>To add listeners for <b>DOM events</b> to this Component (as opposed to listeners
+     * for this Component's own Observable events), see the {@link #listeners} config for a suggestion,
+     * or use a render listener directly:</p><pre><code>
+new Ext.Panel({
+    title: 'The Clickable Panel',
+    listeners: {
+        render: function(p) {
+            // Append the Panel to the click handler&#39;s argument list.
+            p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
+        },
+        single: true  // Remove the listener after first invocation
+    }
+});
+</code></pre>
+     * @return {Ext.Element} The Element which encapsulates this Component.
      */
-    addInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        this.invalidHandleTypes[type] = type;
+    getEl : function(){
+        return this.el;
     },
 
-    /**
-     * 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 = Ext.id(id);
-        }
-        this.invalidHandleIds[id] = id;
+    // private
+    getContentTarget : function(){
+        return this.el;
     },
 
     /**
-     * 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
+     * Returns the <code>id</code> of this component or automatically generates and
+     * returns an <code>id</code> if an <code>id</code> is not defined yet:<pre><code>
+     * 'ext-comp-' + (++Ext.Component.AUTO_ID)
+     * </code></pre>
+     * @return {String} id
      */
-    addInvalidHandleClass: function(cssClass) {
-        this.invalidHandleClasses.push(cssClass);
+    getId : function(){
+        return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID));
     },
 
     /**
-     * Unsets an excluded tag name set by addInvalidHandleType
-     * @method removeInvalidHandleType
-     * @param {string} tagName the type of element to unexclude
+     * Returns the <code>{@link #itemId}</code> of this component.  If an
+     * <code>{@link #itemId}</code> was not assigned through configuration the
+     * <code>id</code> is returned using <code>{@link #getId}</code>.
+     * @return {String}
      */
-    removeInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        // this.invalidHandleTypes[type] = null;
-        delete this.invalidHandleTypes[type];
+    getItemId : function(){
+        return this.itemId || this.getId();
     },
 
     /**
-     * Unsets an invalid handle id
-     * @method removeInvalidHandleId
-     * @param {string} id the id of the element to re-enable
+     * Try to focus this component.
+     * @param {Boolean} selectText (optional) If applicable, true to also select the text in this component
+     * @param {Boolean/Number} delay (optional) Delay the focus this number of milliseconds (true for 10 milliseconds)
+     * @return {Ext.Component} this
      */
-    removeInvalidHandleId: function(id) {
-        if (typeof id !== "string") {
-            id = Ext.id(id);
+    focus : function(selectText, delay){
+        if(delay){
+            this.focus.defer(Ext.isNumber(delay) ? delay : 10, this, [selectText, false]);
+            return;
         }
-        delete this.invalidHandleIds[id];
+        if(this.rendered){
+            this.el.focus();
+            if(selectText === true){
+                this.el.dom.select();
+            }
+        }
+        return this;
     },
 
-    /**
-     * 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];
-            }
+    // private
+    blur : function(){
+        if(this.rendered){
+            this.el.blur();
         }
+        return this;
     },
 
     /**
-     * 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
+     * Disable this component and fire the 'disable' event.
+     * @return {Ext.Component} this
      */
-    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;
+    disable : function(/* private */ silent){
+        if(this.rendered){
+            this.onDisable();
         }
-        valid = valid && !this.invalidHandleTypes[nodeName];
-        valid = valid && !this.invalidHandleIds[node.id];
-
-        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
-            valid = !Ext.fly(node).hasClass(this.invalidHandleClasses[i]);
+        this.disabled = true;
+        if(silent !== true){
+            this.fireEvent('disable', this);
         }
+        return this;
+    },
 
+    // private
+    onDisable : function(){
+        this.getActionEl().addClass(this.disabledClass);
+        this.el.dom.disabled = true;
+    },
 
-        return valid;
+    /**
+     * Enable this component and fire the 'enable' event.
+     * @return {Ext.Component} this
+     */
+    enable : function(){
+        if(this.rendered){
+            this.onEnable();
+        }
+        this.disabled = false;
+        this.fireEvent('enable', this);
+        return this;
+    },
 
+    // private
+    onEnable : function(){
+        this.getActionEl().removeClass(this.disabledClass);
+        this.el.dom.disabled = false;
     },
 
     /**
-     * Create the array of horizontal tick marks if an interval was specified
-     * in setXConstraint().
-     * @method setXTicks
-     * @private
+     * Convenience function for setting disabled/enabled by boolean.
+     * @param {Boolean} disabled
+     * @return {Ext.Component} this
      */
-    setXTicks: function(iStartX, iTickSize) {
-        this.xTicks = [];
-        this.xTickSize = iTickSize;
-
-        var tickMap = {};
+    setDisabled : function(disabled){
+        return this[disabled ? 'disable' : 'enable']();
+    },
 
-        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
+    /**
+     * Show this component.  Listen to the '{@link #beforeshow}' event and return
+     * <tt>false</tt> to cancel showing the component.  Fires the '{@link #show}'
+     * event after showing the component.
+     * @return {Ext.Component} this
+     */
+    show : function(){
+        if(this.fireEvent('beforeshow', this) !== false){
+            this.hidden = false;
+            if(this.autoRender){
+                this.render(Ext.isBoolean(this.autoRender) ? Ext.getBody() : this.autoRender);
             }
-        }
-
-        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
+            if(this.rendered){
+                this.onShow();
             }
+            this.fireEvent('show', this);
         }
+        return this;
+    },
 
-        this.xTicks.sort(this.DDM.numericSort) ;
+    // private
+    onShow : function(){
+        this.getVisibilityEl().removeClass('x-hide-' + this.hideMode);
     },
 
     /**
-     * Create the array of vertical tick marks if an interval was specified in
-     * setYConstraint().
-     * @method setYTicks
-     * @private
+     * Hide this component.  Listen to the '{@link #beforehide}' event and return
+     * <tt>false</tt> to cancel hiding the component.  Fires the '{@link #hide}'
+     * event after hiding the component. Note this method is called internally if
+     * the component is configured to be <code>{@link #hidden}</code>.
+     * @return {Ext.Component} this
      */
-    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;
-            }
+    hide : function(){
+        if(this.fireEvent('beforehide', this) !== false){
+            this.doHide();
+            this.fireEvent('hide', this);
         }
+        return this;
+    },
 
-        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.yTicks[this.yTicks.length] = i;
-                tickMap[i] = true;
-            }
+    // private
+    doHide: function(){
+        this.hidden = true;
+        if(this.rendered){
+            this.onHide();
         }
-
-        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;
-
-        this.minX = this.initPageX - iLeft;
-        this.maxX = this.initPageX + iRight;
-        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+    // private
+    onHide : function(){
+        this.getVisibilityEl().addClass('x-hide-' + this.hideMode);
+    },
 
-        this.constrainX = true;
+    // private
+    getVisibilityEl : function(){
+        return this.hideParent ? this.container : this.getActionEl();
     },
 
     /**
-     * Clears any constraints applied to this instance.  Also clears ticks
-     * since they can't exist independent of a constraint at this time.
-     * @method clearConstraints
+     * Convenience function to hide or show this component by boolean.
+     * @param {Boolean} visible True to show, false to hide
+     * @return {Ext.Component} this
      */
-    clearConstraints: function() {
-        this.constrainX = false;
-        this.constrainY = false;
-        this.clearTicks();
+    setVisible : function(visible){
+        return this[visible ? 'show' : 'hide']();
     },
 
     /**
-     * Clears any tick interval defined for this instance
-     * @method clearTicks
+     * Returns true if this component is visible.
+     * @return {Boolean} True if this component is visible, false otherwise.
      */
-    clearTicks: function() {
-        this.xTicks = null;
-        this.yTicks = null;
-        this.xTickSize = 0;
-        this.yTickSize = 0;
+    isVisible : function(){
+        return this.rendered && this.getVisibilityEl().isVisible();
     },
 
     /**
-     * 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.
+     * Clone the current component using the original config values passed into this instance by default.
+     * @param {Object} overrides A new config containing any properties to override in the cloned version.
+     * An id property can be passed on this object, otherwise one will be generated to avoid duplicates.
+     * @return {Ext.Component} clone The cloned copy of this component
      */
-    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;
-
+    cloneConfig : function(overrides){
+        overrides = overrides || {};
+        var id = overrides.id || Ext.id();
+        var cfg = Ext.applyIf(overrides, this.initialConfig);
+        cfg.id = id; // prevent dup id
+        return new this.constructor(cfg);
     },
 
     /**
-     * resetConstraints must be called if you manually reposition a dd element.
-     * @method resetConstraints
-     * @param {boolean} maintainOffset
+     * Gets the xtype for this component as registered with {@link Ext.ComponentMgr}. For a list of all
+     * available xtypes, see the {@link Ext.Component} header. Example usage:
+     * <pre><code>
+var t = new Ext.form.TextField();
+alert(t.getXType());  // alerts 'textfield'
+</code></pre>
+     * @return {String} The xtype
      */
-    resetConstraints: function() {
-
-
-        // 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;
-
-            this.setInitPosition(dx, dy);
-
-        // This is the first time we have detected the element's position
-        } 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         );
-        }
+    getXType : function(){
+        return this.constructor.xtype;
     },
 
     /**
-     * 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
+     * <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
+     * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p>
+     * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
+     * to participate in determination of inherited xtypes.</b></p>
+     * <p>For a list of all available xtypes, see the {@link Ext.Component} header.</p>
+     * <p>Example usage:</p>
+     * <pre><code>
+var t = new Ext.form.TextField();
+var isText = t.isXType('textfield');        // true
+var isBoxSubclass = t.isXType('box');       // true, descended from BoxComponent
+var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
+</code></pre>
+     * @param {String} xtype The xtype to check for this Component
+     * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
+     * the default), or true to check whether this Component is directly of the specified xtype.
+     * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
      */
-    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];
-                }
-            }
-
-            // The value is larger than the last tick, so we return the last
-            // tick.
-            return tickArray[tickArray.length - 1];
+    isXType : function(xtype, shallow){
+        //assume a string by default
+        if (Ext.isFunction(xtype)){
+            xtype = xtype.xtype; //handle being passed the class, e.g. Ext.Component
+        }else if (Ext.isObject(xtype)){
+            xtype = xtype.constructor.xtype; //handle being passed an instance
         }
+
+        return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : this.constructor.xtype == xtype;
     },
 
     /**
-     * toString method
-     * @method toString
-     * @return {string} string representation of the dd obj
+     * <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
+     * available xtypes, see the {@link Ext.Component} header.</p>
+     * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
+     * to participate in determination of inherited xtypes.</b></p>
+     * <p>Example usage:</p>
+     * <pre><code>
+var t = new Ext.form.TextField();
+alert(t.getXTypes());  // alerts 'component/box/field/textfield'
+</code></pre>
+     * @return {String} The xtype hierarchy string
      */
-    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.
- */
-
-// Only load the library once.  Rewriting the manager class would orphan
-// existing drag and drop instances.
-if (!Ext.dd.DragDropMgr) {
-
-/**
- * @class Ext.dd.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.
- * @singleton
- */
-Ext.dd.DragDropMgr = function() {
-
-    var Event = Ext.EventManager;
-
-    return {
-
-        /**
-         * 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: {},
-
-        /**
-         * 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 DragDrop object that is currently being dragged
-         * @property dragCurrent
-         * @type DragDrop
-         * @private
-         * @static
-         **/
-        dragCurrent: null,
-
-        /**
-         * the DragDrop object(s) that are being hovered over
-         * @property dragOvers
-         * @type Array
-         * @private
-         * @static
-         */
-        dragOvers: {},
-
-        /**
-         * the X distance between the cursor and the object being dragged
-         * @property deltaX
-         * @type int
-         * @private
-         * @static
-         */
-        deltaX: 0,
-
-        /**
-         * the Y distance between the cursor and the object being dragged
-         * @property deltaY
-         * @type int
-         * @private
-         * @static
-         */
-        deltaY: 0,
-
-        /**
-         * 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,
-
-        /**
-         * 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,
-
-        /**
-         * Internal flag that is set to true when drag and drop has been
-         * intialized
-         * @property initialized
-         * @private
-         * @static
-         */
-        initialized: false,
-
-        /**
-         * All drag and drop can be disabled.
-         * @property locked
-         * @private
-         * @static
-         */
-        locked: false,
-
-        /**
-         * Called the first time an element is registered.
-         * @method init
-         * @private
-         * @static
-         */
-        init: function() {
-            this.initialized = 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
-         */
-        POINT: 0,
-
-        /**
-         * In intersect mode, drag and drop interaction is defined by the
-         * overlap of two or more drag and drop objects.
-         * @property INTERSECT
-         * @type int
-         * @static
-         */
-        INTERSECT: 1,
-
-        /**
-         * The current drag and drop mode.  Default: POINT
-         * @property mode
-         * @type int
-         * @static
-         */
-        mode: 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);
-                }
+    getXTypes : function(){
+        var tc = this.constructor;
+        if(!tc.xtypes){
+            var c = [], sc = this;
+            while(sc && sc.constructor.xtype){
+                c.unshift(sc.constructor.xtype);
+                sc = sc.constructor.superclass;
             }
-        },
-
-        /**
-         * Drag and drop initialization.  Sets up the global event handlers
-         * @method _onLoad
-         * @private
-         * @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);
-
-        },
-
-        /**
-         * Reset constraints on all drag and drop objs
-         * @method _onResize
-         * @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; },
+            tc.xtypeChain = c;
+            tc.xtypes = c.join('/');
+        }
+        return tc.xtypes;
+    },
 
-        /**
-         * 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: {},
+    /**
+     * Find a container above this component at any level by a custom function. If the passed function returns
+     * true, the container will be returned.
+     * @param {Function} fn The custom function to call with the arguments (container, this component).
+     * @return {Ext.Container} The first Container for which the custom function returns true
+     */
+    findParentBy : function(fn) {
+        for (var p = this.ownerCt; (p != null) && !fn(p, this); p = p.ownerCt);
+        return p || null;
+    },
 
-        /**
-         * 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,
+    /**
+     * Find a container above this component at any level by xtype or class
+     * @param {String/Class} xtype The xtype string for a component, or the class of the component directly
+     * @return {Ext.Container} The first Container which matches the given xtype or class
+     */
+    findParentByType : function(xtype) {
+        return Ext.isFunction(xtype) ?
+            this.findParentBy(function(p){
+                return p.constructor === xtype;
+            }) :
+            this.findParentBy(function(p){
+                return p.constructor.xtype === xtype;
+            });
+    },
 
-        /**
-         * 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,
+    // protected
+    getPositionEl : function(){
+        return this.positionEl || this.el;
+    },
 
-        /**
-         * 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: 350,
+    // private
+    purgeListeners : function(){
+        Ext.Component.superclass.purgeListeners.call(this);
+        if(this.mons){
+            this.on('beforedestroy', this.clearMons, this, {single: 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,
+    // private
+    clearMons : function(){
+        Ext.each(this.mons, function(m){
+            m.item.un(m.ename, m.fn, m.scope);
+        }, this);
+        this.mons = [];
+    },
 
-        /**
-         * Timeout used for the click time threshold
-         * @property clickTimeout
-         * @type Object
-         * @private
-         * @static
-         */
-        clickTimeout: null,
+    // private
+    createMons: function(){
+        if(!this.mons){
+            this.mons = [];
+            this.on('beforedestroy', this.clearMons, this, {single: true});
+        }
+    },
 
-        /**
-         * 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,
+    /**
+     * <p>Adds listeners to any Observable object (or Elements) which are automatically removed when this Component
+     * is destroyed. Usage:</p><code><pre>
+myGridPanel.mon(myGridPanel.getSelectionModel(), 'selectionchange', handleSelectionChange, null, {buffer: 50});
+</pre></code>
+     * <p>or:</p><code><pre>
+myGridPanel.mon(myGridPanel.getSelectionModel(), {
+    selectionchange: handleSelectionChange,
+    buffer: 50
+});
+</pre></code>
+     * @param {Observable|Element} item The item to which to add a listener/listeners.
+     * @param {Object|String} ename The event name, or an object containing event name properties.
+     * @param {Function} fn Optional. If the <code>ename</code> parameter was an event name, this
+     * is the handler function.
+     * @param {Object} scope Optional. If the <code>ename</code> parameter was an event name, this
+     * is the scope (<code>this</code> reference) in which the handler function is executed.
+     * @param {Object} opt Optional. If the <code>ename</code> parameter was an event name, this
+     * is the {@link Ext.util.Observable#addListener addListener} options.
+     */
+    mon : function(item, ename, fn, scope, opt){
+        this.createMons();
+        if(Ext.isObject(ename)){
+            var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
 
-        /**
-         * 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,
+            var o = ename;
+            for(var e in o){
+                if(propRe.test(e)){
+                    continue;
+                }
+                if(Ext.isFunction(o[e])){
+                    // shared options
+                    this.mons.push({
+                        item: item, ename: e, fn: o[e], scope: o.scope
+                    });
+                    item.on(e, o[e], o.scope, o);
+                }else{
+                    // individual options
+                    this.mons.push({
+                        item: item, ename: e, fn: o[e], scope: o.scope
+                    });
+                    item.on(e, o[e]);
+                }
+            }
+            return;
+        }
 
-        /**
-         * 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(); }
+        this.mons.push({
+            item: item, ename: ename, fn: fn, scope: scope
+        });
+        item.on(ename, fn, scope, opt);
+    },
 
-            if (!this.ids[sGroup]) {
-                this.ids[sGroup] = {};
+    /**
+     * Removes listeners that were added by the {@link #mon} method.
+     * @param {Observable|Element} item The item from which to remove a listener/listeners.
+     * @param {Object|String} ename The event name, or an object containing event name properties.
+     * @param {Function} fn Optional. If the <code>ename</code> parameter was an event name, this
+     * is the handler function.
+     * @param {Object} scope Optional. If the <code>ename</code> parameter was an event name, this
+     * is the scope (<code>this</code> reference) in which the handler function is executed.
+     */
+    mun : function(item, ename, fn, scope){
+        var found, mon;
+        this.createMons();
+        for(var i = 0, len = this.mons.length; i < len; ++i){
+            mon = this.mons[i];
+            if(item === mon.item && ename == mon.ename && fn === mon.fn && scope === mon.scope){
+                this.mons.splice(i, 1);
+                item.un(ename, fn, scope);
+                found = true;
+                break;
             }
-            this.ids[sGroup][oDD.id] = oDD;
-        },
+        }
+        return found;
+    },
 
-        /**
-         * 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] = {};
+    /**
+     * Returns the next component in the owning container
+     * @return Ext.Component
+     */
+    nextSibling : function(){
+        if(this.ownerCt){
+            var index = this.ownerCt.items.indexOf(this);
+            if(index != -1 && index+1 < this.ownerCt.items.getCount()){
+                return this.ownerCt.items.itemAt(index+1);
+            }
+        }
+        return null;
+    },
+
+    /**
+     * Returns the previous component in the owning container
+     * @return Ext.Component
+     */
+    previousSibling : function(){
+        if(this.ownerCt){
+            var index = this.ownerCt.items.indexOf(this);
+            if(index > 0){
+                return this.ownerCt.items.itemAt(index-1);
             }
+        }
+        return null;
+    },
+
+    /**
+     * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
+     * @return {Ext.Container} the Container which owns this Component.
+     */
+    getBubbleTarget : function(){
+        return this.ownerCt;
+    }
+});
+
+Ext.reg('component', Ext.Component);/**\r
+ * @class Ext.Action\r
+ * <p>An Action is a piece of reusable functionality that can be abstracted out of any particular component so that it\r
+ * can be usefully shared among multiple components.  Actions let you share handlers, configuration options and UI\r
+ * updates across any components that support the Action interface (primarily {@link Ext.Toolbar}, {@link Ext.Button}\r
+ * and {@link Ext.menu.Menu} components).</p>\r
+ * <p>Aside from supporting the config object interface, any component that needs to use Actions must also support\r
+ * the following method list, as these will be called as needed by the Action class: setText(string), setIconCls(string),\r
+ * setDisabled(boolean), setVisible(boolean) and setHandler(function).</p>\r
+ * Example usage:<br>\r
+ * <pre><code>\r
+// Define the shared action.  Each component below will have the same\r
+// display text and icon, and will display the same message on click.\r
+var action = new Ext.Action({\r
+    {@link #text}: 'Do something',\r
+    {@link #handler}: function(){\r
+        Ext.Msg.alert('Click', 'You did something.');\r
+    },\r
+    {@link #iconCls}: 'do-something',\r
+    {@link #itemId}: 'myAction'\r
+});\r
+\r
+var panel = new Ext.Panel({\r
+    title: 'Actions',\r
+    width: 500,\r
+    height: 300,\r
+    tbar: [\r
+        // Add the action directly to a toolbar as a menu button\r
+        action,\r
+        {\r
+            text: 'Action Menu',\r
+            // Add the action to a menu as a text item\r
+            menu: [action]\r
+        }\r
+    ],\r
+    items: [\r
+        // Add the action to the panel body as a standard button\r
+        new Ext.Button(action)\r
+    ],\r
+    renderTo: Ext.getBody()\r
+});\r
+\r
+// Change the text for all components using the action\r
+action.setText('Something else');\r
+\r
+// Reference an action through a container using the itemId\r
+var btn = panel.getComponent('myAction');\r
+var aRef = btn.baseAction;\r
+aRef.setText('New text');\r
+</code></pre>\r
+ * @constructor\r
+ * @param {Object} config The configuration options\r
+ */\r
+Ext.Action = Ext.extend(Object, {\r
+    /**\r
+     * @cfg {String} text The text to set for all components using this action (defaults to '').\r
+     */\r
+    /**\r
+     * @cfg {String} iconCls\r
+     * The CSS class selector that specifies a background image to be used as the header icon for\r
+     * all components using this action (defaults to '').\r
+     * <p>An example of specifying a custom icon class would be something like:\r
+     * </p><pre><code>\r
+// specify the property in the config for the class:\r
+     ...\r
+     iconCls: 'do-something'\r
+\r
+// css class that specifies background image to be used as the icon image:\r
+.do-something { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }\r
+</code></pre>\r
+     */\r
+    /**\r
+     * @cfg {Boolean} disabled True to disable all components using this action, false to enable them (defaults to false).\r
+     */\r
+    /**\r
+     * @cfg {Boolean} hidden True to hide all components using this action, false to show them (defaults to false).\r
+     */\r
+    /**\r
+     * @cfg {Function} handler The function that will be invoked by each component tied to this action\r
+     * when the component's primary event is triggered (defaults to undefined).\r
+     */\r
+    /**\r
+     * @cfg {String} itemId\r
+     * See {@link Ext.Component}.{@link Ext.Component#itemId itemId}.\r
+     */\r
+    /**\r
+     * @cfg {Object} scope The scope (<tt><b>this</b></tt> reference) in which the\r
+     * <code>{@link #handler}</code> is executed. Defaults to this Button.\r
+     */\r
+\r
+    constructor : function(config){\r
+        this.initialConfig = config;\r
+        this.itemId = config.itemId = (config.itemId || config.id || Ext.id());\r
+        this.items = [];\r
+    },\r
+    \r
+    // private\r
+    isAction : true,\r
+\r
+    /**\r
+     * Sets the text to be displayed by all components using this action.\r
+     * @param {String} text The text to display\r
+     */\r
+    setText : function(text){\r
+        this.initialConfig.text = text;\r
+        this.callEach('setText', [text]);\r
+    },\r
+\r
+    /**\r
+     * Gets the text currently displayed by all components using this action.\r
+     */\r
+    getText : function(){\r
+        return this.initialConfig.text;\r
+    },\r
+\r
+    /**\r
+     * Sets the icon CSS class for all components using this action.  The class should supply\r
+     * a background image that will be used as the icon image.\r
+     * @param {String} cls The CSS class supplying the icon image\r
+     */\r
+    setIconClass : function(cls){\r
+        this.initialConfig.iconCls = cls;\r
+        this.callEach('setIconClass', [cls]);\r
+    },\r
+\r
+    /**\r
+     * Gets the icon CSS class currently used by all components using this action.\r
+     */\r
+    getIconClass : function(){\r
+        return this.initialConfig.iconCls;\r
+    },\r
+\r
+    /**\r
+     * Sets the disabled state of all components using this action.  Shortcut method\r
+     * for {@link #enable} and {@link #disable}.\r
+     * @param {Boolean} disabled True to disable the component, false to enable it\r
+     */\r
+    setDisabled : function(v){\r
+        this.initialConfig.disabled = v;\r
+        this.callEach('setDisabled', [v]);\r
+    },\r
+\r
+    /**\r
+     * Enables all components using this action.\r
+     */\r
+    enable : function(){\r
+        this.setDisabled(false);\r
+    },\r
+\r
+    /**\r
+     * Disables all components using this action.\r
+     */\r
+    disable : function(){\r
+        this.setDisabled(true);\r
+    },\r
+\r
+    /**\r
+     * Returns true if the components using this action are currently disabled, else returns false.  \r
+     */\r
+    isDisabled : function(){\r
+        return this.initialConfig.disabled;\r
+    },\r
+\r
+    /**\r
+     * Sets the hidden state of all components using this action.  Shortcut method\r
+     * for <code>{@link #hide}</code> and <code>{@link #show}</code>.\r
+     * @param {Boolean} hidden True to hide the component, false to show it\r
+     */\r
+    setHidden : function(v){\r
+        this.initialConfig.hidden = v;\r
+        this.callEach('setVisible', [!v]);\r
+    },\r
+\r
+    /**\r
+     * Shows all components using this action.\r
+     */\r
+    show : function(){\r
+        this.setHidden(false);\r
+    },\r
+\r
+    /**\r
+     * Hides all components using this action.\r
+     */\r
+    hide : function(){\r
+        this.setHidden(true);\r
+    },\r
+\r
+    /**\r
+     * Returns true if the components using this action are currently hidden, else returns false.  \r
+     */\r
+    isHidden : function(){\r
+        return this.initialConfig.hidden;\r
+    },\r
+\r
+    /**\r
+     * Sets the function that will be called by each Component using this action when its primary event is triggered.\r
+     * @param {Function} fn The function that will be invoked by the action's components.  The function\r
+     * will be called with no arguments.\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the function is executed. Defaults to the Component firing the event.\r
+     */\r
+    setHandler : function(fn, scope){\r
+        this.initialConfig.handler = fn;\r
+        this.initialConfig.scope = scope;\r
+        this.callEach('setHandler', [fn, scope]);\r
+    },\r
+\r
+    /**\r
+     * Executes the specified function once for each Component currently tied to this action.  The function passed\r
+     * in should accept a single argument that will be an object that supports the basic Action config/method interface.\r
+     * @param {Function} fn The function to execute for each component\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the function is executed.  Defaults to the Component.\r
+     */\r
+    each : function(fn, scope){\r
+        Ext.each(this.items, fn, scope);\r
+    },\r
+\r
+    // private\r
+    callEach : function(fnName, args){\r
+        var cs = this.items;\r
+        for(var i = 0, len = cs.length; i < len; i++){\r
+            cs[i][fnName].apply(cs[i], args);\r
+        }\r
+    },\r
+\r
+    // private\r
+    addComponent : function(comp){\r
+        this.items.push(comp);\r
+        comp.on('destroy', this.removeComponent, this);\r
+    },\r
+\r
+    // private\r
+    removeComponent : function(comp){\r
+        this.items.remove(comp);\r
+    },\r
+\r
+    /**\r
+     * Executes this action manually using the handler function specified in the original config object\r
+     * or the handler function set with <code>{@link #setHandler}</code>.  Any arguments passed to this\r
+     * function will be passed on to the handler function.\r
+     * @param {Mixed} arg1 (optional) Variable number of arguments passed to the handler function\r
+     * @param {Mixed} arg2 (optional)\r
+     * @param {Mixed} etc... (optional)\r
+     */\r
+    execute : function(){\r
+        this.initialConfig.handler.apply(this.initialConfig.scope || window, arguments);\r
+    }\r
+});\r
+/**
+ * @class Ext.Layer
+ * @extends Ext.Element
+ * An extended {@link Ext.Element} object that supports a shadow and shim, constrain to viewport and
+ * automatic maintaining of shadow/shim positions.
+ * @cfg {Boolean} shim False to disable the iframe shim in browsers which need one (defaults to true)
+ * @cfg {String/Boolean} shadow True to automatically create an {@link Ext.Shadow}, or a string indicating the
+ * shadow's display {@link Ext.Shadow#mode}. False to disable the shadow. (defaults to false)
+ * @cfg {Object} dh DomHelper object config to create element with (defaults to {tag: 'div', cls: 'x-layer'}).
+ * @cfg {Boolean} constrain False to disable constrain to viewport (defaults to true)
+ * @cfg {String} cls CSS class to add to the element
+ * @cfg {Number} zindex Starting z-index (defaults to 11000)
+ * @cfg {Number} shadowOffset Number of pixels to offset the shadow (defaults to 4)
+ * @cfg {Boolean} useDisplay
+ * Defaults to use css offsets to hide the Layer. Specify <tt>true</tt>
+ * to use css style <tt>'display:none;'</tt> to hide the Layer.
+ * @constructor
+ * @param {Object} config An object with config options.
+ * @param {String/HTMLElement} existingEl (optional) Uses an existing DOM element. If the element is not found it creates it.
+ */
+(function(){
+Ext.Layer = function(config, existingEl){
+    config = config || {};
+    var dh = Ext.DomHelper;
+    var cp = config.parentEl, pel = cp ? Ext.getDom(cp) : document.body;
+    if(existingEl){
+        this.dom = Ext.getDom(existingEl);
+    }
+    if(!this.dom){
+        var o = config.dh || {tag: 'div', cls: 'x-layer'};
+        this.dom = dh.append(pel, o);
+    }
+    if(config.cls){
+        this.addClass(config.cls);
+    }
+    this.constrain = config.constrain !== false;
+    this.setVisibilityMode(Ext.Element.VISIBILITY);
+    if(config.id){
+        this.id = this.dom.id = config.id;
+    }else{
+        this.id = Ext.id(this.dom);
+    }
+    this.zindex = config.zindex || this.getZIndex();
+    this.position('absolute', this.zindex);
+    if(config.shadow){
+        this.shadowOffset = config.shadowOffset || 4;
+        this.shadow = new Ext.Shadow({
+            offset : this.shadowOffset,
+            mode : config.shadow
+        });
+    }else{
+        this.shadowOffset = 0;
+    }
+    this.useShim = config.shim !== false && Ext.useShims;
+    this.useDisplay = config.useDisplay;
+    this.hide();
+};
 
-            var obj = this.ids[sGroup];
-            if (obj && obj[oDD.id]) {
-                delete obj[oDD.id];
-            }
-        },
+var supr = Ext.Element.prototype;
 
-        /**
-         * 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] && this.ids[g][oDD.id]) {
-                    delete this.ids[g][oDD.id];
-                }
-            }
-            delete this.handleIds[oDD.id];
-        },
+// shims are shared among layer to keep from having 100 iframes
+var shims = [];
 
-        /**
-         * 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;
-        },
+Ext.extend(Ext.Layer, Ext.Element, {
 
-        /**
-         * 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;
-        },
+    getZIndex : function(){
+        return this.zindex || parseInt((this.getShim() || this).getStyle('z-index'), 10) || 11000;
+    },
 
-        /**
-         * 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 (var j in this.ids[i]) {
-                    var dd = this.ids[i][j];
-                    if (! this.isTypeOfDD(dd)) {
-                        continue;
-                    }
-                    if (!bTargetsOnly || dd.isTarget) {
-                        oDDs[oDDs.length] = dd;
-                    }
-                }
-            }
+    getShim : function(){
+        if(!this.useShim){
+            return null;
+        }
+        if(this.shim){
+            return this.shim;
+        }
+        var shim = shims.shift();
+        if(!shim){
+            shim = this.createShim();
+            shim.enableDisplayMode('block');
+            shim.dom.style.display = 'none';
+            shim.dom.style.visibility = 'visible';
+        }
+        var pn = this.dom.parentNode;
+        if(shim.dom.parentNode != pn){
+            pn.insertBefore(shim.dom, this.dom);
+        }
+        shim.setStyle('z-index', this.getZIndex()-2);
+        this.shim = shim;
+        return shim;
+    },
 
-            return oDDs;
-        },
+    hideShim : function(){
+        if(this.shim){
+            this.shim.setDisplayed(false);
+            shims.push(this.shim);
+            delete this.shim;
+        }
+    },
 
-        /**
-         * 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;
-                }
+    disableShadow : function(){
+        if(this.shadow){
+            this.shadowDisabled = true;
+            this.shadow.hide();
+            this.lastShadowOffset = this.shadowOffset;
+            this.shadowOffset = 0;
+        }
+    },
+
+    enableShadow : function(show){
+        if(this.shadow){
+            this.shadowDisabled = false;
+            this.shadowOffset = this.lastShadowOffset;
+            delete this.lastShadowOffset;
+            if(show){
+                this.sync(true);
             }
+        }
+    },
 
-            return false;
-        },
+    // private
+    // this code can execute repeatedly in milliseconds (i.e. during a drag) so
+    // code size was sacrificed for effeciency (e.g. no getBox/setBox, no XY calls)
+    sync : function(doShow){
+        var sw = this.shadow;
+        if(!this.updating && this.isVisible() && (sw || this.useShim)){
+            var sh = this.getShim();
 
-        /**
-         * 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);
-        },
+            var w = this.getWidth(),
+                h = this.getHeight();
 
-        /**
-         * 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] );
-        },
+            var l = this.getLeft(true),
+                t = this.getTop(true);
 
-        /**
-         * 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];
+            if(sw && !this.shadowDisabled){
+                if(doShow && !sw.isVisible()){
+                    sw.show(this);
+                }else{
+                    sw.realign(l, t, w, h);
                 }
+                if(sh){
+                    if(doShow){
+                       sh.show();
+                    }
+                    // fit the shim behind the shadow, so it is shimmed too
+                    var a = sw.adjusts, s = sh.dom.style;
+                    s.left = (Math.min(l, l+a.l))+'px';
+                    s.top = (Math.min(t, t+a.t))+'px';
+                    s.width = (w+a.w)+'px';
+                    s.height = (h+a.h)+'px';
+                }
+            }else if(sh){
+                if(doShow){
+                   sh.show();
+                }
+                sh.setSize(w, h);
+                sh.setLeftTop(l, t);
             }
-            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) {
-            if(Ext.QuickTips){
-                Ext.QuickTips.disable();
-            }
-            if(this.dragCurrent){
-                // the original browser mouseup wasn't handled (e.g. outside FF browser window)
-                // so clean up first to avoid breaking the next drag
-                this.handleMouseUp(e);
-            }
-            
-            this.currentTarget = e.getTarget();
-            this.dragCurrent = oDD;
 
-            var el = oDD.getEl();
+        }
+    },
 
-            // track start position
-            this.startX = e.getPageX();
-            this.startY = e.getPageY();
+    // private
+    destroy : function(){
+        this.hideShim();
+        if(this.shadow){
+            this.shadow.hide();
+        }
+        this.removeAllListeners();
+        Ext.removeNode(this.dom);
+        delete this.dom;
+    },
 
-            this.deltaX = this.startX - el.offsetLeft;
-            this.deltaY = this.startY - el.offsetTop;
+    remove : function(){
+        this.destroy();
+    },
 
-            this.dragThreshMet = false;
+    // private
+    beginUpdate : function(){
+        this.updating = true;
+    },
 
-            this.clickTimeout = setTimeout(
-                    function() {
-                        var DDM = Ext.dd.DDM;
-                        DDM.startDrag(DDM.startX, DDM.startY);
-                    },
-                    this.clickTimeThresh );
-        },
+    // private
+    endUpdate : function(){
+        this.updating = false;
+        this.sync(true);
+    },
 
-        /**
-         * 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;
-        },
+    // private
+    hideUnders : function(negOffset){
+        if(this.shadow){
+            this.shadow.hide();
+        }
+        this.hideShim();
+    },
 
-        /**
-         * 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) {
+    // private
+    constrainXY : function(){
+        if(this.constrain){
+            var vw = Ext.lib.Dom.getViewWidth(),
+                vh = Ext.lib.Dom.getViewHeight();
+            var s = Ext.getDoc().getScroll();
 
-            if(Ext.QuickTips){
-                Ext.QuickTips.enable();
-            }
-            if (! this.dragCurrent) {
-                return;
+            var xy = this.getXY();
+            var x = xy[0], y = xy[1];
+            var so = this.shadowOffset;
+            var w = this.dom.offsetWidth+so, h = this.dom.offsetHeight+so;
+            // only move it if it needs it
+            var moved = false;
+            // first validate right/bottom
+            if((x + w) > vw+s.left){
+                x = vw - w - so;
+                moved = true;
             }
-
-            clearTimeout(this.clickTimeout);
-
-            if (this.dragThreshMet) {
-                this.fireEvents(e, true);
-            } else {
+            if((y + h) > vh+s.top){
+                y = vh - h - so;
+                moved = true;
             }
-
-            this.stopDrag(e);
-
-            this.stopEvent(e);
-        },
-
-        /**
-         * 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) {
-                e.stopPropagation();
+            // then make sure top/left isn't negative
+            if(x < s.left){
+                x = s.left;
+                moved = true;
             }
-
-            if (this.preventDefault) {
-                e.preventDefault();
+            if(y < s.top){
+                y = s.top;
+                moved = true;
             }
-        },
-
-        /**
-         * 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) {
-            // 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);
+            if(moved){
+                if(this.avoidY){
+                    var ay = this.avoidY;
+                    if(y <= ay && (y+h) >= ay){
+                        y = ay-h-5;
+                    }
                 }
-
-                this.dragCurrent.onMouseUp(e);
+                xy = [x, y];
+                this.storeXY(xy);
+                supr.setXY.call(this, xy);
+                this.sync();
             }
+        }
+        return this;
+    },
 
-            this.dragCurrent = null;
-            this.dragOvers = {};
-        },
-
-        /**
-         * 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;
-            }
-            // var button = e.which || e.button;
+    isVisible : function(){
+        return this.visible;
+    },
 
-            // check for IE mouseup outside of page boundary
-            if (Ext.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) {
-                this.stopEvent(e);
-                return this.handleMouseUp(e);
-            }
+    // private
+    showAction : function(){
+        this.visible = true; // track visibility to prevent getStyle calls
+        if(this.useDisplay === true){
+            this.setDisplayed('');
+        }else if(this.lastXY){
+            supr.setXY.call(this, this.lastXY);
+        }else if(this.lastLT){
+            supr.setLeftTop.call(this, this.lastLT[0], this.lastLT[1]);
+        }
+    },
 
-            if (!this.dragThreshMet) {
-                var diffX = Math.abs(this.startX - e.getPageX());
-                var diffY = Math.abs(this.startY - e.getPageY());
-                if (diffX > this.clickPixelThresh ||
-                            diffY > this.clickPixelThresh) {
-                    this.startDrag(this.startX, this.startY);
-                }
-            }
+    // private
+    hideAction : function(){
+        this.visible = false;
+        if(this.useDisplay === true){
+            this.setDisplayed(false);
+        }else{
+            this.setLeftTop(-10000,-10000);
+        }
+    },
 
-            if (this.dragThreshMet) {
-                this.dragCurrent.b4Drag(e);
-                this.dragCurrent.onDrag(e);
-                if(!this.dragCurrent.moveOnly){
-                    this.fireEvents(e, false);
+    // overridden Element method
+    setVisible : function(v, a, d, c, e){
+        if(v){
+            this.showAction();
+        }
+        if(a && v){
+            var cb = function(){
+                this.sync(true);
+                if(c){
+                    c();
                 }
+            }.createDelegate(this);
+            supr.setVisible.call(this, true, true, d, cb, e);
+        }else{
+            if(!v){
+                this.hideUnders(true);
             }
+            var cb = c;
+            if(a){
+                cb = function(){
+                    this.hideAction();
+                    if(c){
+                        c();
+                    }
+                }.createDelegate(this);
+            }
+            supr.setVisible.call(this, v, a, d, cb, e);
+            if(v){
+                this.sync(true);
+            }else if(!a){
+                this.hideAction();
+            }
+        }
+        return this;
+    },
 
-            this.stopEvent(e);
-
-            return true;
-        },
-
-        /**
-         * 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;
-
-            // 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 pt = e.getPoint();
-
-            // cache the previous dragOver array
-            var oldOvers = [];
-
-            var outEvts   = [];
-            var overEvts  = [];
-            var dropEvts  = [];
-            var enterEvts = [];
-
-            // 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) {
-
-                var ddo = this.dragOvers[i];
+    storeXY : function(xy){
+        delete this.lastLT;
+        this.lastXY = xy;
+    },
 
-                if (! this.isTypeOfDD(ddo)) {
-                    continue;
-                }
+    storeLeftTop : function(left, top){
+        delete this.lastXY;
+        this.lastLT = [left, top];
+    },
 
-                if (! this.isOverTarget(pt, ddo, this.mode)) {
-                    outEvts.push( ddo );
-                }
+    // private
+    beforeFx : function(){
+        this.beforeAction();
+        return Ext.Layer.superclass.beforeFx.apply(this, arguments);
+    },
 
-                oldOvers[i] = true;
-                delete this.dragOvers[i];
-            }
+    // private
+    afterFx : function(){
+        Ext.Layer.superclass.afterFx.apply(this, arguments);
+        this.sync(this.isVisible());
+    },
 
-            for (var sGroup in dc.groups) {
+    // private
+    beforeAction : function(){
+        if(!this.updating && this.shadow){
+            this.shadow.hide();
+        }
+    },
 
-                if ("string" != typeof sGroup) {
-                    continue;
-                }
+    // overridden Element method
+    setLeft : function(left){
+        this.storeLeftTop(left, this.getTop(true));
+        supr.setLeft.apply(this, arguments);
+        this.sync();
+        return this;
+    },
 
-                for (i in this.ids[sGroup]) {
-                    var oDD = this.ids[sGroup][i];
-                    if (! this.isTypeOfDD(oDD)) {
-                        continue;
-                    }
+    setTop : function(top){
+        this.storeLeftTop(this.getLeft(true), top);
+        supr.setTop.apply(this, arguments);
+        this.sync();
+        return this;
+    },
 
-                    if (oDD.isTarget && !oDD.isLocked() && ((oDD != dc) || (dc.ignoreSelf === false))) {
-                        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 {
+    setLeftTop : function(left, top){
+        this.storeLeftTop(left, top);
+        supr.setLeftTop.apply(this, arguments);
+        this.sync();
+        return this;
+    },
 
-                                // initial drag over: dragEnter fires
-                                if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
-                                // subsequent drag overs: dragOver fires
-                                } else {
-                                    overEvts.push( oDD );
-                                }
+    setXY : function(xy, a, d, c, e){
+        this.fixDisplay();
+        this.beforeAction();
+        this.storeXY(xy);
+        var cb = this.createCB(c);
+        supr.setXY.call(this, xy, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+        return this;
+    },
 
-                                this.dragOvers[oDD.id] = oDD;
-                            }
-                        }
-                    }
-                }
+    // private
+    createCB : function(c){
+        var el = this;
+        return function(){
+            el.constrainXY();
+            el.sync(true);
+            if(c){
+                c();
             }
+        };
+    },
 
-            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);
-                }
+    // overridden Element method
+    setX : function(x, a, d, c, e){
+        this.setXY([x, this.getY()], a, d, c, e);
+        return this;
+    },
 
-                if (dropEvts.length) {
-                    dc.b4DragDrop(e, dropEvts);
-                    dc.onDragDrop(e, dropEvts);
-                }
+    // overridden Element method
+    setY : function(y, a, d, c, e){
+        this.setXY([this.getX(), y], a, d, c, e);
+        return this;
+    },
 
-            } 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);
-                }
+    // overridden Element method
+    setSize : function(w, h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setSize.call(this, w, h, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+        return this;
+    },
 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    // dc.b4DragEnter(e, oDD.id);
-                    dc.onDragEnter(e, enterEvts[i].id);
-                }
+    // overridden Element method
+    setWidth : function(w, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setWidth.call(this, w, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+        return this;
+    },
 
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    dc.b4DragOver(e, overEvts[i].id);
-                    dc.onDragOver(e, overEvts[i].id);
-                }
+    // overridden Element method
+    setHeight : function(h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setHeight.call(this, h, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+        return this;
+    },
 
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    dc.b4DragDrop(e, dropEvts[i].id);
-                    dc.onDragDrop(e, dropEvts[i].id);
-                }
+    // overridden Element method
+    setBounds : function(x, y, w, h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        if(!a){
+            this.storeXY([x, y]);
+            supr.setXY.call(this, [x, y]);
+            supr.setSize.call(this, w, h, a, d, cb, e);
+            cb();
+        }else{
+            supr.setBounds.call(this, x, y, w, h, a, d, cb, e);
+        }
+        return this;
+    },
 
+    /**
+     * Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
+     * incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow
+     * element, if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index).
+     * @param {Number} zindex The new z-index to set
+     * @return {this} The Layer
+     */
+    setZIndex : function(zindex){
+        this.zindex = zindex;
+        this.setStyle('z-index', zindex + 2);
+        if(this.shadow){
+            this.shadow.setZIndex(zindex + 1);
+        }
+        if(this.shim){
+            this.shim.setStyle('z-index', zindex);
+        }
+        return this;
+    }
+});
+})();
+/**
+ * @class Ext.Shadow
+ * Simple class that can provide a shadow effect for any element.  Note that the element MUST be absolutely positioned,
+ * and the shadow does not provide any shimming.  This should be used only in simple cases -- for more advanced
+ * functionality that can also provide the same shadow effect, see the {@link Ext.Layer} class.
+ * @constructor
+ * Create a new Shadow
+ * @param {Object} config The config object
+ */
+Ext.Shadow = function(config){
+    Ext.apply(this, config);
+    if(typeof this.mode != "string"){
+        this.mode = this.defaultMode;
+    }
+    var o = this.offset, a = {h: 0};
+    var rad = Math.floor(this.offset/2);
+    switch(this.mode.toLowerCase()){ // all this hideous nonsense calculates the various offsets for shadows
+        case "drop":
+            a.w = 0;
+            a.l = a.t = o;
+            a.t -= 1;
+            if(Ext.isIE){
+                a.l -= this.offset + rad;
+                a.t -= this.offset + rad;
+                a.w -= rad;
+                a.h -= rad;
+                a.t += 1;
             }
-
-            // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
-                dc.onInvalidDrop(e);
+        break;
+        case "sides":
+            a.w = (o*2);
+            a.l = -o;
+            a.t = o-1;
+            if(Ext.isIE){
+                a.l -= (this.offset - rad);
+                a.t -= this.offset + rad;
+                a.l += 1;
+                a.w -= (this.offset - rad)*2;
+                a.w -= rad + 1;
+                a.h -= 1;
+            }
+        break;
+        case "frame":
+            a.w = a.h = (o*2);
+            a.l = a.t = -o;
+            a.t += 1;
+            a.h -= 2;
+            if(Ext.isIE){
+                a.l -= (this.offset - rad);
+                a.t -= (this.offset - rad);
+                a.l += 1;
+                a.w -= (this.offset + rad + 1);
+                a.h -= (this.offset + rad);
+                a.h += 1;
             }
+        break;
+    };
 
-        },
+    this.adjusts = a;
+};
 
-        /**
-         * 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;
-            // Return null if the input is not what we expect
-            //if (!dds || !dds.length || dds.length == 0) {
-               // winner = null;
-            // If there is only one item, it wins
-            //} else if (dds.length == 1) {
+Ext.Shadow.prototype = {
+    /**
+     * @cfg {String} mode
+     * The shadow display mode.  Supports the following options:<div class="mdetail-params"><ul>
+     * <li><b><tt>sides</tt></b> : Shadow displays on both sides and bottom only</li>
+     * <li><b><tt>frame</tt></b> : Shadow displays equally on all four sides</li>
+     * <li><b><tt>drop</tt></b> : Traditional bottom-right drop shadow</li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {String} offset
+     * The number of pixels to offset the shadow from the element (defaults to <tt>4</tt>)
+     */
+    offset: 4,
 
-            var len = dds.length;
+    // private
+    defaultMode: "drop",
 
-            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 (dd.cursorIsOver) {
-                        winner = dd;
-                        break;
-                    // Otherwise the object with the most overlap wins
-                    } else {
-                        if (!winner ||
-                            winner.overlap.getArea() < dd.overlap.getArea()) {
-                            winner = dd;
-                        }
-                    }
-                }
+    /**
+     * Displays the shadow under the target element
+     * @param {Mixed} targetEl The id or element under which the shadow should display
+     */
+    show : function(target){
+        target = Ext.get(target);
+        if(!this.el){
+            this.el = Ext.Shadow.Pool.pull();
+            if(this.el.dom.nextSibling != target.dom){
+                this.el.insertBefore(target);
             }
+        }
+        this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10)-1);
+        if(Ext.isIE){
+            this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";
+        }
+        this.realign(
+            target.getLeft(true),
+            target.getTop(true),
+            target.getWidth(),
+            target.getHeight()
+        );
+        this.el.dom.style.display = "block";
+    },
 
-            return winner;
-        },
+    /**
+     * Returns true if the shadow is visible, else false
+     */
+    isVisible : function(){
+        return this.el ? true : false;  
+    },
 
-        /**
-         * 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>
-         * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups);
-         * </code>
-         * Alternatively:
-         * <code>
-         * Ext.dd.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];
+    /**
+     * Direct alignment when values are already available. Show must be called at least once before
+     * calling this method to ensure it is initialized.
+     * @param {Number} left The target element left position
+     * @param {Number} top The target element top position
+     * @param {Number} width The target element width
+     * @param {Number} height The target element height
+     */
+    realign : function(l, t, w, h){
+        if(!this.el){
+            return;
+        }
+        var a = this.adjusts, d = this.el.dom, s = d.style;
+        var iea = 0;
+        s.left = (l+a.l)+"px";
+        s.top = (t+a.t)+"px";
+        var sw = (w+a.w), sh = (h+a.h), sws = sw +"px", shs = sh + "px";
+        if(s.width != sws || s.height != shs){
+            s.width = sws;
+            s.height = shs;
+            if(!Ext.isIE){
+                var cn = d.childNodes;
+                var sww = Math.max(0, (sw-12))+"px";
+                cn[0].childNodes[1].style.width = sww;
+                cn[1].childNodes[1].style.width = sww;
+                cn[2].childNodes[1].style.width = sww;
+                cn[1].style.height = Math.max(0, (sh-12))+"px";
+            }
+        }
+    },
 
-                    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();
-                        }
-                    }
-                }
+    /**
+     * Hides this shadow
+     */
+    hide : function(){
+        if(this.el){
+            this.el.dom.style.display = "none";
+            Ext.Shadow.Pool.push(this.el);
+            delete this.el;
+        }
+    },
+
+    /**
+     * Adjust the z-index of this shadow
+     * @param {Number} zindex The new z-index
+     */
+    setZIndex : function(z){
+        this.zIndex = z;
+        if(this.el){
+            this.el.setStyle("z-index", z);
+        }
+    }
+};
+
+// Private utility class that manages the internal Shadow cache
+Ext.Shadow.Pool = function(){
+    var p = [];
+    var markup = Ext.isIE ?
+                 '<div class="x-ie-shadow"></div>' :
+                 '<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
+    return {
+        pull : function(){
+            var sh = p.shift();
+            if(!sh){
+                sh = Ext.get(Ext.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup));
+                sh.autoBoxAdjust = false;
             }
+            return sh;
         },
 
-        /**
-         * 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) {
-            if (el) {
-                var parent;
-                if(Ext.isIE){
-                    try{
-                        parent = el.offsetParent;
-                    }catch(e){}
-                }else{
-                    parent = el.offsetParent;
-                }
-                if (parent) {
-                    return true;
-                }
+        push : function(sh){
+            p.push(sh);
+        }
+    };
+}();/**
+ * @class Ext.BoxComponent
+ * @extends Ext.Component
+ * <p>Base class for any {@link Ext.Component Component} that is to be sized as a box, using width and height.</p>
+ * <p>BoxComponent provides automatic box model adjustments for sizing and positioning and will work correctly
+ * within the Component rendering model.</p>
+ * <p>A BoxComponent may be created as a custom Component which encapsulates any HTML element, either a pre-existing
+ * element, or one that is created to your specifications at render time. Usually, to participate in layouts,
+ * a Component will need to be a <b>Box</b>Component in order to have its width and height managed.</p>
+ * <p>To use a pre-existing element as a BoxComponent, configure it so that you preset the <b>el</b> property to the
+ * element to reference:<pre><code>
+var pageHeader = new Ext.BoxComponent({
+    el: 'my-header-div'
+});</code></pre>
+ * This may then be {@link Ext.Container#add added} to a {@link Ext.Container Container} as a child item.</p>
+ * <p>To create a BoxComponent based around a HTML element to be created at render time, use the
+ * {@link Ext.Component#autoEl autoEl} config option which takes the form of a
+ * {@link Ext.DomHelper DomHelper} specification:<pre><code>
+var myImage = new Ext.BoxComponent({
+    autoEl: {
+        tag: 'img',
+        src: '/images/my-image.jpg'
+    }
+});</code></pre></p>
+ * @constructor
+ * @param {Ext.Element/String/Object} config The configuration options.
+ * @xtype box
+ */
+Ext.BoxComponent = Ext.extend(Ext.Component, {
+
+    // Configs below are used for all Components when rendered by BoxLayout.
+    /**
+     * @cfg {Number} flex
+     * <p><b>Note</b>: this config is only used when this Component is rendered
+     * by a Container which has been configured to use a <b>{@link Ext.layout.BoxLayout BoxLayout}.</b>
+     * Each child Component with a <code>flex</code> property will be flexed either vertically (by a VBoxLayout)
+     * or horizontally (by an HBoxLayout) according to the item's <b>relative</b> <code>flex</code> value
+     * compared to the sum of all Components with <code>flex</flex> value specified. Any child items that have
+     * either a <code>flex = 0</code> or <code>flex = undefined</code> will not be 'flexed' (the initial size will not be changed).
+     */
+    // Configs below are used for all Components when rendered by AnchorLayout.
+    /**
+     * @cfg {String} anchor <p><b>Note</b>: this config is only used when this Component is rendered
+     * by a Container which has been configured to use an <b>{@link Ext.layout.AnchorLayout AnchorLayout} (or subclass thereof).</b>
+     * based layout manager, for example:<div class="mdetail-params"><ul>
+     * <li>{@link Ext.form.FormPanel}</li>
+     * <li>specifying <code>layout: 'anchor' // or 'form', or 'absolute'</code></li>
+     * </ul></div></p>
+     * <p>See {@link Ext.layout.AnchorLayout}.{@link Ext.layout.AnchorLayout#anchor anchor} also.</p>
+     */
+    // tabTip config is used when a BoxComponent is a child of a TabPanel
+    /**
+     * @cfg {String} tabTip
+     * <p><b>Note</b>: this config is only used when this BoxComponent is a child item of a TabPanel.</p>
+     * A string to be used as innerHTML (html tags are accepted) to show in a tooltip when mousing over
+     * the associated tab selector element. {@link Ext.QuickTips}.init()
+     * must be called in order for the tips to render.
+     */
+    // Configs below are used for all Components when rendered by BorderLayout.
+    /**
+     * @cfg {String} region <p><b>Note</b>: this config is only used when this BoxComponent is rendered
+     * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
+     * layout manager (e.g. specifying <tt>layout:'border'</tt>).</p><br>
+     * <p>See {@link Ext.layout.BorderLayout} also.</p>
+     */
+    // margins config is used when a BoxComponent is rendered by BorderLayout or BoxLayout.
+    /**
+     * @cfg {Object} margins <p><b>Note</b>: this config is only used when this BoxComponent is rendered
+     * by a Container which has been configured to use the <b>{@link Ext.layout.BorderLayout BorderLayout}</b>
+     * or one of the two <b>{@link Ext.layout.BoxLayout BoxLayout} subclasses.</b></p>
+     * <p>An object containing margins to apply to this BoxComponent in the
+     * format:</p><pre><code>
+{
+    top: (top margin),
+    right: (right margin),
+    bottom: (bottom margin),
+    left: (left margin)
+}</code></pre>
+     * <p>May also be a string containing space-separated, numeric margin values. The order of the
+     * sides associated with each value matches the way CSS processes margin values:</p>
+     * <p><div class="mdetail-params"><ul>
+     * <li>If there is only one value, it applies to all sides.</li>
+     * <li>If there are two values, the top and bottom borders are set to the first value and the
+     * right and left are set to the second.</li>
+     * <li>If there are three values, the top is set to the first value, the left and right are set
+     * to the second, and the bottom is set to the third.</li>
+     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
+     * </ul></div></p>
+     * <p>Defaults to:</p><pre><code>
+     * {top:0, right:0, bottom:0, left:0}
+     * </code></pre>
+     */
+    /**
+     * @cfg {Number} x
+     * The local x (left) coordinate for this component if contained within a positioning container.
+     */
+    /**
+     * @cfg {Number} y
+     * The local y (top) coordinate for this component if contained within a positioning container.
+     */
+    /**
+     * @cfg {Number} pageX
+     * The page level x coordinate for this component if contained within a positioning container.
+     */
+    /**
+     * @cfg {Number} pageY
+     * The page level y coordinate for this component if contained within a positioning container.
+     */
+    /**
+     * @cfg {Number} height
+     * The height of this component in pixels (defaults to auto).
+     * <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
+     */
+    /**
+     * @cfg {Number} width
+     * The width of this component in pixels (defaults to auto).
+     * <b>Note</b> to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
+     */
+    /**
+     * @cfg {Number} boxMinHeight
+     * <p>The minimum value in pixels which this BoxComponent will set its height to.</p>
+     * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+     */
+    /**
+     * @cfg {Number} boxMinWidth
+     * <p>The minimum value in pixels which this BoxComponent will set its width to.</p>
+     * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+     */
+    /**
+     * @cfg {Number} boxMaxHeight
+     * <p>The maximum value in pixels which this BoxComponent will set its height to.</p>
+     * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+     */
+    /**
+     * @cfg {Number} boxMaxWidth
+     * <p>The maximum value in pixels which this BoxComponent will set its width to.</p>
+     * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
+     */
+    /**
+     * @cfg {Boolean} autoHeight
+     * <p>True to use height:'auto', false to use fixed height (or allow it to be managed by its parent
+     * Container's {@link Ext.Container#layout layout manager}. Defaults to false.</p>
+     * <p><b>Note</b>: Although many components inherit this config option, not all will
+     * function as expected with a height of 'auto'. Setting autoHeight:true means that the
+     * browser will manage height based on the element's contents, and that Ext will not manage it at all.</p>
+     * <p>If the <i>browser</i> is managing the height, be aware that resizes performed by the browser in response
+     * to changes within the structure of the Component cannot be detected. Therefore changes to the height might
+     * result in elements needing to be synchronized with the new height. Example:</p><pre><code>
+var w = new Ext.Window({
+    title: 'Window',
+    width: 600,
+    autoHeight: true,
+    items: {
+        title: 'Collapse Me',
+        height: 400,
+        collapsible: true,
+        border: false,
+        listeners: {
+            beforecollapse: function() {
+                w.el.shadow.hide();
+            },
+            beforeexpand: function() {
+                w.el.shadow.hide();
+            },
+            collapse: function() {
+                w.syncShadow();
+            },
+            expand: function() {
+                w.syncShadow();
             }
+        }
+    }
+}).show();
+</code></pre>
+     */
+    /**
+     * @cfg {Boolean} autoWidth
+     * <p>True to use width:'auto', false to use fixed width (or allow it to be managed by its parent
+     * Container's {@link Ext.Container#layout layout manager}. Defaults to false.</p>
+     * <p><b>Note</b>: Although many components  inherit this config option, not all will
+     * function as expected with a width of 'auto'. Setting autoWidth:true means that the
+     * browser will manage width based on the element's contents, and that Ext will not manage it at all.</p>
+     * <p>If the <i>browser</i> is managing the width, be aware that resizes performed by the browser in response
+     * to changes within the structure of the Component cannot be detected. Therefore changes to the width might
+     * result in elements needing to be synchronized with the new width. For example, where the target element is:</p><pre><code>
+&lt;div id='grid-container' style='margin-left:25%;width:50%'>&lt;/div>
+</code></pre>
+     * A Panel rendered into that target element must listen for browser window resize in order to relay its
+      * child items when the browser changes its width:<pre><code>
+var myPanel = new Ext.Panel({
+    renderTo: 'grid-container',
+    monitorResize: true, // relay on browser resize
+    title: 'Panel',
+    height: 400,
+    autoWidth: true,
+    layout: 'hbox',
+    layoutConfig: {
+        align: 'stretch'
+    },
+    defaults: {
+        flex: 1
+    },
+    items: [{
+        title: 'Box 1',
+    }, {
+        title: 'Box 2'
+    }, {
+        title: 'Box 3'
+    }],
+});
+</code></pre>
+     */
+    /**
+     * @cfg {Boolean} autoScroll
+     * <code>true</code> to use overflow:'auto' on the components layout element and show scroll bars automatically when
+     * necessary, <code>false</code> to clip any overflowing content (defaults to <code>false</code>).
+     */
 
-            return false;
-        },
+    /* // private internal config
+     * {Boolean} deferHeight
+     * True to defer height calculations to an external component, false to allow this component to set its own
+     * height (defaults to 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 {Ext.lib.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;
-            }
+    // private
+    initComponent : function(){
+        Ext.BoxComponent.superclass.initComponent.call(this);
+        this.addEvents(
+            /**
+             * @event resize
+             * Fires after the component is resized.
+             * @param {Ext.Component} this
+             * @param {Number} adjWidth The box-adjusted width that was set
+             * @param {Number} adjHeight The box-adjusted height that was set
+             * @param {Number} rawWidth The width that was originally specified
+             * @param {Number} rawHeight The height that was originally specified
+             */
+            'resize',
+            /**
+             * @event move
+             * Fires after the component is moved.
+             * @param {Ext.Component} this
+             * @param {Number} x The new x position
+             * @param {Number} y The new y position
+             */
+            'move'
+        );
+    },
 
-            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
+    // private, set in afterRender to signify that the component has been rendered
+    boxReady : false,
+    // private, used to defer height settings to subclasses
+    deferHeight: false,
 
-            try {
-                pos= Ext.lib.Dom.getXY(el);
-            } catch (e) { }
+    /**
+     * Sets the width and height of this BoxComponent. This method fires the {@link #resize} event. This method can accept
+     * either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.
+     * @param {Mixed} width The new width to set. This may be one of:<div class="mdetail-params"><ul>
+     * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
+     * <li>A String used to set the CSS width style.</li>
+     * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
+     * <li><code>undefined</code> to leave the width unchanged.</li>
+     * </ul></div>
+     * @param {Mixed} height The new height to set (not required if a size object is passed as the first arg).
+     * This may be one of:<div class="mdetail-params"><ul>
+     * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
+     * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
+     * <li><code>undefined</code> to leave the height unchanged.</li>
+     * </ul></div>
+     * @return {Ext.BoxComponent} this
+     */
+    setSize : function(w, h){
 
-            if (!pos) {
-                return null;
+        // support for standard size objects
+        if(typeof w == 'object'){
+            h = w.height, w = w.width;
+        }
+        if (Ext.isDefined(w) && Ext.isDefined(this.boxMinWidth) && (w < this.boxMinWidth)) {
+            w = this.boxMinWidth;
+        }
+        if (Ext.isDefined(h) && Ext.isDefined(this.boxMinHeight) && (h < this.boxMinHeight)) {
+            h = this.boxMinHeight;
+        }
+        if (Ext.isDefined(w) && Ext.isDefined(this.boxMaxWidth) && (w > this.boxMaxWidth)) {
+            w = this.boxMaxWidth;
+        }
+        if (Ext.isDefined(h) && Ext.isDefined(this.boxMaxHeight) && (h > this.boxMaxHeight)) {
+            h = this.boxMaxHeight;
+        }
+        // not rendered
+        if(!this.boxReady){
+            this.width = w, this.height = h;
+            return this;
+        }
+
+        // prevent recalcs when not needed
+        if(this.cacheSizes !== false && this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
+            return this;
+        }
+        this.lastSize = {width: w, height: h};
+        var adj = this.adjustSize(w, h),
+            aw = adj.width,
+            ah = adj.height,
+            rz;
+        if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
+            rz = this.getResizeEl();
+            if(!this.deferHeight && aw !== undefined && ah !== undefined){
+                rz.setSize(aw, ah);
+            }else if(!this.deferHeight && ah !== undefined){
+                rz.setHeight(ah);
+            }else if(aw !== undefined){
+                rz.setWidth(aw);
             }
+            this.onResize(aw, ah, w, h);
+            this.fireEvent('resize', this, aw, ah, w, h);
+        }
+        return this;
+    },
 
-            x1 = pos[0];
-            x2 = x1 + el.offsetWidth;
-            y1 = pos[1];
-            y2 = y1 + el.offsetHeight;
+    /**
+     * Sets the width of the component.  This method fires the {@link #resize} event.
+     * @param {Number} width The new width to setThis may be one of:<div class="mdetail-params"><ul>
+     * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
+     * <li>A String used to set the CSS width style.</li>
+     * </ul></div>
+     * @return {Ext.BoxComponent} this
+     */
+    setWidth : function(width){
+        return this.setSize(width);
+    },
 
-            t = y1 - oDD.padding[0];
-            r = x2 + oDD.padding[1];
-            b = y2 + oDD.padding[2];
-            l = x1 - oDD.padding[3];
+    /**
+     * Sets the height of the component.  This method fires the {@link #resize} event.
+     * @param {Number} height The new height to set. This may be one of:<div class="mdetail-params"><ul>
+     * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).</li>
+     * <li>A String used to set the CSS height style.</li>
+     * <li><i>undefined</i> to leave the height unchanged.</li>
+     * </ul></div>
+     * @return {Ext.BoxComponent} this
+     */
+    setHeight : function(height){
+        return this.setSize(undefined, height);
+    },
 
-            return new Ext.lib.Region( t, r, b, l );
-        },
+    /**
+     * Gets the current size of the component's underlying element.
+     * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
+     */
+    getSize : function(){
+        return this.getResizeEl().getSize();
+    },
 
-        /**
-         * Checks the cursor location to see if it over the target
-         * @method isOverTarget
-         * @param {Ext.lib.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;
+    /**
+     * Gets the current width of the component's underlying element.
+     * @return {Number}
+     */
+    getWidth : function(){
+        return this.getResizeEl().getWidth();
+    },
 
-            }
+    /**
+     * Gets the current height of the component's underlying element.
+     * @return {Number}
+     */
+    getHeight : function(){
+        return this.getResizeEl().getHeight();
+    },
 
-            if (!loc) {
-                return false;
-            }
+    /**
+     * Gets the current size of the component's underlying element, including space taken by its margins.
+     * @return {Object} An object containing the element's size {width: (element width + left/right margins), height: (element height + top/bottom margins)}
+     */
+    getOuterSize : function(){
+        var el = this.getResizeEl();
+        return {width: el.getWidth() + el.getMargins('lr'),
+                height: el.getHeight() + el.getMargins('tb')};
+    },
 
-            oTarget.cursorIsOver = loc.contains( pt );
+    /**
+     * Gets the current XY position of the component's underlying element.
+     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
+     * @return {Array} The XY position of the element (e.g., [100, 200])
+     */
+    getPosition : function(local){
+        var el = this.getPositionEl();
+        if(local === true){
+            return [el.getLeft(true), el.getTop(true)];
+        }
+        return this.xy || el.getXY();
+    },
 
-            // 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;
-            }
+    /**
+     * Gets the current box measurements of the component's underlying element.
+     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
+     * @return {Object} box An object in the format {x, y, width, height}
+     */
+    getBox : function(local){
+        var pos = this.getPosition(local);
+        var s = this.getSize();
+        s.x = pos[0];
+        s.y = pos[1];
+        return s;
+    },
 
-            oTarget.overlap = null;
+    /**
+     * Sets the current box measurements of the component's underlying element.
+     * @param {Object} box An object in the format {x, y, width, height}
+     * @return {Ext.BoxComponent} this
+     */
+    updateBox : function(box){
+        this.setSize(box.width, box.height);
+        this.setPagePosition(box.x, box.y);
+        return this;
+    },
 
-            // 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);
+    /**
+     * <p>Returns the outermost Element of this Component which defines the Components overall size.</p>
+     * <p><i>Usually</i> this will return the same Element as <code>{@link #getEl}</code>,
+     * but in some cases, a Component may have some more wrapping Elements around its main
+     * active Element.</p>
+     * <p>An example is a ComboBox. It is encased in a <i>wrapping</i> Element which
+     * contains both the <code>&lt;input></code> Element (which is what would be returned
+     * by its <code>{@link #getEl}</code> method, <i>and</i> the trigger button Element.
+     * This Element is returned as the <code>resizeEl</code>.
+     * @return {Ext.Element} The Element which is to be resized by size managing layouts.
+     */
+    getResizeEl : function(){
+        return this.resizeEl || this.el;
+    },
 
-            var el = dc.getDragEl();
-            var curRegion = new Ext.lib.Region( pos.y,
-                                                   pos.x + el.offsetWidth,
-                                                   pos.y + el.offsetHeight,
-                                                   pos.x );
+    /**
+     * Sets the overflow on the content element of the component.
+     * @param {Boolean} scroll True to allow the Component to auto scroll.
+     * @return {Ext.BoxComponent} this
+     */
+    setAutoScroll : function(scroll){
+        if(this.rendered){
+            this.getContentTarget().setOverflow(scroll ? 'auto' : '');
+        }
+        this.autoScroll = scroll;
+        return this;
+    },
 
-            var overlap = curRegion.intersect(loc);
+    /**
+     * Sets the left and top of the component.  To set the page XY position instead, use {@link #setPagePosition}.
+     * This method fires the {@link #move} event.
+     * @param {Number} left The new left
+     * @param {Number} top The new top
+     * @return {Ext.BoxComponent} this
+     */
+    setPosition : function(x, y){
+        if(x && typeof x[1] == 'number'){
+            y = x[1];
+            x = x[0];
+        }
+        this.x = x;
+        this.y = y;
+        if(!this.boxReady){
+            return this;
+        }
+        var adj = this.adjustPosition(x, y);
+        var ax = adj.x, ay = adj.y;
 
-            if (overlap) {
-                oTarget.overlap = overlap;
-                return (intersect) ? true : oTarget.cursorIsOver;
-            } else {
-                return false;
+        var el = this.getPositionEl();
+        if(ax !== undefined || ay !== undefined){
+            if(ax !== undefined && ay !== undefined){
+                el.setLeftTop(ax, ay);
+            }else if(ax !== undefined){
+                el.setLeft(ax);
+            }else if(ay !== undefined){
+                el.setTop(ay);
             }
-        },
+            this.onPosition(ax, ay);
+            this.fireEvent('move', this, ax, ay);
+        }
+        return this;
+    },
 
-        /**
-         * unload event handler
-         * @method _onUnload
-         * @private
-         * @static
-         */
-        _onUnload: function(e, me) {
-            Ext.dd.DragDropMgr.unregAll();
-        },
+    /**
+     * Sets the page XY position of the component.  To set the left and top instead, use {@link #setPosition}.
+     * This method fires the {@link #move} event.
+     * @param {Number} x The new x position
+     * @param {Number} y The new y position
+     * @return {Ext.BoxComponent} this
+     */
+    setPagePosition : function(x, y){
+        if(x && typeof x[1] == 'number'){
+            y = x[1];
+            x = x[0];
+        }
+        this.pageX = x;
+        this.pageY = y;
+        if(!this.boxReady){
+            return;
+        }
+        if(x === undefined || y === undefined){ // cannot translate undefined points
+            return;
+        }
+        var p = this.getPositionEl().translatePoints(x, y);
+        this.setPosition(p.left, p.top);
+        return this;
+    },
 
-        /**
-         * Cleans up the drag and drop events and objects.
-         * @method unregAll
-         * @private
-         * @static
-         */
-        unregAll: function() {
+    // private
+    afterRender : function(){
+        Ext.BoxComponent.superclass.afterRender.call(this);
+        if(this.resizeEl){
+            this.resizeEl = Ext.get(this.resizeEl);
+        }
+        if(this.positionEl){
+            this.positionEl = Ext.get(this.positionEl);
+        }
+        this.boxReady = true;
+        Ext.isDefined(this.autoScroll) && this.setAutoScroll(this.autoScroll);
+        this.setSize(this.width, this.height);
+        if(this.x || this.y){
+            this.setPosition(this.x, this.y);
+        }else if(this.pageX || this.pageY){
+            this.setPagePosition(this.pageX, this.pageY);
+        }
+    },
 
-            if (this.dragCurrent) {
-                this.stopDrag();
-                this.dragCurrent = null;
-            }
+    /**
+     * Force the component's size to recalculate based on the underlying element's current height and width.
+     * @return {Ext.BoxComponent} this
+     */
+    syncSize : function(){
+        delete this.lastSize;
+        this.setSize(this.autoWidth ? undefined : this.getResizeEl().getWidth(), this.autoHeight ? undefined : this.getResizeEl().getHeight());
+        return this;
+    },
 
-            this._execOnAll("unreg", []);
+    /* // protected
+     * Called after the component is resized, this method is empty by default but can be implemented by any
+     * subclass that needs to perform custom logic after a resize occurs.
+     * @param {Number} adjWidth The box-adjusted width that was set
+     * @param {Number} adjHeight The box-adjusted height that was set
+     * @param {Number} rawWidth The width that was originally specified
+     * @param {Number} rawHeight The height that was originally specified
+     */
+    onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
+    },
 
-            for (var i in this.elementCache) {
-                delete this.elementCache[i];
-            }
+    /* // protected
+     * Called after the component is moved, this method is empty by default but can be implemented by any
+     * subclass that needs to perform custom logic after a move occurs.
+     * @param {Number} x The new x position
+     * @param {Number} y The new y position
+     */
+    onPosition : function(x, y){
 
-            this.elementCache = {};
-            this.ids = {};
-        },
+    },
 
-        /**
-         * A cache of DOM elements
-         * @property elementCache
-         * @private
-         * @static
-         */
-        elementCache: {},
+    // private
+    adjustSize : function(w, h){
+        if(this.autoWidth){
+            w = 'auto';
+        }
+        if(this.autoHeight){
+            h = 'auto';
+        }
+        return {width : w, height: h};
+    },
 
-        /**
-         * Get the wrapper for the DOM element specified
-         * @method getElWrapper
-         * @param {String} id the id of the element to get
-         * @return {Ext.dd.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(Ext.getDom(id));
-            }
-            return oWrapper;
-        },
+    // private
+    adjustPosition : function(x, y){
+        return {x : x, y: y};
+    }
+});
+Ext.reg('box', Ext.BoxComponent);
 
-        /**
-         * Returns the actual DOM element
-         * @method getElement
-         * @param {String} id the id of the elment to get
-         * @return {Object} The element
-         * @deprecated use Ext.lib.Ext.getDom instead
-         * @static
-         */
-        getElement: function(id) {
-            return Ext.getDom(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 Ext.lib.Dom instead
-         * @static
-         */
-        getCss: function(id) {
-            var el = Ext.getDom(id);
-            return (el) ? el.style : null;
-        },
+/**
+ * @class Ext.Spacer
+ * @extends Ext.BoxComponent
+ * <p>Used to provide a sizable space in a layout.</p>
+ * @constructor
+ * @param {Object} config
+ */
+Ext.Spacer = Ext.extend(Ext.BoxComponent, {
+    autoEl:'div'
+});
+Ext.reg('spacer', Ext.Spacer);/**\r
+ * @class Ext.SplitBar\r
+ * @extends Ext.util.Observable\r
+ * Creates draggable splitter bar functionality from two elements (element to be dragged and element to be resized).\r
+ * <br><br>\r
+ * Usage:\r
+ * <pre><code>\r
+var split = new Ext.SplitBar("elementToDrag", "elementToSize",\r
+                   Ext.SplitBar.HORIZONTAL, Ext.SplitBar.LEFT);\r
+split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));\r
+split.minSize = 100;\r
+split.maxSize = 600;\r
+split.animate = true;\r
+split.on('moved', splitterMoved);\r
+</code></pre>\r
+ * @constructor\r
+ * Create a new SplitBar\r
+ * @param {Mixed} dragElement The element to be dragged and act as the SplitBar.\r
+ * @param {Mixed} resizingElement The element to be resized based on where the SplitBar element is dragged\r
+ * @param {Number} orientation (optional) Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)\r
+ * @param {Number} placement (optional) Either Ext.SplitBar.LEFT or Ext.SplitBar.RIGHT for horizontal or\r
+                        Ext.SplitBar.TOP or Ext.SplitBar.BOTTOM for vertical. (By default, this is determined automatically by the initial\r
+                        position of the SplitBar).\r
+ */\r
+Ext.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){\r
+\r
+    /** @private */\r
+    this.el = Ext.get(dragElement, true);\r
+    this.el.dom.unselectable = "on";\r
+    /** @private */\r
+    this.resizingEl = Ext.get(resizingElement, true);\r
+\r
+    /**\r
+     * @private\r
+     * The orientation of the split. Either Ext.SplitBar.HORIZONTAL or Ext.SplitBar.VERTICAL. (Defaults to HORIZONTAL)\r
+     * Note: If this is changed after creating the SplitBar, the placement property must be manually updated\r
+     * @type Number\r
+     */\r
+    this.orientation = orientation || Ext.SplitBar.HORIZONTAL;\r
+\r
+    /**\r
+     * The increment, in pixels by which to move this SplitBar. When <i>undefined</i>, the SplitBar moves smoothly.\r
+     * @type Number\r
+     * @property tickSize\r
+     */\r
+    /**\r
+     * The minimum size of the resizing element. (Defaults to 0)\r
+     * @type Number\r
+     */\r
+    this.minSize = 0;\r
+\r
+    /**\r
+     * The maximum size of the resizing element. (Defaults to 2000)\r
+     * @type Number\r
+     */\r
+    this.maxSize = 2000;\r
+\r
+    /**\r
+     * Whether to animate the transition to the new size\r
+     * @type Boolean\r
+     */\r
+    this.animate = false;\r
+\r
+    /**\r
+     * Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes.\r
+     * @type Boolean\r
+     */\r
+    this.useShim = false;\r
+\r
+    /** @private */\r
+    this.shim = null;\r
+\r
+    if(!existingProxy){\r
+        /** @private */\r
+        this.proxy = Ext.SplitBar.createProxy(this.orientation);\r
+    }else{\r
+        this.proxy = Ext.get(existingProxy).dom;\r
+    }\r
+    /** @private */\r
+    this.dd = new Ext.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id});\r
+\r
+    /** @private */\r
+    this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this);\r
+\r
+    /** @private */\r
+    this.dd.endDrag = this.onEndProxyDrag.createDelegate(this);\r
+\r
+    /** @private */\r
+    this.dragSpecs = {};\r
+\r
+    /**\r
+     * @private The adapter to use to positon and resize elements\r
+     */\r
+    this.adapter = new Ext.SplitBar.BasicLayoutAdapter();\r
+    this.adapter.init(this);\r
+\r
+    if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
+        /** @private */\r
+        this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Ext.SplitBar.LEFT : Ext.SplitBar.RIGHT);\r
+        this.el.addClass("x-splitbar-h");\r
+    }else{\r
+        /** @private */\r
+        this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Ext.SplitBar.TOP : Ext.SplitBar.BOTTOM);\r
+        this.el.addClass("x-splitbar-v");\r
+    }\r
+\r
+    this.addEvents(\r
+        /**\r
+         * @event resize\r
+         * Fires when the splitter is moved (alias for {@link #moved})\r
+         * @param {Ext.SplitBar} this\r
+         * @param {Number} newSize the new width or height\r
+         */\r
+        "resize",\r
+        /**\r
+         * @event moved\r
+         * Fires when the splitter is moved\r
+         * @param {Ext.SplitBar} this\r
+         * @param {Number} newSize the new width or height\r
+         */\r
+        "moved",\r
+        /**\r
+         * @event beforeresize\r
+         * Fires before the splitter is dragged\r
+         * @param {Ext.SplitBar} this\r
+         */\r
+        "beforeresize",\r
+\r
+        "beforeapply"\r
+    );\r
+\r
+    Ext.SplitBar.superclass.constructor.call(this);\r
+};\r
+\r
+Ext.extend(Ext.SplitBar, Ext.util.Observable, {\r
+    onStartProxyDrag : function(x, y){\r
+        this.fireEvent("beforeresize", this);\r
+        this.overlay =  Ext.DomHelper.append(document.body,  {cls: "x-drag-overlay", html: "&#160;"}, true);\r
+        this.overlay.unselectable();\r
+        this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));\r
+        this.overlay.show();\r
+        Ext.get(this.proxy).setDisplayed("block");\r
+        var size = this.adapter.getElementSize(this);\r
+        this.activeMinSize = this.getMinimumSize();\r
+        this.activeMaxSize = this.getMaximumSize();\r
+        var c1 = size - this.activeMinSize;\r
+        var c2 = Math.max(this.activeMaxSize - size, 0);\r
+        if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
+            this.dd.resetConstraints();\r
+            this.dd.setXConstraint(\r
+                this.placement == Ext.SplitBar.LEFT ? c1 : c2,\r
+                this.placement == Ext.SplitBar.LEFT ? c2 : c1,\r
+                this.tickSize\r
+            );\r
+            this.dd.setYConstraint(0, 0);\r
+        }else{\r
+            this.dd.resetConstraints();\r
+            this.dd.setXConstraint(0, 0);\r
+            this.dd.setYConstraint(\r
+                this.placement == Ext.SplitBar.TOP ? c1 : c2,\r
+                this.placement == Ext.SplitBar.TOP ? c2 : c1,\r
+                this.tickSize\r
+            );\r
+         }\r
+        this.dragSpecs.startSize = size;\r
+        this.dragSpecs.startPoint = [x, y];\r
+        Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y);\r
+    },\r
+\r
+    /**\r
+     * @private Called after the drag operation by the DDProxy\r
+     */\r
+    onEndProxyDrag : function(e){\r
+        Ext.get(this.proxy).setDisplayed(false);\r
+        var endPoint = Ext.lib.Event.getXY(e);\r
+        if(this.overlay){\r
+            Ext.destroy(this.overlay);\r
+            delete this.overlay;\r
+        }\r
+        var newSize;\r
+        if(this.orientation == Ext.SplitBar.HORIZONTAL){\r
+            newSize = this.dragSpecs.startSize +\r
+                (this.placement == Ext.SplitBar.LEFT ?\r
+                    endPoint[0] - this.dragSpecs.startPoint[0] :\r
+                    this.dragSpecs.startPoint[0] - endPoint[0]\r
+                );\r
+        }else{\r
+            newSize = this.dragSpecs.startSize +\r
+                (this.placement == Ext.SplitBar.TOP ?\r
+                    endPoint[1] - this.dragSpecs.startPoint[1] :\r
+                    this.dragSpecs.startPoint[1] - endPoint[1]\r
+                );\r
+        }\r
+        newSize = Math.min(Math.max(newSize, this.activeMinSize), this.activeMaxSize);\r
+        if(newSize != this.dragSpecs.startSize){\r
+            if(this.fireEvent('beforeapply', this, newSize) !== false){\r
+                this.adapter.setElementSize(this, newSize);\r
+                this.fireEvent("moved", this, newSize);\r
+                this.fireEvent("resize", this, newSize);\r
+            }\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Get the adapter this SplitBar uses\r
+     * @return The adapter object\r
+     */\r
+    getAdapter : function(){\r
+        return this.adapter;\r
+    },\r
+\r
+    /**\r
+     * Set the adapter this SplitBar uses\r
+     * @param {Object} adapter A SplitBar adapter object\r
+     */\r
+    setAdapter : function(adapter){\r
+        this.adapter = adapter;\r
+        this.adapter.init(this);\r
+    },\r
+\r
+    /**\r
+     * Gets the minimum size for the resizing element\r
+     * @return {Number} The minimum size\r
+     */\r
+    getMinimumSize : function(){\r
+        return this.minSize;\r
+    },\r
+\r
+    /**\r
+     * Sets the minimum size for the resizing element\r
+     * @param {Number} minSize The minimum size\r
+     */\r
+    setMinimumSize : function(minSize){\r
+        this.minSize = minSize;\r
+    },\r
+\r
+    /**\r
+     * Gets the maximum size for the resizing element\r
+     * @return {Number} The maximum size\r
+     */\r
+    getMaximumSize : function(){\r
+        return this.maxSize;\r
+    },\r
+\r
+    /**\r
+     * Sets the maximum size for the resizing element\r
+     * @param {Number} maxSize The maximum size\r
+     */\r
+    setMaximumSize : function(maxSize){\r
+        this.maxSize = maxSize;\r
+    },\r
+\r
+    /**\r
+     * Sets the initialize size for the resizing element\r
+     * @param {Number} size The initial size\r
+     */\r
+    setCurrentSize : function(size){\r
+        var oldAnimate = this.animate;\r
+        this.animate = false;\r
+        this.adapter.setElementSize(this, size);\r
+        this.animate = oldAnimate;\r
+    },\r
+\r
+    /**\r
+     * Destroy this splitbar.\r
+     * @param {Boolean} removeEl True to remove the element\r
+     */\r
+    destroy : function(removeEl){\r
+        Ext.destroy(this.shim, Ext.get(this.proxy));\r
+        this.dd.unreg();\r
+        if(removeEl){\r
+            this.el.remove();\r
+        }\r
+        this.purgeListeners();\r
+    }\r
+});\r
+\r
+/**\r
+ * @private static Create our own proxy element element. So it will be the same same size on all browsers, we won't use borders. Instead we use a background color.\r
+ */\r
+Ext.SplitBar.createProxy = function(dir){\r
+    var proxy = new Ext.Element(document.createElement("div"));\r
+    document.body.appendChild(proxy.dom);\r
+    proxy.unselectable();\r
+    var cls = 'x-splitbar-proxy';\r
+    proxy.addClass(cls + ' ' + (dir == Ext.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v'));\r
+    return proxy.dom;\r
+};\r
+\r
+/**\r
+ * @class Ext.SplitBar.BasicLayoutAdapter\r
+ * Default Adapter. It assumes the splitter and resizing element are not positioned\r
+ * elements and only gets/sets the width of the element. Generally used for table based layouts.\r
+ */\r
+Ext.SplitBar.BasicLayoutAdapter = function(){\r
+};\r
+\r
+Ext.SplitBar.BasicLayoutAdapter.prototype = {\r
+    // do nothing for now\r
+    init : function(s){\r
+\r
+    },\r
+    /**\r
+     * Called before drag operations to get the current size of the resizing element.\r
+     * @param {Ext.SplitBar} s The SplitBar using this adapter\r
+     */\r
+     getElementSize : function(s){\r
+        if(s.orientation == Ext.SplitBar.HORIZONTAL){\r
+            return s.resizingEl.getWidth();\r
+        }else{\r
+            return s.resizingEl.getHeight();\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Called after drag operations to set the size of the resizing element.\r
+     * @param {Ext.SplitBar} s The SplitBar using this adapter\r
+     * @param {Number} newSize The new size to set\r
+     * @param {Function} onComplete A function to be invoked when resizing is complete\r
+     */\r
+    setElementSize : function(s, newSize, onComplete){\r
+        if(s.orientation == Ext.SplitBar.HORIZONTAL){\r
+            if(!s.animate){\r
+                s.resizingEl.setWidth(newSize);\r
+                if(onComplete){\r
+                    onComplete(s, newSize);\r
+                }\r
+            }else{\r
+                s.resizingEl.setWidth(newSize, true, .1, onComplete, 'easeOut');\r
+            }\r
+        }else{\r
+\r
+            if(!s.animate){\r
+                s.resizingEl.setHeight(newSize);\r
+                if(onComplete){\r
+                    onComplete(s, newSize);\r
+                }\r
+            }else{\r
+                s.resizingEl.setHeight(newSize, true, .1, onComplete, 'easeOut');\r
+            }\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ *@class Ext.SplitBar.AbsoluteLayoutAdapter\r
+ * @extends Ext.SplitBar.BasicLayoutAdapter\r
+ * Adapter that  moves the splitter element to align with the resized sizing element.\r
+ * Used with an absolute positioned SplitBar.\r
+ * @param {Mixed} container The container that wraps around the absolute positioned content. If it's\r
+ * document.body, make sure you assign an id to the body element.\r
+ */\r
+Ext.SplitBar.AbsoluteLayoutAdapter = function(container){\r
+    this.basic = new Ext.SplitBar.BasicLayoutAdapter();\r
+    this.container = Ext.get(container);\r
+};\r
+\r
+Ext.SplitBar.AbsoluteLayoutAdapter.prototype = {\r
+    init : function(s){\r
+        this.basic.init(s);\r
+    },\r
+\r
+    getElementSize : function(s){\r
+        return this.basic.getElementSize(s);\r
+    },\r
+\r
+    setElementSize : function(s, newSize, onComplete){\r
+        this.basic.setElementSize(s, newSize, this.moveSplitter.createDelegate(this, [s]));\r
+    },\r
+\r
+    moveSplitter : function(s){\r
+        var yes = Ext.SplitBar;\r
+        switch(s.placement){\r
+            case yes.LEFT:\r
+                s.el.setX(s.resizingEl.getRight());\r
+                break;\r
+            case yes.RIGHT:\r
+                s.el.setStyle("right", (this.container.getWidth() - s.resizingEl.getLeft()) + "px");\r
+                break;\r
+            case yes.TOP:\r
+                s.el.setY(s.resizingEl.getBottom());\r
+                break;\r
+            case yes.BOTTOM:\r
+                s.el.setY(s.resizingEl.getTop() - s.el.getHeight());\r
+                break;\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Orientation constant - Create a vertical SplitBar\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.VERTICAL = 1;\r
+\r
+/**\r
+ * Orientation constant - Create a horizontal SplitBar\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.HORIZONTAL = 2;\r
+\r
+/**\r
+ * Placement constant - The resizing element is to the left of the splitter element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.LEFT = 1;\r
+\r
+/**\r
+ * Placement constant - The resizing element is to the right of the splitter element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.RIGHT = 2;\r
+\r
+/**\r
+ * Placement constant - The resizing element is positioned above the splitter element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.TOP = 3;\r
+\r
+/**\r
+ * Placement constant - The resizing element is positioned under splitter element\r
+ * @static\r
+ * @type Number\r
+ */\r
+Ext.SplitBar.BOTTOM = 4;\r
+/**
+ * @class Ext.Container
+ * @extends Ext.BoxComponent
+ * <p>Base class for any {@link Ext.BoxComponent} that may contain other Components. Containers handle the
+ * basic behavior of containing items, namely adding, inserting and removing items.</p>
+ *
+ * <p>The most commonly used Container classes are {@link Ext.Panel}, {@link Ext.Window} and {@link Ext.TabPanel}.
+ * If you do not need the capabilities offered by the aforementioned classes you can create a lightweight
+ * Container to be encapsulated by an HTML element to your specifications by using the
+ * <code><b>{@link Ext.Component#autoEl autoEl}</b></code> config option. This is a useful technique when creating
+ * embedded {@link Ext.layout.ColumnLayout column} layouts inside {@link Ext.form.FormPanel FormPanels}
+ * for example.</p>
+ *
+ * <p>The code below illustrates both how to explicitly create a Container, and how to implicitly
+ * create one using the <b><code>'container'</code></b> xtype:<pre><code>
+// explicitly create a Container
+var embeddedColumns = new Ext.Container({
+    autoEl: 'div',  // This is the default
+    layout: 'column',
+    defaults: {
+        // implicitly create Container by specifying xtype
+        xtype: 'container',
+        autoEl: 'div', // This is the default.
+        layout: 'form',
+        columnWidth: 0.5,
+        style: {
+            padding: '10px'
+        }
+    },
+//  The two items below will be Ext.Containers, each encapsulated by a &lt;DIV> element.
+    items: [{
+        items: {
+            xtype: 'datefield',
+            name: 'startDate',
+            fieldLabel: 'Start date'
+        }
+    }, {
+        items: {
+            xtype: 'datefield',
+            name: 'endDate',
+            fieldLabel: 'End date'
+        }
+    }]
+});</code></pre></p>
+ *
+ * <p><u><b>Layout</b></u></p>
+ * <p>Container classes delegate the rendering of child Components to a layout
+ * manager class which must be configured into the Container using the
+ * <code><b>{@link #layout}</b></code> configuration property.</p>
+ * <p>When either specifying child <code>{@link #items}</code> of a Container,
+ * or dynamically {@link #add adding} Components to a Container, remember to
+ * consider how you wish the Container to arrange those child elements, and
+ * whether those child elements need to be sized using one of Ext's built-in
+ * <b><code>{@link #layout}</code></b> schemes. By default, Containers use the
+ * {@link Ext.layout.ContainerLayout ContainerLayout} scheme which only
+ * renders child components, appending them one after the other inside the
+ * Container, and <b>does not apply any sizing</b> at all.</p>
+ * <p>A common mistake is when a developer neglects to specify a
+ * <b><code>{@link #layout}</code></b> (e.g. widgets like GridPanels or
+ * TreePanels are added to Containers for which no <code><b>{@link #layout}</b></code>
+ * has been specified). If a Container is left to use the default
+ * {@link Ext.layout.ContainerLayout ContainerLayout} scheme, none of its
+ * child components will be resized, or changed in any way when the Container
+ * is resized.</p>
+ * <p>Certain layout managers allow dynamic addition of child components.
+ * Those that do include {@link Ext.layout.CardLayout},
+ * {@link Ext.layout.AnchorLayout}, {@link Ext.layout.FormLayout}, and
+ * {@link Ext.layout.TableLayout}. For example:<pre><code>
+//  Create the GridPanel.
+var myNewGrid = new Ext.grid.GridPanel({
+    store: myStore,
+    columns: myColumnModel,
+    title: 'Results', // the title becomes the title of the tab
+});
 
-        /**
-         * 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;
-            },
+myTabPanel.add(myNewGrid); // {@link Ext.TabPanel} implicitly uses {@link Ext.layout.CardLayout CardLayout}
+myTabPanel.{@link Ext.TabPanel#setActiveTab setActiveTab}(myNewGrid);
+ * </code></pre></p>
+ * <p>The example above adds a newly created GridPanel to a TabPanel. Note that
+ * a TabPanel uses {@link Ext.layout.CardLayout} as its layout manager which
+ * means all its child items are sized to {@link Ext.layout.FitLayout fit}
+ * exactly into its client area.
+ * <p><b><u>Overnesting is a common problem</u></b>.
+ * An example of overnesting occurs when a GridPanel is added to a TabPanel
+ * by wrapping the GridPanel <i>inside</i> a wrapping Panel (that has no
+ * <code><b>{@link #layout}</b></code> specified) and then add that wrapping Panel
+ * to the TabPanel. The point to realize is that a GridPanel <b>is</b> a
+ * Component which can be added directly to a Container. If the wrapping Panel
+ * has no <code><b>{@link #layout}</b></code> configuration, then the overnested
+ * GridPanel will not be sized as expected.<p>
+ *
+ * <p><u><b>Adding via remote configuration</b></u></p>
+ *
+ * <p>A server side script can be used to add Components which are generated dynamically on the server.
+ * An example of adding a GridPanel to a TabPanel where the GridPanel is generated by the server
+ * based on certain parameters:
+ * </p><pre><code>
+// execute an Ajax request to invoke server side script:
+Ext.Ajax.request({
+    url: 'gen-invoice-grid.php',
+    // send additional parameters to instruct server script
+    params: {
+        startDate: Ext.getCmp('start-date').getValue(),
+        endDate: Ext.getCmp('end-date').getValue()
+    },
+    // process the response object to add it to the TabPanel:
+    success: function(xhr) {
+        var newComponent = eval(xhr.responseText); // see discussion below
+        myTabPanel.add(newComponent); // add the component to the TabPanel
+        myTabPanel.setActiveTab(newComponent);
+    },
+    failure: function() {
+        Ext.Msg.alert("Grid create failed", "Server communication failure");
+    }
+});
+</code></pre>
+ * <p>The server script needs to return an executable Javascript statement which, when processed
+ * using <code>eval()</code>, will return either a config object with an {@link Ext.Component#xtype xtype},
+ * or an instantiated Component. The server might return this for example:</p><pre><code>
+(function() {
+    function formatDate(value){
+        return value ? value.dateFormat('M d, Y') : '';
+    };
 
-        /**
-         * 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 Ext.lib.Dom.getX instead
-         * @static
-         */
-        getPosX: function(el) {
-            return Ext.lib.Dom.getX(el);
+    var store = new Ext.data.Store({
+        url: 'get-invoice-data.php',
+        baseParams: {
+            startDate: '01/01/2008',
+            endDate: '01/31/2008'
         },
+        reader: new Ext.data.JsonReader({
+            record: 'transaction',
+            idProperty: 'id',
+            totalRecords: 'total'
+        }, [
+           'customer',
+           'invNo',
+           {name: 'date', type: 'date', dateFormat: 'm/d/Y'},
+           {name: 'value', type: 'float'}
+        ])
+    });
 
-        /**
-         * 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 Ext.lib.Dom.getY instead
-         * @static
-         */
-        getPosY: function(el) {
-            return Ext.lib.Dom.getY(el);
-        },
+    var grid = new Ext.grid.GridPanel({
+        title: 'Invoice Report',
+        bbar: new Ext.PagingToolbar(store),
+        store: store,
+        columns: [
+            {header: "Customer", width: 250, dataIndex: 'customer', sortable: true},
+            {header: "Invoice Number", width: 120, dataIndex: 'invNo', sortable: true},
+            {header: "Invoice Date", width: 100, dataIndex: 'date', renderer: formatDate, sortable: true},
+            {header: "Value", width: 120, dataIndex: 'value', renderer: 'usMoney', sortable: true}
+        ],
+    });
+    store.load();
+    return grid;  // return instantiated component
+})();
+</code></pre>
+ * <p>When the above code fragment is passed through the <code>eval</code> function in the success handler
+ * of the Ajax request, the code is executed by the Javascript processor, and the anonymous function
+ * runs, and returns the instantiated grid component.</p>
+ * <p>Note: since the code above is <i>generated</i> by a server script, the <code>baseParams</code> for
+ * the Store, the metadata to allow generation of the Record layout, and the ColumnModel
+ * can all be generated into the code since these are all known on the server.</p>
+ *
+ * @xtype container
+ */
+Ext.Container = Ext.extend(Ext.BoxComponent, {
+    /**
+     * @cfg {Boolean} monitorResize
+     * True to automatically monitor window resize events to handle anything that is sensitive to the current size
+     * of the viewport.  This value is typically managed by the chosen <code>{@link #layout}</code> and should not need
+     * to be set manually.
+     */
+    /**
+     * @cfg {String/Object} layout
+     * <p><b>*Important</b>: In order for child items to be correctly sized and
+     * positioned, typically a layout manager <b>must</b> be specified through
+     * the <code>layout</code> configuration option.</p>
+     * <br><p>The sizing and positioning of child {@link items} is the responsibility of
+     * the Container's layout manager which creates and manages the type of layout
+     * you have in mind.  For example:</p><pre><code>
+new Ext.Window({
+    width:300, height: 300,
+    layout: 'fit', // explicitly set layout manager: override the default (layout:'auto')
+    items: [{
+        title: 'Panel inside a Window'
+    }]
+}).show();
+     * </code></pre>
+     * <p>If the {@link #layout} configuration is not explicitly specified for
+     * a general purpose container (e.g. Container or Panel) the
+     * {@link Ext.layout.ContainerLayout default layout manager} will be used
+     * which does nothing but render child components sequentially into the
+     * Container (no sizing or positioning will be performed in this situation).
+     * Some container classes implicitly specify a default layout
+     * (e.g. FormPanel specifies <code>layout:'form'</code>). Other specific
+     * purpose classes internally specify/manage their internal layout (e.g.
+     * GridPanel, TabPanel, TreePanel, Toolbar, Menu, etc.).</p>
+     * <br><p><b><code>layout</code></b> may be specified as either as an Object or
+     * as a String:</p><div><ul class="mdetail-params">
+     *
+     * <li><u>Specify as an Object</u></li>
+     * <div><ul class="mdetail-params">
+     * <li>Example usage:</li>
+<pre><code>
+layout: {
+    type: 'vbox',
+    padding: '5',
+    align: 'left'
+}
+</code></pre>
+     *
+     * <li><code><b>type</b></code></li>
+     * <br/><p>The layout type to be used for this container.  If not specified,
+     * a default {@link Ext.layout.ContainerLayout} will be created and used.</p>
+     * <br/><p>Valid layout <code>type</code> values are:</p>
+     * <div class="sub-desc"><ul class="mdetail-params">
+     * <li><code><b>{@link Ext.layout.AbsoluteLayout absolute}</b></code></li>
+     * <li><code><b>{@link Ext.layout.AccordionLayout accordion}</b></code></li>
+     * <li><code><b>{@link Ext.layout.AnchorLayout anchor}</b></code></li>
+     * <li><code><b>{@link Ext.layout.ContainerLayout auto}</b></code> &nbsp;&nbsp;&nbsp; <b>Default</b></li>
+     * <li><code><b>{@link Ext.layout.BorderLayout border}</b></code></li>
+     * <li><code><b>{@link Ext.layout.CardLayout card}</b></code></li>
+     * <li><code><b>{@link Ext.layout.ColumnLayout column}</b></code></li>
+     * <li><code><b>{@link Ext.layout.FitLayout fit}</b></code></li>
+     * <li><code><b>{@link Ext.layout.FormLayout form}</b></code></li>
+     * <li><code><b>{@link Ext.layout.HBoxLayout hbox}</b></code></li>
+     * <li><code><b>{@link Ext.layout.MenuLayout menu}</b></code></li>
+     * <li><code><b>{@link Ext.layout.TableLayout table}</b></code></li>
+     * <li><code><b>{@link Ext.layout.ToolbarLayout toolbar}</b></code></li>
+     * <li><code><b>{@link Ext.layout.VBoxLayout vbox}</b></code></li>
+     * </ul></div>
+     *
+     * <li>Layout specific configuration properties</li>
+     * <br/><p>Additional layout specific configuration properties may also be
+     * specified. For complete details regarding the valid config options for
+     * each layout type, see the layout class corresponding to the <code>type</code>
+     * specified.</p>
+     *
+     * </ul></div>
+     *
+     * <li><u>Specify as a String</u></li>
+     * <div><ul class="mdetail-params">
+     * <li>Example usage:</li>
+<pre><code>
+layout: 'vbox',
+layoutConfig: {
+    padding: '5',
+    align: 'left'
+}
+</code></pre>
+     * <li><code><b>layout</b></code></li>
+     * <br/><p>The layout <code>type</code> to be used for this container (see list
+     * of valid layout type values above).</p><br/>
+     * <li><code><b>{@link #layoutConfig}</b></code></li>
+     * <br/><p>Additional layout specific configuration properties. For complete
+     * details regarding the valid config options for each layout type, see the
+     * layout class corresponding to the <code>layout</code> specified.</p>
+     * </ul></div></ul></div>
+     */
+    /**
+     * @cfg {Object} layoutConfig
+     * This is a config object containing properties specific to the chosen
+     * <b><code>{@link #layout}</code></b> if <b><code>{@link #layout}</code></b>
+     * has been specified as a <i>string</i>.</p>
+     */
+    /**
+     * @cfg {Boolean/Number} bufferResize
+     * When set to true (50 milliseconds) or a number of milliseconds, the layout assigned for this container will buffer
+     * the frequency it calculates and does a re-layout of components. This is useful for heavy containers or containers
+     * with a large quantity of sub-components for which frequent layout calls would be expensive. Defaults to <code>50</code>.
+     */
+    // Deprecated - will be removed in 3.2.x
+    bufferResize: 50,
 
-        /**
-         * 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;
+    /**
+     * @cfg {String/Number} activeItem
+     * A string component id or the numeric index of the component that should be initially activated within the
+     * container's layout on render.  For example, activeItem: 'item-1' or activeItem: 0 (index 0 = the first
+     * item in the container's collection).  activeItem only applies to layout styles that can display
+     * items one at a time (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout} and
+     * {@link Ext.layout.FitLayout}).  Related to {@link Ext.layout.ContainerLayout#activeItem}.
+     */
+    /**
+     * @cfg {Object/Array} items
+     * <pre><b>** IMPORTANT</b>: be sure to <b>{@link #layout specify a <code>layout</code>} if needed ! **</b></pre>
+     * <p>A single item, or an array of child Components to be added to this container,
+     * for example:</p>
+     * <pre><code>
+// specifying a single item
+items: {...},
+layout: 'fit',    // specify a layout!
 
-                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);
-                }
-            }
-        },
+// specifying multiple items
+items: [{...}, {...}],
+layout: 'anchor', // specify a layout!
+     * </code></pre>
+     * <p>Each item may be:</p>
+     * <div><ul class="mdetail-params">
+     * <li>any type of object based on {@link Ext.Component}</li>
+     * <li>a fully instanciated object or</li>
+     * <li>an object literal that:</li>
+     * <div><ul class="mdetail-params">
+     * <li>has a specified <code>{@link Ext.Component#xtype xtype}</code></li>
+     * <li>the {@link Ext.Component#xtype} specified is associated with the Component
+     * desired and should be chosen from one of the available xtypes as listed
+     * in {@link Ext.Component}.</li>
+     * <li>If an <code>{@link Ext.Component#xtype xtype}</code> is not explicitly
+     * specified, the {@link #defaultType} for that Container is used.</li>
+     * <li>will be "lazily instanciated", avoiding the overhead of constructing a fully
+     * instanciated Component object</li>
+     * </ul></div></ul></div>
+     * <p><b>Notes</b>:</p>
+     * <div><ul class="mdetail-params">
+     * <li>Ext uses lazy rendering. Child Components will only be rendered
+     * should it become necessary. Items are automatically laid out when they are first
+     * shown (no sizing is done while hidden), or in response to a {@link #doLayout} call.</li>
+     * <li>Do not specify <code>{@link Ext.Panel#contentEl contentEl}</code>/
+     * <code>{@link Ext.Panel#html html}</code> with <code>items</code>.</li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Object|Function} defaults
+     * <p>This option is a means of applying default settings to all added items whether added through the {@link #items}
+     * config or via the {@link #add} or {@link #insert} methods.</p>
+     * <p>If an added item is a config object, and <b>not</b> an instantiated Component, then the default properties are
+     * unconditionally applied. If the added item <b>is</b> an instantiated Component, then the default properties are
+     * applied conditionally so as not to override existing properties in the item.</p>
+     * <p>If the defaults option is specified as a function, then the function will be called using this Container as the
+     * scope (<code>this</code> reference) and passing the added item as the first parameter. Any resulting object
+     * from that call is then applied to the item as default properties.</p>
+     * <p>For example, to automatically apply padding to the body of each of a set of
+     * contained {@link Ext.Panel} items, you could pass: <code>defaults: {bodyStyle:'padding:15px'}</code>.</p>
+     * <p>Usage:</p><pre><code>
+defaults: {               // defaults are applied to items, not the container
+    autoScroll:true
+},
+items: [
+    {
+        xtype: 'panel',   // defaults <b>do not</b> have precedence over
+        id: 'panel1',     // options in config objects, so the defaults
+        autoScroll: false // will not be applied here, panel1 will be autoScroll:false
+    },
+    new Ext.Panel({       // defaults <b>do</b> have precedence over options
+        id: 'panel2',     // options in components, so the defaults
+        autoScroll: false // will be applied here, panel2 will be autoScroll:true.
+    })
+]
+     * </code></pre>
+     */
 
-        /**
-         * 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 {
 
-            }
-            return { top: t, left: l };
-        },
+    /** @cfg {Boolean} autoDestroy
+     * If true the container will automatically destroy any contained component that is removed from it, else
+     * destruction must be handled manually (defaults to true).
+     */
+    autoDestroy : true,
 
-        /**
-         * 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 Ext.lib.Dom.getStyle
-         * @static
-         */
-        getStyle: function(el, styleProp) {
-            return Ext.fly(el).getStyle(styleProp);
-        },
+    /** @cfg {Boolean} forceLayout
+     * If true the container will force a layout initially even if hidden or collapsed. This option
+     * is useful for forcing forms to render in collapsed or hidden containers. (defaults to false).
+     */
+    forceLayout: false,
 
-        /**
-         * Gets the scrollTop
-         * @method getScrollTop
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollTop: function () { return this.getScroll().top; },
+    /** @cfg {Boolean} hideBorders
+     * True to hide the borders of each contained component, false to defer to the component's existing
+     * border settings (defaults to false).
+     */
+    /** @cfg {String} defaultType
+     * <p>The default {@link Ext.Component xtype} of child Components to create in this Container when
+     * a child item is specified as a raw configuration object, rather than as an instantiated Component.</p>
+     * <p>Defaults to <code>'panel'</code>, except {@link Ext.menu.Menu} which defaults to <code>'menuitem'</code>,
+     * and {@link Ext.Toolbar} and {@link Ext.ButtonGroup} which default to <code>'button'</code>.</p>
+     */
+    defaultType : 'panel',
 
-        /**
-         * Gets the scrollLeft
-         * @method getScrollLeft
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollLeft: function () { return this.getScroll().left; },
+    /** @cfg {String} resizeEvent
+     * The event to listen to for resizing in layouts. Defaults to <code>'resize'</code>.
+     */
+    resizeEvent: 'resize',
 
-        /**
-         * 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 = Ext.lib.Dom.getXY(targetEl);
-            Ext.lib.Dom.setXY(moveEl, aCoord);
-        },
+    /**
+     * @cfg {Array} bubbleEvents
+     * <p>An array of events that, when fired, should be bubbled to any parent container.
+     * See {@link Ext.util.Observable#enableBubble}.
+     * Defaults to <code>['add', 'remove']</code>.
+     */
+    bubbleEvents: ['add', 'remove'],
 
-        /**
-         * Numeric array sort function
-         * @method numericSort
-         * @static
-         */
-        numericSort: function(a, b) { return (a - b); },
+    // private
+    initComponent : function(){
+        Ext.Container.superclass.initComponent.call(this);
 
-        /**
-         * Internal counter
-         * @property _timeoutCount
-         * @private
-         * @static
-         */
-        _timeoutCount: 0,
+        this.addEvents(
+            /**
+             * @event afterlayout
+             * Fires when the components in this container are arranged by the associated layout manager.
+             * @param {Ext.Container} this
+             * @param {ContainerLayout} layout The ContainerLayout implementation for this container
+             */
+            'afterlayout',
+            /**
+             * @event beforeadd
+             * Fires before any {@link Ext.Component} is added or inserted into the container.
+             * A handler can return false to cancel the add.
+             * @param {Ext.Container} this
+             * @param {Ext.Component} component The component being added
+             * @param {Number} index The index at which the component will be added to the container's items collection
+             */
+            'beforeadd',
+            /**
+             * @event beforeremove
+             * Fires before any {@link Ext.Component} is removed from the container.  A handler can return
+             * false to cancel the remove.
+             * @param {Ext.Container} this
+             * @param {Ext.Component} component The component being removed
+             */
+            'beforeremove',
+            /**
+             * @event add
+             * @bubbles
+             * Fires after any {@link Ext.Component} is added or inserted into the container.
+             * @param {Ext.Container} this
+             * @param {Ext.Component} component The component that was added
+             * @param {Number} index The index at which the component was added to the container's items collection
+             */
+            'add',
+            /**
+             * @event remove
+             * @bubbles
+             * Fires after any {@link Ext.Component} is removed from the container.
+             * @param {Ext.Container} this
+             * @param {Ext.Component} component The component that was removed
+             */
+            'remove'
+        );
 
-        /**
-         * 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 = Ext.dd.DDM;
-            if ( Ext.lib.Event && document ) {
-                DDM._onLoad();
-            } else {
-                if (DDM._timeoutCount > 2000) {
-                } else {
-                    setTimeout(DDM._addListeners, 10);
-                    if (document && document.body) {
-                        DDM._timeoutCount += 1;
-                    }
-                }
-            }
-        },
+        this.enableBubble(this.bubbleEvents);
 
         /**
-         * 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
+         * The collection of components in this container as a {@link Ext.util.MixedCollection}
+         * @type MixedCollection
+         * @property items
          */
-        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;
-
-                while (p) {
-                    if (this.isHandle(id, p.id)) {
-                        return true;
-                    } else {
-                        p = p.parentNode;
-                    }
-                }
-            }
-
-            return false;
+        var items = this.items;
+        if(items){
+            delete this.items;
+            this.add(items);
         }
+    },
 
-    };
+    // private
+    initItems : function(){
+        if(!this.items){
+            this.items = new Ext.util.MixedCollection(false, this.getComponentId);
+            this.getLayout(); // initialize the layout
+        }
+    },
 
-}();
+    // private
+    setLayout : function(layout){
+        if(this.layout && this.layout != layout){
+            this.layout.setContainer(null);
+        }
+        this.initItems();
+        this.layout = layout;
+        layout.setContainer(this);
+    },
 
-// shorter alias, save a few bytes
-Ext.dd.DDM = Ext.dd.DragDropMgr;
-Ext.dd.DDM._addListeners();
+    afterRender: function(){
+        // Render this Container, this should be done before setLayout is called which
+        // will hook onResize
+        Ext.Container.superclass.afterRender.call(this);
+        if(!this.layout){
+            this.layout = 'auto';
+        }
+        if(Ext.isObject(this.layout) && !this.layout.layout){
+            this.layoutConfig = this.layout;
+            this.layout = this.layoutConfig.type;
+        }
+        if(Ext.isString(this.layout)){
+            this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);
+        }
+        this.setLayout(this.layout);
 
-}
+        // If a CardLayout, the active item set
+        if(this.activeItem !== undefined){
+            var item = this.activeItem;
+            delete this.activeItem;
+            this.layout.setActiveItem(item);
+        }
 
-/**
- * @class Ext.dd.DD
- * A DragDrop implementation where the linked element follows the
- * mouse cursor during a drag.
- * @extends Ext.dd.DragDrop
- * @constructor
- * @param {String} id the id of the linked element
- * @param {String} sGroup the group of related DragDrop items
- * @param {object} config an object containing configurable attributes
- *                Valid properties for DD:
- *                    scroll
- */
-Ext.dd.DD = function(id, sGroup, config) {
-    if (id) {
-        this.init(id, sGroup, config);
-    }
-};
+        // If we have no ownerCt, render and size all children
+        if(!this.ownerCt){
+            this.doLayout(false, true);
+        }
 
-Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, {
+        // This is a manually configured flag set by users in conjunction with renderTo.
+        // Not to be confused with the flag by the same name used in Layouts.
+        if(this.monitorResize === true){
+            Ext.EventManager.onWindowResize(this.doLayout, this, [false]);
+        }
+    },
 
     /**
-     * When set to true, the utility automatically tries to scroll the browser
-     * window when a drag and drop element is dragged near the viewport boundary.
-     * Defaults to true.
-     * @property scroll
-     * @type boolean
+     * <p>Returns the Element to be used to contain the child Components of this Container.</p>
+     * <p>An implementation is provided which returns the Container's {@link #getEl Element}, but
+     * if there is a more complex structure to a Container, this may be overridden to return
+     * the element into which the {@link #layout layout} renders child Components.</p>
+     * @return {Ext.Element} The Element to render child Components into.
      */
-    scroll: true,
+    getLayoutTarget : function(){
+        return this.el;
+    },
 
-    /**
-     * Sets the pointer offset to the distance between the linked element's top
-     * left corner and the location the element was clicked
-     * @method autoOffset
-     * @param {int} iPageX the X coordinate of the click
-     * @param {int} iPageY the Y coordinate of the click
-     */
-    autoOffset: function(iPageX, iPageY) {
-        var x = iPageX - this.startPageX;
-        var y = iPageY - this.startPageY;
-        this.setDelta(x, y);
+    // private - used as the key lookup function for the items collection
+    getComponentId : function(comp){
+        return comp.getItemId();
     },
 
     /**
-     * Sets the pointer offset.  You can call this directly to force the
-     * offset to be in a particular location (e.g., pass in 0,0 to set it
-     * to the center of the object)
-     * @method setDelta
-     * @param {int} iDeltaX the distance from the left
-     * @param {int} iDeltaY the distance from the top
+     * <p>Adds {@link Ext.Component Component}(s) to this Container.</p>
+     * <br><p><b>Description</b></u> :
+     * <div><ul class="mdetail-params">
+     * <li>Fires the {@link #beforeadd} event before adding</li>
+     * <li>The Container's {@link #defaults default config values} will be applied
+     * accordingly (see <code>{@link #defaults}</code> for details).</li>
+     * <li>Fires the {@link #add} event after the component has been added.</li>
+     * </ul></div>
+     * <br><p><b>Notes</b></u> :
+     * <div><ul class="mdetail-params">
+     * <li>If the Container is <i>already rendered</i> when <code>add</code>
+     * is called, you may need to call {@link #doLayout} to refresh the view which causes
+     * any unrendered child Components to be rendered. This is required so that you can
+     * <code>add</code> multiple child components if needed while only refreshing the layout
+     * once. For example:<pre><code>
+var tb = new {@link Ext.Toolbar}();
+tb.render(document.body);  // toolbar is rendered
+tb.add({text:'Button 1'}); // add multiple items ({@link #defaultType} for {@link Ext.Toolbar Toolbar} is 'button')
+tb.add({text:'Button 2'});
+tb.{@link #doLayout}();             // refresh the layout
+     * </code></pre></li>
+     * <li><i>Warning:</i> Containers directly managed by the BorderLayout layout manager
+     * may not be removed or added.  See the Notes for {@link Ext.layout.BorderLayout BorderLayout}
+     * for more details.</li>
+     * </ul></div>
+     * @param {Object/Array} component
+     * <p>Either a single component or an Array of components to add.  See
+     * <code>{@link #items}</code> for additional information.</p>
+     * @param {Object} (Optional) component_2
+     * @param {Object} (Optional) component_n
+     * @return {Ext.Component} component The Component (or config object) that was added.
      */
-    setDelta: function(iDeltaX, iDeltaY) {
-        this.deltaX = iDeltaX;
-        this.deltaY = iDeltaY;
+    add : function(comp){
+        this.initItems();
+        var args = arguments.length > 1;
+        if(args || Ext.isArray(comp)){
+            var result = [];
+            Ext.each(args ? arguments : comp, function(c){
+                result.push(this.add(c));
+            }, this);
+            return result;
+        }
+        var c = this.lookupComponent(this.applyDefaults(comp));
+        var index = this.items.length;
+        if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){
+            this.items.add(c);
+            // *onAdded
+            c.onAdded(this, index);
+            this.onAdd(c);
+            this.fireEvent('add', this, c, index);
+        }
+        return c;
     },
 
-    /**
-     * Sets the drag element to the location of the mousedown or click event,
-     * maintaining the cursor location relative to the location on the element
-     * that was clicked.  Override this if you want to place the element in a
-     * location other than where the cursor is.
-     * @method setDragElPos
-     * @param {int} iPageX the X coordinate of the mousedown or drag event
-     * @param {int} iPageY the Y coordinate of the mousedown or drag event
-     */
-    setDragElPos: function(iPageX, iPageY) {
-        // the first time we do this, we are going to check to make sure
-        // the element has css positioning
+    onAdd : function(c){
+        // Empty template method
+    },
 
-        var el = this.getDragEl();
-        this.alignElWithMouse(el, iPageX, iPageY);
+    // private
+    onAdded : function(container, pos) {
+        //overridden here so we can cascade down, not worth creating a template method.
+        this.ownerCt = container;
+        this.initRef();
+        //initialize references for child items
+        this.cascade(function(c){
+            c.initRef();
+        });
+        this.fireEvent('added', this, container, pos);
     },
 
     /**
-     * Sets the element to the location of the mousedown or click event,
-     * maintaining the cursor location relative to the location on the element
-     * that was clicked.  Override this if you want to place the element in a
-     * location other than where the cursor is.
-     * @method alignElWithMouse
-     * @param {HTMLElement} el the element to move
-     * @param {int} iPageX the X coordinate of the mousedown or drag event
-     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     * Inserts a Component into this Container at a specified index. Fires the
+     * {@link #beforeadd} event before inserting, then fires the {@link #add} event after the
+     * Component has been inserted.
+     * @param {Number} index The index at which the Component will be inserted
+     * into the Container's items collection
+     * @param {Ext.Component} component The child Component to insert.<br><br>
+     * Ext uses lazy rendering, and will only render the inserted Component should
+     * it become necessary.<br><br>
+     * A Component config object may be passed in order to avoid the overhead of
+     * constructing a real Component object if lazy rendering might mean that the
+     * inserted Component will not be rendered immediately. To take advantage of
+     * this 'lazy instantiation', set the {@link Ext.Component#xtype} config
+     * property to the registered type of the Component wanted.<br><br>
+     * For a list of all available xtypes, see {@link Ext.Component}.
+     * @return {Ext.Component} component The Component (or config object) that was
+     * inserted with the Container's default config values applied.
      */
-    alignElWithMouse: function(el, iPageX, iPageY) {
-        var oCoord = this.getTargetCoord(iPageX, iPageY);
-        var fly = el.dom ? el : Ext.fly(el, '_dd');
-        if (!this.deltaSetXY) {
-            var aCoord = [oCoord.x, oCoord.y];
-            fly.setXY(aCoord);
-            var newLeft = fly.getLeft(true);
-            var newTop  = fly.getTop(true);
-            this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
-        } else {
-            fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]);
+    insert : function(index, comp){
+        this.initItems();
+        var a = arguments, len = a.length;
+        if(len > 2){
+            var result = [];
+            for(var i = len-1; i >= 1; --i) {
+                result.push(this.insert(index, a[i]));
+            }
+            return result;
+        }
+        var c = this.lookupComponent(this.applyDefaults(comp));
+        index = Math.min(index, this.items.length);
+        if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){
+            if(c.ownerCt == this){
+                this.items.remove(c);
+            }
+            this.items.insert(index, c);
+            c.onAdded(this, index);
+            this.onAdd(c);
+            this.fireEvent('add', this, c, index);
         }
+        return c;
+    },
 
-        this.cachePosition(oCoord.x, oCoord.y);
-        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-        return oCoord;
+    // private
+    applyDefaults : function(c){
+        var d = this.defaults;
+        if(d){
+            if(Ext.isFunction(d)){
+                d = d.call(this, c);
+            }
+            if(Ext.isString(c)){
+                c = Ext.ComponentMgr.get(c);
+                Ext.apply(c, d);
+            }else if(!c.events){
+                Ext.applyIf(c, d);
+            }else{
+                Ext.apply(c, d);
+            }
+        }
+        return c;
     },
 
-    /**
-     * Saves the most recent position so that we can reset the constraints and
-     * tick marks on-demand.  We need to know this so that we can calculate the
-     * number of pixels the element is offset from its original position.
-     * @method cachePosition
-     * @param iPageX the current x position (optional, this just makes it so we
-     * don't have to look it up again)
-     * @param iPageY the current y position (optional, this just makes it so we
-     * don't have to look it up again)
-     */
-    cachePosition: function(iPageX, iPageY) {
-        if (iPageX) {
-            this.lastPageX = iPageX;
-            this.lastPageY = iPageY;
-        } else {
-            var aCoord = Ext.lib.Dom.getXY(this.getEl());
-            this.lastPageX = aCoord[0];
-            this.lastPageY = aCoord[1];
+    // private
+    onBeforeAdd : function(item){
+        if(item.ownerCt){
+            item.ownerCt.remove(item, false);
+        }
+        if(this.hideBorders === true){
+            item.border = (item.border === true);
         }
     },
 
     /**
-     * Auto-scroll the window if the dragged object has been moved beyond the
-     * visible window boundary.
-     * @method autoScroll
-     * @param {int} x the drag element's x position
-     * @param {int} y the drag element's y position
-     * @param {int} h the height of the drag element
-     * @param {int} w the width of the drag element
-     * @private
+     * Removes a component from this container.  Fires the {@link #beforeremove} event before removing, then fires
+     * the {@link #remove} event after the component has been removed.
+     * @param {Component/String} component The component reference or id to remove.
+     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
+     * Defaults to the value of this Container's {@link #autoDestroy} config.
+     * @return {Ext.Component} component The Component that was removed.
      */
-    autoScroll: function(x, y, h, w) {
+    remove : function(comp, autoDestroy){
+        this.initItems();
+        var c = this.getComponent(comp);
+        if(c && this.fireEvent('beforeremove', this, c) !== false){
+            this.doRemove(c, autoDestroy);
+            this.fireEvent('remove', this, c);
+        }
+        return c;
+    },
 
-        if (this.scroll) {
-            // The client height
-            var clientH = Ext.lib.Dom.getViewHeight();
+    onRemove: function(c){
+        // Empty template method
+    },
 
-            // The client width
-            var clientW = Ext.lib.Dom.getViewWidth();
+    // private
+    doRemove: function(c, autoDestroy){
+        var l = this.layout,
+            hasLayout = l && this.rendered;
 
-            // The amt scrolled down
-            var st = this.DDM.getScrollTop();
+        if(hasLayout){
+            l.onRemove(c);
+        }
+        this.items.remove(c);
+        c.onRemoved();
+        this.onRemove(c);
+        if(autoDestroy === true || (autoDestroy !== false && this.autoDestroy)){
+            c.destroy();
+        }
+        if(hasLayout){
+            l.afterRemove(c);
+        }
+    },
 
-            // The amt scrolled right
-            var sl = this.DDM.getScrollLeft();
+    /**
+     * Removes all components from this container.
+     * @param {Boolean} autoDestroy (optional) True to automatically invoke the removed Component's {@link Ext.Component#destroy} function.
+     * Defaults to the value of this Container's {@link #autoDestroy} config.
+     * @return {Array} Array of the destroyed components
+     */
+    removeAll: function(autoDestroy){
+        this.initItems();
+        var item, rem = [], items = [];
+        this.items.each(function(i){
+            rem.push(i);
+        });
+        for (var i = 0, len = rem.length; i < len; ++i){
+            item = rem[i];
+            this.remove(item, autoDestroy);
+            if(item.ownerCt !== this){
+                items.push(item);
+            }
+        }
+        return items;
+    },
 
-            // Location of the bottom of the element
-            var bot = h + y;
+    /**
+     * Examines this container's <code>{@link #items}</code> <b>property</b>
+     * and gets a direct child component of this container.
+     * @param {String/Number} comp This parameter may be any of the following:
+     * <div><ul class="mdetail-params">
+     * <li>a <b><code>String</code></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
+     * or <code>{@link Ext.Component#id id}</code> of the child component </li>
+     * <li>a <b><code>Number</code></b> : representing the position of the child component
+     * within the <code>{@link #items}</code> <b>property</b></li>
+     * </ul></div>
+     * <p>For additional information see {@link Ext.util.MixedCollection#get}.
+     * @return Ext.Component The component (if found).
+     */
+    getComponent : function(comp){
+        if(Ext.isObject(comp)){
+            comp = comp.getItemId();
+        }
+        return this.items.get(comp);
+    },
 
-            // Location of the right of the element
-            var right = w + x;
+    // private
+    lookupComponent : function(comp){
+        if(Ext.isString(comp)){
+            return Ext.ComponentMgr.get(comp);
+        }else if(!comp.events){
+            return this.createComponent(comp);
+        }
+        return comp;
+    },
 
-            // The distance from the cursor to the bottom of the visible area,
-            // adjusted so that we don't scroll if the cursor is beyond the
-            // element drag constraints
-            var toBot = (clientH + st - y - this.deltaY);
+    // private
+    createComponent : function(config, defaultType){
+        // add in ownerCt at creation time but then immediately
+        // remove so that onBeforeAdd can handle it
+        var c = config.render ? config : Ext.create(Ext.apply({
+            ownerCt: this
+        }, config), defaultType || this.defaultType);
+        delete c.ownerCt;
+        return c;
+    },
 
-            // The distance from the cursor to the right of the visible area
-            var toRight = (clientW + sl - x - this.deltaX);
+    /**
+    * We can only lay out if there is a view area in which to layout.
+    * display:none on the layout target, *or any of its parent elements* will mean it has no view area.
+    */
 
+    // private
+    canLayout : function() {
+        var el = this.getVisibilityEl();
+        return el && el.dom && !el.isStyle("display", "none");
+    },
 
-            // How close to the edge the cursor must be before we scroll
-            // var thresh = (document.all) ? 100 : 40;
-            var thresh = 40;
+    /**
+     * Force this container's layout to be recalculated. A call to this function is required after adding a new component
+     * to an already rendered container, or possibly after changing sizing/position properties of child components.
+     * @param {Boolean} shallow (optional) True to only calc the layout of this component, and let child components auto
+     * calc layouts as required (defaults to false, which calls doLayout recursively for each subcontainer)
+     * @param {Boolean} force (optional) True to force a layout to occur, even if the item is hidden.
+     * @return {Ext.Container} this
+     */
 
-            // How many pixels to scroll per autoscroll op.  This helps to reduce
-            // clunky scrolling. IE is more sensitive about this ... it needs this
-            // value to be higher.
-            var scrAmt = (document.all) ? 80 : 30;
+    doLayout : function(shallow, force){
+        var rendered = this.rendered,
+            forceLayout = force || this.forceLayout;
 
-            // Scroll down if we are near the bottom of the visible page and the
-            // obj extends below the crease
-            if ( bot > clientH && toBot < thresh ) {
-                window.scrollTo(sl, st + scrAmt);
+        if(this.collapsed || !this.canLayout()){
+            this.deferLayout = this.deferLayout || !shallow;
+            if(!forceLayout){
+                return;
             }
-
-            // Scroll up if the window is scrolled down and the top of the object
-            // goes above the top border
-            if ( y < st && st > 0 && y - st < thresh ) {
-                window.scrollTo(sl, st - scrAmt);
+            shallow = shallow && !this.deferLayout;
+        } else {
+            delete this.deferLayout;
+        }
+        if(rendered && this.layout){
+            this.layout.layout();
+        }
+        if(shallow !== true && this.items){
+            var cs = this.items.items;
+            for(var i = 0, len = cs.length; i < len; i++){
+                var c = cs[i];
+                if(c.doLayout){
+                    c.doLayout(false, forceLayout);
+                }
             }
+        }
+        if(rendered){
+            this.onLayout(shallow, forceLayout);
+        }
+        // Initial layout completed
+        this.hasLayout = true;
+        delete this.forceLayout;
+    },
 
-            // Scroll right if the obj is beyond the right border and the cursor is
-            // near the border.
-            if ( right > clientW && toRight < thresh ) {
-                window.scrollTo(sl + scrAmt, st);
-            }
+    onLayout : Ext.emptyFn,
 
-            // Scroll left if the window has been scrolled to the right and the obj
-            // extends past the left border
-            if ( x < sl && sl > 0 && x - sl < thresh ) {
-                window.scrollTo(sl - scrAmt, st);
+    // private
+    shouldBufferLayout: function(){
+        /*
+         * Returns true if the container should buffer a layout.
+         * This is true only if the container has previously been laid out
+         * and has a parent container that is pending a layout.
+         */
+        var hl = this.hasLayout;
+        if(this.ownerCt){
+            // Only ever buffer if we've laid out the first time and we have one pending.
+            return hl ? !this.hasLayoutPending() : false;
+        }
+        // Never buffer initial layout
+        return hl;
+    },
+
+    // private
+    hasLayoutPending: function(){
+        // Traverse hierarchy to see if any parent container has a pending layout.
+        var pending = false;
+        this.ownerCt.bubble(function(c){
+            if(c.layoutPending){
+                pending = true;
+                return false;
             }
+        });
+        return pending;
+    },
+
+    onShow : function(){
+        // removes css classes that were added to hide
+        Ext.Container.superclass.onShow.call(this);
+        // If we were sized during the time we were hidden, layout.
+        if(Ext.isDefined(this.deferLayout)){
+            delete this.deferLayout;
+            this.doLayout(true);
         }
     },
 
     /**
-     * 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
+     * Returns the layout currently in use by the container.  If the container does not currently have a layout
+     * set, a default {@link Ext.layout.ContainerLayout} will be created and set as the container's layout.
+     * @return {ContainerLayout} layout The container's layout
      */
-    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; }
+    getLayout : function(){
+        if(!this.layout){
+            var layout = new Ext.layout.ContainerLayout(this.layoutConfig);
+            this.setLayout(layout);
         }
+        return this.layout;
+    },
 
-        if (this.constrainY) {
-            if (y < this.minY) { y = this.minY; }
-            if (y > this.maxY) { y = this.maxY; }
+    // private
+    beforeDestroy : function(){
+        var c;
+        if(this.items){
+            while(c = this.items.first()){
+                this.doRemove(c, true);
+            }
         }
-
-        x = this.getTick(x, this.xTicks);
-        y = this.getTick(y, this.yTicks);
-
-
-        return {x:x, y:y};
+        if(this.monitorResize){
+            Ext.EventManager.removeResizeListener(this.doLayout, this);
+        }
+        Ext.destroy(this.layout);
+        Ext.Container.superclass.beforeDestroy.call(this);
     },
 
     /**
-     * Sets up config options specific to this class. Overrides
-     * Ext.dd.DragDrop, but all versions of this method through the
-     * inheritance chain are called
+     * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<i>this</i>) of
+     * function call will be the scope provided or the current component. The arguments to the function
+     * will be the args provided or the current component. If the function returns false at any point,
+     * the bubble is stopped.
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function (defaults to current node)
+     * @param {Array} args (optional) The args to call the function with (default to passing the current component)
+     * @return {Ext.Container} this
      */
-    applyConfig: function() {
-        Ext.dd.DD.superclass.applyConfig.call(this);
-        this.scroll = (this.config.scroll !== false);
+    bubble : function(fn, scope, args){
+        var p = this;
+        while(p){
+            if(fn.apply(scope || p, args || [p]) === false){
+                break;
+            }
+            p = p.ownerCt;
+        }
+        return this;
     },
 
     /**
-     * Event that fires prior to the onMouseDown event.  Overrides
-     * Ext.dd.DragDrop.
+     * Cascades down the component/container heirarchy from this component (called first), calling the specified function with
+     * each component. The scope (<i>this</i>) of
+     * function call will be the scope provided or the current component. The arguments to the function
+     * will be the args provided or the current component. If the function returns false at any point,
+     * the cascade is stopped on that branch.
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function (defaults to current component)
+     * @param {Array} args (optional) The args to call the function with (defaults to passing the current component)
+     * @return {Ext.Container} this
      */
-    b4MouseDown: function(e) {
-        // this.resetConstraints();
-        this.autoOffset(e.getPageX(),
-                            e.getPageY());
+    cascade : function(fn, scope, args){
+        if(fn.apply(scope || this, args || [this]) !== false){
+            if(this.items){
+                var cs = this.items.items;
+                for(var i = 0, len = cs.length; i < len; i++){
+                    if(cs[i].cascade){
+                        cs[i].cascade(fn, scope, args);
+                    }else{
+                        fn.apply(scope || cs[i], args || [cs[i]]);
+                    }
+                }
+            }
+        }
+        return this;
     },
 
     /**
-     * Event that fires prior to the onDrag event.  Overrides
-     * Ext.dd.DragDrop.
+     * Find a component under this container at any level by id
+     * @param {String} id
+     * @return Ext.Component
      */
-    b4Drag: function(e) {
-        this.setDragElPos(e.getPageX(),
-                            e.getPageY());
-    },
-
-    toString: function() {
-        return ("DD " + this.id);
-    }
-
-    //////////////////////////////////////////////////////////////////////////
-    // Debugging ygDragDrop events that can be overridden
-    //////////////////////////////////////////////////////////////////////////
-    /*
-    startDrag: function(x, y) {
-    },
-
-    onDrag: function(e) {
-    },
-
-    onDragEnter: function(e, id) {
+    findById : function(id){
+        var m, ct = this;
+        this.cascade(function(c){
+            if(ct != c && c.id === id){
+                m = c;
+                return false;
+            }
+        });
+        return m || null;
     },
 
-    onDragOver: function(e, id) {
+    /**
+     * Find a component under this container at any level by xtype or class
+     * @param {String/Class} xtype The xtype string for a component, or the class of the component directly
+     * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
+     * the default), or true to check whether this Component is directly of the specified xtype.
+     * @return {Array} Array of Ext.Components
+     */
+    findByType : function(xtype, shallow){
+        return this.findBy(function(c){
+            return c.isXType(xtype, shallow);
+        });
     },
 
-    onDragOut: function(e, id) {
+    /**
+     * Find a component under this container at any level by property
+     * @param {String} prop
+     * @param {String} value
+     * @return {Array} Array of Ext.Components
+     */
+    find : function(prop, value){
+        return this.findBy(function(c){
+            return c[prop] === value;
+        });
     },
 
-    onDragDrop: function(e, id) {
+    /**
+     * Find a component under this container at any level by a custom function. If the passed function returns
+     * true, the component will be included in the results. The passed function is called with the arguments (component, this container).
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional)
+     * @return {Array} Array of Ext.Components
+     */
+    findBy : function(fn, scope){
+        var m = [], ct = this;
+        this.cascade(function(c){
+            if(ct != c && fn.call(scope || c, c, ct) === true){
+                m.push(c);
+            }
+        });
+        return m;
     },
 
-    endDrag: function(e) {
+    /**
+     * Get a component contained by this container (alias for items.get(key))
+     * @param {String/Number} key The index or id of the component
+     * @return {Ext.Component} Ext.Component
+     */
+    get : function(key){
+        return this.items.get(key);
     }
-
-    */
-
 });
-/**
- * @class Ext.dd.DDProxy
- * A DragDrop implementation that inserts an empty, bordered div into
- * the document that follows the cursor during drag operations.  At the time of
- * the click, the frame div is resized to the dimensions of the linked html
- * element, and moved to the exact location of the linked element.
- *
- * References to the "frame" element refer to the single proxy element that
- * was created to be dragged in place of all DDProxy elements on the
- * page.
- *
- * @extends Ext.dd.DD
- * @constructor
- * @param {String} id the id of the linked html element
- * @param {String} sGroup the group of related DragDrop objects
- * @param {object} config an object containing configurable attributes
- *                Valid properties for DDProxy in addition to those in DragDrop:
- *                   resizeFrame, centerFrame, dragElId
- */
-Ext.dd.DDProxy = function(id, sGroup, config) {
-    if (id) {
-        this.init(id, sGroup, config);
-        this.initFrame();
-    }
-};
 
+Ext.Container.LAYOUTS = {};
+Ext.reg('container', Ext.Container);
 /**
- * The default drag frame div id
- * @property Ext.dd.DDProxy.dragElId
- * @type String
- * @static
+ * @class Ext.layout.ContainerLayout
+ * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
+ * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
  */
-Ext.dd.DDProxy.dragElId = "ygddfdiv";
-
-Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
-
+Ext.layout.ContainerLayout = Ext.extend(Object, {
     /**
-     * By default we resize the drag frame to be the same size as the element
-     * we want to drag (this is to get the frame effect).  We can turn it off
-     * if we want a different behavior.
-     * @property resizeFrame
-     * @type boolean
+     * @cfg {String} extraCls
+     * <p>An optional extra CSS class that will be added to the container. This can be useful for adding
+     * customized styles to the container or any of its children using standard CSS rules. See
+     * {@link Ext.Component}.{@link Ext.Component#ctCls ctCls} also.</p>
+     * <p><b>Note</b>: <tt>extraCls</tt> defaults to <tt>''</tt> except for the following classes
+     * which assign a value by default:
+     * <div class="mdetail-params"><ul>
+     * <li>{@link Ext.layout.AbsoluteLayout Absolute Layout} : <tt>'x-abs-layout-item'</tt></li>
+     * <li>{@link Ext.layout.Box Box Layout} : <tt>'x-box-item'</tt></li>
+     * <li>{@link Ext.layout.ColumnLayout Column Layout} : <tt>'x-column'</tt></li>
+     * </ul></div>
+     * To configure the above Classes with an extra CSS class append to the default.  For example,
+     * for ColumnLayout:<pre><code>
+     * extraCls: 'x-column custom-class'
+     * </code></pre>
+     * </p>
      */
-    resizeFrame: true,
-
     /**
-     * By default the frame is positioned exactly where the drag element is, so
-     * we use the cursor offset provided by Ext.dd.DD.  Another option that works only if
-     * you do not have constraints on the obj is to have the drag frame centered
-     * around the cursor.  Set centerFrame to true for this effect.
-     * @property centerFrame
-     * @type boolean
+     * @cfg {Boolean} renderHidden
+     * True to hide each contained item on render (defaults to false).
      */
-    centerFrame: false,
 
     /**
-     * Creates the proxy element if it does not yet exist
-     * @method createFrame
+     * A reference to the {@link Ext.Component} that is active.  For example, <pre><code>
+     * if(myPanel.layout.activeItem.id == 'item-1') { ... }
+     * </code></pre>
+     * <tt>activeItem</tt> only applies to layout styles that can display items one at a time
+     * (like {@link Ext.layout.AccordionLayout}, {@link Ext.layout.CardLayout}
+     * and {@link Ext.layout.FitLayout}).  Read-only.  Related to {@link Ext.Container#activeItem}.
+     * @type {Ext.Component}
+     * @property activeItem
      */
-    createFrame: function() {
-        var self = this;
-        var body = document.body;
-
-        if (!body || !body.firstChild) {
-            setTimeout( function() { self.createFrame(); }, 50 );
-            return;
-        }
 
-        var div = this.getDragEl();
+    // private
+    monitorResize:false,
+    // private
+    activeItem : null,
 
-        if (!div) {
-            div    = document.createElement("div");
-            div.id = this.dragElId;
-            var s  = div.style;
+    constructor : function(config){
+        this.id = Ext.id(null, 'ext-layout-');
+        Ext.apply(this, config);
+    },
 
-            s.position   = "absolute";
-            s.visibility = "hidden";
-            s.cursor     = "move";
-            s.border     = "2px solid #aaa";
-            s.zIndex     = 999;
+    type: 'container',
 
-            // appendChild can blow up IE if invoked prior to the window load event
-            // while rendering a table.  It is possible there are other scenarios
-            // that would cause this to happen as well.
-            body.insertBefore(div, body.firstChild);
+    /* Workaround for how IE measures autoWidth elements.  It prefers bottom-up measurements
+      whereas other browser prefer top-down.  We will hide all target child elements before we measure and
+      put them back to get an accurate measurement.
+    */
+    IEMeasureHack : function(target, viewFlag) {
+        var tChildren = target.dom.childNodes, tLen = tChildren.length, c, d = [], e, i, ret;
+        for (i = 0 ; i < tLen ; i++) {
+            c = tChildren[i];
+            e = Ext.get(c);
+            if (e) {
+                d[i] = e.getStyle('display');
+                e.setStyle({display: 'none'});
+            }
         }
+        ret = target ? target.getViewSize(viewFlag) : {};
+        for (i = 0 ; i < tLen ; i++) {
+            c = tChildren[i];
+            e = Ext.get(c);
+            if (e) {
+                e.setStyle({display: d[i]});
+            }
+        }
+        return ret;
     },
 
-    /**
-     * Initialization for the drag frame element.  Must be called in the
-     * constructor of all subclasses
-     * @method initFrame
-     */
-    initFrame: function() {
-        this.createFrame();
-    },
-
-    applyConfig: function() {
-        Ext.dd.DDProxy.superclass.applyConfig.call(this);
+    // Placeholder for the derived layouts
+    getLayoutTargetSize : Ext.EmptyFn,
 
-        this.resizeFrame = (this.config.resizeFrame !== false);
-        this.centerFrame = (this.config.centerFrame);
-        this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
+    // private
+    layout : function(){
+        var ct = this.container, target = ct.getLayoutTarget();
+        if(!(this.hasLayout || Ext.isEmpty(this.targetCls))){
+            target.addClass(this.targetCls);
+        }
+        this.onLayout(ct, target);
+        ct.fireEvent('afterlayout', ct, this);
     },
 
-    /**
-     * Resizes the drag frame to the dimensions of the clicked object, positions
-     * it over the object, and finally displays it
-     * @method showFrame
-     * @param {int} iPageX X click position
-     * @param {int} iPageY Y click position
-     * @private
-     */
-    showFrame: function(iPageX, iPageY) {
-        var el = this.getEl();
-        var dragEl = this.getDragEl();
-        var s = dragEl.style;
+    // private
+    onLayout : function(ct, target){
+        this.renderAll(ct, target);
+    },
 
-        this._resizeProxy();
+    // private
+    isValidParent : function(c, target){
+        return target && c.getPositionEl().dom.parentNode == (target.dom || target);
+    },
 
-        if (this.centerFrame) {
-            this.setDelta( Math.round(parseInt(s.width,  10)/2),
-                           Math.round(parseInt(s.height, 10)/2) );
+    // private
+    renderAll : function(ct, target){
+        var items = ct.items.items, i, c, len = items.length;
+        for(i = 0; i < len; i++) {
+            c = items[i];
+            if(c && (!c.rendered || !this.isValidParent(c, target))){
+                this.renderItem(c, i, target);
+            }
         }
+    },
 
-        this.setDragElPos(iPageX, iPageY);
+    // private
+    renderItem : function(c, position, target){
+        if(c){
+            if(!c.rendered){
+                c.render(target, position);
+                this.configureItem(c, position);
+            }else if(!this.isValidParent(c, target)){
+                if(Ext.isNumber(position)){
+                    position = target.dom.childNodes[position];
+                }
+                target.dom.insertBefore(c.getPositionEl().dom, position || null);
+                c.container = target;
+                this.configureItem(c, position);
+            }
+        }
+    },
 
-        Ext.fly(dragEl).show();
+    // private.
+    // Get all rendered items to lay out.
+    getRenderedItems: function(ct){
+        var t = ct.getLayoutTarget(), cti = ct.items.items, len = cti.length, i, c, items = [];
+        for (i = 0; i < len; i++) {
+            if((c = cti[i]).rendered && this.isValidParent(c, t)){
+                items.push(c);
+            }
+        };
+        return items;
     },
 
-    /**
-     * The proxy is automatically resized to the dimensions of the linked
-     * element when a drag is initiated, unless resizeFrame is set to false
-     * @method _resizeProxy
-     * @private
-     */
-    _resizeProxy: function() {
-        if (this.resizeFrame) {
-            var el = this.getEl();
-            Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
+    // private
+    configureItem: function(c, position){
+        if(this.extraCls){
+            var t = c.getPositionEl ? c.getPositionEl() : c;
+            t.addClass(this.extraCls);
+        }
+        // If we are forcing a layout, do so *before* we hide so elements have height/width
+        if(c.doLayout && this.forceLayout){
+            c.doLayout();
+        }
+        if (this.renderHidden && c != this.activeItem) {
+            c.hide();
         }
     },
 
-    // overrides Ext.dd.DragDrop
-    b4MouseDown: function(e) {
-        var x = e.getPageX();
-        var y = e.getPageY();
-        this.autoOffset(x, y);
-        this.setDragElPos(x, y);
+    onRemove: function(c){
+         if(this.activeItem == c){
+            delete this.activeItem;
+         }
+         if(c.rendered && this.extraCls){
+            var t = c.getPositionEl ? c.getPositionEl() : c;
+            t.removeClass(this.extraCls);
+        }
     },
 
-    // overrides Ext.dd.DragDrop
-    b4StartDrag: function(x, y) {
-        // show the drag frame
-        this.showFrame(x, y);
+    afterRemove: function(c){
+        if(c.removeRestore){
+            c.removeMode = 'container';
+            delete c.removeRestore;
+        }
     },
 
-    // overrides Ext.dd.DragDrop
-    b4EndDrag: function(e) {
-        Ext.fly(this.getDragEl()).hide();
+    // private
+    onResize: function(){
+        var ct = this.container,
+            b;
+        if(ct.collapsed){
+            return;
+        }
+        if(b = ct.bufferResize){
+            // Only allow if we should buffer the layout
+            if(ct.shouldBufferLayout()){
+                if(!this.resizeTask){
+                    this.resizeTask = new Ext.util.DelayedTask(this.runLayout, this);
+                    this.resizeBuffer = Ext.isNumber(b) ? b : 50;
+                }
+                ct.layoutPending = true;
+                this.resizeTask.delay(this.resizeBuffer);
+            }
+        }else{
+            this.runLayout();
+        }
     },
 
-    // overrides Ext.dd.DragDrop
-    // By default we try to move the element to the last location of the frame.
-    // This is so that the default behavior mirrors that of Ext.dd.DD.
-    endDrag: function(e) {
-
-        var lel = this.getEl();
-        var del = this.getDragEl();
+    runLayout: function(){
+        var ct = this.container;
+        // AutoLayout is known to require the recursive doLayout call, others need this currently (BorderLayout for example)
+        // but shouldn't.  A more extensive review will take place for 3.2 which requires a ContainerMgr with hierarchy lookups.
+        //this.layout();
+        //ct.onLayout();
+        ct.doLayout();
+        delete ct.layoutPending;
+    },
 
-        // Show the drag frame briefly so we can get its position
-        del.style.visibility = "";
+    // private
+    setContainer : function(ct){
+        if (!Ext.LayoutManager) {
+            Ext.LayoutManager = {};
+        }
 
-        this.beforeMove();
-        // Hide the linked element before the move to get around a Safari
-        // rendering bug.
-        lel.style.visibility = "hidden";
-        Ext.dd.DDM.moveToEl(lel, del);
-        del.style.visibility = "hidden";
-        lel.style.visibility = "";
+        /* This monitorResize flag will be renamed soon as to avoid confusion
+        * with the Container version which hooks onWindowResize to doLayout
+        *
+        * monitorResize flag in this context attaches the resize event between
+        * a container and it's layout
+        */
 
-        this.afterDrag();
+        if(this.monitorResize && ct != this.container){
+            var old = this.container;
+            if(old){
+                old.un(old.resizeEvent, this.onResize, this);
+            }
+            if(ct){
+                ct.on(ct.resizeEvent, this.onResize, this);
+            }
+        }
+        this.container = ct;
     },
 
-    beforeMove : function(){
-
+    // private
+    parseMargins : function(v){
+        if(Ext.isNumber(v)){
+            v = v.toString();
+        }
+        var ms = v.split(' ');
+        var len = ms.length;
+        if(len == 1){
+            ms[1] = ms[2] = ms[3] = ms[0];
+        } else if(len == 2){
+            ms[2] = ms[0];
+            ms[3] = ms[1];
+        } else if(len == 3){
+            ms[3] = ms[1];
+        }
+        return {
+            top:parseInt(ms[0], 10) || 0,
+            right:parseInt(ms[1], 10) || 0,
+            bottom:parseInt(ms[2], 10) || 0,
+            left:parseInt(ms[3], 10) || 0
+        };
     },
 
-    afterDrag : function(){
-
-    },
+    /**
+     * The {@link Ext.Template Ext.Template} used by Field rendering layout classes (such as
+     * {@link Ext.layout.FormLayout}) to create the DOM structure of a fully wrapped,
+     * labeled and styled form Field. A default Template is supplied, but this may be
+     * overriden to create custom field structures. The template processes values returned from
+     * {@link Ext.layout.FormLayout#getTemplateArgs}.
+     * @property fieldTpl
+     * @type Ext.Template
+     */
+    fieldTpl: (function() {
+        var t = new Ext.Template(
+            '<div class="x-form-item {itemCls}" tabIndex="-1">',
+                '<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>',
+                '<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">',
+                '</div><div class="{clearCls}"></div>',
+            '</div>'
+        );
+        t.disableFormats = true;
+        return t.compile();
+    })(),
 
-    toString: function() {
-        return ("DDProxy " + this.id);
+    /*
+     * Destroys this layout. This is a template method that is empty by default, but should be implemented
+     * by subclasses that require explicit destruction to purge event handlers or remove DOM nodes.
+     * @protected
+     */
+    destroy : function(){
+        if(!Ext.isEmpty(this.targetCls)){
+            var target = this.container.getLayoutTarget();
+            if(target){
+                target.removeClass(this.targetCls);
+            }
+        }
     }
-
-});
-/**
- * @class Ext.dd.DDTarget
- * A DragDrop implementation that does not move, but can be a drop
- * target.  You would get the same result by simply omitting implementation
- * for the event callbacks, but this way we reduce the processing cost of the
- * event listener and the callbacks.
- * @extends Ext.dd.DragDrop
- * @constructor
- * @param {String} id the id of the element that is a drop target
- * @param {String} sGroup the group of related DragDrop objects
- * @param {object} config an object containing configurable attributes
- *                 Valid properties for DDTarget in addition to those in
- *                 DragDrop:
- *                    none
+});/**
+ * @class Ext.layout.AutoLayout
+ * <p>The AutoLayout is the default layout manager delegated by {@link Ext.Container} to
+ * render any child Components when no <tt>{@link Ext.Container#layout layout}</tt> is configured into
+ * a {@link Ext.Container Container}. ContainerLayout provides the basic foundation for all other layout
+ * classes in Ext. It simply renders all child Components into the Container, performing no sizing or
+ * positioning services. To utilize a layout that provides sizing and positioning of child Components,
+ * specify an appropriate <tt>{@link Ext.Container#layout layout}</tt>.</p>
  */
-Ext.dd.DDTarget = function(id, sGroup, config) {
-    if (id) {
-        this.initTarget(id, sGroup, config);
-    }
-};
-
-// Ext.dd.DDTarget.prototype = new Ext.dd.DragDrop();
-Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, {
-    toString: function() {
-        return ("DDTarget " + this.id);
+Ext.layout.AutoLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    runLayout: function(){
+        var ct = this.container;
+        ct.doLayout();
+        delete ct.layoutPending;
     }
 });
+
+Ext.Container.LAYOUTS['auto'] = Ext.layout.AutoLayout;
 /**\r
- * @class Ext.dd.DragTracker\r
- * @extends Ext.util.Observable\r
- */\r
-Ext.dd.DragTracker = function(config){\r
-    Ext.apply(this, config);\r
-    this.addEvents(\r
-        /**\r
-         * @event mousedown\r
-         * @param {Object} this\r
-         * @param {Object} e event object\r
-         */\r
-        'mousedown',\r
-        /**\r
-         * @event mouseup\r
-         * @param {Object} this\r
-         * @param {Object} e event object\r
-         */\r
-        'mouseup',\r
-        /**\r
-         * @event mousemove\r
-         * @param {Object} this\r
-         * @param {Object} e event object\r
-         */\r
-        'mousemove',\r
-        /**\r
-         * @event dragstart\r
-         * @param {Object} this\r
-         * @param {Object} startXY the page coordinates of the event\r
-         */\r
-        'dragstart',\r
-        /**\r
-         * @event dragend\r
-         * @param {Object} this\r
-         * @param {Object} e event object\r
-         */\r
-        'dragend',\r
-        /**\r
-         * @event drag\r
-         * @param {Object} this\r
-         * @param {Object} e event object\r
-         */\r
-        'drag'\r
-    );\r
-\r
-    this.dragRegion = new Ext.lib.Region(0,0,0,0);\r
-\r
-    if(this.el){\r
-        this.initEl(this.el);\r
+ * @class Ext.layout.FitLayout\r
+ * @extends Ext.layout.ContainerLayout\r
+ * <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's\r
+ * container.  This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.Container#layout}\r
+ * config, and should generally not need to be created directly via the new keyword.</p>\r
+ * <p>FitLayout does not have any direct config options (other than inherited ones).  To fit a panel to a container\r
+ * using FitLayout, simply set layout:'fit' on the container and add a single panel to it.  If the container has\r
+ * multiple panels, only the first one will be displayed.  Example usage:</p>\r
+ * <pre><code>\r
+var p = new Ext.Panel({\r
+    title: 'Fit Layout',\r
+    layout:'fit',\r
+    items: {\r
+        title: 'Inner Panel',\r
+        html: '&lt;p&gt;This is the inner panel content&lt;/p&gt;',\r
+        border: false\r
     }\r
-}\r
-\r
-Ext.extend(Ext.dd.DragTracker, Ext.util.Observable,  {\r
-    /**\r
-     * @cfg {Boolean} active\r
-        * Defaults to <tt>false</tt>.\r
-        */     \r
-    active: false,\r
-    /**\r
-     * @cfg {Number} tolerance\r
-        * Defaults to <tt>5</tt>.\r
-        */     \r
-    tolerance: 5,\r
-    /**\r
-     * @cfg {Boolean/Number} autoStart\r
-        * Defaults to <tt>false</tt>. Specify <tt>true</tt> to defer trigger start by 1000 ms.\r
-        * Specify a Number for the number of milliseconds to defer trigger start.\r
-        */     \r
-    autoStart: false,\r
-\r
-    initEl: function(el){\r
-        this.el = Ext.get(el);\r
-        el.on('mousedown', this.onMouseDown, this,\r
-                this.delegate ? {delegate: this.delegate} : undefined);\r
-    },\r
-\r
-    destroy : function(){\r
-        this.el.un('mousedown', this.onMouseDown, this);\r
-    },\r
-\r
-    onMouseDown: function(e, target){\r
-        if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){\r
-            this.startXY = this.lastXY = e.getXY();\r
-            this.dragTarget = this.delegate ? target : this.el.dom;\r
-            if(this.preventDefault !== false){\r
-                e.preventDefault();\r
-            }\r
-            var doc = Ext.getDoc();\r
-            doc.on('mouseup', this.onMouseUp, this);\r
-            doc.on('mousemove', this.onMouseMove, this);\r
-            doc.on('selectstart', this.stopSelect, this);\r
-            if(this.autoStart){\r
-                this.timer = this.triggerStart.defer(this.autoStart === true ? 1000 : this.autoStart, this);\r
-            }\r
-        }\r
-    },\r
-\r
-    onMouseMove: function(e, target){\r
-        // HACK: IE hack to see if button was released outside of window. */\r
-        if(this.active && Ext.isIE && !e.browserEvent.button){\r
-            e.preventDefault();\r
-            this.onMouseUp(e);\r
-            return;\r
-        }\r
+});\r
+</code></pre>\r
+ */\r
+Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
+    // private\r
+    monitorResize:true,\r
 \r
-        e.preventDefault();\r
-        var xy = e.getXY(), s = this.startXY;\r
-        this.lastXY = xy;\r
-        if(!this.active){\r
-            if(Math.abs(s[0]-xy[0]) > this.tolerance || Math.abs(s[1]-xy[1]) > this.tolerance){\r
-                this.triggerStart();\r
-            }else{\r
-                return;\r
-            }\r
-        }\r
-        this.fireEvent('mousemove', this, e);\r
-        this.onDrag(e);\r
-        this.fireEvent('drag', this, e);\r
-    },\r
+    type: 'fit',\r
 \r
-    onMouseUp: function(e){\r
-        var doc = Ext.getDoc();\r
-        doc.un('mousemove', this.onMouseMove, this);\r
-        doc.un('mouseup', this.onMouseUp, this);\r
-        doc.un('selectstart', this.stopSelect, this);\r
-        e.preventDefault();\r
-        this.clearStart();\r
-        var wasActive = this.active;\r
-        this.active = false;\r
-        delete this.elRegion;\r
-        this.fireEvent('mouseup', this, e);\r
-        if(wasActive){\r
-            this.onEnd(e);\r
-            this.fireEvent('dragend', this, e);\r
+    getLayoutTargetSize : function() {\r
+        var target = this.container.getLayoutTarget();\r
+        if (!target) {\r
+            return {};\r
         }\r
+        // Style Sized (scrollbars not included)\r
+        return target.getStyleSize();\r
     },\r
 \r
-    triggerStart: function(isTimer){\r
-        this.clearStart();\r
-        this.active = true;\r
-        this.onStart(this.startXY);\r
-        this.fireEvent('dragstart', this, this.startXY);\r
-    },\r
-\r
-    clearStart : function(){\r
-        if(this.timer){\r
-            clearTimeout(this.timer);\r
-            delete this.timer;\r
+    // private\r
+    onLayout : function(ct, target){\r
+        Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);\r
+        if(!ct.collapsed){\r
+            this.setItemSize(this.activeItem || ct.items.itemAt(0), this.getLayoutTargetSize());\r
         }\r
     },\r
 \r
-    stopSelect : function(e){\r
-        e.stopEvent();\r
-        return false;\r
-    },\r
-\r
-    onBeforeStart : function(e){\r
-\r
-    },\r
-\r
-    onStart : function(xy){\r
-\r
-    },\r
-\r
-    onDrag : function(e){\r
-\r
-    },\r
-\r
-    onEnd : function(e){\r
-\r
-    },\r
-\r
-    getDragTarget : function(){\r
-        return this.dragTarget;\r
-    },\r
-\r
-    getDragCt : function(){\r
-        return this.el;\r
-    },\r
-\r
-    getXY : function(constrain){\r
-        return constrain ?\r
-               this.constrainModes[constrain].call(this, this.lastXY) : this.lastXY;\r
-    },\r
-\r
-    getOffset : function(constrain){\r
-        var xy = this.getXY(constrain);\r
-        var s = this.startXY;\r
-        return [s[0]-xy[0], s[1]-xy[1]];\r
-    },\r
-\r
-    constrainModes: {\r
-        'point' : function(xy){\r
-\r
-            if(!this.elRegion){\r
-                this.elRegion = this.getDragCt().getRegion();\r
-            }\r
-\r
-            var dr = this.dragRegion;\r
-\r
-            dr.left = xy[0];\r
-            dr.top = xy[1];\r
-            dr.right = xy[0];\r
-            dr.bottom = xy[1];\r
-\r
-            dr.constrainTo(this.elRegion);\r
-\r
-            return [dr.left, dr.top];\r
+    // private\r
+    setItemSize : function(item, size){\r
+        if(item && size.height > 0){ // display none?\r
+            item.setSize(size);\r
         }\r
     }\r
-});/**\r
- * @class Ext.dd.ScrollManager\r
- * <p>Provides automatic scrolling of overflow regions in the page during drag operations.</p>\r
- * <p>The ScrollManager configs will be used as the defaults for any scroll container registered with it,\r
- * but you can also override most of the configs per scroll container by adding a \r
- * <tt>ddScrollConfig</tt> object to the target element that contains these properties: {@link #hthresh},\r
- * {@link #vthresh}, {@link #increment} and {@link #frequency}.  Example usage:\r
+});\r
+Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;/**\r
+ * @class Ext.layout.CardLayout\r
+ * @extends Ext.layout.FitLayout\r
+ * <p>This layout manages multiple child Components, each fitted to the Container, where only a single child Component can be\r
+ * visible at any given time.  This layout style is most commonly used for wizards, tab implementations, etc.\r
+ * This class is intended to be extended or created via the layout:'card' {@link Ext.Container#layout} config,\r
+ * and should generally not need to be created directly via the new keyword.</p>\r
+ * <p>The CardLayout's focal method is {@link #setActiveItem}.  Since only one panel is displayed at a time,\r
+ * the only way to move from one Component to the next is by calling setActiveItem, passing the id or index of\r
+ * the next panel to display.  The layout itself does not provide a user interface for handling this navigation,\r
+ * so that functionality must be provided by the developer.</p>\r
+ * <p>In the following example, a simplistic wizard setup is demonstrated.  A button bar is added\r
+ * to the footer of the containing panel to provide navigation buttons.  The buttons will be handled by a\r
+ * common navigation routine -- for this example, the implementation of that routine has been ommitted since\r
+ * it can be any type of custom logic.  Note that other uses of a CardLayout (like a tab control) would require a\r
+ * completely different implementation.  For serious implementations, a better approach would be to extend\r
+ * CardLayout to provide the custom functionality needed.  Example usage:</p>\r
  * <pre><code>\r
-var el = Ext.get('scroll-ct');\r
-el.ddScrollConfig = {\r
-    vthresh: 50,\r
-    hthresh: -1,\r
-    frequency: 100,\r
-    increment: 200\r
+var navHandler = function(direction){\r
+    // This routine could contain business logic required to manage the navigation steps.\r
+    // It would call setActiveItem as needed, manage navigation button state, handle any\r
+    // branching logic that might be required, handle alternate actions like cancellation\r
+    // or finalization, etc.  A complete wizard implementation could get pretty\r
+    // sophisticated depending on the complexity required, and should probably be\r
+    // done as a subclass of CardLayout in a real-world implementation.\r
 };\r
-Ext.dd.ScrollManager.register(el);\r
-</code></pre>\r
- * <b>Note: This class uses "Point Mode" and is untested in "Intersect Mode".</b>\r
- * @singleton\r
- */\r
-Ext.dd.ScrollManager = function(){\r
-    var ddm = Ext.dd.DragDropMgr;\r
-    var els = {};\r
-    var dragEl = null;\r
-    var proc = {};\r
-    \r
-    var onStop = function(e){\r
-        dragEl = null;\r
-        clearProc();\r
-    };\r
-    \r
-    var triggerRefresh = function(){\r
-        if(ddm.dragCurrent){\r
-             ddm.refreshCache(ddm.dragCurrent.groups);\r
-        }\r
-    };\r
-    \r
-    var doScroll = function(){\r
-        if(ddm.dragCurrent){\r
-            var dds = Ext.dd.ScrollManager;\r
-            var inc = proc.el.ddScrollConfig ?\r
-                      proc.el.ddScrollConfig.increment : dds.increment;\r
-            if(!dds.animate){\r
-                if(proc.el.scroll(proc.dir, inc)){\r
-                    triggerRefresh();\r
-                }\r
-            }else{\r
-                proc.el.scroll(proc.dir, inc, true, dds.animDuration, triggerRefresh);\r
-            }\r
-        }\r
-    };\r
-    \r
-    var clearProc = function(){\r
-        if(proc.id){\r
-            clearInterval(proc.id);\r
-        }\r
-        proc.id = 0;\r
-        proc.el = null;\r
-        proc.dir = "";\r
-    };\r
-    \r
-    var startProc = function(el, dir){\r
-        clearProc();\r
-        proc.el = el;\r
-        proc.dir = dir;\r
-        var freq = (el.ddScrollConfig && el.ddScrollConfig.frequency) ? \r
-                el.ddScrollConfig.frequency : Ext.dd.ScrollManager.frequency;\r
-        proc.id = setInterval(doScroll, freq);\r
-    };\r
-    \r
-    var onFire = function(e, isDrop){\r
-        if(isDrop || !ddm.dragCurrent){ return; }\r
-        var dds = Ext.dd.ScrollManager;\r
-        if(!dragEl || dragEl != ddm.dragCurrent){\r
-            dragEl = ddm.dragCurrent;\r
-            // refresh regions on drag start\r
-            dds.refreshCache();\r
-        }\r
-        \r
-        var xy = Ext.lib.Event.getXY(e);\r
-        var pt = new Ext.lib.Point(xy[0], xy[1]);\r
-        for(var id in els){\r
-            var el = els[id], r = el._region;\r
-            var c = el.ddScrollConfig ? el.ddScrollConfig : dds;\r
-            if(r && r.contains(pt) && el.isScrollable()){\r
-                if(r.bottom - pt.y <= c.vthresh){\r
-                    if(proc.el != el){\r
-                        startProc(el, "down");\r
-                    }\r
-                    return;\r
-                }else if(r.right - pt.x <= c.hthresh){\r
-                    if(proc.el != el){\r
-                        startProc(el, "left");\r
-                    }\r
-                    return;\r
-                }else if(pt.y - r.top <= c.vthresh){\r
-                    if(proc.el != el){\r
-                        startProc(el, "up");\r
-                    }\r
-                    return;\r
-                }else if(pt.x - r.left <= c.hthresh){\r
-                    if(proc.el != el){\r
-                        startProc(el, "right");\r
-                    }\r
-                    return;\r
-                }\r
-            }\r
-        }\r
-        clearProc();\r
-    };\r
-    \r
-    ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm);\r
-    ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm);\r
-    \r
-    return {\r
-        /**\r
-         * Registers new overflow element(s) to auto scroll\r
-         * @param {Mixed/Array} el The id of or the element to be scrolled or an array of either\r
-         */\r
-        register : function(el){\r
-            if(Ext.isArray(el)){\r
-                for(var i = 0, len = el.length; i < len; i++) {\r
-                       this.register(el[i]);\r
-                }\r
-            }else{\r
-                el = Ext.get(el);\r
-                els[el.id] = el;\r
-            }\r
-        },\r
-        \r
-        /**\r
-         * Unregisters overflow element(s) so they are no longer scrolled\r
-         * @param {Mixed/Array} el The id of or the element to be removed or an array of either\r
-         */\r
-        unregister : function(el){\r
-            if(Ext.isArray(el)){\r
-                for(var i = 0, len = el.length; i < len; i++) {\r
-                       this.unregister(el[i]);\r
-                }\r
-            }else{\r
-                el = Ext.get(el);\r
-                delete els[el.id];\r
-            }\r
-        },\r
-        \r
-        /**\r
-         * The number of pixels from the top or bottom edge of a container the pointer needs to be to\r
-         * trigger scrolling (defaults to 25)\r
-         * @type Number\r
-         */\r
-        vthresh : 25,\r
-        /**\r
-         * The number of pixels from the right or left edge of a container the pointer needs to be to\r
-         * trigger scrolling (defaults to 25)\r
-         * @type Number\r
-         */\r
-        hthresh : 25,\r
-\r
-        /**\r
-         * The number of pixels to scroll in each scroll increment (defaults to 50)\r
-         * @type Number\r
-         */\r
-        increment : 100,\r
-        \r
-        /**\r
-         * The frequency of scrolls in milliseconds (defaults to 500)\r
-         * @type Number\r
-         */\r
-        frequency : 500,\r
-        \r
-        /**\r
-         * True to animate the scroll (defaults to true)\r
-         * @type Boolean\r
-         */\r
-        animate: true,\r
-        \r
-        /**\r
-         * The animation duration in seconds - \r
-         * MUST BE less than Ext.dd.ScrollManager.frequency! (defaults to .4)\r
-         * @type Number\r
-         */\r
-        animDuration: .4,\r
-        \r
-        /**\r
-         * Manually trigger a cache refresh.\r
-         */\r
-        refreshCache : function(){\r
-            for(var id in els){\r
-                if(typeof els[id] == 'object'){ // for people extending the object prototype\r
-                    els[id]._region = els[id].getRegion();\r
-                }\r
-            }\r
-        }\r
-    };\r
-}();/**\r
- * @class Ext.dd.Registry\r
- * Provides easy access to all drag drop components that are registered on a page.  Items can be retrieved either\r
- * directly by DOM node id, or by passing in the drag drop event that occurred and looking up the event target.\r
- * @singleton\r
- */\r
-Ext.dd.Registry = function(){\r
-    var elements = {}; \r
-    var handles = {}; \r
-    var autoIdSeed = 0;\r
-\r
-    var getId = function(el, autogen){\r
-        if(typeof el == "string"){\r
-            return el;\r
-        }\r
-        var id = el.id;\r
-        if(!id && autogen !== false){\r
-            id = "extdd-" + (++autoIdSeed);\r
-            el.id = id;\r
-        }\r
-        return id;\r
-    };\r
-    \r
-    return {\r
-    /**\r
-     * Resgister a drag drop element\r
-     * @param {String/HTMLElement) element The id or DOM node to register\r
-     * @param {Object} data (optional) An custom data object that will be passed between the elements that are involved\r
-     * in drag drop operations.  You can populate this object with any arbitrary properties that your own code\r
-     * knows how to interpret, plus there are some specific properties known to the Registry that should be\r
-     * populated in the data object (if applicable):\r
-     * <pre>\r
-Value      Description<br />\r
----------  ------------------------------------------<br />\r
-handles    Array of DOM nodes that trigger dragging<br />\r
-           for the element being registered<br />\r
-isHandle   True if the element passed in triggers<br />\r
-           dragging itself, else false\r
-</pre>\r
-     */\r
-        register : function(el, data){\r
-            data = data || {};\r
-            if(typeof el == "string"){\r
-                el = document.getElementById(el);\r
-            }\r
-            data.ddel = el;\r
-            elements[getId(el)] = data;\r
-            if(data.isHandle !== false){\r
-                handles[data.ddel.id] = data;\r
-            }\r
-            if(data.handles){\r
-                var hs = data.handles;\r
-                for(var i = 0, len = hs.length; i < len; i++){\r
-                       handles[getId(hs[i])] = data;\r
-                }\r
-            }\r
-        },\r
 \r
-    /**\r
-     * Unregister a drag drop element\r
-     * @param {String/HTMLElement) element The id or DOM node to unregister\r
-     */\r
-        unregister : function(el){\r
-            var id = getId(el, false);\r
-            var data = elements[id];\r
-            if(data){\r
-                delete elements[id];\r
-                if(data.handles){\r
-                    var hs = data.handles;\r
-                    for(var i = 0, len = hs.length; i < len; i++){\r
-                       delete handles[getId(hs[i], false)];\r
-                    }\r
-                }\r
-            }\r
-        },\r
-\r
-    /**\r
-     * Returns the handle registered for a DOM Node by id\r
-     * @param {String/HTMLElement} id The DOM node or id to look up\r
-     * @return {Object} handle The custom handle data\r
-     */\r
-        getHandle : function(id){\r
-            if(typeof id != "string"){ // must be element?\r
-                id = id.id;\r
-            }\r
-            return handles[id];\r
-        },\r
-\r
-    /**\r
-     * Returns the handle that is registered for the DOM node that is the target of the event\r
-     * @param {Event} e The event\r
-     * @return {Object} handle The custom handle data\r
-     */\r
-        getHandleFromEvent : function(e){\r
-            var t = Ext.lib.Event.getTarget(e);\r
-            return t ? handles[t.id] : null;\r
-        },\r
-\r
-    /**\r
-     * Returns a custom data object that is registered for a DOM node by id\r
-     * @param {String/HTMLElement} id The DOM node or id to look up\r
-     * @return {Object} data The custom data\r
-     */\r
-        getTarget : function(id){\r
-            if(typeof id != "string"){ // must be element?\r
-                id = id.id;\r
-            }\r
-            return elements[id];\r
+var card = new Ext.Panel({\r
+    title: 'Example Wizard',\r
+    layout:'card',\r
+    activeItem: 0, // make sure the active item is set on the container config!\r
+    bodyStyle: 'padding:15px',\r
+    defaults: {\r
+        // applied to each contained panel\r
+        border:false\r
+    },\r
+    // just an example of one possible navigation scheme, using buttons\r
+    bbar: [\r
+        {\r
+            id: 'move-prev',\r
+            text: 'Back',\r
+            handler: navHandler.createDelegate(this, [-1]),\r
+            disabled: true\r
         },\r
-\r
-    /**\r
-     * Returns a custom data object that is registered for the DOM node that is the target of the event\r
-     * @param {Event} e The event\r
-     * @return {Object} data The custom data\r
-     */\r
-        getTargetFromEvent : function(e){\r
-            var t = Ext.lib.Event.getTarget(e);\r
-            return t ? elements[t.id] || handles[t.id] : null;\r
+        '->', // greedy spacer so that the buttons are aligned to each side\r
+        {\r
+            id: 'move-next',\r
+            text: 'Next',\r
+            handler: navHandler.createDelegate(this, [1])\r
         }\r
-    };\r
-}();/**\r
- * @class Ext.dd.StatusProxy\r
- * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair.  This is the\r
- * default drag proxy used by all Ext.dd components.\r
- * @constructor\r
- * @param {Object} config\r
+    ],\r
+    // the panels (or "cards") within the layout\r
+    items: [{\r
+        id: 'card-0',\r
+        html: '&lt;h1&gt;Welcome to the Wizard!&lt;/h1&gt;&lt;p&gt;Step 1 of 3&lt;/p&gt;'\r
+    },{\r
+        id: 'card-1',\r
+        html: '&lt;p&gt;Step 2 of 3&lt;/p&gt;'\r
+    },{\r
+        id: 'card-2',\r
+        html: '&lt;h1&gt;Congratulations!&lt;/h1&gt;&lt;p&gt;Step 3 of 3 - Complete&lt;/p&gt;'\r
+    }]\r
+});\r
+</code></pre>\r
  */\r
-Ext.dd.StatusProxy = function(config){\r
-    Ext.apply(this, config);\r
-    this.id = this.id || Ext.id();\r
-    this.el = new Ext.Layer({\r
-        dh: {\r
-            id: this.id, tag: "div", cls: "x-dd-drag-proxy "+this.dropNotAllowed, children: [\r
-                {tag: "div", cls: "x-dd-drop-icon"},\r
-                {tag: "div", cls: "x-dd-drag-ghost"}\r
-            ]\r
-        }, \r
-        shadow: !config || config.shadow !== false\r
-    });\r
-    this.ghost = Ext.get(this.el.dom.childNodes[1]);\r
-    this.dropStatus = this.dropNotAllowed;\r
-};\r
-\r
-Ext.dd.StatusProxy.prototype = {\r
+Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {\r
     /**\r
-     * @cfg {String} dropAllowed\r
-     * The CSS class to apply to the status element when drop is allowed (defaults to "x-dd-drop-ok").\r
+     * @cfg {Boolean} deferredRender\r
+     * True to render each contained item at the time it becomes active, false to render all contained items\r
+     * as soon as the layout is rendered (defaults to false).  If there is a significant amount of content or\r
+     * a lot of heavy controls being rendered into panels that are not displayed by default, setting this to\r
+     * true might improve performance.\r
      */\r
-    dropAllowed : "x-dd-drop-ok",\r
+    deferredRender : false,\r
+\r
     /**\r
-     * @cfg {String} dropNotAllowed\r
-     * The CSS class to apply to the status element when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
+     * @cfg {Boolean} layoutOnCardChange\r
+     * True to force a layout of the active item when the active card is changed. Defaults to false.\r
      */\r
-    dropNotAllowed : "x-dd-drop-nodrop",\r
+    layoutOnCardChange : false,\r
 \r
     /**\r
-     * Updates the proxy's visual element to indicate the status of whether or not drop is allowed\r
-     * over the current target element.\r
-     * @param {String} cssClass The css class for the new drop status indicator image\r
+     * @cfg {Boolean} renderHidden @hide\r
      */\r
-    setStatus : function(cssClass){\r
-        cssClass = cssClass || this.dropNotAllowed;\r
-        if(this.dropStatus != cssClass){\r
-            this.el.replaceClass(this.dropStatus, cssClass);\r
-            this.dropStatus = cssClass;\r
-        }\r
+    // private\r
+    renderHidden : true,\r
+\r
+    type: 'card',\r
+\r
+    constructor: function(config){\r
+        Ext.layout.CardLayout.superclass.constructor.call(this, config);\r
     },\r
 \r
     /**\r
-     * Resets the status indicator to the default dropNotAllowed value\r
-     * @param {Boolean} clearGhost True to also remove all content from the ghost, false to preserve it\r
+     * Sets the active (visible) item in the layout.\r
+     * @param {String/Number} item The string component id or numeric index of the item to activate\r
      */\r
-    reset : function(clearGhost){\r
-        this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed;\r
-        this.dropStatus = this.dropNotAllowed;\r
-        if(clearGhost){\r
-            this.ghost.update("");\r
+    setActiveItem : function(item){\r
+        var ai = this.activeItem,\r
+            ct = this.container;\r
+        item = ct.getComponent(item);\r
+\r
+        // Is this a valid, different card?\r
+        if(item && ai != item){\r
+\r
+            // Changing cards, hide the current one\r
+            if(ai){\r
+                ai.hide();\r
+                if (ai.hidden !== true) {\r
+                    return false;\r
+                }\r
+                ai.fireEvent('deactivate', ai);\r
+            }\r
+            // Change activeItem reference\r
+            this.activeItem = item;\r
+\r
+            // The container is about to get a recursive layout, remove any deferLayout reference\r
+            // because it will trigger a redundant layout.\r
+            delete item.deferLayout;\r
+\r
+            // Show the new component\r
+            item.show();\r
+\r
+            this.layout();\r
+\r
+            if(item.doLayout){\r
+                item.doLayout();\r
+            }\r
+            item.fireEvent('activate', item);\r
         }\r
     },\r
 \r
-    /**\r
-     * Updates the contents of the ghost element\r
-     * @param {String/HTMLElement} html The html that will replace the current innerHTML of the ghost element, or a\r
-     * DOM node to append as the child of the ghost element (in which case the innerHTML will be cleared first).\r
-     */\r
-    update : function(html){\r
-        if(typeof html == "string"){\r
-            this.ghost.update(html);\r
+    // private\r
+    renderAll : function(ct, target){\r
+        if(this.deferredRender){\r
+            this.renderItem(this.activeItem, undefined, target);\r
         }else{\r
-            this.ghost.update("");\r
-            html.style.margin = "0";\r
-            this.ghost.dom.appendChild(html);\r
-        }\r
-        var el = this.ghost.dom.firstChild; \r
-        if(el){\r
-            Ext.fly(el).setStyle('float', 'none');\r
+            Ext.layout.CardLayout.superclass.renderAll.call(this, ct, target);\r
         }\r
-    },\r
+    }\r
+});\r
+Ext.Container.LAYOUTS['card'] = Ext.layout.CardLayout;/**
+ * @class Ext.layout.AnchorLayout
+ * @extends Ext.layout.ContainerLayout
+ * <p>This is a layout that enables anchoring of contained elements relative to the container's dimensions.
+ * If the container is resized, all anchored items are automatically rerendered according to their
+ * <b><tt>{@link #anchor}</tt></b> rules.</p>
+ * <p>This class is intended to be extended or created via the layout:'anchor' {@link Ext.Container#layout}
+ * config, and should generally not need to be created directly via the new keyword.</p>
+ * <p>AnchorLayout does not have any direct config options (other than inherited ones). By default,
+ * AnchorLayout will calculate anchor measurements based on the size of the container itself. However, the
+ * container using the AnchorLayout can supply an anchoring-specific config property of <b>anchorSize</b>.
+ * If anchorSize is specifed, the layout will use it as a virtual container for the purposes of calculating
+ * anchor measurements based on it instead, allowing the container to be sized independently of the anchoring
+ * logic if necessary.  For example:</p>
+ * <pre><code>
+var viewport = new Ext.Viewport({
+    layout:'anchor',
+    anchorSize: {width:800, height:600},
+    items:[{
+        title:'Item 1',
+        html:'Content 1',
+        width:800,
+        anchor:'right 20%'
+    },{
+        title:'Item 2',
+        html:'Content 2',
+        width:300,
+        anchor:'50% 30%'
+    },{
+        title:'Item 3',
+        html:'Content 3',
+        width:600,
+        anchor:'-100 50%'
+    }]
+});
+ * </code></pre>
+ */
+Ext.layout.AnchorLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    /**
+     * @cfg {String} anchor
+     * <p>This configuation option is to be applied to <b>child <tt>items</tt></b> of a container managed by
+     * this layout (ie. configured with <tt>layout:'anchor'</tt>).</p><br/>
+     *
+     * <p>This value is what tells the layout how an item should be anchored to the container. <tt>items</tt>
+     * added to an AnchorLayout accept an anchoring-specific config property of <b>anchor</b> which is a string
+     * containing two values: the horizontal anchor value and the vertical anchor value (for example, '100% 50%').
+     * The following types of anchor values are supported:<div class="mdetail-params"><ul>
+     *
+     * <li><b>Percentage</b> : Any value between 1 and 100, expressed as a percentage.<div class="sub-desc">
+     * The first anchor is the percentage width that the item should take up within the container, and the
+     * second is the percentage height.  For example:<pre><code>
+// two values specified
+anchor: '100% 50%' // render item complete width of the container and
+                   // 1/2 height of the container
+// one value specified
+anchor: '100%'     // the width value; the height will default to auto
+     * </code></pre></div></li>
+     *
+     * <li><b>Offsets</b> : Any positive or negative integer value.<div class="sub-desc">
+     * This is a raw adjustment where the first anchor is the offset from the right edge of the container,
+     * and the second is the offset from the bottom edge. For example:<pre><code>
+// two values specified
+anchor: '-50 -100' // render item the complete width of the container
+                   // minus 50 pixels and
+                   // the complete height minus 100 pixels.
+// one value specified
+anchor: '-50'      // anchor value is assumed to be the right offset value
+                   // bottom offset will default to 0
+     * </code></pre></div></li>
+     *
+     * <li><b>Sides</b> : Valid values are <tt>'right'</tt> (or <tt>'r'</tt>) and <tt>'bottom'</tt>
+     * (or <tt>'b'</tt>).<div class="sub-desc">
+     * Either the container must have a fixed size or an anchorSize config value defined at render time in
+     * order for these to have any effect.</div></li>
+     *
+     * <li><b>Mixed</b> : <div class="sub-desc">
+     * Anchor values can also be mixed as needed.  For example, to render the width offset from the container
+     * right edge by 50 pixels and 75% of the container's height use:
+     * <pre><code>
+anchor: '-50 75%'
+     * </code></pre></div></li>
+     *
+     *
+     * </ul></div>
+     */
+
+    // private
+    monitorResize:true,
+    type: 'anchor',
+
+    getLayoutTargetSize : function() {
+        var target = this.container.getLayoutTarget();
+        if (!target) {
+            return {};
+        }
+        // Style Sized (scrollbars not included)
+        return target.getStyleSize();
+    },
+
+    // private
+    onLayout : function(ct, target){
+        Ext.layout.AnchorLayout.superclass.onLayout.call(this, ct, target);
+        var size = this.getLayoutTargetSize();
+
+        var w = size.width, h = size.height;
+
+        if(w < 20 && h < 20){
+            return;
+        }
+
+        // find the container anchoring size
+        var aw, ah;
+        if(ct.anchorSize){
+            if(typeof ct.anchorSize == 'number'){
+                aw = ct.anchorSize;
+            }else{
+                aw = ct.anchorSize.width;
+                ah = ct.anchorSize.height;
+            }
+        }else{
+            aw = ct.initialConfig.width;
+            ah = ct.initialConfig.height;
+        }
+
+        var cs = this.getRenderedItems(ct), len = cs.length, i, c, a, cw, ch, el, vs;
+        for(i = 0; i < len; i++){
+            c = cs[i];
+            el = c.getPositionEl();
+            if(c.anchor){
+                a = c.anchorSpec;
+                if(!a){ // cache all anchor values
+                    vs = c.anchor.split(' ');
+                    c.anchorSpec = a = {
+                        right: this.parseAnchor(vs[0], c.initialConfig.width, aw),
+                        bottom: this.parseAnchor(vs[1], c.initialConfig.height, ah)
+                    };
+                }
+                cw = a.right ? this.adjustWidthAnchor(a.right(w) - el.getMargins('lr'), c) : undefined;
+                ch = a.bottom ? this.adjustHeightAnchor(a.bottom(h) - el.getMargins('tb'), c) : undefined;
+
+                if(cw || ch){
+                    c.setSize(cw || undefined, ch || undefined);
+                }
+            }
+        }
+    },
+
+    // private
+    parseAnchor : function(a, start, cstart){
+        if(a && a != 'none'){
+            var last;
+            if(/^(r|right|b|bottom)$/i.test(a)){   // standard anchor
+                var diff = cstart - start;
+                return function(v){
+                    if(v !== last){
+                        last = v;
+                        return v - diff;
+                    }
+                }
+            }else if(a.indexOf('%') != -1){
+                var ratio = parseFloat(a.replace('%', ''))*.01;   // percentage
+                return function(v){
+                    if(v !== last){
+                        last = v;
+                        return Math.floor(v*ratio);
+                    }
+                }
+            }else{
+                a = parseInt(a, 10);
+                if(!isNaN(a)){                            // simple offset adjustment
+                    return function(v){
+                        if(v !== last){
+                            last = v;
+                            return v + a;
+                        }
+                    }
+                }
+            }
+        }
+        return false;
+    },
+
+    // private
+    adjustWidthAnchor : function(value, comp){
+        return value;
+    },
+
+    // private
+    adjustHeightAnchor : function(value, comp){
+        return value;
+    }
+
+    /**
+     * @property activeItem
+     * @hide
+     */
+});
+Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout;
+/**\r
+ * @class Ext.layout.ColumnLayout\r
+ * @extends Ext.layout.ContainerLayout\r
+ * <p>This is the layout style of choice for creating structural layouts in a multi-column format where the width of\r
+ * each column can be specified as a percentage or fixed width, but the height is allowed to vary based on the content.\r
+ * This class is intended to be extended or created via the layout:'column' {@link Ext.Container#layout} config,\r
+ * and should generally not need to be created directly via the new keyword.</p>\r
+ * <p>ColumnLayout does not have any direct config options (other than inherited ones), but it does support a\r
+ * specific config property of <b><tt>columnWidth</tt></b> that can be included in the config of any panel added to it.  The\r
+ * layout will use the columnWidth (if present) or width of each panel during layout to determine how to size each panel.\r
+ * If width or columnWidth is not specified for a given panel, its width will default to the panel's width (or auto).</p>\r
+ * <p>The width property is always evaluated as pixels, and must be a number greater than or equal to 1.\r
+ * The columnWidth property is always evaluated as a percentage, and must be a decimal value greater than 0 and\r
+ * less than 1 (e.g., .25).</p>\r
+ * <p>The basic rules for specifying column widths are pretty simple.  The logic makes two passes through the\r
+ * set of contained panels.  During the first layout pass, all panels that either have a fixed width or none\r
+ * specified (auto) are skipped, but their widths are subtracted from the overall container width.  During the second\r
+ * pass, all panels with columnWidths are assigned pixel widths in proportion to their percentages based on\r
+ * the total <b>remaining</b> container width.  In other words, percentage width panels are designed to fill the space\r
+ * left over by all the fixed-width and/or auto-width panels.  Because of this, while you can specify any number of columns\r
+ * with different percentages, the columnWidths must always add up to 1 (or 100%) when added together, otherwise your\r
+ * layout may not render as expected.  Example usage:</p>\r
+ * <pre><code>\r
+// All columns are percentages -- they must add up to 1\r
+var p = new Ext.Panel({\r
+    title: 'Column Layout - Percentage Only',\r
+    layout:'column',\r
+    items: [{\r
+        title: 'Column 1',\r
+        columnWidth: .25\r
+    },{\r
+        title: 'Column 2',\r
+        columnWidth: .6\r
+    },{\r
+        title: 'Column 3',\r
+        columnWidth: .15\r
+    }]\r
+});\r
 \r
-    /**\r
-     * Returns the underlying proxy {@link Ext.Layer}\r
-     * @return {Ext.Layer} el\r
-    */\r
-    getEl : function(){\r
-        return this.el;\r
-    },\r
+// Mix of width and columnWidth -- all columnWidth values must add up\r
+// to 1. The first column will take up exactly 120px, and the last two\r
+// columns will fill the remaining container width.\r
+var p = new Ext.Panel({\r
+    title: 'Column Layout - Mixed',\r
+    layout:'column',\r
+    items: [{\r
+        title: 'Column 1',\r
+        width: 120\r
+    },{\r
+        title: 'Column 2',\r
+        columnWidth: .8\r
+    },{\r
+        title: 'Column 3',\r
+        columnWidth: .2\r
+    }]\r
+});\r
+</code></pre>\r
+ */\r
+Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
+    // private\r
+    monitorResize:true,\r
 \r
-    /**\r
-     * Returns the ghost element\r
-     * @return {Ext.Element} el\r
-     */\r
-    getGhost : function(){\r
-        return this.ghost;\r
+    type: 'column',\r
+\r
+    extraCls: 'x-column',\r
+\r
+    scrollOffset : 0,\r
+\r
+    // private\r
+\r
+    targetCls: 'x-column-layout-ct',\r
+\r
+    isValidParent : function(c, target){\r
+        return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom;\r
     },\r
 \r
-    /**\r
-     * Hides the proxy\r
-     * @param {Boolean} clear True to reset the status and clear the ghost contents, false to preserve them\r
-     */\r
-    hide : function(clear){\r
-        this.el.hide();\r
-        if(clear){\r
-            this.reset(true);\r
+    getLayoutTargetSize : function() {\r
+        var target = this.container.getLayoutTarget(), ret;\r
+        if (target) {\r
+            ret = target.getViewSize();\r
+            ret.width -= target.getPadding('lr');\r
+            ret.height -= target.getPadding('tb');\r
         }\r
+        return ret;\r
     },\r
 \r
-    /**\r
-     * Stops the repair animation if it's currently running\r
-     */\r
-    stop : function(){\r
-        if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){\r
-            this.anim.stop();\r
+    renderAll : function(ct, target) {\r
+        if(!this.innerCt){\r
+            // the innerCt prevents wrapping and shuffling while\r
+            // the container is resizing\r
+            this.innerCt = target.createChild({cls:'x-column-inner'});\r
+            this.innerCt.createChild({cls:'x-clear'});\r
         }\r
+        Ext.layout.ColumnLayout.superclass.renderAll.call(this, ct, this.innerCt);\r
     },\r
 \r
-    /**\r
-     * Displays this proxy\r
-     */\r
-    show : function(){\r
-        this.el.show();\r
-    },\r
+    // private\r
+    onLayout : function(ct, target){\r
+        var cs = ct.items.items, len = cs.length, c, i;\r
+\r
+        this.renderAll(ct, target);\r
+\r
+        var size = this.getLayoutTargetSize();\r
+\r
+        if(size.width < 1 && size.height < 1){ // display none?\r
+            return;\r
+        }\r
+\r
+        var w = size.width - this.scrollOffset,\r
+            h = size.height,\r
+            pw = w;\r
+\r
+        this.innerCt.setWidth(w);\r
+\r
+        // some columns can be percentages while others are fixed\r
+        // so we need to make 2 passes\r
+\r
+        for(i = 0; i < len; i++){\r
+            c = cs[i];\r
+            if(!c.columnWidth){\r
+                pw -= (c.getWidth() + c.getPositionEl().getMargins('lr'));\r
+            }\r
+        }\r
+\r
+        pw = pw < 0 ? 0 : pw;\r
+\r
+        for(i = 0; i < len; i++){\r
+            c = cs[i];\r
+            if(c.columnWidth){\r
+                c.setSize(Math.floor(c.columnWidth * pw) - c.getPositionEl().getMargins('lr'));\r
+            }\r
+        }\r
+\r
+        // Browsers differ as to when they account for scrollbars.  We need to re-measure to see if the scrollbar\r
+        // spaces were accounted for properly.  If not, re-layout.\r
+        if (Ext.isIE) {\r
+            if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) {\r
+                var ts = this.getLayoutTargetSize();\r
+                if (ts.width != size.width){\r
+                    this.adjustmentPass = true;\r
+                    this.onLayout(ct, target);\r
+                }\r
+            }\r
+        }\r
+        delete this.adjustmentPass;\r
+    }\r
 \r
     /**\r
-     * Force the Layer to sync its shadow and shim positions to the element\r
+     * @property activeItem\r
+     * @hide\r
      */\r
-    sync : function(){\r
-        this.el.sync();\r
+});\r
+\r
+Ext.Container.LAYOUTS['column'] = Ext.layout.ColumnLayout;/**
+ * @class Ext.layout.BorderLayout
+ * @extends Ext.layout.ContainerLayout
+ * <p>This is a multi-pane, application-oriented UI layout style that supports multiple
+ * nested panels, automatic {@link Ext.layout.BorderLayout.Region#split split} bars between
+ * {@link Ext.layout.BorderLayout.Region#BorderLayout.Region regions} and built-in
+ * {@link Ext.layout.BorderLayout.Region#collapsible expanding and collapsing} of regions.</p>
+ * <p>This class is intended to be extended or created via the <tt>layout:'border'</tt>
+ * {@link Ext.Container#layout} config, and should generally not need to be created directly
+ * via the new keyword.</p>
+ * <p>BorderLayout does not have any direct config options (other than inherited ones).
+ * All configuration options available for customizing the BorderLayout are at the
+ * {@link Ext.layout.BorderLayout.Region} and {@link Ext.layout.BorderLayout.SplitRegion}
+ * levels.</p>
+ * <p>Example usage:</p>
+ * <pre><code>
+var myBorderPanel = new Ext.Panel({
+    {@link Ext.Component#renderTo renderTo}: document.body,
+    {@link Ext.BoxComponent#width width}: 700,
+    {@link Ext.BoxComponent#height height}: 500,
+    {@link Ext.Panel#title title}: 'Border Layout',
+    {@link Ext.Container#layout layout}: 'border',
+    {@link Ext.Container#items items}: [{
+        {@link Ext.Panel#title title}: 'South Region is resizable',
+        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'south',     // position for region
+        {@link Ext.BoxComponent#height height}: 100,
+        {@link Ext.layout.BorderLayout.Region#split split}: true,         // enable resizing
+        {@link Ext.SplitBar#minSize minSize}: 75,         // defaults to {@link Ext.layout.BorderLayout.Region#minHeight 50}
+        {@link Ext.SplitBar#maxSize maxSize}: 150,
+        {@link Ext.layout.BorderLayout.Region#margins margins}: '0 5 5 5'
+    },{
+        // xtype: 'panel' implied by default
+        {@link Ext.Panel#title title}: 'West Region is collapsible',
+        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}:'west',
+        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 0 0 5',
+        {@link Ext.BoxComponent#width width}: 200,
+        {@link Ext.layout.BorderLayout.Region#collapsible collapsible}: true,   // make collapsible
+        {@link Ext.layout.BorderLayout.Region#cmargins cmargins}: '5 5 0 5', // adjust top margin when collapsed
+        {@link Ext.Component#id id}: 'west-region-container',
+        {@link Ext.Container#layout layout}: 'fit',
+        {@link Ext.Panel#unstyled unstyled}: true
+    },{
+        {@link Ext.Panel#title title}: 'Center Region',
+        {@link Ext.layout.BorderLayout.Region#BorderLayout.Region region}: 'center',     // center region is required, no width/height specified
+        {@link Ext.Component#xtype xtype}: 'container',
+        {@link Ext.Container#layout layout}: 'fit',
+        {@link Ext.layout.BorderLayout.Region#margins margins}: '5 5 0 0'
+    }]
+});
+</code></pre>
+ * <p><b><u>Notes</u></b>:</p><div class="mdetail-params"><ul>
+ * <li>Any container using the BorderLayout <b>must</b> have a child item with <tt>region:'center'</tt>.
+ * The child item in the center region will always be resized to fill the remaining space not used by
+ * the other regions in the layout.</li>
+ * <li>Any child items with a region of <tt>west</tt> or <tt>east</tt> must have <tt>width</tt> defined
+ * (an integer representing the number of pixels that the region should take up).</li>
+ * <li>Any child items with a region of <tt>north</tt> or <tt>south</tt> must have <tt>height</tt> defined.</li>
+ * <li>The regions of a BorderLayout are <b>fixed at render time</b> and thereafter, its child Components may not be removed or added</b>.  To add/remove
+ * Components within a BorderLayout, have them wrapped by an additional Container which is directly
+ * managed by the BorderLayout.  If the region is to be collapsible, the Container used directly
+ * by the BorderLayout manager should be a Panel.  In the following example a Container (an Ext.Panel)
+ * is added to the west region:
+ * <div style="margin-left:16px"><pre><code>
+wrc = {@link Ext#getCmp Ext.getCmp}('west-region-container');
+wrc.{@link Ext.Panel#removeAll removeAll}();
+wrc.{@link Ext.Container#add add}({
+    title: 'Added Panel',
+    html: 'Some content'
+});
+wrc.{@link Ext.Container#doLayout doLayout}();
+ * </code></pre></div>
+ * </li>
+ * <li> To reference a {@link Ext.layout.BorderLayout.Region Region}:
+ * <div style="margin-left:16px"><pre><code>
+wr = myBorderPanel.layout.west;
+ * </code></pre></div>
+ * </li>
+ * </ul></div>
+ */
+Ext.layout.BorderLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    // private
+    monitorResize:true,
+    // private
+    rendered : false,
+
+    type: 'border',
+
+    targetCls: 'x-border-layout-ct',
+
+    getLayoutTargetSize : function() {
+        var target = this.container.getLayoutTarget();
+        return target ? target.getViewSize() : {};
+    },
+
+    // private
+    onLayout : function(ct, target){
+        var collapsed, i, c, pos, items = ct.items.items, len = items.length;
+        if(!this.rendered){
+            collapsed = [];
+            for(i = 0; i < len; i++) {
+                c = items[i];
+                pos = c.region;
+                if(c.collapsed){
+                    collapsed.push(c);
+                }
+                c.collapsed = false;
+                if(!c.rendered){
+                    c.render(target, i);
+                    c.getPositionEl().addClass('x-border-panel');
+                }
+                this[pos] = pos != 'center' && c.split ?
+                    new Ext.layout.BorderLayout.SplitRegion(this, c.initialConfig, pos) :
+                    new Ext.layout.BorderLayout.Region(this, c.initialConfig, pos);
+                this[pos].render(target, c);
+            }
+            this.rendered = true;
+        }
+
+        var size = this.getLayoutTargetSize();
+        if(size.width < 20 || size.height < 20){ // display none?
+            if(collapsed){
+                this.restoreCollapsed = collapsed;
+            }
+            return;
+        }else if(this.restoreCollapsed){
+            collapsed = this.restoreCollapsed;
+            delete this.restoreCollapsed;
+        }
+
+        var w = size.width, h = size.height,
+            centerW = w, centerH = h, centerY = 0, centerX = 0,
+            n = this.north, s = this.south, west = this.west, e = this.east, c = this.center,
+            b, m, totalWidth, totalHeight;
+        if(!c && Ext.layout.BorderLayout.WARN !== false){
+            throw 'No center region defined in BorderLayout ' + ct.id;
+        }
+
+        if(n && n.isVisible()){
+            b = n.getSize();
+            m = n.getMargins();
+            b.width = w - (m.left+m.right);
+            b.x = m.left;
+            b.y = m.top;
+            centerY = b.height + b.y + m.bottom;
+            centerH -= centerY;
+            n.applyLayout(b);
+        }
+        if(s && s.isVisible()){
+            b = s.getSize();
+            m = s.getMargins();
+            b.width = w - (m.left+m.right);
+            b.x = m.left;
+            totalHeight = (b.height + m.top + m.bottom);
+            b.y = h - totalHeight + m.top;
+            centerH -= totalHeight;
+            s.applyLayout(b);
+        }
+        if(west && west.isVisible()){
+            b = west.getSize();
+            m = west.getMargins();
+            b.height = centerH - (m.top+m.bottom);
+            b.x = m.left;
+            b.y = centerY + m.top;
+            totalWidth = (b.width + m.left + m.right);
+            centerX += totalWidth;
+            centerW -= totalWidth;
+            west.applyLayout(b);
+        }
+        if(e && e.isVisible()){
+            b = e.getSize();
+            m = e.getMargins();
+            b.height = centerH - (m.top+m.bottom);
+            totalWidth = (b.width + m.left + m.right);
+            b.x = w - totalWidth + m.left;
+            b.y = centerY + m.top;
+            centerW -= totalWidth;
+            e.applyLayout(b);
+        }
+        if(c){
+            m = c.getMargins();
+            var centerBox = {
+                x: centerX + m.left,
+                y: centerY + m.top,
+                width: centerW - (m.left+m.right),
+                height: centerH - (m.top+m.bottom)
+            };
+            c.applyLayout(centerBox);
+        }
+        if(collapsed){
+            for(i = 0, len = collapsed.length; i < len; i++){
+                collapsed[i].collapse(false);
+            }
+        }
+        if(Ext.isIE && Ext.isStrict){ // workaround IE strict repainting issue
+            target.repaint();
+        }
+        // Putting a border layout into an overflowed container is NOT correct and will make a second layout pass necessary.
+        if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) {
+            var ts = this.getLayoutTargetSize();
+            if (ts.width != size.width || ts.height != size.height){
+                this.adjustmentPass = true;
+                this.onLayout(ct, target);
+            }
+        }
+        delete this.adjustmentPass;
+    },
+
+    destroy: function() {
+        var r = ['north', 'south', 'east', 'west'], i, region;
+        for (i = 0; i < r.length; i++) {
+            region = this[r[i]];
+            if(region){
+                if(region.destroy){
+                    region.destroy();
+                }else if (region.split){
+                    region.split.destroy(true);
+                }
+            }
+        }
+        Ext.layout.BorderLayout.superclass.destroy.call(this);
+    }
+
+    /**
+     * @property activeItem
+     * @hide
+     */
+});
+
+/**
+ * @class Ext.layout.BorderLayout.Region
+ * <p>This is a region of a {@link Ext.layout.BorderLayout BorderLayout} that acts as a subcontainer
+ * within the layout.  Each region has its own {@link Ext.layout.ContainerLayout layout} that is
+ * independent of other regions and the containing BorderLayout, and can be any of the
+ * {@link Ext.layout.ContainerLayout valid Ext layout types}.</p>
+ * <p>Region size is managed automatically and cannot be changed by the user -- for
+ * {@link #split resizable regions}, see {@link Ext.layout.BorderLayout.SplitRegion}.</p>
+ * @constructor
+ * Create a new Region.
+ * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region.
+ * @param {Object} config The configuration options
+ * @param {String} position The region position.  Valid values are: <tt>north</tt>, <tt>south</tt>,
+ * <tt>east</tt>, <tt>west</tt> and <tt>center</tt>.  Every {@link Ext.layout.BorderLayout BorderLayout}
+ * <b>must have a center region</b> for the primary content -- all other regions are optional.
+ */
+Ext.layout.BorderLayout.Region = function(layout, config, pos){
+    Ext.apply(this, config);
+    this.layout = layout;
+    this.position = pos;
+    this.state = {};
+    if(typeof this.margins == 'string'){
+        this.margins = this.layout.parseMargins(this.margins);
+    }
+    this.margins = Ext.applyIf(this.margins || {}, this.defaultMargins);
+    if(this.collapsible){
+        if(typeof this.cmargins == 'string'){
+            this.cmargins = this.layout.parseMargins(this.cmargins);
+        }
+        if(this.collapseMode == 'mini' && !this.cmargins){
+            this.cmargins = {left:0,top:0,right:0,bottom:0};
+        }else{
+            this.cmargins = Ext.applyIf(this.cmargins || {},
+                pos == 'north' || pos == 'south' ? this.defaultNSCMargins : this.defaultEWCMargins);
+        }
+    }
+};
+
+Ext.layout.BorderLayout.Region.prototype = {
+    /**
+     * @cfg {Boolean} animFloat
+     * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated
+     * panel that will close again once the user mouses out of that panel (or clicks out if
+     * <tt>{@link #autoHide} = false</tt>).  Setting <tt>{@link #animFloat} = false</tt> will
+     * prevent the open and close of these floated panels from being animated (defaults to <tt>true</tt>).
+     */
+    /**
+     * @cfg {Boolean} autoHide
+     * When a collapsed region's bar is clicked, the region's panel will be displayed as a floated
+     * panel.  If <tt>autoHide = true</tt>, the panel will automatically hide after the user mouses
+     * out of the panel.  If <tt>autoHide = false</tt>, the panel will continue to display until the
+     * user clicks outside of the panel (defaults to <tt>true</tt>).
+     */
+    /**
+     * @cfg {String} collapseMode
+     * <tt>collapseMode</tt> supports two configuration values:<div class="mdetail-params"><ul>
+     * <li><b><tt>undefined</tt></b> (default)<div class="sub-desc">By default, {@link #collapsible}
+     * regions are collapsed by clicking the expand/collapse tool button that renders into the region's
+     * title bar.</div></li>
+     * <li><b><tt>'mini'</tt></b><div class="sub-desc">Optionally, when <tt>collapseMode</tt> is set to
+     * <tt>'mini'</tt> the region's split bar will also display a small collapse button in the center of
+     * the bar. In <tt>'mini'</tt> mode the region will collapse to a thinner bar than in normal mode.
+     * </div></li>
+     * </ul></div></p>
+     * <p><b>Note</b>: if a collapsible region does not have a title bar, then set <tt>collapseMode =
+     * 'mini'</tt> and <tt>{@link #split} = true</tt> in order for the region to be {@link #collapsible}
+     * by the user as the expand/collapse tool button (that would go in the title bar) will not be rendered.</p>
+     * <p>See also <tt>{@link #cmargins}</tt>.</p>
+     */
+    /**
+     * @cfg {Object} margins
+     * An object containing margins to apply to the region when in the expanded state in the
+     * format:<pre><code>
+{
+    top: (top margin),
+    right: (right margin),
+    bottom: (bottom margin),
+    left: (left margin)
+}</code></pre>
+     * <p>May also be a string containing space-separated, numeric margin values. The order of the
+     * sides associated with each value matches the way CSS processes margin values:</p>
+     * <p><div class="mdetail-params"><ul>
+     * <li>If there is only one value, it applies to all sides.</li>
+     * <li>If there are two values, the top and bottom borders are set to the first value and the
+     * right and left are set to the second.</li>
+     * <li>If there are three values, the top is set to the first value, the left and right are set
+     * to the second, and the bottom is set to the third.</li>
+     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
+     * </ul></div></p>
+     * <p>Defaults to:</p><pre><code>
+     * {top:0, right:0, bottom:0, left:0}
+     * </code></pre>
+     */
+    /**
+     * @cfg {Object} cmargins
+     * An object containing margins to apply to the region when in the collapsed state in the
+     * format:<pre><code>
+{
+    top: (top margin),
+    right: (right margin),
+    bottom: (bottom margin),
+    left: (left margin)
+}</code></pre>
+     * <p>May also be a string containing space-separated, numeric margin values. The order of the
+     * sides associated with each value matches the way CSS processes margin values.</p>
+     * <p><ul>
+     * <li>If there is only one value, it applies to all sides.</li>
+     * <li>If there are two values, the top and bottom borders are set to the first value and the
+     * right and left are set to the second.</li>
+     * <li>If there are three values, the top is set to the first value, the left and right are set
+     * to the second, and the bottom is set to the third.</li>
+     * <li>If there are four values, they apply to the top, right, bottom, and left, respectively.</li>
+     * </ul></p>
+     */
+    /**
+     * @cfg {Boolean} collapsible
+     * <p><tt>true</tt> to allow the user to collapse this region (defaults to <tt>false</tt>).  If
+     * <tt>true</tt>, an expand/collapse tool button will automatically be rendered into the title
+     * bar of the region, otherwise the button will not be shown.</p>
+     * <p><b>Note</b>: that a title bar is required to display the collapse/expand toggle button -- if
+     * no <tt>title</tt> is specified for the region's panel, the region will only be collapsible if
+     * <tt>{@link #collapseMode} = 'mini'</tt> and <tt>{@link #split} = true</tt>.
+     */
+    collapsible : false,
+    /**
+     * @cfg {Boolean} split
+     * <p><tt>true</tt> to create a {@link Ext.layout.BorderLayout.SplitRegion SplitRegion} and
+     * display a 5px wide {@link Ext.SplitBar} between this region and its neighbor, allowing the user to
+     * resize the regions dynamically.  Defaults to <tt>false</tt> creating a
+     * {@link Ext.layout.BorderLayout.Region Region}.</p><br>
+     * <p><b>Notes</b>:</p><div class="mdetail-params"><ul>
+     * <li>this configuration option is ignored if <tt>region='center'</tt></li>
+     * <li>when <tt>split == true</tt>, it is common to specify a
+     * <tt>{@link Ext.SplitBar#minSize minSize}</tt> and <tt>{@link Ext.SplitBar#maxSize maxSize}</tt>
+     * for the {@link Ext.BoxComponent BoxComponent} representing the region. These are not native
+     * configs of {@link Ext.BoxComponent BoxComponent}, and are used only by this class.</li>
+     * <li>if <tt>{@link #collapseMode} = 'mini'</tt> requires <tt>split = true</tt> to reserve space
+     * for the collapse tool</tt></li>
+     * </ul></div>
+     */
+    split:false,
+    /**
+     * @cfg {Boolean} floatable
+     * <tt>true</tt> to allow clicking a collapsed region's bar to display the region's panel floated
+     * above the layout, <tt>false</tt> to force the user to fully expand a collapsed region by
+     * clicking the expand button to see it again (defaults to <tt>true</tt>).
+     */
+    floatable: true,
+    /**
+     * @cfg {Number} minWidth
+     * <p>The minimum allowable width in pixels for this region (defaults to <tt>50</tt>).
+     * <tt>maxWidth</tt> may also be specified.</p><br>
+     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /
+     * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified
+     * <tt>minWidth</tt> / <tt>maxWidth</tt>.</p>
+     */
+    minWidth:50,
+    /**
+     * @cfg {Number} minHeight
+     * The minimum allowable height in pixels for this region (defaults to <tt>50</tt>)
+     * <tt>maxHeight</tt> may also be specified.</p><br>
+     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /
+     * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified
+     * <tt>minHeight</tt> / <tt>maxHeight</tt>.</p>
+     */
+    minHeight:50,
+
+    // private
+    defaultMargins : {left:0,top:0,right:0,bottom:0},
+    // private
+    defaultNSCMargins : {left:5,top:5,right:5,bottom:5},
+    // private
+    defaultEWCMargins : {left:5,top:0,right:5,bottom:0},
+    floatingZIndex: 100,
+
+    /**
+     * True if this region is collapsed. Read-only.
+     * @type Boolean
+     * @property
+     */
+    isCollapsed : false,
+
+    /**
+     * This region's panel.  Read-only.
+     * @type Ext.Panel
+     * @property panel
+     */
+    /**
+     * This region's layout.  Read-only.
+     * @type Layout
+     * @property layout
+     */
+    /**
+     * This region's layout position (north, south, east, west or center).  Read-only.
+     * @type String
+     * @property position
+     */
+
+    // private
+    render : function(ct, p){
+        this.panel = p;
+        p.el.enableDisplayMode();
+        this.targetEl = ct;
+        this.el = p.el;
+
+        var gs = p.getState, ps = this.position;
+        p.getState = function(){
+            return Ext.apply(gs.call(p) || {}, this.state);
+        }.createDelegate(this);
+
+        if(ps != 'center'){
+            p.allowQueuedExpand = false;
+            p.on({
+                beforecollapse: this.beforeCollapse,
+                collapse: this.onCollapse,
+                beforeexpand: this.beforeExpand,
+                expand: this.onExpand,
+                hide: this.onHide,
+                show: this.onShow,
+                scope: this
+            });
+            if(this.collapsible || this.floatable){
+                p.collapseEl = 'el';
+                p.slideAnchor = this.getSlideAnchor();
+            }
+            if(p.tools && p.tools.toggle){
+                p.tools.toggle.addClass('x-tool-collapse-'+ps);
+                p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over');
+            }
+        }
+    },
+
+    // private
+    getCollapsedEl : function(){
+        if(!this.collapsedEl){
+            if(!this.toolTemplate){
+                var tt = new Ext.Template(
+                     '<div class="x-tool x-tool-{id}">&#160;</div>'
+                );
+                tt.disableFormats = true;
+                tt.compile();
+                Ext.layout.BorderLayout.Region.prototype.toolTemplate = tt;
+            }
+            this.collapsedEl = this.targetEl.createChild({
+                cls: "x-layout-collapsed x-layout-collapsed-"+this.position,
+                id: this.panel.id + '-xcollapsed'
+            });
+            this.collapsedEl.enableDisplayMode('block');
+
+            if(this.collapseMode == 'mini'){
+                this.collapsedEl.addClass('x-layout-cmini-'+this.position);
+                this.miniCollapsedEl = this.collapsedEl.createChild({
+                    cls: "x-layout-mini x-layout-mini-"+this.position, html: "&#160;"
+                });
+                this.miniCollapsedEl.addClassOnOver('x-layout-mini-over');
+                this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
+                this.collapsedEl.on('click', this.onExpandClick, this, {stopEvent:true});
+            }else {
+                if(this.collapsible !== false && !this.hideCollapseTool) {
+                    var t = this.toolTemplate.append(
+                            this.collapsedEl.dom,
+                            {id:'expand-'+this.position}, true);
+                    t.addClassOnOver('x-tool-expand-'+this.position+'-over');
+                    t.on('click', this.onExpandClick, this, {stopEvent:true});
+                }
+                if(this.floatable !== false || this.titleCollapse){
+                   this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
+                   this.collapsedEl.on("click", this[this.floatable ? 'collapseClick' : 'onExpandClick'], this);
+                }
+            }
+        }
+        return this.collapsedEl;
+    },
+
+    // private
+    onExpandClick : function(e){
+        if(this.isSlid){
+            this.panel.expand(false);
+        }else{
+            this.panel.expand();
+        }
+    },
+
+    // private
+    onCollapseClick : function(e){
+        this.panel.collapse();
+    },
+
+    // private
+    beforeCollapse : function(p, animate){
+        this.lastAnim = animate;
+        if(this.splitEl){
+            this.splitEl.hide();
+        }
+        this.getCollapsedEl().show();
+        var el = this.panel.getEl();
+        this.originalZIndex = el.getStyle('z-index');
+        el.setStyle('z-index', 100);
+        this.isCollapsed = true;
+        this.layout.layout();
+    },
+
+    // private
+    onCollapse : function(animate){
+        this.panel.el.setStyle('z-index', 1);
+        if(this.lastAnim === false || this.panel.animCollapse === false){
+            this.getCollapsedEl().dom.style.visibility = 'visible';
+        }else{
+            this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2});
+        }
+        this.state.collapsed = true;
+        this.panel.saveState();
+    },
+
+    // private
+    beforeExpand : function(animate){
+        if(this.isSlid){
+            this.afterSlideIn();
+        }
+        var c = this.getCollapsedEl();
+        this.el.show();
+        if(this.position == 'east' || this.position == 'west'){
+            this.panel.setSize(undefined, c.getHeight());
+        }else{
+            this.panel.setSize(c.getWidth(), undefined);
+        }
+        c.hide();
+        c.dom.style.visibility = 'hidden';
+        this.panel.el.setStyle('z-index', this.floatingZIndex);
+    },
+
+    // private
+    onExpand : function(){
+        this.isCollapsed = false;
+        if(this.splitEl){
+            this.splitEl.show();
+        }
+        this.layout.layout();
+        this.panel.el.setStyle('z-index', this.originalZIndex);
+        this.state.collapsed = false;
+        this.panel.saveState();
+    },
+
+    // private
+    collapseClick : function(e){
+        if(this.isSlid){
+           e.stopPropagation();
+           this.slideIn();
+        }else{
+           e.stopPropagation();
+           this.slideOut();
+        }
+    },
+
+    // private
+    onHide : function(){
+        if(this.isCollapsed){
+            this.getCollapsedEl().hide();
+        }else if(this.splitEl){
+            this.splitEl.hide();
+        }
+    },
+
+    // private
+    onShow : function(){
+        if(this.isCollapsed){
+            this.getCollapsedEl().show();
+        }else if(this.splitEl){
+            this.splitEl.show();
+        }
+    },
+
+    /**
+     * True if this region is currently visible, else false.
+     * @return {Boolean}
+     */
+    isVisible : function(){
+        return !this.panel.hidden;
+    },
+
+    /**
+     * Returns the current margins for this region.  If the region is collapsed, the
+     * {@link #cmargins} (collapsed margins) value will be returned, otherwise the
+     * {@link #margins} value will be returned.
+     * @return {Object} An object containing the element's margins: <tt>{left: (left
+     * margin), top: (top margin), right: (right margin), bottom: (bottom margin)}</tt>
+     */
+    getMargins : function(){
+        return this.isCollapsed && this.cmargins ? this.cmargins : this.margins;
+    },
+
+    /**
+     * Returns the current size of this region.  If the region is collapsed, the size of the
+     * collapsedEl will be returned, otherwise the size of the region's panel will be returned.
+     * @return {Object} An object containing the element's size: <tt>{width: (element width),
+     * height: (element height)}</tt>
+     */
+    getSize : function(){
+        return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize();
+    },
+
+    /**
+     * Sets the specified panel as the container element for this region.
+     * @param {Ext.Panel} panel The new panel
+     */
+    setPanel : function(panel){
+        this.panel = panel;
+    },
+
+    /**
+     * Returns the minimum allowable width for this region.
+     * @return {Number} The minimum width
+     */
+    getMinWidth: function(){
+        return this.minWidth;
+    },
+
+    /**
+     * Returns the minimum allowable height for this region.
+     * @return {Number} The minimum height
+     */
+    getMinHeight: function(){
+        return this.minHeight;
+    },
+
+    // private
+    applyLayoutCollapsed : function(box){
+        var ce = this.getCollapsedEl();
+        ce.setLeftTop(box.x, box.y);
+        ce.setSize(box.width, box.height);
+    },
+
+    // private
+    applyLayout : function(box){
+        if(this.isCollapsed){
+            this.applyLayoutCollapsed(box);
+        }else{
+            this.panel.setPosition(box.x, box.y);
+            this.panel.setSize(box.width, box.height);
+        }
+    },
+
+    // private
+    beforeSlide: function(){
+        this.panel.beforeEffect();
+    },
+
+    // private
+    afterSlide : function(){
+        this.panel.afterEffect();
+    },
+
+    // private
+    initAutoHide : function(){
+        if(this.autoHide !== false){
+            if(!this.autoHideHd){
+                var st = new Ext.util.DelayedTask(this.slideIn, this);
+                this.autoHideHd = {
+                    "mouseout": function(e){
+                        if(!e.within(this.el, true)){
+                            st.delay(500);
+                        }
+                    },
+                    "mouseover" : function(e){
+                        st.cancel();
+                    },
+                    scope : this
+                };
+            }
+            this.el.on(this.autoHideHd);
+            this.collapsedEl.on(this.autoHideHd);
+        }
+    },
+
+    // private
+    clearAutoHide : function(){
+        if(this.autoHide !== false){
+            this.el.un("mouseout", this.autoHideHd.mouseout);
+            this.el.un("mouseover", this.autoHideHd.mouseover);
+            this.collapsedEl.un("mouseout", this.autoHideHd.mouseout);
+            this.collapsedEl.un("mouseover", this.autoHideHd.mouseover);
+        }
+    },
+
+    // private
+    clearMonitor : function(){
+        Ext.getDoc().un("click", this.slideInIf, this);
+    },
+
+    /**
+     * If this Region is {@link #floatable}, this method slides this Region into full visibility <i>over the top
+     * of the center Region</i> where it floats until either {@link #slideIn} is called, or other regions of the layout
+     * are clicked, or the mouse exits the Region.
+     */
+    slideOut : function(){
+        if(this.isSlid || this.el.hasActiveFx()){
+            return;
+        }
+        this.isSlid = true;
+        var ts = this.panel.tools, dh, pc;
+        if(ts && ts.toggle){
+            ts.toggle.hide();
+        }
+        this.el.show();
+
+        // Temporarily clear the collapsed flag so we can onResize the panel on the slide
+        pc = this.panel.collapsed;
+        this.panel.collapsed = false;
+
+        if(this.position == 'east' || this.position == 'west'){
+            // Temporarily clear the deferHeight flag so we can size the height on the slide
+            dh = this.panel.deferHeight;
+            this.panel.deferHeight = false;
+
+            this.panel.setSize(undefined, this.collapsedEl.getHeight());
+
+            // Put the deferHeight flag back after setSize
+            this.panel.deferHeight = dh;
+        }else{
+            this.panel.setSize(this.collapsedEl.getWidth(), undefined);
+        }
+
+        // Put the collapsed flag back after onResize
+        this.panel.collapsed = pc;
+
+        this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top];
+        this.el.alignTo(this.collapsedEl, this.getCollapseAnchor());
+        this.el.setStyle("z-index", this.floatingZIndex+2);
+        this.panel.el.replaceClass('x-panel-collapsed', 'x-panel-floating');
+        if(this.animFloat !== false){
+            this.beforeSlide();
+            this.el.slideIn(this.getSlideAnchor(), {
+                callback: function(){
+                    this.afterSlide();
+                    this.initAutoHide();
+                    Ext.getDoc().on("click", this.slideInIf, this);
+                },
+                scope: this,
+                block: true
+            });
+        }else{
+            this.initAutoHide();
+             Ext.getDoc().on("click", this.slideInIf, this);
+        }
+    },
+
+    // private
+    afterSlideIn : function(){
+        this.clearAutoHide();
+        this.isSlid = false;
+        this.clearMonitor();
+        this.el.setStyle("z-index", "");
+        this.panel.el.replaceClass('x-panel-floating', 'x-panel-collapsed');
+        this.el.dom.style.left = this.restoreLT[0];
+        this.el.dom.style.top = this.restoreLT[1];
+
+        var ts = this.panel.tools;
+        if(ts && ts.toggle){
+            ts.toggle.show();
+        }
+    },
+
+    /**
+     * If this Region is {@link #floatable}, and this Region has been slid into floating visibility, then this method slides
+     * this region back into its collapsed state.
+     */
+    slideIn : function(cb){
+        if(!this.isSlid || this.el.hasActiveFx()){
+            Ext.callback(cb);
+            return;
+        }
+        this.isSlid = false;
+        if(this.animFloat !== false){
+            this.beforeSlide();
+            this.el.slideOut(this.getSlideAnchor(), {
+                callback: function(){
+                    this.el.hide();
+                    this.afterSlide();
+                    this.afterSlideIn();
+                    Ext.callback(cb);
+                },
+                scope: this,
+                block: true
+            });
+        }else{
+            this.el.hide();
+            this.afterSlideIn();
+        }
+    },
+
+    // private
+    slideInIf : function(e){
+        if(!e.within(this.el)){
+            this.slideIn();
+        }
+    },
+
+    // private
+    anchors : {
+        "west" : "left",
+        "east" : "right",
+        "north" : "top",
+        "south" : "bottom"
+    },
+
+    // private
+    sanchors : {
+        "west" : "l",
+        "east" : "r",
+        "north" : "t",
+        "south" : "b"
+    },
+
+    // private
+    canchors : {
+        "west" : "tl-tr",
+        "east" : "tr-tl",
+        "north" : "tl-bl",
+        "south" : "bl-tl"
+    },
+
+    // private
+    getAnchor : function(){
+        return this.anchors[this.position];
+    },
+
+    // private
+    getCollapseAnchor : function(){
+        return this.canchors[this.position];
+    },
+
+    // private
+    getSlideAnchor : function(){
+        return this.sanchors[this.position];
+    },
+
+    // private
+    getAlignAdj : function(){
+        var cm = this.cmargins;
+        switch(this.position){
+            case "west":
+                return [0, 0];
+            break;
+            case "east":
+                return [0, 0];
+            break;
+            case "north":
+                return [0, 0];
+            break;
+            case "south":
+                return [0, 0];
+            break;
+        }
+    },
+
+    // private
+    getExpandAdj : function(){
+        var c = this.collapsedEl, cm = this.cmargins;
+        switch(this.position){
+            case "west":
+                return [-(cm.right+c.getWidth()+cm.left), 0];
+            break;
+            case "east":
+                return [cm.right+c.getWidth()+cm.left, 0];
+            break;
+            case "north":
+                return [0, -(cm.top+cm.bottom+c.getHeight())];
+            break;
+            case "south":
+                return [0, cm.top+cm.bottom+c.getHeight()];
+            break;
+        }
+    },
+
+    destroy : function(){
+        Ext.destroy(this.miniCollapsedEl, this.collapsedEl);
+    }
+};
+
+/**
+ * @class Ext.layout.BorderLayout.SplitRegion
+ * @extends Ext.layout.BorderLayout.Region
+ * <p>This is a specialized type of {@link Ext.layout.BorderLayout.Region BorderLayout region} that
+ * has a built-in {@link Ext.SplitBar} for user resizing of regions.  The movement of the split bar
+ * is configurable to move either {@link #tickSize smooth or incrementally}.</p>
+ * @constructor
+ * Create a new SplitRegion.
+ * @param {Layout} layout The {@link Ext.layout.BorderLayout BorderLayout} instance that is managing this Region.
+ * @param {Object} config The configuration options
+ * @param {String} position The region position.  Valid values are: north, south, east, west and center.  Every
+ * BorderLayout must have a center region for the primary content -- all other regions are optional.
+ */
+Ext.layout.BorderLayout.SplitRegion = function(layout, config, pos){
+    Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this, layout, config, pos);
+    // prevent switch
+    this.applyLayout = this.applyFns[pos];
+};
+
+Ext.extend(Ext.layout.BorderLayout.SplitRegion, Ext.layout.BorderLayout.Region, {
+    /**
+     * @cfg {Number} tickSize
+     * The increment, in pixels by which to move this Region's {@link Ext.SplitBar SplitBar}.
+     * By default, the {@link Ext.SplitBar SplitBar} moves smoothly.
+     */
+    /**
+     * @cfg {String} splitTip
+     * The tooltip to display when the user hovers over a
+     * {@link Ext.layout.BorderLayout.Region#collapsible non-collapsible} region's split bar
+     * (defaults to <tt>"Drag to resize."</tt>).  Only applies if
+     * <tt>{@link #useSplitTips} = true</tt>.
+     */
+    splitTip : "Drag to resize.",
+    /**
+     * @cfg {String} collapsibleSplitTip
+     * The tooltip to display when the user hovers over a
+     * {@link Ext.layout.BorderLayout.Region#collapsible collapsible} region's split bar
+     * (defaults to "Drag to resize. Double click to hide."). Only applies if
+     * <tt>{@link #useSplitTips} = true</tt>.
+     */
+    collapsibleSplitTip : "Drag to resize. Double click to hide.",
+    /**
+     * @cfg {Boolean} useSplitTips
+     * <tt>true</tt> to display a tooltip when the user hovers over a region's split bar
+     * (defaults to <tt>false</tt>).  The tooltip text will be the value of either
+     * <tt>{@link #splitTip}</tt> or <tt>{@link #collapsibleSplitTip}</tt> as appropriate.
+     */
+    useSplitTips : false,
+
+    // private
+    splitSettings : {
+        north : {
+            orientation: Ext.SplitBar.VERTICAL,
+            placement: Ext.SplitBar.TOP,
+            maxFn : 'getVMaxSize',
+            minProp: 'minHeight',
+            maxProp: 'maxHeight'
+        },
+        south : {
+            orientation: Ext.SplitBar.VERTICAL,
+            placement: Ext.SplitBar.BOTTOM,
+            maxFn : 'getVMaxSize',
+            minProp: 'minHeight',
+            maxProp: 'maxHeight'
+        },
+        east : {
+            orientation: Ext.SplitBar.HORIZONTAL,
+            placement: Ext.SplitBar.RIGHT,
+            maxFn : 'getHMaxSize',
+            minProp: 'minWidth',
+            maxProp: 'maxWidth'
+        },
+        west : {
+            orientation: Ext.SplitBar.HORIZONTAL,
+            placement: Ext.SplitBar.LEFT,
+            maxFn : 'getHMaxSize',
+            minProp: 'minWidth',
+            maxProp: 'maxWidth'
+        }
+    },
+
+    // private
+    applyFns : {
+        west : function(box){
+            if(this.isCollapsed){
+                return this.applyLayoutCollapsed(box);
+            }
+            var sd = this.splitEl.dom, s = sd.style;
+            this.panel.setPosition(box.x, box.y);
+            var sw = sd.offsetWidth;
+            s.left = (box.x+box.width-sw)+'px';
+            s.top = (box.y)+'px';
+            s.height = Math.max(0, box.height)+'px';
+            this.panel.setSize(box.width-sw, box.height);
+        },
+        east : function(box){
+            if(this.isCollapsed){
+                return this.applyLayoutCollapsed(box);
+            }
+            var sd = this.splitEl.dom, s = sd.style;
+            var sw = sd.offsetWidth;
+            this.panel.setPosition(box.x+sw, box.y);
+            s.left = (box.x)+'px';
+            s.top = (box.y)+'px';
+            s.height = Math.max(0, box.height)+'px';
+            this.panel.setSize(box.width-sw, box.height);
+        },
+        north : function(box){
+            if(this.isCollapsed){
+                return this.applyLayoutCollapsed(box);
+            }
+            var sd = this.splitEl.dom, s = sd.style;
+            var sh = sd.offsetHeight;
+            this.panel.setPosition(box.x, box.y);
+            s.left = (box.x)+'px';
+            s.top = (box.y+box.height-sh)+'px';
+            s.width = Math.max(0, box.width)+'px';
+            this.panel.setSize(box.width, box.height-sh);
+        },
+        south : function(box){
+            if(this.isCollapsed){
+                return this.applyLayoutCollapsed(box);
+            }
+            var sd = this.splitEl.dom, s = sd.style;
+            var sh = sd.offsetHeight;
+            this.panel.setPosition(box.x, box.y+sh);
+            s.left = (box.x)+'px';
+            s.top = (box.y)+'px';
+            s.width = Math.max(0, box.width)+'px';
+            this.panel.setSize(box.width, box.height-sh);
+        }
+    },
+
+    // private
+    render : function(ct, p){
+        Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this, ct, p);
+
+        var ps = this.position;
+
+        this.splitEl = ct.createChild({
+            cls: "x-layout-split x-layout-split-"+ps, html: "&#160;",
+            id: this.panel.id + '-xsplit'
+        });
+
+        if(this.collapseMode == 'mini'){
+            this.miniSplitEl = this.splitEl.createChild({
+                cls: "x-layout-mini x-layout-mini-"+ps, html: "&#160;"
+            });
+            this.miniSplitEl.addClassOnOver('x-layout-mini-over');
+            this.miniSplitEl.on('click', this.onCollapseClick, this, {stopEvent:true});
+        }
+
+        var s = this.splitSettings[ps];
+
+        this.split = new Ext.SplitBar(this.splitEl.dom, p.el, s.orientation);
+        this.split.tickSize = this.tickSize;
+        this.split.placement = s.placement;
+        this.split.getMaximumSize = this[s.maxFn].createDelegate(this);
+        this.split.minSize = this.minSize || this[s.minProp];
+        this.split.on("beforeapply", this.onSplitMove, this);
+        this.split.useShim = this.useShim === true;
+        this.maxSize = this.maxSize || this[s.maxProp];
+
+        if(p.hidden){
+            this.splitEl.hide();
+        }
+
+        if(this.useSplitTips){
+            this.splitEl.dom.title = this.collapsible ? this.collapsibleSplitTip : this.splitTip;
+        }
+        if(this.collapsible){
+            this.splitEl.on("dblclick", this.onCollapseClick,  this);
+        }
+    },
+
+    //docs inherit from superclass
+    getSize : function(){
+        if(this.isCollapsed){
+            return this.collapsedEl.getSize();
+        }
+        var s = this.panel.getSize();
+        if(this.position == 'north' || this.position == 'south'){
+            s.height += this.splitEl.dom.offsetHeight;
+        }else{
+            s.width += this.splitEl.dom.offsetWidth;
+        }
+        return s;
+    },
+
+    // private
+    getHMaxSize : function(){
+         var cmax = this.maxSize || 10000;
+         var center = this.layout.center;
+         return Math.min(cmax, (this.el.getWidth()+center.el.getWidth())-center.getMinWidth());
+    },
+
+    // private
+    getVMaxSize : function(){
+        var cmax = this.maxSize || 10000;
+        var center = this.layout.center;
+        return Math.min(cmax, (this.el.getHeight()+center.el.getHeight())-center.getMinHeight());
+    },
+
+    // private
+    onSplitMove : function(split, newSize){
+        var s = this.panel.getSize();
+        this.lastSplitSize = newSize;
+        if(this.position == 'north' || this.position == 'south'){
+            this.panel.setSize(s.width, newSize);
+            this.state.height = newSize;
+        }else{
+            this.panel.setSize(newSize, s.height);
+            this.state.width = newSize;
+        }
+        this.layout.layout();
+        this.panel.saveState();
+        return false;
+    },
+
+    /**
+     * Returns a reference to the split bar in use by this region.
+     * @return {Ext.SplitBar} The split bar
+     */
+    getSplitBar : function(){
+        return this.split;
+    },
+
+    // inherit docs
+    destroy : function() {
+        Ext.destroy(this.miniSplitEl, this.split, this.splitEl);
+        Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this);
+    }
+});
+
+Ext.Container.LAYOUTS['border'] = Ext.layout.BorderLayout;/**
+ * @class Ext.layout.FormLayout
+ * @extends Ext.layout.AnchorLayout
+ * <p>This layout manager is specifically designed for rendering and managing child Components of
+ * {@link Ext.form.FormPanel forms}. It is responsible for rendering the labels of
+ * {@link Ext.form.Field Field}s.</p>
+ *
+ * <p>This layout manager is used when a Container is configured with the <tt>layout:'form'</tt>
+ * {@link Ext.Container#layout layout} config option, and should generally not need to be created directly
+ * via the new keyword. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
+ *
+ * <p>In an application, it will usually be preferrable to use a {@link Ext.form.FormPanel FormPanel}
+ * (which is configured with FormLayout as its layout class by default) since it also provides built-in
+ * functionality for {@link Ext.form.BasicForm#doAction loading, validating and submitting} the form.</p>
+ *
+ * <p>A {@link Ext.Container Container} <i>using</i> the FormLayout layout manager (e.g.
+ * {@link Ext.form.FormPanel} or specifying <tt>layout:'form'</tt>) can also accept the following
+ * layout-specific config properties:<div class="mdetail-params"><ul>
+ * <li><b><tt>{@link Ext.form.FormPanel#hideLabels hideLabels}</tt></b></li>
+ * <li><b><tt>{@link Ext.form.FormPanel#labelAlign labelAlign}</tt></b></li>
+ * <li><b><tt>{@link Ext.form.FormPanel#labelPad labelPad}</tt></b></li>
+ * <li><b><tt>{@link Ext.form.FormPanel#labelSeparator labelSeparator}</tt></b></li>
+ * <li><b><tt>{@link Ext.form.FormPanel#labelWidth labelWidth}</tt></b></li>
+ * </ul></div></p>
+ *
+ * <p>Any Component (including Fields) managed by FormLayout accepts the following as a config option:
+ * <div class="mdetail-params"><ul>
+ * <li><b><tt>{@link Ext.Component#anchor anchor}</tt></b></li>
+ * </ul></div></p>
+ *
+ * <p>Any Component managed by FormLayout may be rendered as a form field (with an associated label) by
+ * configuring it with a non-null <b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b>. Components configured
+ * in this way may be configured with the following options which affect the way the FormLayout renders them:
+ * <div class="mdetail-params"><ul>
+ * <li><b><tt>{@link Ext.Component#clearCls clearCls}</tt></b></li>
+ * <li><b><tt>{@link Ext.Component#fieldLabel fieldLabel}</tt></b></li>
+ * <li><b><tt>{@link Ext.Component#hideLabel hideLabel}</tt></b></li>
+ * <li><b><tt>{@link Ext.Component#itemCls itemCls}</tt></b></li>
+ * <li><b><tt>{@link Ext.Component#labelSeparator labelSeparator}</tt></b></li>
+ * <li><b><tt>{@link Ext.Component#labelStyle labelStyle}</tt></b></li>
+ * </ul></div></p>
+ *
+ * <p>Example usage:</p>
+ * <pre><code>
+// Required if showing validation messages
+Ext.QuickTips.init();
+
+// While you can create a basic Panel with layout:'form', practically
+// you should usually use a FormPanel to also get its form functionality
+// since it already creates a FormLayout internally.
+var form = new Ext.form.FormPanel({
+    title: 'Form Layout',
+    bodyStyle: 'padding:15px',
+    width: 350,
+    defaultType: 'textfield',
+    defaults: {
+        // applied to each contained item
+        width: 230,
+        msgTarget: 'side'
+    },
+    items: [{
+            fieldLabel: 'First Name',
+            name: 'first',
+            allowBlank: false,
+            {@link Ext.Component#labelSeparator labelSeparator}: ':' // override labelSeparator layout config
+        },{
+            fieldLabel: 'Last Name',
+            name: 'last'
+        },{
+            fieldLabel: 'Email',
+            name: 'email',
+            vtype:'email'
+        }, {
+            xtype: 'textarea',
+            hideLabel: true,     // override hideLabels layout config
+            name: 'msg',
+            anchor: '100% -53'
+        }
+    ],
+    buttons: [
+        {text: 'Save'},
+        {text: 'Cancel'}
+    ],
+    layoutConfig: {
+        {@link #labelSeparator}: '~' // superseded by assignment below
+    },
+    // config options applicable to container when layout='form':
+    hideLabels: false,
+    labelAlign: 'left',   // or 'right' or 'top'
+    {@link Ext.form.FormPanel#labelSeparator labelSeparator}: '>>', // takes precedence over layoutConfig value
+    labelWidth: 65,       // defaults to 100
+    labelPad: 8           // defaults to 5, must specify labelWidth to be honored
+});
+</code></pre>
+ */
+Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, {
+
+    /**
+     * @cfg {String} labelSeparator
+     * See {@link Ext.form.FormPanel}.{@link Ext.form.FormPanel#labelSeparator labelSeparator}.  Configuration
+     * of this property at the <b>container</b> level takes precedence.
+     */
+    labelSeparator : ':',
+
+    /**
+     * Read only. The CSS style specification string added to field labels in this layout if not
+     * otherwise {@link Ext.Component#labelStyle specified by each contained field}.
+     * @type String
+     * @property labelStyle
+     */
+
+    /**
+     * @cfg {Boolean} trackLabels
+     * True to show/hide the field label when the field is hidden. Defaults to <tt>false</tt>.
+     */
+    trackLabels: false,
+
+    type: 'form',
+
+
+    onRemove: function(c){
+        Ext.layout.FormLayout.superclass.onRemove.call(this, c);
+        if(this.trackLabels){
+            c.un('show', this.onFieldShow, this);
+            c.un('hide', this.onFieldHide, this);
+        }
+        // check for itemCt, since we may be removing a fieldset or something similar
+        var el = c.getPositionEl(),
+                ct = c.getItemCt && c.getItemCt();
+        if(c.rendered && ct){
+            if (el && el.dom) {
+                el.insertAfter(ct);
+            }
+            Ext.destroy(ct);
+            Ext.destroyMembers(c, 'label', 'itemCt');
+            if(c.customItemCt){
+                Ext.destroyMembers(c, 'getItemCt', 'customItemCt');
+            }
+        }
+    },
+
+    // private
+    setContainer : function(ct){
+        Ext.layout.FormLayout.superclass.setContainer.call(this, ct);
+        if(ct.labelAlign){
+            ct.addClass('x-form-label-'+ct.labelAlign);
+        }
+
+        if(ct.hideLabels){
+            Ext.apply(this, {
+                labelStyle: 'display:none',
+                elementStyle: 'padding-left:0;',
+                labelAdjust: 0
+            });
+        }else{
+            this.labelSeparator = ct.labelSeparator || this.labelSeparator;
+            ct.labelWidth = ct.labelWidth || 100;
+            if(Ext.isNumber(ct.labelWidth)){
+                var pad = Ext.isNumber(ct.labelPad) ? ct.labelPad : 5;
+                Ext.apply(this, {
+                    labelAdjust: ct.labelWidth + pad,
+                    labelStyle: 'width:' + ct.labelWidth + 'px;',
+                    elementStyle: 'padding-left:' + (ct.labelWidth + pad) + 'px'
+                });
+            }
+            if(ct.labelAlign == 'top'){
+                Ext.apply(this, {
+                    labelStyle: 'width:auto;',
+                    labelAdjust: 0,
+                    elementStyle: 'padding-left:0;'
+                });
+            }
+        }
+    },
+
+    // private
+    isHide: function(c){
+        return c.hideLabel || this.container.hideLabels;
+    },
+
+    onFieldShow: function(c){
+        c.getItemCt().removeClass('x-hide-' + c.hideMode);
+    },
+
+    onFieldHide: function(c){
+        c.getItemCt().addClass('x-hide-' + c.hideMode);
+    },
+
+    //private
+    getLabelStyle: function(s){
+        var ls = '', items = [this.labelStyle, s];
+        for (var i = 0, len = items.length; i < len; ++i){
+            if (items[i]){
+                ls += items[i];
+                if (ls.substr(-1, 1) != ';'){
+                    ls += ';'
+                }
+            }
+        }
+        return ls;
+    },
+
+    /**
+     * @cfg {Ext.Template} fieldTpl
+     * A {@link Ext.Template#compile compile}d {@link Ext.Template} for rendering
+     * the fully wrapped, labeled and styled form Field. Defaults to:</p><pre><code>
+new Ext.Template(
+    &#39;&lt;div class="x-form-item {itemCls}" tabIndex="-1">&#39;,
+        &#39;&lt;&#108;abel for="{id}" style="{labelStyle}" class="x-form-item-&#108;abel">{&#108;abel}{labelSeparator}&lt;/&#108;abel>&#39;,
+        &#39;&lt;div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">&#39;,
+        &#39;&lt;/div>&lt;div class="{clearCls}">&lt;/div>&#39;,
+    '&lt;/div>'
+);
+</code></pre>
+     * <p>This may be specified to produce a different DOM structure when rendering form Fields.</p>
+     * <p>A description of the properties within the template follows:</p><div class="mdetail-params"><ul>
+     * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
+     * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
+     * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
+     * supplied at the container level.</div></li>
+     * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
+     * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
+     * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
+     * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
+     * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
+     * field (defaults to <tt>''</tt>)</div></li>
+     * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
+     * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
+     * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
+     * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
+     * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
+     * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
+     * </ul></div>
+     * <p>Also see <tt>{@link #getTemplateArgs}</tt></p>
+     */
+
+    // private
+    renderItem : function(c, position, target){
+        if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
+            var args = this.getTemplateArgs(c);
+            if(Ext.isNumber(position)){
+                position = target.dom.childNodes[position] || null;
+            }
+            if(position){
+                c.itemCt = this.fieldTpl.insertBefore(position, args, true);
+            }else{
+                c.itemCt = this.fieldTpl.append(target, args, true);
+            }
+            if(!c.getItemCt){
+                // Non form fields don't have getItemCt, apply it here
+                // This will get cleaned up in onRemove
+                Ext.apply(c, {
+                    getItemCt: function(){
+                        return c.itemCt;
+                    },
+                    customItemCt: true
+                });
+            }
+            c.label = c.getItemCt().child('label.x-form-item-label');
+            if(!c.rendered){
+                c.render('x-form-el-' + c.id);
+            }else if(!this.isValidParent(c, target)){
+                Ext.fly('x-form-el-' + c.id).appendChild(c.getPositionEl());
+            }
+            if(this.trackLabels){
+                if(c.hidden){
+                    this.onFieldHide(c);
+                }
+                c.on({
+                    scope: this,
+                    show: this.onFieldShow,
+                    hide: this.onFieldHide
+                });
+            }
+            this.configureItem(c);
+        }else {
+            Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
+        }
+    },
+
+    /**
+     * <p>Provides template arguments for rendering the fully wrapped, labeled and styled form Field.</p>
+     * <p>This method returns an object hash containing properties used by the layout's {@link #fieldTpl}
+     * to create a correctly wrapped, labeled and styled form Field. This may be overriden to
+     * create custom layouts. The properties which must be returned are:</p><div class="mdetail-params"><ul>
+     * <li><b><tt>itemCls</tt></b> : String<div class="sub-desc">The CSS class applied to the outermost div wrapper
+     * that contains this field label and field element (the default class is <tt>'x-form-item'</tt> and <tt>itemCls</tt>
+     * will be added to that). If supplied, <tt>itemCls</tt> at the field level will override the default <tt>itemCls</tt>
+     * supplied at the container level.</div></li>
+     * <li><b><tt>id</tt></b> : String<div class="sub-desc">The id of the Field</div></li>
+     * <li><b><tt>{@link #labelStyle}</tt></b> : String<div class="sub-desc">
+     * A CSS style specification string to add to the field label for this field (defaults to <tt>''</tt> or the
+     * {@link #labelStyle layout's value for <tt>labelStyle</tt>}).</div></li>
+     * <li><b><tt>label</tt></b> : String<div class="sub-desc">The text to display as the label for this
+     * field (defaults to <tt>''</tt>)</div></li>
+     * <li><b><tt>{@link #labelSeparator}</tt></b> : String<div class="sub-desc">The separator to display after
+     * the text of the label for this field (defaults to a colon <tt>':'</tt> or the
+     * {@link #labelSeparator layout's value for labelSeparator}). To hide the separator use empty string ''.</div></li>
+     * <li><b><tt>elementStyle</tt></b> : String<div class="sub-desc">The styles text for the input element's wrapper.</div></li>
+     * <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
+     * rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
+     * </ul></div>
+     * @param (Ext.form.Field} field The {@link Ext.form.Field Field} being rendered.
+     * @return An object hash containing the properties required to render the Field.
+     */
+    getTemplateArgs: function(field) {
+        var noLabelSep = !field.fieldLabel || field.hideLabel;
+        return {
+            id: field.id,
+            label: field.fieldLabel,
+            labelStyle: this.getLabelStyle(field.labelStyle),
+            elementStyle: this.elementStyle||'',
+            labelSeparator: noLabelSep ? '' : (Ext.isDefined(field.labelSeparator) ? field.labelSeparator : this.labelSeparator),
+            itemCls: (field.itemCls||this.container.itemCls||'') + (field.hideLabel ? ' x-hide-label' : ''),
+            clearCls: field.clearCls || 'x-form-clear-left'
+        };
+    },
+
+    // private
+    adjustWidthAnchor: function(value, c){
+        if(c.label && !this.isHide(c) && (this.container.labelAlign != 'top')){
+            var adjust = Ext.isIE6 || (Ext.isIE && !Ext.isStrict);
+            return value - this.labelAdjust + (adjust ? -3 : 0);
+        }
+        return value;
+    },
+
+    adjustHeightAnchor : function(value, c){
+        if(c.label && !this.isHide(c) && (this.container.labelAlign == 'top')){
+            return value - c.label.getHeight();
+        }
+        return value;
+    },
+
+    // private
+    isValidParent : function(c, target){
+        return target && this.container.getEl().contains(c.getPositionEl());
+    }
+
+    /**
+     * @property activeItem
+     * @hide
+     */
+});
+
+Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout;
+/**\r
+ * @class Ext.layout.AccordionLayout\r
+ * @extends Ext.layout.FitLayout\r
+ * <p>This is a layout that manages multiple Panels in an expandable accordion style such that only\r
+ * <b>one Panel can be expanded at any given time</b>. Each Panel has built-in support for expanding and collapsing.</p>\r
+ * <p>Note: Only Ext.Panels <b>and all subclasses of Ext.Panel</b> may be used in an accordion layout Container.</p>\r
+ * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>\r
+ * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>\r
+ * <p>Example usage:</p>\r
+ * <pre><code>\r
+var accordion = new Ext.Panel({\r
+    title: 'Accordion Layout',\r
+    layout:'accordion',\r
+    defaults: {\r
+        // applied to each contained panel\r
+        bodyStyle: 'padding:15px'\r
     },\r
-\r
-    /**\r
-     * Causes the proxy to return to its position of origin via an animation.  Should be called after an\r
-     * invalid drop operation by the item being dragged.\r
-     * @param {Array} xy The XY position of the element ([x, y])\r
-     * @param {Function} callback The function to call after the repair is complete\r
-     * @param {Object} scope The scope in which to execute the callback\r
-     */\r
-    repair : function(xy, callback, scope){\r
-        this.callback = callback;\r
-        this.scope = scope;\r
-        if(xy && this.animRepair !== false){\r
-            this.el.addClass("x-dd-drag-repair");\r
-            this.el.hideUnders(true);\r
-            this.anim = this.el.shift({\r
-                duration: this.repairDuration || .5,\r
-                easing: 'easeOut',\r
-                xy: xy,\r
-                stopFx: true,\r
-                callback: this.afterRepair,\r
-                scope: this\r
-            });\r
-        }else{\r
-            this.afterRepair();\r
-        }\r
+    layoutConfig: {\r
+        // layout-specific configs go here\r
+        titleCollapse: false,\r
+        animate: true,\r
+        activeOnTop: true\r
     },\r
-\r
-    // private\r
-    afterRepair : function(){\r
-        this.hide(true);\r
-        if(typeof this.callback == "function"){\r
-            this.callback.call(this.scope || this);\r
-        }\r
-        this.callback = null;\r
-        this.scope = null;\r
-    }\r
-};/**\r
- * @class Ext.dd.DragSource\r
- * @extends Ext.dd.DDProxy\r
- * A simple class that provides the basic implementation needed to make any element draggable.\r
- * @constructor\r
- * @param {Mixed} el The container element\r
- * @param {Object} config\r
+    items: [{\r
+        title: 'Panel 1',\r
+        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
+    },{\r
+        title: 'Panel 2',\r
+        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
+    },{\r
+        title: 'Panel 3',\r
+        html: '&lt;p&gt;Panel content!&lt;/p&gt;'\r
+    }]\r
+});\r
+</code></pre>\r
  */\r
-Ext.dd.DragSource = function(el, config){\r
-    this.el = Ext.get(el);\r
-    if(!this.dragData){\r
-        this.dragData = {};\r
-    }\r
-    \r
-    Ext.apply(this, config);\r
-    \r
-    if(!this.proxy){\r
-        this.proxy = new Ext.dd.StatusProxy();\r
-    }\r
-    Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, \r
-          {dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true});\r
-    \r
-    this.dragging = false;\r
-};\r
-\r
-Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {\r
-    /**\r
-     * @cfg {String} ddGroup\r
-     * A named drag drop group to which this object belongs.  If a group is specified, then this object will only\r
-     * interact with other drag drop objects in the same group (defaults to undefined).\r
-     */\r
-    /**\r
-     * @cfg {String} dropAllowed\r
-     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").\r
-     */\r
-    dropAllowed : "x-dd-drop-ok",\r
-    /**\r
-     * @cfg {String} dropNotAllowed\r
-     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
-     */\r
-    dropNotAllowed : "x-dd-drop-nodrop",\r
-\r
-    /**\r
-     * Returns the data object associated with this drag source\r
-     * @return {Object} data An object containing arbitrary data\r
-     */\r
-    getDragData : function(e){\r
-        return this.dragData;\r
-    },\r
-\r
-    // private\r
-    onDragEnter : function(e, id){\r
-        var target = Ext.dd.DragDropMgr.getDDById(id);\r
-        this.cachedTarget = target;\r
-        if(this.beforeDragEnter(target, e, id) !== false){\r
-            if(target.isNotifyTarget){\r
-                var status = target.notifyEnter(this, e, this.dragData);\r
-                this.proxy.setStatus(status);\r
-            }else{\r
-                this.proxy.setStatus(this.dropAllowed);\r
-            }\r
-            \r
-            if(this.afterDragEnter){\r
-                /**\r
-                 * An empty function by default, but provided so that you can perform a custom action\r
-                 * when the dragged item enters the drop target by providing an implementation.\r
-                 * @param {Ext.dd.DragDrop} target The drop target\r
-                 * @param {Event} e The event object\r
-                 * @param {String} id The id of the dragged element\r
-                 * @method afterDragEnter\r
-                 */\r
-                this.afterDragEnter(target, e, id);\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * An empty function by default, but provided so that you can perform a custom action\r
-     * before the dragged item enters the drop target and optionally cancel the onDragEnter.\r
-     * @param {Ext.dd.DragDrop} target The drop target\r
-     * @param {Event} e The event object\r
-     * @param {String} id The id of the dragged element\r
-     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
-     */\r
-    beforeDragEnter : function(target, e, id){\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    alignElWithMouse: function() {\r
-        Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments);\r
-        this.proxy.sync();\r
-    },\r
-\r
-    // private\r
-    onDragOver : function(e, id){\r
-        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
-        if(this.beforeDragOver(target, e, id) !== false){\r
-            if(target.isNotifyTarget){\r
-                var status = target.notifyOver(this, e, this.dragData);\r
-                this.proxy.setStatus(status);\r
-            }\r
-\r
-            if(this.afterDragOver){\r
-                /**\r
-                 * An empty function by default, but provided so that you can perform a custom action\r
-                 * while the dragged item is over the drop target by providing an implementation.\r
-                 * @param {Ext.dd.DragDrop} target The drop target\r
-                 * @param {Event} e The event object\r
-                 * @param {String} id The id of the dragged element\r
-                 * @method afterDragOver\r
-                 */\r
-                this.afterDragOver(target, e, id);\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * An empty function by default, but provided so that you can perform a custom action\r
-     * while the dragged item is over the drop target and optionally cancel the onDragOver.\r
-     * @param {Ext.dd.DragDrop} target The drop target\r
-     * @param {Event} e The event object\r
-     * @param {String} id The id of the dragged element\r
-     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
-     */\r
-    beforeDragOver : function(target, e, id){\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    onDragOut : function(e, id){\r
-        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
-        if(this.beforeDragOut(target, e, id) !== false){\r
-            if(target.isNotifyTarget){\r
-                target.notifyOut(this, e, this.dragData);\r
-            }\r
-            this.proxy.reset();\r
-            if(this.afterDragOut){\r
-                /**\r
-                 * An empty function by default, but provided so that you can perform a custom action\r
-                 * after the dragged item is dragged out of the target without dropping.\r
-                 * @param {Ext.dd.DragDrop} target The drop target\r
-                 * @param {Event} e The event object\r
-                 * @param {String} id The id of the dragged element\r
-                 * @method afterDragOut\r
-                 */\r
-                this.afterDragOut(target, e, id);\r
-            }\r
-        }\r
-        this.cachedTarget = null;\r
-    },\r
-\r
-    /**\r
-     * An empty function by default, but provided so that you can perform a custom action before the dragged\r
-     * item is dragged out of the target without dropping, and optionally cancel the onDragOut.\r
-     * @param {Ext.dd.DragDrop} target The drop target\r
-     * @param {Event} e The event object\r
-     * @param {String} id The id of the dragged element\r
-     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
-     */\r
-    beforeDragOut : function(target, e, id){\r
-        return true;\r
-    },\r
-    \r
-    // private\r
-    onDragDrop : function(e, id){\r
-        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
-        if(this.beforeDragDrop(target, e, id) !== false){\r
-            if(target.isNotifyTarget){\r
-                if(target.notifyDrop(this, e, this.dragData)){ // valid drop?\r
-                    this.onValidDrop(target, e, id);\r
-                }else{\r
-                    this.onInvalidDrop(target, e, id);\r
-                }\r
-            }else{\r
-                this.onValidDrop(target, e, id);\r
-            }\r
-            \r
-            if(this.afterDragDrop){\r
-                /**\r
-                 * An empty function by default, but provided so that you can perform a custom action\r
-                 * after a valid drag drop has occurred by providing an implementation.\r
-                 * @param {Ext.dd.DragDrop} target The drop target\r
-                 * @param {Event} e The event object\r
-                 * @param {String} id The id of the dropped element\r
-                 * @method afterDragDrop\r
-                 */\r
-                this.afterDragDrop(target, e, id);\r
-            }\r
-        }\r
-        delete this.cachedTarget;\r
-    },\r
-\r
-    /**\r
-     * An empty function by default, but provided so that you can perform a custom action before the dragged\r
-     * item is dropped onto the target and optionally cancel the onDragDrop.\r
-     * @param {Ext.dd.DragDrop} target The drop target\r
-     * @param {Event} e The event object\r
-     * @param {String} id The id of the dragged element\r
-     * @return {Boolean} isValid True if the drag drop event is valid, else false to cancel\r
-     */\r
-    beforeDragDrop : function(target, e, id){\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    onValidDrop : function(target, e, id){\r
-        this.hideProxy();\r
-        if(this.afterValidDrop){\r
-            /**\r
-             * An empty function by default, but provided so that you can perform a custom action\r
-             * after a valid drop has occurred by providing an implementation.\r
-             * @param {Object} target The target DD \r
-             * @param {Event} e The event object\r
-             * @param {String} id The id of the dropped element\r
-             * @method afterInvalidDrop\r
-             */\r
-            this.afterValidDrop(target, e, id);\r
-        }\r
-    },\r
-\r
-    // private\r
-    getRepairXY : function(e, data){\r
-        return this.el.getXY();  \r
-    },\r
-\r
-    // private\r
-    onInvalidDrop : function(target, e, id){\r
-        this.beforeInvalidDrop(target, e, id);\r
-        if(this.cachedTarget){\r
-            if(this.cachedTarget.isNotifyTarget){\r
-                this.cachedTarget.notifyOut(this, e, this.dragData);\r
-            }\r
-            this.cacheTarget = null;\r
-        }\r
-        this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this);\r
-\r
-        if(this.afterInvalidDrop){\r
-            /**\r
-             * An empty function by default, but provided so that you can perform a custom action\r
-             * after an invalid drop has occurred by providing an implementation.\r
-             * @param {Event} e The event object\r
-             * @param {String} id The id of the dropped element\r
-             * @method afterInvalidDrop\r
-             */\r
-            this.afterInvalidDrop(e, id);\r
-        }\r
-    },\r
-\r
-    // private\r
-    afterRepair : function(){\r
-        if(Ext.enableFx){\r
-            this.el.highlight(this.hlColor || "c3daf9");\r
-        }\r
-        this.dragging = false;\r
-    },\r
-\r
-    /**\r
-     * An empty function by default, but provided so that you can perform a custom action after an invalid\r
-     * drop has occurred.\r
-     * @param {Ext.dd.DragDrop} target The drop target\r
-     * @param {Event} e The event object\r
-     * @param {String} id The id of the dragged element\r
-     * @return {Boolean} isValid True if the invalid drop should proceed, else false to cancel\r
-     */\r
-    beforeInvalidDrop : function(target, e, id){\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    handleMouseDown : function(e){\r
-        if(this.dragging) {\r
-            return;\r
-        }\r
-        var data = this.getDragData(e);\r
-        if(data && this.onBeforeDrag(data, e) !== false){\r
-            this.dragData = data;\r
-            this.proxy.stop();\r
-            Ext.dd.DragSource.superclass.handleMouseDown.apply(this, arguments);\r
-        } \r
-    },\r
-\r
+Ext.layout.AccordionLayout = Ext.extend(Ext.layout.FitLayout, {\r
     /**\r
-     * An empty function by default, but provided so that you can perform a custom action before the initial\r
-     * drag event begins and optionally cancel it.\r
-     * @param {Object} data An object containing arbitrary data to be shared with drop targets\r
-     * @param {Event} e The event object\r
-     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
+     * @cfg {Boolean} fill\r
+     * True to adjust the active item's height to fill the available space in the container, false to use the\r
+     * item's current height, or auto height if not explicitly set (defaults to true).\r
      */\r
-    onBeforeDrag : function(data, e){\r
-        return true;\r
-    },\r
-\r
+    fill : true,\r
     /**\r
-     * An empty function by default, but provided so that you can perform a custom action once the initial\r
-     * drag event has begun.  The drag cannot be canceled from this function.\r
-     * @param {Number} x The x position of the click on the dragged object\r
-     * @param {Number} y The y position of the click on the dragged object\r
+     * @cfg {Boolean} autoWidth\r
+     * True to set each contained item's width to 'auto', false to use the item's current width (defaults to true).\r
+     * Note that some components, in particular the {@link Ext.grid.GridPanel grid}, will not function properly within\r
+     * layouts if they have auto width, so in such cases this config should be set to false.\r
      */\r
-    onStartDrag : Ext.emptyFn,\r
-\r
-    // private override\r
-    startDrag : function(x, y){\r
-        this.proxy.reset();\r
-        this.dragging = true;\r
-        this.proxy.update("");\r
-        this.onInitDrag(x, y);\r
-        this.proxy.show();\r
-    },\r
-\r
-    // private\r
-    onInitDrag : function(x, y){\r
-        var clone = this.el.dom.cloneNode(true);\r
-        clone.id = Ext.id(); // prevent duplicate ids\r
-        this.proxy.update(clone);\r
-        this.onStartDrag(x, y);\r
-        return true;\r
-    },\r
-\r
+    autoWidth : true,\r
     /**\r
-     * Returns the drag source's underlying {@link Ext.dd.StatusProxy}\r
-     * @return {Ext.dd.StatusProxy} proxy The StatusProxy\r
+     * @cfg {Boolean} titleCollapse\r
+     * True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow\r
+     * expand/collapse only when the toggle tool button is clicked (defaults to true).  When set to false,\r
+     * {@link #hideCollapseTool} should be false also.\r
      */\r
-    getProxy : function(){\r
-        return this.proxy;  \r
-    },\r
-\r
+    titleCollapse : true,\r
     /**\r
-     * Hides the drag source's {@link Ext.dd.StatusProxy}\r
+     * @cfg {Boolean} hideCollapseTool\r
+     * True to hide the contained panels' collapse/expand toggle buttons, false to display them (defaults to false).\r
+     * When set to true, {@link #titleCollapse} should be true also.\r
      */\r
-    hideProxy : function(){\r
-        this.proxy.hide();  \r
-        this.proxy.reset(true);\r
-        this.dragging = false;\r
-    },\r
-\r
-    // private\r
-    triggerCacheRefresh : function(){\r
-        Ext.dd.DDM.refreshCache(this.groups);\r
-    },\r
-\r
-    // private - override to prevent hiding\r
-    b4EndDrag: function(e) {\r
-    },\r
-\r
-    // private - override to prevent moving\r
-    endDrag : function(e){\r
-        this.onEndDrag(this.dragData, e);\r
-    },\r
-\r
-    // private\r
-    onEndDrag : function(data, e){\r
-    },\r
-    \r
-    // private - pin to cursor\r
-    autoOffset : function(x, y) {\r
-        this.setDelta(-12, -20);\r
-    }    \r
-});/**\r
- * @class Ext.dd.DropTarget\r
- * @extends Ext.dd.DDTarget\r
- * A simple class that provides the basic implementation needed to make any element a drop target that can have\r
- * draggable items dropped onto it.  The drop has no effect until an implementation of notifyDrop is provided.\r
- * @constructor\r
- * @param {Mixed} el The container element\r
- * @param {Object} config\r
- */\r
-Ext.dd.DropTarget = function(el, config){\r
-    this.el = Ext.get(el);\r
-    \r
-    Ext.apply(this, config);\r
-    \r
-    if(this.containerScroll){\r
-        Ext.dd.ScrollManager.register(this.el);\r
-    }\r
-    \r
-    Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, \r
-          {isTarget: true});\r
-\r
-};\r
-\r
-Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, {\r
+    hideCollapseTool : false,\r
     /**\r
-     * @cfg {String} ddGroup\r
-     * A named drag drop group to which this object belongs.  If a group is specified, then this object will only\r
-     * interact with other drag drop objects in the same group (defaults to undefined).\r
+     * @cfg {Boolean} collapseFirst\r
+     * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools\r
+     * in the contained panels' title bars, false to render it last (defaults to false).\r
      */\r
+    collapseFirst : false,\r
     /**\r
-     * @cfg {String} overClass\r
-     * The CSS class applied to the drop target element while the drag source is over it (defaults to "").\r
+     * @cfg {Boolean} animate\r
+     * True to slide the contained panels open and closed during expand/collapse using animation, false to open and\r
+     * close directly with no animation (defaults to false).  Note: to defer to the specific config setting of each\r
+     * contained panel for this property, set this to undefined at the layout level.\r
      */\r
+    animate : false,\r
     /**\r
-     * @cfg {String} dropAllowed\r
-     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").\r
+     * @cfg {Boolean} sequence\r
+     * <b>Experimental</b>. If animate is set to true, this will result in each animation running in sequence.\r
      */\r
-    dropAllowed : "x-dd-drop-ok",\r
+    sequence : false,\r
     /**\r
-     * @cfg {String} dropNotAllowed\r
-     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
+     * @cfg {Boolean} activeOnTop\r
+     * True to swap the position of each panel as it is expanded so that it becomes the first item in the container,\r
+     * false to keep the panels in the rendered order. <b>This is NOT compatible with "animate:true"</b> (defaults to false).\r
      */\r
-    dropNotAllowed : "x-dd-drop-nodrop",\r
+    activeOnTop : false,\r
 \r
-    // private\r
-    isTarget : true,\r
+    type: 'accordion',\r
 \r
-    // private\r
-    isNotifyTarget : true,\r
+    renderItem : function(c){\r
+        if(this.animate === false){\r
+            c.animCollapse = false;\r
+        }\r
+        c.collapsible = true;\r
+        if(this.autoWidth){\r
+            c.autoWidth = true;\r
+        }\r
+        if(this.titleCollapse){\r
+            c.titleCollapse = true;\r
+        }\r
+        if(this.hideCollapseTool){\r
+            c.hideCollapseTool = true;\r
+        }\r
+        if(this.collapseFirst !== undefined){\r
+            c.collapseFirst = this.collapseFirst;\r
+        }\r
+        if(!this.activeItem && !c.collapsed){\r
+            this.setActiveItem(c, true);\r
+        }else if(this.activeItem && this.activeItem != c){\r
+            c.collapsed = true;\r
+        }\r
+        Ext.layout.AccordionLayout.superclass.renderItem.apply(this, arguments);\r
+        c.header.addClass('x-accordion-hd');\r
+        c.on('beforeexpand', this.beforeExpand, this);\r
+    },\r
 \r
-    /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the\r
-     * target.  This default implementation adds the CSS class specified by overClass (if any) to the drop element\r
-     * and returns the dropAllowed config value.  This method should be overridden if drop validation is required.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
-     */\r
-    notifyEnter : function(dd, e, data){\r
-        if(this.overClass){\r
-            this.el.addClass(this.overClass);\r
+    onRemove: function(c){\r
+        Ext.layout.AccordionLayout.superclass.onRemove.call(this, c);\r
+        if(c.rendered){\r
+            c.header.removeClass('x-accordion-hd');\r
         }\r
-        return this.dropAllowed;\r
+        c.un('beforeexpand', this.beforeExpand, this);\r
     },\r
 \r
-    /**\r
-     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target.\r
-     * This method will be called on every mouse movement while the drag source is over the drop target.\r
-     * This default implementation simply returns the dropAllowed config value.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
-     */\r
-    notifyOver : function(dd, e, data){\r
-        return this.dropAllowed;\r
+    // private\r
+    beforeExpand : function(p, anim){\r
+        var ai = this.activeItem;\r
+        if(ai){\r
+            if(this.sequence){\r
+                delete this.activeItem;\r
+                if (!ai.collapsed){\r
+                    ai.collapse({callback:function(){\r
+                        p.expand(anim || true);\r
+                    }, scope: this});\r
+                    return false;\r
+                }\r
+            }else{\r
+                ai.collapse(this.animate);\r
+            }\r
+        }\r
+        this.setActive(p);\r
+        if(this.activeOnTop){\r
+            p.el.dom.parentNode.insertBefore(p.el.dom, p.el.dom.parentNode.firstChild);\r
+        }\r
+        // Items have been hidden an possibly rearranged, we need to get the container size again.\r
+        this.layout();\r
     },\r
 \r
-    /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged\r
-     * out of the target without dropping.  This default implementation simply removes the CSS class specified by\r
-     * overClass (if any) from the drop element.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     */\r
-    notifyOut : function(dd, e, data){\r
-        if(this.overClass){\r
-            this.el.removeClass(this.overClass);\r
+    // private\r
+    setItemSize : function(item, size){\r
+        if(this.fill && item){\r
+            var hh = 0, i, ct = this.getRenderedItems(this.container), len = ct.length, p;\r
+            // Add up all the header heights\r
+            for (i = 0; i < len; i++) {\r
+                if((p = ct[i]) != item){\r
+                    hh += p.header.getHeight();\r
+                }\r
+            };\r
+            // Subtract the header heights from the container size\r
+            size.height -= hh;\r
+            // Call setSize on the container to set the correct height.  For Panels, deferedHeight\r
+            // will simply store this size for when the expansion is done.\r
+            item.setSize(size);\r
         }\r
     },\r
 \r
     /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has\r
-     * been dropped on it.  This method has no default implementation and returns false, so you must provide an\r
-     * implementation that does something to process the drop event and returns true so that the drag source's\r
-     * repair action does not run.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {Boolean} True if the drop was valid, else false\r
+     * Sets the active (expanded) item in the layout.\r
+     * @param {String/Number} item The string component id or numeric index of the item to activate\r
      */\r
-    notifyDrop : function(dd, e, data){\r
-        return false;\r
-    }\r
-});/**\r
- * @class Ext.dd.DragZone\r
- * @extends Ext.dd.DragSource\r
- * <p>This class provides a container DD instance that allows dragging of multiple child source nodes.</p>\r
- * <p>This class does not move the drag target nodes, but a proxy element which may contain\r
- * any DOM structure you wish. The DOM element to show in the proxy is provided by either a\r
- * provided implementation of {@link #getDragData}, or by registered draggables registered with {@link Ext.dd.Registry}</p>\r
- * <p>If you wish to provide draggability for an arbitrary number of DOM nodes, each of which represent some\r
- * application object (For example nodes in a {@link Ext.DataView DataView}) then use of this class\r
- * is the most efficient way to "activate" those nodes.</p>\r
- * <p>By default, this class requires that draggable child nodes are registered with {@link Ext.dd.Registry}.\r
- * However a simpler way to allow a DragZone to manage any number of draggable elements is to configure\r
- * the DragZone with  an implementation of the {@link #getDragData} method which interrogates the passed\r
- * mouse event to see if it has taken place within an element, or class of elements. This is easily done\r
- * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a\r
- * {@link Ext.DomQuery} selector. For example, to make the nodes of a DataView draggable, use the following\r
- * technique. Knowledge of the use of the DataView is required:</p><pre><code>\r
-myDataView.on('render', function() {\r
-    myDataView.dragZone = new Ext.dd.DragZone(myDataView.getEl(), {\r
-\r
-//      On receipt of a mousedown event, see if it is within a DataView node.\r
-//      Return a drag data object if so.\r
-        getDragData: function(e) {\r
-\r
-//          Use the DataView's own itemSelector (a mandatory property) to\r
-//          test if the mousedown is within one of the DataView's nodes.\r
-            var sourceEl = e.getTarget(myDataView.itemSelector, 10);\r
+    setActiveItem : function(item){\r
+        this.setActive(item, true);\r
+    },\r
 \r
-//          If the mousedown is within a DataView node, clone the node to produce\r
-//          a ddel element for use by the drag proxy. Also add application data\r
-//          to the returned data object.\r
-            if (sourceEl) {\r
-                d = sourceEl.cloneNode(true);\r
-                d.id = Ext.id();\r
-                return {\r
-                    ddel: d,\r
-                    sourceEl: sourceEl,\r
-                    repairXY: Ext.fly(sourceEl).getXY(),\r
-                    sourceStore: myDataView.store,\r
-                    draggedRecord: v.getRecord(sourceEl)\r
+    // private\r
+    setActive : function(item, expand){\r
+        var ai = this.activeItem;\r
+        item = this.container.getComponent(item);\r
+        if(ai != item){\r
+            if(item.rendered && item.collapsed && expand){\r
+                item.expand();\r
+            }else{\r
+                if(ai){\r
+                   ai.fireEvent('deactivate', ai);\r
                 }\r
+                this.activeItem = item;\r
+                item.fireEvent('activate', item);\r
             }\r
-        },\r
-\r
-//      Provide coordinates for the proxy to slide back to on failed drag.\r
-//      This is the original XY coordinates of the draggable element captured\r
-//      in the getDragData method.\r
-        getRepairXY: function() {\r
-            return this.dragData.repairXY;\r
         }\r
-    });\r
-});</code></pre>\r
- * See the {@link Ext.dd.DropZone DropZone} documentation for details about building a DropZone which\r
- * cooperates with this DragZone.\r
- * @constructor\r
- * @param {Mixed} el The container element\r
- * @param {Object} config\r
- */\r
-Ext.dd.DragZone = function(el, config){\r
-    Ext.dd.DragZone.superclass.constructor.call(this, el, config);\r
-    if(this.containerScroll){\r
-        Ext.dd.ScrollManager.register(this.el);\r
     }\r
-};\r
-\r
-Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, {\r
-    /**\r
-     * This property contains the data representing the dragged object. This data is set up by the implementation\r
-     * of the {@link #getDragData} method. It must contain a <tt>ddel</tt> property, but can contain\r
-     * any other data according to the application's needs.\r
-     * @type Object\r
-     * @property dragData\r
-     */\r
-    /**\r
-     * @cfg {Boolean} containerScroll True to register this container with the Scrollmanager\r
-     * for auto scrolling during drag operations.\r
-     */\r
-    /**\r
-     * @cfg {String} hlColor The color to use when visually highlighting the drag source in the afterRepair\r
-     * method after a failed drop (defaults to "c3daf9" - light blue)\r
-     */\r
+});\r
+Ext.Container.LAYOUTS.accordion = Ext.layout.AccordionLayout;\r
 \r
-    /**\r
-     * Called when a mousedown occurs in this container. Looks in {@link Ext.dd.Registry}\r
-     * for a valid target to drag based on the mouse down. Override this method\r
-     * to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned\r
-     * object has a "ddel" attribute (with an HTML Element) for other functions to work.\r
-     * @param {EventObject} e The mouse down event\r
-     * @return {Object} The dragData\r
-     */\r
-    getDragData : function(e){\r
-        return Ext.dd.Registry.getHandleFromEvent(e);\r
+//backwards compat\r
+Ext.layout.Accordion = Ext.layout.AccordionLayout;/**\r
+ * @class Ext.layout.TableLayout\r
+ * @extends Ext.layout.ContainerLayout\r
+ * <p>This layout allows you to easily render content into an HTML table.  The total number of columns can be\r
+ * specified, and rowspan and colspan can be used to create complex layouts within the table.\r
+ * This class is intended to be extended or created via the layout:'table' {@link Ext.Container#layout} config,\r
+ * and should generally not need to be created directly via the new keyword.</p>\r
+ * <p>Note that when creating a layout via config, the layout-specific config properties must be passed in via\r
+ * the {@link Ext.Container#layoutConfig} object which will then be applied internally to the layout.  In the\r
+ * case of TableLayout, the only valid layout config property is {@link #columns}.  However, the items added to a\r
+ * TableLayout can supply the following table-specific config properties:</p>\r
+ * <ul>\r
+ * <li><b>rowspan</b> Applied to the table cell containing the item.</li>\r
+ * <li><b>colspan</b> Applied to the table cell containing the item.</li>\r
+ * <li><b>cellId</b> An id applied to the table cell containing the item.</li>\r
+ * <li><b>cellCls</b> A CSS class name added to the table cell containing the item.</li>\r
+ * </ul>\r
+ * <p>The basic concept of building up a TableLayout is conceptually very similar to building up a standard\r
+ * HTML table.  You simply add each panel (or "cell") that you want to include along with any span attributes\r
+ * specified as the special config properties of rowspan and colspan which work exactly like their HTML counterparts.\r
+ * Rather than explicitly creating and nesting rows and columns as you would in HTML, you simply specify the\r
+ * total column count in the layoutConfig and start adding panels in their natural order from left to right,\r
+ * top to bottom.  The layout will automatically figure out, based on the column count, rowspans and colspans,\r
+ * how to position each panel within the table.  Just like with HTML tables, your rowspans and colspans must add\r
+ * up correctly in your overall layout or you'll end up with missing and/or extra cells!  Example usage:</p>\r
+ * <pre><code>\r
+// This code will generate a layout table that is 3 columns by 2 rows\r
+// with some spanning included.  The basic layout will be:\r
+// +--------+-----------------+\r
+// |   A    |   B             |\r
+// |        |--------+--------|\r
+// |        |   C    |   D    |\r
+// +--------+--------+--------+\r
+var table = new Ext.Panel({\r
+    title: 'Table Layout',\r
+    layout:'table',\r
+    defaults: {\r
+        // applied to each contained panel\r
+        bodyStyle:'padding:20px'\r
     },\r
-    \r
-    /**\r
-     * Called once drag threshold has been reached to initialize the proxy element. By default, it clones the\r
-     * this.dragData.ddel\r
-     * @param {Number} x The x position of the click on the dragged object\r
-     * @param {Number} y The y position of the click on the dragged object\r
-     * @return {Boolean} true to continue the drag, false to cancel\r
-     */\r
-    onInitDrag : function(x, y){\r
-        this.proxy.update(this.dragData.ddel.cloneNode(true));\r
-        this.onStartDrag(x, y);\r
-        return true;\r
+    layoutConfig: {\r
+        // The total column count must be specified here\r
+        columns: 3\r
     },\r
-    \r
+    items: [{\r
+        html: '&lt;p&gt;Cell A content&lt;/p&gt;',\r
+        rowspan: 2\r
+    },{\r
+        html: '&lt;p&gt;Cell B content&lt;/p&gt;',\r
+        colspan: 2\r
+    },{\r
+        html: '&lt;p&gt;Cell C content&lt;/p&gt;',\r
+        cellCls: 'highlight'\r
+    },{\r
+        html: '&lt;p&gt;Cell D content&lt;/p&gt;'\r
+    }]\r
+});\r
+</code></pre>\r
+ */\r
+Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
     /**\r
-     * Called after a repair of an invalid drop. By default, highlights this.dragData.ddel \r
+     * @cfg {Number} columns\r
+     * The total number of columns to create in the table for this layout.  If not specified, all Components added to\r
+     * this layout will be rendered into a single row using one column per Component.\r
      */\r
-    afterRepair : function(){\r
-        if(Ext.enableFx){\r
-            Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");\r
-        }\r
-        this.dragging = false;\r
-    },\r
+\r
+    // private\r
+    monitorResize:false,\r
+\r
+    type: 'table',\r
+\r
+    targetCls: 'x-table-layout-ct',\r
 \r
     /**\r
-     * Called before a repair of an invalid drop to get the XY to animate to. By default returns\r
-     * the XY of this.dragData.ddel\r
-     * @param {EventObject} e The mouse up event\r
-     * @return {Array} The xy location (e.g. [100, 200])\r
-     */\r
-    getRepairXY : function(e){\r
-        return Ext.Element.fly(this.dragData.ddel).getXY();  \r
+     * @cfg {Object} tableAttrs\r
+     * <p>An object containing properties which are added to the {@link Ext.DomHelper DomHelper} specification\r
+     * used to create the layout's <tt>&lt;table&gt;</tt> element. Example:</p><pre><code>\r
+{\r
+    xtype: 'panel',\r
+    layout: 'table',\r
+    layoutConfig: {\r
+        tableAttrs: {\r
+            style: {\r
+                width: '100%'\r
+            }\r
+        },\r
+        columns: 3\r
     }\r
-});/**\r
- * @class Ext.dd.DropZone\r
- * @extends Ext.dd.DropTarget\r
- * <p>This class provides a container DD instance that allows dropping on multiple child target nodes.</p>\r
- * <p>By default, this class requires that child nodes accepting drop are registered with {@link Ext.dd.Registry}.\r
- * However a simpler way to allow a DropZone to manage any number of target elements is to configure the\r
- * DropZone with an implementation of {@link #getTargetFromEvent} which interrogates the passed\r
- * mouse event to see if it has taken place within an element, or class of elements. This is easily done\r
- * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a\r
- * {@link Ext.DomQuery} selector.</p>\r
- * <p>Once the DropZone has detected through calling getTargetFromEvent, that the mouse is over\r
- * a drop target, that target is passed as the first parameter to {@link #onNodeEnter}, {@link #onNodeOver},\r
- * {@link #onNodeOut}, {@link #onNodeDrop}. You may configure the instance of DropZone with implementations\r
- * of these methods to provide application-specific behaviour for these events to update both\r
- * application state, and UI state.</p>\r
- * <p>For example to make a GridPanel a cooperating target with the example illustrated in\r
- * {@link Ext.dd.DragZone DragZone}, the following technique might be used:</p><pre><code>\r
-myGridPanel.on('render', function() {\r
-    myGridPanel.dropZone = new Ext.dd.DropZone(myGridPanel.getView().scroller, {\r
+}</code></pre>\r
+     */\r
+    tableAttrs:null,\r
 \r
-//      If the mouse is over a grid row, return that node. This is\r
-//      provided as the "target" parameter in all "onNodeXXXX" node event handling functions\r
-        getTargetFromEvent: function(e) {\r
-            return e.getTarget(myGridPanel.getView().rowSelector);\r
-        },\r
+    // private\r
+    setContainer : function(ct){\r
+        Ext.layout.TableLayout.superclass.setContainer.call(this, ct);\r
 \r
-//      On entry into a target node, highlight that node.\r
-        onNodeEnter : function(target, dd, e, data){ \r
-            Ext.fly(target).addClass('my-row-highlight-class');\r
-        },\r
+        this.currentRow = 0;\r
+        this.currentColumn = 0;\r
+        this.cells = [];\r
+    },\r
+    \r
+    // private\r
+    onLayout : function(ct, target){\r
+        var cs = ct.items.items, len = cs.length, c, i;\r
 \r
-//      On exit from a target node, unhighlight that node.\r
-        onNodeOut : function(target, dd, e, data){ \r
-            Ext.fly(target).removeClass('my-row-highlight-class');\r
-        },\r
+        if(!this.table){\r
+            target.addClass('x-table-layout-ct');\r
 \r
-//      While over a target node, return the default drop allowed class which\r
-//      places a "tick" icon into the drag proxy.\r
-        onNodeOver : function(target, dd, e, data){ \r
-            return Ext.dd.DropZone.prototype.dropAllowed;\r
-        },\r
+            this.table = target.createChild(\r
+                Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true);\r
+        }\r
+        this.renderAll(ct, target);\r
+    },\r
 \r
-//      On node drop we can interrogate the target to find the underlying\r
-//      application object that is the real target of the dragged data.\r
-//      In this case, it is a Record in the GridPanel's Store.\r
-//      We can use the data set up by the DragZone's getDragData method to read\r
-//      any data we decided to attach in the DragZone's getDragData method.\r
-        onNodeDrop : function(target, dd, e, data){\r
-            var rowIndex = myGridPanel.getView().findRowIndex(target);\r
-            var r = myGridPanel.getStore().getAt(rowIndex);\r
-            Ext.Msg.alert('Drop gesture', 'Dropped Record id ' + data.draggedRecord.id +\r
-                ' on Record id ' + r.id);\r
-            return true;\r
+    // private\r
+    getRow : function(index){\r
+        var row = this.table.tBodies[0].childNodes[index];\r
+        if(!row){\r
+            row = document.createElement('tr');\r
+            this.table.tBodies[0].appendChild(row);\r
         }\r
-    });\r
-}\r
-</code></pre>\r
- * See the {@link Ext.dd.DragZone DragZone} documentation for details about building a DragZone which\r
- * cooperates with this DropZone.\r
- * @constructor\r
- * @param {Mixed} el The container element\r
- * @param {Object} config\r
- */\r
-Ext.dd.DropZone = function(el, config){\r
-    Ext.dd.DropZone.superclass.constructor.call(this, el, config);\r
-};\r
+        return row;\r
+    },\r
 \r
-Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, {\r
-    /**\r
-     * Returns a custom data object associated with the DOM node that is the target of the event.  By default\r
-     * this looks up the event target in the {@link Ext.dd.Registry}, although you can override this method to\r
-     * provide your own custom lookup.\r
-     * @param {Event} e The event\r
-     * @return {Object} data The custom data\r
-     */\r
-    getTargetFromEvent : function(e){\r
-        return Ext.dd.Registry.getTargetFromEvent(e);\r
+    // private\r
+    getNextCell : function(c){\r
+        var cell = this.getNextNonSpan(this.currentColumn, this.currentRow);\r
+        var curCol = this.currentColumn = cell[0], curRow = this.currentRow = cell[1];\r
+        for(var rowIndex = curRow; rowIndex < curRow + (c.rowspan || 1); rowIndex++){\r
+            if(!this.cells[rowIndex]){\r
+                this.cells[rowIndex] = [];\r
+            }\r
+            for(var colIndex = curCol; colIndex < curCol + (c.colspan || 1); colIndex++){\r
+                this.cells[rowIndex][colIndex] = true;\r
+            }\r
+        }\r
+        var td = document.createElement('td');\r
+        if(c.cellId){\r
+            td.id = c.cellId;\r
+        }\r
+        var cls = 'x-table-layout-cell';\r
+        if(c.cellCls){\r
+            cls += ' ' + c.cellCls;\r
+        }\r
+        td.className = cls;\r
+        if(c.colspan){\r
+            td.colSpan = c.colspan;\r
+        }\r
+        if(c.rowspan){\r
+            td.rowSpan = c.rowspan;\r
+        }\r
+        this.getRow(curRow).appendChild(td);\r
+        return td;\r
     },\r
 \r
-    /**\r
-     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has entered a drop node\r
-     * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}.\r
-     * This method has no default implementation and should be overridden to provide\r
-     * node-specific processing if necessary.\r
-     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from \r
-     * {@link #getTargetFromEvent} for this node)\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     */\r
-    onNodeEnter : function(n, dd, e, data){\r
-        \r
+    // private\r
+    getNextNonSpan: function(colIndex, rowIndex){\r
+        var cols = this.columns;\r
+        while((cols && colIndex >= cols) || (this.cells[rowIndex] && this.cells[rowIndex][colIndex])) {\r
+            if(cols && colIndex >= cols){\r
+                rowIndex++;\r
+                colIndex = 0;\r
+            }else{\r
+                colIndex++;\r
+            }\r
+        }\r
+        return [colIndex, rowIndex];\r
     },\r
 \r
-    /**\r
-     * Called while the DropZone determines that a {@link Ext.dd.DragSource} is over a drop node\r
-     * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}.\r
-     * The default implementation returns this.dropNotAllowed, so it should be\r
-     * overridden to provide the proper feedback.\r
-     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
-     * {@link #getTargetFromEvent} for this node)\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
-     */\r
-    onNodeOver : function(n, dd, e, data){\r
-        return this.dropAllowed;\r
+    // private\r
+    renderItem : function(c, position, target){\r
+        // Ensure we have our inner table to get cells to render into.\r
+        if(!this.table){\r
+            this.table = target.createChild(\r
+                Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true);\r
+        }\r
+        if(c && !c.rendered){\r
+            c.render(this.getNextCell(c));\r
+            this.configureItem(c, position);\r
+        }else if(c && !this.isValidParent(c, target)){\r
+            var container = this.getNextCell(c);\r
+            container.insertBefore(c.getPositionEl().dom, null);\r
+            c.container = Ext.get(container);\r
+            this.configureItem(c, position);\r
+        }\r
     },\r
 \r
+    // private\r
+    isValidParent : function(c, target){\r
+        return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target);\r
+    }\r
+\r
     /**\r
-     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dragged out of\r
-     * the drop node without dropping.  This method has no default implementation and should be overridden to provide\r
-     * node-specific processing if necessary.\r
-     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
-     * {@link #getTargetFromEvent} for this node)\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @property activeItem\r
+     * @hide\r
      */\r
-    onNodeOut : function(n, dd, e, data){\r
-        \r
-    },\r
+});\r
 \r
+Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;/**
+ * @class Ext.layout.AbsoluteLayout
+ * @extends Ext.layout.AnchorLayout
+ * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the
+ * ability for x/y positioning using the standard x and y component config options.</p>
+ * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
+ * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
+ * <p>Example usage:</p>
+ * <pre><code>
+var form = new Ext.form.FormPanel({
+    title: 'Absolute Layout',
+    layout:'absolute',
+    layoutConfig: {
+        // layout-specific configs go here
+        extraCls: 'x-abs-layout-item',
+    },
+    baseCls: 'x-plain',
+    url:'save-form.php',
+    defaultType: 'textfield',
+    items: [{
+        x: 0,
+        y: 5,
+        xtype:'label',
+        text: 'Send To:'
+    },{
+        x: 60,
+        y: 0,
+        name: 'to',
+        anchor:'100%'  // anchor width by percentage
+    },{
+        x: 0,
+        y: 35,
+        xtype:'label',
+        text: 'Subject:'
+    },{
+        x: 60,
+        y: 30,
+        name: 'subject',
+        anchor: '100%'  // anchor width by percentage
+    },{
+        x:0,
+        y: 60,
+        xtype: 'textarea',
+        name: 'msg',
+        anchor: '100% 100%'  // anchor width and height
+    }]
+});
+</code></pre>
+ */
+Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
+
+    extraCls: 'x-abs-layout-item',
+
+    type: 'anchor',
+
+    onLayout : function(ct, target){
+        target.position();
+        this.paddingLeft = target.getPadding('l');
+        this.paddingTop = target.getPadding('t');
+        Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);
+    },
+
+    // private
+    adjustWidthAnchor : function(value, comp){
+        return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value;
+    },
+
+    // private
+    adjustHeightAnchor : function(value, comp){
+        return  value ? value - comp.getPosition(true)[1] + this.paddingTop : value;
+    }
+    /**
+     * @property activeItem
+     * @hide
+     */
+});
+Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;
+/**
+ * @class Ext.layout.BoxLayout
+ * @extends Ext.layout.ContainerLayout
+ * <p>Base Class for HBoxLayout and VBoxLayout Classes. Generally it should not need to be used directly.</p>
+ */
+Ext.layout.BoxLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    /**
+     * @cfg {Object} defaultMargins
+     * <p>If the individual contained items do not have a <tt>margins</tt>
+     * property specified, the default margins from this property will be
+     * applied to each item.</p>
+     * <br><p>This property may be specified as an object containing margins
+     * to apply in the format:</p><pre><code>
+{
+    top: (top margin),
+    right: (right margin),
+    bottom: (bottom margin),
+    left: (left margin)
+}</code></pre>
+     * <p>This property may also be specified as a string containing
+     * space-separated, numeric margin values. The order of the sides associated
+     * with each value matches the way CSS processes margin values:</p>
+     * <div class="mdetail-params"><ul>
+     * <li>If there is only one value, it applies to all sides.</li>
+     * <li>If there are two values, the top and bottom borders are set to the
+     * first value and the right and left are set to the second.</li>
+     * <li>If there are three values, the top is set to the first value, the left
+     * and right are set to the second, and the bottom is set to the third.</li>
+     * <li>If there are four values, they apply to the top, right, bottom, and
+     * left, respectively.</li>
+     * </ul></div>
+     * <p>Defaults to:</p><pre><code>
+     * {top:0, right:0, bottom:0, left:0}
+     * </code></pre>
+     */
+    defaultMargins : {left:0,top:0,right:0,bottom:0},
+    /**
+     * @cfg {String} padding
+     * <p>Sets the padding to be applied to all child items managed by this layout.</p>
+     * <p>This property must be specified as a string containing
+     * space-separated, numeric padding values. The order of the sides associated
+     * with each value matches the way CSS processes padding values:</p>
+     * <div class="mdetail-params"><ul>
+     * <li>If there is only one value, it applies to all sides.</li>
+     * <li>If there are two values, the top and bottom borders are set to the
+     * first value and the right and left are set to the second.</li>
+     * <li>If there are three values, the top is set to the first value, the left
+     * and right are set to the second, and the bottom is set to the third.</li>
+     * <li>If there are four values, they apply to the top, right, bottom, and
+     * left, respectively.</li>
+     * </ul></div>
+     * <p>Defaults to: <code>"0"</code></p>
+     */
+    padding : '0',
+    // documented in subclasses
+    pack : 'start',
+
+    // private
+    monitorResize : true,
+    type: 'box',
+    scrollOffset : 0,
+    extraCls : 'x-box-item',
+    targetCls : 'x-box-layout-ct',
+    innerCls : 'x-box-inner',
+
+    constructor : function(config){
+        Ext.layout.BoxLayout.superclass.constructor.call(this, config);
+        if(Ext.isString(this.defaultMargins)){
+            this.defaultMargins = this.parseMargins(this.defaultMargins);
+        }
+    },
+
+    // private
+    isValidParent : function(c, target){
+        return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom;
+    },
+
+    // private
+    renderAll : function(ct, target){
+        if(!this.innerCt){
+            // the innerCt prevents wrapping and shuffling while
+            // the container is resizing
+            this.innerCt = target.createChild({cls:this.innerCls});
+            this.padding = this.parseMargins(this.padding);
+        }
+        Ext.layout.BoxLayout.superclass.renderAll.call(this, ct, this.innerCt);
+    },
+
+    onLayout : function(ct, target){
+        this.renderAll(ct, target);
+    },
+
+    getLayoutTargetSize : function(){
+        var target = this.container.getLayoutTarget(), ret;
+        if (target) {
+            ret = target.getViewSize();
+            ret.width -= target.getPadding('lr');
+            ret.height -= target.getPadding('tb');
+        }
+        return ret;
+    },
+
+    // private
+    renderItem : function(c){
+        if(Ext.isString(c.margins)){
+            c.margins = this.parseMargins(c.margins);
+        }else if(!c.margins){
+            c.margins = this.defaultMargins;
+        }
+        Ext.layout.BoxLayout.superclass.renderItem.apply(this, arguments);
+    }
+});
+
+/**
+ * @class Ext.layout.VBoxLayout
+ * @extends Ext.layout.BoxLayout
+ * <p>A layout that arranges items vertically down a Container. This layout optionally divides available vertical
+ * space between child items containing a numeric <code>flex</code> configuration.</p>
+ * This layout may also be used to set the widths of child items by configuring it with the {@link #align} option.
+ */
+Ext.layout.VBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
+    /**
+     * @cfg {String} align
+     * Controls how the child items of the container are aligned. Acceptable configuration values for this
+     * property are:
+     * <div class="mdetail-params"><ul>
+     * <li><b><tt>left</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned horizontally
+     * at the <b>left</b> side of the container</div></li>
+     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are aligned horizontally at the
+     * <b>mid-width</b> of the container</div></li>
+     * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched horizontally to fill
+     * the width of the container</div></li>
+     * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched horizontally to
+     * the size of the largest item.</div></li>
+     * </ul></div>
+     */
+    align : 'left', // left, center, stretch, strechmax
+    type: 'vbox',
+    /**
+     * @cfg {String} pack
+     * Controls how the child items of the container are packed together. Acceptable configuration values
+     * for this property are:
+     * <div class="mdetail-params"><ul>
+     * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at
+     * <b>top</b> side of container</div></li>
+     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at
+     * <b>mid-height</b> of container</div></li>
+     * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>bottom</b>
+     * side of container</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Number} flex
+     * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed
+     * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>vertically</b>
+     * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with
+     * a <tt>flex</tt> value specified.  Any child items that have either a <tt>flex = 0</tt> or
+     * <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).
+     */
+
+    // private
+    onLayout : function(ct, target){
+        Ext.layout.VBoxLayout.superclass.onLayout.call(this, ct, target);
+
+        var cs = this.getRenderedItems(ct), csLen = cs.length,
+            c, i, cm, ch, margin, cl, diff, aw, availHeight,
+            size = this.getLayoutTargetSize(),
+            w = size.width,
+            h = size.height - this.scrollOffset,
+            l = this.padding.left,
+            t = this.padding.top,
+            isStart = this.pack == 'start',
+            extraHeight = 0,
+            maxWidth = 0,
+            totalFlex = 0,
+            usedHeight = 0,
+            idx = 0,
+            heights = [],
+            restore = [];
+
+        // Do only width calculations and apply those first, as they can affect height
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            cm = c.margins;
+            margin = cm.top + cm.bottom;
+            // Max height for align
+            maxWidth = Math.max(maxWidth, c.getWidth() + cm.left + cm.right);
+        }
+
+        var innerCtWidth = maxWidth + this.padding.left + this.padding.right;
+        switch(this.align){
+            case 'stretch':
+                this.innerCt.setSize(w, h);
+                break;
+            case 'stretchmax':
+            case 'left':
+                this.innerCt.setSize(innerCtWidth, h);
+                break;
+            case 'center':
+                this.innerCt.setSize(w = Math.max(w, innerCtWidth), h);
+                break;
+        }
+
+        var availableWidth = Math.max(0, w - this.padding.left - this.padding.right);
+        // Apply widths
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            cm = c.margins;
+            if(this.align == 'stretch'){
+                c.setWidth(((w - (this.padding.left + this.padding.right)) - (cm.left + cm.right)).constrain(
+                    c.minWidth || 0, c.maxWidth || 1000000));
+            }else if(this.align == 'stretchmax'){
+                c.setWidth((maxWidth - (cm.left + cm.right)).constrain(
+                    c.minWidth || 0, c.maxWidth || 1000000));
+            }else if(isStart && c.flex){
+                c.setWidth();
+            }
+
+        }
+
+        // Height calculations
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            // Total of all the flex values
+            totalFlex += c.flex || 0;
+            // Don't run height calculations on flexed items
+            if (!c.flex) {
+                // Render and layout sub-containers without a flex or height, once
+                if (!c.height && !c.hasLayout && c.doLayout) {
+                    c.doLayout();
+                }
+                ch = c.getHeight();
+            } else {
+                ch = 0;
+            }
+
+            cm = c.margins;
+            // Determine how much height is available to flex
+            extraHeight += ch + cm.top + cm.bottom;
+        }
+        // Final avail height calc
+        availHeight = Math.max(0, (h - extraHeight - this.padding.top - this.padding.bottom));
+
+        var leftOver = availHeight;
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            if(isStart && c.flex){
+                ch = Math.floor(availHeight * (c.flex / totalFlex));
+                leftOver -= ch;
+                heights.push(ch);
+            }
+        }
+        if(this.pack == 'center'){
+            t += availHeight ? availHeight / 2 : 0;
+        }else if(this.pack == 'end'){
+            t += availHeight;
+        }
+        idx = 0;
+        // Apply heights
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            cm = c.margins;
+            t += cm.top;
+            aw = availableWidth;
+            cl = l + cm.left // default left pos
+
+            // Adjust left pos for centering
+            if(this.align == 'center'){
+                if((diff = availableWidth - (c.getWidth() + cm.left + cm.right)) > 0){
+                    cl += (diff/2);
+                    aw -= diff;
+                }
+            }
+
+            c.setPosition(cl, t);
+            if(isStart && c.flex){
+                ch = Math.max(0, heights[idx++] + (leftOver-- > 0 ? 1 : 0));
+                c.setSize(aw, ch);
+            }else{
+                ch = c.getHeight();
+            }
+            t += ch + cm.bottom;
+        }
+        // Putting a box layout into an overflowed container is NOT correct and will make a second layout pass necessary.
+        if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) {
+            var ts = this.getLayoutTargetSize();
+            if (ts.width != size.width || ts.height != size.height){
+                this.adjustmentPass = true;
+                this.onLayout(ct, target);
+            }
+        }
+        delete this.adjustmentPass;
+    }
+});
+
+Ext.Container.LAYOUTS.vbox = Ext.layout.VBoxLayout;
+
+/**
+ * @class Ext.layout.HBoxLayout
+ * @extends Ext.layout.BoxLayout
+ * <p>A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
+ * space between child items containing a numeric <code>flex</code> configuration.</p>
+ * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
+ */
+Ext.layout.HBoxLayout = Ext.extend(Ext.layout.BoxLayout, {
+    /**
+     * @cfg {String} align
+     * Controls how the child items of the container are aligned. Acceptable configuration values for this
+     * property are:
+     * <div class="mdetail-params"><ul>
+     * <li><b><tt>top</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned vertically
+     * at the <b>top</b> of the container</div></li>
+     * <li><b><tt>middle</tt></b> : <div class="sub-desc">child items are aligned vertically in the
+     * <b>middle</b> of the container</div></li>
+     * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched vertically to fill
+     * the height of the container</div></li>
+     * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched vertically to
+     * the height of the largest item.</div></li>
+     */
+    align : 'top', // top, middle, stretch, strechmax
+    type: 'hbox',
+    /**
+     * @cfg {String} pack
+     * Controls how the child items of the container are packed together. Acceptable configuration values
+     * for this property are:
+     * <div class="mdetail-params"><ul>
+     * <li><b><tt>start</tt></b> : <b>Default</b><div class="sub-desc">child items are packed together at
+     * <b>left</b> side of container</div></li>
+     * <li><b><tt>center</tt></b> : <div class="sub-desc">child items are packed together at
+     * <b>mid-width</b> of container</div></li>
+     * <li><b><tt>end</tt></b> : <div class="sub-desc">child items are packed together at <b>right</b>
+     * side of container</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Number} flex
+     * This configuation option is to be applied to <b>child <tt>items</tt></b> of the container managed
+     * by this layout. Each child item with a <tt>flex</tt> property will be flexed <b>horizontally</b>
+     * according to each item's <b>relative</b> <tt>flex</tt> value compared to the sum of all items with
+     * a <tt>flex</tt> value specified.  Any child items that have either a <tt>flex = 0</tt> or
+     * <tt>flex = undefined</tt> will not be 'flexed' (the initial size will not be changed).
+     */
+
+    // private
+    onLayout : function(ct, target){
+        Ext.layout.HBoxLayout.superclass.onLayout.call(this, ct, target);
+
+        var cs = this.getRenderedItems(ct), csLen = cs.length,
+            c, i, cm, cw, ch, diff, availWidth,
+            size = this.getLayoutTargetSize(),
+            w = size.width - this.scrollOffset,
+            h = size.height,
+            l = this.padding.left,
+            t = this.padding.top,
+            isStart = this.pack == 'start',
+            isRestore = ['stretch', 'stretchmax'].indexOf(this.align) == -1,
+            extraWidth = 0,
+            maxHeight = 0,
+            totalFlex = 0,
+            usedWidth = 0;
+
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            // Total of all the flex values
+            totalFlex += c.flex || 0;
+            // Don't run width calculations on flexed items
+            if (!c.flex) {
+                // Render and layout sub-containers without a flex or width, once
+                if (!c.width && !c.hasLayout && c.doLayout) {
+                    c.doLayout();
+                }
+                cw = c.getWidth();
+            } else {
+                cw = 0;
+            }
+            cm = c.margins;
+            // Determine how much width is available to flex
+            extraWidth += cw + cm.left + cm.right;
+            // Max height for align
+            maxHeight = Math.max(maxHeight, c.getHeight() + cm.top + cm.bottom);
+        }
+        // Final avail width calc
+        availWidth = Math.max(0, (w - extraWidth - this.padding.left - this.padding.right));
+
+        var innerCtHeight = maxHeight + this.padding.top + this.padding.bottom;
+        switch(this.align){
+            case 'stretch':
+                this.innerCt.setSize(w, h);
+                break;
+            case 'stretchmax':
+            case 'top':
+                this.innerCt.setSize(w, innerCtHeight);
+                break;
+            case 'middle':
+                this.innerCt.setSize(w, h = Math.max(h, innerCtHeight));
+                break;
+        }
+
+        var leftOver = availWidth,
+            widths = [],
+            restore = [],
+            idx = 0,
+            availableHeight = Math.max(0, h - this.padding.top - this.padding.bottom);
+
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            if(isStart && c.flex){
+                cw = Math.floor(availWidth * (c.flex / totalFlex));
+                leftOver -= cw;
+                widths.push(cw);
+            }
+        }
+
+        if(this.pack == 'center'){
+            l += availWidth ? availWidth / 2 : 0;
+        }else if(this.pack == 'end'){
+            l += availWidth;
+        }
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            cm = c.margins;
+            l += cm.left;
+            c.setPosition(l, t + cm.top);
+            if(isStart && c.flex){
+                cw = Math.max(0, widths[idx++] + (leftOver-- > 0 ? 1 : 0));
+                if(isRestore){
+                    restore.push(c.getHeight());
+                }
+                c.setSize(cw, availableHeight);
+            }else{
+                cw = c.getWidth();
+            }
+            l += cw + cm.right;
+        }
+
+        idx = 0;
+        for (i = 0 ; i < csLen; i++) {
+            c = cs[i];
+            cm = c.margins;
+            ch = c.getHeight();
+            if(isStart && c.flex){
+                ch = restore[idx++];
+            }
+            if(this.align == 'stretch'){
+                c.setHeight(((h - (this.padding.top + this.padding.bottom)) - (cm.top + cm.bottom)).constrain(
+                    c.minHeight || 0, c.maxHeight || 1000000));
+            }else if(this.align == 'stretchmax'){
+                c.setHeight((maxHeight - (cm.top + cm.bottom)).constrain(
+                    c.minHeight || 0, c.maxHeight || 1000000));
+            }else{
+                if(this.align == 'middle'){
+                    diff = availableHeight - (ch + cm.top + cm.bottom);
+                    ch = t + cm.top + (diff/2);
+                    if(diff > 0){
+                        c.setPosition(c.x, ch);
+                    }
+                }
+                if(isStart && c.flex){
+                    c.setHeight(ch);
+                }
+            }
+        }
+        // Putting a box layout into an overflowed container is NOT correct and will make a second layout pass necessary.
+        if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) {
+            var ts = this.getLayoutTargetSize();
+            if (ts.width != size.width || ts.height != size.height){
+                this.adjustmentPass = true;
+                this.onLayout(ct, target);
+            }
+        }
+        delete this.adjustmentPass;
+    }
+});
+
+Ext.Container.LAYOUTS.hbox = Ext.layout.HBoxLayout;
+/**
+ * @class Ext.layout.ToolbarLayout
+ * @extends Ext.layout.ContainerLayout
+ * Layout manager implicitly used by Ext.Toolbar.
+ */
+Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    monitorResize : true,
+    triggerWidth : 18,
+    lastOverflow : false,
+
+    noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',
+
+    // private
+    onLayout : function(ct, target){
+        if(!this.leftTr){
+            var align = ct.buttonAlign == 'center' ? 'center' : 'left';
+            target.addClass('x-toolbar-layout-ct');
+            target.insertHtml('beforeEnd',
+                 '<table cellspacing="0" class="x-toolbar-ct"><tbody><tr><td class="x-toolbar-left" align="' + align + '"><table cellspacing="0"><tbody><tr class="x-toolbar-left-row"></tr></tbody></table></td><td class="x-toolbar-right" align="right"><table cellspacing="0" class="x-toolbar-right-ct"><tbody><tr><td><table cellspacing="0"><tbody><tr class="x-toolbar-right-row"></tr></tbody></table></td><td><table cellspacing="0"><tbody><tr class="x-toolbar-extras-row"></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>');
+            this.leftTr = target.child('tr.x-toolbar-left-row', true);
+            this.rightTr = target.child('tr.x-toolbar-right-row', true);
+            this.extrasTr = target.child('tr.x-toolbar-extras-row', true);
+        }
+
+        var side = ct.buttonAlign == 'right' ? this.rightTr : this.leftTr,
+            pos = 0,
+            items = ct.items.items;
+
+        for(var i = 0, len = items.length, c; i < len; i++, pos++) {
+            c = items[i];
+            if(c.isFill){
+                side = this.rightTr;
+                pos = -1;
+            }else if(!c.rendered){
+                c.render(this.insertCell(c, side, pos));
+            }else{
+                if(!c.xtbHidden && !this.isValidParent(c, side.childNodes[pos])){
+                    var td = this.insertCell(c, side, pos);
+                    td.appendChild(c.getPositionEl().dom);
+                    c.container = Ext.get(td);
+                }
+            }
+        }
+        //strip extra empty cells
+        this.cleanup(this.leftTr);
+        this.cleanup(this.rightTr);
+        this.cleanup(this.extrasTr);
+        this.fitToSize(target);
+    },
+
+    cleanup : function(row){
+        var cn = row.childNodes, i, c;
+        for(i = cn.length-1; i >= 0 && (c = cn[i]); i--){
+            if(!c.firstChild){
+                row.removeChild(c);
+            }
+        }
+    },
+
+    insertCell : function(c, side, pos){
+        var td = document.createElement('td');
+        td.className='x-toolbar-cell';
+        side.insertBefore(td, side.childNodes[pos]||null);
+        return td;
+    },
+
+    hideItem : function(item){
+        var h = (this.hiddens = this.hiddens || []);
+        h.push(item);
+        item.xtbHidden = true;
+        item.xtbWidth = item.getPositionEl().dom.parentNode.offsetWidth;
+        item.hide();
+    },
+
+    unhideItem : function(item){
+        item.show();
+        item.xtbHidden = false;
+        this.hiddens.remove(item);
+        if(this.hiddens.length < 1){
+            delete this.hiddens;
+        }
+    },
+
+    getItemWidth : function(c){
+        return c.hidden ? (c.xtbWidth || 0) : c.getPositionEl().dom.parentNode.offsetWidth;
+    },
+
+    fitToSize : function(t){
+        if(this.container.enableOverflow === false){
+            return;
+        }
+        var w = t.dom.clientWidth,
+            lw = this.lastWidth || 0,
+            iw = t.dom.firstChild.offsetWidth,
+            clipWidth = w - this.triggerWidth,
+            hideIndex = -1;
+
+        this.lastWidth = w;
+
+        if(iw > w || (this.hiddens && w >= lw)){
+            var i, items = this.container.items.items,
+                len = items.length, c,
+                loopWidth = 0;
+
+            for(i = 0; i < len; i++) {
+                c = items[i];
+                if(!c.isFill){
+                    loopWidth += this.getItemWidth(c);
+                    if(loopWidth > clipWidth){
+                        if(!(c.hidden || c.xtbHidden)){
+                            this.hideItem(c);
+                        }
+                    }else if(c.xtbHidden){
+                        this.unhideItem(c);
+                    }
+                }
+            }
+        }
+        if(this.hiddens){
+            this.initMore();
+            if(!this.lastOverflow){
+                this.container.fireEvent('overflowchange', this.container, true);
+                this.lastOverflow = true;
+            }
+        }else if(this.more){
+            this.clearMenu();
+            this.more.destroy();
+            delete this.more;
+            if(this.lastOverflow){
+                this.container.fireEvent('overflowchange', this.container, false);
+                this.lastOverflow = false;
+            }
+        }
+    },
+
+    createMenuConfig : function(c, hideOnClick){
+        var cfg = Ext.apply({}, c.initialConfig),
+            group = c.toggleGroup;
+
+        Ext.apply(cfg, {
+            text: c.overflowText || c.text,
+            iconCls: c.iconCls,
+            icon: c.icon,
+            itemId: c.itemId,
+            disabled: c.disabled,
+            handler: c.handler,
+            scope: c.scope,
+            menu: c.menu,
+            hideOnClick: hideOnClick
+        });
+        if(group || c.enableToggle){
+            Ext.apply(cfg, {
+                group: group,
+                checked: c.pressed,
+                listeners: {
+                    checkchange: function(item, checked){
+                        c.toggle(checked);
+                    }
+                }
+            });
+        }
+        delete cfg.ownerCt;
+        delete cfg.xtype;
+        delete cfg.id;
+        return cfg;
+    },
+
+    // private
+    addComponentToMenu : function(m, c){
+        if(c instanceof Ext.Toolbar.Separator){
+            m.add('-');
+        }else if(Ext.isFunction(c.isXType)){
+            if(c.isXType('splitbutton')){
+                m.add(this.createMenuConfig(c, true));
+            }else if(c.isXType('button')){
+                m.add(this.createMenuConfig(c, !c.menu));
+            }else if(c.isXType('buttongroup')){
+                c.items.each(function(item){
+                     this.addComponentToMenu(m, item);
+                }, this);
+            }
+        }
+    },
+
+    clearMenu : function(){
+        var m = this.moreMenu;
+        if(m && m.items){
+            m.items.each(function(item){
+                delete item.menu;
+            });
+        }
+    },
+
+    // private
+    beforeMoreShow : function(m){
+        var h = this.container.items.items,
+            len = h.length,
+            c,
+            prev,
+            needsSep = function(group, item){
+                return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator);
+            };
+
+        this.clearMenu();
+        m.removeAll();
+        for(var i = 0; i < len; i++){
+            c = h[i];
+            if(c.xtbHidden){
+                if(prev && (needsSep(c, prev) || needsSep(prev, c))){
+                    m.add('-');
+                }
+                this.addComponentToMenu(m, c);
+                prev = c;
+            }
+        }
+        // put something so the menu isn't empty
+        // if no compatible items found
+        if(m.items.length < 1){
+            m.add(this.noItemsMenuText);
+        }
+    },
+
+    initMore : function(){
+        if(!this.more){
+            this.moreMenu = new Ext.menu.Menu({
+                ownerCt : this.container,
+                listeners: {
+                    beforeshow: this.beforeMoreShow,
+                    scope: this
+                }
+
+            });
+            this.more = new Ext.Button({
+                iconCls : 'x-toolbar-more-icon',
+                cls     : 'x-toolbar-more',
+                menu    : this.moreMenu,
+                ownerCt : this.container
+            });
+            var td = this.insertCell(this.more, this.extrasTr, 100);
+            this.more.render(td);
+        }
+    },
+
+    destroy : function(){
+        Ext.destroy(this.more, this.moreMenu);
+        delete this.leftTr;
+        delete this.rightTr;
+        delete this.extrasTr;
+        Ext.layout.ToolbarLayout.superclass.destroy.call(this);
+    }
+});
+
+Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;/**
+ * @class Ext.layout.MenuLayout
+ * @extends Ext.layout.ContainerLayout
+ * <p>Layout manager used by {@link Ext.menu.Menu}. Generally this class should not need to be used directly.</p>
+ */
+ Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, {
+    monitorResize : true,
+
+    setContainer : function(ct){
+        this.monitorResize = !ct.floating;
+        // This event is only fired by the menu in IE, used so we don't couple
+        // the menu with the layout.
+        ct.on('autosize', this.doAutoSize, this);
+        Ext.layout.MenuLayout.superclass.setContainer.call(this, ct);
+    },
+
+    renderItem : function(c, position, target){
+        if (!this.itemTpl) {
+            this.itemTpl = Ext.layout.MenuLayout.prototype.itemTpl = new Ext.XTemplate(
+                '<li id="{itemId}" class="{itemCls}">',
+                    '<tpl if="needsIcon">',
+                        '<img src="{icon}" class="{iconCls}"/>',
+                    '</tpl>',
+                '</li>'
+            );
+        }
+
+        if(c && !c.rendered){
+            if(Ext.isNumber(position)){
+                position = target.dom.childNodes[position];
+            }
+            var a = this.getItemArgs(c);
+
+//          The Component's positionEl is the <li> it is rendered into
+            c.render(c.positionEl = position ?
+                this.itemTpl.insertBefore(position, a, true) :
+                this.itemTpl.append(target, a, true));
+
+//          Link the containing <li> to the item.
+            c.positionEl.menuItemId = c.getItemId();
+
+//          If rendering a regular Component, and it needs an icon,
+//          move the Component rightwards.
+            if (!a.isMenuItem && a.needsIcon) {
+                c.positionEl.addClass('x-menu-list-item-indent');
+            }
+            this.configureItem(c, position);
+        }else if(c && !this.isValidParent(c, target)){
+            if(Ext.isNumber(position)){
+                position = target.dom.childNodes[position];
+            }
+            target.dom.insertBefore(c.getActionEl().dom, position || null);
+        }
+    },
+
+    getItemArgs : function(c) {
+        var isMenuItem = c instanceof Ext.menu.Item;
+        return {
+            isMenuItem: isMenuItem,
+            needsIcon: !isMenuItem && (c.icon || c.iconCls),
+            icon: c.icon || Ext.BLANK_IMAGE_URL,
+            iconCls: 'x-menu-item-icon ' + (c.iconCls || ''),
+            itemId: 'x-menu-el-' + c.id,
+            itemCls: 'x-menu-list-item '
+        };
+    },
+
+    //  Valid if the Component is in a <li> which is part of our target <ul>
+    isValidParent : function(c, target) {
+        return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target);
+    },
+
+    onLayout : function(ct, target){
+        Ext.layout.MenuLayout.superclass.onLayout.call(this, ct, target);
+        this.doAutoSize();
+    },
+
+    doAutoSize : function(){
+        var ct = this.container, w = ct.width;
+        if(ct.floating){
+            if(w){
+                ct.setWidth(w);
+            }else if(Ext.isIE){
+                ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8) ? 'auto' : ct.minWidth);
+                var el = ct.getEl(), t = el.dom.offsetWidth; // force recalc
+                ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr'));
+            }
+        }
+    }
+});
+Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout;/**\r
+ * @class Ext.Viewport\r
+ * @extends Ext.Container\r
+ * <p>A specialized container representing the viewable application area (the browser viewport).</p>\r
+ * <p>The Viewport renders itself to the document body, and automatically sizes itself to the size of\r
+ * the browser viewport and manages window resizing. There may only be one Viewport created\r
+ * in a page. Inner layouts are available by virtue of the fact that all {@link Ext.Panel Panel}s\r
+ * added to the Viewport, either through its {@link #items}, or through the items, or the {@link #add}\r
+ * method of any of its child Panels may themselves have a layout.</p>\r
+ * <p>The Viewport does not provide scrolling, so child Panels within the Viewport should provide\r
+ * for scrolling if needed using the {@link #autoScroll} config.</p>\r
+ * <p>An example showing a classic application border layout:</p><pre><code>\r
+new Ext.Viewport({\r
+    layout: 'border',\r
+    items: [{\r
+        region: 'north',\r
+        html: '&lt;h1 class="x-panel-header">Page Title&lt;/h1>',\r
+        autoHeight: true,\r
+        border: false,\r
+        margins: '0 0 5 0'\r
+    }, {\r
+        region: 'west',\r
+        collapsible: true,\r
+        title: 'Navigation',\r
+        width: 200\r
+        // the west region might typically utilize a {@link Ext.tree.TreePanel TreePanel} or a Panel with {@link Ext.layout.AccordionLayout Accordion layout}\r
+    }, {\r
+        region: 'south',\r
+        title: 'Title for Panel',\r
+        collapsible: true,\r
+        html: 'Information goes here',\r
+        split: true,\r
+        height: 100,\r
+        minHeight: 100\r
+    }, {\r
+        region: 'east',\r
+        title: 'Title for the Grid Panel',\r
+        collapsible: true,\r
+        split: true,\r
+        width: 200,\r
+        xtype: 'grid',\r
+        // remaining grid configuration not shown ...\r
+        // notice that the GridPanel is added directly as the region\r
+        // it is not "overnested" inside another Panel\r
+    }, {\r
+        region: 'center',\r
+        xtype: 'tabpanel', // TabPanel itself has no title\r
+        items: {\r
+            title: 'Default Tab',\r
+            html: 'The first tab\'s content. Others may be added dynamically'\r
+        }\r
+    }]\r
+});\r
+</code></pre>\r
+ * @constructor\r
+ * Create a new Viewport\r
+ * @param {Object} config The config object\r
+ * @xtype viewport\r
+ */\r
+Ext.Viewport = Ext.extend(Ext.Container, {\r
+    /*\r
+     * Privatize config options which, if used, would interfere with the\r
+     * correct operation of the Viewport as the sole manager of the\r
+     * layout of the document body.\r
+     */\r
     /**\r
-     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped onto\r
-     * the drop node.  The default implementation returns false, so it should be overridden to provide the\r
-     * appropriate processing of the drop event and return true so that the drag source's repair action does not run.\r
-     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
-     * {@link #getTargetFromEvent} for this node)\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {Boolean} True if the drop was valid, else false\r
+     * @cfg {Mixed} applyTo @hide\r
      */\r
-    onNodeDrop : function(n, dd, e, data){\r
-        return false;\r
-    },\r
-\r
     /**\r
-     * Called while the DropZone determines that a {@link Ext.dd.DragSource} is being dragged over it,\r
-     * but not over any of its registered drop nodes.  The default implementation returns this.dropNotAllowed, so\r
-     * it should be overridden to provide the proper feedback if necessary.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     * @cfg {Boolean} allowDomMove @hide\r
      */\r
-    onContainerOver : function(dd, e, data){\r
-        return this.dropNotAllowed;\r
-    },\r
-\r
     /**\r
-     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped on it,\r
-     * but not on any of its registered drop nodes.  The default implementation returns false, so it should be\r
-     * overridden to provide the appropriate processing of the drop event if you need the drop zone itself to\r
-     * be able to accept drops.  It should return true when valid so that the drag source's repair action does not run.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {Boolean} True if the drop was valid, else false\r
+     * @cfg {Boolean} hideParent @hide\r
+     */\r
+    /**\r
+     * @cfg {Mixed} renderTo @hide\r
      */\r
-    onContainerDrop : function(dd, e, data){\r
-        return false;\r
-    },\r
-\r
     /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source is now over\r
-     * the zone.  The default implementation returns this.dropNotAllowed and expects that only registered drop\r
-     * nodes can process drag drop operations, so if you need the drop zone itself to be able to process drops\r
-     * you should override this method and provide a custom implementation.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     * @cfg {Boolean} hideParent @hide\r
      */\r
-    notifyEnter : function(dd, e, data){\r
-        return this.dropNotAllowed;\r
-    },\r
-\r
     /**\r
-     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the drop zone.\r
-     * This method will be called on every mouse movement while the drag source is over the drop zone.\r
-     * It will call {@link #onNodeOver} while the drag source is over a registered node, and will also automatically\r
-     * delegate to the appropriate node-specific methods as necessary when the drag source enters and exits\r
-     * registered nodes ({@link #onNodeEnter}, {@link #onNodeOut}). If the drag source is not currently over a\r
-     * registered node, it will call {@link #onContainerOver}.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
-     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     * @cfg {Number} height @hide\r
      */\r
-    notifyOver : function(dd, e, data){\r
-        var n = this.getTargetFromEvent(e);\r
-        if(!n){ // not over valid drop target\r
-            if(this.lastOverNode){\r
-                this.onNodeOut(this.lastOverNode, dd, e, data);\r
-                this.lastOverNode = null;\r
-            }\r
-            return this.onContainerOver(dd, e, data);\r
-        }\r
-        if(this.lastOverNode != n){\r
-            if(this.lastOverNode){\r
-                this.onNodeOut(this.lastOverNode, dd, e, data);\r
-            }\r
-            this.onNodeEnter(n, dd, e, data);\r
-            this.lastOverNode = n;\r
-        }\r
-        return this.onNodeOver(n, dd, e, data);\r
-    },\r
-\r
     /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source has been dragged\r
-     * out of the zone without dropping.  If the drag source is currently over a registered node, the notification\r
-     * will be delegated to {@link #onNodeOut} for node-specific handling, otherwise it will be ignored.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag zone\r
+     * @cfg {Number} width @hide\r
      */\r
-    notifyOut : function(dd, e, data){\r
-        if(this.lastOverNode){\r
-            this.onNodeOut(this.lastOverNode, dd, e, data);\r
-            this.lastOverNode = null;\r
-        }\r
-    },\r
-\r
     /**\r
-     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the dragged item has\r
-     * been dropped on it.  The drag zone will look up the target node based on the event passed in, and if there\r
-     * is a node registered for that event, it will delegate to {@link #onNodeDrop} for node-specific handling,\r
-     * otherwise it will call {@link #onContainerDrop}.\r
-     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
-     * @param {Event} e The event\r
-     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
-     * @return {Boolean} True if the drop was valid, else false\r
+     * @cfg {Boolean} autoHeight @hide\r
      */\r
-    notifyDrop : function(dd, e, data){\r
-        if(this.lastOverNode){\r
-            this.onNodeOut(this.lastOverNode, dd, e, data);\r
-            this.lastOverNode = null;\r
-        }\r
-        var n = this.getTargetFromEvent(e);\r
-        return n ?\r
-            this.onNodeDrop(n, dd, e, data) :\r
-            this.onContainerDrop(dd, e, data);\r
-    },\r
-\r
-    // private\r
-    triggerCacheRefresh : function(){\r
-        Ext.dd.DDM.refreshCache(this.groups);\r
-    }  \r
-});/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods({\r
     /**\r
-     * Initializes a {@link Ext.dd.DD} drag drop object for this element.\r
-     * @param {String} group The group the DD object is member of\r
-     * @param {Object} config The DD config object\r
-     * @param {Object} overrides An object containing methods to override/implement on the DD object\r
-     * @return {Ext.dd.DD} The DD object\r
+     * @cfg {Boolean} autoWidth @hide\r
      */\r
-    initDD : function(group, config, overrides){\r
-        var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);\r
-        return Ext.apply(dd, overrides);\r
-    },\r
-\r
     /**\r
-     * Initializes a {@link Ext.dd.DDProxy} object for this element.\r
-     * @param {String} group The group the DDProxy object is member of\r
-     * @param {Object} config The DDProxy config object\r
-     * @param {Object} overrides An object containing methods to override/implement on the DDProxy object\r
-     * @return {Ext.dd.DDProxy} The DDProxy object\r
+     * @cfg {Boolean} deferHeight @hide\r
      */\r
-    initDDProxy : function(group, config, overrides){\r
-        var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);\r
-        return Ext.apply(dd, overrides);\r
-    },\r
-\r
     /**\r
-     * Initializes a {@link Ext.dd.DDTarget} object for this element.\r
-     * @param {String} group The group the DDTarget object is member of\r
-     * @param {Object} config The DDTarget config object\r
-     * @param {Object} overrides An object containing methods to override/implement on the DDTarget object\r
-     * @return {Ext.dd.DDTarget} The DDTarget object\r
+     * @cfg {Boolean} monitorResize @hide\r
      */\r
-    initDDTarget : function(group, config, overrides){\r
-        var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);\r
-        return Ext.apply(dd, overrides);\r
+\r
+    initComponent : function() {\r
+        Ext.Viewport.superclass.initComponent.call(this);\r
+        document.getElementsByTagName('html')[0].className += ' x-viewport';\r
+        this.el = Ext.getBody();\r
+        this.el.setHeight = Ext.emptyFn;\r
+        this.el.setWidth = Ext.emptyFn;\r
+        this.el.setSize = Ext.emptyFn;\r
+        this.el.dom.scroll = 'no';\r
+        this.allowDomMove = false;\r
+        this.autoWidth = true;\r
+        this.autoHeight = true;\r
+        Ext.EventManager.onWindowResize(this.fireResize, this);\r
+        this.renderTo = this.el;\r
+    },\r
+\r
+    fireResize : function(w, h){\r
+        this.fireEvent('resize', this, w, h, w, h);\r
     }\r
-});/**
- * @class Ext.data.Api
- * @extends Object
- * Ext.data.Api is a singleton designed to manage the data API including methods
- * for validating a developer's DataProxy API.  Defines variables for CRUD actions
- * create, read, update and destroy in addition to a mapping of RESTful HTTP methods
- * GET, POST, PUT and DELETE to CRUD actions.
- * @singleton
+});\r
+Ext.reg('viewport', Ext.Viewport);\r
+/**
+ * @class Ext.Panel
+ * @extends Ext.Container
+ * <p>Panel is a container that has specific functionality and structural components that make
+ * it the perfect building block for application-oriented user interfaces.</p>
+ * <p>Panels are, by virtue of their inheritance from {@link Ext.Container}, capable
+ * of being configured with a {@link Ext.Container#layout layout}, and containing child Components.</p>
+ * <p>When either specifying child {@link Ext.Component#items items} of a Panel, or dynamically {@link Ext.Container#add adding} Components
+ * to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether
+ * those child elements need to be sized using one of Ext's built-in <code><b>{@link Ext.Container#layout layout}</b></code> schemes. By
+ * default, Panels use the {@link Ext.layout.ContainerLayout ContainerLayout} scheme. This simply renders
+ * child components, appending them one after the other inside the Container, and <b>does not apply any sizing</b>
+ * at all.</p>
+ * <p>A Panel may also contain {@link #bbar bottom} and {@link #tbar top} toolbars, along with separate
+ * {@link #header}, {@link #footer} and {@link #body} sections (see {@link #frame} for additional
+ * information).</p>
+ * <p>Panel also provides built-in {@link #collapsible expandable and collapsible behavior}, along with
+ * a variety of {@link #tools prebuilt tool buttons} that can be wired up to provide other customized
+ * behavior.  Panels can be easily dropped into any {@link Ext.Container Container} or layout, and the
+ * layout and rendering pipeline is {@link Ext.Container#add completely managed by the framework}.</p>
+ * @constructor
+ * @param {Object} config The config object
+ * @xtype panel
  */
-Ext.data.Api = (function() {
+Ext.Panel = Ext.extend(Ext.Container, {
+    /**
+     * The Panel's header {@link Ext.Element Element}. Read-only.
+     * <p>This Element is used to house the {@link #title} and {@link #tools}</p>
+     * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
+     * @type Ext.Element
+     * @property header
+     */
+    /**
+     * The Panel's body {@link Ext.Element Element} which may be used to contain HTML content.
+     * The content may be specified in the {@link #html} config, or it may be loaded using the
+     * {@link autoLoad} config, or through the Panel's {@link #getUpdater Updater}. Read-only.
+     * <p>If this is used to load visible HTML elements in either way, then
+     * the Panel may not be used as a Layout for hosting nested Panels.</p>
+     * <p>If this Panel is intended to be used as the host of a Layout (See {@link #layout}
+     * then the body Element must not be loaded or changed - it is under the control
+     * of the Panel's Layout.
+     * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
+     * @type Ext.Element
+     * @property body
+     */
+    /**
+     * The Panel's bwrap {@link Ext.Element Element} used to contain other Panel elements
+     * (tbar, body, bbar, footer). See {@link #bodyCfg}. Read-only.
+     * @type Ext.Element
+     * @property bwrap
+     */
+    /**
+     * True if this panel is collapsed. Read-only.
+     * @type Boolean
+     * @property collapsed
+     */
+    /**
+     * @cfg {Object} bodyCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object may be specified for any
+     * Panel Element.</p>
+     * <p>By default, the Default element in the table below will be used for the html markup to
+     * create a child element with the commensurate Default class name (<code>baseCls</code> will be
+     * replaced by <code>{@link #baseCls}</code>):</p>
+     * <pre>
+     * Panel      Default  Default             Custom      Additional       Additional
+     * Element    element  class               element     class            style
+     * ========   ==========================   =========   ==============   ===========
+     * {@link #header}     div      {@link #baseCls}+'-header'   {@link #headerCfg}   headerCssClass   headerStyle
+     * {@link #bwrap}      div      {@link #baseCls}+'-bwrap'     {@link #bwrapCfg}    bwrapCssClass    bwrapStyle
+     * + tbar     div      {@link #baseCls}+'-tbar'       {@link #tbarCfg}     tbarCssClass     tbarStyle
+     * + {@link #body}     div      {@link #baseCls}+'-body'       {@link #bodyCfg}     {@link #bodyCssClass}     {@link #bodyStyle}
+     * + bbar     div      {@link #baseCls}+'-bbar'       {@link #bbarCfg}     bbarCssClass     bbarStyle
+     * + {@link #footer}   div      {@link #baseCls}+'-footer'   {@link #footerCfg}   footerCssClass   footerStyle
+     * </pre>
+     * <p>Configuring a Custom element may be used, for example, to force the {@link #body} Element
+     * to use a different form of markup than is created by default. An example of this might be
+     * to {@link Ext.Element#createChild create a child} Panel containing a custom content, such as
+     * a header, or forcing centering of all Panel content by having the body be a &lt;center&gt;
+     * element:</p>
+     * <pre><code>
+new Ext.Panel({
+    title: 'Message Title',
+    renderTo: Ext.getBody(),
+    width: 200, height: 130,
+    <b>bodyCfg</b>: {
+        tag: 'center',
+        cls: 'x-panel-body',  // Default class not applied if Custom element specified
+        html: 'Message'
+    },
+    footerCfg: {
+        tag: 'h2',
+        cls: 'x-panel-footer'        // same as the Default class
+        html: 'footer html'
+    },
+    footerCssClass: 'custom-footer', // additional css class, see {@link Ext.element#addClass addClass}
+    footerStyle:    'background-color:red' // see {@link #bodyStyle}
+});
+     * </code></pre>
+     * <p>The example above also explicitly creates a <code>{@link #footer}</code> with custom markup and
+     * styling applied.</p>
+     */
+    /**
+     * @cfg {Object} headerCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
+     * of this Panel's {@link #header} Element.  See <code>{@link #bodyCfg}</code> also.</p>
+     */
+    /**
+     * @cfg {Object} bwrapCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
+     * of this Panel's {@link #bwrap} Element.  See <code>{@link #bodyCfg}</code> also.</p>
+     */
+    /**
+     * @cfg {Object} tbarCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
+     * of this Panel's {@link #tbar} Element.  See <code>{@link #bodyCfg}</code> also.</p>
+     */
+    /**
+     * @cfg {Object} bbarCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
+     * of this Panel's {@link #bbar} Element.  See <code>{@link #bodyCfg}</code> also.</p>
+     */
+    /**
+     * @cfg {Object} footerCfg
+     * <p>A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
+     * of this Panel's {@link #footer} Element.  See <code>{@link #bodyCfg}</code> also.</p>
+     */
+    /**
+     * @cfg {Boolean} closable
+     * Panels themselves do not directly support being closed, but some Panel subclasses do (like
+     * {@link Ext.Window}) or a Panel Class within an {@link Ext.TabPanel}.  Specify <code>true</code>
+     * to enable closing in such situations. Defaults to <code>false</code>.
+     */
+    /**
+     * The Panel's footer {@link Ext.Element Element}. Read-only.
+     * <p>This Element is used to house the Panel's <code>{@link #buttons}</code> or <code>{@link #fbar}</code>.</p>
+     * <br><p><b>Note</b>: see the Note for <code>{@link Ext.Component#el el}</code> also.</p>
+     * @type Ext.Element
+     * @property footer
+     */
+    /**
+     * @cfg {Mixed} applyTo
+     * <p>The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in
+     * the document that specifies some panel-specific structural markup.  When <code>applyTo</code> is used,
+     * constituent parts of the panel can be specified by CSS class name within the main element, and the panel
+     * will automatically create those components from that markup. Any required components not specified in the
+     * markup will be autogenerated if necessary.</p>
+     * <p>The following class names are supported (baseCls will be replaced by {@link #baseCls}):</p>
+     * <ul><li>baseCls + '-header'</li>
+     * <li>baseCls + '-header-text'</li>
+     * <li>baseCls + '-bwrap'</li>
+     * <li>baseCls + '-tbar'</li>
+     * <li>baseCls + '-body'</li>
+     * <li>baseCls + '-bbar'</li>
+     * <li>baseCls + '-footer'</li></ul>
+     * <p>Using this config, a call to render() is not required.  If applyTo is specified, any value passed for
+     * {@link #renderTo} will be ignored and the target element's parent node will automatically be used as the
+     * panel's container.</p>
+     */
+    /**
+     * @cfg {Object/Array} tbar
+     * <p>The top toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
+     * buttons/button configs to be added to the toolbar.  Note that this is not available as a property after render.
+     * To access the top toolbar after render, use {@link #getTopToolbar}.</p>
+     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> be updated by a load
+     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
+     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
+     * submission parameters are collected from the DOM tree.</p>
+     */
+    /**
+     * @cfg {Object/Array} bbar
+     * <p>The bottom toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
+     * buttons/button configs to be added to the toolbar.  Note that this is not available as a property after render.
+     * To access the bottom toolbar after render, use {@link #getBottomToolbar}.</p>
+     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> be updated by a load
+     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
+     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
+     * submission parameters are collected from the DOM tree.</p>
+     */
+    /** @cfg {Object/Array} fbar
+     * <p>A {@link Ext.Toolbar Toolbar} object, a Toolbar config, or an array of
+     * {@link Ext.Button Button}s/{@link Ext.Button Button} configs, describing a {@link Ext.Toolbar Toolbar} to be rendered into this Panel's footer element.</p>
+     * <p>After render, the <code>fbar</code> property will be an {@link Ext.Toolbar Toolbar} instance.</p>
+     * <p>If <code>{@link #buttons}</code> are specified, they will supersede the <code>fbar</code> configuration property.</p>
+     * The Panel's <code>{@link #buttonAlign}</code> configuration affects the layout of these items, for example:
+     * <pre><code>
+var w = new Ext.Window({
+    height: 250,
+    width: 500,
+    bbar: new Ext.Toolbar({
+        items: [{
+            text: 'bbar Left'
+        },'->',{
+            text: 'bbar Right'
+        }]
+    }),
+    {@link #buttonAlign}: 'left', // anything but 'center' or 'right' and you can use '-', and '->'
+                                  // to control the alignment of fbar items
+    fbar: [{
+        text: 'fbar Left'
+    },'->',{
+        text: 'fbar Right'
+    }]
+}).show();
+     * </code></pre>
+     * <p><b>Note:</b> Although a Toolbar may contain Field components, these will <b>not</b> be updated by a load
+     * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container->Component hierarchy, and
+     * so are not scanned to collect form items. However, the values <b>will</b> be submitted because form
+     * submission parameters are collected from the DOM tree.</p>
+     */
+    /**
+     * @cfg {Boolean} header
+     * <code>true</code> to create the Panel's header element explicitly, <code>false</code> to skip creating
+     * it.  If a <code>{@link #title}</code> is set the header will be created automatically, otherwise it will not.
+     * If a <code>{@link #title}</code> is set but <code>header</code> is explicitly set to <code>false</code>, the header
+     * will not be rendered.
+     */
+    /**
+     * @cfg {Boolean} footer
+     * <code>true</code> to create the footer element explicitly, false to skip creating it. The footer
+     * will be created automatically if <code>{@link #buttons}</code> or a <code>{@link #fbar}</code> have
+     * been configured.  See <code>{@link #bodyCfg}</code> for an example.
+     */
+    /**
+     * @cfg {String} title
+     * The title text to be used as innerHTML (html tags are accepted) to display in the panel
+     * <code>{@link #header}</code> (defaults to ''). When a <code>title</code> is specified the
+     * <code>{@link #header}</code> element will automatically be created and displayed unless
+     * {@link #header} is explicitly set to <code>false</code>.  If you do not want to specify a
+     * <code>title</code> at config time, but you may want one later, you must either specify a non-empty
+     * <code>title</code> (a blank space ' ' will do) or <code>header:true</code> so that the container
+     * element will get created.
+     */
+    /**
+     * @cfg {Array} buttons
+     * <code>buttons</code> will be used as <code>{@link Ext.Container#items items}</code> for the toolbar in
+     * the footer (<code>{@link #fbar}</code>). Typically the value of this configuration property will be
+     * an array of {@link Ext.Button}s or {@link Ext.Button} configuration objects.
+     * If an item is configured with <code>minWidth</code> or the Panel is configured with <code>minButtonWidth</code>,
+     * that width will be applied to the item.
+     */
+    /**
+     * @cfg {Object/String/Function} autoLoad
+     * A valid url spec according to the Updater {@link Ext.Updater#update} method.
+     * If autoLoad is not null, the panel will attempt to load its contents
+     * immediately upon render.<p>
+     * The URL will become the default URL for this panel's {@link #body} element,
+     * so it may be {@link Ext.Element#refresh refresh}ed at any time.</p>
+     */
+    /**
+     * @cfg {Boolean} frame
+     * <code>false</code> by default to render with plain 1px square borders. <code>true</code> to render with
+     * 9 elements, complete with custom rounded corners (also see {@link Ext.Element#boxWrap}).
+     * <p>The template generated for each condition is depicted below:</p><pre><code>
+     *
+// frame = false
+&lt;div id="developer-specified-id-goes-here" class="x-panel">
 
-    // private validActions.  validActions is essentially an inverted hash of Ext.data.Api.actions, where value becomes the key.
-    // Some methods in this singleton (e.g.: getActions, getVerb) will loop through actions with the code <code>for (var verb in this.actions)</code>
-    // For efficiency, some methods will first check this hash for a match.  Those methods which do acces validActions will cache their result here.
-    // We cannot pre-define this hash since the developer may over-ride the actions at runtime.
-    var validActions = {};
+    &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:false)&lt;/span>&lt;/div>
 
-    return {
-        /**
-         * Defined actions corresponding to remote actions:
-         * <pre><code>
-actions: {
-    create  : 'create',  // Text representing the remote-action to create records on server.
-    read    : 'read',    // Text representing the remote-action to read/load data from server.
-    update  : 'update',  // Text representing the remote-action to update records on server.
-    destroy : 'destroy'  // Text representing the remote-action to destroy records on server.
-}
-         * </code></pre>
-         * @property actions
-         * @type Object
-         */
-        actions : {
-            create  : 'create',
-            read    : 'read',
-            update  : 'update',
-            destroy : 'destroy'
-        },
+    &lt;div class="x-panel-bwrap">
+        &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
+    &lt;/div>
+&lt;/div>
 
-        /**
-         * Defined {CRUD action}:{HTTP method} pairs to associate HTTP methods with the
-         * corresponding actions for {@link Ext.data.DataProxy#restful RESTful proxies}.
-         * Defaults to:
-         * <pre><code>
-restActions : {
-    create  : 'POST',
-    read    : 'GET',
-    update  : 'PUT',
-    destroy : 'DELETE'
-},
-         * </code></pre>
-         */
-        restActions : {
-            create  : 'POST',
-            read    : 'GET',
-            update  : 'PUT',
-            destroy : 'DELETE'
-        },
+// frame = true (create 9 elements)
+&lt;div id="developer-specified-id-goes-here" class="x-panel">
+    &lt;div class="x-panel-tl">&lt;div class="x-panel-tr">&lt;div class="x-panel-tc">
+        &lt;div class="x-panel-header">&lt;span class="x-panel-header-text">Title: (frame:true)&lt;/span>&lt;/div>
+    &lt;/div>&lt;/div>&lt;/div>
 
-        /**
-         * Returns true if supplied action-name is a valid API action defined in <code>{@link #actions}</code> constants
-         * @param {String} action
-         * @param {String[]}(Optional) List of available CRUD actions.  Pass in list when executing multiple times for efficiency.
-         * @return {Boolean}
-         */
-        isAction : function(action) {
-            return (Ext.data.Api.actions[action]) ? true : false;
-        },
+    &lt;div class="x-panel-bwrap">
+        &lt;div class="x-panel-ml">&lt;div class="x-panel-mr">&lt;div class="x-panel-mc">
+            &lt;div class="x-panel-body">&lt;p>html value goes here&lt;/p>&lt;/div>
+        &lt;/div>&lt;/div>&lt;/div>
+
+        &lt;div class="x-panel-bl">&lt;div class="x-panel-br">&lt;div class="x-panel-bc"/>
+        &lt;/div>&lt;/div>&lt;/div>
+&lt;/div>
+     * </code></pre>
+     */
+    /**
+     * @cfg {Boolean} border
+     * True to display the borders of the panel's body element, false to hide them (defaults to true).  By default,
+     * the border is a 2px wide inset border, but this can be further altered by setting {@link #bodyBorder} to false.
+     */
+    /**
+     * @cfg {Boolean} bodyBorder
+     * True to display an interior border on the body element of the panel, false to hide it (defaults to true).
+     * This only applies when {@link #border} == true.  If border == true and bodyBorder == false, the border will display
+     * as a 1px wide inset border, giving the entire body element an inset appearance.
+     */
+    /**
+     * @cfg {String/Object/Function} bodyCssClass
+     * Additional css class selector to be applied to the {@link #body} element in the format expected by
+     * {@link Ext.Element#addClass} (defaults to null). See {@link #bodyCfg}.
+     */
+    /**
+     * @cfg {String/Object/Function} bodyStyle
+     * Custom CSS styles to be applied to the {@link #body} element in the format expected by
+     * {@link Ext.Element#applyStyles} (defaults to null). See {@link #bodyCfg}.
+     */
+    /**
+     * @cfg {String} iconCls
+     * The CSS class selector that specifies a background image to be used as the header icon (defaults to '').
+     * <p>An example of specifying a custom icon class would be something like:
+     * </p><pre><code>
+// specify the property in the config for the class:
+     ...
+     iconCls: 'my-icon'
+
+// css class that specifies background image to be used as the icon image:
+.my-icon { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }
+</code></pre>
+     */
+    /**
+     * @cfg {Boolean} collapsible
+     * True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into
+     * the header tool button area, false to keep the panel statically sized with no button (defaults to false).
+     */
+    /**
+     * @cfg {Array} tools
+     * An array of tool button configs to be added to the header tool area. When rendered, each tool is
+     * stored as an {@link Ext.Element Element} referenced by a public property called <code><b></b>tools.<i>&lt;tool-type&gt;</i></code>
+     * <p>Each tool config may contain the following properties:
+     * <div class="mdetail-params"><ul>
+     * <li><b>id</b> : String<div class="sub-desc"><b>Required.</b> The type
+     * of tool to create. By default, this assigns a CSS class of the form <code>x-tool-<i>&lt;tool-type&gt;</i></code> to the
+     * resulting tool Element. Ext provides CSS rules, and an icon sprite containing images for the tool types listed below.
+     * The developer may implement custom tools by supplying alternate CSS rules and background images:
+     * <ul>
+     * <div class="x-tool x-tool-toggle" style="float:left; margin-right:5;"> </div><div><code> toggle</code> (Created by default when {@link #collapsible} is <code>true</code>)</div>
+     * <div class="x-tool x-tool-close" style="float:left; margin-right:5;"> </div><div><code> close</code></div>
+     * <div class="x-tool x-tool-minimize" style="float:left; margin-right:5;"> </div><div><code> minimize</code></div>
+     * <div class="x-tool x-tool-maximize" style="float:left; margin-right:5;"> </div><div><code> maximize</code></div>
+     * <div class="x-tool x-tool-restore" style="float:left; margin-right:5;"> </div><div><code> restore</code></div>
+     * <div class="x-tool x-tool-gear" style="float:left; margin-right:5;"> </div><div><code> gear</code></div>
+     * <div class="x-tool x-tool-pin" style="float:left; margin-right:5;"> </div><div><code> pin</code></div>
+     * <div class="x-tool x-tool-unpin" style="float:left; margin-right:5;"> </div><div><code> unpin</code></div>
+     * <div class="x-tool x-tool-right" style="float:left; margin-right:5;"> </div><div><code> right</code></div>
+     * <div class="x-tool x-tool-left" style="float:left; margin-right:5;"> </div><div><code> left</code></div>
+     * <div class="x-tool x-tool-up" style="float:left; margin-right:5;"> </div><div><code> up</code></div>
+     * <div class="x-tool x-tool-down" style="float:left; margin-right:5;"> </div><div><code> down</code></div>
+     * <div class="x-tool x-tool-refresh" style="float:left; margin-right:5;"> </div><div><code> refresh</code></div>
+     * <div class="x-tool x-tool-minus" style="float:left; margin-right:5;"> </div><div><code> minus</code></div>
+     * <div class="x-tool x-tool-plus" style="float:left; margin-right:5;"> </div><div><code> plus</code></div>
+     * <div class="x-tool x-tool-help" style="float:left; margin-right:5;"> </div><div><code> help</code></div>
+     * <div class="x-tool x-tool-search" style="float:left; margin-right:5;"> </div><div><code> search</code></div>
+     * <div class="x-tool x-tool-save" style="float:left; margin-right:5;"> </div><div><code> save</code></div>
+     * <div class="x-tool x-tool-print" style="float:left; margin-right:5;"> </div><div><code> print</code></div>
+     * </ul></div></li>
+     * <li><b>handler</b> : Function<div class="sub-desc"><b>Required.</b> The function to
+     * call when clicked. Arguments passed are:<ul>
+     * <li><b>event</b> : Ext.EventObject<div class="sub-desc">The click event.</div></li>
+     * <li><b>toolEl</b> : Ext.Element<div class="sub-desc">The tool Element.</div></li>
+     * <li><b>panel</b> : Ext.Panel<div class="sub-desc">The host Panel</div></li>
+     * <li><b>tc</b> : Object<div class="sub-desc">The tool configuration object</div></li>
+     * </ul></div></li>
+     * <li><b>stopEvent</b> : Boolean<div class="sub-desc">Defaults to true. Specify as false to allow click event to propagate.</div></li>
+     * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the handler.</div></li>
+     * <li><b>qtip</b> : String/Object<div class="sub-desc">A tip string, or
+     * a config argument to {@link Ext.QuickTip#register}</div></li>
+     * <li><b>hidden</b> : Boolean<div class="sub-desc">True to initially render hidden.</div></li>
+     * <li><b>on</b> : Object<div class="sub-desc">A listener config object specifiying
+     * event listeners in the format of an argument to {@link #addListener}</div></li>
+     * </ul></div>
+     * <p>Note that, apart from the toggle tool which is provided when a panel is collapsible, these
+     * tools only provide the visual button. Any required functionality must be provided by adding
+     * handlers that implement the necessary behavior.</p>
+     * <p>Example usage:</p>
+     * <pre><code>
+tools:[{
+    id:'refresh',
+    qtip: 'Refresh form Data',
+    // hidden:true,
+    handler: function(event, toolEl, panel){
+        // refresh logic
+    }
+},
+{
+    id:'help',
+    qtip: 'Get Help',
+    handler: function(event, toolEl, panel){
+        // whatever
+    }
+}]
+</code></pre>
+     * <p>For the custom id of <code>'help'</code> define two relevant css classes with a link to
+     * a 15x15 image:</p>
+     * <pre><code>
+.x-tool-help {background-image: url(images/help.png);}
+.x-tool-help-over {background-image: url(images/help_over.png);}
+// if using an image sprite:
+.x-tool-help {background-image: url(images/help.png) no-repeat 0 0;}
+.x-tool-help-over {background-position:-15px 0;}
+</code></pre>
+     */
+    /**
+     * @cfg {Ext.Template/Ext.XTemplate} toolTemplate
+     * <p>A Template used to create {@link #tools} in the {@link #header} Element. Defaults to:</p><pre><code>
+new Ext.Template('&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>')</code></pre>
+     * <p>This may may be overridden to provide a custom DOM structure for tools based upon a more
+     * complex XTemplate. The template's data is a single tool configuration object (Not the entire Array)
+     * as specified in {@link #tools}.  In the following example an &lt;a> tag is used to provide a
+     * visual indication when hovering over the tool:</p><pre><code>
+var win = new Ext.Window({
+    tools: [{
+        id: 'download',
+        href: '/MyPdfDoc.pdf'
+    }],
+    toolTemplate: new Ext.XTemplate(
+        '&lt;tpl if="id==\'download\'">',
+            '&lt;a class="x-tool x-tool-pdf" href="{href}">&lt;/a>',
+        '&lt;/tpl>',
+        '&lt;tpl if="id!=\'download\'">',
+            '&lt;div class="x-tool x-tool-{id}">&amp;#160;&lt;/div>',
+        '&lt;/tpl>'
+    ),
+    width:500,
+    height:300,
+    closeAction:'hide'
+});</code></pre>
+     * <p>Note that the CSS class 'x-tool-pdf' should have an associated style rule which provides an
+     * appropriate background image, something like:</p>
+    <pre><code>
+    a.x-tool-pdf {background-image: url(../shared/extjs/images/pdf.gif)!important;}
+    </code></pre>
+     */
+    /**
+     * @cfg {Boolean} hideCollapseTool
+     * <code>true</code> to hide the expand/collapse toggle button when <code>{@link #collapsible} == true</code>,
+     * <code>false</code> to display it (defaults to <code>false</code>).
+     */
+    /**
+     * @cfg {Boolean} titleCollapse
+     * <code>true</code> to allow expanding and collapsing the panel (when <code>{@link #collapsible} = true</code>)
+     * by clicking anywhere in the header bar, <code>false</code>) to allow it only by clicking to tool button
+     * (defaults to <code>false</code>)). If this panel is a child item of a border layout also see the
+     * {@link Ext.layout.BorderLayout.Region BorderLayout.Region}
+     * <code>{@link Ext.layout.BorderLayout.Region#floatable floatable}</code> config option.
+     */
 
-        /**
-         * Returns the actual CRUD action KEY "create", "read", "update" or "destroy" from the supplied action-name.  This method is used internally and shouldn't generally
-         * need to be used directly.  The key/value pair of Ext.data.Api.actions will often be identical but this is not necessarily true.  A developer can override this naming
-         * convention if desired.  However, the framework internally calls methods based upon the KEY so a way of retreiving the the words "create", "read", "update" and "destroy" is
-         * required.  This method will cache discovered KEYS into the private validActions hash.
-         * @param {String} name The runtime name of the action.
-         * @return {String||null} returns the action-key, or verb of the user-action or null if invalid.
-         * @nodoc
-         */
-        getVerb : function(name) {
-            if (validActions[name]) {
-                return validActions[name];  // <-- found in cache.  return immediately.
-            }
-            for (var verb in this.actions) {
-                if (this.actions[verb] === name) {
-                    validActions[name] = verb;
-                    break;
-                }
-            }
-            return (validActions[name] !== undefined) ? validActions[name] : null;
-        },
+    /**
+     * @cfg {Mixed} floating
+     * <p>This property is used to configure the underlying {@link Ext.Layer}. Acceptable values for this
+     * configuration property are:</p><div class="mdetail-params"><ul>
+     * <li><b><code>false</code></b> : <b>Default.</b><div class="sub-desc">Display the panel inline where it is
+     * rendered.</div></li>
+     * <li><b><code>true</code></b> : <div class="sub-desc">Float the panel (absolute position it with automatic
+     * shimming and shadow).<ul>
+     * <div class="sub-desc">Setting floating to true will create an Ext.Layer for this panel and display the
+     * panel at negative offsets so that it is hidden.</div>
+     * <div class="sub-desc">Since the panel will be absolute positioned, the position must be set explicitly
+     * <i>after</i> render (e.g., <code>myPanel.setPosition(100,100);</code>).</div>
+     * <div class="sub-desc"><b>Note</b>: when floating a panel you should always assign a fixed width,
+     * otherwise it will be auto width and will expand to fill to the right edge of the viewport.</div>
+     * </ul></div></li>
+     * <li><b><code>{@link Ext.Layer object}</code></b> : <div class="sub-desc">The specified object will be used
+     * as the configuration object for the {@link Ext.Layer} that will be created.</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Boolean/String} shadow
+     * <code>true</code> (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the
+     * panel, <code>false</code> to display no shadow (defaults to <code>'sides'</code>).  Note that this option
+     * only applies when <code>{@link #floating} = true</code>.
+     */
+    /**
+     * @cfg {Number} shadowOffset
+     * The number of pixels to offset the shadow if displayed (defaults to <code>4</code>). Note that this
+     * option only applies when <code>{@link #floating} = true</code>.
+     */
+    /**
+     * @cfg {Boolean} shim
+     * <code>false</code> to disable the iframe shim in browsers which need one (defaults to <code>true</code>).
+     * Note that this option only applies when <code>{@link #floating} = true</code>.
+     */
+    /**
+     * @cfg {Object/Array} keys
+     * A {@link Ext.KeyMap} config object (in the format expected by {@link Ext.KeyMap#addBinding}
+     * used to assign custom key handling to this panel (defaults to <code>null</code>).
+     */
+    /**
+     * @cfg {Boolean/Object} draggable
+     * <p><code>true</code> to enable dragging of this Panel (defaults to <code>false</code>).</p>
+     * <p>For custom drag/drop implementations, an <b>Ext.Panel.DD</b> config could also be passed
+     * in this config instead of <code>true</code>. Ext.Panel.DD is an internal, undocumented class which
+     * moves a proxy Element around in place of the Panel's element, but provides no other behaviour
+     * during dragging or on drop. It is a subclass of {@link Ext.dd.DragSource}, so behaviour may be
+     * added by implementing the interface methods of {@link Ext.dd.DragDrop} e.g.:
+     * <pre><code>
+new Ext.Panel({
+    title: 'Drag me',
+    x: 100,
+    y: 100,
+    renderTo: Ext.getBody(),
+    floating: true,
+    frame: true,
+    width: 400,
+    height: 200,
+    draggable: {
+//      Config option of Ext.Panel.DD class.
+//      It&#39;s a floating Panel, so do not show a placeholder proxy in the original position.
+        insertProxy: false,
 
-        /**
-         * Returns true if the supplied API is valid; that is, check that all keys match defined actions
-         * otherwise returns an array of mistakes.
-         * @return {String[]||true}
-         */
-        isValid : function(api){
-            var invalid = [];
-            var crud = this.actions; // <-- cache a copy of the actions.
-            for (var action in api) {
-                if (!(action in crud)) {
-                    invalid.push(action);
-                }
-            }
-            return (!invalid.length) ? true : invalid;
-        },
+//      Called for each mousemove event while dragging the DD object.
+        onDrag : function(e){
+//          Record the x,y position of the drag proxy so that we can
+//          position the Panel at end of drag.
+            var pel = this.proxy.getEl();
+            this.x = pel.getLeft(true);
+            this.y = pel.getTop(true);
 
-        /**
-         * Returns true if the supplied verb upon the supplied proxy points to a unique url in that none of the other api-actions
-         * point to the same url.  The question is important for deciding whether to insert the "xaction" HTTP parameter within an
-         * Ajax request.  This method is used internally and shouldn't generally need to be called directly.
-         * @param {Ext.data.DataProxy} proxy
-         * @param {String} verb
-         * @return {Boolean}
-         */
-        hasUniqueUrl : function(proxy, verb) {
-            var url = (proxy.api[verb]) ? proxy.api[verb].url : null;
-            var unique = true;
-            for (var action in proxy.api) {
-                if ((unique = (action === verb) ? true : (proxy.api[action].url != url) ? true : false) === false) {
-                    break;
-                }
+//          Keep the Shadow aligned if there is one.
+            var s = this.panel.getEl().shadow;
+            if (s) {
+                s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
             }
-            return unique;
         },
 
-        /**
-         * This method is used internally by <tt>{@link Ext.data.DataProxy DataProxy}</tt> and should not generally need to be used directly.
-         * Each action of a DataProxy api can be initially defined as either a String or an Object.  When specified as an object,
-         * one can explicitly define the HTTP method (GET|POST) to use for each CRUD action.  This method will prepare the supplied API, setting
-         * each action to the Object form.  If your API-actions do not explicitly define the HTTP method, the "method" configuration-parameter will
-         * be used.  If the method configuration parameter is not specified, POST will be used.
-         <pre><code>
-new Ext.data.HttpProxy({
-    method: "POST",     // <-- default HTTP method when not specified.
-    api: {
-        create: 'create.php',
-        load: 'read.php',
-        save: 'save.php',
-        destroy: 'destroy.php'
-    }
-});
-
-// Alternatively, one can use the object-form to specify the API
-new Ext.data.HttpProxy({
-    api: {
-        load: {url: 'read.php', method: 'GET'},
-        create: 'create.php',
-        destroy: 'destroy.php',
-        save: 'update.php'
+//      Called on the mouseup event.
+        endDrag : function(e){
+            this.panel.setPosition(this.x, this.y);
+        }
     }
-});
-        </code></pre>
-         *
-         * @param {Ext.data.DataProxy} proxy
-         */
-        prepare : function(proxy) {
-            if (!proxy.api) {
-                proxy.api = {}; // <-- No api?  create a blank one.
-            }
-            for (var verb in this.actions) {
-                var action = this.actions[verb];
-                proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn;
-                if (typeof(proxy.api[action]) == 'string') {
-                    proxy.api[action] = {
-                        url: proxy.api[action]
-                    };
-                }
-            }
-        },
-
-        /**
-         * Prepares a supplied Proxy to be RESTful.  Sets the HTTP method for each api-action to be one of
-         * GET, POST, PUT, DELETE according to the defined {@link #restActions}.
-         * @param {Ext.data.DataProxy} proxy
-         */
-        restify : function(proxy) {
-            proxy.restful = true;
-            for (var verb in this.restActions) {
-                proxy.api[this.actions[verb]].method = this.restActions[verb];
-            }
+}).show();
+</code></pre>
+     */
+    /**
+     * @cfg {Boolean} disabled
+     * Render this panel disabled (default is <code>false</code>). An important note when using the disabled
+     * config on panels is that IE will often fail to initialize the disabled mask element correectly if
+     * the panel's layout has not yet completed by the time the Panel is disabled during the render process.
+     * If you experience this issue, you may need to instead use the {@link #afterlayout} event to initialize
+     * the disabled state:
+     * <pre><code>
+new Ext.Panel({
+    ...
+    listeners: {
+        'afterlayout': {
+            fn: function(p){
+                p.disable();
+            },
+            single: true // important, as many layouts can occur
         }
-    };
-})();
-
-/**
- * @class Ext.data.Api.Error
- * @extends Ext.Error
- * Error class for Ext.data.Api errors
- */
-Ext.data.Api.Error = Ext.extend(Ext.Error, {
-    constructor : function(message, arg) {
-        this.arg = arg;
-        Ext.Error.call(this, message);
-    },
-    name: 'Ext.data.Api'
-});
-Ext.apply(Ext.data.Api.Error.prototype, {
-    lang: {
-        'action-url-undefined': 'No fallback url defined for this action.  When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.',
-        'invalid': 'received an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions',
-        'invalid-url': 'Invalid url.  Please review your proxy configuration.',
-        'execute': 'Attempted to execute an unknown action.  Valid API actions are defined in Ext.data.Api.actions"'
     }
 });
-\r
-/**\r
- * @class Ext.data.SortTypes\r
- * @singleton\r
- * Defines the default sorting (casting?) comparison functions used when sorting data.\r
- */\r
-Ext.data.SortTypes = {\r
-    /**\r
-     * Default sort that does nothing\r
-     * @param {Mixed} s The value being converted\r
-     * @return {Mixed} The comparison value\r
-     */\r
-    none : function(s){\r
-        return s;\r
-    },\r
-    \r
-    /**\r
-     * The regular expression used to strip tags\r
-     * @type {RegExp}\r
-     * @property\r
-     */\r
-    stripTagsRE : /<\/?[^>]+>/gi,\r
-    \r
-    /**\r
-     * Strips all HTML tags to sort on text only\r
-     * @param {Mixed} s The value being converted\r
-     * @return {String} The comparison value\r
-     */\r
-    asText : function(s){\r
-        return String(s).replace(this.stripTagsRE, "");\r
-    },\r
-    \r
-    /**\r
-     * Strips all HTML tags to sort on text only - Case insensitive\r
-     * @param {Mixed} s The value being converted\r
-     * @return {String} The comparison value\r
-     */\r
-    asUCText : function(s){\r
-        return String(s).toUpperCase().replace(this.stripTagsRE, "");\r
-    },\r
-    \r
-    /**\r
-     * Case insensitive string\r
-     * @param {Mixed} s The value being converted\r
-     * @return {String} The comparison value\r
-     */\r
-    asUCString : function(s) {\r
-       return String(s).toUpperCase();\r
-    },\r
-    \r
-    /**\r
-     * Date sorting\r
-     * @param {Mixed} s The value being converted\r
-     * @return {Number} The comparison value\r
-     */\r
-    asDate : function(s) {\r
-        if(!s){\r
-            return 0;\r
-        }\r
-        if(Ext.isDate(s)){\r
-            return s.getTime();\r
-        }\r
-       return Date.parse(String(s));\r
-    },\r
-    \r
-    /**\r
-     * Float sorting\r
-     * @param {Mixed} s The value being converted\r
-     * @return {Float} The comparison value\r
-     */\r
-    asFloat : function(s) {\r
-       var val = parseFloat(String(s).replace(/,/g, ""));\r
-       return isNaN(val) ? 0 : val;\r
-    },\r
-    \r
-    /**\r
-     * Integer sorting\r
-     * @param {Mixed} s The value being converted\r
-     * @return {Number} The comparison value\r
-     */\r
-    asInt : function(s) {\r
-        var val = parseInt(String(s).replace(/,/g, ""), 10);\r
-        return isNaN(val) ? 0 : val;\r
-    }\r
-};/**
- * @class Ext.data.Record
- * <p>Instances of this class encapsulate both Record <em>definition</em> information, and Record
- * <em>value</em> information for use in {@link Ext.data.Store} objects, or any code which needs
- * to access Records cached in an {@link Ext.data.Store} object.</p>
- * <p>Constructors for this class are generated by passing an Array of field definition objects to {@link #create}.
- * Instances are usually only created by {@link Ext.data.Reader} implementations when processing unformatted data
- * objects.</p>
- * <p>Note that an instance of a Record class may only belong to one {@link Ext.data.Store Store} at a time.
- * In order to copy data from one Store to another, use the {@link #copy} method to create an exact
- * copy of the Record, and insert the new instance into the other Store.</p>
- * <p>When serializing a Record for submission to the server, be aware that it contains many private
- * properties, and also a reference to its owning Store which in turn holds references to its Records.
- * This means that a whole Record may not be encoded using {@link Ext.util.JSON.encode}. Instead, use the
- * <code>{@link #data}</code> and <code>{@link #id}</code> properties.</p>
- * <p>Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.</p>
- * @constructor
- * This constructor should not be used to create Record objects. Instead, use {@link #create} to
- * generate a subclass of Ext.data.Record configured with information about its constituent fields.
- * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's
- * fields. If not specified the <code>{@link Ext.data.Field#defaultValue defaultValue}</code>
- * for each field will be assigned.
- * @param {Object} id (Optional) The id of the Record. This id should be unique, and is used by the
- * {@link Ext.data.Store} object which owns the Record to index its collection of Records. If
- * an <code>id</code> is not specified a <b><code>{@link #phantom}</code></b> Record will be created
- * with an {@link #Record.id automatically generated id}.
- */
-Ext.data.Record = function(data, id){
-    // if no id, call the auto id method
-    this.id = (id || id === 0) ? id : Ext.data.Record.id(this);
-    this.data = data || {};
-};
-
-/**
- * Generate a constructor for a specific Record layout.
- * @param {Array} o An Array of <b>{@link Ext.data.Field Field}</b> definition objects.
- * The constructor generated by this method may be used to create new Record instances. The data
- * object must contain properties named after the {@link Ext.data.Field field}
- * <b><tt>{@link Ext.data.Field#name}s</tt></b>.  Example usage:<pre><code>
-// create a Record constructor from a description of the fields
-var TopicRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
-    {{@link Ext.data.Field#name name}: 'title', {@link Ext.data.Field#mapping mapping}: 'topic_title'},
-    {name: 'author', mapping: 'username', allowBlank: false},
-    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
-    {name: 'lastPost', mapping: 'post_time', type: 'date'},
-    {name: 'lastPoster', mapping: 'user2'},
-    {name: 'excerpt', mapping: 'post_text', allowBlank: false},
-    // In the simplest case, if no properties other than <tt>name</tt> are required,
-    // a field definition may consist of just a String for the field name.
-    'signature'
-]);
-
-// create Record instance
-var myNewRecord = new TopicRecord(
-    {
-        title: 'Do my job please',
-        author: 'noobie',
-        totalPosts: 1,
-        lastPost: new Date(),
-        lastPoster: 'Animal',
-        excerpt: 'No way dude!',
-        signature: ''
-    },
-    id // optionally specify the id of the record otherwise {@link #Record.id one is auto-assigned}
-);
-myStore.{@link Ext.data.Store#add add}(myNewRecord);
 </code></pre>
- * @method create
- * @return {function} A constructor which is used to create new Records according
- * to the definition. The constructor has the same signature as {@link #Ext.data.Record}.
- * @static
- */
-Ext.data.Record.create = function(o){
-    var f = Ext.extend(Ext.data.Record, {});
-    var p = f.prototype;
-    p.fields = new Ext.util.MixedCollection(false, function(field){
-        return field.name;
-    });
-    for(var i = 0, len = o.length; i < len; i++){
-        p.fields.add(new Ext.data.Field(o[i]));
-    }
-    f.getField = function(name){
-        return p.fields.get(name);
-    };
-    return f;
-};
-
-Ext.data.Record.PREFIX = 'ext-record';
-Ext.data.Record.AUTO_ID = 1;
-Ext.data.Record.EDIT = 'edit';
-Ext.data.Record.REJECT = 'reject';
-Ext.data.Record.COMMIT = 'commit';
-
+     */
+    /**
+     * @cfg {Boolean} autoHeight
+     * <code>true</code> to use height:'auto', <code>false</code> to use fixed height (defaults to <code>false</code>).
+     * <b>Note</b>: Setting <code>autoHeight: true</code> means that the browser will manage the panel's height
+     * based on its contents, and that Ext will not manage it at all. If the panel is within a layout that
+     * manages dimensions (<code>fit</code>, <code>border</code>, etc.) then setting <code>autoHeight: true</code>
+     * can cause issues with scrolling and will not generally work as expected since the panel will take
+     * on the height of its contents rather than the height required by the Ext layout.
+     */
 
-/**
- * Generates a sequential id. This method is typically called when a record is {@link #create}d
- * and {@link #Record no id has been specified}. The returned id takes the form:
- * <tt>&#123;PREFIX}-&#123;AUTO_ID}</tt>.<div class="mdetail-params"><ul>
- * <li><b><tt>PREFIX</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.PREFIX</tt>
- * (defaults to <tt>'ext-record'</tt>)</p></li>
- * <li><b><tt>AUTO_ID</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.AUTO_ID</tt>
- * (defaults to <tt>1</tt> initially)</p></li>
- * </ul></div>
- * @param {Record} rec The record being created.  The record does not exist, it's a {@link #phantom}.
- * @return {String} auto-generated string id, <tt>"ext-record-i++'</tt>;
- */
-Ext.data.Record.id = function(rec) {
-    rec.phantom = true;
-    return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join('');
-};
 
-Ext.data.Record.prototype = {
     /**
-     * <p><b>This property is stored in the Record definition's <u>prototype</u></b></p>
-     * A MixedCollection containing the defined {@link Ext.data.Field Field}s for this Record.  Read-only.
-     * @property fields
-     * @type Ext.util.MixedCollection
+     * @cfg {String} baseCls
+     * The base CSS class to apply to this panel's element (defaults to <code>'x-panel'</code>).
+     * <p>Another option available by default is to specify <code>'x-plain'</code> which strips all styling
+     * except for required attributes for Ext layouts to function (e.g. overflow:hidden).
+     * See <code>{@link #unstyled}</code> also.</p>
      */
+    baseCls : 'x-panel',
     /**
-     * An object hash representing the data for this Record. Every field name in the Record definition
-     * is represented by a property of that name in this object. Note that unless you specified a field
-     * with {@link Ext.data.Field#name name} "id" in the Record definition, this will <b>not</b> contain
-     * an <tt>id</tt> property.
-     * @property data
-     * @type {Object}
+     * @cfg {String} collapsedCls
+     * A CSS class to add to the panel's element after it has been collapsed (defaults to
+     * <code>'x-panel-collapsed'</code>).
      */
+    collapsedCls : 'x-panel-collapsed',
     /**
-     * The unique ID of the Record {@link #Record as specified at construction time}.
-     * @property id
-     * @type {Object}
+     * @cfg {Boolean} maskDisabled
+     * <code>true</code> to mask the panel when it is {@link #disabled}, <code>false</code> to not mask it (defaults
+     * to <code>true</code>).  Either way, the panel will always tell its contained elements to disable themselves
+     * when it is disabled, but masking the panel can provide an additional visual cue that the panel is
+     * disabled.
+     */
+    maskDisabled : true,
+    /**
+     * @cfg {Boolean} animCollapse
+     * <code>true</code> to animate the transition when the panel is collapsed, <code>false</code> to skip the
+     * animation (defaults to <code>true</code> if the {@link Ext.Fx} class is available, otherwise <code>false</code>).
+     */
+    animCollapse : Ext.enableFx,
+    /**
+     * @cfg {Boolean} headerAsText
+     * <code>true</code> to display the panel <code>{@link #title}</code> in the <code>{@link #header}</code>,
+     * <code>false</code> to hide it (defaults to <code>true</code>).
+     */
+    headerAsText : true,
+    /**
+     * @cfg {String} buttonAlign
+     * The alignment of any {@link #buttons} added to this panel.  Valid values are <code>'right'</code>,
+     * <code>'left'</code> and <code>'center'</code> (defaults to <code>'right'</code>).
+     */
+    buttonAlign : 'right',
+    /**
+     * @cfg {Boolean} collapsed
+     * <code>true</code> to render the panel collapsed, <code>false</code> to render it expanded (defaults to
+     * <code>false</code>).
+     */
+    collapsed : false,
+    /**
+     * @cfg {Boolean} collapseFirst
+     * <code>true</code> to make sure the collapse/expand toggle button always renders first (to the left of)
+     * any other tools in the panel's title bar, <code>false</code> to render it last (defaults to <code>true</code>).
+     */
+    collapseFirst : true,
+    /**
+     * @cfg {Number} minButtonWidth
+     * Minimum width in pixels of all {@link #buttons} in this panel (defaults to <code>75</code>)
+     */
+    minButtonWidth : 75,
+    /**
+     * @cfg {Boolean} unstyled
+     * Overrides the <code>{@link #baseCls}</code> setting to <code>{@link #baseCls} = 'x-plain'</code> which renders
+     * the panel unstyled except for required attributes for Ext layouts to function (e.g. overflow:hidden).
      */
     /**
-     * Readonly flag - true if this Record has been modified.
-     * @type Boolean
+     * @cfg {String} elements
+     * A comma-delimited list of panel elements to initialize when the panel is rendered.  Normally, this list will be
+     * generated automatically based on the items added to the panel at config time, but sometimes it might be useful to
+     * make sure a structural element is rendered even if not specified at config time (for example, you may want
+     * to add a button or toolbar dynamically after the panel has been rendered).  Adding those elements to this
+     * list will allocate the required placeholders in the panel when it is rendered.  Valid values are<div class="mdetail-params"><ul>
+     * <li><code>header</code></li>
+     * <li><code>tbar</code> (top bar)</li>
+     * <li><code>body</code></li>
+     * <li><code>bbar</code> (bottom bar)</li>
+     * <li><code>footer</code></li>
+     * </ul></div>
+     * Defaults to '<code>body</code>'.
      */
-    dirty : false,
-    editing : false,
-    error: null,
+    elements : 'body',
     /**
-     * This object contains a key and value storing the original values of all modified
-     * fields or is null if no fields have been modified.
-     * @property modified
-     * @type {Object}
+     * @cfg {Boolean} preventBodyReset
+     * Defaults to <code>false</code>.  When set to <code>true</code>, an extra css class <code>'x-panel-normal'</code>
+     * will be added to the panel's element, effectively applying css styles suggested by the W3C
+     * (see http://www.w3.org/TR/CSS21/sample.html) to the Panel's <b>body</b> element (not the header,
+     * footer, etc.).
      */
-    modified: null,
+    preventBodyReset : false,
+
     /**
-     * <tt>false</tt> when the record does not yet exist in a server-side database (see
-     * {@link #markDirty}).  Any record which has a real database pk set as its id property
-     * is NOT a phantom -- it's real.
-     * @property phantom
-     * @type {Boolean}
+     * @cfg {Number/String} padding
+     * A shortcut for setting a padding style on the body element. The value can either be
+     * a number to be applied to all sides, or a normal css string describing padding.
+     * Defaults to <tt>undefined</tt>.
+     *
      */
-    phantom : false,
+    padding: undefined,
+
+    /** @cfg {String} resizeEvent
+     * The event to listen to for resizing in layouts. Defaults to <tt>'bodyresize'</tt>.
+     */
+    resizeEvent: 'bodyresize',
 
+    // protected - these could be used to customize the behavior of the window,
+    // but changing them would not be useful without further mofifications and
+    // could lead to unexpected or undesirable results.
+    toolTarget : 'header',
+    collapseEl : 'bwrap',
+    slideAnchor : 't',
+    disabledClass : '',
+
+    // private, notify box this class will handle heights
+    deferHeight : true,
     // private
-    join : function(store){
-        /**
-         * The {@link Ext.data.Store} to which this Record belongs.
-         * @property store
-         * @type {Ext.data.Store}
-         */
-        this.store = store;
+    expandDefaults: {
+        duration : 0.25
+    },
+    // private
+    collapseDefaults : {
+        duration : 0.25
     },
 
-    /**
-     * Set the {@link Ext.data.Field#name named field} to the specified value.  For example:
-     * <pre><code>
-// record has a field named 'firstname'
-var Employee = Ext.data.Record.{@link #create}([
-    {name: 'firstname'},
-    ...
-]);
+    // private
+    initComponent : function(){
+        Ext.Panel.superclass.initComponent.call(this);
 
-// update the 2nd record in the store:
-var rec = myStore.{@link Ext.data.Store#getAt getAt}(1);
+        this.addEvents(
+            /**
+             * @event bodyresize
+             * Fires after the Panel has been resized.
+             * @param {Ext.Panel} p the Panel which has been resized.
+             * @param {Number} width The Panel body's new width.
+             * @param {Number} height The Panel body's new height.
+             */
+            'bodyresize',
+            /**
+             * @event titlechange
+             * Fires after the Panel title has been {@link #title set} or {@link #setTitle changed}.
+             * @param {Ext.Panel} p the Panel which has had its title changed.
+             * @param {String} The new title.
+             */
+            'titlechange',
+            /**
+             * @event iconchange
+             * Fires after the Panel icon class has been {@link #iconCls set} or {@link #setIconClass changed}.
+             * @param {Ext.Panel} p the Panel which has had its {@link #iconCls icon class} changed.
+             * @param {String} The new icon class.
+             * @param {String} The old icon class.
+             */
+            'iconchange',
+            /**
+             * @event collapse
+             * Fires after the Panel has been collapsed.
+             * @param {Ext.Panel} p the Panel that has been collapsed.
+             */
+            'collapse',
+            /**
+             * @event expand
+             * Fires after the Panel has been expanded.
+             * @param {Ext.Panel} p The Panel that has been expanded.
+             */
+            'expand',
+            /**
+             * @event beforecollapse
+             * Fires before the Panel is collapsed.  A handler can return false to cancel the collapse.
+             * @param {Ext.Panel} p the Panel being collapsed.
+             * @param {Boolean} animate True if the collapse is animated, else false.
+             */
+            'beforecollapse',
+            /**
+             * @event beforeexpand
+             * Fires before the Panel is expanded.  A handler can return false to cancel the expand.
+             * @param {Ext.Panel} p The Panel being expanded.
+             * @param {Boolean} animate True if the expand is animated, else false.
+             */
+            'beforeexpand',
+            /**
+             * @event beforeclose
+             * Fires before the Panel is closed.  Note that Panels do not directly support being closed, but some
+             * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel.  This event only
+             * applies to such subclasses.
+             * A handler can return false to cancel the close.
+             * @param {Ext.Panel} p The Panel being closed.
+             */
+            'beforeclose',
+            /**
+             * @event close
+             * Fires after the Panel is closed.  Note that Panels do not directly support being closed, but some
+             * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel.
+             * @param {Ext.Panel} p The Panel that has been closed.
+             */
+            'close',
+            /**
+             * @event activate
+             * Fires after the Panel has been visually activated.
+             * Note that Panels do not directly support being activated, but some Panel subclasses
+             * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
+             * activate and deactivate events under the control of the TabPanel.
+             * @param {Ext.Panel} p The Panel that has been activated.
+             */
+            'activate',
+            /**
+             * @event deactivate
+             * Fires after the Panel has been visually deactivated.
+             * Note that Panels do not directly support being deactivated, but some Panel subclasses
+             * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
+             * activate and deactivate events under the control of the TabPanel.
+             * @param {Ext.Panel} p The Panel that has been deactivated.
+             */
+            'deactivate'
+        );
 
-// set the value (shows dirty flag):
-rec.set('firstname', 'Betty');
+        if(this.unstyled){
+            this.baseCls = 'x-plain';
+        }
 
-// commit the change (removes dirty flag):
-rec.{@link #commit}();
 
-// update the record in the store, bypass setting dirty flag,
-// and do not store the change in the {@link Ext.data.Store#getModifiedRecords modified records}
-rec.{@link #data}['firstname'] = 'Wilma'); // updates record, but not the view
-rec.{@link #commit}(); // updates the view
-     * </code></pre>
-     * <b>Notes</b>:<div class="mdetail-params"><ul>
-     * <li>If the store has a writer and <code>autoSave=true</code>, each set()
-     * will execute an XHR to the server.</li>
-     * <li>Use <code>{@link #beginEdit}</code> to prevent the store's <code>update</code>
-     * event firing while using set().</li>
-     * <li>Use <code>{@link #endEdit}</code> to have the store's <code>update</code>
-     * event fire.</li>
-     * </ul></div>
-     * @param {String} name The {@link Ext.data.Field#name name of the field} to set.
-     * @param {Object} value The value to set the field to.
-     */
-    set : function(name, value){
-        var isObj = (typeof value === 'object');
-        if(!isObj && String(this.data[name]) === String(value)){
-            return;
-        } else if (isObj && Ext.encode(this.data[name]) === Ext.encode(value)) {
-            return;
+        this.toolbars = [];
+        // shortcuts
+        if(this.tbar){
+            this.elements += ',tbar';
+            this.topToolbar = this.createToolbar(this.tbar);
+            delete this.tbar;
+
         }
-        this.dirty = true;
-        if(!this.modified){
-            this.modified = {};
+        if(this.bbar){
+            this.elements += ',bbar';
+            this.bottomToolbar = this.createToolbar(this.bbar);
+            delete this.bbar;
         }
-        if(typeof this.modified[name] == 'undefined'){
-            this.modified[name] = this.data[name];
+
+        if(this.header === true){
+            this.elements += ',header';
+            delete this.header;
+        }else if(this.headerCfg || (this.title && this.header !== false)){
+            this.elements += ',header';
         }
-        this.data[name] = value;
-        if(!this.editing){
-            this.afterEdit();
+
+        if(this.footerCfg || this.footer === true){
+            this.elements += ',footer';
+            delete this.footer;
+        }
+
+        if(this.buttons){
+            this.fbar = this.buttons;
+            delete this.buttons;
+        }
+        if(this.fbar){
+            this.createFbar(this.fbar);
+        }
+        if(this.autoLoad){
+            this.on('render', this.doAutoLoad, this, {delay:10});
         }
     },
 
     // private
-    afterEdit: function(){
-        if(this.store){
-            this.store.afterEdit(this);
-        }
+    createFbar : function(fbar){
+        var min = this.minButtonWidth;
+        this.elements += ',footer';
+        this.fbar = this.createToolbar(fbar, {
+            buttonAlign: this.buttonAlign,
+            toolbarCls: 'x-panel-fbar',
+            enableOverflow: false,
+            defaults: function(c){
+                return {
+                    minWidth: c.minWidth || min
+                };
+            }
+        });
+        //@compat addButton and buttons could possibly be removed
+        //@target 4.0
+        /**
+         * This Panel's Array of buttons as created from the <code>{@link #buttons}</code>
+         * config property. Read only.
+         * @type Array
+         * @property buttons
+         */
+        this.fbar.items.each(function(c){
+            c.minWidth = c.minWidth || this.minButtonWidth;
+        }, this);
+        this.buttons = this.fbar.items.items;
     },
 
     // private
-    afterReject: function(){
-        if(this.store){
-            this.store.afterReject(this);
+    createToolbar: function(tb, options){
+        var result;
+        // Convert array to proper toolbar config
+        if(Ext.isArray(tb)){
+            tb = {
+                items: tb
+            };
         }
+        result = tb.events ? Ext.apply(tb, options) : this.createComponent(Ext.apply({}, tb, options), 'toolbar');
+        this.toolbars.push(result);
+        return result;
     },
 
     // private
-    afterCommit: function(){
-        if(this.store){
-            this.store.afterCommit(this);
+    createElement : function(name, pnode){
+        if(this[name]){
+            pnode.appendChild(this[name].dom);
+            return;
         }
-    },
 
-    /**
-     * Get the value of the {@link Ext.data.Field#name named field}.
-     * @param {String} name The {@link Ext.data.Field#name name of the field} to get the value of.
-     * @return {Object} The value of the field.
-     */
-    get : function(name){
-        return this.data[name];
+        if(name === 'bwrap' || this.elements.indexOf(name) != -1){
+            if(this[name+'Cfg']){
+                this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']);
+            }else{
+                var el = document.createElement('div');
+                el.className = this[name+'Cls'];
+                this[name] = Ext.get(pnode.appendChild(el));
+            }
+            if(this[name+'CssClass']){
+                this[name].addClass(this[name+'CssClass']);
+            }
+            if(this[name+'Style']){
+                this[name].applyStyles(this[name+'Style']);
+            }
+        }
     },
 
-    /**
-     * Begin an edit. While in edit mode, no events (e.g.. the <code>update</code> event)
-     * are relayed to the containing store.
-     * See also: <code>{@link #endEdit}</code> and <code>{@link #cancelEdit}</code>.
-     */
-    beginEdit : function(){
-        this.editing = true;
-        this.modified = this.modified || {};
-    },
+    // private
+    onRender : function(ct, position){
+        Ext.Panel.superclass.onRender.call(this, ct, position);
+        this.createClasses();
 
-    /**
-     * Cancels all changes made in the current edit operation.
-     */
-    cancelEdit : function(){
-        this.editing = false;
-        delete this.modified;
-    },
+        var el = this.el,
+            d = el.dom,
+            bw,
+            ts;
 
-    /**
-     * End an edit. If any data was modified, the containing store is notified
-     * (ie, the store's <code>update</code> event will fire).
-     */
-    endEdit : function(){
-        this.editing = false;
-        if(this.dirty){
-            this.afterEdit();
+
+        if(this.collapsible && !this.hideCollapseTool){
+            this.tools = this.tools ? this.tools.slice(0) : [];
+            this.tools[this.collapseFirst?'unshift':'push']({
+                id: 'toggle',
+                handler : this.toggleCollapse,
+                scope: this
+            });
         }
-    },
 
-    /**
-     * Usually called by the {@link Ext.data.Store} which owns the Record.
-     * Rejects all changes made to the Record since either creation, or the last commit operation.
-     * Modified fields are reverted to their original values.
-     * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
-     * to have their code notified of reject operations.</p>
-     * @param {Boolean} silent (optional) True to skip notification of the owning
-     * store of the change (defaults to false)
-     */
-    reject : function(silent){
-        var m = this.modified;
-        for(var n in m){
-            if(typeof m[n] != "function"){
-                this.data[n] = m[n];
-            }
+        if(this.tools){
+            ts = this.tools;
+            this.elements += (this.header !== false) ? ',header' : '';
         }
-        this.dirty = false;
-        delete this.modified;
-        this.editing = false;
-        if(silent !== true){
-            this.afterReject();
+        this.tools = {};
+
+        el.addClass(this.baseCls);
+        if(d.firstChild){ // existing markup
+            this.header = el.down('.'+this.headerCls);
+            this.bwrap = el.down('.'+this.bwrapCls);
+            var cp = this.bwrap ? this.bwrap : el;
+            this.tbar = cp.down('.'+this.tbarCls);
+            this.body = cp.down('.'+this.bodyCls);
+            this.bbar = cp.down('.'+this.bbarCls);
+            this.footer = cp.down('.'+this.footerCls);
+            this.fromMarkup = true;
+        }
+        if (this.preventBodyReset === true) {
+            el.addClass('x-panel-reset');
+        }
+        if(this.cls){
+            el.addClass(this.cls);
         }
-    },
 
-    /**
-     * Usually called by the {@link Ext.data.Store} which owns the Record.
-     * Commits all changes made to the Record since either creation, or the last commit operation.
-     * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
-     * to have their code notified of commit operations.</p>
-     * @param {Boolean} silent (optional) True to skip notification of the owning
-     * store of the change (defaults to false)
-     */
-    commit : function(silent){
-        this.dirty = false;
-        delete this.modified;
-        this.editing = false;
-        if(silent !== true){
-            this.afterCommit();
+        if(this.buttons){
+            this.elements += ',footer';
         }
-    },
 
-    /**
-     * Gets a hash of only the fields that have been modified since this Record was created or commited.
-     * @return Object
-     */
-    getChanges : function(){
-        var m = this.modified, cs = {};
-        for(var n in m){
-            if(m.hasOwnProperty(n)){
-                cs[n] = this.data[n];
+        // This block allows for maximum flexibility and performance when using existing markup
+
+        // framing requires special markup
+        if(this.frame){
+            el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls));
+
+            this.createElement('header', d.firstChild.firstChild.firstChild);
+            this.createElement('bwrap', d);
+
+            // append the mid and bottom frame to the bwrap
+            bw = this.bwrap.dom;
+            var ml = d.childNodes[1], bl = d.childNodes[2];
+            bw.appendChild(ml);
+            bw.appendChild(bl);
+
+            var mc = bw.firstChild.firstChild.firstChild;
+            this.createElement('tbar', mc);
+            this.createElement('body', mc);
+            this.createElement('bbar', mc);
+            this.createElement('footer', bw.lastChild.firstChild.firstChild);
+
+            if(!this.footer){
+                this.bwrap.dom.lastChild.className += ' x-panel-nofooter';
+            }
+            /*
+             * Store a reference to this element so:
+             * a) We aren't looking it up all the time
+             * b) The last element is reported incorrectly when using a loadmask
+             */
+            this.ft = Ext.get(this.bwrap.dom.lastChild);
+            this.mc = Ext.get(mc);
+        }else{
+            this.createElement('header', d);
+            this.createElement('bwrap', d);
+
+            // append the mid and bottom frame to the bwrap
+            bw = this.bwrap.dom;
+            this.createElement('tbar', bw);
+            this.createElement('body', bw);
+            this.createElement('bbar', bw);
+            this.createElement('footer', bw);
+
+            if(!this.header){
+                this.body.addClass(this.bodyCls + '-noheader');
+                if(this.tbar){
+                    this.tbar.addClass(this.tbarCls + '-noheader');
+                }
             }
         }
-        return cs;
-    },
 
-    // private
-    hasError : function(){
-        return this.error !== null;
-    },
+        if(Ext.isDefined(this.padding)){
+            this.body.setStyle('padding', this.body.addUnits(this.padding));
+        }
 
-    // private
-    clearError : function(){
-        this.error = null;
-    },
+        if(this.border === false){
+            this.el.addClass(this.baseCls + '-noborder');
+            this.body.addClass(this.bodyCls + '-noborder');
+            if(this.header){
+                this.header.addClass(this.headerCls + '-noborder');
+            }
+            if(this.footer){
+                this.footer.addClass(this.footerCls + '-noborder');
+            }
+            if(this.tbar){
+                this.tbar.addClass(this.tbarCls + '-noborder');
+            }
+            if(this.bbar){
+                this.bbar.addClass(this.bbarCls + '-noborder');
+            }
+        }
 
-    /**
-     * Creates a copy of this Record.
-     * @param {String} id (optional) A new Record id, defaults to {@link #Record.id autogenerating an id}.
-     * Note: if an <code>id</code> is not specified the copy created will be a
-     * <code>{@link #phantom}</code> Record.
-     * @return {Record}
-     */
-    copy : function(newId) {
-        return new this.constructor(Ext.apply({}, this.data), newId || this.id);
-    },
+        if(this.bodyBorder === false){
+           this.body.addClass(this.bodyCls + '-noborder');
+        }
 
-    /**
-     * Returns <tt>true</tt> if the passed field name has been <code>{@link #modified}</code>
-     * since the load or last commit.
-     * @param {String} fieldName {@link Ext.data.Field.{@link Ext.data.Field#name}
-     * @return {Boolean}
-     */
-    isModified : function(fieldName){
-        return !!(this.modified && this.modified.hasOwnProperty(fieldName));
-    },
+        this.bwrap.enableDisplayMode('block');
 
-    /**
-     * By default returns <tt>false</tt> if any {@link Ext.data.Field field} within the
-     * record configured with <tt>{@link Ext.data.Field#allowBlank} = false</tt> returns
-     * <tt>true</tt> from an {@link Ext}.{@link Ext#isEmpty isempty} test.
-     * @return {Boolean}
-     */
-    isValid : function() {
-        return this.fields.find(function(f) {
-            return (f.allowBlank === false && Ext.isEmpty(this.data[f.name])) ? true : false;
-        },this) ? false : true;
+        if(this.header){
+            this.header.unselectable();
+
+            // for tools, we need to wrap any existing header markup
+            if(this.headerAsText){
+                this.header.dom.innerHTML =
+                    '<span class="' + this.headerTextCls + '">'+this.header.dom.innerHTML+'</span>';
+
+                if(this.iconCls){
+                    this.setIconClass(this.iconCls);
+                }
+            }
+        }
+
+        if(this.floating){
+            this.makeFloating(this.floating);
+        }
+
+        if(this.collapsible && this.titleCollapse && this.header){
+            this.mon(this.header, 'click', this.toggleCollapse, this);
+            this.header.setStyle('cursor', 'pointer');
+        }
+        if(ts){
+            this.addTool.apply(this, ts);
+        }
+
+        // Render Toolbars.
+        if(this.fbar){
+            this.footer.addClass('x-panel-btns');
+            this.fbar.ownerCt = this;
+            this.fbar.render(this.footer);
+            this.footer.createChild({cls:'x-clear'});
+        }
+        if(this.tbar && this.topToolbar){
+            this.topToolbar.ownerCt = this;
+            this.topToolbar.render(this.tbar);
+        }
+        if(this.bbar && this.bottomToolbar){
+            this.bottomToolbar.ownerCt = this;
+            this.bottomToolbar.render(this.bbar);
+        }
     },
 
     /**
-     * <p>Marks this <b>Record</b> as <code>{@link #dirty}</code>.  This method
-     * is used interally when adding <code>{@link #phantom}</code> records to a
-     * {@link Ext.data.Store#writer writer enabled store}.</p>
-     * <br><p>Marking a record <code>{@link #dirty}</code> causes the phantom to
-     * be returned by {@link Ext.data.Store#getModifiedRecords} where it will
-     * have a create action composed for it during {@link Ext.data.Store#save store save}
-     * operations.</p>
+     * Sets the CSS class that provides the icon image for this panel.  This method will replace any existing
+     * icon class if one has already been set and fire the {@link #iconchange} event after completion.
+     * @param {String} cls The new CSS class name
      */
-    markDirty : function(){
-        this.dirty = true;
-        if(!this.modified){
-            this.modified = {};
+    setIconClass : function(cls){
+        var old = this.iconCls;
+        this.iconCls = cls;
+        if(this.rendered && this.header){
+            if(this.frame){
+                this.header.addClass('x-panel-icon');
+                this.header.replaceClass(old, this.iconCls);
+            }else{
+                var hd = this.header,
+                    img = hd.child('img.x-panel-inline-icon');
+                if(img){
+                    Ext.fly(img).replaceClass(old, this.iconCls);
+                }else{
+                    Ext.DomHelper.insertBefore(hd.dom.firstChild, {
+                        tag:'img', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls
+                    });
+                 }
+            }
         }
-        this.fields.each(function(f) {
-            this.modified[f.name] = this.data[f.name];
-        },this);
-    }
-};/**
- * @class Ext.StoreMgr
- * @extends Ext.util.MixedCollection
- * The default global group of stores.
- * @singleton
- */
-Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
+        this.fireEvent('iconchange', this, cls, old);
+    },
+
+    // private
+    makeFloating : function(cfg){
+        this.floating = true;
+        this.el = new Ext.Layer(Ext.apply({}, cfg, {
+            shadow: Ext.isDefined(this.shadow) ? this.shadow : 'sides',
+            shadowOffset: this.shadowOffset,
+            constrain:false,
+            shim: this.shim === false ? false : undefined
+        }), this.el);
+    },
+
     /**
-     * @cfg {Object} listeners @hide
+     * Returns the {@link Ext.Toolbar toolbar} from the top (<code>{@link #tbar}</code>) section of the panel.
+     * @return {Ext.Toolbar} The toolbar
      */
+    getTopToolbar : function(){
+        return this.topToolbar;
+    },
 
     /**
-     * Registers one or more Stores with the StoreMgr. You do not normally need to register stores
-     * manually.  Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered. 
-     * @param {Ext.data.Store} store1 A Store instance
-     * @param {Ext.data.Store} store2 (optional)
-     * @param {Ext.data.Store} etc... (optional)
+     * Returns the {@link Ext.Toolbar toolbar} from the bottom (<code>{@link #bbar}</code>) section of the panel.
+     * @return {Ext.Toolbar} The toolbar
      */
-    register : function(){
-        for(var i = 0, s; (s = arguments[i]); i++){
-            this.add(s);
-        }
+    getBottomToolbar : function(){
+        return this.bottomToolbar;
     },
 
     /**
-     * Unregisters one or more Stores with the StoreMgr
-     * @param {String/Object} id1 The id of the Store, or a Store instance
-     * @param {String/Object} id2 (optional)
-     * @param {String/Object} etc... (optional)
+     * Adds a button to this panel.  Note that this method must be called prior to rendering.  The preferred
+     * approach is to add buttons via the {@link #buttons} config.
+     * @param {String/Object} config A valid {@link Ext.Button} config.  A string will become the text for a default
+     * button config, an object will be treated as a button config object.
+     * @param {Function} handler The function to be called on button {@link Ext.Button#click}
+     * @param {Object} scope The scope (<code>this</code> reference) in which the button handler function is executed. Defaults to the Button.
+     * @return {Ext.Button} The button that was added
      */
-    unregister : function(){
-        for(var i = 0, s; (s = arguments[i]); i++){
-            this.remove(this.lookup(s));
+    addButton : function(config, handler, scope){
+        if(!this.fbar){
+            this.createFbar([]);
+        }
+        if(handler){
+            if(Ext.isString(config)){
+                config = {text: config};
+            }
+            config = Ext.apply({
+                handler: handler,
+                scope: scope
+            }, config)
         }
+        return this.fbar.add(config);
     },
 
-    /**
-     * Gets a registered Store by id
-     * @param {String/Object} id The id of the Store, or a Store instance
-     * @return {Ext.data.Store}
-     */
-    lookup : function(id){
-        if(Ext.isArray(id)){
-            var fields = ['field1'], expand = !Ext.isArray(id[0]);
-            if(!expand){
-                for(var i = 2, len = id[0].length; i <= len; ++i){
-                    fields.push('field' + i);
+    // private
+    addTool : function(){
+        if(!this.rendered){
+            if(!this.tools){
+                this.tools = [];
+            }
+            Ext.each(arguments, function(arg){
+                this.tools.push(arg)
+            }, this);
+            return;
+        }
+         // nowhere to render tools!
+        if(!this[this.toolTarget]){
+            return;
+        }
+        if(!this.toolTemplate){
+            // initialize the global tool template on first use
+            var tt = new Ext.Template(
+                 '<div class="x-tool x-tool-{id}">&#160;</div>'
+            );
+            tt.disableFormats = true;
+            tt.compile();
+            Ext.Panel.prototype.toolTemplate = tt;
+        }
+        for(var i = 0, a = arguments, len = a.length; i < len; i++) {
+            var tc = a[i];
+            if(!this.tools[tc.id]){
+                var overCls = 'x-tool-'+tc.id+'-over';
+                var t = this.toolTemplate.insertFirst(this[this.toolTarget], tc, true);
+                this.tools[tc.id] = t;
+                t.enableDisplayMode('block');
+                this.mon(t, 'click',  this.createToolHandler(t, tc, overCls, this));
+                if(tc.on){
+                    this.mon(t, tc.on);
+                }
+                if(tc.hidden){
+                    t.hide();
+                }
+                if(tc.qtip){
+                    if(Ext.isObject(tc.qtip)){
+                        Ext.QuickTips.register(Ext.apply({
+                              target: t.id
+                        }, tc.qtip));
+                    } else {
+                        t.dom.qtip = tc.qtip;
+                    }
                 }
+                t.addClassOnOver(overCls);
             }
-            return new Ext.data.ArrayStore({
-                fields: fields,
-                data: id,
-                expandData: expand,
-                autoDestroy: true,
-                autoCreated: true
+        }
+    },
 
+    onLayout : function(shallow, force){
+        Ext.Panel.superclass.onLayout.apply(this, arguments);
+        if(this.hasLayout && this.toolbars.length > 0){
+            Ext.each(this.toolbars, function(tb){
+                tb.doLayout(undefined, force);
             });
+            this.syncHeight();
         }
-        return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
     },
 
-    // getKey implementation for MixedCollection
-    getKey : function(o){
-         return o.storeId;
-    }
-});/**
- * @class Ext.data.Store
- * @extends Ext.util.Observable
- * <p>The Store class encapsulates a client side cache of {@link Ext.data.Record Record}
- * objects which provide input data for Components such as the {@link Ext.grid.GridPanel GridPanel},
- * the {@link Ext.form.ComboBox ComboBox}, or the {@link Ext.DataView DataView}.</p>
- * <p><u>Retrieving Data</u></p>
- * <p>A Store object may access a data object using:<div class="mdetail-params"><ul>
- * <li>{@link #proxy configured implementation} of {@link Ext.data.DataProxy DataProxy}</li>
- * <li>{@link #data} to automatically pass in data</li>
- * <li>{@link #loadData} to manually pass in data</li>
- * </ul></div></p>
- * <p><u>Reading Data</u></p>
- * <p>A Store object has no inherent knowledge of the format of the data object (it could be
- * an Array, XML, or JSON). A Store object uses an appropriate {@link #reader configured implementation}
- * of a {@link Ext.data.DataReader DataReader} to create {@link Ext.data.Record Record} instances from the data
- * object.</p>
- * <p><u>Store Types</u></p>
- * <p>There are several implementations of Store available which are customized for use with
- * a specific DataReader implementation.  Here is an example using an ArrayStore which implicitly
- * creates a reader commensurate to an Array data object.</p>
- * <pre><code>
-var myStore = new Ext.data.ArrayStore({
-    fields: ['fullname', 'first'],
-    idIndex: 0 // id for each record will be the first element
-});
- * </code></pre>
- * <p>For custom implementations create a basic {@link Ext.data.Store} configured as needed:</p>
- * <pre><code>
-// create a {@link Ext.data.Record Record} constructor:
-var rt = Ext.data.Record.create([
-    {name: 'fullname'},
-    {name: 'first'}
-]);
-var myStore = new Ext.data.Store({
-    // explicitly create reader
-    reader: new Ext.data.ArrayReader(
-        {
-            idIndex: 0  // id for each record will be the first element
-        },
-        rt // recordType
-    )
-});
- * </code></pre>
- * <p>Load some data into store (note the data object is an array which corresponds to the reader):</p>
- * <pre><code>
-var myData = [
-    [1, 'Fred Flintstone', 'Fred'],  // note that id for the record is the first element
-    [2, 'Barney Rubble', 'Barney']
-];
-myStore.loadData(myData);
- * </code></pre>
- * <p>Records are cached and made available through accessor functions.  An example of adding
- * a record to the store:</p>
- * <pre><code>
-var defaultData = {
-    fullname: 'Full Name',
-    first: 'First Name'
-};
-var recId = 100; // provide unique id for the record
-var r = new myStore.recordType(defaultData, ++recId); // create new record
-myStore.{@link #insert}(0, r); // insert a new record into the store (also see {@link #add})
- * </code></pre>
- * @constructor
- * Creates a new Store.
- * @param {Object} config A config object containing the objects needed for the Store to access data,
- * and read the data into Records.
- * @xtype store
- */
-Ext.data.Store = function(config){
-    this.data = new Ext.util.MixedCollection(false);
-    this.data.getKey = function(o){
-        return o.id;
-    };
-    /**
-     * See the <code>{@link #baseParams corresponding configuration option}</code>
-     * for a description of this property.
-     * To modify this property see <code>{@link #setBaseParam}</code>.
-     * @property
-     */
-    this.baseParams = {};
+    syncHeight : function(){
+        var h = this.toolbarHeight,
+                bd = this.body,
+                lsh = this.lastSize.height,
+                sz;
 
-    // temporary removed-records cache
-    this.removed = [];
+        if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
+            return;
+        }
 
-    if(config && config.data){
-        this.inlineData = config.data;
-        delete config.data;
-    }
 
-    Ext.apply(this, config);
-    
-    this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames);
+        if(h != this.getToolbarHeight()){
+            h = Math.max(0, this.adjustBodyHeight(lsh - this.getFrameHeight()));
+            bd.setHeight(h);
+            sz = bd.getSize();
+            this.toolbarHeight = this.getToolbarHeight();
+            this.onBodyResize(sz.width, sz.height);
+        }
+    },
 
-    if(this.url && !this.proxy){
-        this.proxy = new Ext.data.HttpProxy({url: this.url});
-    }
-    // If Store is RESTful, so too is the DataProxy
-    if (this.restful === true && this.proxy) {
-        // When operating RESTfully, a unique transaction is generated for each record.
-        this.batch = false;
-        Ext.data.Api.restify(this.proxy);
-    }
+    // private
+    onShow : function(){
+        if(this.floating){
+            return this.el.show();
+        }
+        Ext.Panel.superclass.onShow.call(this);
+    },
+
+    // private
+    onHide : function(){
+        if(this.floating){
+            return this.el.hide();
+        }
+        Ext.Panel.superclass.onHide.call(this);
+    },
+
+    // private
+    createToolHandler : function(t, tc, overCls, panel){
+        return function(e){
+            t.removeClass(overCls);
+            if(tc.stopEvent !== false){
+                e.stopEvent();
+            }
+            if(tc.handler){
+                tc.handler.call(tc.scope || t, e, t, panel, tc);
+            }
+        };
+    },
 
-    if(this.reader){ // reader passed
-        if(!this.recordType){
-            this.recordType = this.reader.recordType;
+    // private
+    afterRender : function(){
+        if(this.floating && !this.hidden){
+            this.el.show();
         }
-        if(this.reader.onMetaChange){
-            this.reader.onMetaChange = this.onMetaChange.createDelegate(this);
+        if(this.title){
+            this.setTitle(this.title);
         }
-        if (this.writer) { // writer passed
-            this.writer.meta = this.reader.meta;
-            this.pruneModifiedRecords = true;
+        Ext.Panel.superclass.afterRender.call(this); // do sizing calcs last
+        if (this.collapsed) {
+            this.collapsed = false;
+            this.collapse(false);
         }
-    }
+        this.initEvents();
+    },
 
-    /**
-     * The {@link Ext.data.Record Record} constructor as supplied to (or created by) the
-     * {@link Ext.data.DataReader Reader}. Read-only.
-     * <p>If the Reader was constructed by passing in an Array of {@link Ext.data.Field} definition objects,
-     * instead of a Record constructor, it will implicitly create a Record constructor from that Array (see
-     * {@link Ext.data.Record}.{@link Ext.data.Record#create create} for additional details).</p>
-     * <p>This property may be used to create new Records of the type held in this Store, for example:</p><pre><code>
-// create the data store
-var store = new Ext.data.ArrayStore({
-    autoDestroy: true,
-    fields: [
-       {name: 'company'},
-       {name: 'price', type: 'float'},
-       {name: 'change', type: 'float'},
-       {name: 'pctChange', type: 'float'},
-       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
-    ]
-});
-store.loadData(myData);
+    // private
+    getKeyMap : function(){
+        if(!this.keyMap){
+            this.keyMap = new Ext.KeyMap(this.el, this.keys);
+        }
+        return this.keyMap;
+    },
 
-// create the Grid
-var grid = new Ext.grid.EditorGridPanel({
-    store: store,
-    colModel: new Ext.grid.ColumnModel({
-        columns: [
-            {id:'company', header: 'Company', width: 160, dataIndex: 'company'},
-            {header: 'Price', renderer: 'usMoney', dataIndex: 'price'},
-            {header: 'Change', renderer: change, dataIndex: 'change'},
-            {header: '% Change', renderer: pctChange, dataIndex: 'pctChange'},
-            {header: 'Last Updated', width: 85,
-                renderer: Ext.util.Format.dateRenderer('m/d/Y'),
-                dataIndex: 'lastChange'}
-        ],
-        defaults: {
-            sortable: true,
-            width: 75
+    // private
+    initEvents : function(){
+        if(this.keys){
+            this.getKeyMap();
         }
-    }),
-    autoExpandColumn: 'company', // match the id specified in the column model
-    height:350,
-    width:600,
-    title:'Array Grid',
-    tbar: [{
-        text: 'Add Record',
-        handler : function(){
-            var defaultData = {
-                change: 0,
-                company: 'New Company',
-                lastChange: (new Date()).clearTime(),
-                pctChange: 0,
-                price: 10
-            };
-            var recId = 3; // provide unique id
-            var p = new store.recordType(defaultData, recId); // create new record
-            grid.stopEditing();
-            store.{@link #insert}(0, p); // insert a new record into the store (also see {@link #add})
-            grid.startEditing(0, 0);
+        if(this.draggable){
+            this.initDraggable();
+        }
+        if(this.toolbars.length > 0){
+            Ext.each(this.toolbars, function(tb){
+                tb.doLayout();
+                tb.on({
+                    scope: this,
+                    afterlayout: this.syncHeight,
+                    remove: this.syncHeight
+                });
+            }, this);
+            this.syncHeight();
         }
-    }]
-});
-     * </code></pre>
-     * @property recordType
-     * @type Function
-     */
 
-    if(this.recordType){
-        /**
-         * A {@link Ext.util.MixedCollection MixedCollection} containing the defined {@link Ext.data.Field Field}s
-         * for the {@link Ext.data.Record Records} stored in this Store. Read-only.
-         * @property fields
-         * @type Ext.util.MixedCollection
-         */
-        this.fields = this.recordType.prototype.fields;
-    }
-    this.modified = [];
+    },
 
-    this.addEvents(
-        /**
-         * @event datachanged
-         * Fires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a
-         * widget that is using this Store as a Record cache should refresh its view.
-         * @param {Store} this
-         */
-        'datachanged',
-        /**
-         * @event metachange
-         * Fires when this store's reader provides new metadata (fields). This is currently only supported for JsonReaders.
-         * @param {Store} this
-         * @param {Object} meta The JSON metadata
-         */
-        'metachange',
-        /**
-         * @event add
-         * Fires when Records have been {@link #add}ed to the Store
-         * @param {Store} this
-         * @param {Ext.data.Record[]} records The array of Records added
-         * @param {Number} index The index at which the record(s) were added
-         */
-        'add',
-        /**
-         * @event remove
-         * Fires when a Record has been {@link #remove}d from the Store
-         * @param {Store} this
-         * @param {Ext.data.Record} record The Record that was removed
-         * @param {Number} index The index at which the record was removed
-         */
-        'remove',
-        /**
-         * @event update
-         * Fires when a Record has been updated
-         * @param {Store} this
-         * @param {Ext.data.Record} record The Record that was updated
-         * @param {String} operation The update operation being performed.  Value may be one of:
-         * <pre><code>
- Ext.data.Record.EDIT
- Ext.data.Record.REJECT
- Ext.data.Record.COMMIT
-         * </code></pre>
-         */
-        'update',
-        /**
-         * @event clear
-         * Fires when the data cache has been cleared.
-         * @param {Store} this
-         */
-        'clear',
-        /**
-         * @event exception
-         * <p>Fires if an exception occurs in the Proxy during a remote request.
-         * This event is relayed through the corresponding {@link Ext.data.DataProxy}.
-         * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
-         * for additional details.
-         * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
-         * for description.
-         */
-        'exception',
-        /**
-         * @event beforeload
-         * Fires before a request is made for a new data object.  If the beforeload handler returns
-         * <tt>false</tt> the {@link #load} action will be canceled.
-         * @param {Store} this
-         * @param {Object} options The loading options that were specified (see {@link #load} for details)
-         */
-        'beforeload',
-        /**
-         * @event load
-         * Fires after a new set of Records has been loaded.
-         * @param {Store} this
-         * @param {Ext.data.Record[]} records The Records that were loaded
-         * @param {Object} options The loading options that were specified (see {@link #load} for details)
-         */
-        'load',
-        /**
-         * @event loadexception
-         * <p>This event is <b>deprecated</b> in favor of the catch-all <b><code>{@link #exception}</code></b>
-         * event instead.</p>
-         * <p>This event is relayed through the corresponding {@link Ext.data.DataProxy}.
-         * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception}
-         * for additional details.
-         * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception}
-         * for description.
-         */
-        'loadexception',
-        /**
-         * @event beforewrite
-         * @param {DataProxy} this
-         * @param {String} action [Ext.data.Api.actions.create|update|destroy]
-         * @param {Record/Array[Record]} rs
-         * @param {Object} options The loading options that were specified. Edit <code>options.params</code> to add Http parameters to the request.  (see {@link #save} for details)
-         * @param {Object} arg The callback's arg object passed to the {@link #request} function
-         */
-        'beforewrite',
+    // private
+    initDraggable : function(){
         /**
-         * @event write
-         * Fires if the server returns 200 after an Ext.data.Api.actions CRUD action.
-         * Success or failure of the action is available in the <code>result['successProperty']</code> property.
-         * The server-code might set the <code>successProperty</code> to <tt>false</tt> if a database validation
-         * failed, for example.
-         * @param {Ext.data.Store} store
-         * @param {String} action [Ext.data.Api.actions.create|update|destroy]
-         * @param {Object} result The 'data' picked-out out of the response for convenience.
-         * @param {Ext.Direct.Transaction} res
-         * @param {Record/Record[]} rs Store's records, the subject(s) of the write-action
+         * <p>If this Panel is configured {@link #draggable}, this property will contain
+         * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.</p>
+         * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
+         * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}.
+         * @type Ext.dd.DragSource.
+         * @property dd
          */
-        'write'
-    );
+        this.dd = new Ext.Panel.DD(this, Ext.isBoolean(this.draggable) ? null : this.draggable);
+    },
 
-    if(this.proxy){
-        this.relayEvents(this.proxy,  ['loadexception', 'exception']);
-    }
-    // With a writer set for the Store, we want to listen to add/remove events to remotely create/destroy records.
-    if (this.writer) {
-        this.on({
-            scope: this,
-            add: this.createRecords,
-            remove: this.destroyRecord,
-            update: this.updateRecord
-        });
-    }
+    // private
+    beforeEffect : function(anim){
+        if(this.floating){
+            this.el.beforeAction();
+        }
+        if(anim !== false){
+            this.el.addClass('x-panel-animated');
+        }
+    },
 
-    this.sortToggle = {};
-    if(this.sortField){
-        this.setDefaultSort(this.sortField, this.sortDir);
-    }else if(this.sortInfo){
-        this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction);
-    }
+    // private
+    afterEffect : function(anim){
+        this.syncShadow();
+        if(anim !== false){
+            this.el.removeClass('x-panel-animated');
+        }
+    },
 
-    Ext.data.Store.superclass.constructor.call(this);
+    // private - wraps up an animation param with internal callbacks
+    createEffect : function(a, cb, scope){
+        var o = {
+            scope:scope,
+            block:true
+        };
+        if(a === true){
+            o.callback = cb;
+            return o;
+        }else if(!a.callback){
+            o.callback = cb;
+        }else { // wrap it up
+            o.callback = function(){
+                cb.call(scope);
+                Ext.callback(a.callback, a.scope);
+            };
+        }
+        return Ext.applyIf(o, a);
+    },
 
-    if(this.id){
-        this.storeId = this.id;
-        delete this.id;
-    }
-    if(this.storeId){
-        Ext.StoreMgr.register(this);
-    }
-    if(this.inlineData){
-        this.loadData(this.inlineData);
-        delete this.inlineData;
-    }else if(this.autoLoad){
-        this.load.defer(10, this, [
-            typeof this.autoLoad == 'object' ?
-                this.autoLoad : undefined]);
-    }
-};
-Ext.extend(Ext.data.Store, Ext.util.Observable, {
-    /**
-     * @cfg {String} storeId If passed, the id to use to register with the <b>{@link Ext.StoreMgr StoreMgr}</b>.
-     * <p><b>Note</b>: if a (deprecated) <tt>{@link #id}</tt> is specified it will supersede the <tt>storeId</tt>
-     * assignment.</p>
-     */
-    /**
-     * @cfg {String} url If a <tt>{@link #proxy}</tt> is not specified the <tt>url</tt> will be used to
-     * implicitly configure a {@link Ext.data.HttpProxy HttpProxy} if an <tt>url</tt> is specified.
-     * Typically this option, or the <code>{@link #data}</code> option will be specified.
-     */
-    /**
-     * @cfg {Boolean/Object} autoLoad If <tt>{@link #data}</tt> is not specified, and if <tt>autoLoad</tt>
-     * is <tt>true</tt> or an <tt>Object</tt>, this store's {@link #load} method is automatically called
-     * after creation. If the value of <tt>autoLoad</tt> is an <tt>Object</tt>, this <tt>Object</tt> will
-     * be passed to the store's {@link #load} method.
-     */
-    /**
-     * @cfg {Ext.data.DataProxy} proxy The {@link Ext.data.DataProxy DataProxy} object which provides
-     * access to a data object.  See <code>{@link #url}</code>.
-     */
-    /**
-     * @cfg {Array} data An inline data object readable by the <code>{@link #reader}</code>.
-     * Typically this option, or the <code>{@link #url}</code> option will be specified.
-     */
     /**
-     * @cfg {Ext.data.DataReader} reader The {@link Ext.data.DataReader Reader} object which processes the
-     * data object and returns an Array of {@link Ext.data.Record} objects which are cached keyed by their
-     * <b><tt>{@link Ext.data.Record#id id}</tt></b> property.
+     * Collapses the panel body so that it becomes hidden.  Fires the {@link #beforecollapse} event which will
+     * cancel the collapse action if it returns false.
+     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
+     * {@link #animCollapse} panel config)
+     * @return {Ext.Panel} this
      */
-    /**
-     * @cfg {Ext.data.DataWriter} writer
-     * <p>The {@link Ext.data.DataWriter Writer} object which processes a record object for being written
-     * to the server-side database.</p>
-     * <br><p>When a writer is installed into a Store the {@link #add}, {@link #remove}, and {@link #update}
-     * events on the store are monitored in order to remotely {@link #createRecords create records},
-     * {@link #destroyRecord destroy records}, or {@link #updateRecord update records}.</p>
-     * <br><p>The proxy for this store will relay any {@link #writexception} events to this store.</p>
-     * <br><p>Sample implementation:
-     * <pre><code>
-var writer = new {@link Ext.data.JsonWriter}({
-    encode: true,
-    writeAllFields: true // write all fields, not just those that changed
-});
+    collapse : function(animate){
+        if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){
+            return;
+        }
+        var doAnim = animate === true || (animate !== false && this.animCollapse);
+        this.beforeEffect(doAnim);
+        this.onCollapse(doAnim, animate);
+        return this;
+    },
+
+    // private
+    onCollapse : function(doAnim, animArg){
+        if(doAnim){
+            this[this.collapseEl].slideOut(this.slideAnchor,
+                    Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this),
+                        this.collapseDefaults));
+        }else{
+            this[this.collapseEl].hide();
+            this.afterCollapse(false);
+        }
+    },
+
+    // private
+    afterCollapse : function(anim){
+        this.collapsed = true;
+        this.el.addClass(this.collapsedCls);
+        this.afterEffect(anim);
+        this.fireEvent('collapse', this);
+    },
 
-// Typical Store collecting the Proxy, Reader and Writer together.
-var store = new Ext.data.Store({
-    storeId: 'user',
-    root: 'records',
-    proxy: proxy,
-    reader: reader,
-    writer: writer,     // <-- plug a DataWriter into the store just as you would a Reader
-    paramsAsHash: true,
-    autoSave: false    // <-- false to delay executing create, update, destroy requests
-                        //     until specifically told to do so.
-});
-     * </code></pre></p>
-     */
-    writer : undefined,
-    /**
-     * @cfg {Object} baseParams
-     * <p>An object containing properties which are to be sent as parameters
-     * for <i>every</i> HTTP request.</p>
-     * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
-     * <p><b>Note</b>: <code>baseParams</code> may be superseded by any <code>params</code>
-     * specified in a <code>{@link #load}</code> request, see <code>{@link #load}</code>
-     * for more details.</p>
-     * This property may be modified after creation using the <code>{@link #setBaseParam}</code>
-     * method.
-     * @property
-     */
-    /**
-     * @cfg {Object} sortInfo A config object to specify the sort order in the request of a Store's
-     * {@link #load} operation.  Note that for local sorting, the <tt>direction</tt> property is
-     * case-sensitive. See also {@link #remoteSort} and {@link #paramNames}.
-     * For example:<pre><code>
-sortInfo: {
-    field: 'fieldName',
-    direction: 'ASC' // or 'DESC' (case sensitive for local sorting)
-}
-</code></pre>
-     */
     /**
-     * @cfg {boolean} remoteSort <tt>true</tt> if sorting is to be handled by requesting the <tt>{@link #proxy Proxy}</tt>
-     * to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache
-     * in place (defaults to <tt>false</tt>).
-     * <p>If <tt>remoteSort</tt> is <tt>true</tt>, then clicking on a {@link Ext.grid.Column Grid Column}'s
-     * {@link Ext.grid.Column#header header} causes the current page to be requested from the server appending
-     * the following two parameters to the <b><tt>{@link #load params}</tt></b>:<div class="mdetail-params"><ul>
-     * <li><b><tt>sort</tt></b> : String<p class="sub-desc">The <tt>name</tt> (as specified in the Record's
-     * {@link Ext.data.Field Field definition}) of the field to sort on.</p></li>
-     * <li><b><tt>dir</tt></b> : String<p class="sub-desc">The direction of the sort, 'ASC' or 'DESC' (case-sensitive).</p></li>
-     * </ul></div></p>
+     * Expands the panel body so that it becomes visible.  Fires the {@link #beforeexpand} event which will
+     * cancel the expand action if it returns false.
+     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
+     * {@link #animCollapse} panel config)
+     * @return {Ext.Panel} this
      */
-    remoteSort : false,
+    expand : function(animate){
+        if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){
+            return;
+        }
+        var doAnim = animate === true || (animate !== false && this.animCollapse);
+        this.el.removeClass(this.collapsedCls);
+        this.beforeEffect(doAnim);
+        this.onExpand(doAnim, animate);
+        return this;
+    },
+
+    // private
+    onExpand : function(doAnim, animArg){
+        if(doAnim){
+            this[this.collapseEl].slideIn(this.slideAnchor,
+                    Ext.apply(this.createEffect(animArg||true, this.afterExpand, this),
+                        this.expandDefaults));
+        }else{
+            this[this.collapseEl].show();
+            this.afterExpand(false);
+        }
+    },
 
-    /**
-     * @cfg {Boolean} autoDestroy <tt>true</tt> to destroy the store when the component the store is bound
-     * to is destroyed (defaults to <tt>false</tt>).
-     * <p><b>Note</b>: this should be set to true when using stores that are bound to only 1 component.</p>
-     */
-    autoDestroy : false,
+    // private
+    afterExpand : function(anim){
+        this.collapsed = false;
+        this.afterEffect(anim);
+        if (this.deferLayout) {
+            delete this.deferLayout;
+            this.doLayout(true);
+        }
+        this.fireEvent('expand', this);
+    },
 
     /**
-     * @cfg {Boolean} pruneModifiedRecords <tt>true</tt> to clear all modified record information each time
-     * the store is loaded or when a record is removed (defaults to <tt>false</tt>). See {@link #getModifiedRecords}
-     * for the accessor method to retrieve the modified records.
+     * Shortcut for performing an {@link #expand} or {@link #collapse} based on the current state of the panel.
+     * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
+     * {@link #animCollapse} panel config)
+     * @return {Ext.Panel} this
      */
-    pruneModifiedRecords : false,
+    toggleCollapse : function(animate){
+        this[this.collapsed ? 'expand' : 'collapse'](animate);
+        return this;
+    },
 
-    /**
-     * Contains the last options object used as the parameter to the {@link #load} method. See {@link #load}
-     * for the details of what this may contain. This may be useful for accessing any params which were used
-     * to load the current Record cache.
-     * @property
-     */
-    lastOptions : null,
+    // private
+    onDisable : function(){
+        if(this.rendered && this.maskDisabled){
+            this.el.mask();
+        }
+        Ext.Panel.superclass.onDisable.call(this);
+    },
 
-    /**
-     * @cfg {Boolean} autoSave
-     * <p>Defaults to <tt>true</tt> causing the store to automatically {@link #save} records to
-     * the server when a record is modified (ie: becomes 'dirty'). Specify <tt>false</tt> to manually call {@link #save}
-     * to send all modifiedRecords to the server.</p>
-     * <br><p><b>Note</b>: each CRUD action will be sent as a separate request.</p>
-     */
-    autoSave : true,
+    // private
+    onEnable : function(){
+        if(this.rendered && this.maskDisabled){
+            this.el.unmask();
+        }
+        Ext.Panel.superclass.onEnable.call(this);
+    },
 
-    /**
-     * @cfg {Boolean} batch
-     * <p>Defaults to <tt>true</tt> (unless <code>{@link #restful}:true</code>). Multiple
-     * requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined
-     * and sent as one transaction. Only applies when <code>{@link #autoSave}</code> is set
-     * to <tt>false</tt>.</p>
-     * <br><p>If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is
-     * generated for each record.</p>
-     */
-    batch : true,
+    // private
+    onResize : function(w, h){
+        if(Ext.isDefined(w) || Ext.isDefined(h)){
+            if(!this.collapsed){
+                // First, set the the Panel's body width.
+                // If we have auto-widthed it, get the resulting full offset width so we can size the Toolbars to match
+                // The Toolbars must not buffer this resize operation because we need to know their heights.
+
+                if(Ext.isNumber(w)){
+                    this.body.setWidth(w = this.adjustBodyWidth(w - this.getFrameWidth()));
+                } else if (w == 'auto') {
+                    w = this.body.setWidth('auto').dom.offsetWidth;
+                } else {
+                    w = this.body.dom.offsetWidth;
+                }
+
+                if(this.tbar){
+                    this.tbar.setWidth(w);
+                    if(this.topToolbar){
+                        this.topToolbar.setSize(w);
+                    }
+                }
+                if(this.bbar){
+                    this.bbar.setWidth(w);
+                    if(this.bottomToolbar){
+                        this.bottomToolbar.setSize(w);
+                        // The bbar does not move on resize without this.
+                        if (Ext.isIE) {
+                            this.bbar.setStyle('position', 'static');
+                            this.bbar.setStyle('position', '');
+                        }
+                    }
+                }
+                if(this.footer){
+                    this.footer.setWidth(w);
+                    if(this.fbar){
+                        this.fbar.setSize(Ext.isIE ? (w - this.footer.getFrameWidth('lr')) : 'auto');
+                    }
+                }
+
+                // At this point, the Toolbars must be layed out for getFrameHeight to find a result.
+                if(Ext.isNumber(h)){
+                    h = Math.max(0, this.adjustBodyHeight(h - this.getFrameHeight()));
+                    this.body.setHeight(h);
+                }else if(h == 'auto'){
+                    this.body.setHeight(h);
+                }
+
+                if(this.disabled && this.el._mask){
+                    this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight());
+                }
+            }else{
+                // Adds an event to set the correct height afterExpand.  This accounts for the deferHeight flag in panel
+                this.queuedBodySize = {width: w, height: h};
+                if(!this.queuedExpand && this.allowQueuedExpand !== false){
+                    this.queuedExpand = true;
+                    this.on('expand', function(){
+                        delete this.queuedExpand;
+                        this.onResize(this.queuedBodySize.width, this.queuedBodySize.height);
+                    }, this, {single:true});
+                }
+            }
+            this.onBodyResize(w, h);
+        }
+        this.syncShadow();
+        Ext.Panel.superclass.onResize.call(this);
+    },
+
+    // private
+    onBodyResize: function(w, h){
+        this.fireEvent('bodyresize', this, w, h);
+    },
+
+    // private
+    getToolbarHeight: function(){
+        var h = 0;
+        if(this.rendered){
+            Ext.each(this.toolbars, function(tb){
+                h += tb.getHeight();
+            }, this);
+        }
+        return h;
+    },
+
+    // private
+    adjustBodyHeight : function(h){
+        return h;
+    },
+
+    // private
+    adjustBodyWidth : function(w){
+        return w;
+    },
+
+    // private
+    onPosition : function(){
+        this.syncShadow();
+    },
 
     /**
-     * @cfg {Boolean} restful
-     * Defaults to <tt>false</tt>.  Set to <tt>true</tt> to have the Store and the set
-     * Proxy operate in a RESTful manner. The store will automatically generate GET, POST,
-     * PUT and DELETE requests to the server. The HTTP method used for any given CRUD
-     * action is described in {@link Ext.data.Api#restActions}.  For additional information
-     * see {@link Ext.data.DataProxy#restful}.
-     * <p><b>Note</b>: if <code>{@link #restful}:true</code> <code>batch</code> will
-     * internally be set to <tt>false</tt>.</p>
+     * Returns the width in pixels of the framing elements of this panel (not including the body width).  To
+     * retrieve the body width see {@link #getInnerWidth}.
+     * @return {Number} The frame width
      */
-    restful: false,
-    
+    getFrameWidth : function(){
+        var w = this.el.getFrameWidth('lr') + this.bwrap.getFrameWidth('lr');
+
+        if(this.frame){
+            var l = this.bwrap.dom.firstChild;
+            w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r'));
+            w += this.mc.getFrameWidth('lr');
+        }
+        return w;
+    },
+
     /**
-     * @cfg {Object} paramNames
-     * <p>An object containing properties which specify the names of the paging and
-     * sorting parameters passed to remote servers when loading blocks of data. By default, this
-     * object takes the following form:</p><pre><code>
-{
-    start : 'start',  // The parameter name which specifies the start row
-    limit : 'limit',  // The parameter name which specifies number of rows to return
-    sort : 'sort',    // The parameter name which specifies the column to sort on
-    dir : 'dir'       // The parameter name which specifies the sort direction
-}
-</code></pre>
-     * <p>The server must produce the requested data block upon receipt of these parameter names.
-     * If different parameter names are required, this property can be overriden using a configuration
-     * property.</p>
-     * <p>A {@link Ext.PagingToolbar PagingToolbar} bound to this Store uses this property to determine
-     * the parameter names to use in its {@link #load requests}.
+     * Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and
+     * header and footer elements, but not including the body height).  To retrieve the body height see {@link #getInnerHeight}.
+     * @return {Number} The frame height
      */
-    paramNames : undefined,
-    
+    getFrameHeight : function(){
+        var h  = this.el.getFrameWidth('tb') + this.bwrap.getFrameWidth('tb');
+        h += (this.tbar ? this.tbar.getHeight() : 0) +
+             (this.bbar ? this.bbar.getHeight() : 0);
+
+        if(this.frame){
+            h += this.el.dom.firstChild.offsetHeight + this.ft.dom.offsetHeight + this.mc.getFrameWidth('tb');
+        }else{
+            h += (this.header ? this.header.getHeight() : 0) +
+                (this.footer ? this.footer.getHeight() : 0);
+        }
+        return h;
+    },
+
     /**
-     * @cfg {Object} defaultParamNames
-     * Provides the default values for the {@link #paramNames} property. To globally modify the parameters
-     * for all stores, this object should be changed on the store prototype.
+     * Returns the width in pixels of the body element (not including the width of any framing elements).
+     * For the frame width see {@link #getFrameWidth}.
+     * @return {Number} The body width
      */
-    defaultParamNames : {
-        start : 'start',
-        limit : 'limit',
-        sort : 'sort',
-        dir : 'dir'
+    getInnerWidth : function(){
+        return this.getSize().width - this.getFrameWidth();
     },
 
     /**
-     * Destroys the store.
+     * Returns the height in pixels of the body element (not including the height of any framing elements).
+     * For the frame height see {@link #getFrameHeight}.
+     * @return {Number} The body height
      */
-    destroy : function(){
-        if(this.storeId){
-            Ext.StoreMgr.unregister(this);
+    getInnerHeight : function(){
+        return this.getSize().height - this.getFrameHeight();
+    },
+
+    // private
+    syncShadow : function(){
+        if(this.floating){
+            this.el.sync(true);
         }
-        this.data = null;
-        Ext.destroy(this.proxy);
-        this.reader = this.writer = null;
-        this.purgeListeners();
+    },
+
+    // private
+    getLayoutTarget : function(){
+        return this.body;
+    },
+
+    // private
+    getContentTarget : function(){
+        return this.body;
     },
 
     /**
-     * Add Records to the Store and fires the {@link #add} event.  To add Records
-     * to the store from a remote source use <code>{@link #load}({add:true})</code>.
-     * See also <code>{@link #recordType}</code> and <code>{@link #insert}</code>.
-     * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects
-     * to add to the cache. See {@link #recordType}.
+     * <p>Sets the title text for the panel and optionally the {@link #iconCls icon class}.</p>
+     * <p>In order to be able to set the title, a header element must have been created
+     * for the Panel. This is triggered either by configuring the Panel with a non-blank <code>{@link #title}</code>,
+     * or configuring it with <code><b>{@link #header}: true</b></code>.</p>
+     * @param {String} title The title text to set
+     * @param {String} iconCls (optional) {@link #iconCls iconCls} A user-defined CSS class that provides the icon image for this panel
      */
-    add : function(records){
-        records = [].concat(records);
-        if(records.length < 1){
-            return;
-        }
-        for(var i = 0, len = records.length; i < len; i++){
-            records[i].join(this);
+    setTitle : function(title, iconCls){
+        this.title = title;
+        if(this.header && this.headerAsText){
+            this.header.child('span').update(title);
         }
-        var index = this.data.length;
-        this.data.addAll(records);
-        if(this.snapshot){
-            this.snapshot.addAll(records);
+        if(iconCls){
+            this.setIconClass(iconCls);
         }
-        this.fireEvent('add', this, records, index);
+        this.fireEvent('titlechange', this, title);
+        return this;
     },
 
     /**
-     * (Local sort only) Inserts the passed Record into the Store at the index where it
-     * should go based on the current sort information.
-     * @param {Ext.data.Record} record
+     * Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body.
+     * @return {Ext.Updater} The Updater
      */
-    addSorted : function(record){
-        var index = this.findInsertIndex(record);
-        this.insert(index, record);
+    getUpdater : function(){
+        return this.body.getUpdater();
     },
 
-    /**
-     * Remove a Record from the Store and fires the {@link #remove} event.
-     * @param {Ext.data.Record} record The Ext.data.Record object to remove from the cache.
+     /**
+     * Loads this content panel immediately with content returned from an XHR call.
+     * @param {Object/String/Function} config A config object containing any of the following options:
+<pre><code>
+panel.load({
+    url: 'your-url.php',
+    params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string
+    callback: yourFunction,
+    scope: yourObject, // optional scope for the callback
+    discardUrl: false,
+    nocache: false,
+    text: 'Loading...',
+    timeout: 30,
+    scripts: false
+});
+</code></pre>
+     * The only required property is url. The optional properties nocache, text and scripts
+     * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their
+     * associated property on this panel Updater instance.
+     * @return {Ext.Panel} this
      */
-    remove : function(record){
-        var index = this.data.indexOf(record);
-        if(index > -1){
-            this.data.removeAt(index);
-            if(this.pruneModifiedRecords){
-                this.modified.remove(record);
+    load : function(){
+        var um = this.body.getUpdater();
+        um.update.apply(um, arguments);
+        return this;
+    },
+
+    // private
+    beforeDestroy : function(){
+        Ext.Panel.superclass.beforeDestroy.call(this);
+        if(this.header){
+            this.header.removeAllListeners();
+        }
+        if(this.tools){
+            for(var k in this.tools){
+                Ext.destroy(this.tools[k]);
             }
-            if(this.snapshot){
-                this.snapshot.remove(record);
+        }
+        if(this.toolbars.length > 0){
+            Ext.each(this.toolbars, function(tb){
+                tb.un('afterlayout', this.syncHeight, this);
+                tb.un('remove', this.syncHeight, this);
+            }, this);
+        }
+        if(Ext.isArray(this.buttons)){
+            while(this.buttons.length) {
+                Ext.destroy(this.buttons[0]);
             }
-            this.fireEvent('remove', this, record, index);
+        }
+        if(this.rendered){
+            Ext.destroy(
+                this.ft,
+                this.header,
+                this.footer,
+                this.toolbars,
+                this.tbar,
+                this.bbar,
+                this.body,
+                this.mc,
+                this.bwrap
+            );
+            if (this.fbar) {
+                Ext.destroy(
+                    this.fbar,
+                    this.fbar.el
+                );
+            }
+        }else{
+            Ext.destroy(
+                this.topToolbar,
+                this.bottomToolbar
+            );
         }
     },
 
-    /**
-     * Remove a Record from the Store at the specified index. Fires the {@link #remove} event.
-     * @param {Number} index The index of the record to remove.
-     */
-    removeAt : function(index){
-        this.remove(this.getAt(index));
+    // private
+    createClasses : function(){
+        this.headerCls = this.baseCls + '-header';
+        this.headerTextCls = this.baseCls + '-header-text';
+        this.bwrapCls = this.baseCls + '-bwrap';
+        this.tbarCls = this.baseCls + '-tbar';
+        this.bodyCls = this.baseCls + '-body';
+        this.bbarCls = this.baseCls + '-bbar';
+        this.footerCls = this.baseCls + '-footer';
     },
 
-    /**
-     * Remove all Records from the Store and fires the {@link #clear} event.
-     */
-    removeAll : function(){
-        this.data.clear();
-        if(this.snapshot){
-            this.snapshot.clear();
+    // private
+    createGhost : function(cls, useShim, appendTo){
+        var el = document.createElement('div');
+        el.className = 'x-panel-ghost ' + (cls ? cls : '');
+        if(this.header){
+            el.appendChild(this.el.dom.firstChild.cloneNode(true));
         }
-        if(this.pruneModifiedRecords){
-            this.modified = [];
+        Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight());
+        el.style.width = this.el.dom.offsetWidth + 'px';;
+        if(!appendTo){
+            this.container.dom.appendChild(el);
+        }else{
+            Ext.getDom(appendTo).appendChild(el);
+        }
+        if(useShim !== false && this.el.useShim !== false){
+            var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el);
+            layer.show();
+            return layer;
+        }else{
+            return new Ext.Element(el);
         }
-        this.fireEvent('clear', this);
     },
 
-    /**
-     * Inserts Records into the Store at the given index and fires the {@link #add} event.
-     * See also <code>{@link #add}</code> and <code>{@link #addSorted}</code>.
-     * @param {Number} index The start index at which to insert the passed Records.
-     * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects to add to the cache.
-     */
-    insert : function(index, records){
-        records = [].concat(records);
-        for(var i = 0, len = records.length; i < len; i++){
-            this.data.insert(index, records[i]);
-            records[i].join(this);
+    // private
+    doAutoLoad : function(){
+        var u = this.body.getUpdater();
+        if(this.renderer){
+            u.setRenderer(this.renderer);
         }
-        this.fireEvent('add', this, records, index);
+        u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad});
     },
 
     /**
-     * Get the index within the cache of the passed Record.
-     * @param {Ext.data.Record} record The Ext.data.Record object to find.
-     * @return {Number} The index of the passed Record. Returns -1 if not found.
+     * Retrieve a tool by id.
+     * @param {String} id
+     * @return {Object} tool
      */
-    indexOf : function(record){
-        return this.data.indexOf(record);
-    },
+    getTool : function(id) {
+        return this.tools[id];
+    }
+
+/**
+ * @cfg {String} autoEl @hide
+ */
+});
+Ext.reg('panel', Ext.Panel);
+/**
+ * @class Ext.Editor
+ * @extends Ext.Component
+ * A base editor field that handles displaying/hiding on demand and has some built-in sizing and event handling logic.
+ * @constructor
+ * Create a new Editor
+ * @param {Object} config The config object
+ * @xtype editor
+ */
+Ext.Editor = function(field, config){
+    if(field.field){
+        this.field = Ext.create(field.field, 'textfield');
+        config = Ext.apply({}, field); // copy so we don't disturb original config
+        delete config.field;
+    }else{
+        this.field = field;
+    }
+    Ext.Editor.superclass.constructor.call(this, config);
+};
 
+Ext.extend(Ext.Editor, Ext.Component, {
     /**
-     * Get the index within the cache of the Record with the passed id.
-     * @param {String} id The id of the Record to find.
-     * @return {Number} The index of the Record. Returns -1 if not found.
+    * @cfg {Ext.form.Field} field
+    * The Field object (or descendant) or config object for field
+    */
+    /**
+     * @cfg {Boolean} allowBlur
+     * True to {@link #completeEdit complete the editing process} if in edit mode when the
+     * field is blurred. Defaults to <tt>false</tt>.
      */
-    indexOfId : function(id){
-        return this.data.indexOfKey(id);
-    },
-
     /**
-     * Get the Record with the specified id.
-     * @param {String} id The id of the Record to find.
-     * @return {Ext.data.Record} The Record with the passed id. Returns undefined if not found.
+     * @cfg {Boolean/String} autoSize
+     * True for the editor to automatically adopt the size of the underlying field, "width" to adopt the width only,
+     * or "height" to adopt the height only, "none" to always use the field dimensions. (defaults to false)
      */
-    getById : function(id){
-        return this.data.key(id);
-    },
-
     /**
-     * Get the Record at the specified index.
-     * @param {Number} index The index of the Record to find.
-     * @return {Ext.data.Record} The Record at the passed index. Returns undefined if not found.
+     * @cfg {Boolean} revertInvalid
+     * True to automatically revert the field value and cancel the edit when the user completes an edit and the field
+     * validation fails (defaults to true)
      */
-    getAt : function(index){
-        return this.data.itemAt(index);
-    },
-
     /**
-     * Returns a range of Records between specified indices.
-     * @param {Number} startIndex (optional) The starting index (defaults to 0)
-     * @param {Number} endIndex (optional) The ending index (defaults to the last Record in the Store)
-     * @return {Ext.data.Record[]} An array of Records
+     * @cfg {Boolean} ignoreNoChange
+     * True to skip the edit completion process (no save, no events fired) if the user completes an edit and
+     * the value has not changed (defaults to false).  Applies only to string values - edits for other data types
+     * will never be ignored.
      */
-    getRange : function(start, end){
-        return this.data.getRange(start, end);
+    /**
+     * @cfg {Boolean} hideEl
+     * False to keep the bound element visible while the editor is displayed (defaults to true)
+     */
+    /**
+     * @cfg {Mixed} value
+     * The data value of the underlying field (defaults to "")
+     */
+    value : "",
+    /**
+     * @cfg {String} alignment
+     * The position to align to (see {@link Ext.Element#alignTo} for more details, defaults to "c-c?").
+     */
+    alignment: "c-c?",
+    /**
+     * @cfg {Array} offsets
+     * The offsets to use when aligning (see {@link Ext.Element#alignTo} for more details. Defaults to <tt>[0, 0]</tt>.
+     */
+    offsets: [0, 0],
+    /**
+     * @cfg {Boolean/String} shadow "sides" for sides/bottom only, "frame" for 4-way shadow, and "drop"
+     * for bottom-right shadow (defaults to "frame")
+     */
+    shadow : "frame",
+    /**
+     * @cfg {Boolean} constrain True to constrain the editor to the viewport
+     */
+    constrain : false,
+    /**
+     * @cfg {Boolean} swallowKeys Handle the keydown/keypress events so they don't propagate (defaults to true)
+     */
+    swallowKeys : true,
+    /**
+     * @cfg {Boolean} completeOnEnter True to complete the edit when the enter key is pressed. Defaults to <tt>true</tt>.
+     */
+    completeOnEnter : true,
+    /**
+     * @cfg {Boolean} cancelOnEsc True to cancel the edit when the escape key is pressed. Defaults to <tt>true</tt>.
+     */
+    cancelOnEsc : true,
+    /**
+     * @cfg {Boolean} updateEl True to update the innerHTML of the bound element when the update completes (defaults to false)
+     */
+    updateEl : false,
+
+    initComponent : function(){
+        Ext.Editor.superclass.initComponent.call(this);
+        this.addEvents(
+            /**
+             * @event beforestartedit
+             * Fires when editing is initiated, but before the value changes.  Editing can be canceled by returning
+             * false from the handler of this event.
+             * @param {Editor} this
+             * @param {Ext.Element} boundEl The underlying element bound to this editor
+             * @param {Mixed} value The field value being set
+             */
+            "beforestartedit",
+            /**
+             * @event startedit
+             * Fires when this editor is displayed
+             * @param {Ext.Element} boundEl The underlying element bound to this editor
+             * @param {Mixed} value The starting field value
+             */
+            "startedit",
+            /**
+             * @event beforecomplete
+             * Fires after a change has been made to the field, but before the change is reflected in the underlying
+             * field.  Saving the change to the field can be canceled by returning false from the handler of this event.
+             * Note that if the value has not changed and ignoreNoChange = true, the editing will still end but this
+             * event will not fire since no edit actually occurred.
+             * @param {Editor} this
+             * @param {Mixed} value The current field value
+             * @param {Mixed} startValue The original field value
+             */
+            "beforecomplete",
+            /**
+             * @event complete
+             * Fires after editing is complete and any changed value has been written to the underlying field.
+             * @param {Editor} this
+             * @param {Mixed} value The current field value
+             * @param {Mixed} startValue The original field value
+             */
+            "complete",
+            /**
+             * @event canceledit
+             * Fires after editing has been canceled and the editor's value has been reset.
+             * @param {Editor} this
+             * @param {Mixed} value The user-entered field value that was discarded
+             * @param {Mixed} startValue The original field value that was set back into the editor after cancel
+             */
+            "canceledit",
+            /**
+             * @event specialkey
+             * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed.  You can check
+             * {@link Ext.EventObject#getKey} to determine which key was pressed.
+             * @param {Ext.form.Field} this
+             * @param {Ext.EventObject} e The event object
+             */
+            "specialkey"
+        );
     },
 
     // private
-    storeOptions : function(o){
-        o = Ext.apply({}, o);
-        delete o.callback;
-        delete o.scope;
-        this.lastOptions = o;
-    },
-
-    /**
-     * <p>Loads the Record cache from the configured <tt>{@link #proxy}</tt> using the configured <tt>{@link #reader}</tt>.</p>
-     * <br><p>Notes:</p><div class="mdetail-params"><ul>
-     * <li><b><u>Important</u></b>: loading is asynchronous! This call will return before the new data has been
-     * loaded. To perform any post-processing where information from the load call is required, specify
-     * the <tt>callback</tt> function to be called, or use a {@link Ext.util.Observable#listeners a 'load' event handler}.</li>
-     * <li>If using {@link Ext.PagingToolbar remote paging}, the first load call must specify the <tt>start</tt> and <tt>limit</tt>
-     * properties in the <code>options.params</code> property to establish the initial position within the
-     * dataset, and the number of Records to cache on each read from the Proxy.</li>
-     * <li>If using {@link #remoteSort remote sorting}, the configured <code>{@link #sortInfo}</code>
-     * will be automatically included with the posted parameters according to the specified
-     * <code>{@link #paramNames}</code>.</li>
-     * </ul></div>
-     * @param {Object} options An object containing properties which control loading options:<ul>
-     * <li><b><tt>params</tt></b> :Object<div class="sub-desc"><p>An object containing properties to pass as HTTP
-     * parameters to a remote data source. <b>Note</b>: <code>params</code> will override any
-     * <code>{@link #baseParams}</code> of the same name.</p>
-     * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p></div></li>
-     * <li><b><tt>callback</tt></b> : Function<div class="sub-desc"><p>A function to be called after the Records
-     * have been loaded. The <tt>callback</tt> is called after the load event and is passed the following arguments:<ul>
-     * <li><tt>r</tt> : Ext.data.Record[]</li>
-     * <li><tt>options</tt>: Options object from the load call</li>
-     * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div></li>
-     * <li><b><tt>scope</tt></b> : Object<div class="sub-desc"><p>Scope with which to call the callback (defaults
-     * to the Store object)</p></div></li>
-     * <li><b><tt>add</tt></b> : Boolean<div class="sub-desc"><p>Indicator to append loaded records rather than
-     * replace the current cache.  <b>Note</b>: see note for <tt>{@link #loadData}</tt></p></div></li>
-     * </ul>
-     * @return {Boolean} If the <i>developer</i> provided <tt>{@link #beforeload}</tt> event handler returns
-     * <tt>false</tt>, the load call will abort and will return <tt>false</tt>; otherwise will return <tt>true</tt>.
-     */
-    load : function(options) {
-        options = options || {};
-        this.storeOptions(options);
-        if(this.sortInfo && this.remoteSort){
-            var pn = this.paramNames;
-            options.params = options.params || {};
-            options.params[pn.sort] = this.sortInfo.field;
-            options.params[pn.dir] = this.sortInfo.direction;
+    onRender : function(ct, position){
+        this.el = new Ext.Layer({
+            shadow: this.shadow,
+            cls: "x-editor",
+            parentEl : ct,
+            shim : this.shim,
+            shadowOffset: this.shadowOffset || 4,
+            id: this.id,
+            constrain: this.constrain
+        });
+        if(this.zIndex){
+            this.el.setZIndex(this.zIndex);
         }
-        try {
-            return this.execute('read', null, options); // <-- null represents rs.  No rs for load actions.
-        } catch(e) {
-            this.handleException(e);
-            return false;
+        this.el.setStyle("overflow", Ext.isGecko ? "auto" : "hidden");
+        if(this.field.msgTarget != 'title'){
+            this.field.msgTarget = 'qtip';
         }
-    },
-
-    /**
-     * updateRecord  Should not be used directly.  This method will be called automatically if a Writer is set.
-     * Listens to 'update' event.
-     * @param {Object} store
-     * @param {Object} record
-     * @param {Object} action
-     * @private
-     */
-    updateRecord : function(store, record, action) {
-        if (action == Ext.data.Record.EDIT && this.autoSave === true && (!record.phantom || (record.phantom && record.isValid))) {
-            this.save();
+        this.field.inEditor = true;
+        this.mon(this.field, {
+            scope: this,
+            blur: this.onBlur,
+            specialkey: this.onSpecialKey
+        });
+        if(this.field.grow){
+            this.mon(this.field, "autosize", this.el.sync,  this.el, {delay:1});
+        }
+        this.field.render(this.el).show();
+        this.field.getEl().dom.name = '';
+        if(this.swallowKeys){
+            this.field.el.swallowEvent([
+                'keypress', // *** Opera
+                'keydown'   // *** all other browsers
+            ]);
         }
     },
 
-    /**
-     * Should not be used directly.  Store#add will call this automatically if a Writer is set
-     * @param {Object} store
-     * @param {Object} rs
-     * @param {Object} index
-     * @private
-     */
-    createRecords : function(store, rs, index) {
-        for (var i = 0, len = rs.length; i < len; i++) {
-            if (rs[i].phantom && rs[i].isValid()) {
-                rs[i].markDirty();  // <-- Mark new records dirty
-                this.modified.push(rs[i]);  // <-- add to modified
+    // private
+    onSpecialKey : function(field, e){
+        var key = e.getKey(),
+            complete = this.completeOnEnter && key == e.ENTER,
+            cancel = this.cancelOnEsc && key == e.ESC;
+        if(complete || cancel){
+            e.stopEvent();
+            if(complete){
+                this.completeEdit();
+            }else{
+                this.cancelEdit();
+            }
+            if(field.triggerBlur){
+                field.triggerBlur();
             }
         }
-        if (this.autoSave === true) {
-            this.save();
-        }
+        this.fireEvent('specialkey', field, e);
     },
 
     /**
-     * Destroys a record or records.  Should not be used directly.  It's called by Store#remove if a Writer is set.
-     * @param {Store} this
-     * @param {Ext.data.Record/Ext.data.Record[]}
-     * @param {Number} index
-     * @private
+     * Starts the editing process and shows the editor.
+     * @param {Mixed} el The element to edit
+     * @param {String} value (optional) A value to initialize the editor with. If a value is not provided, it defaults
+      * to the innerHTML of el.
      */
-    destroyRecord : function(store, record, index) {
-        if (this.modified.indexOf(record) != -1) {  // <-- handled already if @cfg pruneModifiedRecords == true
-            this.modified.remove(record);
+    startEdit : function(el, value){
+        if(this.editing){
+            this.completeEdit();
         }
-        if (!record.phantom) {
-            this.removed.push(record);
+        this.boundEl = Ext.get(el);
+        var v = value !== undefined ? value : this.boundEl.dom.innerHTML;
+        if(!this.rendered){
+            this.render(this.parentEl || document.body);
+        }
+        if(this.fireEvent("beforestartedit", this, this.boundEl, v) !== false){
+            this.startValue = v;
+            this.field.reset();
+            this.field.setValue(v);
+            this.realign(true);
+            this.editing = true;
+            this.show();
+        }
+    },
 
-            // since the record has already been removed from the store but the server request has not yet been executed,
-            // must keep track of the last known index this record existed.  If a server error occurs, the record can be
-            // put back into the store.  @see Store#createCallback where the record is returned when response status === false
-            record.lastIndex = index;
+    // private
+    doAutoSize : function(){
+        if(this.autoSize){
+            var sz = this.boundEl.getSize(),
+                fs = this.field.getSize();
 
-            if (this.autoSave === true) {
-                this.save();
+            switch(this.autoSize){
+                case "width":
+                    this.setSize(sz.width, fs.height);
+                    break;
+                case "height":
+                    this.setSize(fs.width, sz.height);
+                    break;
+                case "none":
+                    this.setSize(fs.width, fs.height);
+                    break;
+                default:
+                    this.setSize(sz.width, sz.height);
             }
         }
     },
 
     /**
-     * This method should generally not be used directly.  This method is called internally
-     * by {@link #load}, or if a Writer is set will be called automatically when {@link #add},
-     * {@link #remove}, or {@link #update} events fire.
-     * @param {String} action Action name ('read', 'create', 'update', or 'destroy')
-     * @param {Record/Record[]} rs
-     * @param {Object} options
-     * @throws Error
-     * @private
+     * Sets the height and width of this editor.
+     * @param {Number} width The new width
+     * @param {Number} height The new height
      */
-    execute : function(action, rs, options) {
-        // blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY
-        if (!Ext.data.Api.isAction(action)) {
-            throw new Ext.data.Api.Error('execute', action);
-        }
-        // make sure options has a params key
-        options = Ext.applyIf(options||{}, {
-            params: {}
-        });
-
-        // have to separate before-events since load has a different signature than create,destroy and save events since load does not
-        // include the rs (record resultset) parameter.  Capture return values from the beforeaction into doRequest flag.
-        var doRequest = true;
-
-        if (action === 'read') {
-            doRequest = this.fireEvent('beforeload', this, options);
-        }
-        else {
-            // if Writer is configured as listful, force single-recoord rs to be [{}} instead of {}
-            if (this.writer.listful === true && this.restful !== true) {
-                rs = (Ext.isArray(rs)) ? rs : [rs];
-            }
-            // if rs has just a single record, shift it off so that Writer writes data as '{}' rather than '[{}]'
-            else if (Ext.isArray(rs) && rs.length == 1) {
-                rs = rs.shift();
-            }
-            // Write the action to options.params
-            if ((doRequest = this.fireEvent('beforewrite', this, action, rs, options)) !== false) {
-                this.writer.write(action, options.params, rs);
-            }
-        }
-        if (doRequest !== false) {
-            // Send request to proxy.
-            var params = Ext.apply({}, options.params, this.baseParams);
-            if (this.writer && this.proxy.url && !this.proxy.restful && !Ext.data.Api.hasUniqueUrl(this.proxy, action)) {
-                params.xaction = action;
+    setSize : function(w, h){
+        delete this.field.lastSize;
+        this.field.setSize(w, h);
+        if(this.el){
+            if(Ext.isGecko2 || Ext.isOpera){
+                // prevent layer scrollbars
+                this.el.setSize(w, h);
             }
-            // Note:  Up until this point we've been dealing with 'action' as a key from Ext.data.Api.actions.  We'll flip it now
-            // and send the value into DataProxy#request, since it's the value which maps to the DataProxy#api
-            this.proxy.request(Ext.data.Api.actions[action], rs, params, this.reader, this.createCallback(action, rs), this, options);
+            this.el.sync();
         }
-        return doRequest;
     },
 
     /**
-     * Saves all pending changes to the store.  If the commensurate Ext.data.Api.actions action is not configured, then
-     * the configured <code>{@link #url}</code> will be used.
-     * <pre>
-     * change            url
-     * ---------------   --------------------
-     * removed records   Ext.data.Api.actions.destroy
-     * phantom records   Ext.data.Api.actions.create
-     * {@link #getModifiedRecords modified records}  Ext.data.Api.actions.update
-     * </pre>
-     * @TODO:  Create extensions of Error class and send associated Record with thrown exceptions.
-     * e.g.:  Ext.data.DataReader.Error or Ext.data.Error or Ext.data.DataProxy.Error, etc.
+     * Realigns the editor to the bound field based on the current alignment config value.
+     * @param {Boolean} autoSize (optional) True to size the field to the dimensions of the bound element.
      */
-    save : function() {
-        if (!this.writer) {
-            throw new Ext.data.Store.Error('writer-undefined');
-        }
-
-        // DESTROY:  First check for removed records.  Records in this.removed are guaranteed non-phantoms.  @see Store#remove
-        if (this.removed.length) {
-            this.doTransaction('destroy', this.removed);
+    realign : function(autoSize){
+        if(autoSize === true){
+            this.doAutoSize();
         }
+        this.el.alignTo(this.boundEl, this.alignment, this.offsets);
+    },
 
-        // Check for modified records. Use a copy so Store#rejectChanges will work if server returns error.
-        var rs = [].concat(this.getModifiedRecords());
-        if (!rs.length) { // Bail-out if empty...
-            return true;
+    /**
+     * Ends the editing process, persists the changed value to the underlying field, and hides the editor.
+     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after edit (defaults to false)
+     */
+    completeEdit : function(remainVisible){
+        if(!this.editing){
+            return;
         }
-
-        // CREATE:  Next check for phantoms within rs.  splice-off and execute create.
-        var phantoms = [];
-        for (var i = rs.length-1; i >= 0; i--) {
-            if (rs[i].phantom === true) {
-                var rec = rs.splice(i, 1).shift();
-                if (rec.isValid()) {
-                    phantoms.push(rec);
-                }
-            } else if (!rs[i].isValid()) { // <-- while we're here, splice-off any !isValid real records
-                rs.splice(i,1);
+        var v = this.getValue();
+        if(!this.field.isValid()){
+            if(this.revertInvalid !== false){
+                this.cancelEdit(remainVisible);
             }
+            return;
         }
-        // If we have valid phantoms, create them...
-        if (phantoms.length) {
-            this.doTransaction('create', phantoms);
-        }
-
-        // UPDATE:  And finally, if we're still here after splicing-off phantoms and !isValid real records, update the rest...
-        if (rs.length) {
-            this.doTransaction('update', rs);
-        }
-        return true;
-    },
-
-    // private.  Simply wraps call to Store#execute in try/catch.  Defers to Store#handleException on error.  Loops if batch: false
-    doTransaction : function(action, rs) {
-        function transaction(records) {
-            try {
-                this.execute(action, records);
-            } catch (e) {
-                this.handleException(e);
-            }
+        if(String(v) === String(this.startValue) && this.ignoreNoChange){
+            this.hideEdit(remainVisible);
+            return;
         }
-        if (this.batch === false) {
-            for (var i = 0, len = rs.length; i < len; i++) {
-                transaction.call(this, rs[i]);
+        if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){
+            v = this.getValue();
+            if(this.updateEl && this.boundEl){
+                this.boundEl.update(v);
             }
-        } else {
-            transaction.call(this, rs);
+            this.hideEdit(remainVisible);
+            this.fireEvent("complete", this, v, this.startValue);
         }
     },
 
-    // @private callback-handler for remote CRUD actions
-    // Do not override -- override loadRecords, onCreateRecords, onDestroyRecords and onUpdateRecords instead.
-    createCallback : function(action, rs) {
-        var actions = Ext.data.Api.actions;
-        return (action == 'read') ? this.loadRecords : function(data, response, success) {
-            // calls: onCreateRecords | onUpdateRecords | onDestroyRecords
-            this['on' + Ext.util.Format.capitalize(action) + 'Records'](success, rs, data);
-            // If success === false here, exception will have been called in DataProxy
-            if (success === true) {
-                this.fireEvent('write', this, action, data, response, rs);
-            }
-        };
-    },
-
-    // Clears records from modified array after an exception event.
-    // NOTE:  records are left marked dirty.  Do we want to commit them even though they were not updated/realized?
-    clearModified : function(rs) {
-        if (Ext.isArray(rs)) {
-            for (var n=rs.length-1;n>=0;n--) {
-                this.modified.splice(this.modified.indexOf(rs[n]), 1);
-            }
-        } else {
-            this.modified.splice(this.modified.indexOf(rs), 1);
+    // private
+    onShow : function(){
+        this.el.show();
+        if(this.hideEl !== false){
+            this.boundEl.hide();
         }
+        this.field.show().focus(false, true);
+        this.fireEvent("startedit", this.boundEl, this.startValue);
     },
 
-    // remap record ids in MixedCollection after records have been realized.  @see Store#onCreateRecords, @see DataReader#realize
-    reMap : function(record) {
-        if (Ext.isArray(record)) {
-            for (var i = 0, len = record.length; i < len; i++) {
-                this.reMap(record[i]);
-            }
-        } else {
-            delete this.data.map[record._phid];
-            this.data.map[record.id] = record;
-            var index = this.data.keys.indexOf(record._phid);
-            this.data.keys.splice(index, 1, record.id);
-            delete record._phid;
+    /**
+     * Cancels the editing process and hides the editor without persisting any changes.  The field value will be
+     * reverted to the original starting value.
+     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after
+     * cancel (defaults to false)
+     */
+    cancelEdit : function(remainVisible){
+        if(this.editing){
+            var v = this.getValue();
+            this.setValue(this.startValue);
+            this.hideEdit(remainVisible);
+            this.fireEvent("canceledit", this, v, this.startValue);
         }
     },
 
-    // @protected onCreateRecord proxy callback for create action
-    onCreateRecords : function(success, rs, data) {
-        if (success === true) {
-            try {
-                this.reader.realize(rs, data);
-                this.reMap(rs);
-            }
-            catch (e) {
-                this.handleException(e);
-                if (Ext.isArray(rs)) {
-                    // Recurse to run back into the try {}.  DataReader#realize splices-off the rs until empty.
-                    this.onCreateRecords(success, rs, data);
-                }
-            }
+    // private
+    hideEdit: function(remainVisible){
+        if(remainVisible !== true){
+            this.editing = false;
+            this.hide();
         }
     },
 
-    // @protected, onUpdateRecords proxy callback for update action
-    onUpdateRecords : function(success, rs, data) {
-        if (success === true) {
-            try {
-                this.reader.update(rs, data);
-            } catch (e) {
-                this.handleException(e);
-                if (Ext.isArray(rs)) {
-                    // Recurse to run back into the try {}.  DataReader#update splices-off the rs until empty.
-                    this.onUpdateRecords(success, rs, data);
-                }
-            }
+    // private
+    onBlur : function(){
+        // selectSameEditor flag allows the same editor to be started without onBlur firing on itself
+        if(this.allowBlur !== true && this.editing && this.selectSameEditor !== true){
+            this.completeEdit();
         }
     },
 
-    // @protected onDestroyRecords proxy callback for destroy action
-    onDestroyRecords : function(success, rs, data) {
-        // splice each rec out of this.removed
-        rs = (rs instanceof Ext.data.Record) ? [rs] : rs;
-        for (var i=0,len=rs.length;i<len;i++) {
-            this.removed.splice(this.removed.indexOf(rs[i]), 1);
+    // private
+    onHide : function(){
+        if(this.editing){
+            this.completeEdit();
+            return;
         }
-        if (success === false) {
-            // put records back into store if remote destroy fails.
-            // @TODO: Might want to let developer decide.
-            for (i=rs.length-1;i>=0;i--) {
-                this.insert(rs[i].lastIndex, rs[i]);    // <-- lastIndex set in Store#destroyRecord
-            }
+        this.field.blur();
+        if(this.field.collapse){
+            this.field.collapse();
+        }
+        this.el.hide();
+        if(this.hideEl !== false){
+            this.boundEl.show();
         }
     },
 
-    // protected handleException.  Possibly temporary until Ext framework has an exception-handler.
-    handleException : function(e) {
-        // @see core/Error.js
-        Ext.handleError(e);
+    /**
+     * Sets the data value of the editor
+     * @param {Mixed} value Any valid value supported by the underlying field
+     */
+    setValue : function(v){
+        this.field.setValue(v);
     },
 
     /**
-     * <p>Reloads the Record cache from the configured Proxy using the configured {@link Ext.data.Reader Reader} and
-     * the options from the last load operation performed.</p>
-     * <p><b>Note</b>: see the Important note in {@link #load}.</p>
-     * @param {Object} options (optional) An <tt>Object</tt> containing {@link #load loading options} which may
-     * override the options used in the last {@link #load} operation. See {@link #load} for details (defaults to
-     * <tt>null</tt>, in which case the {@link #lastOptions} are used).
+     * Gets the data value of the editor
+     * @return {Mixed} The data value
      */
-    reload : function(options){
-        this.load(Ext.applyIf(options||{}, this.lastOptions));
+    getValue : function(){
+        return this.field.getValue();
     },
 
+    beforeDestroy : function(){
+        Ext.destroyMembers(this, 'field');
+
+        delete this.parentEl;
+        delete this.boundEl;
+    }
+});
+Ext.reg('editor', Ext.Editor);
+/**
+ * @class Ext.ColorPalette
+ * @extends Ext.Component
+ * Simple color palette class for choosing colors.  The palette can be rendered to any container.<br />
+ * Here's an example of typical usage:
+ * <pre><code>
+var cp = new Ext.ColorPalette({value:'993300'});  // initial selected color
+cp.render('my-div');
+
+cp.on('select', function(palette, selColor){
+    // do something with selColor
+});
+</code></pre>
+ * @constructor
+ * Create a new ColorPalette
+ * @param {Object} config The config object
+ * @xtype colorpalette
+ */
+Ext.ColorPalette = Ext.extend(Ext.Component, {
+       /**
+        * @cfg {String} tpl An existing XTemplate instance to be used in place of the default template for rendering the component.
+        */
+    /**
+     * @cfg {String} itemCls
+     * The CSS class to apply to the containing element (defaults to 'x-color-palette')
+     */
+    itemCls : 'x-color-palette',
+    /**
+     * @cfg {String} value
+     * The initial color to highlight (should be a valid 6-digit color hex code without the # symbol).  Note that
+     * the hex codes are case-sensitive.
+     */
+    value : null,
+    /**
+     * @cfg {String} clickEvent
+     * The DOM event that will cause a color to be selected. This can be any valid event name (dblclick, contextmenu). 
+     * Defaults to <tt>'click'</tt>.
+     */
+    clickEvent :'click',
     // private
-    // Called as a callback by the Reader during a load operation.
-    loadRecords : function(o, options, success){
-        if(!o || success === false){
-            if(success !== false){
-                this.fireEvent('load', this, [], options);
-            }
-            if(options.callback){
-                options.callback.call(options.scope || this, [], options, false, o);
-            }
-            return;
-        }
-        var r = o.records, t = o.totalRecords || r.length;
-        if(!options || options.add !== true){
-            if(this.pruneModifiedRecords){
-                this.modified = [];
-            }
-            for(var i = 0, len = r.length; i < len; i++){
-                r[i].join(this);
-            }
-            if(this.snapshot){
-                this.data = this.snapshot;
-                delete this.snapshot;
-            }
-            this.data.clear();
-            this.data.addAll(r);
-            this.totalLength = t;
-            this.applySort();
-            this.fireEvent('datachanged', this);
-        }else{
-            this.totalLength = Math.max(t, this.data.length+r.length);
-            this.add(r);
-        }
-        this.fireEvent('load', this, r, options);
-        if(options.callback){
-            options.callback.call(options.scope || this, r, options, true);
-        }
-    },
+    ctype : 'Ext.ColorPalette',
 
     /**
-     * Loads data from a passed data block and fires the {@link #load} event. A {@link Ext.data.Reader Reader}
-     * which understands the format of the data must have been configured in the constructor.
-     * @param {Object} data The data block from which to read the Records.  The format of the data expected
-     * is dependent on the type of {@link Ext.data.Reader Reader} that is configured and should correspond to
-     * that {@link Ext.data.Reader Reader}'s <tt>{@link Ext.data.Reader#readRecords}</tt> parameter.
-     * @param {Boolean} append (Optional) <tt>true</tt> to append the new Records rather the default to replace
-     * the existing cache.
-     * <b>Note</b>: that Records in a Store are keyed by their {@link Ext.data.Record#id id}, so added Records
-     * with ids which are already present in the Store will <i>replace</i> existing Records. Only Records with
-     * new, unique ids will be added.
+     * @cfg {Boolean} allowReselect If set to true then reselecting a color that is already selected fires the {@link #select} event
      */
-    loadData : function(o, append){
-        var r = this.reader.readRecords(o);
-        this.loadRecords(r, {add: append}, true);
-    },
+    allowReselect : false,
 
     /**
-     * Gets the number of cached records.
-     * <p>If using paging, this may not be the total size of the dataset. If the data object
-     * used by the Reader contains the dataset size, then the {@link #getTotalCount} function returns
-     * the dataset size.  <b>Note</b>: see the Important note in {@link #load}.</p>
-     * @return {Number} The number of Records in the Store's cache.
+     * <p>An array of 6-digit color hex code strings (without the # symbol).  This array can contain any number
+     * of colors, and each hex code should be unique.  The width of the palette is controlled via CSS by adjusting
+     * the width property of the 'x-color-palette' class (or assigning a custom class), so you can balance the number
+     * of colors with the width setting until the box is symmetrical.</p>
+     * <p>You can override individual colors if needed:</p>
+     * <pre><code>
+var cp = new Ext.ColorPalette();
+cp.colors[0] = 'FF0000';  // change the first box to red
+</code></pre>
+
+Or you can provide a custom array of your own for complete control:
+<pre><code>
+var cp = new Ext.ColorPalette();
+cp.colors = ['000000', '993300', '333300'];
+</code></pre>
+     * @type Array
      */
-    getCount : function(){
-        return this.data.length || 0;
-    },
+    colors : [
+        '000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333',
+        '800000', 'FF6600', '808000', '008000', '008080', '0000FF', '666699', '808080',
+        'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '969696',
+        'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0',
+        'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF'
+    ],
 
     /**
-     * Gets the total number of records in the dataset as returned by the server.
-     * <p>If using paging, for this to be accurate, the data object used by the {@link #reader Reader}
-     * must contain the dataset size. For remote data sources, the value for this property
-     * (<tt>totalProperty</tt> for {@link Ext.data.JsonReader JsonReader},
-     * <tt>totalRecords</tt> for {@link Ext.data.XmlReader XmlReader}) shall be returned by a query on the server.
-     * <b>Note</b>: see the Important note in {@link #load}.</p>
-     * @return {Number} The number of Records as specified in the data object passed to the Reader
-     * by the Proxy.
-     * <p><b>Note</b>: this value is not updated when changing the contents of the Store locally.</p>
+     * @cfg {Function} handler
+     * Optional. A function that will handle the select event of this palette.
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>
+     * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>
+     * </ul></div>
      */
-    getTotalCount : function(){
-        return this.totalLength || 0;
-    },
-
     /**
-     * Returns an object describing the current sort state of this Store.
-     * @return {Object} The sort state of the Store. An object with two properties:<ul>
-     * <li><b>field : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
-     * <li><b>direction : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
-     * </ul>
-     * See <tt>{@link #sortInfo}</tt> for additional details.
+     * @cfg {Object} scope
+     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
+     * function will be called.  Defaults to this ColorPalette instance.
      */
-    getSortState : function(){
-        return this.sortInfo;
+    
+    // private
+    initComponent : function(){
+        Ext.ColorPalette.superclass.initComponent.call(this);
+        this.addEvents(
+            /**
+             * @event select
+             * Fires when a color is selected
+             * @param {ColorPalette} this
+             * @param {String} color The 6-digit color hex code (without the # symbol)
+             */
+            'select'
+        );
+
+        if(this.handler){
+            this.on('select', this.handler, this.scope, true);
+        }    
     },
 
     // private
-    applySort : function(){
-        if(this.sortInfo && !this.remoteSort){
-            var s = this.sortInfo, f = s.field;
-            this.sortData(f, s.direction);
+    onRender : function(container, position){
+        this.autoEl = {
+            tag: 'div',
+            cls: this.itemCls
+        };
+        Ext.ColorPalette.superclass.onRender.call(this, container, position);
+        var t = this.tpl || new Ext.XTemplate(
+            '<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>'
+        );
+        t.overwrite(this.el, this.colors);
+        this.mon(this.el, this.clickEvent, this.handleClick, this, {delegate: 'a'});
+        if(this.clickEvent != 'click'){
+               this.mon(this.el, 'click', Ext.emptyFn, this, {delegate: 'a', preventDefault: true});
         }
     },
 
     // private
-    sortData : function(f, direction){
-        direction = direction || 'ASC';
-        var st = this.fields.get(f).sortType;
-        var fn = function(r1, r2){
-            var v1 = st(r1.data[f]), v2 = st(r2.data[f]);
-            return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
-        };
-        this.data.sort(direction, fn);
-        if(this.snapshot && this.snapshot != this.data){
-            this.snapshot.sort(direction, fn);
+    afterRender : function(){
+        Ext.ColorPalette.superclass.afterRender.call(this);
+        if(this.value){
+            var s = this.value;
+            this.value = null;
+            this.select(s);
         }
     },
 
-    /**
-     * Sets the default sort column and order to be used by the next {@link #load} operation.
-     * @param {String} fieldName The name of the field to sort by.
-     * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to <tt>'ASC'</tt>)
-     */
-    setDefaultSort : function(field, dir){
-        dir = dir ? dir.toUpperCase() : 'ASC';
-        this.sortInfo = {field: field, direction: dir};
-        this.sortToggle[field] = dir;
+    // private
+    handleClick : function(e, t){
+        e.preventDefault();
+        if(!this.disabled){
+            var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
+            this.select(c.toUpperCase());
+        }
     },
 
     /**
-     * Sort the Records.
-     * If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local
-     * sorting is used, the cache is sorted internally. See also {@link #remoteSort} and {@link #paramNames}.
-     * @param {String} fieldName The name of the field to sort by.
-     * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to <tt>'ASC'</tt>)
+     * Selects the specified color in the palette (fires the {@link #select} event)
+     * @param {String} color A valid 6-digit color hex code (# will be stripped if included)
      */
-    sort : function(fieldName, dir){
-        var f = this.fields.get(fieldName);
-        if(!f){
-            return false;
-        }
-        if(!dir){
-            if(this.sortInfo && this.sortInfo.field == f.name){ // toggle sort dir
-                dir = (this.sortToggle[f.name] || 'ASC').toggle('ASC', 'DESC');
-            }else{
-                dir = f.sortDir;
-            }
-        }
-        var st = (this.sortToggle) ? this.sortToggle[f.name] : null;
-        var si = (this.sortInfo) ? this.sortInfo : null;
-
-        this.sortToggle[f.name] = dir;
-        this.sortInfo = {field: f.name, direction: dir};
-        if(!this.remoteSort){
-            this.applySort();
-            this.fireEvent('datachanged', this);
-        }else{
-            if (!this.load(this.lastOptions)) {
-                if (st) {
-                    this.sortToggle[f.name] = st;
-                }
-                if (si) {
-                    this.sortInfo = si;
-                }
+    select : function(color){
+        color = color.replace('#', '');
+        if(color != this.value || this.allowReselect){
+            var el = this.el;
+            if(this.value){
+                el.child('a.color-'+this.value).removeClass('x-color-palette-sel');
             }
+            el.child('a.color-'+color).addClass('x-color-palette-sel');
+            this.value = color;
+            this.fireEvent('select', this, color);
         }
-    },
+    }
 
     /**
-     * Calls the specified function for each of the {@link Ext.data.Record Records} in the cache.
-     * @param {Function} fn The function to call. The {@link Ext.data.Record Record} is passed as the first parameter.
-     * Returning <tt>false</tt> aborts and exits the iteration.
-     * @param {Object} scope (optional) The scope in which to call the function (defaults to the {@link Ext.data.Record Record}).
+     * @cfg {String} autoEl @hide
      */
-    each : function(fn, scope){
-        this.data.each(fn, scope);
-    },
-
+});
+Ext.reg('colorpalette', Ext.ColorPalette);
+/**
+ * @class Ext.DatePicker
+ * @extends Ext.Component
+ * <p>A popup date picker. This class is used by the {@link Ext.form.DateField DateField} class
+ * to allow browsing and selection of valid dates.</p>
+ * <p>All the string values documented below may be overridden by including an Ext locale file in
+ * your page.</p>
+ * @constructor
+ * Create a new DatePicker
+ * @param {Object} config The config object
+ * @xtype datepicker
+ */
+Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
     /**
-     * Gets all {@link Ext.data.Record records} modified since the last commit.  Modified records are
-     * persisted across load operations (e.g., during paging). <b>Note</b>: deleted records are not
-     * included.  See also <tt>{@link #pruneModifiedRecords}</tt> and
-     * {@link Ext.data.Record}<tt>{@link Ext.data.Record#markDirty markDirty}.</tt>.
-     * @return {Ext.data.Record[]} An array of {@link Ext.data.Record Records} containing outstanding
-     * modifications.  To obtain modified fields within a modified record see
-     *{@link Ext.data.Record}<tt>{@link Ext.data.Record#modified modified}.</tt>.
+     * @cfg {String} todayText
+     * The text to display on the button that selects the current date (defaults to <code>'Today'</code>)
      */
-    getModifiedRecords : function(){
-        return this.modified;
-    },
+    todayText : 'Today',
+    /**
+     * @cfg {String} okText
+     * The text to display on the ok button (defaults to <code>'&#160;OK&#160;'</code> to give the user extra clicking room)
+     */
+    okText : '&#160;OK&#160;',
+    /**
+     * @cfg {String} cancelText
+     * The text to display on the cancel button (defaults to <code>'Cancel'</code>)
+     */
+    cancelText : 'Cancel',
+    /**
+     * @cfg {Function} handler
+     * Optional. A function that will handle the select event of this picker.
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><code>picker</code> : DatePicker<div class="sub-desc">This DatePicker.</div></li>
+     * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
+     * </ul></div>
+     */
+    /**
+     * @cfg {Object} scope
+     * The scope (<code><b>this</b></code> reference) in which the <code>{@link #handler}</code>
+     * function will be called.  Defaults to this DatePicker instance.
+     */ 
+    /**
+     * @cfg {String} todayTip
+     * A string used to format the message for displaying in a tooltip over the button that
+     * selects the current date. Defaults to <code>'{0} (Spacebar)'</code> where
+     * the <code>{0}</code> token is replaced by today's date.
+     */
+    todayTip : '{0} (Spacebar)',
+    /**
+     * @cfg {String} minText
+     * The error text to display if the minDate validation fails (defaults to <code>'This date is before the minimum date'</code>)
+     */
+    minText : 'This date is before the minimum date',
+    /**
+     * @cfg {String} maxText
+     * The error text to display if the maxDate validation fails (defaults to <code>'This date is after the maximum date'</code>)
+     */
+    maxText : 'This date is after the maximum date',
+    /**
+     * @cfg {String} format
+     * The default date format string which can be overriden for localization support.  The format must be
+     * valid according to {@link Date#parseDate} (defaults to <code>'m/d/y'</code>).
+     */
+    format : 'm/d/y',
+    /**
+     * @cfg {String} disabledDaysText
+     * The tooltip to display when the date falls on a disabled day (defaults to <code>'Disabled'</code>)
+     */
+    disabledDaysText : 'Disabled',
+    /**
+     * @cfg {String} disabledDatesText
+     * The tooltip text to display when the date falls on a disabled date (defaults to <code>'Disabled'</code>)
+     */
+    disabledDatesText : 'Disabled',
+    /**
+     * @cfg {Array} monthNames
+     * An array of textual month names which can be overriden for localization support (defaults to Date.monthNames)
+     */
+    monthNames : Date.monthNames,
+    /**
+     * @cfg {Array} dayNames
+     * An array of textual day names which can be overriden for localization support (defaults to Date.dayNames)
+     */
+    dayNames : Date.dayNames,
+    /**
+     * @cfg {String} nextText
+     * The next month navigation button tooltip (defaults to <code>'Next Month (Control+Right)'</code>)
+     */
+    nextText : 'Next Month (Control+Right)',
+    /**
+     * @cfg {String} prevText
+     * The previous month navigation button tooltip (defaults to <code>'Previous Month (Control+Left)'</code>)
+     */
+    prevText : 'Previous Month (Control+Left)',
+    /**
+     * @cfg {String} monthYearText
+     * The header month selector tooltip (defaults to <code>'Choose a month (Control+Up/Down to move years)'</code>)
+     */
+    monthYearText : 'Choose a month (Control+Up/Down to move years)',
+    /**
+     * @cfg {Number} startDay
+     * Day index at which the week should begin, 0-based (defaults to 0, which is Sunday)
+     */
+    startDay : 0,
+    /**
+     * @cfg {Boolean} showToday
+     * False to hide the footer area containing the Today button and disable the keyboard handler for spacebar
+     * that selects the current date (defaults to <code>true</code>).
+     */
+    showToday : true,
+    /**
+     * @cfg {Date} minDate
+     * Minimum allowable date (JavaScript date object, defaults to null)
+     */
+    /**
+     * @cfg {Date} maxDate
+     * Maximum allowable date (JavaScript date object, defaults to null)
+     */
+    /**
+     * @cfg {Array} disabledDays
+     * An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday (defaults to null).
+     */
+    /**
+     * @cfg {RegExp} disabledDatesRE
+     * JavaScript regular expression used to disable a pattern of dates (defaults to null).  The {@link #disabledDates}
+     * config will generate this regex internally, but if you specify disabledDatesRE it will take precedence over the
+     * disabledDates value.
+     */
+    /**
+     * @cfg {Array} disabledDates
+     * An array of 'dates' to disable, as strings. These strings will be used to build a dynamic regular
+     * expression so they are very powerful. Some examples:
+     * <ul>
+     * <li>['03/08/2003', '09/16/2003'] would disable those exact dates</li>
+     * <li>['03/08', '09/16'] would disable those days for every year</li>
+     * <li>['^03/08'] would only match the beginning (useful if you are using short years)</li>
+     * <li>['03/../2006'] would disable every day in March 2006</li>
+     * <li>['^03'] would disable every day in every March</li>
+     * </ul>
+     * Note that the format of the dates included in the array should exactly match the {@link #format} config.
+     * In order to support regular expressions, if you are using a date format that has '.' in it, you will have to
+     * escape the dot when restricting dates. For example: ['03\\.08\\.03'].
+     */
+    
+    // private
+    // Set by other components to stop the picker focus being updated when the value changes.
+    focusOnSelect: true,
 
     // private
-    createFilterFn : function(property, value, anyMatch, caseSensitive){
-        if(Ext.isEmpty(value, false)){
-            return false;
+    initComponent : function(){
+        Ext.DatePicker.superclass.initComponent.call(this);
+
+        this.value = this.value ?
+                 this.value.clearTime(true) : new Date().clearTime();
+
+        this.addEvents(
+            /**
+             * @event select
+             * Fires when a date is selected
+             * @param {DatePicker} this DatePicker
+             * @param {Date} date The selected date
+             */
+            'select'
+        );
+
+        if(this.handler){
+            this.on('select', this.handler,  this.scope || this);
         }
-        value = this.data.createValueMatcher(value, anyMatch, caseSensitive);
-        return function(r){
-            return value.test(r.data[property]);
-        };
-    },
 
-    /**
-     * Sums the value of <tt>property</tt> for each {@link Ext.data.Record record} between <tt>start</tt>
-     * and <tt>end</tt> and returns the result.
-     * @param {String} property A field in each record
-     * @param {Number} start (optional) The record index to start at (defaults to <tt>0</tt>)
-     * @param {Number} end (optional) The last record index to include (defaults to length - 1)
-     * @return {Number} The sum
-     */
-    sum : function(property, start, end){
-        var rs = this.data.items, v = 0;
-        start = start || 0;
-        end = (end || end === 0) ? end : rs.length-1;
+        this.initDisabledDays();
+    },
 
-        for(var i = start; i <= end; i++){
-            v += (rs[i].data[property] || 0);
+    // private
+    initDisabledDays : function(){
+        if(!this.disabledDatesRE && this.disabledDates){
+            var dd = this.disabledDates,
+                len = dd.length - 1,
+                re = '(?:';
+                
+            Ext.each(dd, function(d, i){
+                re += Ext.isDate(d) ? '^' + Ext.escapeRe(d.dateFormat(this.format)) + '$' : dd[i];
+                if(i != len){
+                    re += '|';
+                }
+            }, this);
+            this.disabledDatesRE = new RegExp(re + ')');
         }
-        return v;
     },
 
     /**
-     * Filter the {@link Ext.data.Record records} by a specified property.
-     * @param {String} field A field on your records
-     * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test
-     * against the field.
-     * @param {Boolean} anyMatch (optional) <tt>true</tt> to match any part not just the beginning
-     * @param {Boolean} caseSensitive (optional) <tt>true</tt> for case sensitive comparison
+     * Replaces any existing disabled dates with new values and refreshes the DatePicker.
+     * @param {Array/RegExp} disabledDates An array of date strings (see the {@link #disabledDates} config
+     * for details on supported values), or a JavaScript regular expression used to disable a pattern of dates.
      */
-    filter : function(property, value, anyMatch, caseSensitive){
-        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
-        return fn ? this.filterBy(fn) : this.clearFilter();
+    setDisabledDates : function(dd){
+        if(Ext.isArray(dd)){
+            this.disabledDates = dd;
+            this.disabledDatesRE = null;
+        }else{
+            this.disabledDatesRE = dd;
+        }
+        this.initDisabledDays();
+        this.update(this.value, true);
     },
 
     /**
-     * Filter by a function. The specified function will be called for each
-     * Record in this Store. If the function returns <tt>true</tt> the Record is included,
-     * otherwise it is filtered out.
-     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
-     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
-     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
-     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
-     * </ul>
-     * @param {Object} scope (optional) The scope of the function (defaults to this)
+     * Replaces any existing disabled days (by index, 0-6) with new values and refreshes the DatePicker.
+     * @param {Array} disabledDays An array of disabled day indexes. See the {@link #disabledDays} config
+     * for details on supported values.
      */
-    filterBy : function(fn, scope){
-        this.snapshot = this.snapshot || this.data;
-        this.data = this.queryBy(fn, scope||this);
-        this.fireEvent('datachanged', this);
+    setDisabledDays : function(dd){
+        this.disabledDays = dd;
+        this.update(this.value, true);
     },
 
     /**
-     * Query the records by a specified property.
-     * @param {String} field A field on your records
-     * @param {String/RegExp} value Either a string that the field
-     * should begin with, or a RegExp to test against the field.
-     * @param {Boolean} anyMatch (optional) True to match any part not just the beginning
-     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison
-     * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records
+     * Replaces any existing {@link #minDate} with the new value and refreshes the DatePicker.
+     * @param {Date} value The minimum date that can be selected
      */
-    query : function(property, value, anyMatch, caseSensitive){
-        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
-        return fn ? this.queryBy(fn) : this.data.clone();
+    setMinDate : function(dt){
+        this.minDate = dt;
+        this.update(this.value, true);
     },
 
     /**
-     * Query the cached records in this Store using a filtering function. The specified function
-     * will be called with each record in this Store. If the function returns <tt>true</tt> the record is
-     * included in the results.
-     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
-     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
-     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
-     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
-     * </ul>
-     * @param {Object} scope (optional) The scope of the function (defaults to this)
-     * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records
-     **/
-    queryBy : function(fn, scope){
-        var data = this.snapshot || this.data;
-        return data.filterBy(fn, scope||this);
+     * Replaces any existing {@link #maxDate} with the new value and refreshes the DatePicker.
+     * @param {Date} value The maximum date that can be selected
+     */
+    setMaxDate : function(dt){
+        this.maxDate = dt;
+        this.update(this.value, true);
     },
 
     /**
-     * Finds the index of the first matching record in this store by a specific property/value.
-     * @param {String} property A property on your objects
-     * @param {String/RegExp} value Either a string that the property value
-     * should begin with, or a RegExp to test against the property.
-     * @param {Number} startIndex (optional) The index to start searching at
-     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning
-     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison
-     * @return {Number} The matched index or -1
+     * Sets the value of the date field
+     * @param {Date} value The date to set
      */
-    find : function(property, value, start, anyMatch, caseSensitive){
-        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
-        return fn ? this.data.findIndexBy(fn, null, start) : -1;
+    setValue : function(value){
+        this.value = value.clearTime(true);
+        this.update(this.value);
     },
 
     /**
-     * Finds the index of the first matching record in this store by a specific property/value.
-     * @param {String} property A property on your objects
-     * @param {String/RegExp} value The value to match against
-     * @param {Number} startIndex (optional) The index to start searching at
-     * @return {Number} The matched index or -1
+     * Gets the current selected value of the date field
+     * @return {Date} The selected date
      */
-    findExact: function(property, value, start){
-        return this.data.findIndexBy(function(rec){
-            return rec.get(property) === value;
-        }, this, start);
+    getValue : function(){
+        return this.value;
     },
 
-    /**
-     * Find the index of the first matching Record in this Store by a function.
-     * If the function returns <tt>true</tt> it is considered a match.
-     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
-     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
-     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
-     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
-     * </ul>
-     * @param {Object} scope (optional) The scope of the function (defaults to this)
-     * @param {Number} startIndex (optional) The index to start searching at
-     * @return {Number} The matched index or -1
-     */
-    findBy : function(fn, scope, start){
-        return this.data.findIndexBy(fn, scope, start);
+    // private
+    focus : function(){
+        this.update(this.activeDate);
+    },
+    
+    // private
+    onEnable: function(initial){
+        Ext.DatePicker.superclass.onEnable.call(this);    
+        this.doDisabled(false);
+        this.update(initial ? this.value : this.activeDate);
+        if(Ext.isIE){
+            this.el.repaint();
+        }
+        
+    },
+    
+    // private
+    onDisable : function(){
+        Ext.DatePicker.superclass.onDisable.call(this);   
+        this.doDisabled(true);
+        if(Ext.isIE && !Ext.isIE8){
+            /* Really strange problem in IE6/7, when disabled, have to explicitly
+             * repaint each of the nodes to get them to display correctly, simply
+             * calling repaint on the main element doesn't appear to be enough.
+             */
+             Ext.each([].concat(this.textNodes, this.el.query('th span')), function(el){
+                 Ext.fly(el).repaint();
+             });
+        }
+    },
+    
+    // private
+    doDisabled : function(disabled){
+        this.keyNav.setDisabled(disabled);
+        this.prevRepeater.setDisabled(disabled);
+        this.nextRepeater.setDisabled(disabled);
+        if(this.showToday){
+            this.todayKeyListener.setDisabled(disabled);
+            this.todayBtn.setDisabled(disabled);
+        }
     },
 
-    /**
-     * Collects unique values for a particular dataIndex from this store.
-     * @param {String} dataIndex The property to collect
-     * @param {Boolean} allowNull (optional) Pass true to allow null, undefined or empty string values
-     * @param {Boolean} bypassFilter (optional) Pass true to collect from all records, even ones which are filtered
-     * @return {Array} An array of the unique values
-     **/
-    collect : function(dataIndex, allowNull, bypassFilter){
-        var d = (bypassFilter === true && this.snapshot) ?
-                this.snapshot.items : this.data.items;
-        var v, sv, r = [], l = {};
-        for(var i = 0, len = d.length; i < len; i++){
-            v = d[i].data[dataIndex];
-            sv = String(v);
-            if((allowNull || !Ext.isEmpty(v)) && !l[sv]){
-                l[sv] = true;
-                r[r.length] = v;
-            }
+    // private
+    onRender : function(container, position){
+        var m = [
+             '<table cellspacing="0">',
+                '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">&#160;</a></td></tr>',
+                '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],
+                dn = this.dayNames,
+                i;
+        for(i = 0; i < 7; i++){
+            var d = this.startDay+i;
+            if(d > 6){
+                d = d-7;
+            }
+            m.push('<th><span>', dn[d].substr(0,1), '</span></th>');
+        }
+        m[m.length] = '</tr></thead><tbody><tr>';
+        for(i = 0; i < 42; i++) {
+            if(i % 7 === 0 && i !== 0){
+                m[m.length] = '</tr><tr>';
+            }
+            m[m.length] = '<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>';
+        }
+        m.push('</tr></tbody></table></td></tr>',
+                this.showToday ? '<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>' : '',
+                '</table><div class="x-date-mp"></div>');
+
+        var el = document.createElement('div');
+        el.className = 'x-date-picker';
+        el.innerHTML = m.join('');
+
+        container.dom.insertBefore(el, position);
+
+        this.el = Ext.get(el);
+        this.eventEl = Ext.get(el.firstChild);
+
+        this.prevRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-left a'), {
+            handler: this.showPrevMonth,
+            scope: this,
+            preventDefault:true,
+            stopDefault:true
+        });
+
+        this.nextRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-right a'), {
+            handler: this.showNextMonth,
+            scope: this,
+            preventDefault:true,
+            stopDefault:true
+        });
+
+        this.monthPicker = this.el.down('div.x-date-mp');
+        this.monthPicker.enableDisplayMode('block');
+
+        this.keyNav = new Ext.KeyNav(this.eventEl, {
+            'left' : function(e){
+                if(e.ctrlKey){
+                    this.showPrevMonth();
+                }else{
+                    this.update(this.activeDate.add('d', -1));    
+                }
+            },
+
+            'right' : function(e){
+                if(e.ctrlKey){
+                    this.showNextMonth();
+                }else{
+                    this.update(this.activeDate.add('d', 1));    
+                }
+            },
+
+            'up' : function(e){
+                if(e.ctrlKey){
+                    this.showNextYear();
+                }else{
+                    this.update(this.activeDate.add('d', -7));
+                }
+            },
+
+            'down' : function(e){
+                if(e.ctrlKey){
+                    this.showPrevYear();
+                }else{
+                    this.update(this.activeDate.add('d', 7));
+                }
+            },
+
+            'pageUp' : function(e){
+                this.showNextMonth();
+            },
+
+            'pageDown' : function(e){
+                this.showPrevMonth();
+            },
+
+            'enter' : function(e){
+                e.stopPropagation();
+                return true;
+            },
+
+            scope : this
+        });
+
+        this.el.unselectable();
+
+        this.cells = this.el.select('table.x-date-inner tbody td');
+        this.textNodes = this.el.query('table.x-date-inner tbody span');
+
+        this.mbtn = new Ext.Button({
+            text: '&#160;',
+            tooltip: this.monthYearText,
+            renderTo: this.el.child('td.x-date-middle', true)
+        });
+        this.mbtn.el.child('em').addClass('x-btn-arrow');
+
+        if(this.showToday){
+            this.todayKeyListener = this.eventEl.addKeyListener(Ext.EventObject.SPACE, this.selectToday,  this);
+            var today = (new Date()).dateFormat(this.format);
+            this.todayBtn = new Ext.Button({
+                renderTo: this.el.child('td.x-date-bottom', true),
+                text: String.format(this.todayText, today),
+                tooltip: String.format(this.todayTip, today),
+                handler: this.selectToday,
+                scope: this
+            });
         }
-        return r;
+        this.mon(this.eventEl, 'mousewheel', this.handleMouseWheel, this);
+        this.mon(this.eventEl, 'click', this.handleDateClick,  this, {delegate: 'a.x-date-date'});
+        this.mon(this.mbtn, 'click', this.showMonthPicker, this);
+        this.onEnable(true);
     },
 
-    /**
-     * Revert to a view of the Record cache with no filtering applied.
-     * @param {Boolean} suppressEvent If <tt>true</tt> the filter is cleared silently without firing the
-     * {@link #datachanged} event.
-     */
-    clearFilter : function(suppressEvent){
-        if(this.isFiltered()){
-            this.data = this.snapshot;
-            delete this.snapshot;
-            if(suppressEvent !== true){
-                this.fireEvent('datachanged', this);
+    // private
+    createMonthPicker : function(){
+        if(!this.monthPicker.dom.firstChild){
+            var buf = ['<table border="0" cellspacing="0">'];
+            for(var i = 0; i < 6; i++){
+                buf.push(
+                    '<tr><td class="x-date-mp-month"><a href="#">', Date.getShortMonthName(i), '</a></td>',
+                    '<td class="x-date-mp-month x-date-mp-sep"><a href="#">', Date.getShortMonthName(i + 6), '</a></td>',
+                    i === 0 ?
+                    '<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>' :
+                    '<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>'
+                );
             }
+            buf.push(
+                '<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',
+                    this.okText,
+                    '</button><button type="button" class="x-date-mp-cancel">',
+                    this.cancelText,
+                    '</button></td></tr>',
+                '</table>'
+            );
+            this.monthPicker.update(buf.join(''));
+
+            this.mon(this.monthPicker, 'click', this.onMonthClick, this);
+            this.mon(this.monthPicker, 'dblclick', this.onMonthDblClick, this);
+
+            this.mpMonths = this.monthPicker.select('td.x-date-mp-month');
+            this.mpYears = this.monthPicker.select('td.x-date-mp-year');
+
+            this.mpMonths.each(function(m, a, i){
+                i += 1;
+                if((i%2) === 0){
+                    m.dom.xmonth = 5 + Math.round(i * 0.5);
+                }else{
+                    m.dom.xmonth = Math.round((i-1) * 0.5);
+                }
+            });
         }
     },
 
-    /**
-     * Returns true if this store is currently filtered
-     * @return {Boolean}
-     */
-    isFiltered : function(){
-        return this.snapshot && this.snapshot != this.data;
+    // private
+    showMonthPicker : function(){
+        if(!this.disabled){
+            this.createMonthPicker();
+            var size = this.el.getSize();
+            this.monthPicker.setSize(size);
+            this.monthPicker.child('table').setSize(size);
+
+            this.mpSelMonth = (this.activeDate || this.value).getMonth();
+            this.updateMPMonth(this.mpSelMonth);
+            this.mpSelYear = (this.activeDate || this.value).getFullYear();
+            this.updateMPYear(this.mpSelYear);
+
+            this.monthPicker.slideIn('t', {duration:0.2});
+        }
     },
 
     // private
-    afterEdit : function(record){
-        if(this.modified.indexOf(record) == -1){
-            this.modified.push(record);
+    updateMPYear : function(y){
+        this.mpyear = y;
+        var ys = this.mpYears.elements;
+        for(var i = 1; i <= 10; i++){
+            var td = ys[i-1], y2;
+            if((i%2) === 0){
+                y2 = y + Math.round(i * 0.5);
+                td.firstChild.innerHTML = y2;
+                td.xyear = y2;
+            }else{
+                y2 = y - (5-Math.round(i * 0.5));
+                td.firstChild.innerHTML = y2;
+                td.xyear = y2;
+            }
+            this.mpYears.item(i-1)[y2 == this.mpSelYear ? 'addClass' : 'removeClass']('x-date-mp-sel');
         }
-        this.fireEvent('update', this, record, Ext.data.Record.EDIT);
     },
 
     // private
-    afterReject : function(record){
-        this.modified.remove(record);
-        this.fireEvent('update', this, record, Ext.data.Record.REJECT);
+    updateMPMonth : function(sm){
+        this.mpMonths.each(function(m, a, i){
+            m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel');
+        });
     },
 
     // private
-    afterCommit : function(record){
-        this.modified.remove(record);
-        this.fireEvent('update', this, record, Ext.data.Record.COMMIT);
+    selectMPMonth : function(m){
+
     },
 
-    /**
-     * Commit all Records with {@link #getModifiedRecords outstanding changes}. To handle updates for changes,
-     * subscribe to the Store's {@link #update update event}, and perform updating when the third parameter is
-     * Ext.data.Record.COMMIT.
-     */
-    commitChanges : function(){
-        var m = this.modified.slice(0);
-        this.modified = [];
-        for(var i = 0, len = m.length; i < len; i++){
-            m[i].commit();
+    // private
+    onMonthClick : function(e, t){
+        e.stopEvent();
+        var el = new Ext.Element(t), pn;
+        if(el.is('button.x-date-mp-cancel')){
+            this.hideMonthPicker();
+        }
+        else if(el.is('button.x-date-mp-ok')){
+            var d = new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate());
+            if(d.getMonth() != this.mpSelMonth){
+                // 'fix' the JS rolling date conversion if needed
+                d = new Date(this.mpSelYear, this.mpSelMonth, 1).getLastDateOfMonth();
+            }
+            this.update(d);
+            this.hideMonthPicker();
+        }
+        else if((pn = el.up('td.x-date-mp-month', 2))){
+            this.mpMonths.removeClass('x-date-mp-sel');
+            pn.addClass('x-date-mp-sel');
+            this.mpSelMonth = pn.dom.xmonth;
+        }
+        else if((pn = el.up('td.x-date-mp-year', 2))){
+            this.mpYears.removeClass('x-date-mp-sel');
+            pn.addClass('x-date-mp-sel');
+            this.mpSelYear = pn.dom.xyear;
+        }
+        else if(el.is('a.x-date-mp-prev')){
+            this.updateMPYear(this.mpyear-10);
+        }
+        else if(el.is('a.x-date-mp-next')){
+            this.updateMPYear(this.mpyear+10);
         }
     },
 
-    /**
-     * {@link Ext.data.Record#reject Reject} outstanding changes on all {@link #getModifiedRecords modified records}.
-     */
-    rejectChanges : function(){
-        var m = this.modified.slice(0);
-        this.modified = [];
-        for(var i = 0, len = m.length; i < len; i++){
-            m[i].reject();
+    // private
+    onMonthDblClick : function(e, t){
+        e.stopEvent();
+        var el = new Ext.Element(t), pn;
+        if((pn = el.up('td.x-date-mp-month', 2))){
+            this.update(new Date(this.mpSelYear, pn.dom.xmonth, (this.activeDate || this.value).getDate()));
+            this.hideMonthPicker();
+        }
+        else if((pn = el.up('td.x-date-mp-year', 2))){
+            this.update(new Date(pn.dom.xyear, this.mpSelMonth, (this.activeDate || this.value).getDate()));
+            this.hideMonthPicker();
         }
     },
 
     // private
-    onMetaChange : function(meta, rtype, o){
-        this.recordType = rtype;
-        this.fields = rtype.prototype.fields;
-        delete this.snapshot;
-        if(meta.sortInfo){
-            this.sortInfo = meta.sortInfo;
-        }else if(this.sortInfo  && !this.fields.get(this.sortInfo.field)){
-            delete this.sortInfo;
+    hideMonthPicker : function(disableAnim){
+        if(this.monthPicker){
+            if(disableAnim === true){
+                this.monthPicker.hide();
+            }else{
+                this.monthPicker.slideOut('t', {duration:0.2});
+            }
         }
-        this.modified = [];
-        this.fireEvent('metachange', this, this.reader.meta);
     },
 
     // private
-    findInsertIndex : function(record){
-        this.suspendEvents();
-        var data = this.data.clone();
-        this.data.add(record);
-        this.applySort();
-        var index = this.data.indexOf(record);
-        this.data = data;
-        this.resumeEvents();
-        return index;
+    showPrevMonth : function(e){
+        this.update(this.activeDate.add('mo', -1));
     },
 
-    /**
-     * Set the value for a property name in this store's {@link #baseParams}.  Usage:</p><pre><code>
-myStore.setBaseParam('foo', {bar:3});
-</code></pre>
-     * @param {String} name Name of the property to assign
-     * @param {Mixed} value Value to assign the <tt>name</tt>d property
-     **/
-    setBaseParam : function (name, value){
-        this.baseParams = this.baseParams || {};
-        this.baseParams[name] = value;
-    }
-});
-
-Ext.reg('store', Ext.data.Store);
-
-/**
- * @class Ext.data.Store.Error
- * @extends Ext.Error
- * Store Error extension.
- * @param {String} name
- */
-Ext.data.Store.Error = Ext.extend(Ext.Error, {
-    name: 'Ext.data.Store'
-});
-Ext.apply(Ext.data.Store.Error.prototype, {
-    lang: {
-        'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.'
-    }
-});
+    // private
+    showNextMonth : function(e){
+        this.update(this.activeDate.add('mo', 1));
+    },
 
-/**
- * @class Ext.data.Field
- * <p>This class encapsulates the field definition information specified in the field definition objects
- * passed to {@link Ext.data.Record#create}.</p>
- * <p>Developers do not need to instantiate this class. Instances are created by {@link Ext.data.Record.create}
- * and cached in the {@link Ext.data.Record#fields fields} property of the created Record constructor's <b>prototype.</b></p>
- */
-Ext.data.Field = function(config){
-    if(typeof config == "string"){
-        config = {name: config};
-    }
-    Ext.apply(this, config);
+    // private
+    showPrevYear : function(){
+        this.update(this.activeDate.add('y', -1));
+    },
 
-    if(!this.type){
-        this.type = "auto";
-    }
+    // private
+    showNextYear : function(){
+        this.update(this.activeDate.add('y', 1));
+    },
 
-    var st = Ext.data.SortTypes;
-    // named sortTypes are supported, here we look them up
-    if(typeof this.sortType == "string"){
-        this.sortType = st[this.sortType];
-    }
+    // private
+    handleMouseWheel : function(e){
+        e.stopEvent();
+        if(!this.disabled){
+            var delta = e.getWheelDelta();
+            if(delta > 0){
+                this.showPrevMonth();
+            } else if(delta < 0){
+                this.showNextMonth();
+            }
+        }
+    },
 
-    // set default sortType for strings and dates
-    if(!this.sortType){
-        switch(this.type){
-            case "string":
-                this.sortType = st.asUCString;
-                break;
-            case "date":
-                this.sortType = st.asDate;
-                break;
-            default:
-                this.sortType = st.none;
+    // private
+    handleDateClick : function(e, t){
+        e.stopEvent();
+        if(!this.disabled && t.dateValue && !Ext.fly(t.parentNode).hasClass('x-date-disabled')){
+            this.cancelFocus = this.focusOnSelect === false;
+            this.setValue(new Date(t.dateValue));
+            delete this.cancelFocus;
+            this.fireEvent('select', this, this.value);
         }
-    }
+    },
 
-    // define once
-    var stripRe = /[\$,%]/g;
+    // private
+    selectToday : function(){
+        if(this.todayBtn && !this.todayBtn.disabled){
+            this.setValue(new Date().clearTime());
+            this.fireEvent('select', this, this.value);
+        }
+    },
 
-    // prebuilt conversion function for this field, instead of
-    // switching every time we're reading a value
-    if(!this.convert){
-        var cv, dateFormat = this.dateFormat;
-        switch(this.type){
-            case "":
-            case "auto":
-            case undefined:
-                cv = function(v){ return v; };
-                break;
-            case "string":
-                cv = function(v){ return (v === undefined || v === null) ? '' : String(v); };
-                break;
-            case "int":
-                cv = function(v){
-                    return v !== undefined && v !== null && v !== '' ?
-                           parseInt(String(v).replace(stripRe, ""), 10) : '';
-                    };
-                break;
-            case "float":
-                cv = function(v){
-                    return v !== undefined && v !== null && v !== '' ?
-                           parseFloat(String(v).replace(stripRe, ""), 10) : '';
-                    };
-                break;
-            case "bool":
-            case "boolean":
-                cv = function(v){ return v === true || v === "true" || v == 1; };
-                break;
-            case "date":
-                cv = function(v){
-                    if(!v){
-                        return '';
-                    }
-                    if(Ext.isDate(v)){
-                        return v;
-                    }
-                    if(dateFormat){
-                        if(dateFormat == "timestamp"){
-                            return new Date(v*1000);
-                        }
-                        if(dateFormat == "time"){
-                            return new Date(parseInt(v, 10));
-                        }
-                        return Date.parseDate(v, dateFormat);
-                    }
-                    var parsed = Date.parse(v);
-                    return parsed ? new Date(parsed) : null;
-                };
-             break;
+    // private
+    update : function(date, forceRefresh){
+        if(this.rendered){
+               var vd = this.activeDate, vis = this.isVisible();
+               this.activeDate = date;
+               if(!forceRefresh && vd && this.el){
+                   var t = date.getTime();
+                   if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){
+                       this.cells.removeClass('x-date-selected');
+                       this.cells.each(function(c){
+                          if(c.dom.firstChild.dateValue == t){
+                              c.addClass('x-date-selected');
+                              if(vis && !this.cancelFocus){
+                                  Ext.fly(c.dom.firstChild).focus(50);
+                              }
+                              return false;
+                          }
+                       }, this);
+                       return;
+                   }
+               }
+               var days = date.getDaysInMonth(),
+                   firstOfMonth = date.getFirstDateOfMonth(),
+                   startingPos = firstOfMonth.getDay()-this.startDay;
+       
+               if(startingPos < 0){
+                   startingPos += 7;
+               }
+               days += startingPos;
+       
+               var pm = date.add('mo', -1),
+                   prevStart = pm.getDaysInMonth()-startingPos,
+                   cells = this.cells.elements,
+                   textEls = this.textNodes,
+                   // convert everything to numbers so it's fast
+                   day = 86400000,
+                   d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart)).clearTime(),
+                   today = new Date().clearTime().getTime(),
+                   sel = date.clearTime(true).getTime(),
+                   min = this.minDate ? this.minDate.clearTime(true) : Number.NEGATIVE_INFINITY,
+                   max = this.maxDate ? this.maxDate.clearTime(true) : Number.POSITIVE_INFINITY,
+                   ddMatch = this.disabledDatesRE,
+                   ddText = this.disabledDatesText,
+                   ddays = this.disabledDays ? this.disabledDays.join('') : false,
+                   ddaysText = this.disabledDaysText,
+                   format = this.format;
+       
+               if(this.showToday){
+                   var td = new Date().clearTime(),
+                       disable = (td < min || td > max ||
+                       (ddMatch && format && ddMatch.test(td.dateFormat(format))) ||
+                       (ddays && ddays.indexOf(td.getDay()) != -1));
+       
+                   if(!this.disabled){
+                       this.todayBtn.setDisabled(disable);
+                       this.todayKeyListener[disable ? 'disable' : 'enable']();
+                   }
+               }
+       
+               var setCellClass = function(cal, cell){
+                   cell.title = '';
+                   var t = d.getTime();
+                   cell.firstChild.dateValue = t;
+                   if(t == today){
+                       cell.className += ' x-date-today';
+                       cell.title = cal.todayText;
+                   }
+                   if(t == sel){
+                       cell.className += ' x-date-selected';
+                       if(vis){
+                           Ext.fly(cell.firstChild).focus(50);
+                       }
+                   }
+                   // disabling
+                   if(t < min) {
+                       cell.className = ' x-date-disabled';
+                       cell.title = cal.minText;
+                       return;
+                   }
+                   if(t > max) {
+                       cell.className = ' x-date-disabled';
+                       cell.title = cal.maxText;
+                       return;
+                   }
+                   if(ddays){
+                       if(ddays.indexOf(d.getDay()) != -1){
+                           cell.title = ddaysText;
+                           cell.className = ' x-date-disabled';
+                       }
+                   }
+                   if(ddMatch && format){
+                       var fvalue = d.dateFormat(format);
+                       if(ddMatch.test(fvalue)){
+                           cell.title = ddText.replace('%0', fvalue);
+                           cell.className = ' x-date-disabled';
+                       }
+                   }
+               };
+       
+               var i = 0;
+               for(; i < startingPos; i++) {
+                   textEls[i].innerHTML = (++prevStart);
+                   d.setDate(d.getDate()+1);
+                   cells[i].className = 'x-date-prevday';
+                   setCellClass(this, cells[i]);
+               }
+               for(; i < days; i++){
+                   var intDay = i - startingPos + 1;
+                   textEls[i].innerHTML = (intDay);
+                   d.setDate(d.getDate()+1);
+                   cells[i].className = 'x-date-active';
+                   setCellClass(this, cells[i]);
+               }
+               var extraDays = 0;
+               for(; i < 42; i++) {
+                    textEls[i].innerHTML = (++extraDays);
+                    d.setDate(d.getDate()+1);
+                    cells[i].className = 'x-date-nextday';
+                    setCellClass(this, cells[i]);
+               }
+       
+               this.mbtn.setText(this.monthNames[date.getMonth()] + ' ' + date.getFullYear());
+       
+               if(!this.internalRender){
+                   var main = this.el.dom.firstChild,
+                       w = main.offsetWidth;
+                   this.el.setWidth(w + this.el.getBorderWidth('lr'));
+                   Ext.fly(main).setWidth(w);
+                   this.internalRender = true;
+                   // opera does not respect the auto grow header center column
+                   // then, after it gets a width opera refuses to recalculate
+                   // without a second pass
+                   if(Ext.isOpera && !this.secondPass){
+                       main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + 'px';
+                       this.secondPass = true;
+                       this.update.defer(10, this, [date]);
+                   }
+               }
+        }
+    },
 
+    // private
+    beforeDestroy : function() {
+        if(this.rendered){
+            Ext.destroy(
+                this.keyNav,
+                this.monthPicker,
+                this.eventEl,
+                this.mbtn,
+                this.nextRepeater,
+                this.prevRepeater,
+                this.cells.el,
+                this.todayBtn
+            );
+            delete this.textNodes;
+            delete this.cells.elements;
         }
-        this.convert = cv;
     }
-};
 
-Ext.data.Field.prototype = {
-    /**
-     * @cfg {String} name
-     * The name by which the field is referenced within the Record. This is referenced by, for example,
-     * the <tt>dataIndex</tt> property in column definition objects passed to {@link Ext.grid.ColumnModel}.
-     * <p>Note: In the simplest case, if no properties other than <tt>name</tt> are required, a field
-     * definition may consist of just a String for the field name.</p>
-     */
     /**
-     * @cfg {String} type
-     * (Optional) The data type for conversion to displayable value if <tt>{@link Ext.data.Field#convert convert}</tt>
-     * has not been specified. Possible values are
-     * <div class="mdetail-params"><ul>
-     * <li>auto (Default, implies no conversion)</li>
-     * <li>string</li>
-     * <li>int</li>
-     * <li>float</li>
-     * <li>boolean</li>
-     * <li>date</li></ul></div>
+     * @cfg {String} autoEl @hide
      */
-    /**
-     * @cfg {Function} convert
-     * (Optional) A function which converts the value provided by the Reader into an object that will be stored
-     * in the Record. It is passed the following parameters:<div class="mdetail-params"><ul>
-     * <li><b>v</b> : Mixed<div class="sub-desc">The data value as read by the Reader, if undefined will use
-     * the configured <tt>{@link Ext.data.Field#defaultValue defaultValue}</tt>.</div></li>
-     * <li><b>rec</b> : Mixed<div class="sub-desc">The data object containing the row as read by the Reader.
-     * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object
-     *  ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).</div></li>
-     * </ul></div>
-     * <pre><code>
-// example of convert function
-function fullName(v, record){
-    return record.name.last + ', ' + record.name.first;
-}
-
-function location(v, record){
-    return !record.city ? '' : (record.city + ', ' + record.state);
-}
-
-var Dude = Ext.data.Record.create([
-    {name: 'fullname',  convert: fullName},
-    {name: 'firstname', mapping: 'name.first'},
-    {name: 'lastname',  mapping: 'name.last'},
-    {name: 'city', defaultValue: 'homeless'},
-    'state',
-    {name: 'location',  convert: location}
-]);
-
-// create the data store
-var store = new Ext.data.Store({
-    reader: new Ext.data.JsonReader(
-        {
-            idProperty: 'key',
-            root: 'daRoot',  
-            totalProperty: 'total'
-        },
-        Dude  // recordType
-    )
 });
 
-var myData = [
-    { key: 1,
-      name: { first: 'Fat',    last:  'Albert' }
-      // notice no city, state provided in data object
-    },
-    { key: 2,
-      name: { first: 'Barney', last:  'Rubble' },
-      city: 'Bedrock', state: 'Stoneridge'
-    },
-    { key: 3,
-      name: { first: 'Cliff',  last:  'Claven' },
-      city: 'Boston',  state: 'MA'
-    }
-];
-     * </code></pre>
-     */
-    /**
-     * @cfg {String} dateFormat
-     * (Optional) A format string for the {@link Date#parseDate Date.parseDate} function, or "timestamp" if the
-     * value provided by the Reader is a UNIX timestamp, or "time" if the value provided by the Reader is a
-     * javascript millisecond timestamp.
-     */
-    dateFormat: null,
-    /**
-     * @cfg {Mixed} defaultValue
-     * (Optional) The default value used <b>when a Record is being created by a {@link Ext.data.Reader Reader}</b>
-     * when the item referenced by the <tt>{@link Ext.data.Field#mapping mapping}</tt> does not exist in the data
-     * object (i.e. undefined). (defaults to "")
-     */
-    defaultValue: "",
-    /**
-     * @cfg {String/Number} mapping
-     * <p>(Optional) A path expression for use by the {@link Ext.data.DataReader} implementation
-     * that is creating the {@link Ext.data.Record Record} to extract the Field value from the data object.
-     * If the path expression is the same as the field name, the mapping may be omitted.</p>
-     * <p>The form of the mapping expression depends on the Reader being used.</p>
-     * <div class="mdetail-params"><ul>
-     * <li>{@link Ext.data.JsonReader}<div class="sub-desc">The mapping is a string containing the javascript
-     * expression to reference the data from an element of the data item's {@link Ext.data.JsonReader#root root} Array. Defaults to the field name.</div></li>
-     * <li>{@link Ext.data.XmlReader}<div class="sub-desc">The mapping is an {@link Ext.DomQuery} path to the data
-     * item relative to the DOM element that represents the {@link Ext.data.XmlReader#record record}. Defaults to the field name.</div></li>
-     * <li>{@link Ext.data.ArrayReader}<div class="sub-desc">The mapping is a number indicating the Array index
-     * of the field's value. Defaults to the field specification's Array position.</div></li>
-     * </ul></div>
-     * <p>If a more complex value extraction strategy is required, then configure the Field with a {@link #convert}
-     * function. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to
-     * return the desired data.</p>
-     */
-    mapping: null,
-    /**
-     * @cfg {Function} sortType
-     * (Optional) A function which converts a Field's value to a comparable value in order to ensure
-     * correct sort ordering. Predefined functions are provided in {@link Ext.data.SortTypes}. A custom
-     * sort example:<pre><code>
-// current sort     after sort we want
-// +-+------+          +-+------+
-// |1|First |          |1|First |
-// |2|Last  |          |3|Second|
-// |3|Second|          |2|Last  |
-// +-+------+          +-+------+
-
-sortType: function(value) {
-   switch (value.toLowerCase()) // native toLowerCase():
-   {
-      case 'first': return 1;
-      case 'second': return 2;
-      default: return 3;
-   }
-}
-     * </code></pre>
-     */
-    sortType : null,
-    /**
-     * @cfg {String} sortDir
-     * (Optional) Initial direction to sort (<tt>"ASC"</tt> or  <tt>"DESC"</tt>).  Defaults to
-     * <tt>"ASC"</tt>.
-     */
-    sortDir : "ASC",
-       /**
-        * @cfg {Boolean} allowBlank 
-        * (Optional) Used for validating a {@link Ext.data.Record record}, defaults to <tt>true</tt>.
-        * An empty value here will cause {@link Ext.data.Record}.{@link Ext.data.Record#isValid isValid}
-        * to evaluate to <tt>false</tt>.
-        */
-       allowBlank : true
-};/**\r
- * @class Ext.data.DataReader\r
- * Abstract base class for reading structured data from a data source and converting\r
- * it into an object containing {@link Ext.data.Record} objects and metadata for use\r
- * by an {@link Ext.data.Store}.  This class is intended to be extended and should not\r
- * be created directly. For existing implementations, see {@link Ext.data.ArrayReader},\r
- * {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}.\r
- * @constructor Create a new DataReader\r
- * @param {Object} meta Metadata configuration options (implementation-specific).\r
- * @param {Array/Object} recordType\r
- * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which\r
- * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}\r
- * constructor created using {@link Ext.data.Record#create}.</p>\r
- */\r
-Ext.data.DataReader = function(meta, recordType){\r
-    /**\r
-     * This DataReader's configured metadata as passed to the constructor.\r
-     * @type Mixed\r
-     * @property meta\r
-     */\r
-    this.meta = meta;\r
-    /**\r
-     * @cfg {Array/Object} fields\r
-     * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which\r
-     * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}\r
-     * constructor created from {@link Ext.data.Record#create}.</p>\r
-     */\r
-    this.recordType = Ext.isArray(recordType) ?\r
-        Ext.data.Record.create(recordType) : recordType;\r
-};\r
-\r
-Ext.data.DataReader.prototype = {\r
-\r
-    /**\r
-     * Abstract method, overridden in {@link Ext.data.JsonReader}\r
-     */\r
-    buildExtractors : Ext.emptyFn,\r
-\r
-    /**\r
-     * Used for un-phantoming a record after a successful database insert.  Sets the records pk along with new data from server.\r
-     * You <b>must</b> return at least the database pk using the idProperty defined in your DataReader configuration.  The incoming\r
-     * data from server will be merged with the data in the local record.\r
-     * In addition, you <b>must</b> return record-data from the server in the same order received.\r
-     * Will perform a commit as well, un-marking dirty-fields.  Store's "update" event will be suppressed.\r
-     * @param {Record/Record[]} record The phantom record to be realized.\r
-     * @param {Object/Object[]} data The new record data to apply.  Must include the primary-key from database defined in idProperty field.\r
-     */\r
-    realize: function(rs, data){\r
-        if (Ext.isArray(rs)) {\r
-            for (var i = rs.length - 1; i >= 0; i--) {\r
-                // recurse\r
-                if (Ext.isArray(data)) {\r
-                    this.realize(rs.splice(i,1).shift(), data.splice(i,1).shift());\r
-                }\r
-                else {\r
-                    // weird...rs is an array but data isn't??  recurse but just send in the whole invalid data object.\r
-                    // the else clause below will detect !this.isData and throw exception.\r
-                    this.realize(rs.splice(i,1).shift(), data);\r
-                }\r
-            }\r
-        }\r
-        else {\r
-            // If rs is NOT an array but data IS, see if data contains just 1 record.  If so extract it and carry on.\r
-            if (Ext.isArray(data) && data.length == 1) {\r
-                data = data.shift();\r
-            }\r
-            if (!this.isData(data)) {\r
-                // TODO: Let exception-handler choose to commit or not rather than blindly rs.commit() here.\r
-                //rs.commit();\r
-                throw new Ext.data.DataReader.Error('realize', rs);\r
-            }\r
-            this.buildExtractors();\r
-            var values = this.extractValues(data, rs.fields.items, rs.fields.items.length);\r
-            rs.phantom = false; // <-- That's what it's all about\r
-            rs._phid = rs.id;  // <-- copy phantom-id -> _phid, so we can remap in Store#onCreateRecords\r
-            rs.id = data[this.meta.idProperty];\r
-            rs.data = values;\r
-            rs.commit();\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save.\r
-     * You <b>must</b> return a complete new record from the server.  If you don't, your local record's missing fields\r
-     * will be populated with the default values specified in your Ext.data.Record.create specification.  Without a defaultValue,\r
-     * local fields will be populated with empty string "".  So return your entire record's data after both remote create and update.\r
-     * In addition, you <b>must</b> return record-data from the server in the same order received.\r
-     * Will perform a commit as well, un-marking dirty-fields.  Store's "update" event will be suppressed as the record receives\r
-     * a fresh new data-hash.\r
-     * @param {Record/Record[]} rs\r
-     * @param {Object/Object[]} data\r
-     */\r
-    update : function(rs, data) {\r
-        if (Ext.isArray(rs)) {\r
-            for (var i=rs.length-1; i >= 0; i--) {\r
-                if (Ext.isArray(data)) {\r
-                    this.update(rs.splice(i,1).shift(), data.splice(i,1).shift());\r
-                }\r
-                else {\r
-                    // weird...rs is an array but data isn't??  recurse but just send in the whole data object.\r
-                    // the else clause below will detect !this.isData and throw exception.\r
-                    this.update(rs.splice(i,1).shift(), data);\r
-                }\r
-            }\r
-        }\r
-        else {\r
-                     // If rs is NOT an array but data IS, see if data contains just 1 record.  If so extract it and carry on.\r
-            if (Ext.isArray(data) && data.length == 1) {\r
-                data = data.shift();\r
-            }\r
-            if (!this.isData(data)) {\r
-                // TODO: create custom Exception class to return record in thrown exception.  Allow exception-handler the choice\r
-                // to commit or not rather than blindly rs.commit() here.\r
-                rs.commit();\r
-                throw new Ext.data.DataReader.Error('update', rs);\r
-            }\r
-            this.buildExtractors();\r
-            rs.data = this.extractValues(Ext.apply(rs.data, data), rs.fields.items, rs.fields.items.length);\r
-            rs.commit();\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns true if the supplied data-hash <b>looks</b> and quacks like data.  Checks to see if it has a key\r
-     * corresponding to idProperty defined in your DataReader config containing non-empty pk.\r
-     * @param {Object} data\r
-     * @return {Boolean}\r
-     */\r
-    isData : function(data) {\r
-        return (data && Ext.isObject(data) && !Ext.isEmpty(data[this.meta.idProperty])) ? true : false;\r
-    }\r
-};\r
-\r
-/**\r
- * @class Ext.data.DataReader.Error\r
- * @extends Ext.Error\r
- * General error class for Ext.data.DataReader\r
- */\r
-Ext.data.DataReader.Error = Ext.extend(Ext.Error, {\r
-    constructor : function(message, arg) {\r
-        this.arg = arg;\r
-        Ext.Error.call(this, message);\r
-    },\r
-    name: 'Ext.data.DataReader'\r
-});\r
-Ext.apply(Ext.data.DataReader.Error.prototype, {\r
-    lang : {\r
-        'update': "#update received invalid data from server.  Please see docs for DataReader#update and review your DataReader configuration.",\r
-        'realize': "#realize was called with invalid remote-data.  Please see the docs for DataReader#realize and review your DataReader configuration.",\r
-        'invalid-response': "#readResponse received an invalid response from the server."\r
-    }\r
-});\r
-\r
-\r
+Ext.reg('datepicker', Ext.DatePicker);
 /**
- * @class Ext.data.DataWriter
- * <p>Ext.data.DataWriter facilitates create, update, and destroy actions between
- * an Ext.data.Store and a server-side framework. A Writer enabled Store will
- * automatically manage the Ajax requests to perform CRUD actions on a Store.</p>
- * <p>Ext.data.DataWriter is an abstract base class which is intended to be extended
- * and should not be created directly. For existing implementations, see
- * {@link Ext.data.JsonWriter}.</p>
- * <p>Creating a writer is simple:</p>
- * <pre><code>
-var writer = new Ext.data.JsonWriter();
- * </code></pre>
- * <p>The proxy for a writer enabled store can be configured with a simple <code>url</code>:</p>
- * <pre><code>
-// Create a standard HttpProxy instance.
-var proxy = new Ext.data.HttpProxy({
-    url: 'app.php/users'
-});
- * </code></pre>
- * <p>For finer grained control, the proxy may also be configured with an <code>api</code>:</p>
- * <pre><code>
-// Use the api specification
-var proxy = new Ext.data.HttpProxy({
-    api: {
-        read    : 'app.php/users/read',
-        create  : 'app.php/users/create',
-        update  : 'app.php/users/update',
-        destroy : 'app.php/users/destroy'
-    }
-});
- * </code></pre>
- * <p>Creating a Writer enabled store:</p>
- * <pre><code>
-var store = new Ext.data.Store({
-    proxy: proxy,
-    reader: reader,
-    writer: writer
-});
- * </code></pre>
- * @constructor Create a new DataWriter
- * @param {Object} meta Metadata configuration options (implementation-specific)
- * @param {Object} recordType Either an Array of field definition objects as specified
- * in {@link Ext.data.Record#create}, or an {@link Ext.data.Record} object created
- * using {@link Ext.data.Record#create}.
+ * @class Ext.LoadMask
+ * A simple utility class for generically masking elements while loading data.  If the {@link #store}
+ * config option is specified, the masking will be automatically synchronized with the store's loading
+ * process and the mask element will be cached for reuse.  For all other elements, this mask will replace the
+ * element's Updater load indicator and will be destroyed after the initial load.
+ * <p>Example usage:</p>
+ *<pre><code>
+// Basic mask:
+var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
+myMask.show();
+</code></pre>
+ * @constructor
+ * Create a new LoadMask
+ * @param {Mixed} el The element or DOM node, or its id
+ * @param {Object} config The config object
  */
-Ext.data.DataWriter = function(config){
-    /**
-     * This DataWriter's configured metadata as passed to the constructor.
-     * @type Mixed
-     * @property meta
-     */
+Ext.LoadMask = function(el, config){
+    this.el = Ext.get(el);
     Ext.apply(this, config);
+    if(this.store){
+        this.store.on({
+            scope: this,
+            beforeload: this.onBeforeLoad,
+            load: this.onLoad,
+            exception: this.onLoad
+        });
+        this.removeMask = Ext.value(this.removeMask, false);
+    }else{
+        var um = this.el.getUpdater();
+        um.showLoadIndicator = false; // disable the default indicator
+        um.on({
+            scope: this,
+            beforeupdate: this.onBeforeLoad,
+            update: this.onLoad,
+            failure: this.onLoad
+        });
+        this.removeMask = Ext.value(this.removeMask, true);
+    }
 };
 
-Ext.data.DataWriter.prototype = {
-
+Ext.LoadMask.prototype = {
     /**
-     * @cfg {Boolean} writeAllFields
-     * <tt>false</tt> by default.  Set <tt>true</tt> to have DataWriter return ALL fields of a modified
-     * record -- not just those that changed.
-     * <tt>false</tt> to have DataWriter only request modified fields from a record.
+     * @cfg {Ext.data.Store} store
+     * Optional Store to which the mask is bound. The mask is displayed when a load request is issued, and
+     * hidden on either load sucess, or load fail.
      */
-    writeAllFields : false,
     /**
-     * @cfg {Boolean} listful
-     * <tt>false</tt> by default.  Set <tt>true</tt> to have the DataWriter <b>always</b> write HTTP params as a list,
-     * even when acting upon a single record.
+     * @cfg {Boolean} removeMask
+     * True to create a single-use mask that is automatically destroyed after loading (useful for page loads),
+     * False to persist the mask element reference for multiple uses (e.g., for paged data widgets).  Defaults to false.
      */
-    listful : false,    // <-- listful is actually not used internally here in DataWriter.  @see Ext.data.Store#execute.
-
     /**
-     * Writes data in preparation for server-write action.  Simply proxies to DataWriter#update, DataWriter#create
-     * DataWriter#destroy.
-     * @param {String} action [CREATE|UPDATE|DESTROY]
-     * @param {Object} params The params-hash to write-to
-     * @param {Record/Record[]} rs The recordset write.
+     * @cfg {String} msg
+     * The text to display in a centered loading message box (defaults to 'Loading...')
      */
-    write : function(action, params, rs) {
-        this.render(action, rs, params, this[action](rs));
-    },
-
+    msg : 'Loading...',
     /**
-     * abstract method meant to be overridden by all DataWriter extensions.  It's the extension's job to apply the "data" to the "params".
-     * The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config,
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
-     * @param {Record[]} rs Store recordset
-     * @param {Object} params Http params to be sent to server.
-     * @param {Object} data object populated according to DataReader meta-data.
+     * @cfg {String} msgCls
+     * The CSS class to apply to the loading message element (defaults to "x-mask-loading")
      */
-    render : Ext.emptyFn,
+    msgCls : 'x-mask-loading',
 
     /**
-     * update
-     * @param {Object} p Params-hash to apply result to.
-     * @param {Record/Record[]} rs Record(s) to write
-     * @private
+     * Read-only. True if the mask is currently disabled so that it will not be displayed (defaults to false)
+     * @type Boolean
      */
-    update : function(rs) {
-        var params = {};
-        if (Ext.isArray(rs)) {
-            var data = [],
-                ids = [];
-            Ext.each(rs, function(val){
-                ids.push(val.id);
-                data.push(this.updateRecord(val));
-            }, this);
-            params[this.meta.idProperty] = ids;
-            params[this.meta.root] = data;
-        }
-        else if (rs instanceof Ext.data.Record) {
-            params[this.meta.idProperty] = rs.id;
-            params[this.meta.root] = this.updateRecord(rs);
-        }
-        return params;
-    },
+    disabled: false,
 
     /**
-     * @cfg {Function} saveRecord Abstract method that should be implemented in all subclasses
-     * (e.g.: {@link Ext.data.JsonWriter#saveRecord JsonWriter.saveRecord}
+     * Disables the mask to prevent it from being displayed
      */
-    updateRecord : Ext.emptyFn,
+    disable : function(){
+       this.disabled = true;
+    },
 
     /**
-     * create
-     * @param {Object} p Params-hash to apply result to.
-     * @param {Record/Record[]} rs Record(s) to write
-     * @private
+     * Enables the mask so that it can be displayed
      */
-    create : function(rs) {
-        var params = {};
-        if (Ext.isArray(rs)) {
-            var data = [];
-            Ext.each(rs, function(val){
-                data.push(this.createRecord(val));
-            }, this);
-            params[this.meta.root] = data;
-        }
-        else if (rs instanceof Ext.data.Record) {
-            params[this.meta.root] = this.createRecord(rs);
-        }
-        return params;
+    enable : function(){
+        this.disabled = false;
     },
 
-    /**
-     * @cfg {Function} createRecord Abstract method that should be implemented in all subclasses
-     * (e.g.: {@link Ext.data.JsonWriter#createRecord JsonWriter.createRecord})
-     */
-    createRecord : Ext.emptyFn,
+    // private
+    onLoad : function(){
+        this.el.unmask(this.removeMask);
+    },
 
-    /**
-     * destroy
-     * @param {Object} p Params-hash to apply result to.
-     * @param {Record/Record[]} rs Record(s) to write
-     * @private
-     */
-    destroy : function(rs) {
-        var params = {};
-        if (Ext.isArray(rs)) {
-            var data = [],
-                ids = [];
-            Ext.each(rs, function(val){
-                data.push(this.destroyRecord(val));
-            }, this);
-            params[this.meta.root] = data;
-        } else if (rs instanceof Ext.data.Record) {
-            params[this.meta.root] = this.destroyRecord(rs);
+    // private
+    onBeforeLoad : function(){
+        if(!this.disabled){
+            this.el.mask(this.msg, this.msgCls);
         }
-        return params;
     },
 
     /**
-     * @cfg {Function} destroyRecord Abstract method that should be implemented in all subclasses
-     * (e.g.: {@link Ext.data.JsonWriter#destroyRecord JsonWriter.destroyRecord})
+     * Show this LoadMask over the configured Element.
      */
-    destroyRecord : Ext.emptyFn,
+    show: function(){
+        this.onBeforeLoad();
+    },
 
     /**
-     * Converts a Record to a hash
-     * @param {Record}
-     * @private
+     * Hide this LoadMask.
      */
-    toHash : function(rec) {
-        var map = rec.fields.map,
-            data = {},
-            raw = (this.writeAllFields === false && rec.phantom === false) ? rec.getChanges() : rec.data,
-            m;
-        Ext.iterate(raw, function(prop, value){
-            if((m = map[prop])){
-                data[m.mapping ? m.mapping : m.name] = value;
-            }
-        });
-        data[this.meta.idProperty] = rec.id;
-        return data;
+    hide: function(){
+        this.onLoad();
+    },
+
+    // private
+    destroy : function(){
+        if(this.store){
+            this.store.un('beforeload', this.onBeforeLoad, this);
+            this.store.un('load', this.onLoad, this);
+            this.store.un('exception', this.onLoad, this);
+        }else{
+            var um = this.el.getUpdater();
+            um.un('beforeupdate', this.onBeforeLoad, this);
+            um.un('update', this.onLoad, this);
+            um.un('failure', this.onLoad, this);
+        }
     }
 };/**\r
- * @class Ext.data.DataProxy\r
- * @extends Ext.util.Observable\r
- * <p>Abstract base class for implementations which provide retrieval of unformatted data objects.\r
- * This class is intended to be extended and should not be created directly. For existing implementations,\r
- * see {@link Ext.data.DirectProxy}, {@link Ext.data.HttpProxy}, {@link Ext.data.ScriptTagProxy} and\r
- * {@link Ext.data.MemoryProxy}.</p>\r
- * <p>DataProxy implementations are usually used in conjunction with an implementation of {@link Ext.data.DataReader}\r
- * (of the appropriate type which knows how to parse the data object) to provide a block of\r
- * {@link Ext.data.Records} to an {@link Ext.data.Store}.</p>\r
- * <p>The parameter to a DataProxy constructor may be an {@link Ext.data.Connection} or can also be the\r
- * config object to an {@link Ext.data.Connection}.</p>\r
- * <p>Custom implementations must implement either the <code><b>doRequest</b></code> method (preferred) or the\r
- * <code>load</code> method (deprecated). See\r
- * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#doRequest doRequest} or\r
- * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#load load} for additional details.</p>\r
- * <p><b><u>Example 1</u></b></p>\r
- * <pre><code>\r
-proxy: new Ext.data.ScriptTagProxy({\r
-    {@link Ext.data.Connection#url url}: 'http://extjs.com/forum/topics-remote.php'\r
-}),\r
- * </code></pre>\r
- * <p><b><u>Example 2</u></b></p>\r
- * <pre><code>\r
-proxy : new Ext.data.HttpProxy({\r
-    {@link Ext.data.Connection#method method}: 'GET',\r
-    {@link Ext.data.HttpProxy#prettyUrls prettyUrls}: false,\r
-    {@link Ext.data.Connection#url url}: 'local/default.php', // see options parameter for {@link Ext.Ajax#request}\r
-    {@link #api}: {\r
-        // all actions except the following will use above url\r
-        create  : 'local/new.php',\r
-        update  : 'local/update.php'\r
-    }\r
-}),\r
- * </code></pre>\r
+ * @class Ext.Slider\r
+ * @extends Ext.BoxComponent\r
+ * Slider which supports vertical or horizontal orientation, keyboard adjustments,\r
+ * configurable snapping, axis clicking and animation. Can be added as an item to\r
+ * any container. Example usage:\r
+<pre><code>\r
+new Ext.Slider({\r
+    renderTo: Ext.getBody(),\r
+    width: 200,\r
+    value: 50,\r
+    increment: 10,\r
+    minValue: 0,\r
+    maxValue: 100\r
+});\r
+</code></pre>\r
  */\r
-Ext.data.DataProxy = function(conn){\r
-    // make sure we have a config object here to support ux proxies.\r
-    // All proxies should now send config into superclass constructor.\r
-    conn = conn || {};\r
-\r
-    // This line caused a bug when people use custom Connection object having its own request method.\r
-    // http://extjs.com/forum/showthread.php?t=67194.  Have to set DataProxy config\r
-    //Ext.applyIf(this, conn);\r
+Ext.Slider = Ext.extend(Ext.BoxComponent, {\r
+    /**\r
+     * @cfg {Number} value The value to initialize the slider with. Defaults to minValue.\r
+     */\r
+    /**\r
+     * @cfg {Boolean} vertical Orient the Slider vertically rather than horizontally, defaults to false.\r
+     */\r
+    vertical: false,\r
+    /**\r
+     * @cfg {Number} minValue The minimum value for the Slider. Defaults to 0.\r
+     */\r
+    minValue: 0,\r
+    /**\r
+     * @cfg {Number} maxValue The maximum value for the Slider. Defaults to 100.\r
+     */\r
+    maxValue: 100,\r
+    /**\r
+     * @cfg {Number/Boolean} decimalPrecision.\r
+     * <p>The number of decimal places to which to round the Slider's value. Defaults to 0.</p>\r
+     * <p>To disable rounding, configure as <tt><b>false</b></tt>.</p>\r
+     */\r
+    decimalPrecision: 0,\r
+    /**\r
+     * @cfg {Number} keyIncrement How many units to change the Slider when adjusting with keyboard navigation. Defaults to 1. If the increment config is larger, it will be used instead.\r
+     */\r
+    keyIncrement: 1,\r
+    /**\r
+     * @cfg {Number} increment How many units to change the slider when adjusting by drag and drop. Use this option to enable 'snapping'.\r
+     */\r
+    increment: 0,\r
+    // private\r
+    clickRange: [5,15],\r
+    /**\r
+     * @cfg {Boolean} clickToChange Determines whether or not clicking on the Slider axis will change the slider. Defaults to true\r
+     */\r
+    clickToChange : true,\r
+    /**\r
+     * @cfg {Boolean} animate Turn on or off animation. Defaults to true\r
+     */\r
+    animate: true,\r
 \r
-    this.api     = conn.api;\r
-    this.url     = conn.url;\r
-    this.restful = conn.restful;\r
-    this.listeners = conn.listeners;\r
+    /**\r
+     * True while the thumb is in a drag operation\r
+     * @type boolean\r
+     */\r
+    dragging: false,\r
 \r
-    // deprecated\r
-    this.prettyUrls = conn.prettyUrls;\r
+    // private override\r
+    initComponent : function(){\r
+        if(!Ext.isDefined(this.value)){\r
+            this.value = this.minValue;\r
+        }\r
+        Ext.Slider.superclass.initComponent.call(this);\r
+        this.keyIncrement = Math.max(this.increment, this.keyIncrement);\r
+        this.addEvents(\r
+            /**\r
+             * @event beforechange\r
+             * Fires before the slider value is changed. By returning false from an event handler,\r
+             * you can cancel the event and prevent the slider from changing.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Number} newValue The new value which the slider is being changed to.\r
+             * @param {Number} oldValue The old value which the slider was previously.\r
+             */\r
+            'beforechange',\r
+            /**\r
+             * @event change\r
+             * Fires when the slider value is changed.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Number} newValue The new value which the slider has been changed to.\r
+             */\r
+            'change',\r
+            /**\r
+             * @event changecomplete\r
+             * Fires when the slider value is changed by the user and any drag operations have completed.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Number} newValue The new value which the slider has been changed to.\r
+             */\r
+            'changecomplete',\r
+            /**\r
+             * @event dragstart\r
+             * Fires after a drag operation has started.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
+             */\r
+            'dragstart',\r
+            /**\r
+             * @event drag\r
+             * Fires continuously during the drag operation while the mouse is moving.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
+             */\r
+            'drag',\r
+            /**\r
+             * @event dragend\r
+             * Fires after the drag operation has completed.\r
+             * @param {Ext.Slider} slider The slider\r
+             * @param {Ext.EventObject} e The event fired from Ext.dd.DragTracker\r
+             */\r
+            'dragend'\r
+        );\r
 \r
-    /**\r
-     * @cfg {Object} api\r
-     * Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".\r
-     * Defaults to:<pre><code>\r
-api: {\r
-    read    : undefined,\r
-    create  : undefined,\r
-    update  : undefined,\r
-    destroy : undefined\r
-}\r
-</code></pre>\r
-     * <p>If the specific URL for a given CRUD action is undefined, the CRUD action request\r
-     * will be directed to the configured <tt>{@link Ext.data.Connection#url url}</tt>.</p>\r
-     * <br><p><b>Note</b>: To modify the URL for an action dynamically the appropriate API\r
-     * property should be modified before the action is requested using the corresponding before\r
-     * action event.  For example to modify the URL associated with the load action:\r
-     * <pre><code>\r
-// modify the url for the action\r
-myStore.on({\r
-    beforeload: {\r
-        fn: function (store, options) {\r
-            // use <tt>{@link Ext.data.HttpProxy#setUrl setUrl}</tt> to change the URL for *just* this request.\r
-            store.proxy.setUrl('changed1.php');\r
+        if(this.vertical){\r
+            Ext.apply(this, Ext.Slider.Vertical);\r
+        }\r
+    },\r
 \r
-            // set optional second parameter to true to make this URL change\r
-            // permanent, applying this URL for all subsequent requests.\r
-            store.proxy.setUrl('changed1.php', true);\r
+    // private override\r
+    onRender : function(){\r
+        this.autoEl = {\r
+            cls: 'x-slider ' + (this.vertical ? 'x-slider-vert' : 'x-slider-horz'),\r
+            cn:{cls:'x-slider-end',cn:{cls:'x-slider-inner',cn:[{cls:'x-slider-thumb'},{tag:'a', cls:'x-slider-focus', href:"#", tabIndex: '-1', hidefocus:'on'}]}}\r
+        };\r
+        Ext.Slider.superclass.onRender.apply(this, arguments);\r
+        this.endEl = this.el.first();\r
+        this.innerEl = this.endEl.first();\r
+        this.thumb = this.innerEl.first();\r
+        this.halfThumb = (this.vertical ? this.thumb.getHeight() : this.thumb.getWidth())/2;\r
+        this.focusEl = this.thumb.next();\r
+        this.initEvents();\r
+    },\r
 \r
-            // manually set the <b>private</b> connection URL.\r
-            // <b>Warning:</b>  Accessing the private URL property should be avoided.\r
-            // Use the public method <tt>{@link Ext.data.HttpProxy#setUrl setUrl}</tt> instead, shown above.\r
-            // It should be noted that changing the URL like this will affect\r
-            // the URL for just this request.  Subsequent requests will use the\r
-            // API or URL defined in your initial proxy configuration.\r
-            store.proxy.conn.url = 'changed1.php';\r
+    // private override\r
+    initEvents : function(){\r
+        this.thumb.addClassOnOver('x-slider-thumb-over');\r
+        this.mon(this.el, {\r
+            scope: this,\r
+            mousedown: this.onMouseDown,\r
+            keydown: this.onKeyDown\r
+        });\r
 \r
-            // proxy URL will be superseded by API (only if proxy created to use ajax):\r
-            // It should be noted that proxy API changes are permanent and will\r
-            // be used for all subsequent requests.\r
-            store.proxy.api.load = 'changed2.php';\r
+        this.focusEl.swallowEvent("click", true);\r
 \r
-            // However, altering the proxy API should be done using the public\r
-            // method <tt>{@link Ext.data.DataProxy#setApi setApi}</tt> instead.\r
-            store.proxy.setApi('load', 'changed2.php');\r
+        this.tracker = new Ext.dd.DragTracker({\r
+            onBeforeStart: this.onBeforeDragStart.createDelegate(this),\r
+            onStart: this.onDragStart.createDelegate(this),\r
+            onDrag: this.onDrag.createDelegate(this),\r
+            onEnd: this.onDragEnd.createDelegate(this),\r
+            tolerance: 3,\r
+            autoStart: 300\r
+        });\r
+        this.tracker.initEl(this.thumb);\r
+    },\r
 \r
-            // Or set the entire API with a config-object.\r
-            // When using the config-object option, you must redefine the <b>entire</b>\r
-            // API -- not just a specific action of it.\r
-            store.proxy.setApi({\r
-                read    : 'changed_read.php',\r
-                create  : 'changed_create.php',\r
-                update  : 'changed_update.php',\r
-                destroy : 'changed_destroy.php'\r
-            });\r
+    // private override\r
+    onMouseDown : function(e){\r
+        if(this.disabled){\r
+            return;\r
         }\r
-    }\r
-});\r
-     * </code></pre>\r
-     * </p>\r
-     */\r
-    // Prepare the proxy api.  Ensures all API-actions are defined with the Object-form.\r
-    try {\r
-        Ext.data.Api.prepare(this);\r
-    } catch (e) {\r
-        if (e instanceof Ext.data.Api.Error) {\r
-            e.toConsole();\r
+        if(this.clickToChange && e.target != this.thumb.dom){\r
+            var local = this.innerEl.translatePoints(e.getXY());\r
+            this.onClickChange(local);\r
         }\r
-    }\r
-\r
-    this.addEvents(\r
-        /**\r
-         * @event exception\r
-         * <p>Fires if an exception occurs in the Proxy during a remote request.\r
-         * This event is relayed through a corresponding\r
-         * {@link Ext.data.Store}.{@link Ext.data.Store#exception exception},\r
-         * so any Store instance may observe this event.\r
-         * This event can be fired for one of two reasons:</p>\r
-         * <div class="mdetail-params"><ul>\r
-         * <li>remote-request <b>failed</b> : <div class="sub-desc">\r
-         * The server did not return status === 200.\r
-         * </div></li>\r
-         * <li>remote-request <b>succeeded</b> : <div class="sub-desc">\r
-         * The remote-request succeeded but the reader could not read the response.\r
-         * This means the server returned data, but the configured Reader threw an\r
-         * error while reading the response.  In this case, this event will be\r
-         * raised and the caught error will be passed along into this event.\r
-         * </div></li>\r
-         * </ul></div>\r
-         * <br><p>This event fires with two different contexts based upon the 2nd\r
-         * parameter <tt>type [remote|response]</tt>.  The first four parameters\r
-         * are identical between the two contexts -- only the final two parameters\r
-         * differ.</p>\r
-         * @param {DataProxy} this The proxy that sent the request\r
-         * @param {String} type\r
-         * <p>The value of this parameter will be either <tt>'response'</tt> or <tt>'remote'</tt>.</p>\r
-         * <div class="mdetail-params"><ul>\r
-         * <li><b><tt>'response'</tt></b> : <div class="sub-desc">\r
-         * <p>An <b>invalid</b> response from the server was returned: either 404,\r
-         * 500 or the response meta-data does not match that defined in the DataReader\r
-         * (e.g.: root, idProperty, successProperty).</p>\r
-         * </div></li>\r
-         * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">\r
-         * <p>A <b>valid</b> response was returned from the server having\r
-         * successProperty === false.  This response might contain an error-message\r
-         * sent from the server.  For example, the user may have failed\r
-         * authentication/authorization or a database validation error occurred.</p>\r
-         * </div></li>\r
-         * </ul></div>\r
-         * @param {String} action Name of the action (see {@link Ext.data.Api#actions}.\r
-         * @param {Object} options The options for the action that were specified in the {@link #request}.\r
-         * @param {Object} response\r
-         * <p>The value of this parameter depends on the value of the <code>type</code> parameter:</p>\r
-         * <div class="mdetail-params"><ul>\r
-         * <li><b><tt>'response'</tt></b> : <div class="sub-desc">\r
-         * <p>The raw browser response object (e.g.: XMLHttpRequest)</p>\r
-         * </div></li>\r
-         * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">\r
-         * <p>The decoded response object sent from the server.</p>\r
-         * </div></li>\r
-         * </ul></div>\r
-         * @param {Mixed} arg\r
-         * <p>The type and value of this parameter depends on the value of the <code>type</code> parameter:</p>\r
-         * <div class="mdetail-params"><ul>\r
-         * <li><b><tt>'response'</tt></b> : Error<div class="sub-desc">\r
-         * <p>The JavaScript Error object caught if the configured Reader could not read the data.\r
-         * If the remote request returns success===false, this parameter will be null.</p>\r
-         * </div></li>\r
-         * <li><b><tt>'remote'</tt></b> : Record/Record[]<div class="sub-desc">\r
-         * <p>This parameter will only exist if the <tt>action</tt> was a <b>write</b> action\r
-         * (Ext.data.Api.actions.create|update|destroy).</p>\r
-         * </div></li>\r
-         * </ul></div>\r
-         */\r
-        'exception',\r
-        /**\r
-         * @event beforeload\r
-         * Fires before a request to retrieve a data object.\r
-         * @param {DataProxy} this The proxy for the request\r
-         * @param {Object} params The params object passed to the {@link #request} function\r
-         */\r
-        'beforeload',\r
-        /**\r
-         * @event load\r
-         * Fires before the load method's callback is called.\r
-         * @param {DataProxy} this The proxy for the request\r
-         * @param {Object} o The request transaction object\r
-         * @param {Object} options The callback's <tt>options</tt> property as passed to the {@link #request} function\r
-         */\r
-        'load',\r
-        /**\r
-         * @event loadexception\r
-         * <p>This event is <b>deprecated</b>.  The signature of the loadexception event\r
-         * varies depending on the proxy, use the catch-all {@link #exception} event instead.\r
-         * This event will fire in addition to the {@link #exception} event.</p>\r
-         * @param {misc} misc See {@link #exception}.\r
-         * @deprecated\r
-         */\r
-        'loadexception',\r
-        /**\r
-         * @event beforewrite\r
-         * Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy\r
-         * @param {DataProxy} this The proxy for the request\r
-         * @param {String} action [Ext.data.Api.actions.create|update|destroy]\r
-         * @param {Record/Array[Record]} rs The Record(s) to create|update|destroy.\r
-         * @param {Object} params The request <code>params</code> object.  Edit <code>params</code> to add parameters to the request.\r
-         */\r
-        'beforewrite',\r
-        /**\r
-         * @event write\r
-         * Fires before the request-callback is called\r
-         * @param {DataProxy} this The proxy that sent the request\r
-         * @param {String} action [Ext.data.Api.actions.create|upate|destroy]\r
-         * @param {Object} data The data object extracted from the server-response\r
-         * @param {Object} response The decoded response from server\r
-         * @param {Record/Record{}} rs The records from Store\r
-         * @param {Object} options The callback's <tt>options</tt> property as passed to the {@link #request} function\r
-         */\r
-        'write'\r
-    );\r
-    Ext.data.DataProxy.superclass.constructor.call(this);\r
-};\r
+        this.focus();\r
+    },\r
 \r
-Ext.extend(Ext.data.DataProxy, Ext.util.Observable, {\r
-    /**\r
-     * @cfg {Boolean} restful\r
-     * <p>Defaults to <tt>false</tt>.  Set to <tt>true</tt> to operate in a RESTful manner.</p>\r
-     * <br><p> Note: this parameter will automatically be set to <tt>true</tt> if the\r
-     * {@link Ext.data.Store} it is plugged into is set to <code>restful: true</code>. If the\r
-     * Store is RESTful, there is no need to set this option on the proxy.</p>\r
-     * <br><p>RESTful implementations enable the serverside framework to automatically route\r
-     * actions sent to one url based upon the HTTP method, for example:\r
-     * <pre><code>\r
-store: new Ext.data.Store({\r
-    restful: true,\r
-    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users\r
-    ...\r
-)}\r
-     * </code></pre>\r
-     * There is no <code>{@link #api}</code> specified in the configuration of the proxy,\r
-     * all requests will be marshalled to a single RESTful url (/users) so the serverside\r
-     * framework can inspect the HTTP Method and act accordingly:\r
-     * <pre>\r
-<u>Method</u>   <u>url</u>        <u>action</u>\r
-POST     /users     create\r
-GET      /users     read\r
-PUT      /users/23  update\r
-DESTROY  /users/23  delete\r
-     * </pre></p>\r
-     */\r
-    restful: false,\r
+    // private\r
+    onClickChange : function(local){\r
+        if(local.top > this.clickRange[0] && local.top < this.clickRange[1]){\r
+            this.setValue(Ext.util.Format.round(this.reverseValue(local.left), this.decimalPrecision), undefined, true);\r
+        }\r
+    },\r
 \r
-    /**\r
-     * <p>Redefines the Proxy's API or a single action of an API. Can be called with two method signatures.</p>\r
-     * <p>If called with an object as the only parameter, the object should redefine the <b>entire</b> API, e.g.:</p><pre><code>\r
-proxy.setApi({\r
-    read    : '/users/read',\r
-    create  : '/users/create',\r
-    update  : '/users/update',\r
-    destroy : '/users/destroy'\r
-});\r
-</code></pre>\r
-     * <p>If called with two parameters, the first parameter should be a string specifying the API action to\r
-     * redefine and the second parameter should be the URL (or function if using DirectProxy) to call for that action, e.g.:</p><pre><code>\r
-proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');\r
-</code></pre>\r
-     * @param {String/Object} api An API specification object, or the name of an action.\r
-     * @param {String/Function} url The URL (or function if using DirectProxy) to call for the action.\r
-     */\r
-    setApi : function() {\r
-        if (arguments.length == 1) {\r
-            var valid = Ext.data.Api.isValid(arguments[0]);\r
-            if (valid === true) {\r
-                this.api = arguments[0];\r
-            }\r
-            else {\r
-                throw new Ext.data.Api.Error('invalid', valid);\r
+    // private\r
+    onKeyDown : function(e){\r
+        if(this.disabled){e.preventDefault();return;}\r
+        var k = e.getKey();\r
+        switch(k){\r
+            case e.UP:\r
+            case e.RIGHT:\r
+                e.stopEvent();\r
+                if(e.ctrlKey){\r
+                    this.setValue(this.maxValue, undefined, true);\r
+                }else{\r
+                    this.setValue(this.value+this.keyIncrement, undefined, true);\r
+                }\r
+            break;\r
+            case e.DOWN:\r
+            case e.LEFT:\r
+                e.stopEvent();\r
+                if(e.ctrlKey){\r
+                    this.setValue(this.minValue, undefined, true);\r
+                }else{\r
+                    this.setValue(this.value-this.keyIncrement, undefined, true);\r
+                }\r
+            break;\r
+            default:\r
+                e.preventDefault();\r
+        }\r
+    },\r
+\r
+    // private\r
+    doSnap : function(value){\r
+        if(!(this.increment && value)){\r
+            return value;\r
+        }\r
+        var newValue = value,\r
+            inc = this.increment,\r
+            m = value % inc;\r
+        if(m != 0){\r
+            newValue -= m;\r
+            if(m * 2 > inc){\r
+                newValue += inc;\r
+            }else if(m * 2 < -inc){\r
+                newValue -= inc;\r
             }\r
         }\r
-        else if (arguments.length == 2) {\r
-            if (!Ext.data.Api.isAction(arguments[0])) {\r
-                throw new Ext.data.Api.Error('invalid', arguments[0]);\r
+        return newValue.constrain(this.minValue,  this.maxValue);\r
+    },\r
+\r
+    // private\r
+    afterRender : function(){\r
+        Ext.Slider.superclass.afterRender.apply(this, arguments);\r
+        if(this.value !== undefined){\r
+            var v = this.normalizeValue(this.value);\r
+            if(v !== this.value){\r
+                delete this.value;\r
+                this.setValue(v, false);\r
+            }else{\r
+                this.moveThumb(this.translateValue(v), false);\r
             }\r
-            this.api[arguments[0]] = arguments[1];\r
         }\r
-        Ext.data.Api.prepare(this);\r
     },\r
 \r
-    /**\r
-     * Returns true if the specified action is defined as a unique action in the api-config.\r
-     * request.  If all API-actions are routed to unique urls, the xaction parameter is unecessary.  However, if no api is defined\r
-     * and all Proxy actions are routed to DataProxy#url, the server-side will require the xaction parameter to perform a switch to\r
-     * the corresponding code for CRUD action.\r
-     * @param {String [Ext.data.Api.CREATE|READ|UPDATE|DESTROY]} action\r
-     * @return {Boolean}\r
-     */\r
-    isApiAction : function(action) {\r
-        return (this.api[action]) ? true : false;\r
+    // private\r
+    getRatio : function(){\r
+        var w = this.innerEl.getWidth(),\r
+            v = this.maxValue - this.minValue;\r
+        return v == 0 ? w : (w/v);\r
     },\r
 \r
+    // private\r
+    normalizeValue : function(v){\r
+        v = this.doSnap(v);\r
+        v = Ext.util.Format.round(v, this.decimalPrecision);\r
+        v = v.constrain(this.minValue, this.maxValue);\r
+        return v;\r
+    },\r
+    \r
     /**\r
-     * All proxy actions are executed through this method.  Automatically fires the "before" + action event\r
-     * @param {String} action Name of the action\r
-     * @param {Ext.data.Record/Ext.data.Record[]/null} rs Will be null when action is 'load'\r
-     * @param {Object} params\r
-     * @param {Ext.data.DataReader} reader\r
-     * @param {Function} callback\r
-     * @param {Object} scope Scope with which to call the callback (defaults to the Proxy object)\r
-     * @param {Object} options Any options specified for the action (e.g. see {@link Ext.data.Store#load}.\r
+     * Sets the minimum value for the slider instance. If the current value is less than the \r
+     * minimum value, the current value will be changed.\r
+     * @param {Number} val The new minimum value\r
      */\r
-    request : function(action, rs, params, reader, callback, scope, options) {\r
-        if (!this.api[action] && !this.load) {\r
-            throw new Ext.data.DataProxy.Error('action-undefined', action);\r
-        }\r
-        params = params || {};\r
-        if ((action === Ext.data.Api.actions.read) ? this.fireEvent("beforeload", this, params) : this.fireEvent("beforewrite", this, action, rs, params) !== false) {\r
-            this.doRequest.apply(this, arguments);\r
-        }\r
-        else {\r
-            callback.call(scope || this, null, options, false);\r
+    setMinValue : function(val){\r
+        this.minValue = val;\r
+        this.syncThumb();\r
+        if(this.value < val){\r
+            this.setValue(val);\r
         }\r
     },\r
-\r
-\r
-    /**\r
-     * <b>Deprecated</b> load method using old method signature. See {@doRequest} for preferred method.\r
-     * @deprecated\r
-     * @param {Object} params\r
-     * @param {Object} reader\r
-     * @param {Object} callback\r
-     * @param {Object} scope\r
-     * @param {Object} arg\r
-     */\r
-    load : null,\r
-\r
+    \r
     /**\r
-     * @cfg {Function} doRequest Abstract method that should be implemented in all subclasses\r
-     * (e.g.: {@link Ext.data.HttpProxy#doRequest HttpProxy.doRequest},\r
-     * {@link Ext.data.DirectProxy#doRequest DirectProxy.doRequest}).\r
+     * Sets the maximum value for the slider instance. If the current value is more than the \r
+     * maximum value, the current value will be changed.\r
+     * @param {Number} val The new maximum value\r
      */\r
-    doRequest : function(action, rs, params, reader, callback, scope, options) {\r
-        // default implementation of doRequest for backwards compatibility with 2.0 proxies.\r
-        // If we're executing here, the action is probably "load".\r
-        // Call with the pre-3.0 method signature.\r
-        this.load(params, reader, callback, scope, options);\r
+    setMaxValue : function(val){\r
+        this.maxValue = val;\r
+        this.syncThumb();\r
+        if(this.value > val){\r
+            this.setValue(val);\r
+        }\r
     },\r
 \r
     /**\r
-     * buildUrl\r
-     * Sets the appropriate url based upon the action being executed.  If restful is true, and only a single record is being acted upon,\r
-     * url will be built Rails-style, as in "/controller/action/32".  restful will aply iff the supplied record is an\r
-     * instance of Ext.data.Record rather than an Array of them.\r
-     * @param {String} action The api action being executed [read|create|update|destroy]\r
-     * @param {Ext.data.Record/Array[Ext.data.Record]} The record or Array of Records being acted upon.\r
-     * @return {String} url\r
-     * @private\r
+     * Programmatically sets the value of the Slider. Ensures that the value is constrained within\r
+     * the minValue and maxValue.\r
+     * @param {Number} value The value to set the slider to. (This will be constrained within minValue and maxValue)\r
+     * @param {Boolean} animate Turn on or off animation, defaults to true\r
      */\r
-    buildUrl : function(action, record) {\r
-        record = record || null;\r
-        var url = (this.api[action]) ? this.api[action].url : this.url;\r
-        if (!url) {\r
-            throw new Ext.data.Api.Error('invalid-url', action);\r
+    setValue : function(v, animate, changeComplete){\r
+        v = this.normalizeValue(v);\r
+        if(v !== this.value && this.fireEvent('beforechange', this, v, this.value) !== false){\r
+            this.value = v;\r
+            this.moveThumb(this.translateValue(v), animate !== false);\r
+            this.fireEvent('change', this, v);\r
+            if(changeComplete){\r
+                this.fireEvent('changecomplete', this, v);\r
+            }\r
         }\r
+    },\r
 \r
-        var format = null;\r
-        var m = url.match(/(.*)(\.\w+)$/);  // <-- look for urls with "provides" suffix, e.g.: /users.json, /users.xml, etc\r
-        if (m) {\r
-            format = m[2];\r
-            url = m[1];\r
-        }\r
-        // prettyUrls is deprectated in favor of restful-config\r
-        if ((this.prettyUrls === true || this.restful === true) && record instanceof Ext.data.Record && !record.phantom) {\r
-            url += '/' + record.id;\r
-        }\r
-        if (format) {   // <-- append the request format if exists (ie: /users/update/69[.json])\r
-            url += format;\r
-        }\r
-        return url;\r
+    // private\r
+    translateValue : function(v){\r
+        var ratio = this.getRatio();\r
+        return (v * ratio) - (this.minValue * ratio) - this.halfThumb;\r
     },\r
 \r
-    /**\r
-     * Destroys the proxy by purging any event listeners and cancelling any active requests.\r
-     */\r
-    destroy: function(){\r
-        this.purgeListeners();\r
-    }\r
-});\r
+    reverseValue : function(pos){\r
+        var ratio = this.getRatio();\r
+        return (pos + (this.minValue * ratio)) / ratio;\r
+    },\r
 \r
-/**\r
- * @class Ext.data.DataProxy.Error\r
- * @extends Ext.Error\r
- * DataProxy Error extension.\r
- * constructor\r
- * @param {String} name\r
- * @param {Record/Array[Record]/Array}\r
- */\r
-Ext.data.DataProxy.Error = Ext.extend(Ext.Error, {\r
-    constructor : function(message, arg) {\r
-        this.arg = arg;\r
-        Ext.Error.call(this, message);\r
+    // private\r
+    moveThumb: function(v, animate){\r
+        if(!animate || this.animate === false){\r
+            this.thumb.setLeft(v);\r
+        }else{\r
+            this.thumb.shift({left: v, stopFx: true, duration:.35});\r
+        }\r
     },\r
-    name: 'Ext.data.DataProxy'\r
-});\r
-Ext.apply(Ext.data.DataProxy.Error.prototype, {\r
-    lang: {\r
-        'action-undefined': "DataProxy attempted to execute an API-action but found an undefined url / function.  Please review your Proxy url/api-configuration.",\r
-        'api-invalid': 'Recieved an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions.'\r
-    }\r
-});\r
-/**\r
- * @class Ext.data.ScriptTagProxy\r
- * @extends Ext.data.DataProxy\r
- * An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain\r
- * other than the originating domain of the running page.<br>\r
- * <p>\r
- * <b>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain\r
- * of the running page, you must use this class, rather than HttpProxy.</b><br>\r
- * <p>\r
- * The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScript\r
- * source code because it is used as the source inside a &lt;script> tag.<br>\r
- * <p>\r
- * In order for the browser to process the returned data, the server must wrap the data object\r
- * with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.\r
- * Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy\r
- * depending on whether the callback name was passed:\r
- * <p>\r
- * <pre><code>\r
-boolean scriptTag = false;\r
-String cb = request.getParameter("callback");\r
-if (cb != null) {\r
-    scriptTag = true;\r
-    response.setContentType("text/javascript");\r
-} else {\r
-    response.setContentType("application/x-json");\r
-}\r
-Writer out = response.getWriter();\r
-if (scriptTag) {\r
-    out.write(cb + "(");\r
-}\r
-out.print(dataBlock.toJsonString());\r
-if (scriptTag) {\r
-    out.write(");");\r
-}\r
-</code></pre>\r
- *\r
- * @constructor\r
- * @param {Object} config A configuration object.\r
- */\r
-Ext.data.ScriptTagProxy = function(config){\r
-    Ext.apply(this, config);\r
 \r
-    Ext.data.ScriptTagProxy.superclass.constructor.call(this, config);\r
+    // private\r
+    focus : function(){\r
+        this.focusEl.focus(10);\r
+    },\r
 \r
-    this.head = document.getElementsByTagName("head")[0];\r
+    // private\r
+    onBeforeDragStart : function(e){\r
+        return !this.disabled;\r
+    },\r
 \r
-    /**\r
-     * @event loadexception\r
-     * <b>Deprecated</b> in favor of 'exception' event.\r
-     * Fires if an exception occurs in the Proxy during data loading.  This event can be fired for one of two reasons:\r
-     * <ul><li><b>The load call timed out.</b>  This means the load callback did not execute within the time limit\r
-     * specified by {@link #timeout}.  In this case, this event will be raised and the\r
-     * fourth parameter (read error) will be null.</li>\r
-     * <li><b>The load succeeded but the reader could not read the response.</b>  This means the server returned\r
-     * data, but the configured Reader threw an error while reading the data.  In this case, this event will be\r
-     * raised and the caught error will be passed along as the fourth parameter of this event.</li></ul>\r
-     * Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly\r
-     * on any Store instance.\r
-     * @param {Object} this\r
-     * @param {Object} options The loading options that were specified (see {@link #load} for details).  If the load\r
-     * call timed out, this parameter will be null.\r
-     * @param {Object} arg The callback's arg object passed to the {@link #load} function\r
-     * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data.\r
-     * If the remote request returns success: false, this parameter will be null.\r
-     */\r
-};\r
+    // private\r
+    onDragStart: function(e){\r
+        this.thumb.addClass('x-slider-thumb-drag');\r
+        this.dragging = true;\r
+        this.dragStartValue = this.value;\r
+        this.fireEvent('dragstart', this, e);\r
+    },\r
 \r
-Ext.data.ScriptTagProxy.TRANS_ID = 1000;\r
+    // private\r
+    onDrag: function(e){\r
+        var pos = this.innerEl.translatePoints(this.tracker.getXY());\r
+        this.setValue(Ext.util.Format.round(this.reverseValue(pos.left), this.decimalPrecision), false);\r
+        this.fireEvent('drag', this, e);\r
+    },\r
 \r
-Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {\r
-    /**\r
-     * @cfg {String} url The URL from which to request the data object.\r
-     */\r
-    /**\r
-     * @cfg {Number} timeout (optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.\r
-     */\r
-    timeout : 30000,\r
-    /**\r
-     * @cfg {String} callbackParam (Optional) The name of the parameter to pass to the server which tells\r
-     * the server the name of the callback function set up by the load call to process the returned data object.\r
-     * Defaults to "callback".<p>The server-side processing must read this parameter value, and generate\r
-     * javascript output which calls this named function passing the data object as its only parameter.\r
-     */\r
-    callbackParam : "callback",\r
-    /**\r
-     *  @cfg {Boolean} nocache (optional) Defaults to true. Disable caching by adding a unique parameter\r
-     * name to the request.\r
-     */\r
-    nocache : true,\r
+    // private\r
+    onDragEnd: function(e){\r
+        this.thumb.removeClass('x-slider-thumb-drag');\r
+        this.dragging = false;\r
+        this.fireEvent('dragend', this, e);\r
+        if(this.dragStartValue != this.value){\r
+            this.fireEvent('changecomplete', this, this.value);\r
+        }\r
+    },\r
 \r
-    /**\r
-     * HttpProxy implementation of DataProxy#doRequest\r
-     * @param {String} action\r
-     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is <tt>read</tt>, rs will be null\r
-     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
-     * for the request to the remote server.\r
-     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
-     * object into a block of Ext.data.Records.\r
-     * @param {Function} callback The function into which to pass the block of Ext.data.Records.\r
-     * The function must be passed <ul>\r
-     * <li>The Record block object</li>\r
-     * <li>The "arg" argument from the load function</li>\r
-     * <li>A boolean success indicator</li>\r
-     * </ul>\r
-     * @param {Object} scope The scope in which to call the callback\r
-     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
-     */\r
-    doRequest : function(action, rs, params, reader, callback, scope, arg) {\r
-        var p = Ext.urlEncode(Ext.apply(params, this.extraParams));\r
+    // private\r
+    onResize : function(w, h){\r
+        this.innerEl.setWidth(w - (this.el.getPadding('l') + this.endEl.getPadding('r')));\r
+        this.syncThumb();\r
+        Ext.Slider.superclass.onResize.apply(this, arguments);\r
+    },\r
 \r
-        var url = this.buildUrl(action, rs);\r
-        if (!url) {\r
-            throw new Ext.data.Api.Error('invalid-url', url);\r
+    //private\r
+    onDisable: function(){\r
+        Ext.Slider.superclass.onDisable.call(this);\r
+        this.thumb.addClass(this.disabledClass);\r
+        if(Ext.isIE){\r
+            //IE breaks when using overflow visible and opacity other than 1.\r
+            //Create a place holder for the thumb and display it.\r
+            var xy = this.thumb.getXY();\r
+            this.thumb.hide();\r
+            this.innerEl.addClass(this.disabledClass).dom.disabled = true;\r
+            if (!this.thumbHolder){\r
+                this.thumbHolder = this.endEl.createChild({cls: 'x-slider-thumb ' + this.disabledClass});\r
+            }\r
+            this.thumbHolder.show().setXY(xy);\r
         }\r
-        url = Ext.urlAppend(url, p);\r
+    },\r
 \r
-        if(this.nocache){\r
-            url = Ext.urlAppend(url, '_dc=' + (new Date().getTime()));\r
+    //private\r
+    onEnable: function(){\r
+        Ext.Slider.superclass.onEnable.call(this);\r
+        this.thumb.removeClass(this.disabledClass);\r
+        if(Ext.isIE){\r
+            this.innerEl.removeClass(this.disabledClass).dom.disabled = false;\r
+            if(this.thumbHolder){\r
+                this.thumbHolder.hide();\r
+            }\r
+            this.thumb.show();\r
+            this.syncThumb();\r
         }\r
-        var transId = ++Ext.data.ScriptTagProxy.TRANS_ID;\r
-        var trans = {\r
-            id : transId,\r
-            action: action,\r
-            cb : "stcCallback"+transId,\r
-            scriptId : "stcScript"+transId,\r
-            params : params,\r
-            arg : arg,\r
-            url : url,\r
-            callback : callback,\r
-            scope : scope,\r
-            reader : reader\r
-        };\r
-        window[trans.cb] = this.createCallback(action, rs, trans);\r
-        url += String.format("&{0}={1}", this.callbackParam, trans.cb);\r
-        if(this.autoAbort !== false){\r
-            this.abort();\r
+    },\r
+\r
+    /**\r
+     * Synchronizes the thumb position to the proper proportion of the total component width based\r
+     * on the current slider {@link #value}.  This will be called automatically when the Slider\r
+     * is resized by a layout, but if it is rendered auto width, this method can be called from\r
+     * another resize handler to sync the Slider if necessary.\r
+     */\r
+    syncThumb : function(){\r
+        if(this.rendered){\r
+            this.moveThumb(this.translateValue(this.value));\r
         }\r
+    },\r
 \r
-        trans.timeoutId = this.handleFailure.defer(this.timeout, this, [trans]);\r
+    /**\r
+     * Returns the current value of the slider\r
+     * @return {Number} The current value of the slider\r
+     */\r
+    getValue : function(){\r
+        return this.value;\r
+    },\r
 \r
-        var script = document.createElement("script");\r
-        script.setAttribute("src", url);\r
-        script.setAttribute("type", "text/javascript");\r
-        script.setAttribute("id", trans.scriptId);\r
-        this.head.appendChild(script);\r
+    // private\r
+    beforeDestroy : function(){\r
+        Ext.destroyMembers(this, 'endEl', 'innerEl', 'thumb', 'halfThumb', 'focusEl', 'tracker', 'thumbHolder');\r
+        Ext.Slider.superclass.beforeDestroy.call(this);\r
+    }\r
+});\r
+Ext.reg('slider', Ext.Slider);\r
 \r
-        this.trans = trans;\r
+// private class to support vertical sliders\r
+Ext.Slider.Vertical = {\r
+    onResize : function(w, h){\r
+        this.innerEl.setHeight(h - (this.el.getPadding('t') + this.endEl.getPadding('b')));\r
+        this.syncThumb();\r
     },\r
 \r
-    // @private createCallback\r
-    createCallback : function(action, rs, trans) {\r
-        var self = this;\r
-        return function(res) {\r
-            self.trans = false;\r
-            self.destroyTrans(trans, true);\r
-            if (action === Ext.data.Api.actions.read) {\r
-                self.onRead.call(self, action, trans, res);\r
-            } else {\r
-                self.onWrite.call(self, action, trans, res, rs);\r
-            }\r
-        };\r
+    getRatio : function(){\r
+        var h = this.innerEl.getHeight(),\r
+            v = this.maxValue - this.minValue;\r
+        return h/v;\r
     },\r
-    /**\r
-     * Callback for read actions\r
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
-     * @param {Object} trans The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
-     */\r
-    onRead : function(action, trans, res) {\r
-        var result;\r
-        try {\r
-            result = trans.reader.readRecords(res);\r
-        }catch(e){\r
-            // @deprecated: fire loadexception\r
-            this.fireEvent("loadexception", this, trans, res, e);\r
 \r
-            this.fireEvent('exception', this, 'response', action, trans, res, e);\r
-            trans.callback.call(trans.scope||window, null, trans.arg, false);\r
-            return;\r
+    moveThumb: function(v, animate){\r
+        if(!animate || this.animate === false){\r
+            this.thumb.setBottom(v);\r
+        }else{\r
+            this.thumb.shift({bottom: v, stopFx: true, duration:.35});\r
         }\r
-        if (result.success === false) {\r
-            // @deprecated: fire old loadexception for backwards-compat.\r
-            this.fireEvent('loadexception', this, trans, res);\r
+    },\r
 \r
-            this.fireEvent('exception', this, 'remote', action, trans, res, null);\r
-        } else {\r
-            this.fireEvent("load", this, res, trans.arg);\r
-        }\r
-        trans.callback.call(trans.scope||window, result, trans.arg, result.success);\r
+    onDrag: function(e){\r
+        var pos = this.innerEl.translatePoints(this.tracker.getXY()),\r
+            bottom = this.innerEl.getHeight()-pos.top;\r
+        this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), false);\r
+        this.fireEvent('drag', this, e);\r
     },\r
-    /**\r
-     * Callback for write actions\r
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
-     * @param {Object} trans The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
-     */\r
-    onWrite : function(action, trans, res, rs) {\r
-        var reader = trans.reader;\r
-        try {\r
-            // though we already have a response object here in STP, run through readResponse to catch any meta-data exceptions.\r
-            reader.readResponse(action, res);\r
-        } catch (e) {\r
-            this.fireEvent('exception', this, 'response', action, trans, res, e);\r
-            trans.callback.call(trans.scope||window, null, res, false);\r
-            return;\r
-        }\r
-        if(!res[reader.meta.successProperty] === true){\r
-            this.fireEvent('exception', this, 'remote', action, trans, res, rs);\r
-            trans.callback.call(trans.scope||window, null, res, false);\r
-            return;\r
+\r
+    onClickChange : function(local){\r
+        if(local.left > this.clickRange[0] && local.left < this.clickRange[1]){\r
+            var bottom = this.innerEl.getHeight() - local.top;\r
+            this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), undefined, true);\r
         }\r
-        this.fireEvent("write", this, action, res[reader.meta.root], res, rs, trans.arg );\r
-        trans.callback.call(trans.scope||window, res[reader.meta.root], res, true);\r
+    }\r
+};/**\r
+ * @class Ext.ProgressBar\r
+ * @extends Ext.BoxComponent\r
+ * <p>An updateable progress bar component.  The progress bar supports two different modes: manual and automatic.</p>\r
+ * <p>In manual mode, you are responsible for showing, updating (via {@link #updateProgress}) and clearing the\r
+ * progress bar as needed from your own code.  This method is most appropriate when you want to show progress\r
+ * throughout an operation that has predictable points of interest at which you can update the control.</p>\r
+ * <p>In automatic mode, you simply call {@link #wait} and let the progress bar run indefinitely, only clearing it\r
+ * once the operation is complete.  You can optionally have the progress bar wait for a specific amount of time\r
+ * and then clear itself.  Automatic mode is most appropriate for timed operations or asynchronous operations in\r
+ * which you have no need for indicating intermediate progress.</p>\r
+ * @cfg {Float} value A floating point value between 0 and 1 (e.g., .5, defaults to 0)\r
+ * @cfg {String} text The progress bar text (defaults to '')\r
+ * @cfg {Mixed} textEl The element to render the progress text to (defaults to the progress\r
+ * bar's internal text element)\r
+ * @cfg {String} id The progress bar element's id (defaults to an auto-generated id)\r
+ * @xtype progress\r
+ */\r
+Ext.ProgressBar = Ext.extend(Ext.BoxComponent, {\r
+   /**\r
+    * @cfg {String} baseCls\r
+    * The base CSS class to apply to the progress bar's wrapper element (defaults to 'x-progress')\r
+    */\r
+    baseCls : 'x-progress',\r
+    \r
+    /**\r
+    * @cfg {Boolean} animate\r
+    * True to animate the progress bar during transitions (defaults to false)\r
+    */\r
+    animate : false,\r
+\r
+    // private\r
+    waitTimer : null,\r
+\r
+    // private\r
+    initComponent : function(){\r
+        Ext.ProgressBar.superclass.initComponent.call(this);\r
+        this.addEvents(\r
+            /**\r
+             * @event update\r
+             * Fires after each update interval\r
+             * @param {Ext.ProgressBar} this\r
+             * @param {Number} The current progress value\r
+             * @param {String} The current progress text\r
+             */\r
+            "update"\r
+        );\r
     },\r
 \r
     // private\r
-    isLoading : function(){\r
-        return this.trans ? true : false;\r
-    },\r
+    onRender : function(ct, position){\r
+        var tpl = new Ext.Template(\r
+            '<div class="{cls}-wrap">',\r
+                '<div class="{cls}-inner">',\r
+                    '<div class="{cls}-bar">',\r
+                        '<div class="{cls}-text">',\r
+                            '<div>&#160;</div>',\r
+                        '</div>',\r
+                    '</div>',\r
+                    '<div class="{cls}-text {cls}-text-back">',\r
+                        '<div>&#160;</div>',\r
+                    '</div>',\r
+                '</div>',\r
+            '</div>'\r
+        );\r
 \r
-    /**\r
-     * Abort the current server request.\r
-     */\r
-    abort : function(){\r
-        if(this.isLoading()){\r
-            this.destroyTrans(this.trans);\r
+        this.el = position ? tpl.insertBefore(position, {cls: this.baseCls}, true)\r
+               : tpl.append(ct, {cls: this.baseCls}, true);\r
+                       \r
+        if(this.id){\r
+            this.el.dom.id = this.id;\r
         }\r
-    },\r
+        var inner = this.el.dom.firstChild;\r
+        this.progressBar = Ext.get(inner.firstChild);\r
 \r
-    // private\r
-    destroyTrans : function(trans, isLoaded){\r
-        this.head.removeChild(document.getElementById(trans.scriptId));\r
-        clearTimeout(trans.timeoutId);\r
-        if(isLoaded){\r
-            window[trans.cb] = undefined;\r
-            try{\r
-                delete window[trans.cb];\r
-            }catch(e){}\r
+        if(this.textEl){\r
+            //use an external text el\r
+            this.textEl = Ext.get(this.textEl);\r
+            delete this.textTopEl;\r
         }else{\r
-            // if hasn't been loaded, wait for load to remove it to prevent script error\r
-            window[trans.cb] = function(){\r
-                window[trans.cb] = undefined;\r
-                try{\r
-                    delete window[trans.cb];\r
-                }catch(e){}\r
-            };\r
+            //setup our internal layered text els\r
+            this.textTopEl = Ext.get(this.progressBar.dom.firstChild);\r
+            var textBackEl = Ext.get(inner.childNodes[1]);\r
+            this.textTopEl.setStyle("z-index", 99).addClass('x-hidden');\r
+            this.textEl = new Ext.CompositeElement([this.textTopEl.dom.firstChild, textBackEl.dom.firstChild]);\r
+            this.textEl.setWidth(inner.offsetWidth);\r
         }\r
+        this.progressBar.setHeight(inner.offsetHeight);\r
     },\r
-\r
+    \r
     // private\r
-    handleFailure : function(trans){\r
-        this.trans = false;\r
-        this.destroyTrans(trans, false);\r
-        if (trans.action === Ext.data.Api.actions.read) {\r
-            // @deprecated firing loadexception\r
-            this.fireEvent("loadexception", this, null, trans.arg);\r
+    afterRender : function(){\r
+        Ext.ProgressBar.superclass.afterRender.call(this);\r
+        if(this.value){\r
+            this.updateProgress(this.value, this.text);\r
+        }else{\r
+            this.updateText(this.text);\r
         }\r
-\r
-        this.fireEvent('exception', this, 'response', trans.action, {\r
-            response: null,\r
-            options: trans.arg\r
-        });\r
-        trans.callback.call(trans.scope||window, null, trans.arg, false);\r
     },\r
 \r
-    // inherit docs\r
-    destroy: function(){\r
-        this.abort();\r
-        Ext.data.ScriptTagProxy.superclass.destroy.call(this);\r
-    }\r
-});/**\r
- * @class Ext.data.HttpProxy\r
- * @extends Ext.data.DataProxy\r
- * <p>An implementation of {@link Ext.data.DataProxy} that processes data requests within the same\r
- * domain of the originating page.</p>\r
- * <p><b>Note</b>: this class cannot be used to retrieve data from a domain other\r
- * than the domain from which the running page was served. For cross-domain requests, use a\r
- * {@link Ext.data.ScriptTagProxy ScriptTagProxy}.</p>\r
- * <p>Be aware that to enable the browser to parse an XML document, the server must set\r
- * the Content-Type header in the HTTP response to "<tt>text/xml</tt>".</p>\r
- * @constructor\r
- * @param {Object} conn\r
- * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.\r
- * <p>Note that if this HttpProxy is being used by a (@link Ext.data.Store Store}, then the\r
- * Store's call to {@link #load} will override any specified <tt>callback</tt> and <tt>params</tt>\r
- * options. In this case, use the Store's {@link Ext.data.Store#events events} to modify parameters,\r
- * or react to loading events. The Store's {@link Ext.data.Store#baseParams baseParams} may also be\r
- * used to pass parameters known at instantiation time.</p>\r
- * <p>If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make\r
- * the request.</p>\r
- */\r
-Ext.data.HttpProxy = function(conn){\r
-    Ext.data.HttpProxy.superclass.constructor.call(this, conn);\r
-\r
     /**\r
-     * The Connection object (Or options parameter to {@link Ext.Ajax#request}) which this HttpProxy\r
-     * uses to make requests to the server. Properties of this object may be changed dynamically to\r
-     * change the way data is requested.\r
-     * @property\r
+     * Updates the progress bar value, and optionally its text.  If the text argument is not specified,\r
+     * any existing text value will be unchanged.  To blank out existing text, pass ''.  Note that even\r
+     * if the progress bar value exceeds 1, it will never automatically reset -- you are responsible for\r
+     * determining when the progress is complete and calling {@link #reset} to clear and/or hide the control.\r
+     * @param {Float} value (optional) A floating point value between 0 and 1 (e.g., .5, defaults to 0)\r
+     * @param {String} text (optional) The string to display in the progress text element (defaults to '')\r
+     * @param {Boolean} animate (optional) Whether to animate the transition of the progress bar. If this value is\r
+     * not specified, the default for the class is used (default to false)\r
+     * @return {Ext.ProgressBar} this\r
      */\r
-    this.conn = conn;\r
-\r
-    // nullify the connection url.  The url param has been copied to 'this' above.  The connection\r
-    // url will be set during each execution of doRequest when buildUrl is called.  This makes it easier for users to override the\r
-    // connection url during beforeaction events (ie: beforeload, beforesave, etc).  The connection url will be nullified\r
-    // after each request as well.  Url is always re-defined during doRequest.\r
-    this.conn.url = null;\r
-\r
-    this.useAjax = !conn || !conn.events;\r
-\r
-    //private.  A hash containing active requests, keyed on action [Ext.data.Api.actions.create|read|update|destroy]\r
-    var actions = Ext.data.Api.actions;\r
-    this.activeRequest = {};\r
-    for (var verb in actions) {\r
-        this.activeRequest[actions[verb]] = undefined;\r
-    }\r
-};\r
+    updateProgress : function(value, text, animate){\r
+        this.value = value || 0;\r
+        if(text){\r
+            this.updateText(text);\r
+        }\r
+        if(this.rendered && !this.isDestroyed){\r
+            var w = Math.floor(value*this.el.dom.firstChild.offsetWidth);\r
+            this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));\r
+            if(this.textTopEl){\r
+                //textTopEl should be the same width as the bar so overflow will clip as the bar moves\r
+                this.textTopEl.removeClass('x-hidden').setWidth(w);\r
+            }\r
+        }\r
+        this.fireEvent('update', this, value, text);\r
+        return this;\r
+    },\r
 \r
-Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {\r
     /**\r
-     * @cfg {Boolean} restful\r
-     * <p>If set to <tt>true</tt>, a {@link Ext.data.Record#phantom non-phantom} record's\r
-     * {@link Ext.data.Record#id id} will be appended to the url (defaults to <tt>false</tt>).</p><br>\r
-     * <p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>\r
-     * using the commensurate <tt>{@link #api}</tt> property, or if undefined default to the\r
-     * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.</p><br>\r
-     * <p>Some MVC (e.g., Ruby on Rails, Merb and Django) support this style of segment based urls\r
-     * where the segments in the URL follow the Model-View-Controller approach.</p><pre><code>\r
-     * someSite.com/controller/action/id\r
-     * </code></pre>\r
-     * Where the segments in the url are typically:<div class="mdetail-params"><ul>\r
-     * <li>The first segment : represents the controller class that should be invoked.</li>\r
-     * <li>The second segment : represents the class function, or method, that should be called.</li>\r
-     * <li>The third segment : represents the ID (a variable typically passed to the method).</li>\r
-     * </ul></div></p>\r
-     * <p>For example:</p>\r
-     * <pre><code>\r
-api: {\r
-    load :    '/controller/load',\r
-    create :  '/controller/new',  // Server MUST return idProperty of new record\r
-    save :    '/controller/update',\r
-    destroy : '/controller/destroy_action'\r
-}\r
+     * Initiates an auto-updating progress bar.  A duration can be specified, in which case the progress\r
+     * bar will automatically reset after a fixed amount of time and optionally call a callback function\r
+     * if specified.  If no duration is passed in, then the progress bar will run indefinitely and must\r
+     * be manually cleared by calling {@link #reset}.  The wait method accepts a config object with\r
+     * the following properties:\r
+     * <pre>\r
+Property   Type          Description\r
+---------- ------------  ----------------------------------------------------------------------\r
+duration   Number        The length of time in milliseconds that the progress bar should\r
+                         run before resetting itself (defaults to undefined, in which case it\r
+                         will run indefinitely until reset is called)\r
+interval   Number        The length of time in milliseconds between each progress update\r
+                         (defaults to 1000 ms)\r
+animate    Boolean       Whether to animate the transition of the progress bar. If this value is\r
+                         not specified, the default for the class is used.                                                   \r
+increment  Number        The number of progress update segments to display within the progress\r
+                         bar (defaults to 10).  If the bar reaches the end and is still\r
+                         updating, it will automatically wrap back to the beginning.\r
+text       String        Optional text to display in the progress bar element (defaults to '').\r
+fn         Function      A callback function to execute after the progress bar finishes auto-\r
+                         updating.  The function will be called with no arguments.  This function\r
+                         will be ignored if duration is not specified since in that case the\r
+                         progress bar can only be stopped programmatically, so any required function\r
+                         should be called by the same code after it resets the progress bar.\r
+scope      Object        The scope that is passed to the callback function (only applies when\r
+                         duration and fn are both passed).\r
+</pre>\r
+         *\r
+         * Example usage:\r
+         * <pre><code>\r
+var p = new Ext.ProgressBar({\r
+   renderTo: 'my-el'\r
+});\r
 \r
-// Alternatively, one can use the object-form to specify each API-action\r
-api: {\r
-    load: {url: 'read.php', method: 'GET'},\r
-    create: 'create.php',\r
-    destroy: 'destroy.php',\r
-    save: 'update.php'\r
-}\r
+//Wait for 5 seconds, then update the status el (progress bar will auto-reset)\r
+p.wait({\r
+   interval: 100, //bar will move fast!\r
+   duration: 5000,\r
+   increment: 15,\r
+   text: 'Updating...',\r
+   scope: this,\r
+   fn: function(){\r
+      Ext.fly('status').update('Done!');\r
+   }\r
+});\r
+\r
+//Or update indefinitely until some async action completes, then reset manually\r
+p.wait();\r
+myAction.on('complete', function(){\r
+    p.reset();\r
+    Ext.fly('status').update('Done!');\r
+});\r
+</code></pre>\r
+     * @param {Object} config (optional) Configuration options\r
+     * @return {Ext.ProgressBar} this\r
      */\r
+    wait : function(o){\r
+        if(!this.waitTimer){\r
+            var scope = this;\r
+            o = o || {};\r
+            this.updateText(o.text);\r
+            this.waitTimer = Ext.TaskMgr.start({\r
+                run: function(i){\r
+                    var inc = o.increment || 10;\r
+                    i -= 1;\r
+                    this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01, null, o.animate);\r
+                },\r
+                interval: o.interval || 1000,\r
+                duration: o.duration,\r
+                onStop: function(){\r
+                    if(o.fn){\r
+                        o.fn.apply(o.scope || this);\r
+                    }\r
+                    this.reset();\r
+                },\r
+                scope: scope\r
+            });\r
+        }\r
+        return this;\r
+    },\r
 \r
     /**\r
-     * Return the {@link Ext.data.Connection} object being used by this Proxy.\r
-     * @return {Connection} The Connection object. This object may be used to subscribe to events on\r
-     * a finer-grained basis than the DataProxy events.\r
+     * Returns true if the progress bar is currently in a {@link #wait} operation\r
+     * @return {Boolean} True if waiting, else false\r
      */\r
-    getConnection : function() {\r
-        return this.useAjax ? Ext.Ajax : this.conn;\r
+    isWaiting : function(){\r
+        return this.waitTimer !== null;\r
     },\r
 \r
     /**\r
-     * Used for overriding the url used for a single request.  Designed to be called during a beforeaction event.  Calling setUrl\r
-     * will override any urls set via the api configuration parameter.  Set the optional parameter makePermanent to set the url for\r
-     * all subsequent requests.  If not set to makePermanent, the next request will use the same url or api configuration defined\r
-     * in the initial proxy configuration.\r
-     * @param {String} url\r
-     * @param {Boolean} makePermanent (Optional) [false]\r
-     *\r
-     * (e.g.: beforeload, beforesave, etc).\r
+     * Updates the progress bar text.  If specified, textEl will be updated, otherwise the progress\r
+     * bar itself will display the updated text.\r
+     * @param {String} text (optional) The string to display in the progress text element (defaults to '')\r
+     * @return {Ext.ProgressBar} this\r
      */\r
-    setUrl : function(url, makePermanent) {\r
-        this.conn.url = url;\r
-        if (makePermanent === true) {\r
-            this.url = url;\r
-            Ext.data.Api.prepare(this);\r
+    updateText : function(text){\r
+        this.text = text || '&#160;';\r
+        if(this.rendered){\r
+            this.textEl.update(this.text);\r
         }\r
+        return this;\r
     },\r
-\r
+    \r
     /**\r
-     * HttpProxy implementation of DataProxy#doRequest\r
-     * @param {String} action The crud action type (create, read, update, destroy)\r
-     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null\r
-     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
-     * for the request to the remote server.\r
-     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
-     * object into a block of Ext.data.Records.\r
-     * @param {Function} callback\r
-     * <div class="sub-desc"><p>A function to be called after the request.\r
-     * The <tt>callback</tt> is passed the following arguments:<ul>\r
-     * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>\r
-     * <li><tt>options</tt>: Options object from the action request</li>\r
-     * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>\r
-     * @param {Object} scope The scope in which to call the callback\r
-     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
+     * Synchronizes the inner bar width to the proper proportion of the total componet width based\r
+     * on the current progress {@link #value}.  This will be called automatically when the ProgressBar\r
+     * is resized by a layout, but if it is rendered auto width, this method can be called from\r
+     * another resize handler to sync the ProgressBar if necessary.\r
      */\r
-    doRequest : function(action, rs, params, reader, cb, scope, arg) {\r
-        var  o = {\r
-            method: (this.api[action]) ? this.api[action]['method'] : undefined,\r
-            request: {\r
-                callback : cb,\r
-                scope : scope,\r
-                arg : arg\r
-            },\r
-            reader: reader,\r
-            callback : this.createCallback(action, rs),\r
-            scope: this\r
-        };\r
-        // Sample the request data:  If it's an object, then it hasn't been json-encoded yet.\r
-        // Transmit data using jsonData config of Ext.Ajax.request\r
-        if (typeof(params[reader.meta.root]) === 'object') {\r
-            o.jsonData = params;\r
-        } else {\r
-            o.params = params || {};\r
-        }\r
-        // Set the connection url.  If this.conn.url is not null here,\r
-        // the user may have overridden the url during a beforeaction event-handler.\r
-        // this.conn.url is nullified after each request.\r
-        if (this.conn.url === null) {\r
-            this.conn.url = this.buildUrl(action, rs);\r
-        }\r
-        else if (this.restful === true && rs instanceof Ext.data.Record && !rs.phantom) {\r
-            this.conn.url += '/' + rs.id;\r
-        }\r
-        if(this.useAjax){\r
-\r
-            Ext.applyIf(o, this.conn);\r
-\r
-            // If a currently running request is found for this action, abort it.\r
-            if (this.activeRequest[action]) {\r
-                // Disabled aborting activeRequest while implementing REST.  activeRequest[action] will have to become an array\r
-                //Ext.Ajax.abort(this.activeRequest[action]);\r
-            }\r
-            this.activeRequest[action] = Ext.Ajax.request(o);\r
-        }else{\r
-            this.conn.request(o);\r
+    syncProgressBar : function(){\r
+        if(this.value){\r
+            this.updateProgress(this.value, this.text);\r
         }\r
-        // request is sent, nullify the connection url in preparation for the next request\r
-        this.conn.url = null;\r
+        return this;\r
     },\r
 \r
     /**\r
-     * Returns a callback function for a request.  Note a special case is made for the\r
-     * read action vs all the others.\r
-     * @param {String} action [create|update|delete|load]\r
-     * @param {Ext.data.Record[]} rs The Store-recordset being acted upon\r
-     * @private\r
+     * Sets the size of the progress bar.\r
+     * @param {Number} width The new width in pixels\r
+     * @param {Number} height The new height in pixels\r
+     * @return {Ext.ProgressBar} this\r
      */\r
-    createCallback : function(action, rs) {\r
-        return function(o, success, response) {\r
-            this.activeRequest[action] = undefined;\r
-            if (!success) {\r
-                if (action === Ext.data.Api.actions.read) {\r
-                    // @deprecated: fire loadexception for backwards compat.\r
-                    this.fireEvent('loadexception', this, o, response);\r
-                }\r
-                this.fireEvent('exception', this, 'response', action, o, response);\r
-                o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
-                return;\r
-            }\r
-            if (action === Ext.data.Api.actions.read) {\r
-                this.onRead(action, o, response);\r
-            } else {\r
-                this.onWrite(action, o, response, rs);\r
-            }\r
+    setSize : function(w, h){\r
+        Ext.ProgressBar.superclass.setSize.call(this, w, h);\r
+        if(this.textTopEl){\r
+            var inner = this.el.dom.firstChild;\r
+            this.textEl.setSize(inner.offsetWidth, inner.offsetHeight);\r
         }\r
+        this.syncProgressBar();\r
+        return this;\r
     },\r
 \r
     /**\r
-     * Callback for read action\r
-     * @param {String} action Action name as per {@link Ext.data.Api.actions#read}.\r
-     * @param {Object} o The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
+     * Resets the progress bar value to 0 and text to empty string.  If hide = true, the progress\r
+     * bar will also be hidden (using the {@link #hideMode} property internally).\r
+     * @param {Boolean} hide (optional) True to hide the progress bar (defaults to false)\r
+     * @return {Ext.ProgressBar} this\r
      */\r
-    onRead : function(action, o, response) {\r
-        var result;\r
-        try {\r
-            result = o.reader.read(response);\r
-        }catch(e){\r
-            // @deprecated: fire old loadexception for backwards-compat.\r
-            this.fireEvent('loadexception', this, o, response, e);\r
-            this.fireEvent('exception', this, 'response', action, o, response, e);\r
-            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
-            return;\r
-        }\r
-        if (result.success === false) {\r
-            // @deprecated: fire old loadexception for backwards-compat.\r
-            this.fireEvent('loadexception', this, o, response);\r
-\r
-            // Get DataReader read-back a response-object to pass along to exception event\r
-            var res = o.reader.readResponse(action, response);\r
-            this.fireEvent('exception', this, 'remote', action, o, res, null);\r
+    reset : function(hide){\r
+        this.updateProgress(0);\r
+        if(this.textTopEl){\r
+            this.textTopEl.addClass('x-hidden');\r
         }\r
-        else {\r
-            this.fireEvent('load', this, o, o.request.arg);\r
+        this.clearTimer();\r
+        if(hide === true){\r
+            this.hide();\r
         }\r
-        o.request.callback.call(o.request.scope, result, o.request.arg, result.success);\r
+        return this;\r
     },\r
-    /**\r
-     * Callback for write actions\r
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
-     * @param {Object} trans The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
-     */\r
-    onWrite : function(action, o, response, rs) {\r
-        var reader = o.reader;\r
-        var res;\r
-        try {\r
-            res = reader.readResponse(action, response);\r
-        } catch (e) {\r
-            this.fireEvent('exception', this, 'response', action, o, response, e);\r
-            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
-            return;\r
-        }\r
-        if (res[reader.meta.successProperty] === false) {\r
-            this.fireEvent('exception', this, 'remote', action, o, res, rs);\r
-        } else {\r
-            this.fireEvent('write', this, action, res[reader.meta.root], res, rs, o.request.arg);\r
+    \r
+    // private\r
+    clearTimer : function(){\r
+        if(this.waitTimer){\r
+            this.waitTimer.onStop = null; //prevent recursion\r
+            Ext.TaskMgr.stop(this.waitTimer);\r
+            this.waitTimer = null;\r
         }\r
-        o.request.callback.call(o.request.scope, res[reader.meta.root], res, res[reader.meta.successProperty]);\r
     },\r
-\r
-    // inherit docs\r
-    destroy: function(){\r
-        if(!this.useAjax){\r
-            this.conn.abort();\r
-        }else if(this.activeRequest){\r
-            var actions = Ext.data.Api.actions;\r
-            for (var verb in actions) {\r
-                if(this.activeRequest[actions[verb]]){\r
-                    Ext.Ajax.abort(this.activeRequest[actions[verb]]);\r
-                }\r
+    \r
+    onDestroy: function(){\r
+        this.clearTimer();\r
+        if(this.rendered){\r
+            if(this.textEl.isComposite){\r
+                this.textEl.clear();\r
             }\r
+            Ext.destroyMembers(this, 'textEl', 'progressBar', 'textTopEl');\r
         }\r
-        Ext.data.HttpProxy.superclass.destroy.call(this);\r
-    }\r
-});/**\r
- * @class Ext.data.MemoryProxy\r
- * @extends Ext.data.DataProxy\r
- * An implementation of Ext.data.DataProxy that simply passes the data specified in its constructor\r
- * to the Reader when its load method is called.\r
- * @constructor\r
- * @param {Object} data The data object which the Reader uses to construct a block of Ext.data.Records.\r
- */\r
-Ext.data.MemoryProxy = function(data){\r
-    // Must define a dummy api with "read" action to satisfy DataProxy#doRequest and Ext.data.Api#prepare *before* calling super\r
-    var api = {};\r
-    api[Ext.data.Api.actions.read] = true;\r
-    Ext.data.MemoryProxy.superclass.constructor.call(this, {\r
-        api: api\r
-    });\r
-    this.data = data;\r
-};\r
-\r
-Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, {\r
-    /**\r
-     * @event loadexception\r
-     * Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed\r
-     * through {@link Ext.data.Store}, so you can listen for it directly on any Store instance.\r
-     * @param {Object} this\r
-     * @param {Object} arg The callback's arg object passed to the {@link #load} function\r
-     * @param {Object} null This parameter does not apply and will always be null for MemoryProxy\r
-     * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data\r
-     */\r
-\r
-       /**\r
-     * MemoryProxy implementation of DataProxy#doRequest\r
-     * @param {String} action\r
-     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null\r
-     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
-     * for the request to the remote server.\r
-     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
-     * object into a block of Ext.data.Records.\r
-     * @param {Function} callback The function into which to pass the block of Ext.data.Records.\r
-     * The function must be passed <ul>\r
-     * <li>The Record block object</li>\r
-     * <li>The "arg" argument from the load function</li>\r
-     * <li>A boolean success indicator</li>\r
-     * </ul>\r
-     * @param {Object} scope The scope in which to call the callback\r
-     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
-     */\r
-    doRequest : function(action, rs, params, reader, callback, scope, arg) {\r
-        // No implementation for CRUD in MemoryProxy.  Assumes all actions are 'load'\r
-        params = params || {};\r
-        var result;\r
-        try {\r
-            result = reader.readRecords(this.data);\r
-        }catch(e){\r
-            // @deprecated loadexception\r
-            this.fireEvent("loadexception", this, null, arg, e);\r
-\r
-            this.fireEvent('exception', this, 'response', action, arg, null, e);\r
-            callback.call(scope, null, arg, false);\r
-            return;\r
-        }\r
-        callback.call(scope, result, arg, true);\r
+        Ext.ProgressBar.superclass.onDestroy.call(this);\r
     }\r
-});/**
- * @class Ext.data.JsonWriter
- * @extends Ext.data.DataWriter
- * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action.
+});\r
+Ext.reg('progress', Ext.ProgressBar);/*
+ * These classes are derivatives of the similarly named classes in the YUI Library.
+ * The original license:
+ * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ */
+
+(function() {
+
+var Event=Ext.EventManager;
+var Dom=Ext.lib.Dom;
+
+/**
+ * @class Ext.dd.DragDrop
+ * 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 and 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 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 Ext.dd.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link Ext.dd.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 Ext.dd.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>
+ * @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
+ */
+Ext.dd.DragDrop = function(id, sGroup, config) {
+    if(id) {
+        this.init(id, sGroup, config);
+    }
+};
+
+Ext.dd.DragDrop.prototype = {
+
+    /**
+     * Set to false to enable a DragDrop object to fire drag events while dragging
+     * over its own Element. Defaults to true - DragDrop objects do not by default
+     * fire drag events to themselves.
+     * @property ignoreSelf
+     * @type Boolean
+     */
+
+    /**
+     * 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,
+
+    /**
+     * Configuration attributes passed into the constructor
+     * @property config
+     * @type object
+     */
+    config: null,
+
+    /**
+     * 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:
+     * Ext.dd.DDProxy
+     * @property dragElId
+     * @type String
+     * @private
+     */
+    dragElId: null,
+
+    /**
+     * 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,
+
+    /**
+     * An object who's property names identify HTML tags to be considered invalid as drag handles.
+     * A non-null property value identifies the tag as invalid. Defaults to the 
+     * following value which prevents drag operations from being initiated by &lt;a> elements:<pre><code>
+{
+    A: "A"
+}</code></pre>
+     * @property invalidHandleTypes
+     * @type Object
+     */
+    invalidHandleTypes: null,
+
+    /**
+     * An object who's property names identify the IDs of elements to be considered invalid as drag handles.
+     * A non-null property value identifies the ID as invalid. For example, to prevent
+     * dragging from being initiated on element ID "foo", use:<pre><code>
+{
+    foo: true
+}</code></pre>
+     * @property invalidHandleIds
+     * @type Object
+     */
+    invalidHandleIds: null,
+
+    /**
+     * An Array of CSS class names for elements to be considered in valid as drag handles.
+     * @property invalidHandleClasses
+     * @type Array
+     */
+    invalidHandleClasses: null,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     * @property startPageX
+     * @type int
+     * @private
+     */
+    startPageX: 0,
+
+    /**
+     * 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 object An object in the format {'group1':true, 'group2':true}
+     */
+    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; },
+
+    /**
+     * When set to true, other DD objects in cooperating DDGroups do not receive
+     * notification events when this DD object is dragged over them. Defaults to false.
+     * @property moveOnly
+     * @type boolean
+     */
+    moveOnly: false,
+
+    /**
+     * 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.
+     * @property isTarget
+     * @type boolean
+     */
+    isTarget: true,
+
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     * @property padding
+     * @type int[] An array containing the 4 padding values: [top, right, bottom, left]
+     */
+    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,
+
+    /**
+     * 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,
+
+    /**
+     * 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 */ },
+
+    /**
+     * Code executed immediately before the onMouseDown event
+     * @method b4MouseDown
+     * @param {Event} e the mousedown event
+     * @private
+     */
+    b4MouseDown: function(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 */ },
+
+    /**
+     * 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 () {
+    },
+
+    /**
+     * Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}).
+     * @type Object
+     */
+    defaultPadding : {left:0, right:0, top:0, bottom:0},
+
+    /**
+     * Initializes the drag drop object's constraints to restrict movement to a certain element.
+ *
+ * Usage:
+ <pre><code>
+ var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
+                { dragElId: "existingProxyDiv" });
+ dd.startDrag = function(){
+     this.constrainTo("parent-id");
+ };
+ </code></pre>
+ * Or you can initalize it using the {@link Ext.Element} object:
+ <pre><code>
+ Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
+     startDrag : function(){
+         this.constrainTo("parent-id");
+     }
+ });
+ </code></pre>
+     * @param {Mixed} constrainTo The element to constrain to.
+     * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
+     * and can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}) or
+     * an object containing the sides to pad. For example: {right:10, bottom:10}
+     * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders)
+     */
+    constrainTo : function(constrainTo, pad, inContent){
+        if(Ext.isNumber(pad)){
+            pad = {left: pad, right:pad, top:pad, bottom:pad};
+        }
+        pad = pad || this.defaultPadding;
+        var b = Ext.get(this.getEl()).getBox(),
+            ce = Ext.get(constrainTo),
+            s = ce.getScroll(),
+            c, 
+            cd = ce.dom;
+        if(cd == document.body){
+            c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()};
+        }else{
+            var xy = ce.getXY();
+            c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight};
+        }
+
+
+        var topSpace = b.y - c.y,
+            leftSpace = b.x - c.x;
+
+        this.resetConstraints();
+        this.setXConstraint(leftSpace - (pad.left||0), // left
+                c.width - leftSpace - b.width - (pad.right||0), //right
+                               this.xTickSize
+        );
+        this.setYConstraint(topSpace - (pad.top||0), //top
+                c.height - topSpace - b.height - (pad.bottom||0), //bottom
+                               this.yTickSize
+        );
+    },
+
+    /**
+     * Returns a reference to the linked element
+     * @method getEl
+     * @return {HTMLElement} the html element
+     */
+    getEl: function() {
+        if (!this._domRef) {
+            this._domRef = Ext.getDom(this.id);
+        }
+
+        return this._domRef;
+    },
+
+    /**
+     * 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 Ext.dd.DDProxy
+     * @method getDragEl
+     * @return {HTMLElement} the html element
+     */
+    getDragEl: function() {
+        return Ext.getDom(this.dragElId);
+    },
+
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * Ext.dd.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);
+        // Event.on(this.id, "selectstart", Event.preventDefault);
+    },
+
+    /**
+     * 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) {
+
+        // configuration attributes
+        this.config = config || {};
+
+        // create a local reference to the drag and drop manager
+        this.DDM = Ext.dd.DDM;
+        // initialize the groups array
+        this.groups = {};
+
+        // assume that we have an element reference instead of an id if the
+        // parameter is not a string
+        if (typeof id !== "string") {
+            id = Ext.id(id);
+        }
+
+        // set the id
+        this.id = id;
+
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
+
+        // 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;
+
+        // the linked element is the element that gets dragged by default
+        this.setDragElId(id);
+
+        // by default, clicked anchors will not start drag operations.
+        this.invalidHandleTypes = { A: "A" };
+        this.invalidHandleIds = {};
+        this.invalidHandleClasses = [];
+
+        this.applyConfig();
+
+        this.handleOnAvailable();
+    },
+
+    /**
+     * 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);
+
+    },
+
+    /**
+     * 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 setInitPosition
+     * @param {int} diffX   the X offset, default 0
+     * @param {int} diffY   the Y offset, default 0
+     */
+    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);
+    },
+
+    /**
+     * 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() );
+        this.deltaSetXY = null;
+
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
+
+    /**
+     * 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);
+    },
+
+    /**
+     * 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);
+    },
+
+    /**
+     * 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") {
+            id = Ext.id(id);
+        }
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
+
+    /**
+     * 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 = Ext.id(id);
+        }
+        Event.on(id, "mousedown",
+                this.handleMouseDown, this);
+        this.setHandleElId(id);
+
+        this.hasOuterHandles = true;
+    },
+
+    /**
+     * Remove all drag and drop hooks for this element
+     * @method unreg
+     */
+    unreg: function() {
+        Event.un(this.id, "mousedown",
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
+
+    destroy : function(){
+        this.unreg();
+    },
+
+    /**
+     * 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);
+    },
+
+    /**
+     * Fired when this object is clicked
+     * @method handleMouseDown
+     * @param {Event} e
+     * @param {Ext.dd.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD){
+        if (this.primaryButtonOnly && e.button != 0) {
+            return;
+        }
+
+        if (this.isLocked()) {
+            return;
+        }
+
+        this.DDM.refreshCache(this.groups);
+
+        var pt = new Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.lib.Event.getPageY(e));
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
+        } else {
+            if (this.clickValidator(e)) {
+
+                // set the initial element position
+                this.setStartPosition();
+
+
+                this.b4MouseDown(e);
+                this.onMouseDown(e);
+
+                this.DDM.handleMouseDown(e, this);
+
+                this.DDM.stopEvent(e);
+            } else {
+
+
+            }
+        }
+    },
+
+    clickValidator: function(e) {
+        var target = e.getTarget();
+        return ( this.isValidHandleChild(target) &&
+                    (this.id == this.handleElId ||
+                        this.DDM.handleWasClicked(target, this.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;
+    },
+
+    /**
+     * 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 = Ext.id(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);
+    },
+
+    /**
+     * 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 = Ext.id(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];
+            }
+        }
+    },
+
+    /**
+     * 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];
+
+        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
+            valid = !Ext.fly(node).hasClass(this.invalidHandleClasses[i]);
+        }
+
+
+        return valid;
+
+    },
+
+    /**
+     * 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 = {};
+
+        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) ;
+    },
+
+    /**
+     * 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 = {};
+
+        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) ;
+    },
+
+    /**
+     * 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;
+
+        this.minX = this.initPageX - iLeft;
+        this.maxX = this.initPageX + iRight;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+
+        this.constrainX = true;
+    },
+
+    /**
+     * 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();
+    },
+
+    /**
+     * 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;
+
+        this.minY = this.initPageY - iUp;
+        this.maxY = this.initPageY + iDown;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+
+        this.constrainY = true;
+
+    },
+
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @method resetConstraints
+     * @param {boolean} maintainOffset
+     */
+    resetConstraints: function() {
+
+
+        // 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;
+
+            this.setInitPosition(dx, dy);
+
+        // This is the first time we have detected the element's position
+        } 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         );
+        }
+    },
+
+    /**
+     * 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];
+                }
+            }
+
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
+        }
+    },
+
+    /**
+     * 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.
+ */
+
+// Only load the library once.  Rewriting the manager class would orphan
+// existing drag and drop instances.
+if (!Ext.dd.DragDropMgr) {
+
+/**
+ * @class Ext.dd.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.
+ * @singleton
+ */
+Ext.dd.DragDropMgr = function() {
+
+    var Event = Ext.EventManager;
+
+    return {
+
+        /**
+         * 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: {},
+
+        /**
+         * 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 DragDrop object that is currently being dragged
+         * @property dragCurrent
+         * @type DragDrop
+         * @private
+         * @static
+         **/
+        dragCurrent: null,
+
+        /**
+         * the DragDrop object(s) that are being hovered over
+         * @property dragOvers
+         * @type Array
+         * @private
+         * @static
+         */
+        dragOvers: {},
+
+        /**
+         * the X distance between the cursor and the object being dragged
+         * @property deltaX
+         * @type int
+         * @private
+         * @static
+         */
+        deltaX: 0,
+
+        /**
+         * the Y distance between the cursor and the object being dragged
+         * @property deltaY
+         * @type int
+         * @private
+         * @static
+         */
+        deltaY: 0,
+
+        /**
+         * 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,
+
+        /**
+         * 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,
+
+        /**
+         * Internal flag that is set to true when drag and drop has been
+         * intialized
+         * @property initialized
+         * @private
+         * @static
+         */
+        initialized: false,
+
+        /**
+         * All drag and drop can be disabled.
+         * @property locked
+         * @private
+         * @static
+         */
+        locked: false,
+
+        /**
+         * Called the first time an element is registered.
+         * @method init
+         * @private
+         * @static
+         */
+        init: function() {
+            this.initialized = 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
+         */
+        POINT: 0,
+
+        /**
+         * In intersect mode, drag and drop interaction is defined by the
+         * overlap of two or more drag and drop objects.
+         * @property INTERSECT
+         * @type int
+         * @static
+         */
+        INTERSECT: 1,
+
+        /**
+         * The current drag and drop mode.  Default: POINT
+         * @property mode
+         * @type int
+         * @static
+         */
+        mode: 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);
+                }
+            }
+        },
+
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @method _onLoad
+         * @private
+         * @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);
+
+        },
+
+        /**
+         * Reset constraints on all drag and drop objs
+         * @method _onResize
+         * @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; },
+
+        /**
+         * 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: {},
+
+        /**
+         * 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,
+
+        /**
+         * 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,
+
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=350
+         * @property clickTimeThresh
+         * @type int
+         * @static
+         */
+        clickTimeThresh: 350,
+
+        /**
+         * 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,
+
+        /**
+         * 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;
+        },
+
+        /**
+         * 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 obj = this.ids[sGroup];
+            if (obj && obj[oDD.id]) {
+                delete obj[oDD.id];
+            }
+        },
+
+        /**
+         * 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] && this.ids[g][oDD.id]) {
+                    delete this.ids[g][oDD.id];
+                }
+            }
+            delete this.handleIds[oDD.id];
+        },
+
+        /**
+         * 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;
+        },
+
+        /**
+         * 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;
+        },
+
+        /**
+         * 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 (var j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
+
+            return oDDs;
+        },
+
+        /**
+         * 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 false;
+        },
+
+        /**
+         * 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) {
+            if(Ext.QuickTips){
+                Ext.QuickTips.disable();
+            }
+            if(this.dragCurrent){
+                // the original browser mouseup wasn't handled (e.g. outside FF browser window)
+                // so clean up first to avoid breaking the next drag
+                this.handleMouseUp(e);
+            }
+            
+            this.currentTarget = e.getTarget();
+            this.dragCurrent = oDD;
+
+            var el = oDD.getEl();
+
+            // track start position
+            this.startX = e.getPageX();
+            this.startY = e.getPageY();
+
+            this.deltaX = this.startX - el.offsetLeft;
+            this.deltaY = this.startY - el.offsetTop;
+
+            this.dragThreshMet = false;
+
+            this.clickTimeout = setTimeout(
+                    function() {
+                        var DDM = Ext.dd.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);
+            if (this.dragCurrent) {
+                this.dragCurrent.b4StartDrag(x, y);
+                this.dragCurrent.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        },
+
+        /**
+         * 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(Ext.QuickTips){
+                Ext.QuickTips.enable();
+            }
+            if (! this.dragCurrent) {
+                return;
+            }
+
+            clearTimeout(this.clickTimeout);
+
+            if (this.dragThreshMet) {
+                this.fireEvents(e, true);
+            } else {
+            }
+
+            this.stopDrag(e);
+
+            this.stopEvent(e);
+        },
+
+        /**
+         * 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) {
+                e.stopPropagation();
+            }
+
+            if (this.preventDefault) {
+                e.preventDefault();
+            }
+        },
+
+        /**
+         * 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) {
+            // 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);
+                }
+
+                this.dragCurrent.onMouseUp(e);
+            }
+
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        },
+
+        /**
+         * 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;
+            }
+            // var button = e.which || e.button;
+
+            // check for IE mouseup outside of page boundary
+            if (Ext.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) {
+                this.stopEvent(e);
+                return this.handleMouseUp(e);
+            }
+
+            if (!this.dragThreshMet) {
+                var diffX = Math.abs(this.startX - e.getPageX());
+                var diffY = Math.abs(this.startY - e.getPageY());
+                if (diffX > this.clickPixelThresh ||
+                            diffY > this.clickPixelThresh) {
+                    this.startDrag(this.startX, this.startY);
+                }
+            }
+
+            if (this.dragThreshMet) {
+                this.dragCurrent.b4Drag(e);
+                this.dragCurrent.onDrag(e);
+                if(!this.dragCurrent.moveOnly){
+                    this.fireEvents(e, false);
+                }
+            }
+
+            this.stopEvent(e);
+
+            return true;
+        },
+
+        /**
+         * 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;
+
+            // 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 pt = e.getPoint();
+
+            // cache the previous dragOver array
+            var oldOvers = [];
+
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
+
+            // 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) {
+
+                var ddo = this.dragOvers[i];
+
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
+
+                if (! this.isOverTarget(pt, ddo, this.mode)) {
+                    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) || (dc.ignoreSelf === false))) {
+                        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 {
+
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } 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 {
+                // 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);
+                }
+
+                // 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);
+            }
+
+        },
+
+        /**
+         * 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;
+            // Return null if the input is not what we expect
+            //if (!dds || !dds.length || dds.length == 0) {
+               // winner = null;
+            // If there is only one item, it wins
+            //} else if (dds.length == 1) {
+
+            var len = dds.length;
+
+            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 (dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner ||
+                            winner.overlap.getArea() < dd.overlap.getArea()) {
+                            winner = dd;
+                        }
+                    }
+                }
+            }
+
+            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>
+         * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups);
+         * </code>
+         * Alternatively:
+         * <code>
+         * Ext.dd.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];
+
+                    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) {
+            if (el) {
+                var parent;
+                if(Ext.isIE){
+                    try{
+                        parent = el.offsetParent;
+                    }catch(e){}
+                }else{
+                    parent = el.offsetParent;
+                }
+                if (parent) {
+                    return true;
+                }
+            }
+
+            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 {Ext.lib.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;
+            }
+
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
+
+            try {
+                pos= Ext.lib.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 Ext.lib.Region( t, r, b, l );
+        },
+
+        /**
+         * Checks the cursor location to see if it over the target
+         * @method isOverTarget
+         * @param {Ext.lib.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;
+
+            }
+
+            if (!loc) {
+                return false;
+            }
+
+            oTarget.cursorIsOver = loc.contains( pt );
+
+            // 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;
+            }
+
+            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);
+
+            var el = dc.getDragEl();
+            var curRegion = new Ext.lib.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;
+            }
+        },
+
+        /**
+         * unload event handler
+         * @method _onUnload
+         * @private
+         * @static
+         */
+        _onUnload: function(e, me) {
+            Ext.dd.DragDropMgr.unregAll();
+        },
+
+        /**
+         * Cleans up the drag and drop events and objects.
+         * @method unregAll
+         * @private
+         * @static
+         */
+        unregAll: function() {
+
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
+            }
+
+            this._execOnAll("unreg", []);
+
+            for (var i in this.elementCache) {
+                delete this.elementCache[i];
+            }
+
+            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 {Ext.dd.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(Ext.getDom(id));
+            }
+            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 Ext.lib.Ext.getDom instead
+         * @static
+         */
+        getElement: function(id) {
+            return Ext.getDom(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 Ext.lib.Dom instead
+         * @static
+         */
+        getCss: function(id) {
+            var el = Ext.getDom(id);
+            return (el) ? el.style : null;
+        },
+
+        /**
+         * Inner class for cached elements
+         * @class Ext.dd.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;
+            },
+
+        /**
+         * 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 Ext.lib.Dom.getX instead
+         * @static
+         */
+        getPosX: function(el) {
+            return Ext.lib.Dom.getX(el);
+        },
+
+        /**
+         * 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 Ext.lib.Dom.getY instead
+         * @static
+         */
+        getPosY: function(el) {
+            return Ext.lib.Dom.getY(el);
+        },
+
+        /**
+         * 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;
+
+                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);
+                }
+            }
+        },
+
+        /**
+         * 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 {
+
+            }
+            return { top: t, left: l };
+        },
+
+        /**
+         * 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 Ext.lib.Dom.getStyle
+         * @static
+         */
+        getStyle: function(el, styleProp) {
+            return Ext.fly(el).getStyle(styleProp);
+        },
+
+        /**
+         * Gets the scrollTop
+         * @method getScrollTop
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollTop: function () { return this.getScroll().top; },
+
+        /**
+         * Gets the scrollLeft
+         * @method getScrollLeft
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollLeft: function () { return this.getScroll().left; },
+
+        /**
+         * 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 = Ext.lib.Dom.getXY(targetEl);
+            Ext.lib.Dom.setXY(moveEl, aCoord);
+        },
+
+        /**
+         * Numeric array sort function
+         * @method numericSort
+         * @static
+         */
+        numericSort: function(a, b) { return (a - b); },
+
+        /**
+         * Internal counter
+         * @property _timeoutCount
+         * @private
+         * @static
+         */
+        _timeoutCount: 0,
+
+        /**
+         * 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 = Ext.dd.DDM;
+            if ( Ext.lib.Event && document ) {
+                DDM._onLoad();
+            } else {
+                if (DDM._timeoutCount > 2000) {
+                } else {
+                    setTimeout(DDM._addListeners, 10);
+                    if (document && document.body) {
+                        DDM._timeoutCount += 1;
+                    }
+                }
+            }
+        },
+
+        /**
+         * 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;
+
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        p = p.parentNode;
+                    }
+                }
+            }
+
+            return false;
+        }
+
+    };
+
+}();
+
+// shorter alias, save a few bytes
+Ext.dd.DDM = Ext.dd.DragDropMgr;
+Ext.dd.DDM._addListeners();
+
+}
+
+/**
+ * @class Ext.dd.DD
+ * A DragDrop implementation where the linked element follows the
+ * mouse cursor during a drag.
+ * @extends Ext.dd.DragDrop
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop items
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DD:
+ *                    scroll
  */
-Ext.data.JsonWriter = function(config) {
-    Ext.data.JsonWriter.superclass.constructor.call(this, config);
-    // careful to respect "returnJson", renamed to "encode"
-    if (this.returnJson != undefined) {
-        this.encode = this.returnJson;
+Ext.dd.DD = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config);
     }
-}
-Ext.extend(Ext.data.JsonWriter, Ext.data.DataWriter, {
+};
+
+Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, {
+
+    /**
+     * When set to true, the utility automatically tries to scroll the browser
+     * window when a drag and drop element is dragged near the viewport boundary.
+     * Defaults to true.
+     * @property scroll
+     * @type boolean
+     */
+    scroll: true,
+
+    /**
+     * Sets the pointer offset to the distance between the linked element's top
+     * left corner and the location the element was clicked
+     * @method autoOffset
+     * @param {int} iPageX the X coordinate of the click
+     * @param {int} iPageY the Y coordinate of the click
+     */
+    autoOffset: function(iPageX, iPageY) {
+        var x = iPageX - this.startPageX;
+        var y = iPageY - this.startPageY;
+        this.setDelta(x, y);
+    },
+
+    /**
+     * Sets the pointer offset.  You can call this directly to force the
+     * offset to be in a particular location (e.g., pass in 0,0 to set it
+     * to the center of the object)
+     * @method setDelta
+     * @param {int} iDeltaX the distance from the left
+     * @param {int} iDeltaY the distance from the top
+     */
+    setDelta: function(iDeltaX, iDeltaY) {
+        this.deltaX = iDeltaX;
+        this.deltaY = iDeltaY;
+    },
+
+    /**
+     * Sets the drag element to the location of the mousedown or click event,
+     * maintaining the cursor location relative to the location on the element
+     * that was clicked.  Override this if you want to place the element in a
+     * location other than where the cursor is.
+     * @method setDragElPos
+     * @param {int} iPageX the X coordinate of the mousedown or drag event
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     */
+    setDragElPos: function(iPageX, iPageY) {
+        // the first time we do this, we are going to check to make sure
+        // the element has css positioning
+
+        var el = this.getDragEl();
+        this.alignElWithMouse(el, iPageX, iPageY);
+    },
+
     /**
-     * @cfg {Boolean} returnJson <b>Deprecated.  Use {@link Ext.data.JsonWriter#encode} instead.
+     * Sets the element to the location of the mousedown or click event,
+     * maintaining the cursor location relative to the location on the element
+     * that was clicked.  Override this if you want to place the element in a
+     * location other than where the cursor is.
+     * @method alignElWithMouse
+     * @param {HTMLElement} el the element to move
+     * @param {int} iPageX the X coordinate of the mousedown or drag event
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event
      */
-    returnJson : undefined,
+    alignElWithMouse: function(el, iPageX, iPageY) {
+        var oCoord = this.getTargetCoord(iPageX, iPageY);
+        var fly = el.dom ? el : Ext.fly(el, '_dd');
+        if (!this.deltaSetXY) {
+            var aCoord = [oCoord.x, oCoord.y];
+            fly.setXY(aCoord);
+            var newLeft = fly.getLeft(true);
+            var newTop  = fly.getTop(true);
+            this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+        } else {
+            fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]);
+        }
+
+        this.cachePosition(oCoord.x, oCoord.y);
+        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        return oCoord;
+    },
+
     /**
-     * @cfg {Boolean} encode <tt>true</tt> to {@link Ext.util.JSON#encode encode} the
-     * {@link Ext.data.DataWriter#toHash hashed data}. Defaults to <tt>true</tt>.  When using
-     * {@link Ext.data.DirectProxy}, set this to <tt>false</tt> since Ext.Direct.JsonProvider will perform
-     * its own json-encoding.  In addition, if you're using {@link Ext.data.HttpProxy}, setting to <tt>false</tt>
-     * will cause HttpProxy to transmit data using the <b>jsonData</b> configuration-params of {@link Ext.Ajax#request}
-     * instead of <b>params</b>.  When using a {@link Ext.data.Store#restful} Store, some serverside frameworks are
-     * tuned to expect data through the jsonData mechanism.  In those cases, one will want to set <b>encode: <tt>false</tt></b>
+     * Saves the most recent position so that we can reset the constraints and
+     * tick marks on-demand.  We need to know this so that we can calculate the
+     * number of pixels the element is offset from its original position.
+     * @method cachePosition
+     * @param iPageX the current x position (optional, this just makes it so we
+     * don't have to look it up again)
+     * @param iPageY the current y position (optional, this just makes it so we
+     * don't have to look it up again)
      */
-    encode : true,
+    cachePosition: function(iPageX, iPageY) {
+        if (iPageX) {
+            this.lastPageX = iPageX;
+            this.lastPageY = iPageY;
+        } else {
+            var aCoord = Ext.lib.Dom.getXY(this.getEl());
+            this.lastPageX = aCoord[0];
+            this.lastPageY = aCoord[1];
+        }
+    },
 
     /**
-     * Final action of a write event.  Apply the written data-object to params.
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
-     * @param {Record[]} rs
-     * @param {Object} http params
-     * @param {Object} data object populated according to DataReader meta-data "root" and "idProperty"
+     * Auto-scroll the window if the dragged object has been moved beyond the
+     * visible window boundary.
+     * @method autoScroll
+     * @param {int} x the drag element's x position
+     * @param {int} y the drag element's y position
+     * @param {int} h the height of the drag element
+     * @param {int} w the width of the drag element
+     * @private
      */
-    render : function(action, rs, params, data) {
-        Ext.apply(params, data);
+    autoScroll: function(x, y, h, w) {
+
+        if (this.scroll) {
+            // The client height
+            var clientH = Ext.lib.Dom.getViewHeight();
+
+            // The client width
+            var clientW = Ext.lib.Dom.getViewWidth();
+
+            // The amt scrolled down
+            var st = this.DDM.getScrollTop();
+
+            // The amt scrolled right
+            var sl = this.DDM.getScrollLeft();
+
+            // Location of the bottom of the element
+            var bot = h + y;
+
+            // Location of the right of the element
+            var right = w + x;
+
+            // The distance from the cursor to the bottom of the visible area,
+            // adjusted so that we don't scroll if the cursor is beyond the
+            // element drag constraints
+            var toBot = (clientH + st - y - this.deltaY);
+
+            // The distance from the cursor to the right of the visible area
+            var toRight = (clientW + sl - x - this.deltaX);
+
+
+            // How close to the edge the cursor must be before we scroll
+            // var thresh = (document.all) ? 100 : 40;
+            var thresh = 40;
+
+            // How many pixels to scroll per autoscroll op.  This helps to reduce
+            // clunky scrolling. IE is more sensitive about this ... it needs this
+            // value to be higher.
+            var scrAmt = (document.all) ? 80 : 30;
+
+            // Scroll down if we are near the bottom of the visible page and the
+            // obj extends below the crease
+            if ( bot > clientH && toBot < thresh ) {
+                window.scrollTo(sl, st + scrAmt);
+            }
+
+            // Scroll up if the window is scrolled down and the top of the object
+            // goes above the top border
+            if ( y < st && st > 0 && y - st < thresh ) {
+                window.scrollTo(sl, st - scrAmt);
+            }
+
+            // Scroll right if the obj is beyond the right border and the cursor is
+            // near the border.
+            if ( right > clientW && toRight < thresh ) {
+                window.scrollTo(sl + scrAmt, st);
+            }
 
-        if (this.encode === true) { // <-- @deprecated returnJson
-            if (Ext.isArray(rs) && data[this.meta.idProperty]) {
-                params[this.meta.idProperty] = Ext.encode(params[this.meta.idProperty]);
+            // Scroll left if the window has been scrolled to the right and the obj
+            // extends past the left border
+            if ( x < sl && sl > 0 && x - sl < thresh ) {
+                window.scrollTo(sl - scrAmt, st);
             }
-            params[this.meta.root] = Ext.encode(params[this.meta.root]);
         }
     },
+
     /**
-     * createRecord
-     * @protected
-     * @param {Ext.data.Record} rec
+     * 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
      */
-    createRecord : function(rec) {
-        return this.toHash(rec);
+    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};
     },
+
     /**
-     * updateRecord
-     * @protected
-     * @param {Ext.data.Record} rec
+     * Sets up config options specific to this class. Overrides
+     * Ext.dd.DragDrop, but all versions of this method through the
+     * inheritance chain are called
      */
-    updateRecord : function(rec) {
-        return this.toHash(rec);
+    applyConfig: function() {
+        Ext.dd.DD.superclass.applyConfig.call(this);
+        this.scroll = (this.config.scroll !== false);
+    },
 
+    /**
+     * Event that fires prior to the onMouseDown event.  Overrides
+     * Ext.dd.DragDrop.
+     */
+    b4MouseDown: function(e) {
+        // this.resetConstraints();
+        this.autoOffset(e.getPageX(),
+                            e.getPageY());
     },
+
     /**
-     * destroyRecord
-     * @protected
-     * @param {Ext.data.Record} rec
+     * Event that fires prior to the onDrag event.  Overrides
+     * Ext.dd.DragDrop.
      */
-    destroyRecord : function(rec) {
-        return rec.id;
+    b4Drag: function(e) {
+        this.setDragElPos(e.getPageX(),
+                            e.getPageY());
+    },
+
+    toString: function() {
+        return ("DD " + this.id);
     }
-});/**
- * @class Ext.data.JsonReader
- * @extends Ext.data.DataReader
- * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from a JSON response
- * based on mappings in a provided {@link Ext.data.Record} constructor.</p>
- * <p>Example code:</p>
- * <pre><code>
-var Employee = Ext.data.Record.create([
-    {name: 'firstname'},                  // map the Record's "firstname" field to the row object's key of the same name
-    {name: 'job', mapping: 'occupation'}  // map the Record's "job" field to the row object's "occupation" key
-]);
-var myReader = new Ext.data.JsonReader(
-    {                             // The metadata property, with configuration options:
-        totalProperty: "results", //   the property which contains the total dataset size (optional)
-        root: "rows",             //   the property which contains an Array of record data objects
-        idProperty: "id"          //   the property within each row object that provides an ID for the record (optional)
+
+    //////////////////////////////////////////////////////////////////////////
+    // Debugging ygDragDrop events that can be overridden
+    //////////////////////////////////////////////////////////////////////////
+    /*
+    startDrag: function(x, y) {
     },
-    Employee  // {@link Ext.data.Record} constructor that provides mapping for JSON object
-);
-</code></pre>
- * <p>This would consume a JSON data object of the form:</p><pre><code>
-{
-    results: 2,  // Reader's configured totalProperty
-    rows: [      // Reader's configured root
-        { id: 1, firstname: 'Bill', occupation: 'Gardener' },         // a row object
-        { id: 2, firstname: 'Ben' , occupation: 'Horticulturalist' }  // another row object
-    ]
-}
-</code></pre>
- * <p><b><u>Automatic configuration using metaData</u></b></p>
- * <p>It is possible to change a JsonReader's metadata at any time by including a <b><tt>metaData</tt></b>
- * property in the JSON data object. If the JSON data object has a <b><tt>metaData</tt></b> property, a
- * {@link Ext.data.Store Store} object using this Reader will reconfigure itself to use the newly provided
- * field definition and fire its {@link Ext.data.Store#metachange metachange} event. The metachange event
- * handler may interrogate the <b><tt>metaData</tt></b> property to perform any configuration required.
- * Note that reconfiguring a Store potentially invalidates objects which may refer to Fields or Records
- * which no longer exist.</p>
- * <p>The <b><tt>metaData</tt></b> property in the JSON data object may contain:</p>
- * <div class="mdetail-params"><ul>
- * <li>any of the configuration options for this class</li>
- * <li>a <b><tt>{@link Ext.data.Record#fields fields}</tt></b> property which the JsonReader will
- * use as an argument to the {@link Ext.data.Record#create data Record create method} in order to
- * configure the layout of the Records it will produce.</li>
- * <li>a <b><tt>{@link Ext.data.Store#sortInfo sortInfo}</tt></b> property which the JsonReader will
- * use to set the {@link Ext.data.Store}'s {@link Ext.data.Store#sortInfo sortInfo} property</li>
- * <li>any user-defined properties needed</li>
- * </ul></div>
- * <p>To use this facility to send the same data as the example above (without having to code the creation
- * of the Record constructor), you would create the JsonReader like this:</p><pre><code>
-var myReader = new Ext.data.JsonReader();
-</code></pre>
- * <p>The first data packet from the server would configure the reader by containing a
- * <b><tt>metaData</tt></b> property <b>and</b> the data. For example, the JSON data object might take
- * the form:</p>
-<pre><code>
-{
-    metaData: {
-        idProperty: 'id',
-        root: 'rows',
-        totalProperty: 'results',
-        fields: [
-            {name: 'name'},
-            {name: 'job', mapping: 'occupation'}
-        ],
-        sortInfo: {field: 'name', direction:'ASC'}, // used by store to set its sortInfo
-        foo: 'bar' // custom property
+
+    onDrag: function(e) {
     },
-    results: 2,
-    rows: [ // an Array
-        { 'id': 1, 'name': 'Bill', occupation: 'Gardener' },
-        { 'id': 2, 'name': 'Ben', occupation: 'Horticulturalist' }
-    ]
-}
-</code></pre>
- * @cfg {String} totalProperty [total] Name of the property from which to retrieve the total number of records
- * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
- * paged from the remote server.  Defaults to <tt>total</tt>.
- * @cfg {String} successProperty [success] Name of the property from which to
- * retrieve the success attribute. Defaults to <tt>success</tt>.  See
- * {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
- * for additional information.
- * @cfg {String} root [undefined] <b>Required</b>.  The name of the property
- * which contains the Array of row objects.  Defaults to <tt>undefined</tt>.
- * An exception will be thrown if the root property is undefined. The data packet
- * value for this property should be an empty array to clear the data or show
- * no data.
- * @cfg {String} idProperty [id] Name of the property within a row object that contains a record identifier value.  Defaults to <tt>id</tt>
+
+    onDragEnter: function(e, id) {
+    },
+
+    onDragOver: function(e, id) {
+    },
+
+    onDragOut: function(e, id) {
+    },
+
+    onDragDrop: function(e, id) {
+    },
+
+    endDrag: function(e) {
+    }
+
+    */
+
+});
+/**
+ * @class Ext.dd.DDProxy
+ * A DragDrop implementation that inserts an empty, bordered div into
+ * the document that follows the cursor during drag operations.  At the time of
+ * the click, the frame div is resized to the dimensions of the linked html
+ * element, and moved to the exact location of the linked element.
+ *
+ * References to the "frame" element refer to the single proxy element that
+ * was created to be dragged in place of all DDProxy elements on the
+ * page.
+ *
+ * @extends Ext.dd.DD
  * @constructor
- * Create a new JsonReader
- * @param {Object} meta Metadata configuration options.
- * @param {Array/Object} recordType
- * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
- * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
- * constructor created from {@link Ext.data.Record#create}.</p>
+ * @param {String} id the id of the linked html element
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DDProxy in addition to those in DragDrop:
+ *                   resizeFrame, centerFrame, dragElId
  */
-Ext.data.JsonReader = function(meta, recordType){
-    meta = meta || {};
+Ext.dd.DDProxy = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config);
+        this.initFrame();
+    }
+};
 
-    // default idProperty, successProperty & totalProperty -> "id", "success", "total"
-    Ext.applyIf(meta, {
-        idProperty: 'id',
-        successProperty: 'success',
-        totalProperty: 'total'
-    });
+/**
+ * The default drag frame div id
+ * @property Ext.dd.DDProxy.dragElId
+ * @type String
+ * @static
+ */
+Ext.dd.DDProxy.dragElId = "ygddfdiv";
+
+Ext.extend(Ext.dd.DDProxy, Ext.dd.DD, {
 
-    Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields);
-};
-Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
     /**
-     * This JsonReader's metadata as passed to the constructor, or as passed in
-     * the last data packet's <b><tt>metaData</tt></b> property.
-     * @type Mixed
-     * @property meta
+     * By default we resize the drag frame to be the same size as the element
+     * we want to drag (this is to get the frame effect).  We can turn it off
+     * if we want a different behavior.
+     * @property resizeFrame
+     * @type boolean
+     */
+    resizeFrame: true,
+
+    /**
+     * By default the frame is positioned exactly where the drag element is, so
+     * we use the cursor offset provided by Ext.dd.DD.  Another option that works only if
+     * you do not have constraints on the obj is to have the drag frame centered
+     * around the cursor.  Set centerFrame to true for this effect.
+     * @property centerFrame
+     * @type boolean
      */
+    centerFrame: false,
+
     /**
-     * This method is only used by a DataProxy which has retrieved data from a remote server.
-     * @param {Object} response The XHR object which contains the JSON data in its responseText.
-     * @return {Object} data A data block which is used by an Ext.data.Store object as
-     * a cache of Ext.data.Records.
+     * Creates the proxy element if it does not yet exist
+     * @method createFrame
      */
-    read : function(response){
-        var json = response.responseText;
-        var o = Ext.decode(json);
-        if(!o) {
-            throw {message: "JsonReader.read: Json object not found"};
+    createFrame: function() {
+        var self = this;
+        var body = document.body;
+
+        if (!body || !body.firstChild) {
+            setTimeout( function() { self.createFrame(); }, 50 );
+            return;
         }
-        return this.readRecords(o);
-    },
 
-    // private function a store will implement
-    onMetaChange : function(meta, recordType, o){
+        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;
 
+            // appendChild can blow up IE if invoked prior to the window load event
+            // while rendering a table.  It is possible there are other scenarios
+            // that would cause this to happen as well.
+            body.insertBefore(div, body.firstChild);
+        }
     },
 
     /**
-     * @ignore
+     * Initialization for the drag frame element.  Must be called in the
+     * constructor of all subclasses
+     * @method initFrame
      */
-    simpleAccess: function(obj, subsc) {
-        return obj[subsc];
+    initFrame: function() {
+        this.createFrame();
+    },
+
+    applyConfig: function() {
+        Ext.dd.DDProxy.superclass.applyConfig.call(this);
+
+        this.resizeFrame = (this.config.resizeFrame !== false);
+        this.centerFrame = (this.config.centerFrame);
+        this.setDragElId(this.config.dragElId || Ext.dd.DDProxy.dragElId);
     },
 
     /**
-     * @ignore
+     * Resizes the drag frame to the dimensions of the clicked object, positions
+     * it over the object, and finally displays it
+     * @method showFrame
+     * @param {int} iPageX X click position
+     * @param {int} iPageY Y click position
+     * @private
      */
-    getJsonAccessor: function(){
-        var re = /[\[\.]/;
-        return function(expr) {
-            try {
-                return(re.test(expr)) ?
-                new Function("obj", "return obj." + expr) :
-                function(obj){
-                    return obj[expr];
-                };
-            } catch(e){}
-            return Ext.emptyFn;
-        };
-    }(),
+    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);
+
+        Ext.fly(dragEl).show();
+    },
 
     /**
-     * Create a data block containing Ext.data.Records from a JSON object.
-     * @param {Object} o An object which contains an Array of row objects in the property specified
-     * in the config as 'root, and optionally a property, specified in the config as 'totalProperty'
-     * which contains the total size of the dataset.
-     * @return {Object} data A data block which is used by an Ext.data.Store object as
-     * a cache of Ext.data.Records.
+     * The proxy is automatically resized to the dimensions of the linked
+     * element when a drag is initiated, unless resizeFrame is set to false
+     * @method _resizeProxy
+     * @private
      */
-    readRecords : function(o){
-        /**
-         * After any data loads, the raw JSON data is available for further custom processing.  If no data is
-         * loaded or there is a load exception this property will be undefined.
-         * @type Object
-         */
-        this.jsonData = o;
-        if(o.metaData){
-            delete this.ef;
-            this.meta = o.metaData;
-            this.recordType = Ext.data.Record.create(o.metaData.fields);
-            this.onMetaChange(this.meta, this.recordType, o);
+    _resizeProxy: function() {
+        if (this.resizeFrame) {
+            var el = this.getEl();
+            Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
         }
-        var s = this.meta, Record = this.recordType,
-            f = Record.prototype.fields, fi = f.items, fl = f.length, v;
+    },
 
-        // Generate extraction functions for the totalProperty, the root, the id, and for each field
-        this.buildExtractors();
-        var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
-        if(s.totalProperty){
-            v = parseInt(this.getTotal(o), 10);
-            if(!isNaN(v)){
-                totalRecords = v;
-            }
-        }
-        if(s.successProperty){
-            v = this.getSuccess(o);
-            if(v === false || v === 'false'){
-                success = false;
-            }
-        }
+    // overrides Ext.dd.DragDrop
+    b4MouseDown: function(e) {
+        var x = e.getPageX();
+        var y = e.getPageY();
+        this.autoOffset(x, y);
+        this.setDragElPos(x, y);
+    },
 
-        var records = [];
-        for(var i = 0; i < c; i++){
-            var n = root[i];
-            var record = new Record(this.extractValues(n, fi, fl), this.getId(n));
-            record.json = n;
-            records[i] = record;
-        }
-        return {
-            success : success,
-            records : records,
-            totalRecords : totalRecords
-        };
+    // overrides Ext.dd.DragDrop
+    b4StartDrag: function(x, y) {
+        // show the drag frame
+        this.showFrame(x, y);
     },
 
-    // private
-    buildExtractors : function() {
-        if(this.ef){
-            return;
-        }
-        var s = this.meta, Record = this.recordType,
-            f = Record.prototype.fields, fi = f.items, fl = f.length;
+    // overrides Ext.dd.DragDrop
+    b4EndDrag: function(e) {
+        Ext.fly(this.getDragEl()).hide();
+    },
 
-        if(s.totalProperty) {
-            this.getTotal = this.getJsonAccessor(s.totalProperty);
-        }
-        if(s.successProperty) {
-            this.getSuccess = this.getJsonAccessor(s.successProperty);
-        }
-        this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p){return p;};
-        if (s.id || s.idProperty) {
-            var g = this.getJsonAccessor(s.id || s.idProperty);
-            this.getId = function(rec) {
-                var r = g(rec);
-                return (r === undefined || r === "") ? null : r;
-            };
-        } else {
-            this.getId = function(){return null;};
-        }
-        var ef = [];
-        for(var i = 0; i < fl; i++){
-            f = fi[i];
-            var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
-            ef.push(this.getJsonAccessor(map));
-        }
-        this.ef = ef;
+    // overrides Ext.dd.DragDrop
+    // By default we try to move the element to the last location of the frame.
+    // This is so that the default behavior mirrors that of Ext.dd.DD.
+    endDrag: function(e) {
+
+        var lel = this.getEl();
+        var del = this.getDragEl();
+
+        // Show the drag frame briefly so we can get its position
+        del.style.visibility = "";
+
+        this.beforeMove();
+        // Hide the linked element before the move to get around a Safari
+        // rendering bug.
+        lel.style.visibility = "hidden";
+        Ext.dd.DDM.moveToEl(lel, del);
+        del.style.visibility = "hidden";
+        lel.style.visibility = "";
+
+        this.afterDrag();
     },
 
-    // private extractValues
-    extractValues: function(data, items, len) {
-        var f, values = {};
-        for(var j = 0; j < len; j++){
-            f = items[j];
-            var v = this.ef[j](data);
-            values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data);
-        }
-        return values;
+    beforeMove : function(){
+
     },
 
-    /**
-     * Decode a json response from server.
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
-     * @param {Object} response
-     */
-    readResponse : function(action, response) {
-        var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response;
-        if(!o) {
-            throw new Ext.data.JsonReader.Error('response');
-        }
-        if (Ext.isEmpty(o[this.meta.successProperty])) {
-            throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);
-        }
-        // TODO, separate empty and undefined exceptions.
-        if ((action === Ext.data.Api.actions.create || action === Ext.data.Api.actions.update)) {
-            if (Ext.isEmpty(o[this.meta.root])) {
-                throw new Ext.data.JsonReader.Error('root-emtpy', this.meta.root);
-            }
-            else if (o[this.meta.root] === undefined) {
-                throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
-            }
-        }
-        // make sure extraction functions are defined.
-        this.ef = this.buildExtractors();
-        return o;
-    }
-});
+    afterDrag : function(){
 
-/**
- * @class Ext.data.JsonReader.Error
- * Error class for JsonReader
- */
-Ext.data.JsonReader.Error = Ext.extend(Ext.Error, {
-    constructor : function(message, arg) {
-        this.arg = arg;
-        Ext.Error.call(this, message);
     },
-    name : 'Ext.data.JsonReader'
-});
-Ext.apply(Ext.data.JsonReader.Error.prototype, {
-    lang: {
-        'response': "An error occurred while json-decoding your server response",
-        'successProperty-response': 'Could not locate your "successProperty" in your server response.  Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response.  See the JsonReader docs.',
-        'root-undefined-response': 'Could not locate your "root" property in your server response.  Please review your JsonReader config to ensure the config-property "root" matches the property your server-response.  See the JsonReader docs.',
-        'root-undefined-config': 'Your JsonReader was configured without a "root" property.  Please review your JsonReader config and make sure to define the root property.  See the JsonReader docs.',
-        'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty"  Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id").  See the JsonReader docs.',
-        'root-emtpy': 'Data was expected to be returned by the server in the "root" property of the response.  Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response.  See JsonReader docs.'
+
+    toString: function() {
+        return ("DDProxy " + this.id);
     }
+
 });
 /**
- * @class Ext.data.ArrayReader
- * @extends Ext.data.JsonReader
- * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an Array.
- * Each element of that Array represents a row of data fields. The
- * fields are pulled into a Record object using as a subscript, the <code>mapping</code> property
- * of the field definition if it exists, or the field's ordinal position in the definition.</p>
- * <p>Example code:</p>
- * <pre><code>
-var Employee = Ext.data.Record.create([
-    {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
-    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.
-]);
-var myReader = new Ext.data.ArrayReader({
-    {@link #idIndex}: 0
-}, Employee);
-</code></pre>
- * <p>This would consume an Array like this:</p>
- * <pre><code>
-[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
- * </code></pre>
+ * @class Ext.dd.DDTarget
+ * A DragDrop implementation that does not move, but can be a drop
+ * target.  You would get the same result by simply omitting implementation
+ * for the event callbacks, but this way we reduce the processing cost of the
+ * event listener and the callbacks.
+ * @extends Ext.dd.DragDrop
  * @constructor
- * Create a new ArrayReader
- * @param {Object} meta Metadata configuration options.
- * @param {Array/Object} recordType
- * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
- * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
- * constructor created from {@link Ext.data.Record#create}.</p>
+ * @param {String} id the id of the element that is a drop target
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                 Valid properties for DDTarget in addition to those in
+ *                 DragDrop:
+ *                    none
  */
-Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
+Ext.dd.DDTarget = function(id, sGroup, config) {
+    if (id) {
+        this.initTarget(id, sGroup, config);
+    }
+};
+
+// Ext.dd.DDTarget.prototype = new Ext.dd.DragDrop();
+Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, {
     /**
-     * @cfg {String} successProperty
      * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
+    getDragEl: Ext.emptyFn,
     /**
-     * @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record.
-     * Deprecated. Use {@link #idIndex} instead.
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
+    isValidHandleChild: Ext.emptyFn,
     /**
-     * @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record.
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
+    startDrag: Ext.emptyFn,
     /**
-     * Create a data block containing Ext.data.Records from an Array.
-     * @param {Object} o An Array of row objects which represents the dataset.
-     * @return {Object} data A data block which is used by an Ext.data.Store object as
-     * a cache of Ext.data.Records.
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    readRecords : function(o){
-        this.arrayData = o;
-        var s = this.meta,
-            sid = s ? Ext.num(s.idIndex, s.id) : null,
-            recordType = this.recordType, 
-            fields = recordType.prototype.fields,
-            records = [],
-            v;
-
-        if(!this.getRoot) {
-            this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p) {return p;};
-            if(s.totalProperty) {
-                this.getTotal = this.getJsonAccessor(s.totalProperty);
-            }
-        }
-
-        var root = this.getRoot(o);
-
-        for(var i = 0; i < root.length; i++) {
-            var n = root[i];
-            var values = {};
-            var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
-            for(var j = 0, jlen = fields.length; j < jlen; j++) {
-                var f = fields.items[j];
-                var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
-                v = n[k] !== undefined ? n[k] : f.defaultValue;
-                v = f.convert(v, n);
-                values[f.name] = v;
-            }
-            var record = new recordType(values, id);
-            record.json = n;
-            records[records.length] = record;
-        }
-
-        var totalRecords = records.length;
-
-        if(s.totalProperty) {
-            v = parseInt(this.getTotal(o), 10);
-            if(!isNaN(v)) {
-                totalRecords = v;
-            }
-        }
-
-        return {
-            records : records,
-            totalRecords : totalRecords
-        };
-    }
-});/**
- * @class Ext.data.ArrayStore
- * @extends Ext.data.Store
- * <p>Formerly known as "SimpleStore".</p>
- * <p>Small helper class to make creating {@link Ext.data.Store}s from Array data easier.
- * An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.</p>
- * <p>A store configuration would be something like:<pre><code>
-var store = new Ext.data.ArrayStore({
-    // store configs
-    autoDestroy: true,
-    storeId: 'myStore',
-    // reader configs
-    idIndex: 0,  
-    fields: [
-       'company',
-       {name: 'price', type: 'float'},
-       {name: 'change', type: 'float'},
-       {name: 'pctChange', type: 'float'},
-       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
-    ]
-});
- * </code></pre></p>
- * <p>This store is configured to consume a returned object of the form:<pre><code>
-var myData = [
-    ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
-    ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
-    ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
-    ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
-    ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
-];
- * </code></pre>
- * An object literal of this form could also be used as the {@link #data} config option.</p>
- * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of 
- * <b>{@link Ext.data.ArrayReader ArrayReader}</b>.</p>
- * @constructor
- * @param {Object} config
- * @xtype arraystore
- */
-Ext.data.ArrayStore = Ext.extend(Ext.data.Store, {
+    endDrag: Ext.emptyFn,
     /**
-     * @cfg {Ext.data.DataReader} reader @hide
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    constructor: function(config){
-        Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, {
-            reader: new Ext.data.ArrayReader(config)
-        }));
-    },
-
-    loadData : function(data, append){
-        if(this.expandData === true){
-            var r = [];
-            for(var i = 0, len = data.length; i < len; i++){
-                r[r.length] = [data[i]];
-            }
-            data = r;
-        }
-        Ext.data.ArrayStore.superclass.loadData.call(this, data, append);
-    }
-});
-Ext.reg('arraystore', Ext.data.ArrayStore);
-
-// backwards compat
-Ext.data.SimpleStore = Ext.data.ArrayStore;
-Ext.reg('simplestore', Ext.data.SimpleStore);/**
- * @class Ext.data.JsonStore
- * @extends Ext.data.Store
- * <p>Small helper class to make creating {@link Ext.data.Store}s from JSON data easier.
- * A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.</p>
- * <p>A store configuration would be something like:<pre><code>
-var store = new Ext.data.JsonStore({
-    // store configs
-    autoDestroy: true,
-    url: 'get-images.php',
-    storeId: 'myStore',
-    // reader configs
-    root: 'images',
-    idProperty: 'name',  
-    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
-});
- * </code></pre></p>
- * <p>This store is configured to consume a returned object of the form:<pre><code>
-{
-    images: [
-        {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
-        {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
-    ]
-}
- * </code></pre>
- * An object literal of this form could also be used as the {@link #data} config option.</p>
- * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of 
- * <b>{@link Ext.data.JsonReader JsonReader}</b>.</p>
- * @constructor
- * @param {Object} config
- * @xtype jsonstore
- */
-Ext.data.JsonStore = Ext.extend(Ext.data.Store, {
+    onDrag: Ext.emptyFn,
     /**
-     * @cfg {Ext.data.DataReader} reader @hide
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    constructor: function(config){
-        Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, {
-            reader: new Ext.data.JsonReader(config)
-        }));
-    }
-});
-Ext.reg('jsonstore', Ext.data.JsonStore);/**
- * @class Ext.data.XmlWriter
- * @extends Ext.data.DataWriter
- * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action via XML.
- */
-Ext.data.XmlWriter = Ext.extend(Ext.data.DataWriter, {
+    onDragDrop: Ext.emptyFn,
     /**
-     * Final action of a write event.  Apply the written data-object to params.
-     * @param {String} action [Ext.data.Api.create|read|update|destroy]
-     * @param {Record[]} rs
-     * @param {Object} http params
-     * @param {Object} data object populated according to DataReader meta-data "root" and "idProperty"
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    render : function(action, rs, params, data) {
-        // no impl.
-    },
+    onDragEnter: Ext.emptyFn,
     /**
-     * createRecord
-     * @param {Ext.data.Record} rec
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    createRecord : function(rec) {
-        // no impl
-    },
+    onDragOut: Ext.emptyFn,
     /**
-     * updateRecord
-     * @param {Ext.data.Record} rec
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    updateRecord : function(rec) {
-        // no impl.
-
-    },
+    onDragOver: Ext.emptyFn,
     /**
-     * destroyRecord
-     * @param {Ext.data.Record} rec
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    destroyRecord : function(rec) {
-        // no impl
-    }
-});/**
- * @class Ext.data.XmlReader
- * @extends Ext.data.DataReader
- * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an XML document
- * based on mappings in a provided {@link Ext.data.Record} constructor.</p>
- * <p><b>Note</b>: that in order for the browser to parse a returned XML document, the Content-Type
- * header in the HTTP response must be set to "text/xml" or "application/xml".</p>
- * <p>Example code:</p>
- * <pre><code>
-var Employee = Ext.data.Record.create([
-   {name: 'name', mapping: 'name'},     // "mapping" property not needed if it is the same as "name"
-   {name: 'occupation'}                 // This field will use "occupation" as the mapping.
-]);
-var myReader = new Ext.data.XmlReader({
-   totalRecords: "results", // The element which contains the total dataset size (optional)
-   record: "row",           // The repeated element which contains row information
-   id: "id"                 // The element within the row that provides an ID for the record (optional)
-}, Employee);
-</code></pre>
- * <p>
- * This would consume an XML file like this:
- * <pre><code>
-&lt;?xml version="1.0" encoding="UTF-8"?>
-&lt;dataset>
- &lt;results>2&lt;/results>
- &lt;row>
-   &lt;id>1&lt;/id>
-   &lt;name>Bill&lt;/name>
-   &lt;occupation>Gardener&lt;/occupation>
- &lt;/row>
- &lt;row>
-   &lt;id>2&lt;/id>
-   &lt;name>Ben&lt;/name>
-   &lt;occupation>Horticulturalist&lt;/occupation>
- &lt;/row>
-&lt;/dataset>
-</code></pre>
- * @cfg {String} totalRecords The DomQuery path from which to retrieve the total number of records
- * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
- * paged from the remote server.
- * @cfg {String} record The DomQuery path to the repeated element which contains record information.
- * @cfg {String} success The DomQuery path to the success attribute used by forms.
- * @cfg {String} idPath The DomQuery path relative from the record element to the element that contains
- * a record identifier value.
- * @constructor
- * Create a new XmlReader.
- * @param {Object} meta Metadata configuration options
- * @param {Object} recordType Either an Array of field definition objects as passed to
- * {@link Ext.data.Record#create}, or a Record constructor object created using {@link Ext.data.Record#create}.
- */
-Ext.data.XmlReader = function(meta, recordType){
-    meta = meta || {};
-    Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields);
-};
-Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
+    onInvalidDrop: Ext.emptyFn,
     /**
-     * This method is only used by a DataProxy which has retrieved data from a remote server.
-     * @param {Object} response The XHR object which contains the parsed XML document.  The response is expected
-     * to contain a property called <tt>responseXML</tt> which refers to an XML document object.
-     * @return {Object} records A data block which is used by an {@link Ext.data.Store} as
-     * a cache of Ext.data.Records.
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    read : function(response){
-        var doc = response.responseXML;
-        if(!doc) {
-            throw {message: "XmlReader.read: XML Document not available"};
-        }
-        return this.readRecords(doc);
-    },
-
+    onMouseDown: Ext.emptyFn,
     /**
-     * Create a data block containing Ext.data.Records from an XML document.
-     * @param {Object} doc A parsed XML document.
-     * @return {Object} records A data block which is used by an {@link Ext.data.Store} as
-     * a cache of Ext.data.Records.
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
      */
-    readRecords : function(doc){
-        /**
-         * After any data loads/reads, the raw XML Document is available for further custom processing.
-         * @type XMLDocument
-         */
-        this.xmlData = doc;
-        var root = doc.documentElement || doc;
-        var q = Ext.DomQuery;
-        var recordType = this.recordType, fields = recordType.prototype.fields;
-        var sid = this.meta.idPath || this.meta.id;
-        var totalRecords = 0, success = true;
-        if(this.meta.totalRecords){
-            totalRecords = q.selectNumber(this.meta.totalRecords, root, 0);
-        }
-
-        if(this.meta.success){
-            var sv = q.selectValue(this.meta.success, root, true);
-            success = sv !== false && sv !== 'false';
-        }
-        var records = [];
-        var ns = q.select(this.meta.record, root);
-        for(var i = 0, len = ns.length; i < len; i++) {
-            var n = ns[i];
-            var values = {};
-            var id = sid ? q.selectValue(sid, n) : undefined;
-            for(var j = 0, jlen = fields.length; j < jlen; j++){
-                var f = fields.items[j];
-                var v = q.selectValue(Ext.value(f.mapping, f.name, true), n, f.defaultValue);
-                v = f.convert(v, n);
-                values[f.name] = v;
-            }
-            var record = new recordType(values, id);
-            record.node = n;
-            records[records.length] = record;
-        }
-
-        return {
-            success : success,
-            records : records,
-            totalRecords : totalRecords || records.length
-        };
-    },
+    onMouseUp: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setXConstraint: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setYConstraint: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    resetConstraints: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    clearConstraints: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    clearTicks: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setInitPosition: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setDragElId: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setHandleElId: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    setOuterHandleElId: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    addInvalidHandleClass: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    addInvalidHandleId: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    addInvalidHandleType: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    removeInvalidHandleClass: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    removeInvalidHandleId: Ext.emptyFn,
+    /**
+     * @hide
+     * Overridden and disabled. A DDTarget does not support being dragged.
+     * @method
+     */
+    removeInvalidHandleType: Ext.emptyFn,
 
-    // TODO: implement readResponse for XmlReader
-    readResponse : Ext.emptyFn
+    toString: function() {
+        return ("DDTarget " + this.id);
+    }
+});/**\r
+ * @class Ext.dd.DragTracker\r
+ * @extends Ext.util.Observable\r
+ */\r
+Ext.dd.DragTracker = Ext.extend(Ext.util.Observable,  {\r
+    /**\r
+     * @cfg {Boolean} active\r
+        * Defaults to <tt>false</tt>.\r
+        */     \r
+    active: false,\r
+    /**\r
+     * @cfg {Number} tolerance\r
+        * Defaults to <tt>5</tt>.\r
+        */     \r
+    tolerance: 5,\r
+    /**\r
+     * @cfg {Boolean/Number} autoStart\r
+        * Defaults to <tt>false</tt>. Specify <tt>true</tt> to defer trigger start by 1000 ms.\r
+        * Specify a Number for the number of milliseconds to defer trigger start.\r
+        */     \r
+    autoStart: false,\r
+    \r
+    constructor : function(config){\r
+        Ext.apply(this, config);\r
+           this.addEvents(\r
+               /**\r
+                * @event mousedown\r
+                * @param {Object} this\r
+                * @param {Object} e event object\r
+                */\r
+               'mousedown',\r
+               /**\r
+                * @event mouseup\r
+                * @param {Object} this\r
+                * @param {Object} e event object\r
+                */\r
+               'mouseup',\r
+               /**\r
+                * @event mousemove\r
+                * @param {Object} this\r
+                * @param {Object} e event object\r
+                */\r
+               'mousemove',\r
+               /**\r
+                * @event dragstart\r
+                * @param {Object} this\r
+                * @param {Object} startXY the page coordinates of the event\r
+                */\r
+               'dragstart',\r
+               /**\r
+                * @event dragend\r
+                * @param {Object} this\r
+                * @param {Object} e event object\r
+                */\r
+               'dragend',\r
+               /**\r
+                * @event drag\r
+                * @param {Object} this\r
+                * @param {Object} e event object\r
+                */\r
+               'drag'\r
+           );\r
+       \r
+           this.dragRegion = new Ext.lib.Region(0,0,0,0);\r
+       \r
+           if(this.el){\r
+               this.initEl(this.el);\r
+           }\r
+        Ext.dd.DragTracker.superclass.constructor.call(this, config);\r
+    },\r
+\r
+    initEl: function(el){\r
+        this.el = Ext.get(el);\r
+        el.on('mousedown', this.onMouseDown, this,\r
+                this.delegate ? {delegate: this.delegate} : undefined);\r
+    },\r
+\r
+    destroy : function(){\r
+        this.el.un('mousedown', this.onMouseDown, this);\r
+    },\r
+\r
+    onMouseDown: function(e, target){\r
+        if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){\r
+            this.startXY = this.lastXY = e.getXY();\r
+            this.dragTarget = this.delegate ? target : this.el.dom;\r
+            if(this.preventDefault !== false){\r
+                e.preventDefault();\r
+            }\r
+            var doc = Ext.getDoc();\r
+            doc.on('mouseup', this.onMouseUp, this);\r
+            doc.on('mousemove', this.onMouseMove, this);\r
+            doc.on('selectstart', this.stopSelect, this);\r
+            if(this.autoStart){\r
+                this.timer = this.triggerStart.defer(this.autoStart === true ? 1000 : this.autoStart, this);\r
+            }\r
+        }\r
+    },\r
+\r
+    onMouseMove: function(e, target){\r
+        // HACK: IE hack to see if button was released outside of window. */\r
+        if(this.active && Ext.isIE && !e.browserEvent.button){\r
+            e.preventDefault();\r
+            this.onMouseUp(e);\r
+            return;\r
+        }\r
+\r
+        e.preventDefault();\r
+        var xy = e.getXY(), s = this.startXY;\r
+        this.lastXY = xy;\r
+        if(!this.active){\r
+            if(Math.abs(s[0]-xy[0]) > this.tolerance || Math.abs(s[1]-xy[1]) > this.tolerance){\r
+                this.triggerStart();\r
+            }else{\r
+                return;\r
+            }\r
+        }\r
+        this.fireEvent('mousemove', this, e);\r
+        this.onDrag(e);\r
+        this.fireEvent('drag', this, e);\r
+    },\r
+\r
+    onMouseUp: function(e){\r
+        var doc = Ext.getDoc();\r
+        doc.un('mousemove', this.onMouseMove, this);\r
+        doc.un('mouseup', this.onMouseUp, this);\r
+        doc.un('selectstart', this.stopSelect, this);\r
+        e.preventDefault();\r
+        this.clearStart();\r
+        var wasActive = this.active;\r
+        this.active = false;\r
+        delete this.elRegion;\r
+        this.fireEvent('mouseup', this, e);\r
+        if(wasActive){\r
+            this.onEnd(e);\r
+            this.fireEvent('dragend', this, e);\r
+        }\r
+    },\r
+\r
+    triggerStart: function(isTimer){\r
+        this.clearStart();\r
+        this.active = true;\r
+        this.onStart(this.startXY);\r
+        this.fireEvent('dragstart', this, this.startXY);\r
+    },\r
+\r
+    clearStart : function(){\r
+        if(this.timer){\r
+            clearTimeout(this.timer);\r
+            delete this.timer;\r
+        }\r
+    },\r
+\r
+    stopSelect : function(e){\r
+        e.stopEvent();\r
+        return false;\r
+    },\r
+\r
+    onBeforeStart : function(e){\r
+\r
+    },\r
+\r
+    onStart : function(xy){\r
+\r
+    },\r
+\r
+    onDrag : function(e){\r
+\r
+    },\r
+\r
+    onEnd : function(e){\r
+\r
+    },\r
+\r
+    getDragTarget : function(){\r
+        return this.dragTarget;\r
+    },\r
+\r
+    getDragCt : function(){\r
+        return this.el;\r
+    },\r
+\r
+    getXY : function(constrain){\r
+        return constrain ?\r
+               this.constrainModes[constrain].call(this, this.lastXY) : this.lastXY;\r
+    },\r
+\r
+    getOffset : function(constrain){\r
+        var xy = this.getXY(constrain);\r
+        var s = this.startXY;\r
+        return [s[0]-xy[0], s[1]-xy[1]];\r
+    },\r
+\r
+    constrainModes: {\r
+        'point' : function(xy){\r
+\r
+            if(!this.elRegion){\r
+                this.elRegion = this.getDragCt().getRegion();\r
+            }\r
+\r
+            var dr = this.dragRegion;\r
+\r
+            dr.left = xy[0];\r
+            dr.top = xy[1];\r
+            dr.right = xy[0];\r
+            dr.bottom = xy[1];\r
+\r
+            dr.constrainTo(this.elRegion);\r
+\r
+            return [dr.left, dr.top];\r
+        }\r
+    }\r
 });/**\r
- * @class Ext.data.XmlStore\r
- * @extends Ext.data.Store\r
- * <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.\r
- * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.</p>\r
- * <p>A store configuration would be something like:<pre><code>\r
-var store = new Ext.data.XmlStore({\r
-    // store configs\r
-    autoDestroy: true,\r
-    storeId: 'myStore',\r
-    url: 'sheldon.xml', // automatically configures a HttpProxy\r
-    // reader configs\r
-    record: 'Item', // records will have an "Item" tag\r
-    idPath: 'ASIN',\r
-    totalRecords: '@TotalResults'\r
-    fields: [\r
-        // set up the fields mapping into the xml doc\r
-        // The first needs mapping, the others are very basic\r
-        {name: 'Author', mapping: 'ItemAttributes > Author'},\r
-        'Title', 'Manufacturer', 'ProductGroup'\r
-    ]\r
-});\r
- * </code></pre></p>\r
- * <p>This store is configured to consume a returned object of the form:<pre><code>\r
-&#60?xml version="1.0" encoding="UTF-8"?>\r
-&#60ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">\r
-    &#60Items>\r
-        &#60Request>\r
-            &#60IsValid>True&#60/IsValid>\r
-            &#60ItemSearchRequest>\r
-                &#60Author>Sidney Sheldon&#60/Author>\r
-                &#60SearchIndex>Books&#60/SearchIndex>\r
-            &#60/ItemSearchRequest>\r
-        &#60/Request>\r
-        &#60TotalResults>203&#60/TotalResults>\r
-        &#60TotalPages>21&#60/TotalPages>\r
-        &#60Item>\r
-            &#60ASIN>0446355453&#60/ASIN>\r
-            &#60DetailPageURL>\r
-                http://www.amazon.com/\r
-            &#60/DetailPageURL>\r
-            &#60ItemAttributes>\r
-                &#60Author>Sidney Sheldon&#60/Author>\r
-                &#60Manufacturer>Warner Books&#60/Manufacturer>\r
-                &#60ProductGroup>Book&#60/ProductGroup>\r
-                &#60Title>Master of the Game&#60/Title>\r
-            &#60/ItemAttributes>\r
-        &#60/Item>\r
-    &#60/Items>\r
-&#60/ItemSearchResponse>\r
- * </code></pre>\r
- * An object literal of this form could also be used as the {@link #data} config option.</p>\r
- * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of \r
- * <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>\r
+ * @class Ext.dd.ScrollManager\r
+ * <p>Provides automatic scrolling of overflow regions in the page during drag operations.</p>\r
+ * <p>The ScrollManager configs will be used as the defaults for any scroll container registered with it,\r
+ * but you can also override most of the configs per scroll container by adding a \r
+ * <tt>ddScrollConfig</tt> object to the target element that contains these properties: {@link #hthresh},\r
+ * {@link #vthresh}, {@link #increment} and {@link #frequency}.  Example usage:\r
+ * <pre><code>\r
+var el = Ext.get('scroll-ct');\r
+el.ddScrollConfig = {\r
+    vthresh: 50,\r
+    hthresh: -1,\r
+    frequency: 100,\r
+    increment: 200\r
+};\r
+Ext.dd.ScrollManager.register(el);\r
+</code></pre>\r
+ * <b>Note: This class uses "Point Mode" and is untested in "Intersect Mode".</b>\r
+ * @singleton\r
+ */\r
+Ext.dd.ScrollManager = function(){\r
+    var ddm = Ext.dd.DragDropMgr;\r
+    var els = {};\r
+    var dragEl = null;\r
+    var proc = {};\r
+    \r
+    var onStop = function(e){\r
+        dragEl = null;\r
+        clearProc();\r
+    };\r
+    \r
+    var triggerRefresh = function(){\r
+        if(ddm.dragCurrent){\r
+             ddm.refreshCache(ddm.dragCurrent.groups);\r
+        }\r
+    };\r
+    \r
+    var doScroll = function(){\r
+        if(ddm.dragCurrent){\r
+            var dds = Ext.dd.ScrollManager;\r
+            var inc = proc.el.ddScrollConfig ?\r
+                      proc.el.ddScrollConfig.increment : dds.increment;\r
+            if(!dds.animate){\r
+                if(proc.el.scroll(proc.dir, inc)){\r
+                    triggerRefresh();\r
+                }\r
+            }else{\r
+                proc.el.scroll(proc.dir, inc, true, dds.animDuration, triggerRefresh);\r
+            }\r
+        }\r
+    };\r
+    \r
+    var clearProc = function(){\r
+        if(proc.id){\r
+            clearInterval(proc.id);\r
+        }\r
+        proc.id = 0;\r
+        proc.el = null;\r
+        proc.dir = "";\r
+    };\r
+    \r
+    var startProc = function(el, dir){\r
+        clearProc();\r
+        proc.el = el;\r
+        proc.dir = dir;\r
+        var freq = (el.ddScrollConfig && el.ddScrollConfig.frequency) ? \r
+                el.ddScrollConfig.frequency : Ext.dd.ScrollManager.frequency;\r
+        proc.id = setInterval(doScroll, freq);\r
+    };\r
+    \r
+    var onFire = function(e, isDrop){\r
+        if(isDrop || !ddm.dragCurrent){ return; }\r
+        var dds = Ext.dd.ScrollManager;\r
+        if(!dragEl || dragEl != ddm.dragCurrent){\r
+            dragEl = ddm.dragCurrent;\r
+            // refresh regions on drag start\r
+            dds.refreshCache();\r
+        }\r
+        \r
+        var xy = Ext.lib.Event.getXY(e);\r
+        var pt = new Ext.lib.Point(xy[0], xy[1]);\r
+        for(var id in els){\r
+            var el = els[id], r = el._region;\r
+            var c = el.ddScrollConfig ? el.ddScrollConfig : dds;\r
+            if(r && r.contains(pt) && el.isScrollable()){\r
+                if(r.bottom - pt.y <= c.vthresh){\r
+                    if(proc.el != el){\r
+                        startProc(el, "down");\r
+                    }\r
+                    return;\r
+                }else if(r.right - pt.x <= c.hthresh){\r
+                    if(proc.el != el){\r
+                        startProc(el, "left");\r
+                    }\r
+                    return;\r
+                }else if(pt.y - r.top <= c.vthresh){\r
+                    if(proc.el != el){\r
+                        startProc(el, "up");\r
+                    }\r
+                    return;\r
+                }else if(pt.x - r.left <= c.hthresh){\r
+                    if(proc.el != el){\r
+                        startProc(el, "right");\r
+                    }\r
+                    return;\r
+                }\r
+            }\r
+        }\r
+        clearProc();\r
+    };\r
+    \r
+    ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm);\r
+    ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm);\r
+    \r
+    return {\r
+        /**\r
+         * Registers new overflow element(s) to auto scroll\r
+         * @param {Mixed/Array} el The id of or the element to be scrolled or an array of either\r
+         */\r
+        register : function(el){\r
+            if(Ext.isArray(el)){\r
+                for(var i = 0, len = el.length; i < len; i++) {\r
+                       this.register(el[i]);\r
+                }\r
+            }else{\r
+                el = Ext.get(el);\r
+                els[el.id] = el;\r
+            }\r
+        },\r
+        \r
+        /**\r
+         * Unregisters overflow element(s) so they are no longer scrolled\r
+         * @param {Mixed/Array} el The id of or the element to be removed or an array of either\r
+         */\r
+        unregister : function(el){\r
+            if(Ext.isArray(el)){\r
+                for(var i = 0, len = el.length; i < len; i++) {\r
+                       this.unregister(el[i]);\r
+                }\r
+            }else{\r
+                el = Ext.get(el);\r
+                delete els[el.id];\r
+            }\r
+        },\r
+        \r
+        /**\r
+         * The number of pixels from the top or bottom edge of a container the pointer needs to be to\r
+         * trigger scrolling (defaults to 25)\r
+         * @type Number\r
+         */\r
+        vthresh : 25,\r
+        /**\r
+         * The number of pixels from the right or left edge of a container the pointer needs to be to\r
+         * trigger scrolling (defaults to 25)\r
+         * @type Number\r
+         */\r
+        hthresh : 25,\r
+\r
+        /**\r
+         * The number of pixels to scroll in each scroll increment (defaults to 50)\r
+         * @type Number\r
+         */\r
+        increment : 100,\r
+        \r
+        /**\r
+         * The frequency of scrolls in milliseconds (defaults to 500)\r
+         * @type Number\r
+         */\r
+        frequency : 500,\r
+        \r
+        /**\r
+         * True to animate the scroll (defaults to true)\r
+         * @type Boolean\r
+         */\r
+        animate: true,\r
+        \r
+        /**\r
+         * The animation duration in seconds - \r
+         * MUST BE less than Ext.dd.ScrollManager.frequency! (defaults to .4)\r
+         * @type Number\r
+         */\r
+        animDuration: .4,\r
+        \r
+        /**\r
+         * Manually trigger a cache refresh.\r
+         */\r
+        refreshCache : function(){\r
+            for(var id in els){\r
+                if(typeof els[id] == 'object'){ // for people extending the object prototype\r
+                    els[id]._region = els[id].getRegion();\r
+                }\r
+            }\r
+        }\r
+    };\r
+}();/**\r
+ * @class Ext.dd.Registry\r
+ * Provides easy access to all drag drop components that are registered on a page.  Items can be retrieved either\r
+ * directly by DOM node id, or by passing in the drag drop event that occurred and looking up the event target.\r
+ * @singleton\r
+ */\r
+Ext.dd.Registry = function(){\r
+    var elements = {}; \r
+    var handles = {}; \r
+    var autoIdSeed = 0;\r
+\r
+    var getId = function(el, autogen){\r
+        if(typeof el == "string"){\r
+            return el;\r
+        }\r
+        var id = el.id;\r
+        if(!id && autogen !== false){\r
+            id = "extdd-" + (++autoIdSeed);\r
+            el.id = id;\r
+        }\r
+        return id;\r
+    };\r
+    \r
+    return {\r
+    /**\r
+     * Resgister a drag drop element\r
+     * @param {String/HTMLElement) element The id or DOM node to register\r
+     * @param {Object} data (optional) An custom data object that will be passed between the elements that are involved\r
+     * in drag drop operations.  You can populate this object with any arbitrary properties that your own code\r
+     * knows how to interpret, plus there are some specific properties known to the Registry that should be\r
+     * populated in the data object (if applicable):\r
+     * <pre>\r
+Value      Description<br />\r
+---------  ------------------------------------------<br />\r
+handles    Array of DOM nodes that trigger dragging<br />\r
+           for the element being registered<br />\r
+isHandle   True if the element passed in triggers<br />\r
+           dragging itself, else false\r
+</pre>\r
+     */\r
+        register : function(el, data){\r
+            data = data || {};\r
+            if(typeof el == "string"){\r
+                el = document.getElementById(el);\r
+            }\r
+            data.ddel = el;\r
+            elements[getId(el)] = data;\r
+            if(data.isHandle !== false){\r
+                handles[data.ddel.id] = data;\r
+            }\r
+            if(data.handles){\r
+                var hs = data.handles;\r
+                for(var i = 0, len = hs.length; i < len; i++){\r
+                       handles[getId(hs[i])] = data;\r
+                }\r
+            }\r
+        },\r
+\r
+    /**\r
+     * Unregister a drag drop element\r
+     * @param {String/HTMLElement) element The id or DOM node to unregister\r
+     */\r
+        unregister : function(el){\r
+            var id = getId(el, false);\r
+            var data = elements[id];\r
+            if(data){\r
+                delete elements[id];\r
+                if(data.handles){\r
+                    var hs = data.handles;\r
+                    for(var i = 0, len = hs.length; i < len; i++){\r
+                       delete handles[getId(hs[i], false)];\r
+                    }\r
+                }\r
+            }\r
+        },\r
+\r
+    /**\r
+     * Returns the handle registered for a DOM Node by id\r
+     * @param {String/HTMLElement} id The DOM node or id to look up\r
+     * @return {Object} handle The custom handle data\r
+     */\r
+        getHandle : function(id){\r
+            if(typeof id != "string"){ // must be element?\r
+                id = id.id;\r
+            }\r
+            return handles[id];\r
+        },\r
+\r
+    /**\r
+     * Returns the handle that is registered for the DOM node that is the target of the event\r
+     * @param {Event} e The event\r
+     * @return {Object} handle The custom handle data\r
+     */\r
+        getHandleFromEvent : function(e){\r
+            var t = Ext.lib.Event.getTarget(e);\r
+            return t ? handles[t.id] : null;\r
+        },\r
+\r
+    /**\r
+     * Returns a custom data object that is registered for a DOM node by id\r
+     * @param {String/HTMLElement} id The DOM node or id to look up\r
+     * @return {Object} data The custom data\r
+     */\r
+        getTarget : function(id){\r
+            if(typeof id != "string"){ // must be element?\r
+                id = id.id;\r
+            }\r
+            return elements[id];\r
+        },\r
+\r
+    /**\r
+     * Returns a custom data object that is registered for the DOM node that is the target of the event\r
+     * @param {Event} e The event\r
+     * @return {Object} data The custom data\r
+     */\r
+        getTargetFromEvent : function(e){\r
+            var t = Ext.lib.Event.getTarget(e);\r
+            return t ? elements[t.id] || handles[t.id] : null;\r
+        }\r
+    };\r
+}();/**\r
+ * @class Ext.dd.StatusProxy\r
+ * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair.  This is the\r
+ * default drag proxy used by all Ext.dd components.\r
  * @constructor\r
  * @param {Object} config\r
- * @xtype xmlstore\r
  */\r
-Ext.data.XmlStore = Ext.extend(Ext.data.Store, {\r
+Ext.dd.StatusProxy = function(config){\r
+    Ext.apply(this, config);\r
+    this.id = this.id || Ext.id();\r
+    this.el = new Ext.Layer({\r
+        dh: {\r
+            id: this.id, tag: "div", cls: "x-dd-drag-proxy "+this.dropNotAllowed, children: [\r
+                {tag: "div", cls: "x-dd-drop-icon"},\r
+                {tag: "div", cls: "x-dd-drag-ghost"}\r
+            ]\r
+        }, \r
+        shadow: !config || config.shadow !== false\r
+    });\r
+    this.ghost = Ext.get(this.el.dom.childNodes[1]);\r
+    this.dropStatus = this.dropNotAllowed;\r
+};\r
+\r
+Ext.dd.StatusProxy.prototype = {\r
+    /**\r
+     * @cfg {String} dropAllowed\r
+     * The CSS class to apply to the status element when drop is allowed (defaults to "x-dd-drop-ok").\r
+     */\r
+    dropAllowed : "x-dd-drop-ok",\r
+    /**\r
+     * @cfg {String} dropNotAllowed\r
+     * The CSS class to apply to the status element when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
+     */\r
+    dropNotAllowed : "x-dd-drop-nodrop",\r
+\r
+    /**\r
+     * Updates the proxy's visual element to indicate the status of whether or not drop is allowed\r
+     * over the current target element.\r
+     * @param {String} cssClass The css class for the new drop status indicator image\r
+     */\r
+    setStatus : function(cssClass){\r
+        cssClass = cssClass || this.dropNotAllowed;\r
+        if(this.dropStatus != cssClass){\r
+            this.el.replaceClass(this.dropStatus, cssClass);\r
+            this.dropStatus = cssClass;\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Resets the status indicator to the default dropNotAllowed value\r
+     * @param {Boolean} clearGhost True to also remove all content from the ghost, false to preserve it\r
+     */\r
+    reset : function(clearGhost){\r
+        this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed;\r
+        this.dropStatus = this.dropNotAllowed;\r
+        if(clearGhost){\r
+            this.ghost.update("");\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Updates the contents of the ghost element\r
+     * @param {String/HTMLElement} html The html that will replace the current innerHTML of the ghost element, or a\r
+     * DOM node to append as the child of the ghost element (in which case the innerHTML will be cleared first).\r
+     */\r
+    update : function(html){\r
+        if(typeof html == "string"){\r
+            this.ghost.update(html);\r
+        }else{\r
+            this.ghost.update("");\r
+            html.style.margin = "0";\r
+            this.ghost.dom.appendChild(html);\r
+        }\r
+        var el = this.ghost.dom.firstChild; \r
+        if(el){\r
+            Ext.fly(el).setStyle('float', 'none');\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Returns the underlying proxy {@link Ext.Layer}\r
+     * @return {Ext.Layer} el\r
+    */\r
+    getEl : function(){\r
+        return this.el;\r
+    },\r
+\r
     /**\r
-     * @cfg {Ext.data.DataReader} reader @hide\r
+     * Returns the ghost element\r
+     * @return {Ext.Element} el\r
      */\r
-    constructor: function(config){\r
-        Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, {\r
-            reader: new Ext.data.XmlReader(config)\r
-        }));\r
+    getGhost : function(){\r
+        return this.ghost;\r
+    },\r
+\r
+    /**\r
+     * Hides the proxy\r
+     * @param {Boolean} clear True to reset the status and clear the ghost contents, false to preserve them\r
+     */\r
+    hide : function(clear){\r
+        this.el.hide();\r
+        if(clear){\r
+            this.reset(true);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Stops the repair animation if it's currently running\r
+     */\r
+    stop : function(){\r
+        if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){\r
+            this.anim.stop();\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Displays this proxy\r
+     */\r
+    show : function(){\r
+        this.el.show();\r
+    },\r
+\r
+    /**\r
+     * Force the Layer to sync its shadow and shim positions to the element\r
+     */\r
+    sync : function(){\r
+        this.el.sync();\r
+    },\r
+\r
+    /**\r
+     * Causes the proxy to return to its position of origin via an animation.  Should be called after an\r
+     * invalid drop operation by the item being dragged.\r
+     * @param {Array} xy The XY position of the element ([x, y])\r
+     * @param {Function} callback The function to call after the repair is complete.\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
+     */\r
+    repair : function(xy, callback, scope){\r
+        this.callback = callback;\r
+        this.scope = scope;\r
+        if(xy && this.animRepair !== false){\r
+            this.el.addClass("x-dd-drag-repair");\r
+            this.el.hideUnders(true);\r
+            this.anim = this.el.shift({\r
+                duration: this.repairDuration || .5,\r
+                easing: 'easeOut',\r
+                xy: xy,\r
+                stopFx: true,\r
+                callback: this.afterRepair,\r
+                scope: this\r
+            });\r
+        }else{\r
+            this.afterRepair();\r
+        }\r
+    },\r
+\r
+    // private\r
+    afterRepair : function(){\r
+        this.hide(true);\r
+        if(typeof this.callback == "function"){\r
+            this.callback.call(this.scope || this);\r
+        }\r
+        this.callback = null;\r
+        this.scope = null;\r
+    },\r
+    \r
+    destroy: function(){\r
+        Ext.destroy(this.ghost, this.el);    \r
     }\r
-});\r
-Ext.reg('xmlstore', Ext.data.XmlStore);/**\r
- * @class Ext.data.GroupingStore\r
- * @extends Ext.data.Store\r
- * A specialized store implementation that provides for grouping records by one of the available fields. This\r
- * is usually used in conjunction with an {@link Ext.grid.GroupingView} to proved the data model for\r
- * a grouped GridPanel.\r
+};/**\r
+ * @class Ext.dd.DragSource\r
+ * @extends Ext.dd.DDProxy\r
+ * A simple class that provides the basic implementation needed to make any element draggable.\r
  * @constructor\r
- * Creates a new GroupingStore.\r
- * @param {Object} config A config object containing the objects needed for the Store to access data,\r
- * and read the data into Records.\r
- * @xtype groupingstore\r
+ * @param {Mixed} el The container element\r
+ * @param {Object} config\r
  */\r
-Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {\r
+Ext.dd.DragSource = function(el, config){\r
+    this.el = Ext.get(el);\r
+    if(!this.dragData){\r
+        this.dragData = {};\r
+    }\r
     \r
-    //inherit docs\r
-    constructor: function(config){\r
-        Ext.data.GroupingStore.superclass.constructor.call(this, config);\r
-        this.applyGroupField();\r
-    },\r
+    Ext.apply(this, config);\r
+    \r
+    if(!this.proxy){\r
+        this.proxy = new Ext.dd.StatusProxy();\r
+    }\r
+    Ext.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, \r
+          {dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true});\r
     \r
+    this.dragging = false;\r
+};\r
+\r
+Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, {\r
     /**\r
-     * @cfg {String} groupField\r
-     * The field name by which to sort the store's data (defaults to '').\r
+     * @cfg {String} ddGroup\r
+     * A named drag drop group to which this object belongs.  If a group is specified, then this object will only\r
+     * interact with other drag drop objects in the same group (defaults to undefined).\r
      */\r
     /**\r
-     * @cfg {Boolean} remoteGroup\r
-     * True if the grouping should apply on the server side, false if it is local only (defaults to false).  If the\r
-     * grouping is local, it can be applied immediately to the data.  If it is remote, then it will simply act as a\r
-     * helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call.\r
+     * @cfg {String} dropAllowed\r
+     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").\r
      */\r
-    remoteGroup : false,\r
+    dropAllowed : "x-dd-drop-ok",\r
     /**\r
-     * @cfg {Boolean} groupOnSort\r
-     * True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the\r
-     * existing sort info (defaults to false).\r
+     * @cfg {String} dropNotAllowed\r
+     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
      */\r
-    groupOnSort:false,\r
+    dropNotAllowed : "x-dd-drop-nodrop",\r
 \r
-       groupDir : 'ASC',\r
-       \r
     /**\r
-     * Clears any existing grouping and refreshes the data using the default sort.\r
+     * Returns the data object associated with this drag source\r
+     * @return {Object} data An object containing arbitrary data\r
      */\r
-    clearGrouping : function(){\r
-        this.groupField = false;\r
-        if(this.remoteGroup){\r
-            if(this.baseParams){\r
-                delete this.baseParams.groupBy;\r
+    getDragData : function(e){\r
+        return this.dragData;\r
+    },\r
+\r
+    // private\r
+    onDragEnter : function(e, id){\r
+        var target = Ext.dd.DragDropMgr.getDDById(id);\r
+        this.cachedTarget = target;\r
+        if(this.beforeDragEnter(target, e, id) !== false){\r
+            if(target.isNotifyTarget){\r
+                var status = target.notifyEnter(this, e, this.dragData);\r
+                this.proxy.setStatus(status);\r
+            }else{\r
+                this.proxy.setStatus(this.dropAllowed);\r
             }\r
-            var lo = this.lastOptions;\r
-            if(lo && lo.params){\r
-                delete lo.params.groupBy;\r
+            \r
+            if(this.afterDragEnter){\r
+                /**\r
+                 * An empty function by default, but provided so that you can perform a custom action\r
+                 * when the dragged item enters the drop target by providing an implementation.\r
+                 * @param {Ext.dd.DragDrop} target The drop target\r
+                 * @param {Event} e The event object\r
+                 * @param {String} id The id of the dragged element\r
+                 * @method afterDragEnter\r
+                 */\r
+                this.afterDragEnter(target, e, id);\r
             }\r
-            this.reload();\r
-        }else{\r
-            this.applySort();\r
-            this.fireEvent('datachanged', this);\r
         }\r
     },\r
 \r
     /**\r
-     * Groups the data by the specified field.\r
-     * @param {String} field The field name by which to sort the store's data\r
-     * @param {Boolean} forceRegroup (optional) True to force the group to be refreshed even if the field passed\r
-     * in is the same as the current grouping field, false to skip grouping on the same field (defaults to false)\r
+     * An empty function by default, but provided so that you can perform a custom action\r
+     * before the dragged item enters the drop target and optionally cancel the onDragEnter.\r
+     * @param {Ext.dd.DragDrop} target The drop target\r
+     * @param {Event} e The event object\r
+     * @param {String} id The id of the dragged element\r
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
      */\r
-    groupBy : function(field, forceRegroup, direction){\r
-               direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;\r
-        if(this.groupField == field && this.groupDir == direction && !forceRegroup){\r
-            return; // already grouped by this field\r
-        }\r
-        this.groupField = field;\r
-               this.groupDir = direction;\r
-        this.applyGroupField();\r
-        if(this.groupOnSort){\r
-            this.sort(field, direction);\r
-            return;\r
+    beforeDragEnter : function(target, e, id){\r
+        return true;\r
+    },\r
+\r
+    // private\r
+    alignElWithMouse: function() {\r
+        Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments);\r
+        this.proxy.sync();\r
+    },\r
+\r
+    // private\r
+    onDragOver : function(e, id){\r
+        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
+        if(this.beforeDragOver(target, e, id) !== false){\r
+            if(target.isNotifyTarget){\r
+                var status = target.notifyOver(this, e, this.dragData);\r
+                this.proxy.setStatus(status);\r
+            }\r
+\r
+            if(this.afterDragOver){\r
+                /**\r
+                 * An empty function by default, but provided so that you can perform a custom action\r
+                 * while the dragged item is over the drop target by providing an implementation.\r
+                 * @param {Ext.dd.DragDrop} target The drop target\r
+                 * @param {Event} e The event object\r
+                 * @param {String} id The id of the dragged element\r
+                 * @method afterDragOver\r
+                 */\r
+                this.afterDragOver(target, e, id);\r
+            }\r
         }\r
-        if(this.remoteGroup){\r
-            this.reload();\r
-        }else{\r
-            var si = this.sortInfo || {};\r
-            if(si.field != field || si.direction != direction){\r
-                this.applySort();\r
-            }else{\r
-                this.sortData(field, direction);\r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action\r
+     * while the dragged item is over the drop target and optionally cancel the onDragOver.\r
+     * @param {Ext.dd.DragDrop} target The drop target\r
+     * @param {Event} e The event object\r
+     * @param {String} id The id of the dragged element\r
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
+     */\r
+    beforeDragOver : function(target, e, id){\r
+        return true;\r
+    },\r
+\r
+    // private\r
+    onDragOut : function(e, id){\r
+        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
+        if(this.beforeDragOut(target, e, id) !== false){\r
+            if(target.isNotifyTarget){\r
+                target.notifyOut(this, e, this.dragData);\r
+            }\r
+            this.proxy.reset();\r
+            if(this.afterDragOut){\r
+                /**\r
+                 * An empty function by default, but provided so that you can perform a custom action\r
+                 * after the dragged item is dragged out of the target without dropping.\r
+                 * @param {Ext.dd.DragDrop} target The drop target\r
+                 * @param {Event} e The event object\r
+                 * @param {String} id The id of the dragged element\r
+                 * @method afterDragOut\r
+                 */\r
+                this.afterDragOut(target, e, id);\r
             }\r
-            this.fireEvent('datachanged', this);\r
         }\r
+        this.cachedTarget = null;\r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action before the dragged\r
+     * item is dragged out of the target without dropping, and optionally cancel the onDragOut.\r
+     * @param {Ext.dd.DragDrop} target The drop target\r
+     * @param {Event} e The event object\r
+     * @param {String} id The id of the dragged element\r
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
+     */\r
+    beforeDragOut : function(target, e, id){\r
+        return true;\r
     },\r
     \r
     // private\r
-    applyGroupField: function(){\r
-        if(this.remoteGroup){\r
-            if(!this.baseParams){\r
-                this.baseParams = {};\r
+    onDragDrop : function(e, id){\r
+        var target = this.cachedTarget || Ext.dd.DragDropMgr.getDDById(id);\r
+        if(this.beforeDragDrop(target, e, id) !== false){\r
+            if(target.isNotifyTarget){\r
+                if(target.notifyDrop(this, e, this.dragData)){ // valid drop?\r
+                    this.onValidDrop(target, e, id);\r
+                }else{\r
+                    this.onInvalidDrop(target, e, id);\r
+                }\r
+            }else{\r
+                this.onValidDrop(target, e, id);\r
+            }\r
+            \r
+            if(this.afterDragDrop){\r
+                /**\r
+                 * An empty function by default, but provided so that you can perform a custom action\r
+                 * after a valid drag drop has occurred by providing an implementation.\r
+                 * @param {Ext.dd.DragDrop} target The drop target\r
+                 * @param {Event} e The event object\r
+                 * @param {String} id The id of the dropped element\r
+                 * @method afterDragDrop\r
+                 */\r
+                this.afterDragDrop(target, e, id);\r
             }\r
-            this.baseParams.groupBy = this.groupField;\r
-            this.baseParams.groupDir = this.groupDir;\r
         }\r
+        delete this.cachedTarget;\r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action before the dragged\r
+     * item is dropped onto the target and optionally cancel the onDragDrop.\r
+     * @param {Ext.dd.DragDrop} target The drop target\r
+     * @param {Event} e The event object\r
+     * @param {String} id The id of the dragged element\r
+     * @return {Boolean} isValid True if the drag drop event is valid, else false to cancel\r
+     */\r
+    beforeDragDrop : function(target, e, id){\r
+        return true;\r
     },\r
 \r
     // private\r
-    applySort : function(){\r
-        Ext.data.GroupingStore.superclass.applySort.call(this);\r
-        if(!this.groupOnSort && !this.remoteGroup){\r
-            var gs = this.getGroupState();\r
-            if(gs && (gs != this.sortInfo.field || this.groupDir != this.sortInfo.direction)){\r
-                this.sortData(this.groupField, this.groupDir);\r
-            }\r
+    onValidDrop : function(target, e, id){\r
+        this.hideProxy();\r
+        if(this.afterValidDrop){\r
+            /**\r
+             * An empty function by default, but provided so that you can perform a custom action\r
+             * after a valid drop has occurred by providing an implementation.\r
+             * @param {Object} target The target DD \r
+             * @param {Event} e The event object\r
+             * @param {String} id The id of the dropped element\r
+             * @method afterInvalidDrop\r
+             */\r
+            this.afterValidDrop(target, e, id);\r
         }\r
     },\r
 \r
     // private\r
-    applyGrouping : function(alwaysFireChange){\r
-        if(this.groupField !== false){\r
-            this.groupBy(this.groupField, true, this.groupDir);\r
-            return true;\r
-        }else{\r
-            if(alwaysFireChange === true){\r
-                this.fireEvent('datachanged', this);\r
+    getRepairXY : function(e, data){\r
+        return this.el.getXY();  \r
+    },\r
+\r
+    // private\r
+    onInvalidDrop : function(target, e, id){\r
+        this.beforeInvalidDrop(target, e, id);\r
+        if(this.cachedTarget){\r
+            if(this.cachedTarget.isNotifyTarget){\r
+                this.cachedTarget.notifyOut(this, e, this.dragData);\r
             }\r
-            return false;\r
+            this.cacheTarget = null;\r
+        }\r
+        this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this);\r
+\r
+        if(this.afterInvalidDrop){\r
+            /**\r
+             * An empty function by default, but provided so that you can perform a custom action\r
+             * after an invalid drop has occurred by providing an implementation.\r
+             * @param {Event} e The event object\r
+             * @param {String} id The id of the dropped element\r
+             * @method afterInvalidDrop\r
+             */\r
+            this.afterInvalidDrop(e, id);\r
         }\r
     },\r
 \r
     // private\r
-    getGroupState : function(){\r
-        return this.groupOnSort && this.groupField !== false ?\r
-               (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField;\r
+    afterRepair : function(){\r
+        if(Ext.enableFx){\r
+            this.el.highlight(this.hlColor || "c3daf9");\r
+        }\r
+        this.dragging = false;\r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action after an invalid\r
+     * drop has occurred.\r
+     * @param {Ext.dd.DragDrop} target The drop target\r
+     * @param {Event} e The event object\r
+     * @param {String} id The id of the dragged element\r
+     * @return {Boolean} isValid True if the invalid drop should proceed, else false to cancel\r
+     */\r
+    beforeInvalidDrop : function(target, e, id){\r
+        return true;\r
+    },\r
+\r
+    // private\r
+    handleMouseDown : function(e){\r
+        if(this.dragging) {\r
+            return;\r
+        }\r
+        var data = this.getDragData(e);\r
+        if(data && this.onBeforeDrag(data, e) !== false){\r
+            this.dragData = data;\r
+            this.proxy.stop();\r
+            Ext.dd.DragSource.superclass.handleMouseDown.apply(this, arguments);\r
+        } \r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action before the initial\r
+     * drag event begins and optionally cancel it.\r
+     * @param {Object} data An object containing arbitrary data to be shared with drop targets\r
+     * @param {Event} e The event object\r
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel\r
+     */\r
+    onBeforeDrag : function(data, e){\r
+        return true;\r
+    },\r
+\r
+    /**\r
+     * An empty function by default, but provided so that you can perform a custom action once the initial\r
+     * drag event has begun.  The drag cannot be canceled from this function.\r
+     * @param {Number} x The x position of the click on the dragged object\r
+     * @param {Number} y The y position of the click on the dragged object\r
+     */\r
+    onStartDrag : Ext.emptyFn,\r
+\r
+    // private override\r
+    startDrag : function(x, y){\r
+        this.proxy.reset();\r
+        this.dragging = true;\r
+        this.proxy.update("");\r
+        this.onInitDrag(x, y);\r
+        this.proxy.show();\r
+    },\r
+\r
+    // private\r
+    onInitDrag : function(x, y){\r
+        var clone = this.el.dom.cloneNode(true);\r
+        clone.id = Ext.id(); // prevent duplicate ids\r
+        this.proxy.update(clone);\r
+        this.onStartDrag(x, y);\r
+        return true;\r
+    },\r
+\r
+    /**\r
+     * Returns the drag source's underlying {@link Ext.dd.StatusProxy}\r
+     * @return {Ext.dd.StatusProxy} proxy The StatusProxy\r
+     */\r
+    getProxy : function(){\r
+        return this.proxy;  \r
+    },\r
+\r
+    /**\r
+     * Hides the drag source's {@link Ext.dd.StatusProxy}\r
+     */\r
+    hideProxy : function(){\r
+        this.proxy.hide();  \r
+        this.proxy.reset(true);\r
+        this.dragging = false;\r
+    },\r
+\r
+    // private\r
+    triggerCacheRefresh : function(){\r
+        Ext.dd.DDM.refreshCache(this.groups);\r
+    },\r
+\r
+    // private - override to prevent hiding\r
+    b4EndDrag: function(e) {\r
+    },\r
+\r
+    // private - override to prevent moving\r
+    endDrag : function(e){\r
+        this.onEndDrag(this.dragData, e);\r
+    },\r
+\r
+    // private\r
+    onEndDrag : function(data, e){\r
+    },\r
+    \r
+    // private - pin to cursor\r
+    autoOffset : function(x, y) {\r
+        this.setDelta(-12, -20);\r
+    },\r
+    \r
+    destroy: function(){\r
+        Ext.dd.DragSource.superclass.destroy.call(this);\r
+        Ext.destroy(this.proxy);\r
     }\r
-});\r
-Ext.reg('groupingstore', Ext.data.GroupingStore);/**\r
- * @class Ext.data.DirectProxy\r
- * @extends Ext.data.DataProxy\r
+});/**\r
+ * @class Ext.dd.DropTarget\r
+ * @extends Ext.dd.DDTarget\r
+ * A simple class that provides the basic implementation needed to make any element a drop target that can have\r
+ * draggable items dropped onto it.  The drop has no effect until an implementation of notifyDrop is provided.\r
+ * @constructor\r
+ * @param {Mixed} el The container element\r
+ * @param {Object} config\r
  */\r
-Ext.data.DirectProxy = function(config){\r
+Ext.dd.DropTarget = function(el, config){\r
+    this.el = Ext.get(el);\r
+    \r
     Ext.apply(this, config);\r
-    if(typeof this.paramOrder == 'string'){\r
-        this.paramOrder = this.paramOrder.split(/[\s,|]/);\r
+    \r
+    if(this.containerScroll){\r
+        Ext.dd.ScrollManager.register(this.el);\r
     }\r
-    Ext.data.DirectProxy.superclass.constructor.call(this, config);\r
+    \r
+    Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, \r
+          {isTarget: true});\r
+\r
 };\r
 \r
-Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, {\r
+Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, {\r
     /**\r
-     * @cfg {Array/String} paramOrder Defaults to <tt>undefined</tt>. A list of params to be executed\r
-     * server side.  Specify the params in the order in which they must be executed on the server-side\r
-     * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace,\r
-     * comma, or pipe. For example,\r
-     * any of the following would be acceptable:<pre><code>\r
-paramOrder: ['param1','param2','param3']\r
-paramOrder: 'param1 param2 param3'\r
-paramOrder: 'param1,param2,param3'\r
-paramOrder: 'param1|param2|param'\r
-     </code></pre>\r
+     * @cfg {String} ddGroup\r
+     * A named drag drop group to which this object belongs.  If a group is specified, then this object will only\r
+     * interact with other drag drop objects in the same group (defaults to undefined).\r
      */\r
-    paramOrder: undefined,\r
-\r
     /**\r
-     * @cfg {Boolean} paramsAsHash\r
-     * Send parameters as a collection of named arguments (defaults to <tt>true</tt>). Providing a\r
-     * <tt>{@link #paramOrder}</tt> nullifies this configuration.\r
+     * @cfg {String} overClass\r
+     * The CSS class applied to the drop target element while the drag source is over it (defaults to "").\r
      */\r
-    paramsAsHash: true,\r
-\r
     /**\r
-     * @cfg {Function} directFn\r
-     * Function to call when executing a request.  directFn is a simple alternative to defining the api configuration-parameter\r
-     * for Store's which will not implement a full CRUD api.\r
+     * @cfg {String} dropAllowed\r
+     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").\r
      */\r
-    directFn : undefined,\r
-\r
-    // protected\r
-    doRequest : function(action, rs, params, reader, callback, scope, options) {\r
-        var args = [];\r
-        var directFn = this.api[action] || this.directFn;\r
+    dropAllowed : "x-dd-drop-ok",\r
+    /**\r
+     * @cfg {String} dropNotAllowed\r
+     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").\r
+     */\r
+    dropNotAllowed : "x-dd-drop-nodrop",\r
 \r
-        switch (action) {\r
-            case Ext.data.Api.actions.create:\r
-                args.push(params[reader.meta.root]);           // <-- create(Hash)\r
-                break;\r
-            case Ext.data.Api.actions.read:\r
-                if(this.paramOrder){\r
-                    for(var i = 0, len = this.paramOrder.length; i < len; i++){\r
-                        args.push(params[this.paramOrder[i]]);\r
-                    }\r
-                }else if(this.paramsAsHash){\r
-                    args.push(params);\r
-                }\r
-                break;\r
-            case Ext.data.Api.actions.update:\r
-                args.push(params[reader.meta.idProperty]);  // <-- save(Integer/Integer[], Hash/Hash[])\r
-                args.push(params[reader.meta.root]);\r
-                break;\r
-            case Ext.data.Api.actions.destroy:\r
-                args.push(params[reader.meta.root]);        // <-- destroy(Int/Int[])\r
-                break;\r
-        }\r
+    // private\r
+    isTarget : true,\r
 \r
-        var trans = {\r
-            params : params || {},\r
-            callback : callback,\r
-            scope : scope,\r
-            arg : options,\r
-            reader: reader\r
-        };\r
+    // private\r
+    isNotifyTarget : true,\r
 \r
-        args.push(this.createCallback(action, rs, trans), this);\r
-        directFn.apply(window, args);\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the\r
+     * target.  This default implementation adds the CSS class specified by overClass (if any) to the drop element\r
+     * and returns the dropAllowed config value.  This method should be overridden if drop validation is required.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     */\r
+    notifyEnter : function(dd, e, data){\r
+        if(this.overClass){\r
+            this.el.addClass(this.overClass);\r
+        }\r
+        return this.dropAllowed;\r
     },\r
 \r
-    // private\r
-    createCallback : function(action, rs, trans) {\r
-        return function(result, res) {\r
-            if (!res.status) {\r
-                // @deprecated fire loadexception\r
-                if (action === Ext.data.Api.actions.read) {\r
-                    this.fireEvent("loadexception", this, trans, res, null);\r
-                }\r
-                this.fireEvent('exception', this, 'remote', action, trans, res, null);\r
-                trans.callback.call(trans.scope, null, trans.arg, false);\r
-                return;\r
-            }\r
-            if (action === Ext.data.Api.actions.read) {\r
-                this.onRead(action, trans, result, res);\r
-            } else {\r
-                this.onWrite(action, trans, result, res, rs);\r
-            }\r
-        };\r
-    },\r
     /**\r
-     * Callback for read actions\r
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
-     * @param {Object} trans The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
+     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target.\r
+     * This method will be called on every mouse movement while the drag source is over the drop target.\r
+     * This default implementation simply returns the dropAllowed config value.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
      */\r
-    onRead : function(action, trans, result, res) {\r
-        var records;\r
-        try {\r
-            records = trans.reader.readRecords(result);\r
-        }\r
-        catch (ex) {\r
-            // @deprecated: Fire old loadexception for backwards-compat.\r
-            this.fireEvent("loadexception", this, trans, res, ex);\r
+    notifyOver : function(dd, e, data){\r
+        return this.dropAllowed;\r
+    },\r
 \r
-            this.fireEvent('exception', this, 'response', action, trans, res, ex);\r
-            trans.callback.call(trans.scope, null, trans.arg, false);\r
-            return;\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged\r
+     * out of the target without dropping.  This default implementation simply removes the CSS class specified by\r
+     * overClass (if any) from the drop element.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     */\r
+    notifyOut : function(dd, e, data){\r
+        if(this.overClass){\r
+            this.el.removeClass(this.overClass);\r
         }\r
-        this.fireEvent("load", this, res, trans.arg);\r
-        trans.callback.call(trans.scope, records, trans.arg, true);\r
     },\r
+\r
     /**\r
-     * Callback for write actions\r
-     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
-     * @param {Object} trans The request transaction object\r
-     * @param {Object} res The server response\r
-     * @private\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has\r
+     * been dropped on it.  This method has no default implementation and returns false, so you must provide an\r
+     * implementation that does something to process the drop event and returns true so that the drag source's\r
+     * repair action does not run.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {Boolean} True if the drop was valid, else false\r
      */\r
-    onWrite : function(action, trans, result, res, rs) {\r
-        this.fireEvent("write", this, action, result, res, rs, trans.arg);\r
-        trans.callback.call(trans.scope, result, res, true);\r
+    notifyDrop : function(dd, e, data){\r
+        return false;\r
     }\r
-});\r
+});/**\r
+ * @class Ext.dd.DragZone\r
+ * @extends Ext.dd.DragSource\r
+ * <p>This class provides a container DD instance that allows dragging of multiple child source nodes.</p>\r
+ * <p>This class does not move the drag target nodes, but a proxy element which may contain\r
+ * any DOM structure you wish. The DOM element to show in the proxy is provided by either a\r
+ * provided implementation of {@link #getDragData}, or by registered draggables registered with {@link Ext.dd.Registry}</p>\r
+ * <p>If you wish to provide draggability for an arbitrary number of DOM nodes, each of which represent some\r
+ * application object (For example nodes in a {@link Ext.DataView DataView}) then use of this class\r
+ * is the most efficient way to "activate" those nodes.</p>\r
+ * <p>By default, this class requires that draggable child nodes are registered with {@link Ext.dd.Registry}.\r
+ * However a simpler way to allow a DragZone to manage any number of draggable elements is to configure\r
+ * the DragZone with  an implementation of the {@link #getDragData} method which interrogates the passed\r
+ * mouse event to see if it has taken place within an element, or class of elements. This is easily done\r
+ * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a\r
+ * {@link Ext.DomQuery} selector. For example, to make the nodes of a DataView draggable, use the following\r
+ * technique. Knowledge of the use of the DataView is required:</p><pre><code>\r
+myDataView.on('render', function(v) {\r
+    myDataView.dragZone = new Ext.dd.DragZone(v.getEl(), {\r
 \r
-/**\r
- * @class Ext.data.DirectStore\r
- * @extends Ext.data.Store\r
- * <p>Small helper class to create an {@link Ext.data.Store} configured with an\r
- * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting\r
- * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier.\r
- * To create a different proxy/reader combination create a basic {@link Ext.data.Store}\r
- * configured as needed.</p>\r
- *\r
- * <p><b>*Note:</b> Although they are not listed, this class inherits all of the config options of:</p>\r
- * <div><ul class="mdetail-params">\r
- * <li><b>{@link Ext.data.Store Store}</b></li>\r
- * <div class="sub-desc"><ul class="mdetail-params">\r
- *\r
- * </ul></div>\r
- * <li><b>{@link Ext.data.JsonReader JsonReader}</b></li>\r
- * <div class="sub-desc"><ul class="mdetail-params">\r
- * <li><tt><b>{@link Ext.data.JsonReader#root root}</b></tt></li>\r
- * <li><tt><b>{@link Ext.data.JsonReader#idProperty idProperty}</b></tt></li>\r
- * <li><tt><b>{@link Ext.data.JsonReader#totalProperty totalProperty}</b></tt></li>\r
- * </ul></div>\r
- *\r
- * <li><b>{@link Ext.data.DirectProxy DirectProxy}</b></li>\r
- * <div class="sub-desc"><ul class="mdetail-params">\r
- * <li><tt><b>{@link Ext.data.DirectProxy#directFn directFn}</b></tt></li>\r
- * <li><tt><b>{@link Ext.data.DirectProxy#paramOrder paramOrder}</b></tt></li>\r
- * <li><tt><b>{@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}</b></tt></li>\r
- * </ul></div>\r
- * </ul></div>\r
- *\r
- * @xtype directstore\r
- *\r
+//      On receipt of a mousedown event, see if it is within a DataView node.\r
+//      Return a drag data object if so.\r
+        getDragData: function(e) {\r
+\r
+//          Use the DataView's own itemSelector (a mandatory property) to\r
+//          test if the mousedown is within one of the DataView's nodes.\r
+            var sourceEl = e.getTarget(v.itemSelector, 10);\r
+\r
+//          If the mousedown is within a DataView node, clone the node to produce\r
+//          a ddel element for use by the drag proxy. Also add application data\r
+//          to the returned data object.\r
+            if (sourceEl) {\r
+                d = sourceEl.cloneNode(true);\r
+                d.id = Ext.id();\r
+                return {\r
+                    ddel: d,\r
+                    sourceEl: sourceEl,\r
+                    repairXY: Ext.fly(sourceEl).getXY(),\r
+                    sourceStore: v.store,\r
+                    draggedRecord: v.{@link Ext.DataView#getRecord getRecord}(sourceEl)\r
+                }\r
+            }\r
+        },\r
+\r
+//      Provide coordinates for the proxy to slide back to on failed drag.\r
+//      This is the original XY coordinates of the draggable element captured\r
+//      in the getDragData method.\r
+        getRepairXY: function() {\r
+            return this.dragData.repairXY;\r
+        }\r
+    });\r
+});</code></pre>\r
+ * See the {@link Ext.dd.DropZone DropZone} documentation for details about building a DropZone which\r
+ * cooperates with this DragZone.\r
  * @constructor\r
+ * @param {Mixed} el The container element\r
  * @param {Object} config\r
  */\r
-Ext.data.DirectStore = function(c){\r
-    // each transaction upon a singe record will generatie a distinct Direct transaction since Direct queues them into one Ajax request.\r
-    c.batchTransactions = false;\r
-\r
-    Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, {\r
-        proxy: (typeof(c.proxy) == 'undefined') ? new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')) : c.proxy,\r
-        reader: (typeof(c.reader) == 'undefined' && typeof(c.fields) == 'object') ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader\r
-    }));\r
+Ext.dd.DragZone = function(el, config){\r
+    Ext.dd.DragZone.superclass.constructor.call(this, el, config);\r
+    if(this.containerScroll){\r
+        Ext.dd.ScrollManager.register(this.el);\r
+    }\r
 };\r
-Ext.extend(Ext.data.DirectStore, Ext.data.Store, {});\r
-Ext.reg('directstore', Ext.data.DirectStore);
-/**\r
- * @class Ext.Direct\r
- * @extends Ext.util.Observable\r
- * <p><b><u>Overview</u></b></p>\r
- * \r
- * <p>Ext.Direct aims to streamline communication between the client and server\r
- * by providing a single interface that reduces the amount of common code\r
- * typically required to validate data and handle returned data packets\r
- * (reading data, error conditions, etc).</p>\r
- *  \r
- * <p>The Ext.direct namespace includes several classes for a closer integration\r
- * with the server-side. The Ext.data namespace also includes classes for working\r
- * with Ext.data.Stores which are backed by data from an Ext.Direct method.</p>\r
- * \r
- * <p><b><u>Specification</u></b></p>\r
- * \r
- * <p>For additional information consult the \r
- * <a href="http://extjs.com/products/extjs/direct.php">Ext.Direct Specification</a>.</p>\r
- *   \r
- * <p><b><u>Providers</u></b></p>\r
- * \r
- * <p>Ext.Direct uses a provider architecture, where one or more providers are\r
- * used to transport data to and from the server. There are several providers\r
- * that exist in the core at the moment:</p><div class="mdetail-params"><ul>\r
- * \r
- * <li>{@link Ext.direct.JsonProvider JsonProvider} for simple JSON operations</li>\r
- * <li>{@link Ext.direct.PollingProvider PollingProvider} for repeated requests</li>\r
- * <li>{@link Ext.direct.RemotingProvider RemotingProvider} exposes server side\r
- * on the client.</li>\r
- * </ul></div>\r
- * \r
- * <p>A provider does not need to be invoked directly, providers are added via\r
- * {@link Ext.Direct}.{@link Ext.Direct#add add}.</p>\r
- * \r
- * <p><b><u>Router</u></b></p>\r
- * \r
- * <p>Ext.Direct utilizes a "router" on the server to direct requests from the client\r
- * to the appropriate server-side method. Because the Ext.Direct API is completely\r
- * platform-agnostic, you could completely swap out a Java based server solution\r
- * and replace it with one that uses C# without changing the client side JavaScript\r
- * at all.</p>\r
- * \r
- * <p><b><u>Server side events</u></b></p>\r
- * \r
- * <p>Custom events from the server may be handled by the client by adding\r
- * listeners, for example:</p>\r
- * <pre><code>\r
-{"type":"event","name":"message","data":"Successfully polled at: 11:19:30 am"}\r
 \r
-// add a handler for a 'message' event sent by the server \r
-Ext.Direct.on('message', function(e){\r
-    out.append(String.format('&lt;p>&lt;i>{0}&lt;/i>&lt;/p>', e.data));\r
-            out.el.scrollTo('t', 100000, true);\r
-});\r
- * </code></pre>\r
- * @singleton\r
- */\r
-Ext.Direct = Ext.extend(Ext.util.Observable, {\r
+Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, {\r
     /**\r
-     * Each event type implements a getData() method. The default event types are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>event</tt></b> : Ext.Direct.Event</li>\r
-     * <li><b><tt>exception</tt></b> : Ext.Direct.ExceptionEvent</li>\r
-     * <li><b><tt>rpc</tt></b> : Ext.Direct.RemotingEvent</li>\r
-     * </ul></div>\r
-     * @property eventTypes\r
+     * This property contains the data representing the dragged object. This data is set up by the implementation\r
+     * of the {@link #getDragData} method. It must contain a <tt>ddel</tt> property, but can contain\r
+     * any other data according to the application's needs.\r
      * @type Object\r
+     * @property dragData\r
+     */\r
+    /**\r
+     * @cfg {Boolean} containerScroll True to register this container with the Scrollmanager\r
+     * for auto scrolling during drag operations.\r
+     */\r
+    /**\r
+     * @cfg {String} hlColor The color to use when visually highlighting the drag source in the afterRepair\r
+     * method after a failed drop (defaults to "c3daf9" - light blue)\r
      */\r
 \r
     /**\r
-     * Four types of possible exceptions which can occur:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>Ext.Direct.exceptions.TRANSPORT</tt></b> : 'xhr'</li>\r
-     * <li><b><tt>Ext.Direct.exceptions.PARSE</tt></b> : 'parse'</li>\r
-     * <li><b><tt>Ext.Direct.exceptions.LOGIN</tt></b> : 'login'</li>\r
-     * <li><b><tt>Ext.Direct.exceptions.SERVER</tt></b> : 'exception'</li>\r
-     * </ul></div>\r
-     * @property exceptions\r
-     * @type Object\r
+     * Called when a mousedown occurs in this container. Looks in {@link Ext.dd.Registry}\r
+     * for a valid target to drag based on the mouse down. Override this method\r
+     * to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned\r
+     * object has a "ddel" attribute (with an HTML Element) for other functions to work.\r
+     * @param {EventObject} e The mouse down event\r
+     * @return {Object} The dragData\r
      */\r
-    exceptions: {\r
-        TRANSPORT: 'xhr',\r
-        PARSE: 'parse',\r
-        LOGIN: 'login',\r
-        SERVER: 'exception'\r
+    getDragData : function(e){\r
+        return Ext.dd.Registry.getHandleFromEvent(e);\r
     },\r
     \r
-    // private\r
-    constructor: function(){\r
-        this.addEvents(\r
-            /**\r
-             * @event event\r
-             * Fires after an event.\r
-             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
-             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
-             */\r
-            'event',\r
-            /**\r
-             * @event exception\r
-             * Fires after an event exception.\r
-             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
-             */\r
-            'exception'\r
-        );\r
-        this.transactions = {};\r
-        this.providers = {};\r
+    /**\r
+     * Called once drag threshold has been reached to initialize the proxy element. By default, it clones the\r
+     * this.dragData.ddel\r
+     * @param {Number} x The x position of the click on the dragged object\r
+     * @param {Number} y The y position of the click on the dragged object\r
+     * @return {Boolean} true to continue the drag, false to cancel\r
+     */\r
+    onInitDrag : function(x, y){\r
+        this.proxy.update(this.dragData.ddel.cloneNode(true));\r
+        this.onStartDrag(x, y);\r
+        return true;\r
+    },\r
+    \r
+    /**\r
+     * Called after a repair of an invalid drop. By default, highlights this.dragData.ddel \r
+     */\r
+    afterRepair : function(){\r
+        if(Ext.enableFx){\r
+            Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");\r
+        }\r
+        this.dragging = false;\r
     },\r
 \r
     /**\r
-     * Adds an Ext.Direct Provider and creates the proxy or stub methods to execute server-side methods.\r
-     * If the provider is not already connected, it will auto-connect.\r
-     * <pre><code>\r
-var pollProv = new Ext.direct.PollingProvider({\r
-    url: 'php/poll2.php'\r
-}); \r
+     * Called before a repair of an invalid drop to get the XY to animate to. By default returns\r
+     * the XY of this.dragData.ddel\r
+     * @param {EventObject} e The mouse up event\r
+     * @return {Array} The xy location (e.g. [100, 200])\r
+     */\r
+    getRepairXY : function(e){\r
+        return Ext.Element.fly(this.dragData.ddel).getXY();  \r
+    }\r
+});/**\r
+ * @class Ext.dd.DropZone\r
+ * @extends Ext.dd.DropTarget\r
+ * <p>This class provides a container DD instance that allows dropping on multiple child target nodes.</p>\r
+ * <p>By default, this class requires that child nodes accepting drop are registered with {@link Ext.dd.Registry}.\r
+ * However a simpler way to allow a DropZone to manage any number of target elements is to configure the\r
+ * DropZone with an implementation of {@link #getTargetFromEvent} which interrogates the passed\r
+ * mouse event to see if it has taken place within an element, or class of elements. This is easily done\r
+ * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a\r
+ * {@link Ext.DomQuery} selector.</p>\r
+ * <p>Once the DropZone has detected through calling getTargetFromEvent, that the mouse is over\r
+ * a drop target, that target is passed as the first parameter to {@link #onNodeEnter}, {@link #onNodeOver},\r
+ * {@link #onNodeOut}, {@link #onNodeDrop}. You may configure the instance of DropZone with implementations\r
+ * of these methods to provide application-specific behaviour for these events to update both\r
+ * application state, and UI state.</p>\r
+ * <p>For example to make a GridPanel a cooperating target with the example illustrated in\r
+ * {@link Ext.dd.DragZone DragZone}, the following technique might be used:</p><pre><code>\r
+myGridPanel.on('render', function() {\r
+    myGridPanel.dropZone = new Ext.dd.DropZone(myGridPanel.getView().scroller, {\r
 \r
-Ext.Direct.addProvider(\r
-    {\r
-        "type":"remoting",       // create a {@link Ext.direct.RemotingProvider} \r
-        "url":"php\/router.php", // url to connect to the Ext.Direct server-side router.\r
-        "actions":{              // each property within the actions object represents a Class \r
-            "TestAction":[       // array of methods within each server side Class   \r
-            {\r
-                "name":"doEcho", // name of method\r
-                "len":1\r
-            },{\r
-                "name":"multiply",\r
-                "len":1\r
-            },{\r
-                "name":"doForm",\r
-                "formHandler":true, // handle form on server with Ext.Direct.Transaction \r
-                "len":1\r
-            }]\r
+//      If the mouse is over a grid row, return that node. This is\r
+//      provided as the "target" parameter in all "onNodeXXXX" node event handling functions\r
+        getTargetFromEvent: function(e) {\r
+            return e.getTarget(myGridPanel.getView().rowSelector);\r
         },\r
-        "namespace":"myApplication",// namespace to create the Remoting Provider in\r
-    },{\r
-        type: 'polling', // create a {@link Ext.direct.PollingProvider} \r
-        url:  'php/poll.php'\r
+\r
+//      On entry into a target node, highlight that node.\r
+        onNodeEnter : function(target, dd, e, data){ \r
+            Ext.fly(target).addClass('my-row-highlight-class');\r
+        },\r
+\r
+//      On exit from a target node, unhighlight that node.\r
+        onNodeOut : function(target, dd, e, data){ \r
+            Ext.fly(target).removeClass('my-row-highlight-class');\r
+        },\r
+\r
+//      While over a target node, return the default drop allowed class which\r
+//      places a "tick" icon into the drag proxy.\r
+        onNodeOver : function(target, dd, e, data){ \r
+            return Ext.dd.DropZone.prototype.dropAllowed;\r
+        },\r
+\r
+//      On node drop we can interrogate the target to find the underlying\r
+//      application object that is the real target of the dragged data.\r
+//      In this case, it is a Record in the GridPanel's Store.\r
+//      We can use the data set up by the DragZone's getDragData method to read\r
+//      any data we decided to attach in the DragZone's getDragData method.\r
+        onNodeDrop : function(target, dd, e, data){\r
+            var rowIndex = myGridPanel.getView().findRowIndex(target);\r
+            var r = myGridPanel.getStore().getAt(rowIndex);\r
+            Ext.Msg.alert('Drop gesture', 'Dropped Record id ' + data.draggedRecord.id +\r
+                ' on Record id ' + r.id);\r
+            return true;\r
+        }\r
+    });\r
+}\r
+</code></pre>\r
+ * See the {@link Ext.dd.DragZone DragZone} documentation for details about building a DragZone which\r
+ * cooperates with this DropZone.\r
+ * @constructor\r
+ * @param {Mixed} el The container element\r
+ * @param {Object} config\r
+ */\r
+Ext.dd.DropZone = function(el, config){\r
+    Ext.dd.DropZone.superclass.constructor.call(this, el, config);\r
+};\r
+\r
+Ext.extend(Ext.dd.DropZone, Ext.dd.DropTarget, {\r
+    /**\r
+     * Returns a custom data object associated with the DOM node that is the target of the event.  By default\r
+     * this looks up the event target in the {@link Ext.dd.Registry}, although you can override this method to\r
+     * provide your own custom lookup.\r
+     * @param {Event} e The event\r
+     * @return {Object} data The custom data\r
+     */\r
+    getTargetFromEvent : function(e){\r
+        return Ext.dd.Registry.getTargetFromEvent(e);\r
     },\r
-    pollProv // reference to previously created instance\r
-);\r
-     * </code></pre>\r
-     * @param {Object/Array} provider Accepts either an Array of Provider descriptions (an instance\r
-     * or config object for a Provider) or any number of Provider descriptions as arguments.  Each\r
-     * Provider description instructs Ext.Direct how to create client-side stub methods.\r
+\r
+    /**\r
+     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has entered a drop node\r
+     * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}.\r
+     * This method has no default implementation and should be overridden to provide\r
+     * node-specific processing if necessary.\r
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from \r
+     * {@link #getTargetFromEvent} for this node)\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
      */\r
-    addProvider : function(provider){        \r
-        var a = arguments;\r
-        if(a.length > 1){\r
-            for(var i = 0, len = a.length; i < len; i++){\r
-                this.addProvider(a[i]);\r
-            }\r
-            return;\r
-        }\r
+    onNodeEnter : function(n, dd, e, data){\r
         \r
-        // if provider has not already been instantiated\r
-        if(!provider.events){\r
-            provider = new Ext.Direct.PROVIDERS[provider.type](provider);\r
-        }\r
-        provider.id = provider.id || Ext.id();\r
-        this.providers[provider.id] = provider;\r
-\r
-        provider.on('data', this.onProviderData, this);\r
-        provider.on('exception', this.onProviderException, this);\r
-\r
-\r
-        if(!provider.isConnected()){\r
-            provider.connect();\r
-        }\r
+    },\r
 \r
-        return provider;\r
+    /**\r
+     * Called while the DropZone determines that a {@link Ext.dd.DragSource} is over a drop node\r
+     * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}.\r
+     * The default implementation returns this.dropNotAllowed, so it should be\r
+     * overridden to provide the proper feedback.\r
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
+     * {@link #getTargetFromEvent} for this node)\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     */\r
+    onNodeOver : function(n, dd, e, data){\r
+        return this.dropAllowed;\r
     },\r
 \r
     /**\r
-     * Retrieve a {@link Ext.direct.Provider provider} by the\r
-     * <b><tt>{@link Ext.direct.Provider#id id}</tt></b> specified when the provider is\r
-     * {@link #addProvider added}.\r
-     * @param {String} id Unique identifier assigned to the provider when calling {@link #addProvider} \r
+     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dragged out of\r
+     * the drop node without dropping.  This method has no default implementation and should be overridden to provide\r
+     * node-specific processing if necessary.\r
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
+     * {@link #getTargetFromEvent} for this node)\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
      */\r
-    getProvider : function(id){\r
-        return this.providers[id];\r
+    onNodeOut : function(n, dd, e, data){\r
+        \r
     },\r
 \r
-    removeProvider : function(id){\r
-        var provider = id.id ? id : this.providers[id.id];\r
-        provider.un('data', this.onProviderData, this);\r
-        provider.un('exception', this.onProviderException, this);\r
-        delete this.providers[provider.id];\r
-        return provider;\r
+    /**\r
+     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped onto\r
+     * the drop node.  The default implementation returns false, so it should be overridden to provide the\r
+     * appropriate processing of the drop event and return true so that the drag source's repair action does not run.\r
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from\r
+     * {@link #getTargetFromEvent} for this node)\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {Boolean} True if the drop was valid, else false\r
+     */\r
+    onNodeDrop : function(n, dd, e, data){\r
+        return false;\r
     },\r
 \r
-    addTransaction: function(t){\r
-        this.transactions[t.tid] = t;\r
-        return t;\r
+    /**\r
+     * Called while the DropZone determines that a {@link Ext.dd.DragSource} is being dragged over it,\r
+     * but not over any of its registered drop nodes.  The default implementation returns this.dropNotAllowed, so\r
+     * it should be overridden to provide the proper feedback if necessary.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     */\r
+    onContainerOver : function(dd, e, data){\r
+        return this.dropNotAllowed;\r
     },\r
 \r
-    removeTransaction: function(t){\r
-        delete this.transactions[t.tid || t];\r
-        return t;\r
+    /**\r
+     * Called when the DropZone determines that a {@link Ext.dd.DragSource} has been dropped on it,\r
+     * but not on any of its registered drop nodes.  The default implementation returns false, so it should be\r
+     * overridden to provide the appropriate processing of the drop event if you need the drop zone itself to\r
+     * be able to accept drops.  It should return true when valid so that the drag source's repair action does not run.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {Boolean} True if the drop was valid, else false\r
+     */\r
+    onContainerDrop : function(dd, e, data){\r
+        return false;\r
     },\r
 \r
-    getTransaction: function(tid){\r
-        return this.transactions[tid.tid || tid];\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source is now over\r
+     * the zone.  The default implementation returns this.dropNotAllowed and expects that only registered drop\r
+     * nodes can process drag drop operations, so if you need the drop zone itself to be able to process drops\r
+     * you should override this method and provide a custom implementation.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     */\r
+    notifyEnter : function(dd, e, data){\r
+        return this.dropNotAllowed;\r
     },\r
 \r
-    onProviderData : function(provider, e){\r
-        if(Ext.isArray(e)){\r
-            for(var i = 0, len = e.length; i < len; i++){\r
-                this.onProviderData(provider, e[i]);\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the drop zone.\r
+     * This method will be called on every mouse movement while the drag source is over the drop zone.\r
+     * It will call {@link #onNodeOver} while the drag source is over a registered node, and will also automatically\r
+     * delegate to the appropriate node-specific methods as necessary when the drag source enters and exits\r
+     * registered nodes ({@link #onNodeEnter}, {@link #onNodeOut}). If the drag source is not currently over a\r
+     * registered node, it will call {@link #onContainerOver}.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the\r
+     * underlying {@link Ext.dd.StatusProxy} can be updated\r
+     */\r
+    notifyOver : function(dd, e, data){\r
+        var n = this.getTargetFromEvent(e);\r
+        if(!n){ // not over valid drop target\r
+            if(this.lastOverNode){\r
+                this.onNodeOut(this.lastOverNode, dd, e, data);\r
+                this.lastOverNode = null;\r
             }\r
-            return;\r
+            return this.onContainerOver(dd, e, data);\r
         }\r
-        if(e.name && e.name != 'event' && e.name != 'exception'){\r
-            this.fireEvent(e.name, e);\r
-        }else if(e.type == 'exception'){\r
-            this.fireEvent('exception', e);\r
+        if(this.lastOverNode != n){\r
+            if(this.lastOverNode){\r
+                this.onNodeOut(this.lastOverNode, dd, e, data);\r
+            }\r
+            this.onNodeEnter(n, dd, e, data);\r
+            this.lastOverNode = n;\r
         }\r
-        this.fireEvent('event', e, provider);\r
+        return this.onNodeOver(n, dd, e, data);\r
     },\r
 \r
-    createEvent : function(response, extraProps){\r
-        return new Ext.Direct.eventTypes[response.type](Ext.apply(response, extraProps));\r
-    }\r
-});\r
-// overwrite impl. with static instance\r
-Ext.Direct = new Ext.Direct();\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the source has been dragged\r
+     * out of the zone without dropping.  If the drag source is currently over a registered node, the notification\r
+     * will be delegated to {@link #onNodeOut} for node-specific handling, otherwise it will be ignored.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag zone\r
+     */\r
+    notifyOut : function(dd, e, data){\r
+        if(this.lastOverNode){\r
+            this.onNodeOut(this.lastOverNode, dd, e, data);\r
+            this.lastOverNode = null;\r
+        }\r
+    },\r
 \r
-Ext.Direct.TID = 1;\r
-Ext.Direct.PROVIDERS = {};/**\r
- * @class Ext.Direct.Transaction\r
- * @extends Object\r
- * <p>Supporting Class for Ext.Direct (not intended to be used directly).</p>\r
- * @constructor\r
- * @param {Object} config\r
- */\r
-Ext.Direct.Transaction = function(config){\r
-    Ext.apply(this, config);\r
-    this.tid = ++Ext.Direct.TID;\r
-    this.retryCount = 0;\r
-};\r
-Ext.Direct.Transaction.prototype = {\r
-    send: function(){\r
-        this.provider.queueTransaction(this);\r
+    /**\r
+     * The function a {@link Ext.dd.DragSource} calls once to notify this drop zone that the dragged item has\r
+     * been dropped on it.  The drag zone will look up the target node based on the event passed in, and if there\r
+     * is a node registered for that event, it will delegate to {@link #onNodeDrop} for node-specific handling,\r
+     * otherwise it will call {@link #onContainerDrop}.\r
+     * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop zone\r
+     * @param {Event} e The event\r
+     * @param {Object} data An object containing arbitrary data supplied by the drag source\r
+     * @return {Boolean} True if the drop was valid, else false\r
+     */\r
+    notifyDrop : function(dd, e, data){\r
+        if(this.lastOverNode){\r
+            this.onNodeOut(this.lastOverNode, dd, e, data);\r
+            this.lastOverNode = null;\r
+        }\r
+        var n = this.getTargetFromEvent(e);\r
+        return n ?\r
+            this.onNodeDrop(n, dd, e, data) :\r
+            this.onContainerDrop(dd, e, data);\r
     },\r
 \r
-    retry: function(){\r
-        this.retryCount++;\r
-        this.send();\r
+    // private\r
+    triggerCacheRefresh : function(){\r
+        Ext.dd.DDM.refreshCache(this.groups);\r
+    }  \r
+});/**\r
+ * @class Ext.Element\r
+ */\r
+Ext.Element.addMethods({\r
+    /**\r
+     * Initializes a {@link Ext.dd.DD} drag drop object for this element.\r
+     * @param {String} group The group the DD object is member of\r
+     * @param {Object} config The DD config object\r
+     * @param {Object} overrides An object containing methods to override/implement on the DD object\r
+     * @return {Ext.dd.DD} The DD object\r
+     */\r
+    initDD : function(group, config, overrides){\r
+        var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);\r
+        return Ext.apply(dd, overrides);\r
     },\r
 \r
-    getProvider: function(){\r
-        return this.provider;\r
-    }\r
-};Ext.Direct.Event = function(config){\r
-    Ext.apply(this, config);\r
-}\r
-Ext.Direct.Event.prototype = {\r
-    status: true,\r
-    getData: function(){\r
-        return this.data;\r
-    }\r
-};\r
+    /**\r
+     * Initializes a {@link Ext.dd.DDProxy} object for this element.\r
+     * @param {String} group The group the DDProxy object is member of\r
+     * @param {Object} config The DDProxy config object\r
+     * @param {Object} overrides An object containing methods to override/implement on the DDProxy object\r
+     * @return {Ext.dd.DDProxy} The DDProxy object\r
+     */\r
+    initDDProxy : function(group, config, overrides){\r
+        var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);\r
+        return Ext.apply(dd, overrides);\r
+    },\r
 \r
-Ext.Direct.RemotingEvent = Ext.extend(Ext.Direct.Event, {\r
-    type: 'rpc',\r
-    getTransaction: function(){\r
-        return this.transaction || Ext.Direct.getTransaction(this.tid);\r
+    /**\r
+     * Initializes a {@link Ext.dd.DDTarget} object for this element.\r
+     * @param {String} group The group the DDTarget object is member of\r
+     * @param {Object} config The DDTarget config object\r
+     * @param {Object} overrides An object containing methods to override/implement on the DDTarget object\r
+     * @return {Ext.dd.DDTarget} The DDTarget object\r
+     */\r
+    initDDTarget : function(group, config, overrides){\r
+        var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);\r
+        return Ext.apply(dd, overrides);\r
     }\r
-});\r
-\r
-Ext.Direct.ExceptionEvent = Ext.extend(Ext.Direct.RemotingEvent, {\r
-    status: false,\r
-    type: 'exception'\r
-});\r
-\r
-Ext.Direct.eventTypes = {\r
-    'rpc':  Ext.Direct.RemotingEvent,\r
-    'event':  Ext.Direct.Event,\r
-    'exception':  Ext.Direct.ExceptionEvent\r
-};\r
-\r
-/**\r
- * @class Ext.direct.Provider\r
- * @extends Ext.util.Observable\r
- * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>\r
- * \r
- * <p>For example ExtJs implements the following subclasses:</p>\r
- * <pre><code>\r
-Provider\r
-|\r
-+---{@link Ext.direct.JsonProvider JsonProvider} \r
-    |\r
-    +---{@link Ext.direct.PollingProvider PollingProvider}   \r
-    |\r
-    +---{@link Ext.direct.RemotingProvider RemotingProvider}   \r
- * </code></pre>\r
- * @abstract\r
+});
+/**
+ * @class Ext.data.Api
+ * @extends Object
+ * Ext.data.Api is a singleton designed to manage the data API including methods
+ * for validating a developer's DataProxy API.  Defines variables for CRUD actions
+ * create, read, update and destroy in addition to a mapping of RESTful HTTP methods
+ * GET, POST, PUT and DELETE to CRUD actions.
+ * @singleton
+ */
+Ext.data.Api = (function() {
+
+    // private validActions.  validActions is essentially an inverted hash of Ext.data.Api.actions, where value becomes the key.
+    // Some methods in this singleton (e.g.: getActions, getVerb) will loop through actions with the code <code>for (var verb in this.actions)</code>
+    // For efficiency, some methods will first check this hash for a match.  Those methods which do acces validActions will cache their result here.
+    // We cannot pre-define this hash since the developer may over-ride the actions at runtime.
+    var validActions = {};
+
+    return {
+        /**
+         * Defined actions corresponding to remote actions:
+         * <pre><code>
+actions: {
+    create  : 'create',  // Text representing the remote-action to create records on server.
+    read    : 'read',    // Text representing the remote-action to read/load data from server.
+    update  : 'update',  // Text representing the remote-action to update records on server.
+    destroy : 'destroy'  // Text representing the remote-action to destroy records on server.
+}
+         * </code></pre>
+         * @property actions
+         * @type Object
+         */
+        actions : {
+            create  : 'create',
+            read    : 'read',
+            update  : 'update',
+            destroy : 'destroy'
+        },
+
+        /**
+         * Defined {CRUD action}:{HTTP method} pairs to associate HTTP methods with the
+         * corresponding actions for {@link Ext.data.DataProxy#restful RESTful proxies}.
+         * Defaults to:
+         * <pre><code>
+restActions : {
+    create  : 'POST',
+    read    : 'GET',
+    update  : 'PUT',
+    destroy : 'DELETE'
+},
+         * </code></pre>
+         */
+        restActions : {
+            create  : 'POST',
+            read    : 'GET',
+            update  : 'PUT',
+            destroy : 'DELETE'
+        },
+
+        /**
+         * Returns true if supplied action-name is a valid API action defined in <code>{@link #actions}</code> constants
+         * @param {String} action
+         * @param {String[]}(Optional) List of available CRUD actions.  Pass in list when executing multiple times for efficiency.
+         * @return {Boolean}
+         */
+        isAction : function(action) {
+            return (Ext.data.Api.actions[action]) ? true : false;
+        },
+
+        /**
+         * Returns the actual CRUD action KEY "create", "read", "update" or "destroy" from the supplied action-name.  This method is used internally and shouldn't generally
+         * need to be used directly.  The key/value pair of Ext.data.Api.actions will often be identical but this is not necessarily true.  A developer can override this naming
+         * convention if desired.  However, the framework internally calls methods based upon the KEY so a way of retreiving the the words "create", "read", "update" and "destroy" is
+         * required.  This method will cache discovered KEYS into the private validActions hash.
+         * @param {String} name The runtime name of the action.
+         * @return {String||null} returns the action-key, or verb of the user-action or null if invalid.
+         * @nodoc
+         */
+        getVerb : function(name) {
+            if (validActions[name]) {
+                return validActions[name];  // <-- found in cache.  return immediately.
+            }
+            for (var verb in this.actions) {
+                if (this.actions[verb] === name) {
+                    validActions[name] = verb;
+                    break;
+                }
+            }
+            return (validActions[name] !== undefined) ? validActions[name] : null;
+        },
+
+        /**
+         * Returns true if the supplied API is valid; that is, check that all keys match defined actions
+         * otherwise returns an array of mistakes.
+         * @return {String[]||true}
+         */
+        isValid : function(api){
+            var invalid = [];
+            var crud = this.actions; // <-- cache a copy of the actions.
+            for (var action in api) {
+                if (!(action in crud)) {
+                    invalid.push(action);
+                }
+            }
+            return (!invalid.length) ? true : invalid;
+        },
+
+        /**
+         * Returns true if the supplied verb upon the supplied proxy points to a unique url in that none of the other api-actions
+         * point to the same url.  The question is important for deciding whether to insert the "xaction" HTTP parameter within an
+         * Ajax request.  This method is used internally and shouldn't generally need to be called directly.
+         * @param {Ext.data.DataProxy} proxy
+         * @param {String} verb
+         * @return {Boolean}
+         */
+        hasUniqueUrl : function(proxy, verb) {
+            var url = (proxy.api[verb]) ? proxy.api[verb].url : null;
+            var unique = true;
+            for (var action in proxy.api) {
+                if ((unique = (action === verb) ? true : (proxy.api[action].url != url) ? true : false) === false) {
+                    break;
+                }
+            }
+            return unique;
+        },
+
+        /**
+         * This method is used internally by <tt>{@link Ext.data.DataProxy DataProxy}</tt> and should not generally need to be used directly.
+         * Each action of a DataProxy api can be initially defined as either a String or an Object.  When specified as an object,
+         * one can explicitly define the HTTP method (GET|POST) to use for each CRUD action.  This method will prepare the supplied API, setting
+         * each action to the Object form.  If your API-actions do not explicitly define the HTTP method, the "method" configuration-parameter will
+         * be used.  If the method configuration parameter is not specified, POST will be used.
+         <pre><code>
+new Ext.data.HttpProxy({
+    method: "POST",     // <-- default HTTP method when not specified.
+    api: {
+        create: 'create.php',
+        load: 'read.php',
+        save: 'save.php',
+        destroy: 'destroy.php'
+    }
+});
+
+// Alternatively, one can use the object-form to specify the API
+new Ext.data.HttpProxy({
+    api: {
+        load: {url: 'read.php', method: 'GET'},
+        create: 'create.php',
+        destroy: 'destroy.php',
+        save: 'update.php'
+    }
+});
+        </code></pre>
+         *
+         * @param {Ext.data.DataProxy} proxy
+         */
+        prepare : function(proxy) {
+            if (!proxy.api) {
+                proxy.api = {}; // <-- No api?  create a blank one.
+            }
+            for (var verb in this.actions) {
+                var action = this.actions[verb];
+                proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn;
+                if (typeof(proxy.api[action]) == 'string') {
+                    proxy.api[action] = {
+                        url: proxy.api[action],
+                        method: (proxy.restful === true) ? Ext.data.Api.restActions[action] : undefined
+                    };
+                }
+            }
+        },
+
+        /**
+         * Prepares a supplied Proxy to be RESTful.  Sets the HTTP method for each api-action to be one of
+         * GET, POST, PUT, DELETE according to the defined {@link #restActions}.
+         * @param {Ext.data.DataProxy} proxy
+         */
+        restify : function(proxy) {
+            proxy.restful = true;
+            for (var verb in this.restActions) {
+                proxy.api[this.actions[verb]].method ||
+                    (proxy.api[this.actions[verb]].method = this.restActions[verb]);
+            }
+            // TODO: perhaps move this interceptor elsewhere?  like into DataProxy, perhaps?  Placed here
+            // to satisfy initial 3.0 final release of REST features.
+            proxy.onWrite = proxy.onWrite.createInterceptor(function(action, o, response, rs) {
+                var reader = o.reader;
+                var res = new Ext.data.Response({
+                    action: action,
+                    raw: response
+                });
+
+                switch (response.status) {
+                    case 200:   // standard 200 response, send control back to HttpProxy#onWrite by returning true from this intercepted #onWrite
+                        return true;
+                        break;
+                    case 201:   // entity created but no response returned
+                        if (Ext.isEmpty(res.raw.responseText)) {
+                          res.success = true;
+                        } else {
+                          //if the response contains data, treat it like a 200
+                          return true;
+                        }
+                        break;
+                    case 204:  // no-content.  Create a fake response.
+                        res.success = true;
+                        res.data = null;
+                        break;
+                    default:
+                        return true;
+                        break;
+                }
+                if (res.success === true) {
+                    this.fireEvent("write", this, action, res.data, res, rs, o.request.arg);
+                } else {
+                    this.fireEvent('exception', this, 'remote', action, o, res, rs);
+                }
+                o.request.callback.call(o.request.scope, res.data, res, res.success);
+
+                return false;   // <-- false to prevent intercepted function from running.
+            }, proxy);
+        }
+    };
+})();
+
+/**
+ * Ext.data.Response
+ * Experimental.  Do not use directly.
+ */
+Ext.data.Response = function(params, response) {
+    Ext.apply(this, params, {
+        raw: response
+    });
+};
+Ext.data.Response.prototype = {
+    message : null,
+    success : false,
+    status : null,
+    root : null,
+    raw : null,
+
+    getMessage : function() {
+        return this.message;
+    },
+    getSuccess : function() {
+        return this.success;
+    },
+    getStatus : function() {
+        return this.status;
+    },
+    getRoot : function() {
+        return this.root;
+    },
+    getRawResponse : function() {
+        return this.raw;
+    }
+};
+
+/**
+ * @class Ext.data.Api.Error
+ * @extends Ext.Error
+ * Error class for Ext.data.Api errors
+ */
+Ext.data.Api.Error = Ext.extend(Ext.Error, {
+    constructor : function(message, arg) {
+        this.arg = arg;
+        Ext.Error.call(this, message);
+    },
+    name: 'Ext.data.Api'
+});
+Ext.apply(Ext.data.Api.Error.prototype, {
+    lang: {
+        'action-url-undefined': 'No fallback url defined for this action.  When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.',
+        'invalid': 'received an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions',
+        'invalid-url': 'Invalid url.  Please review your proxy configuration.',
+        'execute': 'Attempted to execute an unknown action.  Valid API actions are defined in Ext.data.Api.actions"'
+    }
+});
+
+
+\r
+/**\r
+ * @class Ext.data.SortTypes\r
+ * @singleton\r
+ * Defines the default sorting (casting?) comparison functions used when sorting data.\r
  */\r
-Ext.direct.Provider = Ext.extend(Ext.util.Observable, {    \r
+Ext.data.SortTypes = {\r
     /**\r
-     * @cfg {String} id\r
-     * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}).\r
-     * You should assign an id if you need to be able to access the provider later and you do\r
-     * not have an object reference available, for example:\r
-     * <pre><code>\r
-Ext.Direct.addProvider(\r
-    {\r
-        type: 'polling',\r
-        url:  'php/poll.php',\r
-        id:   'poll-provider'\r
-    }\r
-);\r
-     \r
-var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');\r
-p.disconnect();\r
-     * </code></pre>\r
+     * Default sort that does nothing\r
+     * @param {Mixed} s The value being converted\r
+     * @return {Mixed} The comparison value\r
      */\r
-        \r
+    none : function(s){\r
+        return s;\r
+    },\r
+    \r
     /**\r
-     * @cfg {Number} priority\r
-     * Priority of the request. Lower is higher priority, <tt>0</tt> means "duplex" (always on).\r
-     * All Providers default to <tt>1</tt> except for PollingProvider which defaults to <tt>3</tt>.\r
-     */    \r
-    priority: 1,\r
-\r
+     * The regular expression used to strip tags\r
+     * @type {RegExp}\r
+     * @property\r
+     */\r
+    stripTagsRE : /<\/?[^>]+>/gi,\r
+    \r
     /**\r
-     * @cfg {String} type\r
-     * <b>Required</b>, <tt>undefined</tt> by default.  The <tt>type</tt> of provider specified\r
-     * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a\r
-     * new Provider. Acceptable values by default are:<div class="mdetail-params"><ul>\r
-     * <li><b><tt>polling</tt></b> : {@link Ext.direct.PollingProvider PollingProvider}</li>\r
-     * <li><b><tt>remoting</tt></b> : {@link Ext.direct.RemotingProvider RemotingProvider}</li>\r
-     * </ul></div>\r
-     */    \r
\r
-    // private\r
-    constructor : function(config){\r
-        Ext.apply(this, config);\r
-        this.addEvents(\r
-            /**\r
-             * @event connect\r
-             * Fires when the Provider connects to the server-side\r
-             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
-             */            \r
-            'connect',\r
-            /**\r
-             * @event disconnect\r
-             * Fires when the Provider disconnects from the server-side\r
-             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
-             */            \r
-            'disconnect',\r
-            /**\r
-             * @event data\r
-             * Fires when the Provider receives data from the server-side\r
-             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
-             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
-             */            \r
-            'data',\r
-            /**\r
-             * @event exception\r
-             * Fires when the Provider receives an exception from the server-side\r
-             */                        \r
-            'exception'\r
-        );\r
-        Ext.direct.Provider.superclass.constructor.call(this, config);\r
+     * Strips all HTML tags to sort on text only\r
+     * @param {Mixed} s The value being converted\r
+     * @return {String} The comparison value\r
+     */\r
+    asText : function(s){\r
+        return String(s).replace(this.stripTagsRE, "");\r
     },\r
-\r
+    \r
     /**\r
-     * Returns whether or not the server-side is currently connected.\r
-     * Abstract method for subclasses to implement.\r
+     * Strips all HTML tags to sort on text only - Case insensitive\r
+     * @param {Mixed} s The value being converted\r
+     * @return {String} The comparison value\r
      */\r
-    isConnected: function(){\r
-        return false;\r
+    asUCText : function(s){\r
+        return String(s).toUpperCase().replace(this.stripTagsRE, "");\r
     },\r
-\r
+    \r
     /**\r
-     * Abstract methods for subclasses to implement.\r
+     * Case insensitive string\r
+     * @param {Mixed} s The value being converted\r
+     * @return {String} The comparison value\r
      */\r
-    connect: Ext.emptyFn,\r
+    asUCString : function(s) {\r
+       return String(s).toUpperCase();\r
+    },\r
     \r
     /**\r
-     * Abstract methods for subclasses to implement.\r
+     * Date sorting\r
+     * @param {Mixed} s The value being converted\r
+     * @return {Number} The comparison value\r
      */\r
-    disconnect: Ext.emptyFn\r
-});\r
-/**\r
- * @class Ext.direct.JsonProvider\r
- * @extends Ext.direct.Provider\r
- */\r
-Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {\r
-    parseResponse: function(xhr){\r
-        if(!Ext.isEmpty(xhr.responseText)){\r
-            if(typeof xhr.responseText == 'object'){\r
-                return xhr.responseText;\r
-            }\r
-            return Ext.decode(xhr.responseText);\r
-        }\r
-        return null;\r
-    },\r
-\r
-    getEvents: function(xhr){\r
-        var data = null;\r
-        try{\r
-            data = this.parseResponse(xhr);\r
-        }catch(e){\r
-            var event = new Ext.Direct.ExceptionEvent({\r
-                data: e,\r
-                xhr: xhr,\r
-                code: Ext.Direct.exceptions.PARSE,\r
-                message: 'Error parsing json response: \n\n ' + data\r
-            })\r
-            return [event];\r
+    asDate : function(s) {\r
+        if(!s){\r
+            return 0;\r
         }\r
-        var events = [];\r
-        if(Ext.isArray(data)){\r
-            for(var i = 0, len = data.length; i < len; i++){\r
-                events.push(Ext.Direct.createEvent(data[i]));\r
-            }\r
-        }else{\r
-            events.push(Ext.Direct.createEvent(data));\r
+        if(Ext.isDate(s)){\r
+            return s.getTime();\r
         }\r
-        return events;\r
-    }\r
-});/**\r
- * @class Ext.direct.PollingProvider\r
- * @extends Ext.direct.JsonProvider\r
- *\r
- * <p>Provides for repetitive polling of the server at distinct {@link #interval intervals}.\r
- * The initial request for data originates from the client, and then is responded to by the\r
- * server.</p>\r
- * \r
- * <p>All configurations for the PollingProvider should be generated by the server-side\r
- * API portion of the Ext.Direct stack.</p>\r
- *\r
- * <p>An instance of PollingProvider may be created directly via the new keyword or by simply\r
- * specifying <tt>type = 'polling'</tt>.  For example:</p>\r
- * <pre><code>\r
-var pollA = new Ext.direct.PollingProvider({\r
-    type:'polling',\r
-    url: 'php/pollA.php',\r
-});\r
-Ext.Direct.addProvider(pollA);\r
-pollA.disconnect();\r
-\r
-Ext.Direct.addProvider(\r
-    {\r
-        type:'polling',\r
-        url: 'php/pollB.php',\r
-        id: 'pollB-provider'\r
+       return Date.parse(String(s));\r
+    },\r
+    \r
+    /**\r
+     * Float sorting\r
+     * @param {Mixed} s The value being converted\r
+     * @return {Float} The comparison value\r
+     */\r
+    asFloat : function(s) {\r
+       var val = parseFloat(String(s).replace(/,/g, ""));\r
+       return isNaN(val) ? 0 : val;\r
+    },\r
+    \r
+    /**\r
+     * Integer sorting\r
+     * @param {Mixed} s The value being converted\r
+     * @return {Number} The comparison value\r
+     */\r
+    asInt : function(s) {\r
+        var val = parseInt(String(s).replace(/,/g, ""), 10);\r
+        return isNaN(val) ? 0 : val;\r
     }\r
-);\r
-var pollB = Ext.Direct.getProvider('pollB-provider');\r
- * </code></pre>\r
+};/**
+ * @class Ext.data.Record
+ * <p>Instances of this class encapsulate both Record <em>definition</em> information, and Record
+ * <em>value</em> information for use in {@link Ext.data.Store} objects, or any code which needs
+ * to access Records cached in an {@link Ext.data.Store} object.</p>
+ * <p>Constructors for this class are generated by passing an Array of field definition objects to {@link #create}.
+ * Instances are usually only created by {@link Ext.data.Reader} implementations when processing unformatted data
+ * objects.</p>
+ * <p>Note that an instance of a Record class may only belong to one {@link Ext.data.Store Store} at a time.
+ * In order to copy data from one Store to another, use the {@link #copy} method to create an exact
+ * copy of the Record, and insert the new instance into the other Store.</p>
+ * <p>When serializing a Record for submission to the server, be aware that it contains many private
+ * properties, and also a reference to its owning Store which in turn holds references to its Records.
+ * This means that a whole Record may not be encoded using {@link Ext.util.JSON.encode}. Instead, use the
+ * <code>{@link #data}</code> and <code>{@link #id}</code> properties.</p>
+ * <p>Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.</p>
+ * @constructor
+ * <p>This constructor should not be used to create Record objects. Instead, use {@link #create} to
+ * generate a subclass of Ext.data.Record configured with information about its constituent fields.<p>
+ * <p><b>The generated constructor has the same signature as this constructor.</b></p>
+ * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's
+ * fields. If not specified the <code>{@link Ext.data.Field#defaultValue defaultValue}</code>
+ * for each field will be assigned.
+ * @param {Object} id (Optional) The id of the Record. The id is used by the
+ * {@link Ext.data.Store} object which owns the Record to index its collection
+ * of Records (therefore this id should be unique within each store). If an
+ * <code>id</code> is not specified a <b><code>{@link #phantom}</code></b>
+ * Record will be created with an {@link #Record.id automatically generated id}.
+ */
+Ext.data.Record = function(data, id){
+    // if no id, call the auto id method
+    this.id = (id || id === 0) ? id : Ext.data.Record.id(this);
+    this.data = data || {};
+};
+
+/**
+ * Generate a constructor for a specific Record layout.
+ * @param {Array} o An Array of <b>{@link Ext.data.Field Field}</b> definition objects.
+ * The constructor generated by this method may be used to create new Record instances. The data
+ * object must contain properties named after the {@link Ext.data.Field field}
+ * <b><tt>{@link Ext.data.Field#name}s</tt></b>.  Example usage:<pre><code>
+// create a Record constructor from a description of the fields
+var TopicRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
+    {{@link Ext.data.Field#name name}: 'title', {@link Ext.data.Field#mapping mapping}: 'topic_title'},
+    {name: 'author', mapping: 'username', allowBlank: false},
+    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
+    {name: 'lastPost', mapping: 'post_time', type: 'date'},
+    {name: 'lastPoster', mapping: 'user2'},
+    {name: 'excerpt', mapping: 'post_text', allowBlank: false},
+    // In the simplest case, if no properties other than <tt>name</tt> are required,
+    // a field definition may consist of just a String for the field name.
+    'signature'
+]);
+
+// create Record instance
+var myNewRecord = new TopicRecord(
+    {
+        title: 'Do my job please',
+        author: 'noobie',
+        totalPosts: 1,
+        lastPost: new Date(),
+        lastPoster: 'Animal',
+        excerpt: 'No way dude!',
+        signature: ''
+    },
+    id // optionally specify the id of the record otherwise {@link #Record.id one is auto-assigned}
+);
+myStore.{@link Ext.data.Store#add add}(myNewRecord);
+</code></pre>
+ * @method create
+ * @return {function} A constructor which is used to create new Records according
+ * to the definition. The constructor has the same signature as {@link #Record}.
+ * @static
+ */
+Ext.data.Record.create = function(o){
+    var f = Ext.extend(Ext.data.Record, {});
+    var p = f.prototype;
+    p.fields = new Ext.util.MixedCollection(false, function(field){
+        return field.name;
+    });
+    for(var i = 0, len = o.length; i < len; i++){
+        p.fields.add(new Ext.data.Field(o[i]));
+    }
+    f.getField = function(name){
+        return p.fields.get(name);
+    };
+    return f;
+};
+
+Ext.data.Record.PREFIX = 'ext-record';
+Ext.data.Record.AUTO_ID = 1;
+Ext.data.Record.EDIT = 'edit';
+Ext.data.Record.REJECT = 'reject';
+Ext.data.Record.COMMIT = 'commit';
+
+
+/**
+ * Generates a sequential id. This method is typically called when a record is {@link #create}d
+ * and {@link #Record no id has been specified}. The returned id takes the form:
+ * <tt>&#123;PREFIX}-&#123;AUTO_ID}</tt>.<div class="mdetail-params"><ul>
+ * <li><b><tt>PREFIX</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.PREFIX</tt>
+ * (defaults to <tt>'ext-record'</tt>)</p></li>
+ * <li><b><tt>AUTO_ID</tt></b> : String<p class="sub-desc"><tt>Ext.data.Record.AUTO_ID</tt>
+ * (defaults to <tt>1</tt> initially)</p></li>
+ * </ul></div>
+ * @param {Record} rec The record being created.  The record does not exist, it's a {@link #phantom}.
+ * @return {String} auto-generated string id, <tt>"ext-record-i++'</tt>;
+ */
+Ext.data.Record.id = function(rec) {
+    rec.phantom = true;
+    return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join('');
+};
+
+Ext.data.Record.prototype = {
+    /**
+     * <p><b>This property is stored in the Record definition's <u>prototype</u></b></p>
+     * A MixedCollection containing the defined {@link Ext.data.Field Field}s for this Record.  Read-only.
+     * @property fields
+     * @type Ext.util.MixedCollection
+     */
+    /**
+     * An object hash representing the data for this Record. Every field name in the Record definition
+     * is represented by a property of that name in this object. Note that unless you specified a field
+     * with {@link Ext.data.Field#name name} "id" in the Record definition, this will <b>not</b> contain
+     * an <tt>id</tt> property.
+     * @property data
+     * @type {Object}
+     */
+    /**
+     * The unique ID of the Record {@link #Record as specified at construction time}.
+     * @property id
+     * @type {Object}
+     */
+    /**
+     * <p><b>Only present if this Record was created by an {@link Ext.data.XmlReader XmlReader}</b>.</p>
+     * <p>The XML element which was the source of the data for this Record.</p>
+     * @property node
+     * @type {XMLElement}
+     */
+    /**
+     * <p><b>Only present if this Record was created by an {@link Ext.data.ArrayReader ArrayReader} or a {@link Ext.data.JsonReader JsonReader}</b>.</p>
+     * <p>The Array or object which was the source of the data for this Record.</p>
+     * @property json
+     * @type {Array|Object}
+     */
+    /**
+     * Readonly flag - true if this Record has been modified.
+     * @type Boolean
+     */
+    dirty : false,
+    editing : false,
+    error : null,
+    /**
+     * This object contains a key and value storing the original values of all modified
+     * fields or is null if no fields have been modified.
+     * @property modified
+     * @type {Object}
+     */
+    modified : null,
+    /**
+     * <tt>true</tt> when the record does not yet exist in a server-side database (see
+     * {@link #markDirty}).  Any record which has a real database pk set as its id property
+     * is NOT a phantom -- it's real.
+     * @property phantom
+     * @type {Boolean}
+     */
+    phantom : false,
+
+    // private
+    join : function(store){
+        /**
+         * The {@link Ext.data.Store} to which this Record belongs.
+         * @property store
+         * @type {Ext.data.Store}
+         */
+        this.store = store;
+    },
+
+    /**
+     * Set the {@link Ext.data.Field#name named field} to the specified value.  For example:
+     * <pre><code>
+// record has a field named 'firstname'
+var Employee = Ext.data.Record.{@link #create}([
+    {name: 'firstname'},
+    ...
+]);
+
+// update the 2nd record in the store:
+var rec = myStore.{@link Ext.data.Store#getAt getAt}(1);
+
+// set the value (shows dirty flag):
+rec.set('firstname', 'Betty');
+
+// commit the change (removes dirty flag):
+rec.{@link #commit}();
+
+// update the record in the store, bypass setting dirty flag,
+// and do not store the change in the {@link Ext.data.Store#getModifiedRecords modified records}
+rec.{@link #data}['firstname'] = 'Wilma'; // updates record, but not the view
+rec.{@link #commit}(); // updates the view
+     * </code></pre>
+     * <b>Notes</b>:<div class="mdetail-params"><ul>
+     * <li>If the store has a writer and <code>autoSave=true</code>, each set()
+     * will execute an XHR to the server.</li>
+     * <li>Use <code>{@link #beginEdit}</code> to prevent the store's <code>update</code>
+     * event firing while using set().</li>
+     * <li>Use <code>{@link #endEdit}</code> to have the store's <code>update</code>
+     * event fire.</li>
+     * </ul></div>
+     * @param {String} name The {@link Ext.data.Field#name name of the field} to set.
+     * @param {String/Object/Array} value The value to set the field to.
+     */
+    set : function(name, value){
+        var encode = Ext.isPrimitive(value) ? String : Ext.encode;
+        if(encode(this.data[name]) == encode(value)) {
+            return;
+        }        
+        this.dirty = true;
+        if(!this.modified){
+            this.modified = {};
+        }
+        if(this.modified[name] === undefined){
+            this.modified[name] = this.data[name];
+        }
+        this.data[name] = value;
+        if(!this.editing){
+            this.afterEdit();
+        }
+    },
+
+    // private
+    afterEdit : function(){
+        if(this.store){
+            this.store.afterEdit(this);
+        }
+    },
+
+    // private
+    afterReject : function(){
+        if(this.store){
+            this.store.afterReject(this);
+        }
+    },
+
+    // private
+    afterCommit : function(){
+        if(this.store){
+            this.store.afterCommit(this);
+        }
+    },
+
+    /**
+     * Get the value of the {@link Ext.data.Field#name named field}.
+     * @param {String} name The {@link Ext.data.Field#name name of the field} to get the value of.
+     * @return {Object} The value of the field.
+     */
+    get : function(name){
+        return this.data[name];
+    },
+
+    /**
+     * Begin an edit. While in edit mode, no events (e.g.. the <code>update</code> event)
+     * are relayed to the containing store.
+     * See also: <code>{@link #endEdit}</code> and <code>{@link #cancelEdit}</code>.
+     */
+    beginEdit : function(){
+        this.editing = true;
+        this.modified = this.modified || {};
+    },
+
+    /**
+     * Cancels all changes made in the current edit operation.
+     */
+    cancelEdit : function(){
+        this.editing = false;
+        delete this.modified;
+    },
+
+    /**
+     * End an edit. If any data was modified, the containing store is notified
+     * (ie, the store's <code>update</code> event will fire).
+     */
+    endEdit : function(){
+        this.editing = false;
+        if(this.dirty){
+            this.afterEdit();
+        }
+    },
+
+    /**
+     * Usually called by the {@link Ext.data.Store} which owns the Record.
+     * Rejects all changes made to the Record since either creation, or the last commit operation.
+     * Modified fields are reverted to their original values.
+     * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
+     * to have their code notified of reject operations.</p>
+     * @param {Boolean} silent (optional) True to skip notification of the owning
+     * store of the change (defaults to false)
+     */
+    reject : function(silent){
+        var m = this.modified;
+        for(var n in m){
+            if(typeof m[n] != "function"){
+                this.data[n] = m[n];
+            }
+        }
+        this.dirty = false;
+        delete this.modified;
+        this.editing = false;
+        if(silent !== true){
+            this.afterReject();
+        }
+    },
+
+    /**
+     * Usually called by the {@link Ext.data.Store} which owns the Record.
+     * Commits all changes made to the Record since either creation, or the last commit operation.
+     * <p>Developers should subscribe to the {@link Ext.data.Store#update} event
+     * to have their code notified of commit operations.</p>
+     * @param {Boolean} silent (optional) True to skip notification of the owning
+     * store of the change (defaults to false)
+     */
+    commit : function(silent){
+        this.dirty = false;
+        delete this.modified;
+        this.editing = false;
+        if(silent !== true){
+            this.afterCommit();
+        }
+    },
+
+    /**
+     * Gets a hash of only the fields that have been modified since this Record was created or commited.
+     * @return Object
+     */
+    getChanges : function(){
+        var m = this.modified, cs = {};
+        for(var n in m){
+            if(m.hasOwnProperty(n)){
+                cs[n] = this.data[n];
+            }
+        }
+        return cs;
+    },
+
+    // private
+    hasError : function(){
+        return this.error !== null;
+    },
+
+    // private
+    clearError : function(){
+        this.error = null;
+    },
+
+    /**
+     * Creates a copy (clone) of this Record.
+     * @param {String} id (optional) A new Record id, defaults to the id
+     * of the record being copied. See <code>{@link #id}</code>. 
+     * To generate a phantom record with a new id use:<pre><code>
+var rec = record.copy(); // clone the record
+Ext.data.Record.id(rec); // automatically generate a unique sequential id
+     * </code></pre>
+     * @return {Record}
+     */
+    copy : function(newId) {
+        return new this.constructor(Ext.apply({}, this.data), newId || this.id);
+    },
+
+    /**
+     * Returns <tt>true</tt> if the passed field name has been <code>{@link #modified}</code>
+     * since the load or last commit.
+     * @param {String} fieldName {@link Ext.data.Field.{@link Ext.data.Field#name}
+     * @return {Boolean}
+     */
+    isModified : function(fieldName){
+        return !!(this.modified && this.modified.hasOwnProperty(fieldName));
+    },
+
+    /**
+     * By default returns <tt>false</tt> if any {@link Ext.data.Field field} within the
+     * record configured with <tt>{@link Ext.data.Field#allowBlank} = false</tt> returns
+     * <tt>true</tt> from an {@link Ext}.{@link Ext#isEmpty isempty} test.
+     * @return {Boolean}
+     */
+    isValid : function() {
+        return this.fields.find(function(f) {
+            return (f.allowBlank === false && Ext.isEmpty(this.data[f.name])) ? true : false;
+        },this) ? false : true;
+    },
+
+    /**
+     * <p>Marks this <b>Record</b> as <code>{@link #dirty}</code>.  This method
+     * is used interally when adding <code>{@link #phantom}</code> records to a
+     * {@link Ext.data.Store#writer writer enabled store}.</p>
+     * <br><p>Marking a record <code>{@link #dirty}</code> causes the phantom to
+     * be returned by {@link Ext.data.Store#getModifiedRecords} where it will
+     * have a create action composed for it during {@link Ext.data.Store#save store save}
+     * operations.</p>
+     */
+    markDirty : function(){
+        this.dirty = true;
+        if(!this.modified){
+            this.modified = {};
+        }
+        this.fields.each(function(f) {
+            this.modified[f.name] = this.data[f.name];
+        },this);
+    }
+};
+/**
+ * @class Ext.StoreMgr
+ * @extends Ext.util.MixedCollection
+ * The default global group of stores.
+ * @singleton
+ */
+Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
+    /**
+     * @cfg {Object} listeners @hide
+     */
+
+    /**
+     * Registers one or more Stores with the StoreMgr. You do not normally need to register stores
+     * manually.  Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered. 
+     * @param {Ext.data.Store} store1 A Store instance
+     * @param {Ext.data.Store} store2 (optional)
+     * @param {Ext.data.Store} etc... (optional)
+     */
+    register : function(){
+        for(var i = 0, s; (s = arguments[i]); i++){
+            this.add(s);
+        }
+    },
+
+    /**
+     * Unregisters one or more Stores with the StoreMgr
+     * @param {String/Object} id1 The id of the Store, or a Store instance
+     * @param {String/Object} id2 (optional)
+     * @param {String/Object} etc... (optional)
+     */
+    unregister : function(){
+        for(var i = 0, s; (s = arguments[i]); i++){
+            this.remove(this.lookup(s));
+        }
+    },
+
+    /**
+     * Gets a registered Store by id
+     * @param {String/Object} id The id of the Store, or a Store instance
+     * @return {Ext.data.Store}
+     */
+    lookup : function(id){
+        if(Ext.isArray(id)){
+            var fields = ['field1'], expand = !Ext.isArray(id[0]);
+            if(!expand){
+                for(var i = 2, len = id[0].length; i <= len; ++i){
+                    fields.push('field' + i);
+                }
+            }
+            return new Ext.data.ArrayStore({
+                fields: fields,
+                data: id,
+                expandData: expand,
+                autoDestroy: true,
+                autoCreated: true
+
+            });
+        }
+        return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
+    },
+
+    // getKey implementation for MixedCollection
+    getKey : function(o){
+         return o.storeId;
+    }
+});/**
+ * @class Ext.data.Store
+ * @extends Ext.util.Observable
+ * <p>The Store class encapsulates a client side cache of {@link Ext.data.Record Record}
+ * objects which provide input data for Components such as the {@link Ext.grid.GridPanel GridPanel},
+ * the {@link Ext.form.ComboBox ComboBox}, or the {@link Ext.DataView DataView}.</p>
+ * <p><u>Retrieving Data</u></p>
+ * <p>A Store object may access a data object using:<div class="mdetail-params"><ul>
+ * <li>{@link #proxy configured implementation} of {@link Ext.data.DataProxy DataProxy}</li>
+ * <li>{@link #data} to automatically pass in data</li>
+ * <li>{@link #loadData} to manually pass in data</li>
+ * </ul></div></p>
+ * <p><u>Reading Data</u></p>
+ * <p>A Store object has no inherent knowledge of the format of the data object (it could be
+ * an Array, XML, or JSON). A Store object uses an appropriate {@link #reader configured implementation}
+ * of a {@link Ext.data.DataReader DataReader} to create {@link Ext.data.Record Record} instances from the data
+ * object.</p>
+ * <p><u>Store Types</u></p>
+ * <p>There are several implementations of Store available which are customized for use with
+ * a specific DataReader implementation.  Here is an example using an ArrayStore which implicitly
+ * creates a reader commensurate to an Array data object.</p>
+ * <pre><code>
+var myStore = new Ext.data.ArrayStore({
+    fields: ['fullname', 'first'],
+    idIndex: 0 // id for each record will be the first element
+});
+ * </code></pre>
+ * <p>For custom implementations create a basic {@link Ext.data.Store} configured as needed:</p>
+ * <pre><code>
+// create a {@link Ext.data.Record Record} constructor:
+var rt = Ext.data.Record.create([
+    {name: 'fullname'},
+    {name: 'first'}
+]);
+var myStore = new Ext.data.Store({
+    // explicitly create reader
+    reader: new Ext.data.ArrayReader(
+        {
+            idIndex: 0  // id for each record will be the first element
+        },
+        rt // recordType
+    )
+});
+ * </code></pre>
+ * <p>Load some data into store (note the data object is an array which corresponds to the reader):</p>
+ * <pre><code>
+var myData = [
+    [1, 'Fred Flintstone', 'Fred'],  // note that id for the record is the first element
+    [2, 'Barney Rubble', 'Barney']
+];
+myStore.loadData(myData);
+ * </code></pre>
+ * <p>Records are cached and made available through accessor functions.  An example of adding
+ * a record to the store:</p>
+ * <pre><code>
+var defaultData = {
+    fullname: 'Full Name',
+    first: 'First Name'
+};
+var recId = 100; // provide unique id for the record
+var r = new myStore.recordType(defaultData, ++recId); // create new record
+myStore.{@link #insert}(0, r); // insert a new record into the store (also see {@link #add})
+ * </code></pre>
+ * <p><u>Writing Data</u></p>
+ * <p>And <b>new in Ext version 3</b>, use the new {@link Ext.data.DataWriter DataWriter} to create an automated, <a href="http://extjs.com/deploy/dev/examples/writer/writer.html">Writable Store</a>
+ * along with <a href="http://extjs.com/deploy/dev/examples/restful/restful.html">RESTful features.</a>
+ * @constructor
+ * Creates a new Store.
+ * @param {Object} config A config object containing the objects needed for the Store to access data,
+ * and read the data into Records.
+ * @xtype store
+ */
+Ext.data.Store = Ext.extend(Ext.util.Observable, {
+    /**
+     * @cfg {String} storeId If passed, the id to use to register with the <b>{@link Ext.StoreMgr StoreMgr}</b>.
+     * <p><b>Note</b>: if a (deprecated) <tt>{@link #id}</tt> is specified it will supersede the <tt>storeId</tt>
+     * assignment.</p>
+     */
+    /**
+     * @cfg {String} url If a <tt>{@link #proxy}</tt> is not specified the <tt>url</tt> will be used to
+     * implicitly configure a {@link Ext.data.HttpProxy HttpProxy} if an <tt>url</tt> is specified.
+     * Typically this option, or the <code>{@link #data}</code> option will be specified.
+     */
+    /**
+     * @cfg {Boolean/Object} autoLoad If <tt>{@link #data}</tt> is not specified, and if <tt>autoLoad</tt>
+     * is <tt>true</tt> or an <tt>Object</tt>, this store's {@link #load} method is automatically called
+     * after creation. If the value of <tt>autoLoad</tt> is an <tt>Object</tt>, this <tt>Object</tt> will
+     * be passed to the store's {@link #load} method.
+     */
+    /**
+     * @cfg {Ext.data.DataProxy} proxy The {@link Ext.data.DataProxy DataProxy} object which provides
+     * access to a data object.  See <code>{@link #url}</code>.
+     */
+    /**
+     * @cfg {Array} data An inline data object readable by the <code>{@link #reader}</code>.
+     * Typically this option, or the <code>{@link #url}</code> option will be specified.
+     */
+    /**
+     * @cfg {Ext.data.DataReader} reader The {@link Ext.data.DataReader Reader} object which processes the
+     * data object and returns an Array of {@link Ext.data.Record} objects which are cached keyed by their
+     * <b><tt>{@link Ext.data.Record#id id}</tt></b> property.
+     */
+    /**
+     * @cfg {Ext.data.DataWriter} writer
+     * <p>The {@link Ext.data.DataWriter Writer} object which processes a record object for being written
+     * to the server-side database.</p>
+     * <br><p>When a writer is installed into a Store the {@link #add}, {@link #remove}, and {@link #update}
+     * events on the store are monitored in order to remotely {@link #createRecords create records},
+     * {@link #destroyRecord destroy records}, or {@link #updateRecord update records}.</p>
+     * <br><p>The proxy for this store will relay any {@link #writexception} events to this store.</p>
+     * <br><p>Sample implementation:
+     * <pre><code>
+var writer = new {@link Ext.data.JsonWriter}({
+    encode: true,
+    writeAllFields: true // write all fields, not just those that changed
+});
+
+// Typical Store collecting the Proxy, Reader and Writer together.
+var store = new Ext.data.Store({
+    storeId: 'user',
+    root: 'records',
+    proxy: proxy,
+    reader: reader,
+    writer: writer,     // <-- plug a DataWriter into the store just as you would a Reader
+    paramsAsHash: true,
+    autoSave: false    // <-- false to delay executing create, update, destroy requests
+                        //     until specifically told to do so.
+});
+     * </code></pre></p>
+     */
+    writer : undefined,
+    /**
+     * @cfg {Object} baseParams
+     * <p>An object containing properties which are to be sent as parameters
+     * for <i>every</i> HTTP request.</p>
+     * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
+     * <p><b>Note</b>: <code>baseParams</code> may be superseded by any <code>params</code>
+     * specified in a <code>{@link #load}</code> request, see <code>{@link #load}</code>
+     * for more details.</p>
+     * This property may be modified after creation using the <code>{@link #setBaseParam}</code>
+     * method.
+     * @property
+     */
+    /**
+     * @cfg {Object} sortInfo A config object to specify the sort order in the request of a Store's
+     * {@link #load} operation.  Note that for local sorting, the <tt>direction</tt> property is
+     * case-sensitive. See also {@link #remoteSort} and {@link #paramNames}.
+     * For example:<pre><code>
+sortInfo: {
+    field: 'fieldName',
+    direction: 'ASC' // or 'DESC' (case sensitive for local sorting)
+}
+</code></pre>
+     */
+    /**
+     * @cfg {boolean} remoteSort <tt>true</tt> if sorting is to be handled by requesting the <tt>{@link #proxy Proxy}</tt>
+     * to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache
+     * in place (defaults to <tt>false</tt>).
+     * <p>If <tt>remoteSort</tt> is <tt>true</tt>, then clicking on a {@link Ext.grid.Column Grid Column}'s
+     * {@link Ext.grid.Column#header header} causes the current page to be requested from the server appending
+     * the following two parameters to the <b><tt>{@link #load params}</tt></b>:<div class="mdetail-params"><ul>
+     * <li><b><tt>sort</tt></b> : String<p class="sub-desc">The <tt>name</tt> (as specified in the Record's
+     * {@link Ext.data.Field Field definition}) of the field to sort on.</p></li>
+     * <li><b><tt>dir</tt></b> : String<p class="sub-desc">The direction of the sort, 'ASC' or 'DESC' (case-sensitive).</p></li>
+     * </ul></div></p>
+     */
+    remoteSort : false,
+
+    /**
+     * @cfg {Boolean} autoDestroy <tt>true</tt> to destroy the store when the component the store is bound
+     * to is destroyed (defaults to <tt>false</tt>).
+     * <p><b>Note</b>: this should be set to true when using stores that are bound to only 1 component.</p>
+     */
+    autoDestroy : false,
+
+    /**
+     * @cfg {Boolean} pruneModifiedRecords <tt>true</tt> to clear all modified record information each time
+     * the store is loaded or when a record is removed (defaults to <tt>false</tt>). See {@link #getModifiedRecords}
+     * for the accessor method to retrieve the modified records.
+     */
+    pruneModifiedRecords : false,
+
+    /**
+     * Contains the last options object used as the parameter to the {@link #load} method. See {@link #load}
+     * for the details of what this may contain. This may be useful for accessing any params which were used
+     * to load the current Record cache.
+     * @property
+     */
+    lastOptions : null,
+
+    /**
+     * @cfg {Boolean} autoSave
+     * <p>Defaults to <tt>true</tt> causing the store to automatically {@link #save} records to
+     * the server when a record is modified (ie: becomes 'dirty'). Specify <tt>false</tt> to manually call {@link #save}
+     * to send all modifiedRecords to the server.</p>
+     * <br><p><b>Note</b>: each CRUD action will be sent as a separate request.</p>
+     */
+    autoSave : true,
+
+    /**
+     * @cfg {Boolean} batch
+     * <p>Defaults to <tt>true</tt> (unless <code>{@link #restful}:true</code>). Multiple
+     * requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined
+     * and sent as one transaction. Only applies when <code>{@link #autoSave}</code> is set
+     * to <tt>false</tt>.</p>
+     * <br><p>If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is
+     * generated for each record.</p>
+     */
+    batch : true,
+
+    /**
+     * @cfg {Boolean} restful
+     * Defaults to <tt>false</tt>.  Set to <tt>true</tt> to have the Store and the set
+     * Proxy operate in a RESTful manner. The store will automatically generate GET, POST,
+     * PUT and DELETE requests to the server. The HTTP method used for any given CRUD
+     * action is described in {@link Ext.data.Api#restActions}.  For additional information
+     * see {@link Ext.data.DataProxy#restful}.
+     * <p><b>Note</b>: if <code>{@link #restful}:true</code> <code>batch</code> will
+     * internally be set to <tt>false</tt>.</p>
+     */
+    restful: false,
+
+    /**
+     * @cfg {Object} paramNames
+     * <p>An object containing properties which specify the names of the paging and
+     * sorting parameters passed to remote servers when loading blocks of data. By default, this
+     * object takes the following form:</p><pre><code>
+{
+    start : 'start',  // The parameter name which specifies the start row
+    limit : 'limit',  // The parameter name which specifies number of rows to return
+    sort : 'sort',    // The parameter name which specifies the column to sort on
+    dir : 'dir'       // The parameter name which specifies the sort direction
+}
+</code></pre>
+     * <p>The server must produce the requested data block upon receipt of these parameter names.
+     * If different parameter names are required, this property can be overriden using a configuration
+     * property.</p>
+     * <p>A {@link Ext.PagingToolbar PagingToolbar} bound to this Store uses this property to determine
+     * the parameter names to use in its {@link #load requests}.
+     */
+    paramNames : undefined,
+
+    /**
+     * @cfg {Object} defaultParamNames
+     * Provides the default values for the {@link #paramNames} property. To globally modify the parameters
+     * for all stores, this object should be changed on the store prototype.
+     */
+    defaultParamNames : {
+        start : 'start',
+        limit : 'limit',
+        sort : 'sort',
+        dir : 'dir'
+    },
+
+    // private
+    batchKey : '_ext_batch_',
+
+    constructor : function(config){
+        this.data = new Ext.util.MixedCollection(false);
+        this.data.getKey = function(o){
+            return o.id;
+        };
+
+
+        // temporary removed-records cache
+        this.removed = [];
+
+        if(config && config.data){
+            this.inlineData = config.data;
+            delete config.data;
+        }
+
+        Ext.apply(this, config);
+
+        /**
+         * See the <code>{@link #baseParams corresponding configuration option}</code>
+         * for a description of this property.
+         * To modify this property see <code>{@link #setBaseParam}</code>.
+         * @property
+         */
+        this.baseParams = Ext.isObject(this.baseParams) ? this.baseParams : {};
+
+        this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames);
+
+        if((this.url || this.api) && !this.proxy){
+            this.proxy = new Ext.data.HttpProxy({url: this.url, api: this.api});
+        }
+        // If Store is RESTful, so too is the DataProxy
+        if (this.restful === true && this.proxy) {
+            // When operating RESTfully, a unique transaction is generated for each record.
+            // TODO might want to allow implemention of faux REST where batch is possible using RESTful routes only.
+            this.batch = false;
+            Ext.data.Api.restify(this.proxy);
+        }
+
+        if(this.reader){ // reader passed
+            if(!this.recordType){
+                this.recordType = this.reader.recordType;
+            }
+            if(this.reader.onMetaChange){
+                this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this);
+            }
+            if (this.writer) { // writer passed
+                if (this.writer instanceof(Ext.data.DataWriter) === false) {    // <-- config-object instead of instance.
+                    this.writer = this.buildWriter(this.writer);
+                }
+                this.writer.meta = this.reader.meta;
+                this.pruneModifiedRecords = true;
+            }
+        }
+
+        /**
+         * The {@link Ext.data.Record Record} constructor as supplied to (or created by) the
+         * {@link Ext.data.DataReader Reader}. Read-only.
+         * <p>If the Reader was constructed by passing in an Array of {@link Ext.data.Field} definition objects,
+         * instead of a Record constructor, it will implicitly create a Record constructor from that Array (see
+         * {@link Ext.data.Record}.{@link Ext.data.Record#create create} for additional details).</p>
+         * <p>This property may be used to create new Records of the type held in this Store, for example:</p><pre><code>
+    // create the data store
+    var store = new Ext.data.ArrayStore({
+        autoDestroy: true,
+        fields: [
+           {name: 'company'},
+           {name: 'price', type: 'float'},
+           {name: 'change', type: 'float'},
+           {name: 'pctChange', type: 'float'},
+           {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
+        ]
+    });
+    store.loadData(myData);
+
+    // create the Grid
+    var grid = new Ext.grid.EditorGridPanel({
+        store: store,
+        colModel: new Ext.grid.ColumnModel({
+            columns: [
+                {id:'company', header: 'Company', width: 160, dataIndex: 'company'},
+                {header: 'Price', renderer: 'usMoney', dataIndex: 'price'},
+                {header: 'Change', renderer: change, dataIndex: 'change'},
+                {header: '% Change', renderer: pctChange, dataIndex: 'pctChange'},
+                {header: 'Last Updated', width: 85,
+                    renderer: Ext.util.Format.dateRenderer('m/d/Y'),
+                    dataIndex: 'lastChange'}
+            ],
+            defaults: {
+                sortable: true,
+                width: 75
+            }
+        }),
+        autoExpandColumn: 'company', // match the id specified in the column model
+        height:350,
+        width:600,
+        title:'Array Grid',
+        tbar: [{
+            text: 'Add Record',
+            handler : function(){
+                var defaultData = {
+                    change: 0,
+                    company: 'New Company',
+                    lastChange: (new Date()).clearTime(),
+                    pctChange: 0,
+                    price: 10
+                };
+                var recId = 3; // provide unique id
+                var p = new store.recordType(defaultData, recId); // create new record
+                grid.stopEditing();
+                store.{@link #insert}(0, p); // insert a new record into the store (also see {@link #add})
+                grid.startEditing(0, 0);
+            }
+        }]
+    });
+         * </code></pre>
+         * @property recordType
+         * @type Function
+         */
+
+        if(this.recordType){
+            /**
+             * A {@link Ext.util.MixedCollection MixedCollection} containing the defined {@link Ext.data.Field Field}s
+             * for the {@link Ext.data.Record Records} stored in this Store. Read-only.
+             * @property fields
+             * @type Ext.util.MixedCollection
+             */
+            this.fields = this.recordType.prototype.fields;
+        }
+        this.modified = [];
+
+        this.addEvents(
+            /**
+             * @event datachanged
+             * Fires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a
+             * widget that is using this Store as a Record cache should refresh its view.
+             * @param {Store} this
+             */
+            'datachanged',
+            /**
+             * @event metachange
+             * Fires when this store's reader provides new metadata (fields). This is currently only supported for JsonReaders.
+             * @param {Store} this
+             * @param {Object} meta The JSON metadata
+             */
+            'metachange',
+            /**
+             * @event add
+             * Fires when Records have been {@link #add}ed to the Store
+             * @param {Store} this
+             * @param {Ext.data.Record[]} records The array of Records added
+             * @param {Number} index The index at which the record(s) were added
+             */
+            'add',
+            /**
+             * @event remove
+             * Fires when a Record has been {@link #remove}d from the Store
+             * @param {Store} this
+             * @param {Ext.data.Record} record The Record that was removed
+             * @param {Number} index The index at which the record was removed
+             */
+            'remove',
+            /**
+             * @event update
+             * Fires when a Record has been updated
+             * @param {Store} this
+             * @param {Ext.data.Record} record The Record that was updated
+             * @param {String} operation The update operation being performed.  Value may be one of:
+             * <pre><code>
+     Ext.data.Record.EDIT
+     Ext.data.Record.REJECT
+     Ext.data.Record.COMMIT
+             * </code></pre>
+             */
+            'update',
+            /**
+             * @event clear
+             * Fires when the data cache has been cleared.
+             * @param {Store} this
+             * @param {Record[]} The records that were cleared.
+             */
+            'clear',
+            /**
+             * @event exception
+             * <p>Fires if an exception occurs in the Proxy during a remote request.
+             * This event is relayed through the corresponding {@link Ext.data.DataProxy}.
+             * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
+             * for additional details.
+             * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
+             * for description.
+             */
+            'exception',
+            /**
+             * @event beforeload
+             * Fires before a request is made for a new data object.  If the beforeload handler returns
+             * <tt>false</tt> the {@link #load} action will be canceled.
+             * @param {Store} this
+             * @param {Object} options The loading options that were specified (see {@link #load} for details)
+             */
+            'beforeload',
+            /**
+             * @event load
+             * Fires after a new set of Records has been loaded.
+             * @param {Store} this
+             * @param {Ext.data.Record[]} records The Records that were loaded
+             * @param {Object} options The loading options that were specified (see {@link #load} for details)
+             */
+            'load',
+            /**
+             * @event loadexception
+             * <p>This event is <b>deprecated</b> in favor of the catch-all <b><code>{@link #exception}</code></b>
+             * event instead.</p>
+             * <p>This event is relayed through the corresponding {@link Ext.data.DataProxy}.
+             * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception}
+             * for additional details.
+             * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception}
+             * for description.
+             */
+            'loadexception',
+            /**
+             * @event beforewrite
+             * @param {Ext.data.Store} store
+             * @param {String} action [Ext.data.Api.actions.create|update|destroy]
+             * @param {Record/Array[Record]} rs
+             * @param {Object} options The loading options that were specified. Edit <code>options.params</code> to add Http parameters to the request.  (see {@link #save} for details)
+             * @param {Object} arg The callback's arg object passed to the {@link #request} function
+             */
+            'beforewrite',
+            /**
+             * @event write
+             * Fires if the server returns 200 after an Ext.data.Api.actions CRUD action.
+             * Success of the action is determined in the <code>result['successProperty']</code>property (<b>NOTE</b> for RESTful stores,
+             * a simple 20x response is sufficient for the actions "destroy" and "update".  The "create" action should should return 200 along with a database pk).
+             * @param {Ext.data.Store} store
+             * @param {String} action [Ext.data.Api.actions.create|update|destroy]
+             * @param {Object} result The 'data' picked-out out of the response for convenience.
+             * @param {Ext.Direct.Transaction} res
+             * @param {Record/Record[]} rs Store's records, the subject(s) of the write-action
+             */
+            'write',
+            /**
+             * @event beforesave
+             * Fires before a save action is called. A save encompasses destroying records, updating records and creating records.
+             * @param {Ext.data.Store} store
+             * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action,
+             * with an array of records for each action.
+             */
+            'beforesave',
+            /**
+             * @event save
+             * Fires after a save is completed. A save encompasses destroying records, updating records and creating records.
+             * @param {Ext.data.Store} store
+             * @param {Number} batch The identifier for the batch that was saved.
+             * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action,
+             * with an array of records for each action.
+             */
+            'save'
+
+        );
+
+        if(this.proxy){
+            // TODO remove deprecated loadexception with ext-3.0.1
+            this.relayEvents(this.proxy,  ['loadexception', 'exception']);
+        }
+        // With a writer set for the Store, we want to listen to add/remove events to remotely create/destroy records.
+        if (this.writer) {
+            this.on({
+                scope: this,
+                add: this.createRecords,
+                remove: this.destroyRecord,
+                update: this.updateRecord,
+                clear: this.onClear
+            });
+        }
+
+        this.sortToggle = {};
+        if(this.sortField){
+            this.setDefaultSort(this.sortField, this.sortDir);
+        }else if(this.sortInfo){
+            this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction);
+        }
+
+        Ext.data.Store.superclass.constructor.call(this);
+
+        if(this.id){
+            this.storeId = this.id;
+            delete this.id;
+        }
+        if(this.storeId){
+            Ext.StoreMgr.register(this);
+        }
+        if(this.inlineData){
+            this.loadData(this.inlineData);
+            delete this.inlineData;
+        }else if(this.autoLoad){
+            this.load.defer(10, this, [
+                typeof this.autoLoad == 'object' ?
+                    this.autoLoad : undefined]);
+        }
+        // used internally to uniquely identify a batch
+        this.batchCounter = 0;
+        this.batches = {};
+    },
+
+    /**
+     * builds a DataWriter instance when Store constructor is provided with a writer config-object instead of an instace.
+     * @param {Object} config Writer configuration
+     * @return {Ext.data.DataWriter}
+     * @private
+     */
+    buildWriter : function(config) {
+        var klass = undefined,
+            type = (config.format || 'json').toLowerCase();
+        switch (type) {
+            case 'json':
+                klass = Ext.data.JsonWriter;
+                break;
+            case 'xml':
+                klass = Ext.data.XmlWriter;
+                break;
+            default:
+                klass = Ext.data.JsonWriter;
+        }
+        return new klass(config);
+    },
+
+    /**
+     * Destroys the store.
+     */
+    destroy : function(){
+        if(!this.isDestroyed){
+            if(this.storeId){
+                Ext.StoreMgr.unregister(this);
+            }
+            this.clearData();
+            this.data = null;
+            Ext.destroy(this.proxy);
+            this.reader = this.writer = null;
+            this.purgeListeners();
+            this.isDestroyed = true;
+        }
+    },
+
+    /**
+     * Add Records to the Store and fires the {@link #add} event.  To add Records
+     * to the store from a remote source use <code>{@link #load}({add:true})</code>.
+     * See also <code>{@link #recordType}</code> and <code>{@link #insert}</code>.
+     * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects
+     * to add to the cache. See {@link #recordType}.
+     */
+    add : function(records){
+        records = [].concat(records);
+        if(records.length < 1){
+            return;
+        }
+        for(var i = 0, len = records.length; i < len; i++){
+            records[i].join(this);
+        }
+        var index = this.data.length;
+        this.data.addAll(records);
+        if(this.snapshot){
+            this.snapshot.addAll(records);
+        }
+        this.fireEvent('add', this, records, index);
+    },
+
+    /**
+     * (Local sort only) Inserts the passed Record into the Store at the index where it
+     * should go based on the current sort information.
+     * @param {Ext.data.Record} record
+     */
+    addSorted : function(record){
+        var index = this.findInsertIndex(record);
+        this.insert(index, record);
+    },
+
+    /**
+     * Remove Records from the Store and fires the {@link #remove} event.
+     * @param {Ext.data.Record/Ext.data.Record[]} record The record object or array of records to remove from the cache.
+     */
+    remove : function(record){
+        if(Ext.isArray(record)){
+            Ext.each(record, function(r){
+                this.remove(r);
+            }, this);
+        }
+        var index = this.data.indexOf(record);
+        if(index > -1){
+            record.join(null);
+            this.data.removeAt(index);
+        }
+        if(this.pruneModifiedRecords){
+            this.modified.remove(record);
+        }
+        if(this.snapshot){
+            this.snapshot.remove(record);
+        }
+        if(index > -1){
+            this.fireEvent('remove', this, record, index);
+        }
+    },
+
+    /**
+     * Remove a Record from the Store at the specified index. Fires the {@link #remove} event.
+     * @param {Number} index The index of the record to remove.
+     */
+    removeAt : function(index){
+        this.remove(this.getAt(index));
+    },
+
+    /**
+     * Remove all Records from the Store and fires the {@link #clear} event.
+     * @param {Boolean} silent [false] Defaults to <tt>false</tt>.  Set <tt>true</tt> to not fire clear event.
+     */
+    removeAll : function(silent){
+        var items = [];
+        this.each(function(rec){
+            items.push(rec);
+        });
+        this.clearData();
+        if(this.snapshot){
+            this.snapshot.clear();
+        }
+        if(this.pruneModifiedRecords){
+            this.modified = [];
+        }
+        if (silent !== true) {  // <-- prevents write-actions when we just want to clear a store.
+            this.fireEvent('clear', this, items);
+        }
+    },
+
+    // private
+    onClear: function(store, records){
+        Ext.each(records, function(rec, index){
+            this.destroyRecord(this, rec, index);
+        }, this);
+    },
+
+    /**
+     * Inserts Records into the Store at the given index and fires the {@link #add} event.
+     * See also <code>{@link #add}</code> and <code>{@link #addSorted}</code>.
+     * @param {Number} index The start index at which to insert the passed Records.
+     * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects to add to the cache.
+     */
+    insert : function(index, records){
+        records = [].concat(records);
+        for(var i = 0, len = records.length; i < len; i++){
+            this.data.insert(index, records[i]);
+            records[i].join(this);
+        }
+        if(this.snapshot){
+            this.snapshot.addAll(records);
+        }
+        this.fireEvent('add', this, records, index);
+    },
+
+    /**
+     * Get the index within the cache of the passed Record.
+     * @param {Ext.data.Record} record The Ext.data.Record object to find.
+     * @return {Number} The index of the passed Record. Returns -1 if not found.
+     */
+    indexOf : function(record){
+        return this.data.indexOf(record);
+    },
+
+    /**
+     * Get the index within the cache of the Record with the passed id.
+     * @param {String} id The id of the Record to find.
+     * @return {Number} The index of the Record. Returns -1 if not found.
+     */
+    indexOfId : function(id){
+        return this.data.indexOfKey(id);
+    },
+
+    /**
+     * Get the Record with the specified id.
+     * @param {String} id The id of the Record to find.
+     * @return {Ext.data.Record} The Record with the passed id. Returns undefined if not found.
+     */
+    getById : function(id){
+        return (this.snapshot || this.data).key(id);
+    },
+
+    /**
+     * Get the Record at the specified index.
+     * @param {Number} index The index of the Record to find.
+     * @return {Ext.data.Record} The Record at the passed index. Returns undefined if not found.
+     */
+    getAt : function(index){
+        return this.data.itemAt(index);
+    },
+
+    /**
+     * Returns a range of Records between specified indices.
+     * @param {Number} startIndex (optional) The starting index (defaults to 0)
+     * @param {Number} endIndex (optional) The ending index (defaults to the last Record in the Store)
+     * @return {Ext.data.Record[]} An array of Records
+     */
+    getRange : function(start, end){
+        return this.data.getRange(start, end);
+    },
+
+    // private
+    storeOptions : function(o){
+        o = Ext.apply({}, o);
+        delete o.callback;
+        delete o.scope;
+        this.lastOptions = o;
+    },
+
+    // private
+    clearData: function(){
+        this.data.each(function(rec) {
+            rec.join(null);
+        });
+        this.data.clear();
+    },
+
+    /**
+     * <p>Loads the Record cache from the configured <tt>{@link #proxy}</tt> using the configured <tt>{@link #reader}</tt>.</p>
+     * <br><p>Notes:</p><div class="mdetail-params"><ul>
+     * <li><b><u>Important</u></b>: loading is asynchronous! This call will return before the new data has been
+     * loaded. To perform any post-processing where information from the load call is required, specify
+     * the <tt>callback</tt> function to be called, or use a {@link Ext.util.Observable#listeners a 'load' event handler}.</li>
+     * <li>If using {@link Ext.PagingToolbar remote paging}, the first load call must specify the <tt>start</tt> and <tt>limit</tt>
+     * properties in the <code>options.params</code> property to establish the initial position within the
+     * dataset, and the number of Records to cache on each read from the Proxy.</li>
+     * <li>If using {@link #remoteSort remote sorting}, the configured <code>{@link #sortInfo}</code>
+     * will be automatically included with the posted parameters according to the specified
+     * <code>{@link #paramNames}</code>.</li>
+     * </ul></div>
+     * @param {Object} options An object containing properties which control loading options:<ul>
+     * <li><b><tt>params</tt></b> :Object<div class="sub-desc"><p>An object containing properties to pass as HTTP
+     * parameters to a remote data source. <b>Note</b>: <code>params</code> will override any
+     * <code>{@link #baseParams}</code> of the same name.</p>
+     * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p></div></li>
+     * <li><b>callback</b> : Function<div class="sub-desc"><p>A function to be called after the Records
+     * have been loaded. The callback is called after the load event is fired, and is passed the following arguments:<ul>
+     * <li>r : Ext.data.Record[] An Array of Records loaded.</li>
+     * <li>options : Options object from the load call.</li>
+     * <li>success : Boolean success indicator.</li></ul></p></div></li>
+     * <li><b>scope</b> : Object<div class="sub-desc"><p>Scope with which to call the callback (defaults
+     * to the Store object)</p></div></li>
+     * <li><b>add</b> : Boolean<div class="sub-desc"><p>Indicator to append loaded records rather than
+     * replace the current cache.  <b>Note</b>: see note for <tt>{@link #loadData}</tt></p></div></li>
+     * </ul>
+     * @return {Boolean} If the <i>developer</i> provided <tt>{@link #beforeload}</tt> event handler returns
+     * <tt>false</tt>, the load call will abort and will return <tt>false</tt>; otherwise will return <tt>true</tt>.
+     */
+    load : function(options) {
+        options = options || {};
+        this.storeOptions(options);
+        if(this.sortInfo && this.remoteSort){
+            var pn = this.paramNames;
+            options.params = options.params || {};
+            options.params[pn.sort] = this.sortInfo.field;
+            options.params[pn.dir] = this.sortInfo.direction;
+        }
+        try {
+            return this.execute('read', null, options); // <-- null represents rs.  No rs for load actions.
+        } catch(e) {
+            this.handleException(e);
+            return false;
+        }
+    },
+
+    /**
+     * updateRecord  Should not be used directly.  This method will be called automatically if a Writer is set.
+     * Listens to 'update' event.
+     * @param {Object} store
+     * @param {Object} record
+     * @param {Object} action
+     * @private
+     */
+    updateRecord : function(store, record, action) {
+        if (action == Ext.data.Record.EDIT && this.autoSave === true && (!record.phantom || (record.phantom && record.isValid()))) {
+            this.save();
+        }
+    },
+
+    /**
+     * Should not be used directly.  Store#add will call this automatically if a Writer is set
+     * @param {Object} store
+     * @param {Object} rs
+     * @param {Object} index
+     * @private
+     */
+    createRecords : function(store, rs, index) {
+        for (var i = 0, len = rs.length; i < len; i++) {
+            if (rs[i].phantom && rs[i].isValid()) {
+                rs[i].markDirty();  // <-- Mark new records dirty
+                this.modified.push(rs[i]);  // <-- add to modified
+            }
+        }
+        if (this.autoSave === true) {
+            this.save();
+        }
+    },
+
+    /**
+     * Destroys a record or records.  Should not be used directly.  It's called by Store#remove if a Writer is set.
+     * @param {Store} this
+     * @param {Ext.data.Record/Ext.data.Record[]}
+     * @param {Number} index
+     * @private
+     */
+    destroyRecord : function(store, record, index) {
+        if (this.modified.indexOf(record) != -1) {  // <-- handled already if @cfg pruneModifiedRecords == true
+            this.modified.remove(record);
+        }
+        if (!record.phantom) {
+            this.removed.push(record);
+
+            // since the record has already been removed from the store but the server request has not yet been executed,
+            // must keep track of the last known index this record existed.  If a server error occurs, the record can be
+            // put back into the store.  @see Store#createCallback where the record is returned when response status === false
+            record.lastIndex = index;
+
+            if (this.autoSave === true) {
+                this.save();
+            }
+        }
+    },
+
+    /**
+     * This method should generally not be used directly.  This method is called internally
+     * by {@link #load}, or if a Writer is set will be called automatically when {@link #add},
+     * {@link #remove}, or {@link #update} events fire.
+     * @param {String} action Action name ('read', 'create', 'update', or 'destroy')
+     * @param {Record/Record[]} rs
+     * @param {Object} options
+     * @throws Error
+     * @private
+     */
+    execute : function(action, rs, options, /* private */ batch) {
+        // blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY
+        if (!Ext.data.Api.isAction(action)) {
+            throw new Ext.data.Api.Error('execute', action);
+        }
+        // make sure options has a fresh, new params hash
+        options = Ext.applyIf(options||{}, {
+            params: {}
+        });
+        if(batch !== undefined){
+            this.addToBatch(batch);
+        }
+        // have to separate before-events since load has a different signature than create,destroy and save events since load does not
+        // include the rs (record resultset) parameter.  Capture return values from the beforeaction into doRequest flag.
+        var doRequest = true;
+
+        if (action === 'read') {
+            doRequest = this.fireEvent('beforeload', this, options);
+            Ext.applyIf(options.params, this.baseParams);
+        }
+        else {
+            // if Writer is configured as listful, force single-record rs to be [{}] instead of {}
+            // TODO Move listful rendering into DataWriter where the @cfg is defined.  Should be easy now.
+            if (this.writer.listful === true && this.restful !== true) {
+                rs = (Ext.isArray(rs)) ? rs : [rs];
+            }
+            // if rs has just a single record, shift it off so that Writer writes data as '{}' rather than '[{}]'
+            else if (Ext.isArray(rs) && rs.length == 1) {
+                rs = rs.shift();
+            }
+            // Write the action to options.params
+            if ((doRequest = this.fireEvent('beforewrite', this, action, rs, options)) !== false) {
+                this.writer.apply(options.params, this.baseParams, action, rs);
+            }
+        }
+        if (doRequest !== false) {
+            // Send request to proxy.
+            if (this.writer && this.proxy.url && !this.proxy.restful && !Ext.data.Api.hasUniqueUrl(this.proxy, action)) {
+                options.params.xaction = action;    // <-- really old, probaby unecessary.
+            }
+            // Note:  Up until this point we've been dealing with 'action' as a key from Ext.data.Api.actions.
+            // We'll flip it now and send the value into DataProxy#request, since it's the value which maps to
+            // the user's configured DataProxy#api
+            // TODO Refactor all Proxies to accept an instance of Ext.data.Request (not yet defined) instead of this looooooong list
+            // of params.  This method is an artifact from Ext2.
+            this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options);
+        }
+        return doRequest;
+    },
+
+    /**
+     * Saves all pending changes to the store.  If the commensurate Ext.data.Api.actions action is not configured, then
+     * the configured <code>{@link #url}</code> will be used.
+     * <pre>
+     * change            url
+     * ---------------   --------------------
+     * removed records   Ext.data.Api.actions.destroy
+     * phantom records   Ext.data.Api.actions.create
+     * {@link #getModifiedRecords modified records}  Ext.data.Api.actions.update
+     * </pre>
+     * @TODO:  Create extensions of Error class and send associated Record with thrown exceptions.
+     * e.g.:  Ext.data.DataReader.Error or Ext.data.Error or Ext.data.DataProxy.Error, etc.
+     * @return {Number} batch Returns a number to uniquely identify the "batch" of saves occurring. -1 will be returned
+     * if there are no items to save or the save was cancelled.
+     */
+    save : function() {
+        if (!this.writer) {
+            throw new Ext.data.Store.Error('writer-undefined');
+        }
+
+        var queue = [],
+            len,
+            trans,
+            batch,
+            data = {};
+        // DESTROY:  First check for removed records.  Records in this.removed are guaranteed non-phantoms.  @see Store#remove
+        if(this.removed.length){
+            queue.push(['destroy', this.removed]);
+        }
+
+        // Check for modified records. Use a copy so Store#rejectChanges will work if server returns error.
+        var rs = [].concat(this.getModifiedRecords());
+        if(rs.length){
+            // CREATE:  Next check for phantoms within rs.  splice-off and execute create.
+            var phantoms = [];
+            for(var i = rs.length-1; i >= 0; i--){
+                if(rs[i].phantom === true){
+                    var rec = rs.splice(i, 1).shift();
+                    if(rec.isValid()){
+                        phantoms.push(rec);
+                    }
+                }else if(!rs[i].isValid()){ // <-- while we're here, splice-off any !isValid real records
+                    rs.splice(i,1);
+                }
+            }
+            // If we have valid phantoms, create them...
+            if(phantoms.length){
+                queue.push(['create', phantoms]);
+            }
+
+            // UPDATE:  And finally, if we're still here after splicing-off phantoms and !isValid real records, update the rest...
+            if(rs.length){
+                queue.push(['update', rs]);
+            }
+        }
+        len = queue.length;
+        if(len){
+            batch = ++this.batchCounter;
+            for(var i = 0; i < len; ++i){
+                trans = queue[i];
+                data[trans[0]] = trans[1];
+            }
+            if(this.fireEvent('beforesave', this, data) !== false){
+                for(var i = 0; i < len; ++i){
+                    trans = queue[i];
+                    this.doTransaction(trans[0], trans[1], batch);
+                }
+                return batch;
+            }
+        }
+        return -1;
+    },
+
+    // private.  Simply wraps call to Store#execute in try/catch.  Defers to Store#handleException on error.  Loops if batch: false
+    doTransaction : function(action, rs, batch) {
+        function transaction(records) {
+            try{
+                this.execute(action, records, undefined, batch);
+            }catch (e){
+                this.handleException(e);
+            }
+        }
+        if(this.batch === false){
+            for(var i = 0, len = rs.length; i < len; i++){
+                transaction.call(this, rs[i]);
+            }
+        }else{
+            transaction.call(this, rs);
+        }
+    },
+
+    // private
+    addToBatch : function(batch){
+        var b = this.batches,
+            key = this.batchKey + batch,
+            o = b[key];
+
+        if(!o){
+            b[key] = o = {
+                id: batch,
+                count: 0,
+                data: {}
+            }
+        }
+        ++o.count;
+    },
+
+    removeFromBatch : function(batch, action, data){
+        var b = this.batches,
+            key = this.batchKey + batch,
+            o = b[key],
+            data,
+            arr;
+
+
+        if(o){
+            arr = o.data[action] || [];
+            o.data[action] = arr.concat(data);
+            if(o.count === 1){
+                data = o.data;
+                delete b[key];
+                this.fireEvent('save', this, batch, data);
+            }else{
+                --o.count;
+            }
+        }
+    },
+
+    // @private callback-handler for remote CRUD actions
+    // Do not override -- override loadRecords, onCreateRecords, onDestroyRecords and onUpdateRecords instead.
+    createCallback : function(action, rs, batch) {
+        var actions = Ext.data.Api.actions;
+        return (action == 'read') ? this.loadRecords : function(data, response, success) {
+            // calls: onCreateRecords | onUpdateRecords | onDestroyRecords
+            this['on' + Ext.util.Format.capitalize(action) + 'Records'](success, rs, [].concat(data));
+            // If success === false here, exception will have been called in DataProxy
+            if (success === true) {
+                this.fireEvent('write', this, action, data, response, rs);
+            }
+            this.removeFromBatch(batch, action, data);
+        };
+    },
+
+    // Clears records from modified array after an exception event.
+    // NOTE:  records are left marked dirty.  Do we want to commit them even though they were not updated/realized?
+    // TODO remove this method?
+    clearModified : function(rs) {
+        if (Ext.isArray(rs)) {
+            for (var n=rs.length-1;n>=0;n--) {
+                this.modified.splice(this.modified.indexOf(rs[n]), 1);
+            }
+        } else {
+            this.modified.splice(this.modified.indexOf(rs), 1);
+        }
+    },
+
+    // remap record ids in MixedCollection after records have been realized.  @see Store#onCreateRecords, @see DataReader#realize
+    reMap : function(record) {
+        if (Ext.isArray(record)) {
+            for (var i = 0, len = record.length; i < len; i++) {
+                this.reMap(record[i]);
+            }
+        } else {
+            delete this.data.map[record._phid];
+            this.data.map[record.id] = record;
+            var index = this.data.keys.indexOf(record._phid);
+            this.data.keys.splice(index, 1, record.id);
+            delete record._phid;
+        }
+    },
+
+    // @protected onCreateRecord proxy callback for create action
+    onCreateRecords : function(success, rs, data) {
+        if (success === true) {
+            try {
+                this.reader.realize(rs, data);
+                this.reMap(rs);
+            }
+            catch (e) {
+                this.handleException(e);
+                if (Ext.isArray(rs)) {
+                    // Recurse to run back into the try {}.  DataReader#realize splices-off the rs until empty.
+                    this.onCreateRecords(success, rs, data);
+                }
+            }
+        }
+    },
+
+    // @protected, onUpdateRecords proxy callback for update action
+    onUpdateRecords : function(success, rs, data) {
+        if (success === true) {
+            try {
+                this.reader.update(rs, data);
+            } catch (e) {
+                this.handleException(e);
+                if (Ext.isArray(rs)) {
+                    // Recurse to run back into the try {}.  DataReader#update splices-off the rs until empty.
+                    this.onUpdateRecords(success, rs, data);
+                }
+            }
+        }
+    },
+
+    // @protected onDestroyRecords proxy callback for destroy action
+    onDestroyRecords : function(success, rs, data) {
+        // splice each rec out of this.removed
+        rs = (rs instanceof Ext.data.Record) ? [rs] : [].concat(rs);
+        for (var i=0,len=rs.length;i<len;i++) {
+            this.removed.splice(this.removed.indexOf(rs[i]), 1);
+        }
+        if (success === false) {
+            // put records back into store if remote destroy fails.
+            // @TODO: Might want to let developer decide.
+            for (i=rs.length-1;i>=0;i--) {
+                this.insert(rs[i].lastIndex, rs[i]);    // <-- lastIndex set in Store#destroyRecord
+            }
+        }
+    },
+
+    // protected handleException.  Possibly temporary until Ext framework has an exception-handler.
+    handleException : function(e) {
+        // @see core/Error.js
+        Ext.handleError(e);
+    },
+
+    /**
+     * <p>Reloads the Record cache from the configured Proxy using the configured
+     * {@link Ext.data.Reader Reader} and the options from the last load operation
+     * performed.</p>
+     * <p><b>Note</b>: see the Important note in {@link #load}.</p>
+     * @param {Object} options <p>(optional) An <tt>Object</tt> containing
+     * {@link #load loading options} which may override the {@link #lastOptions options}
+     * used in the last {@link #load} operation. See {@link #load} for details
+     * (defaults to <tt>null</tt>, in which case the {@link #lastOptions} are
+     * used).</p>
+     * <br><p>To add new params to the existing params:</p><pre><code>
+lastOptions = myStore.lastOptions;
+Ext.apply(lastOptions.params, {
+    myNewParam: true
+});
+myStore.reload(lastOptions);
+     * </code></pre>
+     */
+    reload : function(options){
+        this.load(Ext.applyIf(options||{}, this.lastOptions));
+    },
+
+    // private
+    // Called as a callback by the Reader during a load operation.
+    loadRecords : function(o, options, success){
+        if (this.isDestroyed === true) {
+            return;
+        }
+        if(!o || success === false){
+            if(success !== false){
+                this.fireEvent('load', this, [], options);
+            }
+            if(options.callback){
+                options.callback.call(options.scope || this, [], options, false, o);
+            }
+            return;
+        }
+        var r = o.records, t = o.totalRecords || r.length;
+        if(!options || options.add !== true){
+            if(this.pruneModifiedRecords){
+                this.modified = [];
+            }
+            for(var i = 0, len = r.length; i < len; i++){
+                r[i].join(this);
+            }
+            if(this.snapshot){
+                this.data = this.snapshot;
+                delete this.snapshot;
+            }
+            this.clearData();
+            this.data.addAll(r);
+            this.totalLength = t;
+            this.applySort();
+            this.fireEvent('datachanged', this);
+        }else{
+            this.totalLength = Math.max(t, this.data.length+r.length);
+            this.add(r);
+        }
+        this.fireEvent('load', this, r, options);
+        if(options.callback){
+            options.callback.call(options.scope || this, r, options, true);
+        }
+    },
+
+    /**
+     * Loads data from a passed data block and fires the {@link #load} event. A {@link Ext.data.Reader Reader}
+     * which understands the format of the data must have been configured in the constructor.
+     * @param {Object} data The data block from which to read the Records.  The format of the data expected
+     * is dependent on the type of {@link Ext.data.Reader Reader} that is configured and should correspond to
+     * that {@link Ext.data.Reader Reader}'s <tt>{@link Ext.data.Reader#readRecords}</tt> parameter.
+     * @param {Boolean} append (Optional) <tt>true</tt> to append the new Records rather the default to replace
+     * the existing cache.
+     * <b>Note</b>: that Records in a Store are keyed by their {@link Ext.data.Record#id id}, so added Records
+     * with ids which are already present in the Store will <i>replace</i> existing Records. Only Records with
+     * new, unique ids will be added.
+     */
+    loadData : function(o, append){
+        var r = this.reader.readRecords(o);
+        this.loadRecords(r, {add: append}, true);
+    },
+
+    /**
+     * Gets the number of cached records.
+     * <p>If using paging, this may not be the total size of the dataset. If the data object
+     * used by the Reader contains the dataset size, then the {@link #getTotalCount} function returns
+     * the dataset size.  <b>Note</b>: see the Important note in {@link #load}.</p>
+     * @return {Number} The number of Records in the Store's cache.
+     */
+    getCount : function(){
+        return this.data.length || 0;
+    },
+
+    /**
+     * Gets the total number of records in the dataset as returned by the server.
+     * <p>If using paging, for this to be accurate, the data object used by the {@link #reader Reader}
+     * must contain the dataset size. For remote data sources, the value for this property
+     * (<tt>totalProperty</tt> for {@link Ext.data.JsonReader JsonReader},
+     * <tt>totalRecords</tt> for {@link Ext.data.XmlReader XmlReader}) shall be returned by a query on the server.
+     * <b>Note</b>: see the Important note in {@link #load}.</p>
+     * @return {Number} The number of Records as specified in the data object passed to the Reader
+     * by the Proxy.
+     * <p><b>Note</b>: this value is not updated when changing the contents of the Store locally.</p>
+     */
+    getTotalCount : function(){
+        return this.totalLength || 0;
+    },
+
+    /**
+     * Returns an object describing the current sort state of this Store.
+     * @return {Object} The sort state of the Store. An object with two properties:<ul>
+     * <li><b>field : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
+     * <li><b>direction : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
+     * </ul>
+     * See <tt>{@link #sortInfo}</tt> for additional details.
+     */
+    getSortState : function(){
+        return this.sortInfo;
+    },
+
+    // private
+    applySort : function(){
+        if(this.sortInfo && !this.remoteSort){
+            var s = this.sortInfo, f = s.field;
+            this.sortData(f, s.direction);
+        }
+    },
+
+    // private
+    sortData : function(f, direction){
+        direction = direction || 'ASC';
+        var st = this.fields.get(f).sortType;
+        var fn = function(r1, r2){
+            var v1 = st(r1.data[f]), v2 = st(r2.data[f]);
+            return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
+        };
+        this.data.sort(direction, fn);
+        if(this.snapshot && this.snapshot != this.data){
+            this.snapshot.sort(direction, fn);
+        }
+    },
+
+    /**
+     * Sets the default sort column and order to be used by the next {@link #load} operation.
+     * @param {String} fieldName The name of the field to sort by.
+     * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to <tt>'ASC'</tt>)
+     */
+    setDefaultSort : function(field, dir){
+        dir = dir ? dir.toUpperCase() : 'ASC';
+        this.sortInfo = {field: field, direction: dir};
+        this.sortToggle[field] = dir;
+    },
+
+    /**
+     * Sort the Records.
+     * If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local
+     * sorting is used, the cache is sorted internally. See also {@link #remoteSort} and {@link #paramNames}.
+     * @param {String} fieldName The name of the field to sort by.
+     * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to <tt>'ASC'</tt>)
+     */
+    sort : function(fieldName, dir){
+        var f = this.fields.get(fieldName);
+        if(!f){
+            return false;
+        }
+        if(!dir){
+            if(this.sortInfo && this.sortInfo.field == f.name){ // toggle sort dir
+                dir = (this.sortToggle[f.name] || 'ASC').toggle('ASC', 'DESC');
+            }else{
+                dir = f.sortDir;
+            }
+        }
+        var st = (this.sortToggle) ? this.sortToggle[f.name] : null;
+        var si = (this.sortInfo) ? this.sortInfo : null;
+
+        this.sortToggle[f.name] = dir;
+        this.sortInfo = {field: f.name, direction: dir};
+        if(!this.remoteSort){
+            this.applySort();
+            this.fireEvent('datachanged', this);
+        }else{
+            if (!this.load(this.lastOptions)) {
+                if (st) {
+                    this.sortToggle[f.name] = st;
+                }
+                if (si) {
+                    this.sortInfo = si;
+                }
+            }
+        }
+    },
+
+    /**
+     * Calls the specified function for each of the {@link Ext.data.Record Records} in the cache.
+     * @param {Function} fn The function to call. The {@link Ext.data.Record Record} is passed as the first parameter.
+     * Returning <tt>false</tt> aborts and exits the iteration.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed.
+     * Defaults to the current {@link Ext.data.Record Record} in the iteration.
+     */
+    each : function(fn, scope){
+        this.data.each(fn, scope);
+    },
+
+    /**
+     * Gets all {@link Ext.data.Record records} modified since the last commit.  Modified records are
+     * persisted across load operations (e.g., during paging). <b>Note</b>: deleted records are not
+     * included.  See also <tt>{@link #pruneModifiedRecords}</tt> and
+     * {@link Ext.data.Record}<tt>{@link Ext.data.Record#markDirty markDirty}.</tt>.
+     * @return {Ext.data.Record[]} An array of {@link Ext.data.Record Records} containing outstanding
+     * modifications.  To obtain modified fields within a modified record see
+     *{@link Ext.data.Record}<tt>{@link Ext.data.Record#modified modified}.</tt>.
+     */
+    getModifiedRecords : function(){
+        return this.modified;
+    },
+
+    // private
+    createFilterFn : function(property, value, anyMatch, caseSensitive){
+        if(Ext.isEmpty(value, false)){
+            return false;
+        }
+        value = this.data.createValueMatcher(value, anyMatch, caseSensitive);
+        return function(r){
+            return value.test(r.data[property]);
+        };
+    },
+
+    /**
+     * Sums the value of <tt>property</tt> for each {@link Ext.data.Record record} between <tt>start</tt>
+     * and <tt>end</tt> and returns the result.
+     * @param {String} property A field in each record
+     * @param {Number} start (optional) The record index to start at (defaults to <tt>0</tt>)
+     * @param {Number} end (optional) The last record index to include (defaults to length - 1)
+     * @return {Number} The sum
+     */
+    sum : function(property, start, end){
+        var rs = this.data.items, v = 0;
+        start = start || 0;
+        end = (end || end === 0) ? end : rs.length-1;
+
+        for(var i = start; i <= end; i++){
+            v += (rs[i].data[property] || 0);
+        }
+        return v;
+    },
+
+    /**
+     * Filter the {@link Ext.data.Record records} by a specified property.
+     * @param {String} field A field on your records
+     * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test
+     * against the field.
+     * @param {Boolean} anyMatch (optional) <tt>true</tt> to match any part not just the beginning
+     * @param {Boolean} caseSensitive (optional) <tt>true</tt> for case sensitive comparison
+     */
+    filter : function(property, value, anyMatch, caseSensitive){
+        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
+        return fn ? this.filterBy(fn) : this.clearFilter();
+    },
+
+    /**
+     * Filter by a function. The specified function will be called for each
+     * Record in this Store. If the function returns <tt>true</tt> the Record is included,
+     * otherwise it is filtered out.
+     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
+     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
+     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
+     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
+     * </ul>
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this Store.
+     */
+    filterBy : function(fn, scope){
+        this.snapshot = this.snapshot || this.data;
+        this.data = this.queryBy(fn, scope||this);
+        this.fireEvent('datachanged', this);
+    },
+
+    /**
+     * Query the records by a specified property.
+     * @param {String} field A field on your records
+     * @param {String/RegExp} value Either a string that the field
+     * should begin with, or a RegExp to test against the field.
+     * @param {Boolean} anyMatch (optional) True to match any part not just the beginning
+     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison
+     * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records
+     */
+    query : function(property, value, anyMatch, caseSensitive){
+        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
+        return fn ? this.queryBy(fn) : this.data.clone();
+    },
+
+    /**
+     * Query the cached records in this Store using a filtering function. The specified function
+     * will be called with each record in this Store. If the function returns <tt>true</tt> the record is
+     * included in the results.
+     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
+     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
+     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
+     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
+     * </ul>
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this Store.
+     * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records
+     **/
+    queryBy : function(fn, scope){
+        var data = this.snapshot || this.data;
+        return data.filterBy(fn, scope||this);
+    },
+
+    /**
+     * Finds the index of the first matching Record in this store by a specific field value.
+     * @param {String} fieldName The name of the Record field to test.
+     * @param {String/RegExp} value Either a string that the field value
+     * should begin with, or a RegExp to test against the field.
+     * @param {Number} startIndex (optional) The index to start searching at
+     * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning
+     * @param {Boolean} caseSensitive (optional) True for case sensitive comparison
+     * @return {Number} The matched index or -1
+     */
+    find : function(property, value, start, anyMatch, caseSensitive){
+        var fn = this.createFilterFn(property, value, anyMatch, caseSensitive);
+        return fn ? this.data.findIndexBy(fn, null, start) : -1;
+    },
+
+    /**
+     * Finds the index of the first matching Record in this store by a specific field value.
+     * @param {String} fieldName The name of the Record field to test.
+     * @param {Mixed} value The value to match the field against.
+     * @param {Number} startIndex (optional) The index to start searching at
+     * @return {Number} The matched index or -1
+     */
+    findExact: function(property, value, start){
+        return this.data.findIndexBy(function(rec){
+            return rec.get(property) === value;
+        }, this, start);
+    },
+
+    /**
+     * Find the index of the first matching Record in this Store by a function.
+     * If the function returns <tt>true</tt> it is considered a match.
+     * @param {Function} fn The function to be called. It will be passed the following parameters:<ul>
+     * <li><b>record</b> : Ext.data.Record<p class="sub-desc">The {@link Ext.data.Record record}
+     * to test for filtering. Access field values using {@link Ext.data.Record#get}.</p></li>
+     * <li><b>id</b> : Object<p class="sub-desc">The ID of the Record passed.</p></li>
+     * </ul>
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this Store.
+     * @param {Number} startIndex (optional) The index to start searching at
+     * @return {Number} The matched index or -1
+     */
+    findBy : function(fn, scope, start){
+        return this.data.findIndexBy(fn, scope, start);
+    },
+
+    /**
+     * Collects unique values for a particular dataIndex from this store.
+     * @param {String} dataIndex The property to collect
+     * @param {Boolean} allowNull (optional) Pass true to allow null, undefined or empty string values
+     * @param {Boolean} bypassFilter (optional) Pass true to collect from all records, even ones which are filtered
+     * @return {Array} An array of the unique values
+     **/
+    collect : function(dataIndex, allowNull, bypassFilter){
+        var d = (bypassFilter === true && this.snapshot) ?
+                this.snapshot.items : this.data.items;
+        var v, sv, r = [], l = {};
+        for(var i = 0, len = d.length; i < len; i++){
+            v = d[i].data[dataIndex];
+            sv = String(v);
+            if((allowNull || !Ext.isEmpty(v)) && !l[sv]){
+                l[sv] = true;
+                r[r.length] = v;
+            }
+        }
+        return r;
+    },
+
+    /**
+     * Revert to a view of the Record cache with no filtering applied.
+     * @param {Boolean} suppressEvent If <tt>true</tt> the filter is cleared silently without firing the
+     * {@link #datachanged} event.
+     */
+    clearFilter : function(suppressEvent){
+        if(this.isFiltered()){
+            this.data = this.snapshot;
+            delete this.snapshot;
+            if(suppressEvent !== true){
+                this.fireEvent('datachanged', this);
+            }
+        }
+    },
+
+    /**
+     * Returns true if this store is currently filtered
+     * @return {Boolean}
+     */
+    isFiltered : function(){
+        return this.snapshot && this.snapshot != this.data;
+    },
+
+    // private
+    afterEdit : function(record){
+        if(this.modified.indexOf(record) == -1){
+            this.modified.push(record);
+        }
+        this.fireEvent('update', this, record, Ext.data.Record.EDIT);
+    },
+
+    // private
+    afterReject : function(record){
+        this.modified.remove(record);
+        this.fireEvent('update', this, record, Ext.data.Record.REJECT);
+    },
+
+    // private
+    afterCommit : function(record){
+        this.modified.remove(record);
+        this.fireEvent('update', this, record, Ext.data.Record.COMMIT);
+    },
+
+    /**
+     * Commit all Records with {@link #getModifiedRecords outstanding changes}. To handle updates for changes,
+     * subscribe to the Store's {@link #update update event}, and perform updating when the third parameter is
+     * Ext.data.Record.COMMIT.
+     */
+    commitChanges : function(){
+        var m = this.modified.slice(0);
+        this.modified = [];
+        for(var i = 0, len = m.length; i < len; i++){
+            m[i].commit();
+        }
+    },
+
+    /**
+     * {@link Ext.data.Record#reject Reject} outstanding changes on all {@link #getModifiedRecords modified records}.
+     */
+    rejectChanges : function(){
+        var m = this.modified.slice(0);
+        this.modified = [];
+        for(var i = 0, len = m.length; i < len; i++){
+            m[i].reject();
+        }
+        var m = this.removed.slice(0).reverse();
+        this.removed = [];
+        for(var i = 0, len = m.length; i < len; i++){
+            this.insert(m[i].lastIndex||0, m[i]);
+            m[i].reject();
+        }
+    },
+
+    // private
+    onMetaChange : function(meta){
+        this.recordType = this.reader.recordType;
+        this.fields = this.recordType.prototype.fields;
+        delete this.snapshot;
+        if(this.reader.meta.sortInfo){
+            this.sortInfo = this.reader.meta.sortInfo;
+        }else if(this.sortInfo  && !this.fields.get(this.sortInfo.field)){
+            delete this.sortInfo;
+        }
+        if(this.writer){
+            this.writer.meta = this.reader.meta;
+        }
+        this.modified = [];
+        this.fireEvent('metachange', this, this.reader.meta);
+    },
+
+    // private
+    findInsertIndex : function(record){
+        this.suspendEvents();
+        var data = this.data.clone();
+        this.data.add(record);
+        this.applySort();
+        var index = this.data.indexOf(record);
+        this.data = data;
+        this.resumeEvents();
+        return index;
+    },
+
+    /**
+     * Set the value for a property name in this store's {@link #baseParams}.  Usage:</p><pre><code>
+myStore.setBaseParam('foo', {bar:3});
+</code></pre>
+     * @param {String} name Name of the property to assign
+     * @param {Mixed} value Value to assign the <tt>name</tt>d property
+     **/
+    setBaseParam : function (name, value){
+        this.baseParams = this.baseParams || {};
+        this.baseParams[name] = value;
+    }
+});
+
+Ext.reg('store', Ext.data.Store);
+
+/**
+ * @class Ext.data.Store.Error
+ * @extends Ext.Error
+ * Store Error extension.
+ * @param {String} name
+ */
+Ext.data.Store.Error = Ext.extend(Ext.Error, {
+    name: 'Ext.data.Store'
+});
+Ext.apply(Ext.data.Store.Error.prototype, {
+    lang: {
+        'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.'
+    }
+});
+/**
+ * @class Ext.data.Field
+ * <p>This class encapsulates the field definition information specified in the field definition objects
+ * passed to {@link Ext.data.Record#create}.</p>
+ * <p>Developers do not need to instantiate this class. Instances are created by {@link Ext.data.Record.create}
+ * and cached in the {@link Ext.data.Record#fields fields} property of the created Record constructor's <b>prototype.</b></p>
+ */
+Ext.data.Field = function(config){
+    if(typeof config == "string"){
+        config = {name: config};
+    }
+    Ext.apply(this, config);
+
+    if(!this.type){
+        this.type = "auto";
+    }
+
+    var st = Ext.data.SortTypes;
+    // named sortTypes are supported, here we look them up
+    if(typeof this.sortType == "string"){
+        this.sortType = st[this.sortType];
+    }
+
+    // set default sortType for strings and dates
+    if(!this.sortType){
+        switch(this.type){
+            case "string":
+                this.sortType = st.asUCString;
+                break;
+            case "date":
+                this.sortType = st.asDate;
+                break;
+            default:
+                this.sortType = st.none;
+        }
+    }
+
+    // define once
+    var stripRe = /[\$,%]/g;
+
+    // prebuilt conversion function for this field, instead of
+    // switching every time we're reading a value
+    if(!this.convert){
+        var cv, dateFormat = this.dateFormat;
+        switch(this.type){
+            case "":
+            case "auto":
+            case undefined:
+                cv = function(v){ return v; };
+                break;
+            case "string":
+                cv = function(v){ return (v === undefined || v === null) ? '' : String(v); };
+                break;
+            case "int":
+                cv = function(v){
+                    return v !== undefined && v !== null && v !== '' ?
+                        parseInt(String(v).replace(stripRe, ""), 10) : '';
+                    };
+                break;
+            case "float":
+                cv = function(v){
+                    return v !== undefined && v !== null && v !== '' ?
+                        parseFloat(String(v).replace(stripRe, ""), 10) : '';
+                    };
+                break;
+            case "bool":
+                cv = function(v){ return v === true || v === "true" || v == 1; };
+                break;
+            case "date":
+                cv = function(v){
+                    if(!v){
+                        return '';
+                    }
+                    if(Ext.isDate(v)){
+                        return v;
+                    }
+                    if(dateFormat){
+                        if(dateFormat == "timestamp"){
+                            return new Date(v*1000);
+                        }
+                        if(dateFormat == "time"){
+                            return new Date(parseInt(v, 10));
+                        }
+                        return Date.parseDate(v, dateFormat);
+                    }
+                    var parsed = Date.parse(v);
+                    return parsed ? new Date(parsed) : null;
+                };
+                break;
+            default:
+                cv = function(v){ return v; };
+                break;
+
+        }
+        this.convert = cv;
+    }
+};
+
+Ext.data.Field.prototype = {
+    /**
+     * @cfg {String} name
+     * The name by which the field is referenced within the Record. This is referenced by, for example,
+     * the <tt>dataIndex</tt> property in column definition objects passed to {@link Ext.grid.ColumnModel}.
+     * <p>Note: In the simplest case, if no properties other than <tt>name</tt> are required, a field
+     * definition may consist of just a String for the field name.</p>
+     */
+    /**
+     * @cfg {String} type
+     * (Optional) The data type for conversion to displayable value if <tt>{@link Ext.data.Field#convert convert}</tt>
+     * has not been specified. Possible values are
+     * <div class="mdetail-params"><ul>
+     * <li>auto (Default, implies no conversion)</li>
+     * <li>string</li>
+     * <li>int</li>
+     * <li>float</li>
+     * <li>boolean</li>
+     * <li>date</li></ul></div>
+     */
+    /**
+     * @cfg {Function} convert
+     * (Optional) A function which converts the value provided by the Reader into an object that will be stored
+     * in the Record. It is passed the following parameters:<div class="mdetail-params"><ul>
+     * <li><b>v</b> : Mixed<div class="sub-desc">The data value as read by the Reader, if undefined will use
+     * the configured <tt>{@link Ext.data.Field#defaultValue defaultValue}</tt>.</div></li>
+     * <li><b>rec</b> : Mixed<div class="sub-desc">The data object containing the row as read by the Reader.
+     * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object
+     *  ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).</div></li>
+     * </ul></div>
+     * <pre><code>
+// example of convert function
+function fullName(v, record){
+    return record.name.last + ', ' + record.name.first;
+}
+
+function location(v, record){
+    return !record.city ? '' : (record.city + ', ' + record.state);
+}
+
+var Dude = Ext.data.Record.create([
+    {name: 'fullname',  convert: fullName},
+    {name: 'firstname', mapping: 'name.first'},
+    {name: 'lastname',  mapping: 'name.last'},
+    {name: 'city', defaultValue: 'homeless'},
+    'state',
+    {name: 'location',  convert: location}
+]);
+
+// create the data store
+var store = new Ext.data.Store({
+    reader: new Ext.data.JsonReader(
+        {
+            idProperty: 'key',
+            root: 'daRoot',
+            totalProperty: 'total'
+        },
+        Dude  // recordType
+    )
+});
+
+var myData = [
+    { key: 1,
+      name: { first: 'Fat',    last:  'Albert' }
+      // notice no city, state provided in data object
+    },
+    { key: 2,
+      name: { first: 'Barney', last:  'Rubble' },
+      city: 'Bedrock', state: 'Stoneridge'
+    },
+    { key: 3,
+      name: { first: 'Cliff',  last:  'Claven' },
+      city: 'Boston',  state: 'MA'
+    }
+];
+     * </code></pre>
+     */
+    /**
+     * @cfg {String} dateFormat
+     * (Optional) A format string for the {@link Date#parseDate Date.parseDate} function, or "timestamp" if the
+     * value provided by the Reader is a UNIX timestamp, or "time" if the value provided by the Reader is a
+     * javascript millisecond timestamp.
+     */
+    dateFormat: null,
+    /**
+     * @cfg {Mixed} defaultValue
+     * (Optional) The default value used <b>when a Record is being created by a {@link Ext.data.Reader Reader}</b>
+     * when the item referenced by the <tt>{@link Ext.data.Field#mapping mapping}</tt> does not exist in the data
+     * object (i.e. undefined). (defaults to "")
+     */
+    defaultValue: "",
+    /**
+     * @cfg {String/Number} mapping
+     * <p>(Optional) A path expression for use by the {@link Ext.data.DataReader} implementation
+     * that is creating the {@link Ext.data.Record Record} to extract the Field value from the data object.
+     * If the path expression is the same as the field name, the mapping may be omitted.</p>
+     * <p>The form of the mapping expression depends on the Reader being used.</p>
+     * <div class="mdetail-params"><ul>
+     * <li>{@link Ext.data.JsonReader}<div class="sub-desc">The mapping is a string containing the javascript
+     * expression to reference the data from an element of the data item's {@link Ext.data.JsonReader#root root} Array. Defaults to the field name.</div></li>
+     * <li>{@link Ext.data.XmlReader}<div class="sub-desc">The mapping is an {@link Ext.DomQuery} path to the data
+     * item relative to the DOM element that represents the {@link Ext.data.XmlReader#record record}. Defaults to the field name.</div></li>
+     * <li>{@link Ext.data.ArrayReader}<div class="sub-desc">The mapping is a number indicating the Array index
+     * of the field's value. Defaults to the field specification's Array position.</div></li>
+     * </ul></div>
+     * <p>If a more complex value extraction strategy is required, then configure the Field with a {@link #convert}
+     * function. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to
+     * return the desired data.</p>
+     */
+    mapping: null,
+    /**
+     * @cfg {Function} sortType
+     * (Optional) A function which converts a Field's value to a comparable value in order to ensure
+     * correct sort ordering. Predefined functions are provided in {@link Ext.data.SortTypes}. A custom
+     * sort example:<pre><code>
+// current sort     after sort we want
+// +-+------+          +-+------+
+// |1|First |          |1|First |
+// |2|Last  |          |3|Second|
+// |3|Second|          |2|Last  |
+// +-+------+          +-+------+
+
+sortType: function(value) {
+   switch (value.toLowerCase()) // native toLowerCase():
+   {
+      case 'first': return 1;
+      case 'second': return 2;
+      default: return 3;
+   }
+}
+     * </code></pre>
+     */
+    sortType : null,
+    /**
+     * @cfg {String} sortDir
+     * (Optional) Initial direction to sort (<tt>"ASC"</tt> or  <tt>"DESC"</tt>).  Defaults to
+     * <tt>"ASC"</tt>.
+     */
+    sortDir : "ASC",
+    /**
+     * @cfg {Boolean} allowBlank
+     * (Optional) Used for validating a {@link Ext.data.Record record}, defaults to <tt>true</tt>.
+     * An empty value here will cause {@link Ext.data.Record}.{@link Ext.data.Record#isValid isValid}
+     * to evaluate to <tt>false</tt>.
+     */
+    allowBlank : true
+};/**\r
+ * @class Ext.data.DataReader\r
+ * Abstract base class for reading structured data from a data source and converting\r
+ * it into an object containing {@link Ext.data.Record} objects and metadata for use\r
+ * by an {@link Ext.data.Store}.  This class is intended to be extended and should not\r
+ * be created directly. For existing implementations, see {@link Ext.data.ArrayReader},\r
+ * {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}.\r
+ * @constructor Create a new DataReader\r
+ * @param {Object} meta Metadata configuration options (implementation-specific).\r
+ * @param {Array/Object} recordType\r
+ * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which\r
+ * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}\r
+ * constructor created using {@link Ext.data.Record#create}.</p>\r
  */\r
-Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, {\r
+Ext.data.DataReader = function(meta, recordType){\r
     /**\r
-     * @cfg {Number} priority\r
-     * Priority of the request (defaults to <tt>3</tt>). See {@link Ext.direct.Provider#priority}.\r
+     * This DataReader's configured metadata as passed to the constructor.\r
+     * @type Mixed\r
+     * @property meta\r
      */\r
-    // override default priority\r
-    priority: 3,\r
-    \r
+    this.meta = meta;\r
     /**\r
-     * @cfg {Number} interval\r
-     * How often to poll the server-side in milliseconds (defaults to <tt>3000</tt> - every\r
-     * 3 seconds).\r
+     * @cfg {Array/Object} fields\r
+     * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which\r
+     * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}\r
+     * constructor created from {@link Ext.data.Record#create}.</p>\r
      */\r
-    interval: 3000,\r
+    this.recordType = Ext.isArray(recordType) ?\r
+        Ext.data.Record.create(recordType) : recordType;\r
+
+    // if recordType defined make sure extraction functions are defined\r
+    if (this.recordType){\r
+        this.buildExtractors();\r
+    }
+};\r
 \r
+Ext.data.DataReader.prototype = {\r
     /**\r
-     * @cfg {Object} baseParams An object containing properties which are to be sent as parameters\r
-     * on every polling request\r
+     * @cfg {String} messageProperty [undefined] Optional name of a property within a server-response that represents a user-feedback message.\r
      */\r
-    \r
     /**\r
-     * @cfg {String/Function} url\r
-     * The url which the PollingProvider should contact with each request. This can also be\r
-     * an imported Ext.Direct method which will accept the baseParams as its only argument.\r
+     * Abstract method created in extension's buildExtractors impl.\r
      */\r
-\r
-    // private\r
-    constructor : function(config){\r
-        Ext.direct.PollingProvider.superclass.constructor.call(this, config);\r
-        this.addEvents(\r
-            /**\r
-             * @event beforepoll\r
-             * Fired immediately before a poll takes place, an event handler can return false\r
-             * in order to cancel the poll.\r
-             * @param {Ext.direct.PollingProvider}\r
-             */\r
-            'beforepoll',            \r
-            /**\r
-             * @event poll\r
-             * This event has not yet been implemented.\r
-             * @param {Ext.direct.PollingProvider}\r
-             */\r
-            'poll'\r
-        );\r
-    },\r
-\r
-    // inherited\r
-    isConnected: function(){\r
-        return !!this.pollTask;\r
-    },\r
-\r
+    getTotal: Ext.emptyFn,\r
     /**\r
-     * Connect to the server-side and begin the polling process. To handle each\r
-     * response subscribe to the data event.\r
+     * Abstract method created in extension's buildExtractors impl.\r
      */\r
-    connect: function(){\r
-        if(this.url && !this.pollTask){\r
-            this.pollTask = Ext.TaskMgr.start({\r
-                run: function(){\r
-                    if(this.fireEvent('beforepoll', this) !== false){\r
-                        if(typeof this.url == 'function'){\r
-                            this.url(this.baseParams);\r
-                        }else{\r
-                            Ext.Ajax.request({\r
-                                url: this.url,\r
-                                callback: this.onData,\r
-                                scope: this,\r
-                                params: this.baseParams\r
-                            });\r
-                        }\r
-                    }\r
-                },\r
-                interval: this.interval,\r
-                scope: this\r
-            });\r
-            this.fireEvent('connect', this);\r
-        }else if(!this.url){\r
-            throw 'Error initializing PollingProvider, no url configured.';\r
-        }\r
-    },\r
-\r
+    getRoot: Ext.emptyFn,\r
     /**\r
-     * Disconnect from the server-side and stop the polling process. The disconnect\r
-     * event will be fired on a successful disconnect.\r
+     * Abstract method created in extension's buildExtractors impl.\r
      */\r
-    disconnect: function(){\r
-        if(this.pollTask){\r
-            Ext.TaskMgr.stop(this.pollTask);\r
-            delete this.pollTask;\r
-            this.fireEvent('disconnect', this);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onData: function(opt, success, xhr){\r
-        if(success){\r
-            var events = this.getEvents(xhr);\r
-            for(var i = 0, len = events.length; i < len; i++){\r
-                var e = events[i];\r
-                this.fireEvent('data', this, e);\r
-            }\r
-        }else{\r
-            var e = new Ext.Direct.ExceptionEvent({\r
-                data: e,\r
-                code: Ext.Direct.exceptions.TRANSPORT,\r
-                message: 'Unable to connect to the server.',\r
-                xhr: xhr\r
-            });\r
-            this.fireEvent('data', this, e);\r
-        }\r
-    }\r
-});\r
-\r
-Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider;/**\r
- * @class Ext.direct.RemotingProvider\r
- * @extends Ext.direct.JsonProvider\r
- * \r
- * <p>The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to\r
- * server side methods on the client (a remote procedure call (RPC) type of\r
- * connection where the client can initiate a procedure on the server).</p>\r
- * \r
- * <p>This allows for code to be organized in a fashion that is maintainable,\r
- * while providing a clear path between client and server, something that is\r
- * not always apparent when using URLs.</p>\r
- * \r
- * <p>To accomplish this the server-side needs to describe what classes and methods\r
- * are available on the client-side. This configuration will typically be\r
- * outputted by the server-side Ext.Direct stack when the API description is built.</p>\r
- */\r
-Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, {       \r
+    getMessage: Ext.emptyFn,\r
     /**\r
-     * @cfg {Object} actions\r
-     * Object literal defining the server side actions and methods. For example, if\r
-     * the Provider is configured with:\r
-     * <pre><code>\r
-"actions":{ // each property within the 'actions' object represents a server side Class \r
-    "TestAction":[ // array of methods within each server side Class to be   \r
-    {              // stubbed out on client\r
-        "name":"doEcho", \r
-        "len":1            \r
-    },{\r
-        "name":"multiply",// name of method\r
-        "len":2           // The number of parameters that will be used to create an\r
-                          // array of data to send to the server side function.\r
-                          // Ensure the server sends back a Number, not a String. \r
-    },{\r
-        "name":"doForm",\r
-        "formHandler":true, // direct the client to use specialized form handling method \r
-        "len":1\r
-    }]\r
-}\r
-     * </code></pre>\r
-     * <p>Note that a Store is not required, a server method can be called at any time.\r
-     * In the following example a <b>client side</b> handler is used to call the\r
-     * server side method "multiply" in the server-side "TestAction" Class:</p>\r
-     * <pre><code>\r
-TestAction.multiply(\r
-    2, 4, // pass two arguments to server, so specify len=2\r
-    // callback function after the server is called\r
-    // result: the result returned by the server\r
-    //      e: Ext.Direct.RemotingEvent object\r
-    function(result, e){\r
-        var t = e.getTransaction();\r
-        var action = t.action; // server side Class called\r
-        var method = t.method; // server side method called\r
-        if(e.status){\r
-            var answer = Ext.encode(result); // 8\r
-    \r
-        }else{\r
-            var msg = e.message; // failure message\r
-        }\r
-    }\r
-);\r
-     * </code></pre>\r
-     * In the example above, the server side "multiply" function will be passed two\r
-     * arguments (2 and 4).  The "multiply" method should return the value 8 which will be\r
-     * available as the <tt>result</tt> in the example above. \r
+     * Abstract method created in extension's buildExtractors impl.\r
      */\r
-    \r
+    getSuccess: Ext.emptyFn,\r
     /**\r
-     * @cfg {String/Object} namespace\r
-     * Namespace for the Remoting Provider (defaults to the browser global scope of <i>window</i>).\r
-     * Explicitly specify the namespace Object, or specify a String to have a\r
-     * {@link Ext#namespace namespace created} implicitly.\r
+     * Abstract method created in extension's buildExtractors impl.\r
      */\r
-    \r
+    getId: Ext.emptyFn,\r
     /**\r
-     * @cfg {String} url\r
-     * <b>Required<b>. The url to connect to the {@link Ext.Direct} server-side router. \r
+     * Abstract method, overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}\r
      */\r
-    \r
+    buildExtractors : Ext.emptyFn,\r
     /**\r
-     * @cfg {String} enableUrlEncode\r
-     * Specify which param will hold the arguments for the method.\r
-     * Defaults to <tt>'data'</tt>.\r
+     * Abstract method overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}\r
      */\r
-    \r
+    extractData : Ext.emptyFn,\r
     /**\r
-     * @cfg {Number/Boolean} enableBuffer\r
-     * <p><tt>true</tt> or <tt>false</tt> to enable or disable combining of method\r
-     * calls. If a number is specified this is the amount of time in milliseconds\r
-     * to wait before sending a batched request (defaults to <tt>10</tt>).</p>\r
-     * <br><p>Calls which are received within the specified timeframe will be\r
-     * concatenated together and sent in a single request, optimizing the\r
-     * application by reducing the amount of round trips that have to be made\r
-     * to the server.</p>\r
+     * Abstract method overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}\r
      */\r
-    enableBuffer: 10,\r
-    \r
+    extractValues : Ext.emptyFn,\r
+\r
     /**\r
-     * @cfg {Number} maxRetries\r
-     * Number of times to re-attempt delivery on failure of a call.\r
+     * Used for un-phantoming a record after a successful database insert.  Sets the records pk along with new data from server.\r
+     * You <b>must</b> return at least the database pk using the idProperty defined in your DataReader configuration.  The incoming\r
+     * data from server will be merged with the data in the local record.\r
+     * In addition, you <b>must</b> return record-data from the server in the same order received.\r
+     * Will perform a commit as well, un-marking dirty-fields.  Store's "update" event will be suppressed.\r
+     * @param {Record/Record[]} record The phantom record to be realized.\r
+     * @param {Object/Object[]} data The new record data to apply.  Must include the primary-key from database defined in idProperty field.\r
      */\r
-    maxRetries: 1,\r
-\r
-    constructor : function(config){\r
-        Ext.direct.RemotingProvider.superclass.constructor.call(this, config);\r
-        this.addEvents(\r
-            /**\r
-             * @event beforecall\r
-             * Fires immediately before the client-side sends off the RPC call.\r
-             * By returning false from an event handler you can prevent the call from\r
-             * executing.\r
-             * @param {Ext.direct.RemotingProvider} provider\r
-             * @param {Ext.Direct.Transaction} transaction\r
-             */            \r
-            'beforecall',\r
-            /**\r
-             * @event call\r
-             * Fires immediately after the request to the server-side is sent. This does\r
-             * NOT fire after the response has come back from the call.\r
-             * @param {Ext.direct.RemotingProvider} provider\r
-             * @param {Ext.Direct.Transaction} transaction\r
-             */            \r
-            'call'\r
-        );\r
-        this.namespace = (typeof this.namespace === 'string') ? Ext.ns(this.namespace) : this.namespace || window;\r
-        this.transactions = {};\r
-        this.callBuffer = [];\r
-    },\r
-\r
-    // private\r
-    initAPI : function(){\r
-        var o = this.actions;\r
-        for(var c in o){\r
-            var cls = this.namespace[c] || (this.namespace[c] = {});\r
-            var ms = o[c];\r
-            for(var i = 0, len = ms.length; i < len; i++){\r
-                var m = ms[i];\r
-                cls[m.name] = this.createMethod(c, m);\r
-            }\r
-        }\r
-    },\r
-\r
-    // inherited\r
-    isConnected: function(){\r
-        return !!this.connected;\r
-    },\r
-\r
-    connect: function(){\r
-        if(this.url){\r
-            this.initAPI();\r
-            this.connected = true;\r
-            this.fireEvent('connect', this);\r
-        }else if(!this.url){\r
-            throw 'Error initializing RemotingProvider, no url configured.';\r
-        }\r
-    },\r
-\r
-    disconnect: function(){\r
-        if(this.connected){\r
-            this.connected = false;\r
-            this.fireEvent('disconnect', this);\r
-        }\r
-    },\r
-\r
-    onData: function(opt, success, xhr){\r
-        if(success){\r
-            var events = this.getEvents(xhr);\r
-            for(var i = 0, len = events.length; i < len; i++){\r
-                var e = events[i];\r
-                var t = this.getTransaction(e);\r
-                this.fireEvent('data', this, e);\r
-                if(t){\r
-                    this.doCallback(t, e, true);\r
-                    Ext.Direct.removeTransaction(t);\r
+    realize: function(rs, data){\r
+        if (Ext.isArray(rs)) {\r
+            for (var i = rs.length - 1; i >= 0; i--) {\r
+                // recurse\r
+                if (Ext.isArray(data)) {\r
+                    this.realize(rs.splice(i,1).shift(), data.splice(i,1).shift());\r
                 }\r
-            }\r
-        }else{\r
-            var ts = [].concat(opt.ts);\r
-            for(var i = 0, len = ts.length; i < len; i++){\r
-                var t = this.getTransaction(ts[i]);\r
-                if(t && t.retryCount < this.maxRetries){\r
-                    t.retry();\r
-                }else{\r
-                    var e = new Ext.Direct.ExceptionEvent({\r
-                        data: e,\r
-                        transaction: t,\r
-                        code: Ext.Direct.exceptions.TRANSPORT,\r
-                        message: 'Unable to connect to the server.',\r
-                        xhr: xhr\r
-                    });\r
-                    this.fireEvent('data', this, e);\r
-                    if(t){\r
-                        this.doCallback(t, e, false);\r
-                        Ext.Direct.removeTransaction(t);\r
-                    }\r
+                else {\r
+                    // weird...rs is an array but data isn't??  recurse but just send in the whole invalid data object.\r
+                    // the else clause below will detect !this.isData and throw exception.\r
+                    this.realize(rs.splice(i,1).shift(), data);\r
                 }\r
             }\r
         }\r
-    },\r
-\r
-    getCallData: function(t){\r
-        return {\r
-            action: t.action,\r
-            method: t.method,\r
-            data: t.data,\r
-            type: 'rpc',\r
-            tid: t.tid\r
-        };\r
-    },\r
-\r
-    doSend : function(data){\r
-        var o = {\r
-            url: this.url,\r
-            callback: this.onData,\r
-            scope: this,\r
-            ts: data\r
-        };\r
-\r
-        // send only needed data\r
-        var callData;\r
-        if(Ext.isArray(data)){\r
-            callData = [];\r
-            for(var i = 0, len = data.length; i < len; i++){\r
-                callData.push(this.getCallData(data[i]));\r
+        else {\r
+            // If rs is NOT an array but data IS, see if data contains just 1 record.  If so extract it and carry on.\r
+            if (Ext.isArray(data) && data.length == 1) {\r
+                data = data.shift();\r
             }\r
-        }else{\r
-            callData = this.getCallData(data);\r
-        }\r
-\r
-        if(this.enableUrlEncode){\r
-            var params = {};\r
-            params[typeof this.enableUrlEncode == 'string' ? this.enableUrlEncode : 'data'] = Ext.encode(callData);\r
-            o.params = params;\r
-        }else{\r
-            o.jsonData = callData;\r
-        }\r
-        Ext.Ajax.request(o);\r
-    },\r
-\r
-    combineAndSend : function(){\r
-        var len = this.callBuffer.length;\r
-        if(len > 0){\r
-            this.doSend(len == 1 ? this.callBuffer[0] : this.callBuffer);\r
-            this.callBuffer = [];\r
-        }\r
-    },\r
-\r
-    queueTransaction: function(t){\r
-        if(t.form){\r
-            this.processForm(t);\r
-            return;\r
-        }\r
-        this.callBuffer.push(t);\r
-        if(this.enableBuffer){\r
-            if(!this.callTask){\r
-                this.callTask = new Ext.util.DelayedTask(this.combineAndSend, this);\r
+            if (!this.isData(data)) {\r
+                // TODO: Let exception-handler choose to commit or not rather than blindly rs.commit() here.\r
+                //rs.commit();\r
+                throw new Ext.data.DataReader.Error('realize', rs);\r
             }\r
-            this.callTask.delay(typeof this.enableBuffer == 'number' ? this.enableBuffer : 10);\r
-        }else{\r
-            this.combineAndSend();\r
+            rs.phantom = false; // <-- That's what it's all about\r
+            rs._phid = rs.id;  // <-- copy phantom-id -> _phid, so we can remap in Store#onCreateRecords\r
+            rs.id = this.getId(data);\r
+\r
+            rs.fields.each(function(f) {\r
+                if (data[f.name] !== f.defaultValue) {\r
+                    rs.data[f.name] = data[f.name];\r
+                }\r
+            });\r
+            rs.commit();\r
         }\r
     },\r
 \r
-    doCall : function(c, m, args){\r
-        var data = null, hs = args[m.len], scope = args[m.len+1];\r
-\r
-        if(m.len !== 0){\r
-            data = args.slice(0, m.len);\r
+    /**\r
+     * Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save.\r
+     * If returning data from multiple-records after a batch-update, you <b>must</b> return record-data from the server in\r
+     * the same order received.  Will perform a commit as well, un-marking dirty-fields.  Store's "update" event will be\r
+     * suppressed as the record receives fresh new data-hash\r
+     * @param {Record/Record[]} rs\r
+     * @param {Object/Object[]} data\r
+     */\r
+    update : function(rs, data) {\r
+        if (Ext.isArray(rs)) {\r
+            for (var i=rs.length-1; i >= 0; i--) {\r
+                if (Ext.isArray(data)) {\r
+                    this.update(rs.splice(i,1).shift(), data.splice(i,1).shift());\r
+                }\r
+                else {\r
+                    // weird...rs is an array but data isn't??  recurse but just send in the whole data object.\r
+                    // the else clause below will detect !this.isData and throw exception.\r
+                    this.update(rs.splice(i,1).shift(), data);\r
+                }\r
+            }\r
         }\r
-\r
-        var t = new Ext.Direct.Transaction({\r
-            provider: this,\r
-            args: args,\r
-            action: c,\r
-            method: m.name,\r
-            data: data,\r
-            cb: scope && Ext.isFunction(hs) ? hs.createDelegate(scope) : hs\r
-        });\r
-\r
-        if(this.fireEvent('beforecall', this, t) !== false){\r
-            Ext.Direct.addTransaction(t);\r
-            this.queueTransaction(t);\r
-            this.fireEvent('call', this, t);\r
+        else {\r
+            // If rs is NOT an array but data IS, see if data contains just 1 record.  If so extract it and carry on.\r
+            if (Ext.isArray(data) && data.length == 1) {\r
+                data = data.shift();\r
+            }\r
+            if (this.isData(data)) {\r
+                rs.fields.each(function(f) {\r
+                    if (data[f.name] !== f.defaultValue) {\r
+                        rs.data[f.name] = data[f.name];\r
+                    }\r
+                });\r
+            }\r
+            rs.commit();\r
         }\r
     },\r
 \r
-    doForm : function(c, m, form, callback, scope){\r
-        var t = new Ext.Direct.Transaction({\r
-            provider: this,\r
-            action: c,\r
-            method: m.name,\r
-            args:[form, callback, scope],\r
-            cb: scope && Ext.isFunction(callback) ? callback.createDelegate(scope) : callback,\r
-            isForm: true\r
-        });\r
-\r
-        if(this.fireEvent('beforecall', this, t) !== false){\r
-            Ext.Direct.addTransaction(t);\r
-            var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',\r
-                params = {\r
-                    extTID: t.tid,\r
-                    extAction: c,\r
-                    extMethod: m.name,\r
-                    extType: 'rpc',\r
-                    extUpload: String(isUpload)\r
-                };\r
-            \r
-            // change made from typeof callback check to callback.params\r
-            // to support addl param passing in DirectSubmit EAC 6/2\r
-            Ext.apply(t, {\r
-                form: Ext.getDom(form),\r
-                isUpload: isUpload,\r
-                params: callback && Ext.isObject(callback.params) ? Ext.apply(params, callback.params) : params\r
-            });\r
-            this.fireEvent('call', this, t);\r
-            this.processForm(t);\r
+    /**\r
+     * returns extracted, type-cast rows of data.  Iterates to call #extractValues for each row\r
+     * @param {Object[]/Object} data-root from server response\r
+     * @param {Boolean} returnRecords [false] Set true to return instances of Ext.data.Record\r
+     * @private\r
+     */\r
+    extractData : function(root, returnRecords) {\r
+        // A bit ugly this, too bad the Record's raw data couldn't be saved in a common property named "raw" or something.\r
+        var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node';\r
+\r
+        var rs = [];\r
+\r
+        // Had to add Check for XmlReader, #isData returns true if root is an Xml-object.  Want to check in order to re-factor\r
+        // #extractData into DataReader base, since the implementations are almost identical for JsonReader, XmlReader\r
+        if (this.isData(root) && !(this instanceof Ext.data.XmlReader)) {\r
+            root = [root];\r
+        }\r
+        var f       = this.recordType.prototype.fields,\r
+            fi      = f.items,\r
+            fl      = f.length,\r
+            rs      = [];\r
+        if (returnRecords === true) {\r
+            var Record = this.recordType;\r
+            for (var i = 0; i < root.length; i++) {\r
+                var n = root[i];\r
+                var record = new Record(this.extractValues(n, fi, fl), this.getId(n));\r
+                record[rawName] = n;    // <-- There's implementation of ugly bit, setting the raw record-data.\r
+                rs.push(record);\r
+            }\r
         }\r
-    },\r
-    \r
-    processForm: function(t){\r
-        Ext.Ajax.request({\r
-            url: this.url,\r
-            params: t.params,\r
-            callback: this.onData,\r
-            scope: this,\r
-            form: t.form,\r
-            isUpload: t.isUpload,\r
-            ts: t\r
-        });\r
-    },\r
-\r
-    createMethod : function(c, m){\r
-        var f;\r
-        if(!m.formHandler){\r
-            f = function(){\r
-                this.doCall(c, m, Array.prototype.slice.call(arguments, 0));\r
-            }.createDelegate(this);\r
-        }else{\r
-            f = function(form, callback, scope){\r
-                this.doForm(c, m, form, callback, scope);\r
-            }.createDelegate(this);\r
+        else {\r
+            for (var i = 0; i < root.length; i++) {\r
+                var data = this.extractValues(root[i], fi, fl);\r
+                data[this.meta.idProperty] = this.getId(root[i]);\r
+                rs.push(data);\r
+            }\r
         }\r
-        f.directCfg = {\r
-            action: c,\r
-            method: m\r
-        };\r
-        return f;\r
+        return rs;\r
     },\r
 \r
-    getTransaction: function(opt){\r
-        return opt && opt.tid ? Ext.Direct.getTransaction(opt.tid) : null;\r
+    /**\r
+     * Returns true if the supplied data-hash <b>looks</b> and quacks like data.  Checks to see if it has a key\r
+     * corresponding to idProperty defined in your DataReader config containing non-empty pk.\r
+     * @param {Object} data\r
+     * @return {Boolean}\r
+     */\r
+    isData : function(data) {\r
+        return (data && Ext.isObject(data) && !Ext.isEmpty(this.getId(data))) ? true : false;\r
     },\r
 \r
-    doCallback: function(t, e){\r
-        var fn = e.status ? 'success' : 'failure';\r
-        if(t && t.cb){\r
-            var hs = t.cb;\r
-            var result = e.result || e.data;\r
-            if(Ext.isFunction(hs)){\r
-                hs(result, e);\r
-            } else{\r
-                Ext.callback(hs[fn], hs.scope, [result, e]);\r
-                Ext.callback(hs.callback, hs.scope, [result, e]);\r
-            }\r
-        }\r
+    // private function a store will createSequence upon\r
+    onMetaChange : function(meta){\r
+        delete this.ef;\r
+        this.meta = meta;\r
+        this.recordType = Ext.data.Record.create(meta.fields);\r
+        this.buildExtractors();\r
+    }\r
+};\r
+\r
+/**\r
+ * @class Ext.data.DataReader.Error\r
+ * @extends Ext.Error\r
+ * General error class for Ext.data.DataReader\r
+ */\r
+Ext.data.DataReader.Error = Ext.extend(Ext.Error, {\r
+    constructor : function(message, arg) {\r
+        this.arg = arg;\r
+        Ext.Error.call(this, message);\r
+    },\r
+    name: 'Ext.data.DataReader'\r
+});\r
+Ext.apply(Ext.data.DataReader.Error.prototype, {\r
+    lang : {\r
+        'update': "#update received invalid data from server.  Please see docs for DataReader#update and review your DataReader configuration.",\r
+        'realize': "#realize was called with invalid remote-data.  Please see the docs for DataReader#realize and review your DataReader configuration.",\r
+        'invalid-response': "#readResponse received an invalid response from the server."\r
     }\r
 });\r
-Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;/**\r
- * @class Ext.Resizable\r
+/**
+ * @class Ext.data.DataWriter
+ * <p>Ext.data.DataWriter facilitates create, update, and destroy actions between
+ * an Ext.data.Store and a server-side framework. A Writer enabled Store will
+ * automatically manage the Ajax requests to perform CRUD actions on a Store.</p>
+ * <p>Ext.data.DataWriter is an abstract base class which is intended to be extended
+ * and should not be created directly. For existing implementations, see
+ * {@link Ext.data.JsonWriter}.</p>
+ * <p>Creating a writer is simple:</p>
+ * <pre><code>
+var writer = new Ext.data.JsonWriter({
+    encode: false   // &lt;--- false causes data to be printed to jsonData config-property of Ext.Ajax#reqeust
+});
+ * </code></pre>
+ * * <p>Same old JsonReader as Ext-2.x:</p>
+ * <pre><code>
+var reader = new Ext.data.JsonReader({idProperty: 'id'}, [{name: 'first'}, {name: 'last'}, {name: 'email'}]);
+ * </code></pre>
+ *
+ * <p>The proxy for a writer enabled store can be configured with a simple <code>url</code>:</p>
+ * <pre><code>
+// Create a standard HttpProxy instance.
+var proxy = new Ext.data.HttpProxy({
+    url: 'app.php/users'    // &lt;--- Supports "provides"-type urls, such as '/users.json', '/products.xml' (Hello Rails/Merb)
+});
+ * </code></pre>
+ * <p>For finer grained control, the proxy may also be configured with an <code>API</code>:</p>
+ * <pre><code>
+// Maximum flexibility with the API-configuration
+var proxy = new Ext.data.HttpProxy({
+    api: {
+        read    : 'app.php/users/read',
+        create  : 'app.php/users/create',
+        update  : 'app.php/users/update',
+        destroy : {  // &lt;--- Supports object-syntax as well
+            url: 'app.php/users/destroy',
+            method: "DELETE"
+        }
+    }
+});
+ * </code></pre>
+ * <p>Pulling it all together into a Writer-enabled Store:</p>
+ * <pre><code>
+var store = new Ext.data.Store({
+    proxy: proxy,
+    reader: reader,
+    writer: writer,
+    autoLoad: true,
+    autoSave: true  // -- Cell-level updates.
+});
+ * </code></pre>
+ * <p>Initiating write-actions <b>automatically</b>, using the existing Ext2.0 Store/Record API:</p>
+ * <pre><code>
+var rec = store.getAt(0);
+rec.set('email', 'foo@bar.com');  // &lt;--- Immediately initiates an UPDATE action through configured proxy.
+
+store.remove(rec);  // &lt;---- Immediately initiates a DESTROY action through configured proxy.
+ * </code></pre>
+ * <p>For <b>record/batch</b> updates, use the Store-configuration {@link Ext.data.Store#autoSave autoSave:false}</p>
+ * <pre><code>
+var store = new Ext.data.Store({
+    proxy: proxy,
+    reader: reader,
+    writer: writer,
+    autoLoad: true,
+    autoSave: false  // -- disable cell-updates
+});
+
+var urec = store.getAt(0);
+urec.set('email', 'foo@bar.com');
+
+var drec = store.getAt(1);
+store.remove(drec);
+
+// Push the button!
+store.save();
+ * </code></pre>
+ * @constructor Create a new DataWriter
+ * @param {Object} meta Metadata configuration options (implementation-specific)
+ * @param {Object} recordType Either an Array of field definition objects as specified
+ * in {@link Ext.data.Record#create}, or an {@link Ext.data.Record} object created
+ * using {@link Ext.data.Record#create}.
+ */
+Ext.data.DataWriter = function(config){
+    Ext.apply(this, config);
+};
+Ext.data.DataWriter.prototype = {
+
+    /**
+     * @cfg {Boolean} writeAllFields
+     * <tt>false</tt> by default.  Set <tt>true</tt> to have DataWriter return ALL fields of a modified
+     * record -- not just those that changed.
+     * <tt>false</tt> to have DataWriter only request modified fields from a record.
+     */
+    writeAllFields : false,
+    /**
+     * @cfg {Boolean} listful
+     * <tt>false</tt> by default.  Set <tt>true</tt> to have the DataWriter <b>always</b> write HTTP params as a list,
+     * even when acting upon a single record.
+     */
+    listful : false,    // <-- listful is actually not used internally here in DataWriter.  @see Ext.data.Store#execute.
+
+    /**
+     * Compiles a Store recordset into a data-format defined by an extension such as {@link Ext.data.JsonWriter} or {@link Ext.data.XmlWriter} in preparation for a {@link Ext.data.Api#actions server-write action}.  The first two params are similar similar in nature to {@link Ext#apply},
+     * Where the first parameter is the <i>receiver</i> of paramaters and the second, baseParams, <i>the source</i>.
+     * @param {Object} params The request-params receiver.
+     * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}.  The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}.
+     * @param {String} action [{@link Ext.data.Api#actions create|update|destroy}]
+     * @param {Record/Record[]} rs The recordset to write, the subject(s) of the write action.
+     */
+    apply : function(params, baseParams, action, rs) {
+        var data    = [],
+        renderer    = action + 'Record';
+        // TODO implement @cfg listful here
+        if (Ext.isArray(rs)) {
+            Ext.each(rs, function(rec){
+                data.push(this[renderer](rec));
+            }, this);
+        }
+        else if (rs instanceof Ext.data.Record) {
+            data = this[renderer](rs);
+        }
+        this.render(params, baseParams, data);
+    },
+
+    /**
+     * abstract method meant to be overridden by all DataWriter extensions.  It's the extension's job to apply the "data" to the "params".
+     * The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config,
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
+     * @param {Record[]} rs Store recordset
+     * @param {Object} params Http params to be sent to server.
+     * @param {Object} data object populated according to DataReader meta-data.
+     */
+    render : Ext.emptyFn,
+
+    /**
+     * @cfg {Function} updateRecord Abstract method that should be implemented in all subclasses
+     * (e.g.: {@link Ext.data.JsonWriter#updateRecord JsonWriter.updateRecord}
+     */
+    updateRecord : Ext.emptyFn,
+
+    /**
+     * @cfg {Function} createRecord Abstract method that should be implemented in all subclasses
+     * (e.g.: {@link Ext.data.JsonWriter#createRecord JsonWriter.createRecord})
+     */
+    createRecord : Ext.emptyFn,
+
+    /**
+     * @cfg {Function} destroyRecord Abstract method that should be implemented in all subclasses
+     * (e.g.: {@link Ext.data.JsonWriter#destroyRecord JsonWriter.destroyRecord})
+     */
+    destroyRecord : Ext.emptyFn,
+
+    /**
+     * Converts a Record to a hash, taking into account the state of the Ext.data.Record along with configuration properties
+     * related to its rendering, such as {@link #writeAllFields}, {@link Ext.data.Record#phantom phantom}, {@link Ext.data.Record#getChanges getChanges} and
+     * {@link Ext.data.DataReader#idProperty idProperty}
+     * @param {Ext.data.Record}
+     * @param {Object} config <b>NOT YET IMPLEMENTED</b>.  Will implement an exlude/only configuration for fine-control over which fields do/don't get rendered.
+     * @return {Object}
+     * @protected
+     * TODO Implement excludes/only configuration with 2nd param?
+     */
+    toHash : function(rec, config) {
+        var map = rec.fields.map,
+            data = {},
+            raw = (this.writeAllFields === false && rec.phantom === false) ? rec.getChanges() : rec.data,
+            m;
+        Ext.iterate(raw, function(prop, value){
+            if((m = map[prop])){
+                data[m.mapping ? m.mapping : m.name] = value;
+            }
+        });
+        // we don't want to write Ext auto-generated id to hash.  Careful not to remove it on Models not having auto-increment pk though.
+        // We can tell its not auto-increment if the user defined a DataReader field for it *and* that field's value is non-empty.
+        // we could also do a RegExp here for the Ext.data.Record AUTO_ID prefix.
+        if (rec.phantom) {
+            if (rec.fields.containsKey(this.meta.idProperty) && Ext.isEmpty(rec.data[this.meta.idProperty])) {
+                delete data[this.meta.idProperty];
+            }
+        } else {
+            data[this.meta.idProperty] = rec.id
+        }
+        return data;
+    },
+
+    /**
+     * Converts a {@link Ext.data.DataWriter#toHash Hashed} {@link Ext.data.Record} to fields-array array suitable
+     * for encoding to xml via XTemplate, eg:
+<code><pre>&lt;tpl for=".">&lt;{name}>{value}&lt;/{name}&lt;/tpl></pre></code>
+     * eg, <b>non-phantom</b>:
+<code><pre>{id: 1, first: 'foo', last: 'bar'} --> [{name: 'id', value: 1}, {name: 'first', value: 'foo'}, {name: 'last', value: 'bar'}]</pre></code>
+     * {@link Ext.data.Record#phantom Phantom} records will have had their idProperty omitted in {@link #toHash} if determined to be auto-generated.
+     * Non AUTOINCREMENT pks should have been protected.
+     * @param {Hash} data Hashed by Ext.data.DataWriter#toHash
+     * @return {[Object]} Array of attribute-objects.
+     * @protected
+     */
+    toArray : function(data) {
+        var fields = [];
+        Ext.iterate(data, function(k, v) {fields.push({name: k, value: v});},this);
+        return fields;
+    }
+};/**\r
+ * @class Ext.data.DataProxy\r
  * @extends Ext.util.Observable\r
- * <p>Applies drag handles to an element to make it resizable. The drag handles are inserted into the element \r
- * and positioned absolute. Some elements, such as a textarea or image, don't support this. To overcome that, you can wrap\r
- * the textarea in a div and set 'resizeChild' to true (or to the id of the element), <b>or</b> set wrap:true in your config and\r
- * the element will be wrapped for you automatically.</p>\r
- * <p>Here is the list of valid resize handles:</p>\r
- * <pre>\r
-Value   Description\r
-------  -------------------\r
- 'n'     north\r
- 's'     south\r
- 'e'     east\r
- 'w'     west\r
- 'nw'    northwest\r
- 'sw'    southwest\r
- 'se'    southeast\r
- 'ne'    northeast\r
- 'all'   all\r
-</pre>\r
- * <p>Here's an example showing the creation of a typical Resizable:</p>\r
+ * <p>Abstract base class for implementations which provide retrieval of unformatted data objects.\r
+ * This class is intended to be extended and should not be created directly. For existing implementations,\r
+ * see {@link Ext.data.DirectProxy}, {@link Ext.data.HttpProxy}, {@link Ext.data.ScriptTagProxy} and\r
+ * {@link Ext.data.MemoryProxy}.</p>\r
+ * <p>DataProxy implementations are usually used in conjunction with an implementation of {@link Ext.data.DataReader}\r
+ * (of the appropriate type which knows how to parse the data object) to provide a block of\r
+ * {@link Ext.data.Records} to an {@link Ext.data.Store}.</p>\r
+ * <p>The parameter to a DataProxy constructor may be an {@link Ext.data.Connection} or can also be the\r
+ * config object to an {@link Ext.data.Connection}.</p>\r
+ * <p>Custom implementations must implement either the <code><b>doRequest</b></code> method (preferred) or the\r
+ * <code>load</code> method (deprecated). See\r
+ * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#doRequest doRequest} or\r
+ * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#load load} for additional details.</p>\r
+ * <p><b><u>Example 1</u></b></p>\r
  * <pre><code>\r
-var resizer = new Ext.Resizable('element-id', {\r
-    handles: 'all',\r
-    minWidth: 200,\r
-    minHeight: 100,\r
-    maxWidth: 500,\r
-    maxHeight: 400,\r
-    pinned: true\r
-});\r
-resizer.on('resize', myHandler);\r
-</code></pre>\r
- * <p>To hide a particular handle, set its display to none in CSS, or through script:<br>\r
- * resizer.east.setDisplayed(false);</p>\r
- * @constructor\r
- * Create a new resizable component\r
- * @param {Mixed} el The id or element to resize\r
- * @param {Object} config configuration options\r
-  */\r
-Ext.Resizable = function(el, config){\r
-    this.el = Ext.get(el);\r
-    \r
-    if(config && config.wrap){\r
-        config.resizeChild = this.el;\r
-        this.el = this.el.wrap(typeof config.wrap == 'object' ? config.wrap : {cls:'xresizable-wrap'});\r
-        this.el.id = this.el.dom.id = config.resizeChild.id + '-rzwrap';\r
-        this.el.setStyle('overflow', 'hidden');\r
-        this.el.setPositioning(config.resizeChild.getPositioning());\r
-        config.resizeChild.clearPositioning();\r
-        if(!config.width || !config.height){\r
-            var csize = config.resizeChild.getSize();\r
-            this.el.setSize(csize.width, csize.height);\r
-        }\r
-        if(config.pinned && !config.adjustments){\r
-            config.adjustments = 'auto';\r
-        }\r
+proxy: new Ext.data.ScriptTagProxy({\r
+    {@link Ext.data.Connection#url url}: 'http://extjs.com/forum/topics-remote.php'\r
+}),\r
+ * </code></pre>\r
+ * <p><b><u>Example 2</u></b></p>\r
+ * <pre><code>\r
+proxy : new Ext.data.HttpProxy({\r
+    {@link Ext.data.Connection#method method}: 'GET',\r
+    {@link Ext.data.HttpProxy#prettyUrls prettyUrls}: false,\r
+    {@link Ext.data.Connection#url url}: 'local/default.php', // see options parameter for {@link Ext.Ajax#request}\r
+    {@link #api}: {\r
+        // all actions except the following will use above url\r
+        create  : 'local/new.php',\r
+        update  : 'local/update.php'\r
     }\r
+}),\r
+ * </code></pre>\r
+ * <p>And <b>new in Ext version 3</b>, attach centralized event-listeners upon the DataProxy class itself!  This is a great place\r
+ * to implement a <i>messaging system</i> to centralize your application's user-feedback and error-handling.</p>\r
+ * <pre><code>\r
+// Listen to all "beforewrite" event fired by all proxies.\r
+Ext.data.DataProxy.on('beforewrite', function(proxy, action) {\r
+    console.log('beforewrite: ', action);\r
+});\r
+\r
+// Listen to "write" event fired by all proxies\r
+Ext.data.DataProxy.on('write', function(proxy, action, data, res, rs) {\r
+    console.info('write: ', action);\r
+});\r
+\r
+// Listen to "exception" event fired by all proxies\r
+Ext.data.DataProxy.on('exception', function(proxy, type, action) {\r
+    console.error(type + action + ' exception);\r
+});\r
+ * </code></pre>\r
+ * <b>Note:</b> These three events are all fired with the signature of the corresponding <i>DataProxy instance</i> event {@link #beforewrite beforewrite}, {@link #write write} and {@link #exception exception}.\r
+ */\r
+Ext.data.DataProxy = function(conn){\r
+    // make sure we have a config object here to support ux proxies.\r
+    // All proxies should now send config into superclass constructor.\r
+    conn = conn || {};\r
+\r
+    // This line caused a bug when people use custom Connection object having its own request method.\r
+    // http://extjs.com/forum/showthread.php?t=67194.  Have to set DataProxy config\r
+    //Ext.applyIf(this, conn);\r
+\r
+    this.api     = conn.api;\r
+    this.url     = conn.url;\r
+    this.restful = conn.restful;\r
+    this.listeners = conn.listeners;\r
+\r
+    // deprecated\r
+    this.prettyUrls = conn.prettyUrls;\r
 \r
     /**\r
-     * The proxy Element that is resized in place of the real Element during the resize operation.\r
-     * This may be queried using {@link Ext.Element#getBox} to provide the new area to resize to.\r
-     * Read only.\r
-     * @type Ext.Element.\r
-     * @property proxy\r
-     */\r
-    this.proxy = this.el.createProxy({tag: 'div', cls: 'x-resizable-proxy', id: this.el.id + '-rzproxy'}, Ext.getBody());\r
-    this.proxy.unselectable();\r
-    this.proxy.enableDisplayMode('block');\r
+     * @cfg {Object} api\r
+     * Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".\r
+     * Defaults to:<pre><code>\r
+api: {\r
+    read    : undefined,\r
+    create  : undefined,\r
+    update  : undefined,\r
+    destroy : undefined\r
+}\r
+     * </code></pre>\r
+     * <p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>\r
+     * using the commensurate <tt>{@link #api}</tt> property, or if undefined default to the\r
+     * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.</p><br>\r
+     * <p>For example:</p>\r
+     * <pre><code>\r
+api: {\r
+    load :    '/controller/load',\r
+    create :  '/controller/new',  // Server MUST return idProperty of new record\r
+    save :    '/controller/update',\r
+    destroy : '/controller/destroy_action'\r
+}\r
 \r
-    Ext.apply(this, config);\r
-    \r
-    if(this.pinned){\r
-        this.disableTrackOver = true;\r
-        this.el.addClass('x-resizable-pinned');\r
-    }\r
-    // if the element isn't positioned, make it relative\r
-    var position = this.el.getStyle('position');\r
-    if(position != 'absolute' && position != 'fixed'){\r
-        this.el.setStyle('position', 'relative');\r
-    }\r
-    if(!this.handles){ // no handles passed, must be legacy style\r
-        this.handles = 's,e,se';\r
-        if(this.multiDirectional){\r
-            this.handles += ',n,w';\r
-        }\r
-    }\r
-    if(this.handles == 'all'){\r
-        this.handles = 'n s e w ne nw se sw';\r
-    }\r
-    var hs = this.handles.split(/\s*?[,;]\s*?| /);\r
-    var ps = Ext.Resizable.positions;\r
-    for(var i = 0, len = hs.length; i < len; i++){\r
-        if(hs[i] && ps[hs[i]]){\r
-            var pos = ps[hs[i]];\r
-            this[pos] = new Ext.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent);\r
-        }\r
-    }\r
-    // legacy\r
-    this.corner = this.southeast;\r
-    \r
-    if(this.handles.indexOf('n') != -1 || this.handles.indexOf('w') != -1){\r
-        this.updateBox = true;\r
-    }   \r
-   \r
-    this.activeHandle = null;\r
-    \r
-    if(this.resizeChild){\r
-        if(typeof this.resizeChild == 'boolean'){\r
-            this.resizeChild = Ext.get(this.el.dom.firstChild, true);\r
-        }else{\r
-            this.resizeChild = Ext.get(this.resizeChild, true);\r
+// Alternatively, one can use the object-form to specify each API-action\r
+api: {\r
+    load: {url: 'read.php', method: 'GET'},\r
+    create: 'create.php',\r
+    destroy: 'destroy.php',\r
+    save: 'update.php'\r
+}\r
+     * </code></pre>\r
+     * <p>If the specific URL for a given CRUD action is undefined, the CRUD action request\r
+     * will be directed to the configured <tt>{@link Ext.data.Connection#url url}</tt>.</p>\r
+     * <br><p><b>Note</b>: To modify the URL for an action dynamically the appropriate API\r
+     * property should be modified before the action is requested using the corresponding before\r
+     * action event.  For example to modify the URL associated with the load action:\r
+     * <pre><code>\r
+// modify the url for the action\r
+myStore.on({\r
+    beforeload: {\r
+        fn: function (store, options) {\r
+            // use <tt>{@link Ext.data.HttpProxy#setUrl setUrl}</tt> to change the URL for *just* this request.\r
+            store.proxy.setUrl('changed1.php');\r
+\r
+            // set optional second parameter to true to make this URL change\r
+            // permanent, applying this URL for all subsequent requests.\r
+            store.proxy.setUrl('changed1.php', true);\r
+\r
+            // Altering the proxy API should be done using the public\r
+            // method <tt>{@link Ext.data.DataProxy#setApi setApi}</tt>.\r
+            store.proxy.setApi('read', 'changed2.php');\r
+\r
+            // Or set the entire API with a config-object.\r
+            // When using the config-object option, you must redefine the <b>entire</b>\r
+            // API -- not just a specific action of it.\r
+            store.proxy.setApi({\r
+                read    : 'changed_read.php',\r
+                create  : 'changed_create.php',\r
+                update  : 'changed_update.php',\r
+                destroy : 'changed_destroy.php'\r
+            });\r
         }\r
     }\r
-    \r
-    if(this.adjustments == 'auto'){\r
-        var rc = this.resizeChild;\r
-        var hw = this.west, he = this.east, hn = this.north, hs = this.south;\r
-        if(rc && (hw || hn)){\r
-            rc.position('relative');\r
-            rc.setLeft(hw ? hw.el.getWidth() : 0);\r
-            rc.setTop(hn ? hn.el.getHeight() : 0);\r
-        }\r
-        this.adjustments = [\r
-            (he ? -he.el.getWidth() : 0) + (hw ? -hw.el.getWidth() : 0),\r
-            (hn ? -hn.el.getHeight() : 0) + (hs ? -hs.el.getHeight() : 0) -1 \r
-        ];\r
-    }\r
-    \r
-    if(this.draggable){\r
-        this.dd = this.dynamic ? \r
-            this.el.initDD(null) : this.el.initDDProxy(null, {dragElId: this.proxy.id});\r
-        this.dd.setHandleElId(this.resizeChild ? this.resizeChild.id : this.el.id);\r
-    }\r
-    \r
+});\r
+     * </code></pre>\r
+     * </p>\r
+     */\r
+\r
     this.addEvents(\r
         /**\r
-         * @event beforeresize\r
-         * Fired before resize is allowed. Set {@link #enabled} to false to cancel resize.\r
-         * @param {Ext.Resizable} this\r
-         * @param {Ext.EventObject} e The mousedown event\r
+         * @event exception\r
+         * <p>Fires if an exception occurs in the Proxy during a remote request. This event is relayed\r
+         * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception},\r
+         * so any Store instance may observe this event.</p>\r
+         * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired\r
+         * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of exception events from <b>all</b>\r
+         * DataProxies by attaching a listener to the Ext.data.Proxy class itself.</p>\r
+         * <p>This event can be fired for one of two reasons:</p>\r
+         * <div class="mdetail-params"><ul>\r
+         * <li>remote-request <b>failed</b> : <div class="sub-desc">\r
+         * The server did not return status === 200.\r
+         * </div></li>\r
+         * <li>remote-request <b>succeeded</b> : <div class="sub-desc">\r
+         * The remote-request succeeded but the reader could not read the response.\r
+         * This means the server returned data, but the configured Reader threw an\r
+         * error while reading the response.  In this case, this event will be\r
+         * raised and the caught error will be passed along into this event.\r
+         * </div></li>\r
+         * </ul></div>\r
+         * <br><p>This event fires with two different contexts based upon the 2nd\r
+         * parameter <tt>type [remote|response]</tt>.  The first four parameters\r
+         * are identical between the two contexts -- only the final two parameters\r
+         * differ.</p>\r
+         * @param {DataProxy} this The proxy that sent the request\r
+         * @param {String} type\r
+         * <p>The value of this parameter will be either <tt>'response'</tt> or <tt>'remote'</tt>.</p>\r
+         * <div class="mdetail-params"><ul>\r
+         * <li><b><tt>'response'</tt></b> : <div class="sub-desc">\r
+         * <p>An <b>invalid</b> response from the server was returned: either 404,\r
+         * 500 or the response meta-data does not match that defined in the DataReader\r
+         * (e.g.: root, idProperty, successProperty).</p>\r
+         * </div></li>\r
+         * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">\r
+         * <p>A <b>valid</b> response was returned from the server having\r
+         * successProperty === false.  This response might contain an error-message\r
+         * sent from the server.  For example, the user may have failed\r
+         * authentication/authorization or a database validation error occurred.</p>\r
+         * </div></li>\r
+         * </ul></div>\r
+         * @param {String} action Name of the action (see {@link Ext.data.Api#actions}.\r
+         * @param {Object} options The options for the action that were specified in the {@link #request}.\r
+         * @param {Object} response\r
+         * <p>The value of this parameter depends on the value of the <code>type</code> parameter:</p>\r
+         * <div class="mdetail-params"><ul>\r
+         * <li><b><tt>'response'</tt></b> : <div class="sub-desc">\r
+         * <p>The raw browser response object (e.g.: XMLHttpRequest)</p>\r
+         * </div></li>\r
+         * <li><b><tt>'remote'</tt></b> : <div class="sub-desc">\r
+         * <p>The decoded response object sent from the server.</p>\r
+         * </div></li>\r
+         * </ul></div>\r
+         * @param {Mixed} arg\r
+         * <p>The type and value of this parameter depends on the value of the <code>type</code> parameter:</p>\r
+         * <div class="mdetail-params"><ul>\r
+         * <li><b><tt>'response'</tt></b> : Error<div class="sub-desc">\r
+         * <p>The JavaScript Error object caught if the configured Reader could not read the data.\r
+         * If the remote request returns success===false, this parameter will be null.</p>\r
+         * </div></li>\r
+         * <li><b><tt>'remote'</tt></b> : Record/Record[]<div class="sub-desc">\r
+         * <p>This parameter will only exist if the <tt>action</tt> was a <b>write</b> action\r
+         * (Ext.data.Api.actions.create|update|destroy).</p>\r
+         * </div></li>\r
+         * </ul></div>\r
+         */\r
+        'exception',\r
+        /**\r
+         * @event beforeload\r
+         * Fires before a request to retrieve a data object.\r
+         * @param {DataProxy} this The proxy for the request\r
+         * @param {Object} params The params object passed to the {@link #request} function\r
          */\r
-        'beforeresize',\r
+        'beforeload',\r
         /**\r
-         * @event resize\r
-         * Fired after a resize.\r
-         * @param {Ext.Resizable} this\r
-         * @param {Number} width The new width\r
-         * @param {Number} height The new height\r
-         * @param {Ext.EventObject} e The mouseup event\r
+         * @event load\r
+         * Fires before the load method's callback is called.\r
+         * @param {DataProxy} this The proxy for the request\r
+         * @param {Object} o The request transaction object\r
+         * @param {Object} options The callback's <tt>options</tt> property as passed to the {@link #request} function\r
+         */\r
+        'load',\r
+        /**\r
+         * @event loadexception\r
+         * <p>This event is <b>deprecated</b>.  The signature of the loadexception event\r
+         * varies depending on the proxy, use the catch-all {@link #exception} event instead.\r
+         * This event will fire in addition to the {@link #exception} event.</p>\r
+         * @param {misc} misc See {@link #exception}.\r
+         * @deprecated\r
+         */\r
+        'loadexception',\r
+        /**\r
+         * @event beforewrite\r
+         * <p>Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy</p>\r
+         * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired\r
+         * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of beforewrite events from <b>all</b>\r
+         * DataProxies by attaching a listener to the Ext.data.Proxy class itself.</p>\r
+         * @param {DataProxy} this The proxy for the request\r
+         * @param {String} action [Ext.data.Api.actions.create|update|destroy]\r
+         * @param {Record/Array[Record]} rs The Record(s) to create|update|destroy.\r
+         * @param {Object} params The request <code>params</code> object.  Edit <code>params</code> to add parameters to the request.\r
+         */\r
+        'beforewrite',\r
+        /**\r
+         * @event write\r
+         * <p>Fires before the request-callback is called</p>\r
+         * <p>In addition to being fired through the DataProxy instance that raised the event, this event is also fired\r
+         * through the Ext.data.DataProxy <i>class</i> to allow for centralized processing of write events from <b>all</b>\r
+         * DataProxies by attaching a listener to the Ext.data.Proxy class itself.</p>\r
+         * @param {DataProxy} this The proxy that sent the request\r
+         * @param {String} action [Ext.data.Api.actions.create|upate|destroy]\r
+         * @param {Object} data The data object extracted from the server-response\r
+         * @param {Object} response The decoded response from server\r
+         * @param {Record/Record{}} rs The records from Store\r
+         * @param {Object} options The callback's <tt>options</tt> property as passed to the {@link #request} function\r
          */\r
-        'resize'\r
+        'write'\r
     );\r
-    \r
-    if(this.width !== null && this.height !== null){\r
-        this.resizeTo(this.width, this.height);\r
-    }else{\r
-        this.updateChildSize();\r
-    }\r
-    if(Ext.isIE){\r
-        this.el.dom.style.zoom = 1;\r
+    Ext.data.DataProxy.superclass.constructor.call(this);\r
+\r
+    // Prepare the proxy api.  Ensures all API-actions are defined with the Object-form.\r
+    try {\r
+        Ext.data.Api.prepare(this);\r
+    } catch (e) {\r
+        if (e instanceof Ext.data.Api.Error) {\r
+            e.toConsole();\r
+        }\r
     }\r
-    Ext.Resizable.superclass.constructor.call(this);\r
+    // relay each proxy's events onto Ext.data.DataProxy class for centralized Proxy-listening\r
+    Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']);\r
 };\r
 \r
-Ext.extend(Ext.Resizable, Ext.util.Observable, {\r
-\r
-    /**\r
-     * @cfg {Array/String} adjustments String 'auto' or an array [width, height] with values to be <b>added</b> to the\r
-     * resize operation's new size (defaults to <tt>[0, 0]</tt>)\r
-     */\r
-    adjustments : [0, 0],\r
-    /**\r
-     * @cfg {Boolean} animate True to animate the resize (not compatible with dynamic sizing, defaults to false)\r
-     */\r
-    animate : false,\r
-    /**\r
-     * @cfg {Mixed} constrainTo Constrain the resize to a particular element\r
-     */\r
-    /**\r
-     * @cfg {Boolean} disableTrackOver True to disable mouse tracking. This is only applied at config time. (defaults to false)\r
-     */\r
-    disableTrackOver : false,\r
-    /**\r
-     * @cfg {Boolean} draggable Convenience to initialize drag drop (defaults to false)\r
-     */\r
-    draggable: false,\r
-    /**\r
-     * @cfg {Number} duration Animation duration if animate = true (defaults to 0.35)\r
-     */\r
-    duration : 0.35,\r
-    /**\r
-     * @cfg {Boolean} dynamic True to resize the element while dragging instead of using a proxy (defaults to false)\r
-     */\r
-    dynamic : false,\r
-    /**\r
-     * @cfg {String} easing Animation easing if animate = true (defaults to <tt>'easingOutStrong'</tt>)\r
-     */\r
-    easing : 'easeOutStrong',\r
-    /**\r
-     * @cfg {Boolean} enabled False to disable resizing (defaults to true)\r
-     */\r
-    enabled : true,\r
-    /**\r
-     * @property enabled Writable. False if resizing is disabled.\r
-     * @type Boolean \r
-     */\r
-    /**\r
-     * @cfg {String} handles String consisting of the resize handles to display (defaults to undefined).\r
-     * Specify either <tt>'all'</tt> or any of <tt>'n s e w ne nw se sw'</tt>.\r
-     */\r
-    handles : false,\r
-    /**\r
-     * @cfg {Boolean} multiDirectional <b>Deprecated</b>.  Deprecated style of adding multi-direction resize handles.\r
-     */\r
-    multiDirectional : false,\r
+Ext.extend(Ext.data.DataProxy, Ext.util.Observable, {\r
     /**\r
-     * @cfg {Number} height The height of the element in pixels (defaults to null)\r
+     * @cfg {Boolean} restful\r
+     * <p>Defaults to <tt>false</tt>.  Set to <tt>true</tt> to operate in a RESTful manner.</p>\r
+     * <br><p> Note: this parameter will automatically be set to <tt>true</tt> if the\r
+     * {@link Ext.data.Store} it is plugged into is set to <code>restful: true</code>. If the\r
+     * Store is RESTful, there is no need to set this option on the proxy.</p>\r
+     * <br><p>RESTful implementations enable the serverside framework to automatically route\r
+     * actions sent to one url based upon the HTTP method, for example:\r
+     * <pre><code>\r
+store: new Ext.data.Store({\r
+    restful: true,\r
+    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users\r
+    ...\r
+)}\r
+     * </code></pre>\r
+     * If there is no <code>{@link #api}</code> specified in the configuration of the proxy,\r
+     * all requests will be marshalled to a single RESTful url (/users) so the serverside\r
+     * framework can inspect the HTTP Method and act accordingly:\r
+     * <pre>\r
+<u>Method</u>   <u>url</u>        <u>action</u>\r
+POST     /users     create\r
+GET      /users     read\r
+PUT      /users/23  update\r
+DESTROY  /users/23  delete\r
+     * </pre></p>\r
+     * <p>If set to <tt>true</tt>, a {@link Ext.data.Record#phantom non-phantom} record's\r
+     * {@link Ext.data.Record#id id} will be appended to the url. Some MVC (e.g., Ruby on Rails,\r
+     * Merb and Django) support segment based urls where the segments in the URL follow the\r
+     * Model-View-Controller approach:<pre><code>\r
+     * someSite.com/controller/action/id\r
+     * </code></pre>\r
+     * Where the segments in the url are typically:<div class="mdetail-params"><ul>\r
+     * <li>The first segment : represents the controller class that should be invoked.</li>\r
+     * <li>The second segment : represents the class function, or method, that should be called.</li>\r
+     * <li>The third segment : represents the ID (a variable typically passed to the method).</li>\r
+     * </ul></div></p>\r
+     * <br><p>Refer to <code>{@link Ext.data.DataProxy#api}</code> for additional information.</p>\r
      */\r
-    height : null,\r
+    restful: false,\r
+\r
     /**\r
-     * @cfg {Number} width The width of the element in pixels (defaults to null)\r
+     * <p>Redefines the Proxy's API or a single action of an API. Can be called with two method signatures.</p>\r
+     * <p>If called with an object as the only parameter, the object should redefine the <b>entire</b> API, e.g.:</p><pre><code>\r
+proxy.setApi({\r
+    read    : '/users/read',\r
+    create  : '/users/create',\r
+    update  : '/users/update',\r
+    destroy : '/users/destroy'\r
+});\r
+</code></pre>\r
+     * <p>If called with two parameters, the first parameter should be a string specifying the API action to\r
+     * redefine and the second parameter should be the URL (or function if using DirectProxy) to call for that action, e.g.:</p><pre><code>\r
+proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');\r
+</code></pre>\r
+     * @param {String/Object} api An API specification object, or the name of an action.\r
+     * @param {String/Function} url The URL (or function if using DirectProxy) to call for the action.\r
      */\r
-    width : null,\r
+    setApi : function() {\r
+        if (arguments.length == 1) {\r
+            var valid = Ext.data.Api.isValid(arguments[0]);\r
+            if (valid === true) {\r
+                this.api = arguments[0];\r
+            }\r
+            else {\r
+                throw new Ext.data.Api.Error('invalid', valid);\r
+            }\r
+        }\r
+        else if (arguments.length == 2) {\r
+            if (!Ext.data.Api.isAction(arguments[0])) {\r
+                throw new Ext.data.Api.Error('invalid', arguments[0]);\r
+            }\r
+            this.api[arguments[0]] = arguments[1];\r
+        }\r
+        Ext.data.Api.prepare(this);\r
+    },\r
+\r
     /**\r
-     * @cfg {Number} heightIncrement The increment to snap the height resize in pixels\r
-     * (only applies if <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.\r
+     * Returns true if the specified action is defined as a unique action in the api-config.\r
+     * request.  If all API-actions are routed to unique urls, the xaction parameter is unecessary.  However, if no api is defined\r
+     * and all Proxy actions are routed to DataProxy#url, the server-side will require the xaction parameter to perform a switch to\r
+     * the corresponding code for CRUD action.\r
+     * @param {String [Ext.data.Api.CREATE|READ|UPDATE|DESTROY]} action\r
+     * @return {Boolean}\r
      */\r
-    heightIncrement : 0,\r
+    isApiAction : function(action) {\r
+        return (this.api[action]) ? true : false;\r
+    },\r
+\r
     /**\r
-     * @cfg {Number} widthIncrement The increment to snap the width resize in pixels\r
-     * (only applies if <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.\r
+     * All proxy actions are executed through this method.  Automatically fires the "before" + action event\r
+     * @param {String} action Name of the action\r
+     * @param {Ext.data.Record/Ext.data.Record[]/null} rs Will be null when action is 'load'\r
+     * @param {Object} params\r
+     * @param {Ext.data.DataReader} reader\r
+     * @param {Function} callback\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the Proxy object.\r
+     * @param {Object} options Any options specified for the action (e.g. see {@link Ext.data.Store#load}.\r
      */\r
-    widthIncrement : 0,\r
+    request : function(action, rs, params, reader, callback, scope, options) {\r
+        if (!this.api[action] && !this.load) {\r
+            throw new Ext.data.DataProxy.Error('action-undefined', action);\r
+        }\r
+        params = params || {};\r
+        if ((action === Ext.data.Api.actions.read) ? this.fireEvent("beforeload", this, params) : this.fireEvent("beforewrite", this, action, rs, params) !== false) {\r
+            this.doRequest.apply(this, arguments);\r
+        }\r
+        else {\r
+            callback.call(scope || this, null, options, false);\r
+        }\r
+    },\r
+\r
+\r
     /**\r
-     * @cfg {Number} minHeight The minimum height for the element (defaults to 5)\r
+     * <b>Deprecated</b> load method using old method signature. See {@doRequest} for preferred method.\r
+     * @deprecated\r
+     * @param {Object} params\r
+     * @param {Object} reader\r
+     * @param {Object} callback\r
+     * @param {Object} scope\r
+     * @param {Object} arg\r
      */\r
-    minHeight : 5,\r
+    load : null,\r
+\r
     /**\r
-     * @cfg {Number} minWidth The minimum width for the element (defaults to 5)\r
+     * @cfg {Function} doRequest Abstract method that should be implemented in all subclasses.  <b>Note:</b> Should only be used by custom-proxy developers.\r
+     * (e.g.: {@link Ext.data.HttpProxy#doRequest HttpProxy.doRequest},\r
+     * {@link Ext.data.DirectProxy#doRequest DirectProxy.doRequest}).\r
      */\r
-    minWidth : 5,\r
+    doRequest : function(action, rs, params, reader, callback, scope, options) {\r
+        // default implementation of doRequest for backwards compatibility with 2.0 proxies.\r
+        // If we're executing here, the action is probably "load".\r
+        // Call with the pre-3.0 method signature.\r
+        this.load(params, reader, callback, scope, options);\r
+    },\r
+\r
     /**\r
-     * @cfg {Number} maxHeight The maximum height for the element (defaults to 10000)\r
+     * @cfg {Function} onRead Abstract method that should be implemented in all subclasses.  <b>Note:</b> Should only be used by custom-proxy developers.  Callback for read {@link Ext.data.Api#actions action}.\r
+     * @param {String} action Action name as per {@link Ext.data.Api.actions#read}.\r
+     * @param {Object} o The request transaction object\r
+     * @param {Object} res The server response\r
+     * @fires loadexception (deprecated)\r
+     * @fires exception\r
+     * @fires load\r
+     * @protected\r
      */\r
-    maxHeight : 10000,\r
+    onRead : Ext.emptyFn,\r
     /**\r
-     * @cfg {Number} maxWidth The maximum width for the element (defaults to 10000)\r
+     * @cfg {Function} onWrite Abstract method that should be implemented in all subclasses.  <b>Note:</b> Should only be used by custom-proxy developers.  Callback for <i>create, update and destroy</i> {@link Ext.data.Api#actions actions}.\r
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} res The server response\r
+     * @fires exception\r
+     * @fires write\r
+     * @protected\r
      */\r
-    maxWidth : 10000,\r
+    onWrite : Ext.emptyFn,\r
     /**\r
-     * @cfg {Number} minX The minimum x for the element (defaults to 0)\r
+     * buildUrl\r
+     * Sets the appropriate url based upon the action being executed.  If restful is true, and only a single record is being acted upon,\r
+     * url will be built Rails-style, as in "/controller/action/32".  restful will aply iff the supplied record is an\r
+     * instance of Ext.data.Record rather than an Array of them.\r
+     * @param {String} action The api action being executed [read|create|update|destroy]\r
+     * @param {Ext.data.Record/Array[Ext.data.Record]} The record or Array of Records being acted upon.\r
+     * @return {String} url\r
+     * @private\r
      */\r
-    minX: 0,\r
+    buildUrl : function(action, record) {\r
+        record = record || null;\r
+\r
+        // conn.url gets nullified after each request.  If it's NOT null here, that means the user must have intervened with a call\r
+        // to DataProxy#setUrl or DataProxy#setApi and changed it before the request was executed.  If that's the case, use conn.url,\r
+        // otherwise, build the url from the api or this.url.\r
+        var url = (this.conn && this.conn.url) ? this.conn.url : (this.api[action]) ? this.api[action].url : this.url;\r
+        if (!url) {\r
+            throw new Ext.data.Api.Error('invalid-url', action);\r
+        }\r
+\r
+        // look for urls having "provides" suffix used in some MVC frameworks like Rails/Merb and others.  The provides suffice informs\r
+        // the server what data-format the client is dealing with and returns data in the same format (eg: application/json, application/xml, etc)\r
+        // e.g.: /users.json, /users.xml, etc.\r
+        // with restful routes, we need urls like:\r
+        // PUT /users/1.json\r
+        // DELETE /users/1.json\r
+        var provides = null;\r
+        var m = url.match(/(.*)(\.json|\.xml|\.html)$/);\r
+        if (m) {\r
+            provides = m[2];    // eg ".json"\r
+            url      = m[1];    // eg: "/users"\r
+        }\r
+        // prettyUrls is deprectated in favor of restful-config\r
+        if ((this.restful === true || this.prettyUrls === true) && record instanceof Ext.data.Record && !record.phantom) {\r
+            url += '/' + record.id;\r
+        }\r
+        return (provides === null) ? url : url + provides;\r
+    },\r
+\r
     /**\r
-     * @cfg {Number} minY The minimum x for the element (defaults to 0)\r
+     * Destroys the proxy by purging any event listeners and cancelling any active requests.\r
      */\r
-    minY: 0,\r
+    destroy: function(){\r
+        this.purgeListeners();\r
+    }\r
+});\r
+\r
+// Apply the Observable prototype to the DataProxy class so that proxy instances can relay their\r
+// events to the class.  Allows for centralized listening of all proxy instances upon the DataProxy class.\r
+Ext.apply(Ext.data.DataProxy, Ext.util.Observable.prototype);\r
+Ext.util.Observable.call(Ext.data.DataProxy);\r
+\r
+/**\r
+ * @class Ext.data.DataProxy.Error\r
+ * @extends Ext.Error\r
+ * DataProxy Error extension.\r
+ * constructor\r
+ * @param {String} name\r
+ * @param {Record/Array[Record]/Array}\r
+ */\r
+Ext.data.DataProxy.Error = Ext.extend(Ext.Error, {\r
+    constructor : function(message, arg) {\r
+        this.arg = arg;\r
+        Ext.Error.call(this, message);\r
+    },\r
+    name: 'Ext.data.DataProxy'\r
+});\r
+Ext.apply(Ext.data.DataProxy.Error.prototype, {\r
+    lang: {\r
+        'action-undefined': "DataProxy attempted to execute an API-action but found an undefined url / function.  Please review your Proxy url/api-configuration.",\r
+        'api-invalid': 'Recieved an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions.'\r
+    }\r
+});\r
+\r
+\r
+/**
+ * @class Ext.data.Request
+ * A simple Request class used internally to the data package to provide more generalized remote-requests
+ * to a DataProxy.
+ * TODO Not yet implemented.  Implement in Ext.data.Store#execute
+ */
+Ext.data.Request = function(params) {
+    Ext.apply(this, params);
+};
+Ext.data.Request.prototype = {
+    /**
+     * @cfg {String} action
+     */
+    action : undefined,
+    /**
+     * @cfg {Ext.data.Record[]/Ext.data.Record} rs The Store recordset associated with the request.
+     */
+    rs : undefined,
+    /**
+     * @cfg {Object} params HTTP request params
+     */
+    params: undefined,
+    /**
+     * @cfg {Function} callback The function to call when request is complete
+     */
+    callback : Ext.emptyFn,
+    /**
+     * @cfg {Object} scope The scope of the callback funtion
+     */
+    scope : undefined,
+    /**
+     * @cfg {Ext.data.DataReader} reader The DataReader instance which will parse the received response
+     */
+    reader : undefined
+};
+/**
+ * @class Ext.data.Response
+ * A generic response class to normalize response-handling internally to the framework.
+ */
+Ext.data.Response = function(params) {
+    Ext.apply(this, params);
+};
+Ext.data.Response.prototype = {
+    /**
+     * @cfg {String} action {@link Ext.data.Api#actions}
+     */
+    action: undefined,
+    /**
+     * @cfg {Boolean} success
+     */
+    success : undefined,
+    /**
+     * @cfg {String} message
+     */
+    message : undefined,
+    /**
+     * @cfg {Array/Object} data
+     */
+    data: undefined,
+    /**
+     * @cfg {Object} raw The raw response returned from server-code
+     */
+    raw: undefined,
+    /**
+     * @cfg {Ext.data.Record/Ext.data.Record[]} records related to the Request action
+     */
+    records: undefined
+};
+/**\r
+ * @class Ext.data.ScriptTagProxy\r
+ * @extends Ext.data.DataProxy\r
+ * An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain\r
+ * other than the originating domain of the running page.<br>\r
+ * <p>\r
+ * <b>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain\r
+ * of the running page, you must use this class, rather than HttpProxy.</b><br>\r
+ * <p>\r
+ * The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScript\r
+ * source code because it is used as the source inside a &lt;script> tag.<br>\r
+ * <p>\r
+ * In order for the browser to process the returned data, the server must wrap the data object\r
+ * with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.\r
+ * Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy\r
+ * depending on whether the callback name was passed:\r
+ * <p>\r
+ * <pre><code>\r
+boolean scriptTag = false;\r
+String cb = request.getParameter("callback");\r
+if (cb != null) {\r
+    scriptTag = true;\r
+    response.setContentType("text/javascript");\r
+} else {\r
+    response.setContentType("application/x-json");\r
+}\r
+Writer out = response.getWriter();\r
+if (scriptTag) {\r
+    out.write(cb + "(");\r
+}\r
+out.print(dataBlock.toJsonString());\r
+if (scriptTag) {\r
+    out.write(");");\r
+}\r
+</code></pre>\r
+ * <p>Below is a PHP example to do the same thing:</p><pre><code>\r
+$callback = $_REQUEST['callback'];\r
+\r
+// Create the output object.\r
+$output = array('a' => 'Apple', 'b' => 'Banana');\r
+\r
+//start output\r
+if ($callback) {\r
+    header('Content-Type: text/javascript');\r
+    echo $callback . '(' . json_encode($output) . ');';\r
+} else {\r
+    header('Content-Type: application/x-json');\r
+    echo json_encode($output);\r
+}\r
+</code></pre>\r
+ * <p>Below is the ASP.Net code to do the same thing:</p><pre><code>\r
+String jsonString = "{success: true}";\r
+String cb = Request.Params.Get("callback");\r
+String responseString = "";\r
+if (!String.IsNullOrEmpty(cb)) {\r
+    responseString = cb + "(" + jsonString + ")";\r
+} else {\r
+    responseString = jsonString;\r
+}\r
+Response.Write(responseString);\r
+</code></pre>\r
+ *\r
+ * @constructor\r
+ * @param {Object} config A configuration object.\r
+ */\r
+Ext.data.ScriptTagProxy = function(config){\r
+    Ext.apply(this, config);\r
+\r
+    Ext.data.ScriptTagProxy.superclass.constructor.call(this, config);\r
+\r
+    this.head = document.getElementsByTagName("head")[0];\r
+\r
     /**\r
-     * @cfg {Boolean} pinned True to ensure that the resize handles are always visible, false to display them only when the\r
-     * user mouses over the resizable borders. This is only applied at config time. (defaults to false)\r
+     * @event loadexception\r
+     * <b>Deprecated</b> in favor of 'exception' event.\r
+     * Fires if an exception occurs in the Proxy during data loading.  This event can be fired for one of two reasons:\r
+     * <ul><li><b>The load call timed out.</b>  This means the load callback did not execute within the time limit\r
+     * specified by {@link #timeout}.  In this case, this event will be raised and the\r
+     * fourth parameter (read error) will be null.</li>\r
+     * <li><b>The load succeeded but the reader could not read the response.</b>  This means the server returned\r
+     * data, but the configured Reader threw an error while reading the data.  In this case, this event will be\r
+     * raised and the caught error will be passed along as the fourth parameter of this event.</li></ul>\r
+     * Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly\r
+     * on any Store instance.\r
+     * @param {Object} this\r
+     * @param {Object} options The loading options that were specified (see {@link #load} for details).  If the load\r
+     * call timed out, this parameter will be null.\r
+     * @param {Object} arg The callback's arg object passed to the {@link #load} function\r
+     * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data.\r
+     * If the remote request returns success: false, this parameter will be null.\r
      */\r
-    pinned : false,\r
+};\r
+\r
+Ext.data.ScriptTagProxy.TRANS_ID = 1000;\r
+\r
+Ext.extend(Ext.data.ScriptTagProxy, Ext.data.DataProxy, {\r
     /**\r
-     * @cfg {Boolean} preserveRatio True to preserve the original ratio between height\r
-     * and width during resize (defaults to false)\r
+     * @cfg {String} url The URL from which to request the data object.\r
      */\r
-    preserveRatio : false,\r
-    /**\r
-     * @cfg {Boolean/String/Element} resizeChild True to resize the first child, or id/element to resize (defaults to false) \r
-     */ \r
-    resizeChild : false,\r
     /**\r
-     * @cfg {Boolean} transparent True for transparent handles. This is only applied at config time. (defaults to false)\r
+     * @cfg {Number} timeout (optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.\r
      */\r
-    transparent: false,\r
+    timeout : 30000,\r
     /**\r
-     * @cfg {Ext.lib.Region} resizeRegion Constrain the resize to a particular region\r
+     * @cfg {String} callbackParam (Optional) The name of the parameter to pass to the server which tells\r
+     * the server the name of the callback function set up by the load call to process the returned data object.\r
+     * Defaults to "callback".<p>The server-side processing must read this parameter value, and generate\r
+     * javascript output which calls this named function passing the data object as its only parameter.\r
      */\r
+    callbackParam : "callback",\r
     /**\r
-     * @cfg {Boolean} wrap True to wrap an element with a div if needed (required for textareas and images, defaults to false)\r
-     * in favor of the handles config option (defaults to false)\r
+     *  @cfg {Boolean} nocache (optional) Defaults to true. Disable caching by adding a unique parameter\r
+     * name to the request.\r
      */\r
+    nocache : true,\r
 \r
-    \r
     /**\r
-     * Perform a manual resize and fires the 'resize' event.\r
-     * @param {Number} width\r
-     * @param {Number} height\r
+     * HttpProxy implementation of DataProxy#doRequest\r
+     * @param {String} action\r
+     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is <tt>read</tt>, rs will be null\r
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
+     * for the request to the remote server.\r
+     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
+     * object into a block of Ext.data.Records.\r
+     * @param {Function} callback The function into which to pass the block of Ext.data.Records.\r
+     * The function must be passed <ul>\r
+     * <li>The Record block object</li>\r
+     * <li>The "arg" argument from the load function</li>\r
+     * <li>A boolean success indicator</li>\r
+     * </ul>\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
      */\r
-    resizeTo : function(width, height){\r
-        this.el.setSize(width, height);\r
-        this.updateChildSize();\r
-        this.fireEvent('resize', this, width, height, null);\r
-    },\r
-\r
-    // private\r
-    startSizing : function(e, handle){\r
-        this.fireEvent('beforeresize', this, e);\r
-        if(this.enabled){ // 2nd enabled check in case disabled before beforeresize handler\r
-\r
-            if(!this.overlay){\r
-                this.overlay = this.el.createProxy({tag: 'div', cls: 'x-resizable-overlay', html: '&#160;'}, Ext.getBody());\r
-                this.overlay.unselectable();\r
-                this.overlay.enableDisplayMode('block');\r
-                this.overlay.on({\r
-                    scope: this,\r
-                    mousemove: this.onMouseMove,\r
-                    mouseup: this.onMouseUp\r
-                });\r
-            }\r
-            this.overlay.setStyle('cursor', handle.el.getStyle('cursor'));\r
-\r
-            this.resizing = true;\r
-            this.startBox = this.el.getBox();\r
-            this.startPoint = e.getXY();\r
-            this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0],\r
-                            (this.startBox.y + this.startBox.height) - this.startPoint[1]];\r
-\r
-            this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));\r
-            this.overlay.show();\r
-\r
-            if(this.constrainTo) {\r
-                var ct = Ext.get(this.constrainTo);\r
-                this.resizeRegion = ct.getRegion().adjust(\r
-                    ct.getFrameWidth('t'),\r
-                    ct.getFrameWidth('l'),\r
-                    -ct.getFrameWidth('b'),\r
-                    -ct.getFrameWidth('r')\r
-                );\r
-            }\r
+    doRequest : function(action, rs, params, reader, callback, scope, arg) {\r
+        var p = Ext.urlEncode(Ext.apply(params, this.extraParams));\r
 \r
-            this.proxy.setStyle('visibility', 'hidden'); // workaround display none\r
-            this.proxy.show();\r
-            this.proxy.setBox(this.startBox);\r
-            if(!this.dynamic){\r
-                this.proxy.setStyle('visibility', 'visible');\r
-            }\r
+        var url = this.buildUrl(action, rs);\r
+        if (!url) {\r
+            throw new Ext.data.Api.Error('invalid-url', url);\r
+        }\r
+        url = Ext.urlAppend(url, p);\r
+\r
+        if(this.nocache){\r
+            url = Ext.urlAppend(url, '_dc=' + (new Date().getTime()));\r
+        }\r
+        var transId = ++Ext.data.ScriptTagProxy.TRANS_ID;\r
+        var trans = {\r
+            id : transId,\r
+            action: action,\r
+            cb : "stcCallback"+transId,\r
+            scriptId : "stcScript"+transId,\r
+            params : params,\r
+            arg : arg,\r
+            url : url,\r
+            callback : callback,\r
+            scope : scope,\r
+            reader : reader\r
+        };\r
+        window[trans.cb] = this.createCallback(action, rs, trans);\r
+        url += String.format("&{0}={1}", this.callbackParam, trans.cb);\r
+        if(this.autoAbort !== false){\r
+            this.abort();\r
         }\r
-    },\r
 \r
-    // private\r
-    onMouseDown : function(handle, e){\r
-        if(this.enabled){\r
-            e.stopEvent();\r
-            this.activeHandle = handle;\r
-            this.startSizing(e, handle);\r
-        }          \r
-    },\r
+        trans.timeoutId = this.handleFailure.defer(this.timeout, this, [trans]);\r
 \r
-    // private\r
-    onMouseUp : function(e){\r
-        this.activeHandle = null;\r
-        var size = this.resizeElement();\r
-        this.resizing = false;\r
-        this.handleOut();\r
-        this.overlay.hide();\r
-        this.proxy.hide();\r
-        this.fireEvent('resize', this, size.width, size.height, e);\r
+        var script = document.createElement("script");\r
+        script.setAttribute("src", url);\r
+        script.setAttribute("type", "text/javascript");\r
+        script.setAttribute("id", trans.scriptId);\r
+        this.head.appendChild(script);\r
+\r
+        this.trans = trans;\r
     },\r
 \r
-    // private\r
-    updateChildSize : function(){\r
-        if(this.resizeChild){\r
-            var el = this.el;\r
-            var child = this.resizeChild;\r
-            var adj = this.adjustments;\r
-            if(el.dom.offsetWidth){\r
-                var b = el.getSize(true);\r
-                child.setSize(b.width+adj[0], b.height+adj[1]);\r
-            }\r
-            // Second call here for IE\r
-            // The first call enables instant resizing and\r
-            // the second call corrects scroll bars if they\r
-            // exist\r
-            if(Ext.isIE){\r
-                setTimeout(function(){\r
-                    if(el.dom.offsetWidth){\r
-                        var b = el.getSize(true);\r
-                        child.setSize(b.width+adj[0], b.height+adj[1]);\r
-                    }\r
-                }, 10);\r
+    // @private createCallback\r
+    createCallback : function(action, rs, trans) {\r
+        var self = this;\r
+        return function(res) {\r
+            self.trans = false;\r
+            self.destroyTrans(trans, true);\r
+            if (action === Ext.data.Api.actions.read) {\r
+                self.onRead.call(self, action, trans, res);\r
+            } else {\r
+                self.onWrite.call(self, action, trans, res, rs);\r
             }\r
-        }\r
+        };\r
     },\r
+    /**\r
+     * Callback for read actions\r
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} res The server response\r
+     * @protected\r
+     */\r
+    onRead : function(action, trans, res) {\r
+        var result;\r
+        try {\r
+            result = trans.reader.readRecords(res);\r
+        }catch(e){\r
+            // @deprecated: fire loadexception\r
+            this.fireEvent("loadexception", this, trans, res, e);\r
 \r
-    // private\r
-    snap : function(value, inc, min){\r
-        if(!inc || !value){\r
-            return value;\r
+            this.fireEvent('exception', this, 'response', action, trans, res, e);\r
+            trans.callback.call(trans.scope||window, null, trans.arg, false);\r
+            return;\r
         }\r
-        var newValue = value;\r
-        var m = value % inc;\r
-        if(m > 0){\r
-            if(m > (inc/2)){\r
-                newValue = value + (inc-m);\r
-            }else{\r
-                newValue = value - m;\r
-            }\r
+        if (result.success === false) {\r
+            // @deprecated: fire old loadexception for backwards-compat.\r
+            this.fireEvent('loadexception', this, trans, res);\r
+\r
+            this.fireEvent('exception', this, 'remote', action, trans, res, null);\r
+        } else {\r
+            this.fireEvent("load", this, res, trans.arg);\r
         }\r
-        return Math.max(min, newValue);\r
+        trans.callback.call(trans.scope||window, result, trans.arg, result.success);\r
     },\r
-\r
     /**\r
-     * <p>Performs resizing of the associated Element. This method is called internally by this\r
-     * class, and should not be called by user code.</p>\r
-     * <p>If a Resizable is being used to resize an Element which encapsulates a more complex UI\r
-     * component such as a Panel, this method may be overridden by specifying an implementation\r
-     * as a config option to provide appropriate behaviour at the end of the resize operation on\r
-     * mouseup, for example resizing the Panel, and relaying the Panel's content.</p>\r
-     * <p>The new area to be resized to is available by examining the state of the {@link #proxy}\r
-     * Element. Example:\r
-<pre><code>\r
-new Ext.Panel({\r
-    title: 'Resize me',\r
-    x: 100,\r
-    y: 100,\r
-    renderTo: Ext.getBody(),\r
-    floating: true,\r
-    frame: true,\r
-    width: 400,\r
-    height: 200,\r
-    listeners: {\r
-        render: function(p) {\r
-            new Ext.Resizable(p.getEl(), {\r
-                handles: 'all',\r
-                pinned: true,\r
-                transparent: true,\r
-                resizeElement: function() {\r
-                    var box = this.proxy.getBox();\r
-                    p.updateBox(box);\r
-                    if (p.layout) {\r
-                        p.doLayout();\r
-                    }\r
-                    return box;\r
-                }\r
-           });\r
-       }\r
-    }\r
-}).show();\r
-</code></pre>\r
+     * Callback for write actions\r
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} res The server response\r
+     * @protected\r
      */\r
-    resizeElement : function(){\r
-        var box = this.proxy.getBox();\r
-        if(this.updateBox){\r
-            this.el.setBox(box, false, this.animate, this.duration, null, this.easing);\r
-        }else{\r
-            this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing);\r
+    onWrite : function(action, trans, response, rs) {\r
+        var reader = trans.reader;\r
+        try {\r
+            // though we already have a response object here in STP, run through readResponse to catch any meta-data exceptions.\r
+            var res = reader.readResponse(action, response);\r
+        } catch (e) {\r
+            this.fireEvent('exception', this, 'response', action, trans, res, e);\r
+            trans.callback.call(trans.scope||window, null, res, false);\r
+            return;\r
         }\r
-        this.updateChildSize();\r
-        if(!this.dynamic){\r
-            this.proxy.hide();\r
+        if(!res.success === true){\r
+            this.fireEvent('exception', this, 'remote', action, trans, res, rs);\r
+            trans.callback.call(trans.scope||window, null, res, false);\r
+            return;\r
         }\r
-        return box;\r
+        this.fireEvent("write", this, action, res.data, res, rs, trans.arg );\r
+        trans.callback.call(trans.scope||window, res.data, res, true);\r
     },\r
 \r
     // private\r
-    constrain : function(v, diff, m, mx){\r
-        if(v - diff < m){\r
-            diff = v - m;    \r
-        }else if(v - diff > mx){\r
-            diff = v - mx; \r
-        }\r
-        return diff;                \r
+    isLoading : function(){\r
+        return this.trans ? true : false;\r
     },\r
 \r
-    // private\r
-    onMouseMove : function(e){\r
-        if(this.enabled && this.activeHandle){\r
-            try{// try catch so if something goes wrong the user doesn't get hung\r
-\r
-            if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) {\r
-                return;\r
-            }\r
-\r
-            //var curXY = this.startPoint;\r
-            var curSize = this.curSize || this.startBox,\r
-                x = this.startBox.x, y = this.startBox.y,\r
-                ox = x, \r
-                oy = y,\r
-                w = curSize.width, \r
-                h = curSize.height,\r
-                ow = w, \r
-                oh = h,\r
-                mw = this.minWidth, \r
-                mh = this.minHeight,\r
-                mxw = this.maxWidth, \r
-                mxh = this.maxHeight,\r
-                wi = this.widthIncrement,\r
-                hi = this.heightIncrement,\r
-                eventXY = e.getXY(),\r
-                diffX = -(this.startPoint[0] - Math.max(this.minX, eventXY[0])),\r
-                diffY = -(this.startPoint[1] - Math.max(this.minY, eventXY[1])),\r
-                pos = this.activeHandle.position,\r
-                tw,\r
-                th;\r
-            \r
-            switch(pos){\r
-                case 'east':\r
-                    w += diffX; \r
-                    w = Math.min(Math.max(mw, w), mxw);\r
-                    break;\r
-                case 'south':\r
-                    h += diffY;\r
-                    h = Math.min(Math.max(mh, h), mxh);\r
-                    break;\r
-                case 'southeast':\r
-                    w += diffX; \r
-                    h += diffY;\r
-                    w = Math.min(Math.max(mw, w), mxw);\r
-                    h = Math.min(Math.max(mh, h), mxh);\r
-                    break;\r
-                case 'north':\r
-                    diffY = this.constrain(h, diffY, mh, mxh);\r
-                    y += diffY;\r
-                    h -= diffY;\r
-                    break;\r
-                case 'west':\r
-                    diffX = this.constrain(w, diffX, mw, mxw);\r
-                    x += diffX;\r
-                    w -= diffX;\r
-                    break;\r
-                case 'northeast':\r
-                    w += diffX; \r
-                    w = Math.min(Math.max(mw, w), mxw);\r
-                    diffY = this.constrain(h, diffY, mh, mxh);\r
-                    y += diffY;\r
-                    h -= diffY;\r
-                    break;\r
-                case 'northwest':\r
-                    diffX = this.constrain(w, diffX, mw, mxw);\r
-                    diffY = this.constrain(h, diffY, mh, mxh);\r
-                    y += diffY;\r
-                    h -= diffY;\r
-                    x += diffX;\r
-                    w -= diffX;\r
-                    break;\r
-               case 'southwest':\r
-                    diffX = this.constrain(w, diffX, mw, mxw);\r
-                    h += diffY;\r
-                    h = Math.min(Math.max(mh, h), mxh);\r
-                    x += diffX;\r
-                    w -= diffX;\r
-                    break;\r
-            }\r
-            \r
-            var sw = this.snap(w, wi, mw);\r
-            var sh = this.snap(h, hi, mh);\r
-            if(sw != w || sh != h){\r
-                switch(pos){\r
-                    case 'northeast':\r
-                        y -= sh - h;\r
-                    break;\r
-                    case 'north':\r
-                        y -= sh - h;\r
-                        break;\r
-                    case 'southwest':\r
-                        x -= sw - w;\r
-                    break;\r
-                    case 'west':\r
-                        x -= sw - w;\r
-                        break;\r
-                    case 'northwest':\r
-                        x -= sw - w;\r
-                        y -= sh - h;\r
-                    break;\r
-                }\r
-                w = sw;\r
-                h = sh;\r
-            }\r
-            \r
-            if(this.preserveRatio){\r
-                switch(pos){\r
-                    case 'southeast':\r
-                    case 'east':\r
-                        h = oh * (w/ow);\r
-                        h = Math.min(Math.max(mh, h), mxh);\r
-                        w = ow * (h/oh);\r
-                       break;\r
-                    case 'south':\r
-                        w = ow * (h/oh);\r
-                        w = Math.min(Math.max(mw, w), mxw);\r
-                        h = oh * (w/ow);\r
-                        break;\r
-                    case 'northeast':\r
-                        w = ow * (h/oh);\r
-                        w = Math.min(Math.max(mw, w), mxw);\r
-                        h = oh * (w/ow);\r
-                    break;\r
-                    case 'north':\r
-                        tw = w;\r
-                        w = ow * (h/oh);\r
-                        w = Math.min(Math.max(mw, w), mxw);\r
-                        h = oh * (w/ow);\r
-                        x += (tw - w) / 2;\r
-                        break;\r
-                    case 'southwest':\r
-                        h = oh * (w/ow);\r
-                        h = Math.min(Math.max(mh, h), mxh);\r
-                        tw = w;\r
-                        w = ow * (h/oh);\r
-                        x += tw - w;\r
-                        break;\r
-                    case 'west':\r
-                        th = h;\r
-                        h = oh * (w/ow);\r
-                        h = Math.min(Math.max(mh, h), mxh);\r
-                        y += (th - h) / 2;\r
-                        tw = w;\r
-                        w = ow * (h/oh);\r
-                        x += tw - w;\r
-                       break;\r
-                    case 'northwest':\r
-                        tw = w;\r
-                        th = h;\r
-                        h = oh * (w/ow);\r
-                        h = Math.min(Math.max(mh, h), mxh);\r
-                        w = ow * (h/oh);\r
-                        y += th - h;\r
-                        x += tw - w;\r
-                        break;\r
-                        \r
-                }\r
-            }\r
-            this.proxy.setBounds(x, y, w, h);\r
-            if(this.dynamic){\r
-                this.resizeElement();\r
-            }\r
-            }catch(ex){}\r
+    /**\r
+     * Abort the current server request.\r
+     */\r
+    abort : function(){\r
+        if(this.isLoading()){\r
+            this.destroyTrans(this.trans);\r
         }\r
     },\r
 \r
     // private\r
-    handleOver : function(){\r
-        if(this.enabled){\r
-            this.el.addClass('x-resizable-over');\r
+    destroyTrans : function(trans, isLoaded){\r
+        this.head.removeChild(document.getElementById(trans.scriptId));\r
+        clearTimeout(trans.timeoutId);\r
+        if(isLoaded){\r
+            window[trans.cb] = undefined;\r
+            try{\r
+                delete window[trans.cb];\r
+            }catch(e){}\r
+        }else{\r
+            // if hasn't been loaded, wait for load to remove it to prevent script error\r
+            window[trans.cb] = function(){\r
+                window[trans.cb] = undefined;\r
+                try{\r
+                    delete window[trans.cb];\r
+                }catch(e){}\r
+            };\r
         }\r
     },\r
 \r
     // private\r
-    handleOut : function(){\r
-        if(!this.resizing){\r
-            this.el.removeClass('x-resizable-over');\r
+    handleFailure : function(trans){\r
+        this.trans = false;\r
+        this.destroyTrans(trans, false);\r
+        if (trans.action === Ext.data.Api.actions.read) {\r
+            // @deprecated firing loadexception\r
+            this.fireEvent("loadexception", this, null, trans.arg);\r
         }\r
+\r
+        this.fireEvent('exception', this, 'response', trans.action, {\r
+            response: null,\r
+            options: trans.arg\r
+        });\r
+        trans.callback.call(trans.scope||window, null, trans.arg, false);\r
     },\r
-    \r
+\r
+    // inherit docs\r
+    destroy: function(){\r
+        this.abort();\r
+        Ext.data.ScriptTagProxy.superclass.destroy.call(this);\r
+    }\r
+});/**\r
+ * @class Ext.data.HttpProxy\r
+ * @extends Ext.data.DataProxy\r
+ * <p>An implementation of {@link Ext.data.DataProxy} that processes data requests within the same\r
+ * domain of the originating page.</p>\r
+ * <p><b>Note</b>: this class cannot be used to retrieve data from a domain other\r
+ * than the domain from which the running page was served. For cross-domain requests, use a\r
+ * {@link Ext.data.ScriptTagProxy ScriptTagProxy}.</p>\r
+ * <p>Be aware that to enable the browser to parse an XML document, the server must set\r
+ * the Content-Type header in the HTTP response to "<tt>text/xml</tt>".</p>\r
+ * @constructor\r
+ * @param {Object} conn\r
+ * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.\r
+ * <p>Note that if this HttpProxy is being used by a {@link Ext.data.Store Store}, then the\r
+ * Store's call to {@link #load} will override any specified <tt>callback</tt> and <tt>params</tt>\r
+ * options. In this case, use the Store's {@link Ext.data.Store#events events} to modify parameters,\r
+ * or react to loading events. The Store's {@link Ext.data.Store#baseParams baseParams} may also be\r
+ * used to pass parameters known at instantiation time.</p>\r
+ * <p>If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make\r
+ * the request.</p>\r
+ */\r
+Ext.data.HttpProxy = function(conn){\r
+    Ext.data.HttpProxy.superclass.constructor.call(this, conn);\r
+\r
     /**\r
-     * Returns the element this component is bound to.\r
-     * @return {Ext.Element}\r
+     * The Connection object (Or options parameter to {@link Ext.Ajax#request}) which this HttpProxy\r
+     * uses to make requests to the server. Properties of this object may be changed dynamically to\r
+     * change the way data is requested.\r
+     * @property\r
      */\r
-    getEl : function(){\r
-        return this.el;\r
-    },\r
-    \r
+    this.conn = conn;\r
+\r
+    // nullify the connection url.  The url param has been copied to 'this' above.  The connection\r
+    // url will be set during each execution of doRequest when buildUrl is called.  This makes it easier for users to override the\r
+    // connection url during beforeaction events (ie: beforeload, beforewrite, etc).\r
+    // Url is always re-defined during doRequest.\r
+    this.conn.url = null;\r
+\r
+    this.useAjax = !conn || !conn.events;\r
+\r
+    // A hash containing active requests, keyed on action [Ext.data.Api.actions.create|read|update|destroy]\r
+    var actions = Ext.data.Api.actions;\r
+    this.activeRequest = {};\r
+    for (var verb in actions) {\r
+        this.activeRequest[actions[verb]] = undefined;\r
+    }\r
+};\r
+\r
+Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {\r
     /**\r
-     * Returns the resizeChild element (or null).\r
-     * @return {Ext.Element}\r
+     * Return the {@link Ext.data.Connection} object being used by this Proxy.\r
+     * @return {Connection} The Connection object. This object may be used to subscribe to events on\r
+     * a finer-grained basis than the DataProxy events.\r
      */\r
-    getResizeChild : function(){\r
-        return this.resizeChild;\r
+    getConnection : function() {\r
+        return this.useAjax ? Ext.Ajax : this.conn;\r
     },\r
-    \r
+\r
     /**\r
-     * Destroys this resizable. If the element was wrapped and \r
-     * removeEl is not true then the element remains.\r
-     * @param {Boolean} removeEl (optional) true to remove the element from the DOM\r
+     * Used for overriding the url used for a single request.  Designed to be called during a beforeaction event.  Calling setUrl\r
+     * will override any urls set via the api configuration parameter.  Set the optional parameter makePermanent to set the url for\r
+     * all subsequent requests.  If not set to makePermanent, the next request will use the same url or api configuration defined\r
+     * in the initial proxy configuration.\r
+     * @param {String} url\r
+     * @param {Boolean} makePermanent (Optional) [false]\r
+     *\r
+     * (e.g.: beforeload, beforesave, etc).\r
      */\r
-    destroy : function(removeEl){\r
-        Ext.destroy(this.dd, this.overlay, this.proxy);\r
-        this.overlay = null;\r
-        this.proxy = null;\r
-        \r
-        var ps = Ext.Resizable.positions;\r
-        for(var k in ps){\r
-            if(typeof ps[k] != 'function' && this[ps[k]]){\r
-                this[ps[k]].destroy();\r
-            }\r
-        }\r
-        if(removeEl){\r
-            this.el.update('');\r
-            Ext.destroy(this.el);\r
-            this.el = null;\r
+    setUrl : function(url, makePermanent) {\r
+        this.conn.url = url;\r
+        if (makePermanent === true) {\r
+            this.url = url;\r
+            this.api = null;\r
+            Ext.data.Api.prepare(this);\r
         }\r
-        this.purgeListeners();\r
     },\r
 \r
-    syncHandleHeight : function(){\r
-        var h = this.el.getHeight(true);\r
-        if(this.west){\r
-            this.west.el.setHeight(h);\r
-        }\r
-        if(this.east){\r
-            this.east.el.setHeight(h);\r
+    /**\r
+     * HttpProxy implementation of DataProxy#doRequest\r
+     * @param {String} action The crud action type (create, read, update, destroy)\r
+     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null\r
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
+     * for the request to the remote server.\r
+     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
+     * object into a block of Ext.data.Records.\r
+     * @param {Function} callback\r
+     * <div class="sub-desc"><p>A function to be called after the request.\r
+     * The <tt>callback</tt> is passed the following arguments:<ul>\r
+     * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>\r
+     * <li><tt>options</tt>: Options object from the action request</li>\r
+     * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
+     * @protected\r
+     */\r
+    doRequest : function(action, rs, params, reader, cb, scope, arg) {\r
+        var  o = {\r
+            method: (this.api[action]) ? this.api[action]['method'] : undefined,\r
+            request: {\r
+                callback : cb,\r
+                scope : scope,\r
+                arg : arg\r
+            },\r
+            reader: reader,\r
+            callback : this.createCallback(action, rs),\r
+            scope: this\r
+        };\r
+\r
+        // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.).\r
+        // Use std HTTP params otherwise.\r
+        if (params.jsonData) {\r
+            o.jsonData = params.jsonData;\r
+        } else if (params.xmlData) {\r
+            o.xmlData = params.xmlData;\r
+        } else {\r
+            o.params = params || {};\r
         }\r
-    }\r
-});\r
+        // Set the connection url.  If this.conn.url is not null here,\r
+        // the user must have overridden the url during a beforewrite/beforeload event-handler.\r
+        // this.conn.url is nullified after each request.\r
+        this.conn.url = this.buildUrl(action, rs);\r
 \r
-// private\r
-// hash to map config positions to true positions\r
-Ext.Resizable.positions = {\r
-    n: 'north', s: 'south', e: 'east', w: 'west', se: 'southeast', sw: 'southwest', nw: 'northwest', ne: 'northeast'\r
-};\r
+        if(this.useAjax){\r
 \r
-// private\r
-Ext.Resizable.Handle = function(rz, pos, disableTrackOver, transparent){\r
-    if(!this.tpl){\r
-        // only initialize the template if resizable is used\r
-        var tpl = Ext.DomHelper.createTemplate(\r
-            {tag: 'div', cls: 'x-resizable-handle x-resizable-handle-{0}'}\r
-        );\r
-        tpl.compile();\r
-        Ext.Resizable.Handle.prototype.tpl = tpl;\r
-    }\r
-    this.position = pos;\r
-    this.rz = rz;\r
-    this.el = this.tpl.append(rz.el.dom, [this.position], true);\r
-    this.el.unselectable();\r
-    if(transparent){\r
-        this.el.setOpacity(0);\r
-    }\r
-    this.el.on('mousedown', this.onMouseDown, this);\r
-    if(!disableTrackOver){\r
-        this.el.on({\r
-            scope: this,\r
-            mouseover: this.onMouseOver,\r
-            mouseout: this.onMouseOut\r
-        });\r
-    }\r
-};\r
+            Ext.applyIf(o, this.conn);\r
 \r
-// private\r
-Ext.Resizable.Handle.prototype = {\r
-    // private\r
-    afterResize : function(rz){\r
-        // do nothing    \r
-    },\r
-    // private\r
-    onMouseDown : function(e){\r
-        this.rz.onMouseDown(this, e);\r
-    },\r
-    // private\r
-    onMouseOver : function(e){\r
-        this.rz.handleOver(this, e);\r
+            // If a currently running request is found for this action, abort it.\r
+            if (this.activeRequest[action]) {\r
+                ////\r
+                // Disabled aborting activeRequest while implementing REST.  activeRequest[action] will have to become an array\r
+                // TODO ideas anyone?\r
+                //\r
+                //Ext.Ajax.abort(this.activeRequest[action]);\r
+            }\r
+            this.activeRequest[action] = Ext.Ajax.request(o);\r
+        }else{\r
+            this.conn.request(o);\r
+        }\r
+        // request is sent, nullify the connection url in preparation for the next request\r
+        this.conn.url = null;\r
     },\r
-    // private\r
-    onMouseOut : function(e){\r
-        this.rz.handleOut(this, e);\r
+\r
+    /**\r
+     * Returns a callback function for a request.  Note a special case is made for the\r
+     * read action vs all the others.\r
+     * @param {String} action [create|update|delete|load]\r
+     * @param {Ext.data.Record[]} rs The Store-recordset being acted upon\r
+     * @private\r
+     */\r
+    createCallback : function(action, rs) {\r
+        return function(o, success, response) {\r
+            this.activeRequest[action] = undefined;\r
+            if (!success) {\r
+                if (action === Ext.data.Api.actions.read) {\r
+                    // @deprecated: fire loadexception for backwards compat.\r
+                    // TODO remove in 3.1\r
+                    this.fireEvent('loadexception', this, o, response);\r
+                }\r
+                this.fireEvent('exception', this, 'response', action, o, response);\r
+                o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
+                return;\r
+            }\r
+            if (action === Ext.data.Api.actions.read) {\r
+                this.onRead(action, o, response);\r
+            } else {\r
+                this.onWrite(action, o, response, rs);\r
+            }\r
+        };\r
     },\r
-    // private\r
-    destroy : function(){\r
-        Ext.destroy(this.el);\r
-        this.el = null;\r
-    }\r
-};\r
-/**
- * @class Ext.Window
- * @extends Ext.Panel
- * <p>A specialized panel intended for use as an application window.  Windows are floated, {@link #resizable}, and
- * {@link #draggable} by default.  Windows can be {@link #maximizable maximized} to fill the viewport,
- * restored to their prior size, and can be {@link #minimize}d.</p>
- * <p>Windows can also be linked to a {@link Ext.WindowGroup} or managed by the {@link Ext.WindowMgr} to provide 
- * grouping, activation, to front, to back and other application-specific behavior.</p>
- * <p>By default, Windows will be rendered to document.body. To {@link #constrain} a Window to another element
- * specify {@link Ext.Component#renderTo renderTo}.</p>
- * <p><b>Note:</b> By default, the <code>{@link #closable close}</code> header tool <i>destroys</i> the Window resulting in
- * destruction of any child Components. This makes the Window object, and all its descendants <b>unusable</b>. To enable
- * re-use of a Window, use <b><code>{@link #closeAction closeAction: 'hide'}</code></b>.</p>
- * @constructor
- * @param {Object} config The config object
- * @xtype window
- */
-Ext.Window = Ext.extend(Ext.Panel, {
-    /**
-     * @cfg {Number} x
-     * The X position of the left edge of the window on initial showing. Defaults to centering the Window within
-     * the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
-     */
-    /**
-     * @cfg {Number} y
-     * The Y position of the top edge of the window on initial showing. Defaults to centering the Window within
-     * the height of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
-     */
-    /**
-     * @cfg {Boolean} modal
-     * True to make the window modal and mask everything behind it when displayed, false to display it without
-     * restricting access to other UI elements (defaults to false).
-     */
-    /**
-     * @cfg {String/Element} animateTarget
-     * Id or element from which the window should animate while opening (defaults to null with no animation).
-     */
-    /**
-     * @cfg {String} resizeHandles
-     * A valid {@link Ext.Resizable} handles config string (defaults to 'all').  Only applies when resizable = true.
-     */
-    /**
-     * @cfg {Ext.WindowGroup} manager
-     * A reference to the WindowGroup that should manage this window (defaults to {@link Ext.WindowMgr}).
-     */
-    /**
-    * @cfg {String/Number/Button} defaultButton
-    * The id / index of a button or a button instance to focus when this window received the focus.
-    */
-    /**
-    * @cfg {Function} onEsc
-    * Allows override of the built-in processing for the escape key. Default action
-    * is to close the Window (performing whatever action is specified in {@link #closeAction}.
-    * To prevent the Window closing when the escape key is pressed, specify this as
-    * Ext.emptyFn (See {@link Ext#emptyFn}).
-    */
-    /**
-     * @cfg {Boolean} collapsed
-     * True to render the window collapsed, false to render it expanded (defaults to false). Note that if 
-     * {@link #expandOnShow} is true (the default) it will override the <tt>collapsed</tt> config and the window 
-     * will always be expanded when shown.
-     */
-    /**
-     * @cfg {Boolean} maximized
-     * True to initially display the window in a maximized state. (Defaults to false).
-     */
-    
-    /**
-    * @cfg {String} baseCls
-    * The base CSS class to apply to this panel's element (defaults to 'x-window').
-    */
-    baseCls : 'x-window',
-    /**
-     * @cfg {Boolean} resizable
-     * True to allow user resizing at each edge and corner of the window, false to disable resizing (defaults to true).
-     */
-    resizable : true,
-    /**
-     * @cfg {Boolean} draggable
-     * True to allow the window to be dragged by the header bar, false to disable dragging (defaults to true).  Note
-     * that by default the window will be centered in the viewport, so if dragging is disabled the window may need
-     * to be positioned programmatically after render (e.g., myWindow.setPosition(100, 100);).
-     */
-    draggable : true,
-    /**
-     * @cfg {Boolean} closable
-     * <p>True to display the 'close' tool button and allow the user to close the window, false to
-     * hide the button and disallow closing the window (defaults to true).</p>
-     * <p>By default, when close is requested by either clicking the close button in the header
-     * or pressing ESC when the Window has focus, the {@link #close} method will be called. This
-     * will <i>{@link Ext.Component#destroy destroy}</i> the Window and its content meaning that
-     * it may not be reused.</p>
-     * <p>To make closing a Window <i>hide</i> the Window so that it may be reused, set
-     * {@link #closeAction} to 'hide'.
-     */
-    closable : true,
-    /**
-     * @cfg {String} closeAction
-     * <p>The action to take when the close header tool is clicked:
-     * <div class="mdetail-params"><ul>
-     * <li><b><code>'{@link #close}'</code></b> : <b>Default</b><div class="sub-desc">
-     * {@link #close remove} the window from the DOM and {@link Ext.Component#destroy destroy}
-     * it and all descendant Components. The window will <b>not</b> be available to be
-     * redisplayed via the {@link #show} method.
-     * </div></li>
-     * <li><b><code>'{@link #hide}'</code></b> : <div class="sub-desc">
-     * {@link #hide} the window by setting visibility to hidden and applying negative offsets.
-     * The window will be available to be redisplayed via the {@link #show} method.
-     * </div></li>
-     * </ul></div>
-     * <p><b>Note:</b> This setting does not affect the {@link #close} method
-     * which will always {@link Ext.Component#destroy destroy} the window. To
-     * programatically <i>hide</i> a window, call {@link #hide}.</p>
-     */
-    closeAction : 'close',
-    /**
-     * @cfg {Boolean} constrain
-     * True to constrain the window within its containing element, false to allow it to fall outside of its
-     * containing element. By default the window will be rendered to document.body.  To render and constrain the 
-     * window within another element specify {@link #renderTo}.
-     * (defaults to false).  Optionally the header only can be constrained using {@link #constrainHeader}.
-     */
-    constrain : false,
-    /**
-     * @cfg {Boolean} constrainHeader
-     * True to constrain the window header within its containing element (allowing the window body to fall outside 
-     * of its containing element) or false to allow the header to fall outside its containing element (defaults to 
-     * false). Optionally the entire window can be constrained using {@link #constrain}.
-     */
-    constrainHeader : false,
-    /**
-     * @cfg {Boolean} plain
-     * True to render the window body with a transparent background so that it will blend into the framing
-     * elements, false to add a lighter background color to visually highlight the body element and separate it
-     * more distinctly from the surrounding frame (defaults to false).
-     */
-    plain : false,
-    /**
-     * @cfg {Boolean} minimizable
-     * True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button
-     * and disallow minimizing the window (defaults to false).  Note that this button provides no implementation --
-     * the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a
-     * custom minimize behavior implemented for this option to be useful.
-     */
-    minimizable : false,
-    /**
-     * @cfg {Boolean} maximizable
-     * True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button
-     * and disallow maximizing the window (defaults to false).  Note that when a window is maximized, the tool button
-     * will automatically change to a 'restore' button with the appropriate behavior already built-in that will
-     * restore the window to its previous size.
-     */
-    maximizable : false,
-    /**
-     * @cfg {Number} minHeight
-     * The minimum height in pixels allowed for this window (defaults to 100).  Only applies when resizable = true.
-     */
-    minHeight : 100,
-    /**
-     * @cfg {Number} minWidth
-     * The minimum width in pixels allowed for this window (defaults to 200).  Only applies when resizable = true.
-     */
-    minWidth : 200,
-    /**
-     * @cfg {Boolean} expandOnShow
-     * True to always expand the window when it is displayed, false to keep it in its current state (which may be
-     * {@link #collapsed}) when displayed (defaults to true).
-     */
-    expandOnShow : true,
-
-    // inherited docs, same default
-    collapsible : false,
-
-    /**
-     * @cfg {Boolean} initHidden
-     * True to hide the window until show() is explicitly called (defaults to true).
-     */
-    initHidden : true,
-    /**
-    * @cfg {Boolean} monitorResize @hide
-    * This is automatically managed based on the value of constrain and constrainToHeader
-    */
-    monitorResize : true,
-
-    // The following configs are set to provide the basic functionality of a window.
-    // Changing them would require additional code to handle correctly and should
-    // usually only be done in subclasses that can provide custom behavior.  Changing them
-    // may have unexpected or undesirable results.
-    /** @cfg {String} elements @hide */
-    elements : 'header,body',
-    /** @cfg {Boolean} frame @hide */
-    frame : true,
-    /** @cfg {Boolean} floating @hide */
-    floating : true,
-
-    // private
-    initComponent : function(){
-        Ext.Window.superclass.initComponent.call(this);
-        this.addEvents(
-            /**
-             * @event activate
-             * Fires after the window has been visually activated via {@link setActive}.
-             * @param {Ext.Window} this
-             */
-            /**
-             * @event deactivate
-             * Fires after the window has been visually deactivated via {@link setActive}.
-             * @param {Ext.Window} this
-             */
-            /**
-             * @event resize
-             * Fires after the window has been resized.
-             * @param {Ext.Window} this
-             * @param {Number} width The window's new width
-             * @param {Number} height The window's new height
-             */
-            'resize',
-            /**
-             * @event maximize
-             * Fires after the window has been maximized.
-             * @param {Ext.Window} this
-             */
-            'maximize',
-            /**
-             * @event minimize
-             * Fires after the window has been minimized.
-             * @param {Ext.Window} this
-             */
-            'minimize',
-            /**
-             * @event restore
-             * Fires after the window has been restored to its original size after being maximized.
-             * @param {Ext.Window} this
-             */
-            'restore'
-        );
-        if(this.initHidden === false){
-            this.show();
-        }else{
-            this.hidden = true;
-        }
-    },
-
-    // private
-    getState : function(){
-        return Ext.apply(Ext.Window.superclass.getState.call(this) || {}, this.getBox(true));
-    },
-
-    // private
-    onRender : function(ct, position){
-        Ext.Window.superclass.onRender.call(this, ct, position);
-
-        if(this.plain){
-            this.el.addClass('x-window-plain');
-        }
-
-        // this element allows the Window to be focused for keyboard events
-        this.focusEl = this.el.createChild({
-                    tag: 'a', href:'#', cls:'x-dlg-focus',
-                    tabIndex:'-1', html: '&#160;'});
-        this.focusEl.swallowEvent('click', true);
-
-        this.proxy = this.el.createProxy('x-window-proxy');
-        this.proxy.enableDisplayMode('block');
-
-        if(this.modal){
-            this.mask = this.container.createChild({cls:'ext-el-mask'}, this.el.dom);
-            this.mask.enableDisplayMode('block');
-            this.mask.hide();
-            this.mon(this.mask, 'click', this.focus, this);
-        }
-        this.initTools();
-    },
-
-    // private
-    initEvents : function(){
-        Ext.Window.superclass.initEvents.call(this);
-        if(this.animateTarget){
-            this.setAnimateTarget(this.animateTarget);
-        }
-
-        if(this.resizable){
-            this.resizer = new Ext.Resizable(this.el, {
-                minWidth: this.minWidth,
-                minHeight:this.minHeight,
-                handles: this.resizeHandles || 'all',
-                pinned: true,
-                resizeElement : this.resizerAction
-            });
-            this.resizer.window = this;
-            this.mon(this.resizer, 'beforeresize', this.beforeResize, this);
-        }
-
-        if(this.draggable){
-            this.header.addClass('x-window-draggable');
-        }
-        this.mon(this.el, 'mousedown', this.toFront, this);
-        this.manager = this.manager || Ext.WindowMgr;
-        this.manager.register(this);
-        if(this.maximized){
-            this.maximized = false;
-            this.maximize();
-        }
-        if(this.closable){
-            var km = this.getKeyMap();
-            km.on(27, this.onEsc, this);
-            km.disable();
-        }
-    },
-
-    initDraggable : function(){
-        /**
-         * If this Window is configured {@link #draggable}, this property will contain
-         * an instance of {@link Ext.dd.DD} which handles dragging the Window's DOM Element.
-         * @type Ext.dd.DD
-         * @property dd
-         */
-        this.dd = new Ext.Window.DD(this);
-    },
-
-   // private
-    onEsc : function(){
-        this[this.closeAction]();
-    },
-
-    // private
-    beforeDestroy : function(){
-        if (this.rendered){
-            this.hide();
-          if(this.doAnchor){
-                Ext.EventManager.removeResizeListener(this.doAnchor, this);
-              Ext.EventManager.un(window, 'scroll', this.doAnchor, this);
-            }
-            Ext.destroy(
-                this.focusEl,
-                this.resizer,
-                this.dd,
-                this.proxy,
-                this.mask
-            );
-        }
-        Ext.Window.superclass.beforeDestroy.call(this);
-    },
-
-    // private
-    onDestroy : function(){
-        if(this.manager){
-            this.manager.unregister(this);
-        }
-        Ext.Window.superclass.onDestroy.call(this);
-    },
-
-    // private
-    initTools : function(){
-        if(this.minimizable){
-            this.addTool({
-                id: 'minimize',
-                handler: this.minimize.createDelegate(this, [])
-            });
-        }
-        if(this.maximizable){
-            this.addTool({
-                id: 'maximize',
-                handler: this.maximize.createDelegate(this, [])
-            });
-            this.addTool({
-                id: 'restore',
-                handler: this.restore.createDelegate(this, []),
-                hidden:true
-            });
-            this.mon(this.header, 'dblclick', this.toggleMaximize, this);
-        }
-        if(this.closable){
-            this.addTool({
-                id: 'close',
-                handler: this[this.closeAction].createDelegate(this, [])
-            });
-        }
-    },
-
-    // private
-    resizerAction : function(){
-        var box = this.proxy.getBox();
-        this.proxy.hide();
-        this.window.handleResize(box);
-        return box;
-    },
-
-    // private
-    beforeResize : function(){
-        this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); // 40 is a magic minimum content size?
-        this.resizer.minWidth = Math.max(this.minWidth, this.getFrameWidth() + 40);
-        this.resizeBox = this.el.getBox();
-    },
-
-    // private
-    updateHandles : function(){
-        if(Ext.isIE && this.resizer){
-            this.resizer.syncHandleHeight();
-            this.el.repaint();
-        }
-    },
-
-    // private
-    handleResize : function(box){
-        var rz = this.resizeBox;
-        if(rz.x != box.x || rz.y != box.y){
-            this.updateBox(box);
-        }else{
-            this.setSize(box);
-        }
-        this.focus();
-        this.updateHandles();
-        this.saveState();
-        this.doLayout();
-        this.fireEvent('resize', this, box.width, box.height);
-    },
-
+\r
+    /**\r
+     * Callback for read action\r
+     * @param {String} action Action name as per {@link Ext.data.Api.actions#read}.\r
+     * @param {Object} o The request transaction object\r
+     * @param {Object} res The server response\r
+     * @fires loadexception (deprecated)\r
+     * @fires exception\r
+     * @fires load\r
+     * @protected\r
+     */\r
+    onRead : function(action, o, response) {\r
+        var result;\r
+        try {\r
+            result = o.reader.read(response);\r
+        }catch(e){\r
+            // @deprecated: fire old loadexception for backwards-compat.\r
+            // TODO remove in 3.1\r
+            this.fireEvent('loadexception', this, o, response, e);\r
+\r
+            this.fireEvent('exception', this, 'response', action, o, response, e);\r
+            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
+            return;\r
+        }\r
+        if (result.success === false) {\r
+            // @deprecated: fire old loadexception for backwards-compat.\r
+            // TODO remove in 3.1\r
+            this.fireEvent('loadexception', this, o, response);\r
+\r
+            // Get DataReader read-back a response-object to pass along to exception event\r
+            var res = o.reader.readResponse(action, response);\r
+            this.fireEvent('exception', this, 'remote', action, o, res, null);\r
+        }\r
+        else {\r
+            this.fireEvent('load', this, o, o.request.arg);\r
+        }\r
+        // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance\r
+        // the calls to request.callback(...) in each will have to be made identical.\r
+        // NOTE reader.readResponse does not currently return Ext.data.Response\r
+        o.request.callback.call(o.request.scope, result, o.request.arg, result.success);\r
+    },\r
+    /**\r
+     * Callback for write actions\r
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} res The server response\r
+     * @fires exception\r
+     * @fires write\r
+     * @protected\r
+     */\r
+    onWrite : function(action, o, response, rs) {\r
+        var reader = o.reader;\r
+        var res;\r
+        try {\r
+            res = reader.readResponse(action, response);\r
+        } catch (e) {\r
+            this.fireEvent('exception', this, 'response', action, o, response, e);\r
+            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
+            return;\r
+        }\r
+        if (res.success === true) {\r
+            this.fireEvent('write', this, action, res.data, res, rs, o.request.arg);\r
+        } else {\r
+            this.fireEvent('exception', this, 'remote', action, o, res, rs);\r
+        }\r
+        // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance\r
+        // the calls to request.callback(...) in each will have to be made similar.\r
+        // NOTE reader.readResponse does not currently return Ext.data.Response\r
+        o.request.callback.call(o.request.scope, res.data, res, res.success);\r
+    },\r
+\r
+    // inherit docs\r
+    destroy: function(){\r
+        if(!this.useAjax){\r
+            this.conn.abort();\r
+        }else if(this.activeRequest){\r
+            var actions = Ext.data.Api.actions;\r
+            for (var verb in actions) {\r
+                if(this.activeRequest[actions[verb]]){\r
+                    Ext.Ajax.abort(this.activeRequest[actions[verb]]);\r
+                }\r
+            }\r
+        }\r
+        Ext.data.HttpProxy.superclass.destroy.call(this);\r
+    }\r
+});/**\r
+ * @class Ext.data.MemoryProxy\r
+ * @extends Ext.data.DataProxy\r
+ * An implementation of Ext.data.DataProxy that simply passes the data specified in its constructor\r
+ * to the Reader when its load method is called.\r
+ * @constructor\r
+ * @param {Object} data The data object which the Reader uses to construct a block of Ext.data.Records.\r
+ */\r
+Ext.data.MemoryProxy = function(data){\r
+    // Must define a dummy api with "read" action to satisfy DataProxy#doRequest and Ext.data.Api#prepare *before* calling super\r
+    var api = {};\r
+    api[Ext.data.Api.actions.read] = true;\r
+    Ext.data.MemoryProxy.superclass.constructor.call(this, {\r
+        api: api\r
+    });\r
+    this.data = data;\r
+};\r
+\r
+Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, {\r
+    /**\r
+     * @event loadexception\r
+     * Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed\r
+     * through {@link Ext.data.Store}, so you can listen for it directly on any Store instance.\r
+     * @param {Object} this\r
+     * @param {Object} arg The callback's arg object passed to the {@link #load} function\r
+     * @param {Object} null This parameter does not apply and will always be null for MemoryProxy\r
+     * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data\r
+     */\r
+\r
+       /**\r
+     * MemoryProxy implementation of DataProxy#doRequest\r
+     * @param {String} action\r
+     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null\r
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
+     * for the request to the remote server.\r
+     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
+     * object into a block of Ext.data.Records.\r
+     * @param {Function} callback The function into which to pass the block of Ext.data.Records.\r
+     * The function must be passed <ul>\r
+     * <li>The Record block object</li>\r
+     * <li>The "arg" argument from the load function</li>\r
+     * <li>A boolean success indicator</li>\r
+     * </ul>\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
+     */\r
+    doRequest : function(action, rs, params, reader, callback, scope, arg) {\r
+        // No implementation for CRUD in MemoryProxy.  Assumes all actions are 'load'\r
+        params = params || {};\r
+        var result;\r
+        try {\r
+            result = reader.readRecords(this.data);\r
+        }catch(e){\r
+            // @deprecated loadexception\r
+            this.fireEvent("loadexception", this, null, arg, e);\r
+\r
+            this.fireEvent('exception', this, 'response', action, arg, null, e);\r
+            callback.call(scope, null, arg, false);\r
+            return;\r
+        }\r
+        callback.call(scope, result, arg, true);\r
+    }\r
+});/**
+ * @class Ext.data.JsonWriter
+ * @extends Ext.data.DataWriter
+ * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action.
+ */
+Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, {
     /**
-     * Focuses the window.  If a defaultButton is set, it will receive focus, otherwise the
-     * window itself will receive focus.
+     * @cfg {Boolean} encode <tt>true</tt> to {@link Ext.util.JSON#encode encode} the
+     * {@link Ext.data.DataWriter#toHash hashed data}. Defaults to <tt>true</tt>.  When using
+     * {@link Ext.data.DirectProxy}, set this to <tt>false</tt> since Ext.Direct.JsonProvider will perform
+     * its own json-encoding.  In addition, if you're using {@link Ext.data.HttpProxy}, setting to <tt>false</tt>
+     * will cause HttpProxy to transmit data using the <b>jsonData</b> configuration-params of {@link Ext.Ajax#request}
+     * instead of <b>params</b>.  When using a {@link Ext.data.Store#restful} Store, some serverside frameworks are
+     * tuned to expect data through the jsonData mechanism.  In those cases, one will want to set <b>encode: <tt>false</tt></b>, as in
+     * let the lower-level connection object (eg: Ext.Ajax) do the encoding.
      */
-    focus : function(){
-        var f = this.focusEl, db = this.defaultButton, t = typeof db;
-        if(t != 'undefined'){
-            if(t == 'number' && this.fbar){
-                f = this.fbar.items.get(db);
-            }else if(t == 'string'){
-                f = Ext.getCmp(db);
-            }else{
-                f = db;
-            }
-        }
-        f = f || this.focusEl;
-        f.focus.defer(10, f);
-    },
-
+    encode : true,
     /**
-     * Sets the target element from which the window should animate while opening.
-     * @param {String/Element} el The target element or id
+     * @cfg {Boolean} encodeDelete False to send only the id to the server on delete, true to encode it in an object
+     * literal, eg: <pre><code>
+{id: 1}
+ * </code></pre> Defaults to <tt>false</tt>
      */
-    setAnimateTarget : function(el){
-        el = Ext.get(el);
-        this.animateTarget = el;
+    encodeDelete: false,
+    
+    constructor : function(config){
+        Ext.data.JsonWriter.superclass.constructor.call(this, config);    
     },
 
-    // private
-    beforeShow : function(){
-        delete this.el.lastXY;
-        delete this.el.lastLT;
-        if(this.x === undefined || this.y === undefined){
-            var xy = this.el.getAlignToXY(this.container, 'c-c');
-            var pos = this.el.translatePoints(xy[0], xy[1]);
-            this.x = this.x === undefined? pos.left : this.x;
-            this.y = this.y === undefined? pos.top : this.y;
-        }
-        this.el.setLeftTop(this.x, this.y);
-
-        if(this.expandOnShow){
-            this.expand(false);
-        }
-
-        if(this.modal){
-            Ext.getBody().addClass('x-body-masked');
-            this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
-            this.mask.show();
+    /**
+     * Final action of a write event.  Apply the written data-object to params.
+     * @param {Object} http params-object to write-to.
+     * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}.  The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}.
+     * @param {Object/Object[]} data Data-object representing compiled Store-recordset.
+     */
+    render : function(params, baseParams, data) {
+        if (this.encode === true) {
+            // Encode here now.
+            Ext.apply(params, baseParams);
+            params[this.meta.root] = Ext.encode(data);
+        } else {
+            // defer encoding for some other layer, probably in {@link Ext.Ajax#request}.  Place everything into "jsonData" key.
+            var jdata = Ext.apply({}, baseParams);
+            jdata[this.meta.root] = data;
+            params.jsonData = jdata;
         }
     },
-
     /**
-     * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden.
-     * @param {String/Element} animateTarget (optional) The target element or id from which the window should
-     * animate while opening (defaults to null with no animation)
-     * @param {Function} callback (optional) A callback function to call after the window is displayed
-     * @param {Object} scope (optional) The scope in which to execute the callback
-     * @return {Ext.Window} this
+     * Implements abstract Ext.data.DataWriter#createRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Object}
      */
-    show : function(animateTarget, cb, scope){
-        if(!this.rendered){
-            this.render(Ext.getBody());
-        }
-        if(this.hidden === false){
-            this.toFront();
-            return this;
-        }
-        if(this.fireEvent('beforeshow', this) === false){
-            return this;
-        }
-        if(cb){
-            this.on('show', cb, scope, {single:true});
-        }
-        this.hidden = false;
-        if(animateTarget !== undefined){
-            this.setAnimateTarget(animateTarget);
-        }
-        this.beforeShow();
-        if(this.animateTarget){
-            this.animShow();
-        }else{
-            this.afterShow();
-        }
-        return this;
-    },
-
-    // private
-    afterShow : function(isAnim){
-        this.proxy.hide();
-        this.el.setStyle('display', 'block');
-        this.el.show();
-        if(this.maximized){
-            this.fitContainer();
-        }
-        if(Ext.isMac && Ext.isGecko){ // work around stupid FF 2.0/Mac scroll bar bug
-            this.cascade(this.setAutoScroll);
-        }
-
-        if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
-            Ext.EventManager.onWindowResize(this.onWindowResize, this);
-        }
-        this.doConstrain();
-        this.doLayout();
-        if(this.keyMap){
-            this.keyMap.enable();
-        }
-        this.toFront();
-        this.updateHandles();
-        if(isAnim && (Ext.isIE || Ext.isWebKit)){
-            var sz = this.getSize();
-            this.onResize(sz.width, sz.height);
-        }
-        this.fireEvent('show', this);
+    createRecord : function(rec) {
+       return this.toHash(rec);
     },
+    /**
+     * Implements abstract Ext.data.DataWriter#updateRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Object}
+     */
+    updateRecord : function(rec) {
+        return this.toHash(rec);
 
-    // private
-    animShow : function(){
-        this.proxy.show();
-        this.proxy.setBox(this.animateTarget.getBox());
-        this.proxy.setOpacity(0);
-        var b = this.getBox(false);
-        b.callback = this.afterShow.createDelegate(this, [true], false);
-        b.scope = this;
-        b.duration = 0.25;
-        b.easing = 'easeNone';
-        b.opacity = 0.5;
-        b.block = true;
-        this.el.setStyle('display', 'none');
-        this.proxy.shift(b);
     },
-
     /**
-     * Hides the window, setting it to invisible and applying negative offsets.
-     * @param {String/Element} animateTarget (optional) The target element or id to which the window should
-     * animate while hiding (defaults to null with no animation)
-     * @param {Function} callback (optional) A callback function to call after the window is hidden
-     * @param {Object} scope (optional) The scope in which to execute the callback
-     * @return {Ext.Window} this
+     * Implements abstract Ext.data.DataWriter#destroyRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Object}
      */
-    hide : function(animateTarget, cb, scope){
-        if(this.hidden || this.fireEvent('beforehide', this) === false){
-            return this;
-        }
-        if(cb){
-            this.on('hide', cb, scope, {single:true});
-        }
-        this.hidden = true;
-        if(animateTarget !== undefined){
-            this.setAnimateTarget(animateTarget);
-        }
-        if(this.modal){
-            this.mask.hide();
-            Ext.getBody().removeClass('x-body-masked');
-        }
-        if(this.animateTarget){
-            this.animHide();
+    destroyRecord : function(rec){
+        if(this.encodeDelete){
+            var data = {};
+            data[this.meta.idProperty] = rec.id;
+            return data;
         }else{
-            this.el.hide();
-            this.afterHide();
-        }
-        return this;
-    },
-
-    // private
-    afterHide : function(){
-        this.proxy.hide();
-        if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
-            Ext.EventManager.removeResizeListener(this.onWindowResize, this);
-        }
-        if(this.keyMap){
-            this.keyMap.disable();
-        }
-        this.fireEvent('hide', this);
-    },
-
-    // private
-    animHide : function(){
-        this.proxy.setOpacity(0.5);
-        this.proxy.show();
-        var tb = this.getBox(false);
-        this.proxy.setBox(tb);
-        this.el.hide();
-        var b = this.animateTarget.getBox();
-        b.callback = this.afterHide;
-        b.scope = this;
-        b.duration = 0.25;
-        b.easing = 'easeNone';
-        b.block = true;
-        b.opacity = 0;
-        this.proxy.shift(b);
-    },
-
-    // private
-    onWindowResize : function(){
-        if(this.maximized){
-            this.fitContainer();
-        }
-        if(this.modal){
-            this.mask.setSize('100%', '100%');
-            var force = this.mask.dom.offsetHeight;
-            this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
-        }
-        this.doConstrain();
-    },
-
-    // private
-    doConstrain : function(){
-        if(this.constrain || this.constrainHeader){
-            var offsets;
-            if(this.constrain){
-                offsets = {
-                    right:this.el.shadowOffset,
-                    left:this.el.shadowOffset,
-                    bottom:this.el.shadowOffset
-                };
-            }else {
-                var s = this.getSize();
-                offsets = {
-                    right:-(s.width - 100),
-                    bottom:-(s.height - 25)
-                };
-            }
-
-            var xy = this.el.getConstrainToXY(this.container, true, offsets);
-            if(xy){
-                this.setPosition(xy[0], xy[1]);
-            }
-        }
-    },
-
-    // private - used for dragging
-    ghost : function(cls){
-        var ghost = this.createGhost(cls);
-        var box = this.getBox(true);
-        ghost.setLeftTop(box.x, box.y);
-        ghost.setWidth(box.width);
-        this.el.hide();
-        this.activeGhost = ghost;
-        return ghost;
-    },
-
-    // private
-    unghost : function(show, matchPosition){
-        if(!this.activeGhost) {
-            return;
-        }
-        if(show !== false){
-            this.el.show();
-            this.focus();
-            if(Ext.isMac && Ext.isGecko){ // work around stupid FF 2.0/Mac scroll bar bug
-                this.cascade(this.setAutoScroll);
-            }
-        }
-        if(matchPosition !== false){
-            this.setPosition(this.activeGhost.getLeft(true), this.activeGhost.getTop(true));
+            return rec.id;
         }
-        this.activeGhost.hide();
-        this.activeGhost.remove();
-        delete this.activeGhost;
-    },
-
+    }
+});/**
+ * @class Ext.data.JsonReader
+ * @extends Ext.data.DataReader
+ * <p>Data reader class to create an Array of {@link Ext.data.Record} objects
+ * from a JSON packet based on mappings in a provided {@link Ext.data.Record}
+ * constructor.</p>
+ * <p>Example code:</p>
+ * <pre><code>
+var myReader = new Ext.data.JsonReader({
+    // metadata configuration options:
+    {@link #idProperty}: 'id'
+    {@link #root}: 'rows',
+    {@link #totalProperty}: 'results',
+    {@link Ext.data.DataReader#messageProperty}: "msg"  // The element within the response that provides a user-feedback message (optional)
+
+    // the fields config option will internally create an {@link Ext.data.Record}
+    // constructor that provides mapping for reading the record data objects
+    {@link Ext.data.DataReader#fields fields}: [
+        // map Record&#39;s 'firstname' field to data object&#39;s key of same name
+        {name: 'name'},
+        // map Record&#39;s 'job' field to data object&#39;s 'occupation' key
+        {name: 'job', mapping: 'occupation'}
+    ]
+});
+</code></pre>
+ * <p>This would consume a JSON data object of the form:</p><pre><code>
+{
+    results: 2000, // Reader&#39;s configured {@link #totalProperty}
+    rows: [        // Reader&#39;s configured {@link #root}
+        // record data objects:
+        { {@link #idProperty id}: 1, firstname: 'Bill', occupation: 'Gardener' },
+        { {@link #idProperty id}: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
+        ...
+    ]
+}
+</code></pre>
+ * <p><b><u>Automatic configuration using metaData</u></b></p>
+ * <p>It is possible to change a JsonReader's metadata at any time by including
+ * a <b><tt>metaData</tt></b> property in the JSON data object. If the JSON data
+ * object has a <b><tt>metaData</tt></b> property, a {@link Ext.data.Store Store}
+ * object using this Reader will reconfigure itself to use the newly provided
+ * field definition and fire its {@link Ext.data.Store#metachange metachange}
+ * event. The metachange event handler may interrogate the <b><tt>metaData</tt></b>
+ * property to perform any configuration required.</p>
+ * <p>Note that reconfiguring a Store potentially invalidates objects which may
+ * refer to Fields or Records which no longer exist.</p>
+ * <p>To use this facility you would create the JsonReader like this:</p><pre><code>
+var myReader = new Ext.data.JsonReader();
+</code></pre>
+ * <p>The first data packet from the server would configure the reader by
+ * containing a <b><tt>metaData</tt></b> property <b>and</b> the data. For
+ * example, the JSON data object might take the form:</p><pre><code>
+{
+    metaData: {
+        "{@link #idProperty}": "id",
+        "{@link #root}": "rows",
+        "{@link #totalProperty}": "results"
+        "{@link #successProperty}": "success",
+        "{@link Ext.data.DataReader#fields fields}": [
+            {"name": "name"},
+            {"name": "job", "mapping": "occupation"}
+        ],
+        // used by store to set its sortInfo
+        "sortInfo":{
+           "field": "name",
+           "direction": "ASC"
+        },
+        // {@link Ext.PagingToolbar paging data} (if applicable)
+        "start": 0,
+        "limit": 2,
+        // custom property
+        "foo": "bar"
+    },
+    // Reader&#39;s configured {@link #successProperty}
+    "success": true,
+    // Reader&#39;s configured {@link #totalProperty}
+    "results": 2000,
+    // Reader&#39;s configured {@link #root}
+    // (this data simulates 2 results {@link Ext.PagingToolbar per page})
+    "rows": [ // <b>*Note:</b> this must be an Array
+        { "id": 1, "name": "Bill", "occupation": "Gardener" },
+        { "id": 2, "name":  "Ben", "occupation": "Horticulturalist" }
+    ]
+}
+ * </code></pre>
+ * <p>The <b><tt>metaData</tt></b> property in the JSON data object should contain:</p>
+ * <div class="mdetail-params"><ul>
+ * <li>any of the configuration options for this class</li>
+ * <li>a <b><tt>{@link Ext.data.Record#fields fields}</tt></b> property which
+ * the JsonReader will use as an argument to the
+ * {@link Ext.data.Record#create data Record create method} in order to
+ * configure the layout of the Records it will produce.</li>
+ * <li>a <b><tt>{@link Ext.data.Store#sortInfo sortInfo}</tt></b> property
+ * which the JsonReader will use to set the {@link Ext.data.Store}'s
+ * {@link Ext.data.Store#sortInfo sortInfo} property</li>
+ * <li>any custom properties needed</li>
+ * </ul></div>
+ *
+ * @constructor
+ * Create a new JsonReader
+ * @param {Object} meta Metadata configuration options.
+ * @param {Array/Object} recordType
+ * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
+ * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
+ * constructor created from {@link Ext.data.Record#create}.</p>
+ */
+Ext.data.JsonReader = function(meta, recordType){
+    meta = meta || {};
     /**
-     * Placeholder method for minimizing the window.  By default, this method simply fires the {@link #minimize} event
-     * since the behavior of minimizing a window is application-specific.  To implement custom minimize behavior,
-     * either the minimize event can be handled or this method can be overridden.
-     * @return {Ext.Window} this
+     * @cfg {String} idProperty [id] Name of the property within a row object
+     * that contains a record identifier value.  Defaults to <tt>id</tt>
      */
-    minimize : function(){
-        this.fireEvent('minimize', this);
-        return this;
-    },
+    /**
+     * @cfg {String} successProperty [success] Name of the property from which to
+     * retrieve the success attribute. Defaults to <tt>success</tt>.  See
+     * {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
+     * for additional information.
+     */
+    /**
+     * @cfg {String} totalProperty [total] Name of the property from which to
+     * retrieve the total number of records in the dataset. This is only needed
+     * if the whole dataset is not passed in one go, but is being paged from
+     * the remote server.  Defaults to <tt>total</tt>.
+     */
+    /**
+     * @cfg {String} root [undefined] <b>Required</b>.  The name of the property
+     * which contains the Array of row objects.  Defaults to <tt>undefined</tt>.
+     * An exception will be thrown if the root property is undefined. The data
+     * packet value for this property should be an empty array to clear the data
+     * or show no data.
+     */
+    Ext.applyIf(meta, {
+        idProperty: 'id',
+        successProperty: 'success',
+        totalProperty: 'total'
+    });
 
+    Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields);
+};
+Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
     /**
-     * <p>Closes the Window, removes it from the DOM, {@link Ext.Component#destroy destroy}s
-     * the Window object and all its descendant Components. The {@link Ext.Panel#beforeclose beforeclose}
-     * event is fired before the close happens and will cancel the close action if it returns false.<p>
-     * <p><b>Note:</b> This method is not affected by the {@link #closeAction} setting which
-     * only affects the action triggered when clicking the {@link #closable 'close' tool in the header}.
-     * To hide the Window without destroying it, call {@link #hide}.</p>
+     * This JsonReader's metadata as passed to the constructor, or as passed in
+     * the last data packet's <b><tt>metaData</tt></b> property.
+     * @type Mixed
+     * @property meta
      */
-    close : function(){
-        if(this.fireEvent('beforeclose', this) !== false){
-            this.hide(null, function(){
-                this.fireEvent('close', this);
-                this.destroy();
-            }, this);
+    /**
+     * This method is only used by a DataProxy which has retrieved data from a remote server.
+     * @param {Object} response The XHR object which contains the JSON data in its responseText.
+     * @return {Object} data A data block which is used by an Ext.data.Store object as
+     * a cache of Ext.data.Records.
+     */
+    read : function(response){
+        var json = response.responseText;
+        var o = Ext.decode(json);
+        if(!o) {
+            throw {message: 'JsonReader.read: Json object not found'};
         }
+        return this.readRecords(o);
     },
 
     /**
-     * Fits the window within its current container and automatically replaces
-     * the {@link #maximizable 'maximize' tool button} with the 'restore' tool button.
-     * Also see {@link #toggleMaximize}.
-     * @return {Ext.Window} this
+     * Decode a json response from server.
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
+     * @param {Object} response
+     * TODO: refactor code between JsonReader#readRecords, #readResponse into 1 method.
+     * there's ugly duplication going on due to maintaining backwards compat. with 2.0.  It's time to do this.
      */
-    maximize : function(){
-        if(!this.maximized){
-            this.expand(false);
-            this.restoreSize = this.getSize();
-            this.restorePos = this.getPosition(true);
-            if (this.maximizable){
-                this.tools.maximize.hide();
-                this.tools.restore.show();
-            }
-            this.maximized = true;
-            this.el.disableShadow();
+    readResponse : function(action, response) {
+        var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response;
+        if(!o) {
+            throw new Ext.data.JsonReader.Error('response');
+        }
 
-            if(this.dd){
-                this.dd.lock();
+        var root = this.getRoot(o);
+        if (action === Ext.data.Api.actions.create) {
+            var def = Ext.isDefined(root);
+            if (def && Ext.isEmpty(root)) {
+                throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
             }
-            if(this.collapsible){
-                this.tools.toggle.hide();
+            else if (!def) {
+                throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
             }
-            this.el.addClass('x-window-maximized');
-            this.container.addClass('x-window-maximized-ct');
+        }
 
-            this.setPosition(0, 0);
-            this.fitContainer();
-            this.fireEvent('maximize', this);
+        // instantiate response object
+        var res = new Ext.data.Response({
+            action: action,
+            success: this.getSuccess(o),
+            data: (root) ? this.extractData(root, false) : [],
+            message: this.getMessage(o),
+            raw: o
+        });
+
+        // blow up if no successProperty
+        if (Ext.isEmpty(res.success)) {
+            throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);
         }
-        return this;
+        return res;
     },
 
     /**
-     * Restores a {@link #maximizable maximized}  window back to its original
-     * size and position prior to being maximized and also replaces
-     * the 'restore' tool button with the 'maximize' tool button.
-     * Also see {@link #toggleMaximize}.
-     * @return {Ext.Window} this
+     * Create a data block containing Ext.data.Records from a JSON object.
+     * @param {Object} o An object which contains an Array of row objects in the property specified
+     * in the config as 'root, and optionally a property, specified in the config as 'totalProperty'
+     * which contains the total size of the dataset.
+     * @return {Object} data A data block which is used by an Ext.data.Store object as
+     * a cache of Ext.data.Records.
      */
-    restore : function(){
-        if(this.maximized){
-            this.el.removeClass('x-window-maximized');
-            this.tools.restore.hide();
-            this.tools.maximize.show();
-            this.setPosition(this.restorePos[0], this.restorePos[1]);
-            this.setSize(this.restoreSize.width, this.restoreSize.height);
-            delete this.restorePos;
-            delete this.restoreSize;
-            this.maximized = false;
-            this.el.enableShadow(true);
+    readRecords : function(o){
+        /**
+         * After any data loads, the raw JSON data is available for further custom processing.  If no data is
+         * loaded or there is a load exception this property will be undefined.
+         * @type Object
+         */
+        this.jsonData = o;
+        if(o.metaData){
+            this.onMetaChange(o.metaData);
+        }
+        var s = this.meta, Record = this.recordType,
+            f = Record.prototype.fields, fi = f.items, fl = f.length, v;
 
-            if(this.dd){
-                this.dd.unlock();
+        var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
+        if(s.totalProperty){
+            v = parseInt(this.getTotal(o), 10);
+            if(!isNaN(v)){
+                totalRecords = v;
             }
-            if(this.collapsible){
-                this.tools.toggle.show();
+        }
+        if(s.successProperty){
+            v = this.getSuccess(o);
+            if(v === false || v === 'false'){
+                success = false;
             }
-            this.container.removeClass('x-window-maximized-ct');
-
-            this.doConstrain();
-            this.fireEvent('restore', this);
         }
-        return this;
-    },
-
-    /**
-     * A shortcut method for toggling between {@link #maximize} and {@link #restore} based on the current maximized
-     * state of the window.
-     * @return {Ext.Window} this
-     */
-    toggleMaximize : function(){
-        return this[this.maximized ? 'restore' : 'maximize']();
-    },
 
-    // private
-    fitContainer : function(){
-        var vs = this.container.getViewSize();
-        this.setSize(vs.width, vs.height);
+        // TODO return Ext.data.Response instance instead.  @see #readResponse
+        return {
+            success : success,
+            records : this.extractData(root, true), // <-- true to return [Ext.data.Record]
+            totalRecords : totalRecords
+        };
     },
 
     // private
-    // z-index is managed by the WindowManager and may be overwritten at any time
-    setZIndex : function(index){
-        if(this.modal){
-            this.mask.setStyle('z-index', index);
+    buildExtractors : function() {
+        if(this.ef){
+            return;
         }
-        this.el.setZIndex(++index);
-        index += 5;
+        var s = this.meta, Record = this.recordType,
+            f = Record.prototype.fields, fi = f.items, fl = f.length;
 
-        if(this.resizer){
-            this.resizer.proxy.setStyle('z-index', ++index);
+        if(s.totalProperty) {
+            this.getTotal = this.createAccessor(s.totalProperty);
         }
-
-        this.lastZIndex = index;
-    },
-
-    /**
-     * Aligns the window to the specified element
-     * @param {Mixed} element The element to align to.
-     * @param {String} position The position to align to (see {@link Ext.Element#alignTo} for more details).
-     * @param {Array} offsets (optional) Offset the positioning by [x, y]
-     * @return {Ext.Window} this
-     */
-    alignTo : function(element, position, offsets){
-        var xy = this.el.getAlignToXY(element, position, offsets);
-        this.setPagePosition(xy[0], xy[1]);
-        return this;
+        if(s.successProperty) {
+            this.getSuccess = this.createAccessor(s.successProperty);
+        }
+        if (s.messageProperty) {
+            this.getMessage = this.createAccessor(s.messageProperty);
+        }
+        this.getRoot = s.root ? this.createAccessor(s.root) : function(p){return p;};
+        if (s.id || s.idProperty) {
+            var g = this.createAccessor(s.id || s.idProperty);
+            this.getId = function(rec) {
+                var r = g(rec);
+                return (r === undefined || r === '') ? null : r;
+            };
+        } else {
+            this.getId = function(){return null;};
+        }
+        var ef = [];
+        for(var i = 0; i < fl; i++){
+            f = fi[i];
+            var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
+            ef.push(this.createAccessor(map));
+        }
+        this.ef = ef;
     },
 
     /**
-     * Anchors this window to another element and realigns it when the window is resized or scrolled.
-     * @param {Mixed} element The element to align to.
-     * @param {String} position The position to align to (see {@link Ext.Element#alignTo} for more details)
-     * @param {Array} offsets (optional) Offset the positioning by [x, y]
-     * @param {Boolean/Number} monitorScroll (optional) true to monitor body scroll and reposition. If this parameter
-     * is a number, it is used as the buffer delay (defaults to 50ms).
-     * @return {Ext.Window} this
+     * @ignore
+     * TODO This isn't used anywhere??  Don't we want to use this where possible instead of complex #createAccessor?
      */
-    anchorTo : function(el, alignment, offsets, monitorScroll){
-      if(this.doAnchor){
-          Ext.EventManager.removeResizeListener(this.doAnchor, this);
-          Ext.EventManager.un(window, 'scroll', this.doAnchor, this);
-      }
-      this.doAnchor = function(){
-          this.alignTo(el, alignment, offsets);
-      };
-      Ext.EventManager.onWindowResize(this.doAnchor, this);
-      
-      var tm = typeof monitorScroll;
-      if(tm != 'undefined'){
-          Ext.EventManager.on(window, 'scroll', this.doAnchor, this,
-              {buffer: tm == 'number' ? monitorScroll : 50});
-      }
-      this.doAnchor();
-      return this;
+    simpleAccess : function(obj, subsc) {
+        return obj[subsc];
     },
 
     /**
-     * Brings this window to the front of any other visible windows
-     * @param {Boolean} e (optional) Specify <tt>false</tt> to prevent the window from being focused.
-     * @return {Ext.Window} this
+     * @ignore
      */
-    toFront : function(e){
-        if(this.manager.bringToFront(this)){
-            if(!e || !e.getTarget().focus){
-                this.focus();
+    createAccessor : function(){
+        var re = /[\[\.]/;
+        return function(expr) {
+            if(Ext.isEmpty(expr)){
+                return Ext.emptyFn;
             }
-        }
-        return this;
-    },
-
-    /**
-     * Makes this the active window by showing its shadow, or deactivates it by hiding its shadow.  This method also
-     * fires the {@link #activate} or {@link #deactivate} event depending on which action occurred.
-     * @param {Boolean} active True to activate the window, false to deactivate it (defaults to false)
-     */
-    setActive : function(active){
-        if(active){
-            if(!this.maximized){
-                this.el.enableShadow(true);
+            if(Ext.isFunction(expr)){
+                return expr;
             }
-            this.fireEvent('activate', this);
-        }else{
-            this.el.disableShadow();
-            this.fireEvent('deactivate', this);
-        }
-    },
+            var i = String(expr).search(re);
+            if(i >= 0){
+                return new Function('obj', 'return obj' + (i > 0 ? '.' : '') + expr);
+            }
+            return function(obj){
+                return obj[expr];
+            };
 
-    /**
-     * Sends this window to the back of (lower z-index than) any other visible windows
-     * @return {Ext.Window} this
-     */
-    toBack : function(){
-        this.manager.sendToBack(this);
-        return this;
-    },
+        };
+    }(),
 
     /**
-     * Centers this window in the viewport
-     * @return {Ext.Window} this
+     * type-casts a single row of raw-data from server
+     * @param {Object} data
+     * @param {Array} items
+     * @param {Integer} len
+     * @private
      */
-    center : function(){
-        var xy = this.el.getAlignToXY(this.container, 'c-c');
-        this.setPagePosition(xy[0], xy[1]);
-        return this;
+    extractValues : function(data, items, len) {
+        var f, values = {};
+        for(var j = 0; j < len; j++){
+            f = items[j];
+            var v = this.ef[j](data);
+            values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data);
+        }
+        return values;
     }
-
-    /**
-     * @cfg {Boolean} autoWidth @hide
-     **/
 });
-Ext.reg('window', Ext.Window);
-
-// private - custom Window DD implementation
-Ext.Window.DD = function(win){
-    this.win = win;
-    Ext.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id);
-    this.setHandleElId(win.header.id);
-    this.scroll = false;
-};
-
-Ext.extend(Ext.Window.DD, Ext.dd.DD, {
-    moveOnly:true,
-    headerOffsets:[100, 25],
-    startDrag : function(){
-        var w = this.win;
-        this.proxy = w.ghost();
-        if(w.constrain !== false){
-            var so = w.el.shadowOffset;
-            this.constrainTo(w.container, {right: so, left: so, bottom: so});
-        }else if(w.constrainHeader !== false){
-            var s = this.proxy.getSize();
-            this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])});
-        }
-    },
-    b4Drag : Ext.emptyFn,
 
-    onDrag : function(e){
-        this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY());
+/**
+ * @class Ext.data.JsonReader.Error
+ * Error class for JsonReader
+ */
+Ext.data.JsonReader.Error = Ext.extend(Ext.Error, {
+    constructor : function(message, arg) {
+        this.arg = arg;
+        Ext.Error.call(this, message);
     },
-
-    endDrag : function(e){
-        this.win.unghost();
-        this.win.saveState();
+    name : 'Ext.data.JsonReader'
+});
+Ext.apply(Ext.data.JsonReader.Error.prototype, {
+    lang: {
+        'response': 'An error occurred while json-decoding your server response',
+        'successProperty-response': 'Could not locate your "successProperty" in your server response.  Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response.  See the JsonReader docs.',
+        'root-undefined-config': 'Your JsonReader was configured without a "root" property.  Please review your JsonReader config and make sure to define the root property.  See the JsonReader docs.',
+        'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty"  Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id").  See the JsonReader docs.',
+        'root-empty': 'Data was expected to be returned by the server in the "root" property of the response.  Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response.  See JsonReader docs.'
     }
 });
 /**
- * @class Ext.WindowGroup
- * An object that represents a group of {@link Ext.Window} instances and provides z-order management
- * and window activation behavior.
+ * @class Ext.data.ArrayReader
+ * @extends Ext.data.JsonReader
+ * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an Array.
+ * Each element of that Array represents a row of data fields. The
+ * fields are pulled into a Record object using as a subscript, the <code>mapping</code> property
+ * of the field definition if it exists, or the field's ordinal position in the definition.</p>
+ * <p>Example code:</p>
+ * <pre><code>
+var Employee = Ext.data.Record.create([
+    {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
+    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.
+]);
+var myReader = new Ext.data.ArrayReader({
+    {@link #idIndex}: 0
+}, Employee);
+</code></pre>
+ * <p>This would consume an Array like this:</p>
+ * <pre><code>
+[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
+ * </code></pre>
  * @constructor
+ * Create a new ArrayReader
+ * @param {Object} meta Metadata configuration options.
+ * @param {Array/Object} recordType
+ * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
+ * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
+ * constructor created from {@link Ext.data.Record#create}.</p>
  */
-Ext.WindowGroup = function(){
-    var list = {};
-    var accessList = [];
-    var front = null;
+Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
+    /**
+     * @cfg {String} successProperty
+     * @hide
+     */
+    /**
+     * @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record.
+     * Deprecated. Use {@link #idIndex} instead.
+     */
+    /**
+     * @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record.
+     */
+    /**
+     * Create a data block containing Ext.data.Records from an Array.
+     * @param {Object} o An Array of row objects which represents the dataset.
+     * @return {Object} data A data block which is used by an Ext.data.Store object as
+     * a cache of Ext.data.Records.
+     */
+    readRecords : function(o){
+        this.arrayData = o;
+        var s = this.meta,
+            sid = s ? Ext.num(s.idIndex, s.id) : null,
+            recordType = this.recordType,
+            fields = recordType.prototype.fields,
+            records = [],
+            success = true,
+            v;
 
-    // private
-    var sortWindows = function(d1, d2){
-        return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1;
-    };
+        var root = this.getRoot(o);
 
-    // private
-    var orderWindows = function(){
-        var a = accessList, len = a.length;
-        if(len > 0){
-            a.sort(sortWindows);
-            var seed = a[0].manager.zseed;
-            for(var i = 0; i < len; i++){
-                var win = a[i];
-                if(win && !win.hidden){
-                    win.setZIndex(seed + (i*10));
-                }
+        for(var i = 0, len = root.length; i < len; i++) {
+            var n = root[i],
+                values = {},
+                id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
+            for(var j = 0, jlen = fields.length; j < jlen; j++) {
+                var f = fields.items[j],
+                    k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
+                v = n[k] !== undefined ? n[k] : f.defaultValue;
+                v = f.convert(v, n);
+                values[f.name] = v;
             }
+            var record = new recordType(values, id);
+            record.json = n;
+            records[records.length] = record;
         }
-        activateLast();
-    };
 
-    // private
-    var setActiveWin = function(win){
-        if(win != front){
-            if(front){
-                front.setActive(false);
-            }
-            front = win;
-            if(win){
-                win.setActive(true);
-            }
-        }
-    };
+        var totalRecords = records.length;
 
-    // private
-    var activateLast = function(){
-        for(var i = accessList.length-1; i >=0; --i) {
-            if(!accessList[i].hidden){
-                setActiveWin(accessList[i]);
-                return;
+        if(s.totalProperty) {
+            v = parseInt(this.getTotal(o), 10);
+            if(!isNaN(v)) {
+                totalRecords = v;
             }
         }
-        // none to activate
-        setActiveWin(null);
-    };
-
-    return {
-        /**
-         * The starting z-index for windows (defaults to 9000)
-         * @type Number The z-index value
-         */
-        zseed : 9000,
-
-        // private
-        register : function(win){
-            list[win.id] = win;
-            accessList.push(win);
-            win.on('hide', activateLast);
-        },
-
-        // private
-        unregister : function(win){
-            delete list[win.id];
-            win.un('hide', activateLast);
-            accessList.remove(win);
-        },
-
-        /**
-         * Gets a registered window by id.
-         * @param {String/Object} id The id of the window or a {@link Ext.Window} instance
-         * @return {Ext.Window}
-         */
-        get : function(id){
-            return typeof id == "object" ? id : list[id];
-        },
-
-        /**
-         * Brings the specified window to the front of any other active windows.
-         * @param {String/Object} win The id of the window or a {@link Ext.Window} instance
-         * @return {Boolean} True if the dialog was brought to the front, else false
-         * if it was already in front
-         */
-        bringToFront : function(win){
-            win = this.get(win);
-            if(win != front){
-                win._lastAccess = new Date().getTime();
-                orderWindows();
-                return true;
-            }
-            return false;
-        },
-
-        /**
-         * Sends the specified window to the back of other active windows.
-         * @param {String/Object} win The id of the window or a {@link Ext.Window} instance
-         * @return {Ext.Window} The window
-         */
-        sendToBack : function(win){
-            win = this.get(win);
-            win._lastAccess = -(new Date().getTime());
-            orderWindows();
-            return win;
-        },
-
-        /**
-         * Hides all windows in the group.
-         */
-        hideAll : function(){
-            for(var id in list){
-                if(list[id] && typeof list[id] != "function" && list[id].isVisible()){
-                    list[id].hide();
-                }
+        if(s.successProperty){
+            v = this.getSuccess(o);
+            if(v === false || v === 'false'){
+                success = false;
             }
-        },
+        }
 
-        /**
-         * Gets the currently-active window in the group.
-         * @return {Ext.Window} The active window
-         */
-        getActive : function(){
-            return front;
-        },
+        return {
+            success : success,
+            records : records,
+            totalRecords : totalRecords
+        };
+    }
+});/**
+ * @class Ext.data.ArrayStore
+ * @extends Ext.data.Store
+ * <p>Formerly known as "SimpleStore".</p>
+ * <p>Small helper class to make creating {@link Ext.data.Store}s from Array data easier.
+ * An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.</p>
+ * <p>A store configuration would be something like:<pre><code>
+var store = new Ext.data.ArrayStore({
+    // store configs
+    autoDestroy: true,
+    storeId: 'myStore',
+    // reader configs
+    idIndex: 0,  
+    fields: [
+       'company',
+       {name: 'price', type: 'float'},
+       {name: 'change', type: 'float'},
+       {name: 'pctChange', type: 'float'},
+       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
+    ]
+});
+ * </code></pre></p>
+ * <p>This store is configured to consume a returned object of the form:<pre><code>
+var myData = [
+    ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
+    ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
+    ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
+    ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
+    ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
+];
+ * </code></pre>
+ * An object literal of this form could also be used as the {@link #data} config option.</p>
+ * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of 
+ * <b>{@link Ext.data.ArrayReader ArrayReader}</b>.</p>
+ * @constructor
+ * @param {Object} config
+ * @xtype arraystore
+ */
+Ext.data.ArrayStore = Ext.extend(Ext.data.Store, {
+    /**
+     * @cfg {Ext.data.DataReader} reader @hide
+     */
+    constructor: function(config){
+        Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, {
+            reader: new Ext.data.ArrayReader(config)
+        }));
+    },
 
-        /**
-         * Returns zero or more windows in the group using the custom search function passed to this method.
-         * The function should accept a single {@link Ext.Window} reference as its only argument and should
-         * return true if the window matches the search criteria, otherwise it should return false.
-         * @param {Function} fn The search function
-         * @param {Object} scope (optional) The scope in which to execute the function (defaults to the window
-         * that gets passed to the function if not specified)
-         * @return {Array} An array of zero or more matching windows
-         */
-        getBy : function(fn, scope){
+    loadData : function(data, append){
+        if(this.expandData === true){
             var r = [];
-            for(var i = accessList.length-1; i >=0; --i) {
-                var win = accessList[i];
-                if(fn.call(scope||win, win) !== false){
-                    r.push(win);
-                }
-            }
-            return r;
-        },
-
-        /**
-         * Executes the specified function once for every window in the group, passing each
-         * window as the only parameter. Returning false from the function will stop the iteration.
-         * @param {Function} fn The function to execute for each item
-         * @param {Object} scope (optional) The scope in which to execute the function
-         */
-        each : function(fn, scope){
-            for(var id in list){
-                if(list[id] && typeof list[id] != "function"){
-                    if(fn.call(scope || list[id], list[id]) === false){
-                        return;
-                    }
-                }
+            for(var i = 0, len = data.length; i < len; i++){
+                r[r.length] = [data[i]];
             }
+            data = r;
         }
-    };
+        Ext.data.ArrayStore.superclass.loadData.call(this, data, append);
+    }
+});
+Ext.reg('arraystore', Ext.data.ArrayStore);
+
+// backwards compat
+Ext.data.SimpleStore = Ext.data.ArrayStore;
+Ext.reg('simplestore', Ext.data.SimpleStore);/**
+ * @class Ext.data.JsonStore
+ * @extends Ext.data.Store
+ * <p>Small helper class to make creating {@link Ext.data.Store}s from JSON data easier.
+ * A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.</p>
+ * <p>A store configuration would be something like:<pre><code>
+var store = new Ext.data.JsonStore({
+    // store configs
+    autoDestroy: true,
+    url: 'get-images.php',
+    storeId: 'myStore',
+    // reader configs
+    root: 'images',
+    idProperty: 'name',
+    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
+});
+ * </code></pre></p>
+ * <p>This store is configured to consume a returned object of the form:<pre><code>
+{
+    images: [
+        {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
+        {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
+    ]
+}
+ * </code></pre>
+ * An object literal of this form could also be used as the {@link #data} config option.</p>
+ * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
+ * <b>{@link Ext.data.JsonReader JsonReader}</b>.</p>
+ * @constructor
+ * @param {Object} config
+ * @xtype jsonstore
+ */
+Ext.data.JsonStore = Ext.extend(Ext.data.Store, {
+    /**
+     * @cfg {Ext.data.DataReader} reader @hide
+     */
+    constructor: function(config){
+        Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, {
+            reader: new Ext.data.JsonReader(config)
+        }));
+    }
+});
+Ext.reg('jsonstore', Ext.data.JsonStore);/**
+ * @class Ext.data.XmlWriter
+ * @extends Ext.data.DataWriter
+ * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action via XML.
+ * XmlWriter uses an instance of {@link Ext.XTemplate} for maximum flexibility in defining your own custom XML schema if the default schema is not appropriate for your needs.
+ * See the {@link #tpl} configuration-property.
+ */
+Ext.data.XmlWriter = function(params) {
+    Ext.data.XmlWriter.superclass.constructor.apply(this, arguments);
+    // compile the XTemplate for rendering XML documents.
+    this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile();
 };
+Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, {
+    /**
+     * @cfg {String} documentRoot [xrequest] (Optional) The name of the XML document root-node.  <b>Note:</b>
+     * this parameter is required </b>only when</b> sending extra {@link Ext.data.Store#baseParams baseParams} to the server
+     * during a write-request -- if no baseParams are set, the {@link Ext.data.XmlReader#record} meta-property can
+     * suffice as the XML document root-node for write-actions involving just a <b>single record</b>.  For requests
+     * involving <b>multiple</b> records and <b>NO</b> baseParams, the {@link Ext.data.XmlWriter#root} property can
+     * act as the XML document root.
+     */
+    documentRoot: 'xrequest',
+    /**
+     * @cfg {Boolean} forceDocumentRoot [false] Set to <tt>true</tt> to force XML documents having a root-node as defined
+     * by {@link #documentRoot}, even with no baseParams defined.
+     */
+    forceDocumentRoot: false,
+    /**
+     * @cfg {String} root [records] The name of the containing element which will contain the nodes of an write-action involving <b>multiple</b> records.  Each
+     * xml-record written to the server will be wrapped in an element named after {@link Ext.data.XmlReader#record} property.
+     * eg:
+<code><pre>
+&lt;?xml version="1.0" encoding="UTF-8"?>
+&lt;user>&lt;first>Barney&lt;/first>&lt;/user>
+</code></pre>
+     * However, when <b>multiple</b> records are written in a batch-operation, these records must be wrapped in a containing
+     * Element.
+     * eg:
+<code><pre>
+&lt;?xml version="1.0" encoding="UTF-8"?>
+    &lt;records>
+        &lt;first>Barney&lt;/first>&lt;/user>
+        &lt;records>&lt;first>Barney&lt;/first>&lt;/user>
+    &lt;/records>
+</code></pre>
+     * Defaults to <tt>records</tt>.  Do not confuse the nature of this property with that of {@link #documentRoot}
+     */
+    root: 'records',
+    /**
+     * @cfg {String} xmlVersion [1.0] The <tt>version</tt> written to header of xml documents.
+<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
+     */
+    xmlVersion : '1.0',
+    /**
+     * @cfg {String} xmlEncoding [ISO-8859-15] The <tt>encoding</tt> written to header of xml documents.
+<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
+     */
+    xmlEncoding: 'ISO-8859-15',
+    /**
+     * @cfg {String/Ext.XTemplate} tpl The XML template used to render {@link Ext.data.Api#actions write-actions} to your server.
+     * <p>One can easily provide his/her own custom {@link Ext.XTemplate#constructor template-definition} if the default does not suffice.</p>
+     * <p>Defaults to:</p>
+<code><pre>
+&lt;?xml version="{version}" encoding="{encoding}"?>
+    &lt;tpl if="documentRoot">&lt;{documentRoot}>
+    &lt;tpl for="baseParams">
+        &lt;tpl for=".">
+            &lt;{name}>{value}&lt;/{name}>
+        &lt;/tpl>
+    &lt;/tpl>
+    &lt;tpl if="records.length &gt; 1">&lt;{root}>',
+    &lt;tpl for="records">
+        &lt;{parent.record}>
+        &lt;tpl for=".">
+            &lt;{name}>{value}&lt;/{name}>
+        &lt;/tpl>
+        &lt;/{parent.record}>
+    &lt;/tpl>
+    &lt;tpl if="records.length &gt; 1">&lt;/{root}>&lt;/tpl>
+    &lt;tpl if="documentRoot">&lt;/{documentRoot}>&lt;/tpl>
+</pre></code>
+     * <p>Templates will be called with the following API</p>
+     * <ul>
+     * <li>{String} version [1.0] The xml version.</li>
+     * <li>{String} encoding [ISO-8859-15] The xml encoding.</li>
+     * <li>{String/false} documentRoot The XML document root-node name or <tt>false</tt> if not required.  See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
+     * <li>{String} record The meta-data parameter defined on your {@link Ext.data.XmlReader#record} configuration represents the name of the xml-tag containing each record.</li>
+     * <li>{String} root The meta-data parameter defined by {@link Ext.data.XmlWriter#root} configuration-parameter.  Represents the name of the xml root-tag when sending <b>multiple</b> records to the server.</li>
+     * <li>{Array} records The records being sent to the server, ie: the subject of the write-action being performed.  The records parameter will be always be an array, even when only a single record is being acted upon.
+     *     Each item within the records array will contain an array of field objects having the following properties:
+     *     <ul>
+     *         <li>{String} name The field-name of the record as defined by your {@link Ext.data.Record#create Ext.data.Record definition}.  The "mapping" property will be used, otherwise it will match the "name" property.  Use this parameter to define the XML tag-name of the property.</li>
+     *         <li>{Mixed} value The record value of the field enclosed within XML tags specified by name property above.</li>
+     *     </ul></li>
+     * <li>{Array} baseParams.  The baseParams as defined upon {@link Ext.data.Store#baseParams}.  Note that the baseParams have been converted into an array of [{name : "foo", value: "bar"}, ...] pairs in the same manner as the <b>records</b> parameter above.  See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
+     * </ul>
+     */
+    // Break up encoding here in case it's being included by some kind of page that will parse it (eg. PHP)
+    tpl: '<tpl for="."><' + '?xml version="{version}" encoding="{encoding}"?' + '><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}</tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',
+
+    /**
+     * XmlWriter implementation of the final stage of a write action.
+     * @param {Object} params Transport-proxy's (eg: {@link Ext.Ajax#request}) params-object to write-to.
+     * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}.  The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}.
+     * @param {Object/Object[]} data Data-object representing the compiled Store-recordset.
+     */
+    render : function(params, baseParams, data) {
+        baseParams = this.toArray(baseParams);
+        params.xmlData = this.tpl.applyTemplate({
+            version: this.xmlVersion,
+            encoding: this.xmlEncoding,
+            documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false,
+            record: this.meta.record,
+            root: this.root,
+            baseParams: baseParams,
+            records: (Ext.isArray(data[0])) ? data : [data]
+        });
+    },
 
+    /**
+     * createRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Array} Array of <tt>name:value</tt> pairs for attributes of the {@link Ext.data.Record}.  See {@link Ext.data.DataWriter#toHash}.
+     */
+    createRecord : function(rec) {
+        return this.toArray(this.toHash(rec));
+    },
 
-/**
- * @class Ext.WindowMgr
- * @extends Ext.WindowGroup
- * The default global window group that is available automatically.  To have more than one group of windows
- * with separate z-order stacks, create additional instances of {@link Ext.WindowGroup} as needed.
- * @singleton
- */
-Ext.WindowMgr = new Ext.WindowGroup();/**
- * @class Ext.MessageBox
- * <p>Utility class for generating different styles of message boxes.  The alias Ext.Msg can also be used.<p/>
- * <p>Note that the MessageBox is asynchronous.  Unlike a regular JavaScript <code>alert</code> (which will halt
- * browser execution), showing a MessageBox will not cause the code to stop.  For this reason, if you have code
- * that should only run <em>after</em> some user feedback from the MessageBox, you must use a callback function
- * (see the <code>function</code> parameter for {@link #show} for more details).</p>
- * <p>Example usage:</p>
- *<pre><code>
-// Basic alert:
-Ext.Msg.alert('Status', 'Changes saved successfully.');
+    /**
+     * updateRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Array} Array of {name:value} pairs for attributes of the {@link Ext.data.Record}.  See {@link Ext.data.DataWriter#toHash}.
+     */
+    updateRecord : function(rec) {
+        return this.toArray(this.toHash(rec));
 
-// Prompt for user data and process the result using a callback:
-Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
-    if (btn == 'ok'){
-        // process text value and close...
+    },
+    /**
+     * destroyRecord
+     * @protected
+     * @param {Ext.data.Record} rec
+     * @return {Array} Array containing a attribute-object (name/value pair) representing the {@link Ext.data.DataReader#idProperty idProperty}.
+     */
+    destroyRecord : function(rec) {
+        var data = {};
+        data[this.meta.idProperty] = rec.id;
+        return this.toArray(data);
     }
 });
 
-// Show a dialog using config options:
-Ext.Msg.show({
-   title:'Save Changes?',
-   msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
-   buttons: Ext.Msg.YESNOCANCEL,
-   fn: processResult,
-   animEl: 'elId',
-   icon: Ext.MessageBox.QUESTION
-});
+/**
+ * @class Ext.data.XmlReader
+ * @extends Ext.data.DataReader
+ * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an XML document
+ * based on mappings in a provided {@link Ext.data.Record} constructor.</p>
+ * <p><b>Note</b>: that in order for the browser to parse a returned XML document, the Content-Type
+ * header in the HTTP response must be set to "text/xml" or "application/xml".</p>
+ * <p>Example code:</p>
+ * <pre><code>
+var Employee = Ext.data.Record.create([
+   {name: 'name', mapping: 'name'},     // "mapping" property not needed if it is the same as "name"
+   {name: 'occupation'}                 // This field will use "occupation" as the mapping.
+]);
+var myReader = new Ext.data.XmlReader({
+   totalProperty: "results", // The element which contains the total dataset size (optional)
+   record: "row",           // The repeated element which contains row information
+   idProperty: "id"         // The element within the row that provides an ID for the record (optional)
+   messageProperty: "msg"   // The element within the response that provides a user-feedback message (optional)
+}, Employee);
 </code></pre>
- * @singleton
+ * <p>
+ * This would consume an XML file like this:
+ * <pre><code>
+&lt;?xml version="1.0" encoding="UTF-8"?>
+&lt;dataset>
+ &lt;results>2&lt;/results>
+ &lt;row>
+   &lt;id>1&lt;/id>
+   &lt;name>Bill&lt;/name>
+   &lt;occupation>Gardener&lt;/occupation>
+ &lt;/row>
+ &lt;row>
+   &lt;id>2&lt;/id>
+   &lt;name>Ben&lt;/name>
+   &lt;occupation>Horticulturalist&lt;/occupation>
+ &lt;/row>
+&lt;/dataset>
+</code></pre>
+ * @cfg {String} totalProperty The DomQuery path from which to retrieve the total number of records
+ * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
+ * paged from the remote server.
+ * @cfg {String} record The DomQuery path to the repeated element which contains record information.
+ * @cfg {String} record The DomQuery path to the repeated element which contains record information.
+ * @cfg {String} successProperty The DomQuery path to the success attribute used by forms.
+ * @cfg {String} idPath The DomQuery path relative from the record element to the element that contains
+ * a record identifier value.
+ * @constructor
+ * Create a new XmlReader.
+ * @param {Object} meta Metadata configuration options
+ * @param {Object} recordType Either an Array of field definition objects as passed to
+ * {@link Ext.data.Record#create}, or a Record constructor object created using {@link Ext.data.Record#create}.
  */
-Ext.MessageBox = function(){
-    var dlg, opt, mask, waitTimer;
-    var bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl;
-    var buttons, activeTextEl, bwidth, iconCls = '';
-
-    // private
-    var handleButton = function(button){
-        if(dlg.isVisible()){
-            dlg.hide();
-            handleHide();
-            Ext.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value, opt], 1);
-        }
-    };
-
-    // private
-    var handleHide = function(){
-        if(opt && opt.cls){
-            dlg.el.removeClass(opt.cls);
-        }
-        progressBar.reset();
-    };
+Ext.data.XmlReader = function(meta, recordType){
+    meta = meta || {};
 
-    // private
-    var handleEsc = function(d, k, e){
-        if(opt && opt.closable !== false){
-            dlg.hide();
-            handleHide();
-        }
-        if(e){
-            e.stopEvent();
-        }
-    };
+    // backwards compat, convert idPath or id / success
+    Ext.applyIf(meta, {
+        idProperty: meta.idProperty || meta.idPath || meta.id,
+        successProperty: meta.successProperty || meta.success
+    });
 
-    // private
-    var updateButtons = function(b){
-        var width = 0;
-        if(!b){
-            buttons["ok"].hide();
-            buttons["cancel"].hide();
-            buttons["yes"].hide();
-            buttons["no"].hide();
-            return width;
-        }
-        dlg.footer.dom.style.display = '';
-        for(var k in buttons){
-            if(typeof buttons[k] != "function"){
-                if(b[k]){
-                    buttons[k].show();
-                    buttons[k].setText(typeof b[k] == "string" ? b[k] : Ext.MessageBox.buttonText[k]);
-                    width += buttons[k].el.getWidth()+15;
-                }else{
-                    buttons[k].hide();
-                }
-            }
+    Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields);
+};
+Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
+    /**
+     * This method is only used by a DataProxy which has retrieved data from a remote server.
+     * @param {Object} response The XHR object which contains the parsed XML document.  The response is expected
+     * to contain a property called <tt>responseXML</tt> which refers to an XML document object.
+     * @return {Object} records A data block which is used by an {@link Ext.data.Store} as
+     * a cache of Ext.data.Records.
+     */
+    read : function(response){
+        var doc = response.responseXML;
+        if(!doc) {
+            throw {message: "XmlReader.read: XML Document not available"};
         }
-        return width;
-    };
-
-    return {
-        /**
-         * Returns a reference to the underlying {@link Ext.Window} element
-         * @return {Ext.Window} The window
-         */
-        getDialog : function(titleText){
-           if(!dlg){
-                dlg = new Ext.Window({
-                    autoCreate : true,
-                    title:titleText,
-                    resizable:false,
-                    constrain:true,
-                    constrainHeader:true,
-                    minimizable : false,
-                    maximizable : false,
-                    stateful: false,
-                    modal: true,
-                    shim:true,
-                    buttonAlign:"center",
-                    width:400,
-                    height:100,
-                    minHeight: 80,
-                    plain:true,
-                    footer:true,
-                    closable:true,
-                    close : function(){
-                        if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
-                            handleButton("no");
-                        }else{
-                            handleButton("cancel");
-                        }
-                    }
-                });
-                buttons = {};
-                var bt = this.buttonText;
-                //TODO: refactor this block into a buttons config to pass into the Window constructor
-                buttons["ok"] = dlg.addButton(bt["ok"], handleButton.createCallback("ok"));
-                buttons["yes"] = dlg.addButton(bt["yes"], handleButton.createCallback("yes"));
-                buttons["no"] = dlg.addButton(bt["no"], handleButton.createCallback("no"));
-                buttons["cancel"] = dlg.addButton(bt["cancel"], handleButton.createCallback("cancel"));
-                buttons["ok"].hideMode = buttons["yes"].hideMode = buttons["no"].hideMode = buttons["cancel"].hideMode = 'offsets';
-                dlg.render(document.body);
-                dlg.getEl().addClass('x-window-dlg');
-                mask = dlg.mask;
-                bodyEl = dlg.body.createChild({
-                    html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'
-                });
-                iconEl = Ext.get(bodyEl.dom.firstChild);
-                var contentEl = bodyEl.dom.childNodes[1];
-                msgEl = Ext.get(contentEl.firstChild);
-                textboxEl = Ext.get(contentEl.childNodes[2].firstChild);
-                textboxEl.enableDisplayMode();
-                textboxEl.addKeyListener([10,13], function(){
-                    if(dlg.isVisible() && opt && opt.buttons){
-                        if(opt.buttons.ok){
-                            handleButton("ok");
-                        }else if(opt.buttons.yes){
-                            handleButton("yes");
-                        }
-                    }
-                });
-                textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]);
-                textareaEl.enableDisplayMode();
-                progressBar = new Ext.ProgressBar({
-                    renderTo:bodyEl
-                });
-               bodyEl.createChild({cls:'x-clear'});
-            }
-            return dlg;
-        },
+        return this.readRecords(doc);
+    },
 
+    /**
+     * Create a data block containing Ext.data.Records from an XML document.
+     * @param {Object} doc A parsed XML document.
+     * @return {Object} records A data block which is used by an {@link Ext.data.Store} as
+     * a cache of Ext.data.Records.
+     */
+    readRecords : function(doc){
         /**
-         * Updates the message box body text
-         * @param {String} text (optional) Replaces the message box element's innerHTML with the specified string (defaults to
-         * the XHTML-compliant non-breaking space character '&amp;#160;')
-         * @return {Ext.MessageBox} this
+         * After any data loads/reads, the raw XML Document is available for further custom processing.
+         * @type XMLDocument
          */
-        updateText : function(text){
-            if(!dlg.isVisible() && !opt.width){
-                dlg.setSize(this.maxWidth, 100); // resize first so content is never clipped from previous shows
-            }
-            msgEl.update(text || '&#160;');
+        this.xmlData = doc;
 
-            var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0;
-            var mw = msgEl.getWidth() + msgEl.getMargins('lr');
-            var fw = dlg.getFrameWidth('lr');
-            var bw = dlg.body.getFrameWidth('lr');
-            if (Ext.isIE && iw > 0){
-                //3 pixels get subtracted in the icon CSS for an IE margin issue,
-                //so we have to add it back here for the overall width to be consistent
-                iw += 3;
-            }
-            var w = Math.max(Math.min(opt.width || iw+mw+fw+bw, this.maxWidth),
-                        Math.max(opt.minWidth || this.minWidth, bwidth || 0));
+        var root    = doc.documentElement || doc,
+            q       = Ext.DomQuery,
+            totalRecords = 0,
+            success = true;
 
-            if(opt.prompt === true){
-                activeTextEl.setWidth(w-iw-fw-bw);
-            }
-            if(opt.progress === true || opt.wait === true){
-                progressBar.setSize(w-iw-fw-bw);
-            }
-            if(Ext.isIE && w == bwidth){
-                w += 4; //Add offset when the content width is smaller than the buttons.    
-            }
-            dlg.setSize(w, 'auto').center();
-            return this;
-        },
+        if(this.meta.totalProperty){
+            totalRecords = this.getTotal(root, 0);
+        }
+        if(this.meta.successProperty){
+            success = this.getSuccess(root);
+        }
 
-        /**
-         * Updates a progress-style message box's text and progress bar. Only relevant on message boxes
-         * initiated via {@link Ext.MessageBox#progress} or {@link Ext.MessageBox#wait},
-         * or by calling {@link Ext.MessageBox#show} with progress: true.
-         * @param {Number} value Any number between 0 and 1 (e.g., .5, defaults to 0)
-         * @param {String} progressText The progress text to display inside the progress bar (defaults to '')
-         * @param {String} msg The message box's body text is replaced with the specified string (defaults to undefined
-         * so that any existing body text will not get overwritten by default unless a new value is passed in)
-         * @return {Ext.MessageBox} this
-         */
-        updateProgress : function(value, progressText, msg){
-            progressBar.updateProgress(value, progressText);
-            if(msg){
-                this.updateText(msg);
-            }
-            return this;
-        },
+        var records = this.extractData(q.select(this.meta.record, root), true); // <-- true to return Ext.data.Record[]
 
-        /**
-         * Returns true if the message box is currently displayed
-         * @return {Boolean} True if the message box is visible, else false
-         */
-        isVisible : function(){
-            return dlg && dlg.isVisible();
-        },
+        // TODO return Ext.data.Response instance.  @see #readResponse
+        return {
+            success : success,
+            records : records,
+            totalRecords : totalRecords || records.length
+        };
+    },
 
-        /**
-         * Hides the message box if it is displayed
-         * @return {Ext.MessageBox} this
-         */
-        hide : function(){
-            var proxy = dlg ? dlg.activeGhost : null;
-            if(this.isVisible() || proxy){
-                dlg.hide();
-                handleHide();
-                if (proxy){
-                    // unghost is a private function, but i saw no better solution
-                    // to fix the locking problem when dragging while it closes
-                    dlg.unghost(false, false);
-                } 
-            }
-            return this;
-        },
+    /**
+     * Decode a json response from server.
+     * @param {String} action [{@link Ext.data.Api#actions} create|read|update|destroy]
+     * @param {Object} response HTTP Response object from browser.
+     * @return {Ext.data.Response} response Returns an instance of {@link Ext.data.Response}
+     */
+    readResponse : function(action, response) {
+        var q   = Ext.DomQuery,
+        doc     = response.responseXML;
+
+        // create general Response instance.
+        var res = new Ext.data.Response({
+            action: action,
+            success : this.getSuccess(doc),
+            message: this.getMessage(doc),
+            data: this.extractData(q.select(this.meta.record, doc) || q.select(this.meta.root, doc), false),
+            raw: doc
+        });
 
-        /**
-         * Displays a new message box, or reinitializes an existing message box, based on the config options
-         * passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally,
-         * although those calls are basic shortcuts and do not support all of the config options allowed here.
-         * @param {Object} config The following config options are supported: <ul>
-         * <li><b>animEl</b> : String/Element<div class="sub-desc">An id or Element from which the message box should animate as it
-         * opens and closes (defaults to undefined)</div></li>
-         * <li><b>buttons</b> : Object/Boolean<div class="sub-desc">A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo',
-         * cancel:'Bar'}), or false to not show any buttons (defaults to false)</div></li>
-         * <li><b>closable</b> : Boolean<div class="sub-desc">False to hide the top-right close button (defaults to true). Note that
-         * progress and wait dialogs will ignore this property and always hide the close button as they can only
-         * be closed programmatically.</div></li>
-         * <li><b>cls</b> : String<div class="sub-desc">A custom CSS class to apply to the message box's container element</div></li>
-         * <li><b>defaultTextHeight</b> : Number<div class="sub-desc">The default height in pixels of the message box's multiline textarea
-         * if displayed (defaults to 75)</div></li>
-         * <li><b>fn</b> : Function<div class="sub-desc">A callback function which is called when the dialog is dismissed either
-         * by clicking on the configured buttons, or on the dialog close button, or by pressing
-         * the return button to enter input.
-         * <p>Progress and wait dialogs will ignore this option since they do not respond to user
-         * actions and can only be closed programmatically, so any required function should be called
-         * by the same code after it closes the dialog. Parameters passed:<ul>
-         * <li><b>buttonId</b> : String<div class="sub-desc">The ID of the button pressed, one of:<div class="sub-desc"><ul>
-         * <li><tt>ok</tt></li>
-         * <li><tt>yes</tt></li>
-         * <li><tt>no</tt></li>
-         * <li><tt>cancel</tt></li>
-         * </ul></div></div></li>
-         * <li><b>text</b> : String<div class="sub-desc">Value of the input field if either <tt><a href="#show-option-prompt" ext:member="show-option-prompt" ext:cls="Ext.MessageBox">prompt</a></tt>
-         * or <tt><a href="#show-option-multiline" ext:member="show-option-multiline" ext:cls="Ext.MessageBox">multiline</a></tt> is true</div></li>
-         * <li><b>opt</b> : Object<div class="sub-desc">The config object passed to show.</div></li>
-         * </ul></p></div></li>
-         * <li><b>scope</b> : Object<div class="sub-desc">The scope of the callback function</div></li>
-         * <li><b>icon</b> : String<div class="sub-desc">A CSS class that provides a background image to be used as the body icon for the
-         * dialog (e.g. Ext.MessageBox.WARNING or 'custom-class') (defaults to '')</div></li>
-         * <li><b>iconCls</b> : String<div class="sub-desc">The standard {@link Ext.Window#iconCls} to
-         * add an optional header icon (defaults to '')</div></li>
-         * <li><b>maxWidth</b> : Number<div class="sub-desc">The maximum width in pixels of the message box (defaults to 600)</div></li>
-         * <li><b>minWidth</b> : Number<div class="sub-desc">The minimum width in pixels of the message box (defaults to 100)</div></li>
-         * <li><b>modal</b> : Boolean<div class="sub-desc">False to allow user interaction with the page while the message box is
-         * displayed (defaults to true)</div></li>
-         * <li><b>msg</b> : String<div class="sub-desc">A string that will replace the existing message box body text (defaults to the
-         * XHTML-compliant non-breaking space character '&amp;#160;')</div></li>
-         * <li><a id="show-option-multiline"></a><b>multiline</b> : Boolean<div class="sub-desc">
-         * True to prompt the user to enter multi-line text (defaults to false)</div></li>
-         * <li><b>progress</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
-         * <li><b>progressText</b> : String<div class="sub-desc">The text to display inside the progress bar if progress = true (defaults to '')</div></li>
-         * <li><a id="show-option-prompt"></a><b>prompt</b> : Boolean<div class="sub-desc">True to prompt the user to enter single-line text (defaults to false)</div></li>
-         * <li><b>proxyDrag</b> : Boolean<div class="sub-desc">True to display a lightweight proxy while dragging (defaults to false)</div></li>
-         * <li><b>title</b> : String<div class="sub-desc">The title text</div></li>
-         * <li><b>value</b> : String<div class="sub-desc">The string value to set into the active textbox element if displayed</div></li>
-         * <li><b>wait</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
-         * <li><b>waitConfig</b> : Object<div class="sub-desc">A {@link Ext.ProgressBar#waitConfig} object (applies only if wait = true)</div></li>
-         * <li><b>width</b> : Number<div class="sub-desc">The width of the dialog in pixels</div></li>
-         * </ul>
-         * Example usage:
-         * <pre><code>
-Ext.Msg.show({
-   title: 'Address',
-   msg: 'Please enter your address:',
-   width: 300,
-   buttons: Ext.MessageBox.OKCANCEL,
-   multiline: true,
-   fn: saveAddress,
-   animEl: 'addAddressBtn',
-   icon: Ext.MessageBox.INFO
-});
-</code></pre>
-         * @return {Ext.MessageBox} this
-         */
-        show : function(options){
-            if(this.isVisible()){
-                this.hide();
-            }
-            opt = options;
-            var d = this.getDialog(opt.title || "&#160;");
-
-            d.setTitle(opt.title || "&#160;");
-            var allowClose = (opt.closable !== false && opt.progress !== true && opt.wait !== true);
-            d.tools.close.setDisplayed(allowClose);
-            activeTextEl = textboxEl;
-            opt.prompt = opt.prompt || (opt.multiline ? true : false);
-            if(opt.prompt){
-                if(opt.multiline){
-                    textboxEl.hide();
-                    textareaEl.show();
-                    textareaEl.setHeight(typeof opt.multiline == "number" ?
-                        opt.multiline : this.defaultTextHeight);
-                    activeTextEl = textareaEl;
-                }else{
-                    textboxEl.show();
-                    textareaEl.hide();
-                }
-            }else{
-                textboxEl.hide();
-                textareaEl.hide();
-            }
-            activeTextEl.dom.value = opt.value || "";
-            if(opt.prompt){
-                d.focusEl = activeTextEl;
-            }else{
-                var bs = opt.buttons;
-                var db = null;
-                if(bs && bs.ok){
-                    db = buttons["ok"];
-                }else if(bs && bs.yes){
-                    db = buttons["yes"];
-                }
-                if (db){
-                    d.focusEl = db;
-                }
-            }
-            if(opt.iconCls){
-              d.setIconClass(opt.iconCls);
-            }
-            this.setIcon(opt.icon);
-            if(opt.cls){
-                d.el.addClass(opt.cls);
-            }
-            d.proxyDrag = opt.proxyDrag === true;
-            d.modal = opt.modal !== false;
-            d.mask = opt.modal !== false ? mask : false;
-            
-            d.on('show', function(){
-                //workaround for window internally enabling keymap in afterShow
-                d.keyMap.setDisabled(allowClose !== true);
-                d.doLayout();
-                this.setIcon(opt.icon);
-                bwidth = updateButtons(opt.buttons);
-                progressBar.setVisible(opt.progress === true || opt.wait === true);
-                this.updateProgress(0, opt.progressText);
-                this.updateText(opt.msg);
-                if(opt.wait === true){
-                    progressBar.wait(opt.waitConfig);
-                }
+        if (Ext.isEmpty(res.success)) {
+            throw new Ext.data.DataReader.Error('successProperty-response', this.meta.successProperty);
+        }
 
-            }, this, {single:true});
-            if(!d.isVisible()){
-                // force it to the end of the z-index stack so it gets a cursor in FF
-                document.body.appendChild(dlg.el.dom);
-                d.setAnimateTarget(opt.animEl);
-                d.show(opt.animEl);
+        // Create actions from a response having status 200 must return pk
+        if (action === Ext.data.Api.actions.create) {
+            var def = Ext.isDefined(res.data);
+            if (def && Ext.isEmpty(res.data)) {
+                throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
             }
-            return this;
-        },
-
-        /**
-         * Adds the specified icon to the dialog.  By default, the class 'ext-mb-icon' is applied for default
-         * styling, and the class passed in is expected to supply the background image url. Pass in empty string ('')
-         * to clear any existing icon.  The following built-in icon classes are supported, but you can also pass
-         * in a custom class name:
-         * <pre>
-Ext.MessageBox.INFO
-Ext.MessageBox.WARNING
-Ext.MessageBox.QUESTION
-Ext.MessageBox.ERROR
-         *</pre>
-         * @param {String} icon A CSS classname specifying the icon's background image url, or empty string to clear the icon
-         * @return {Ext.MessageBox} this
-         */
-        setIcon : function(icon){
-            if(icon && icon != ''){
-                iconEl.removeClass('x-hidden');
-                iconEl.replaceClass(iconCls, icon);
-                bodyEl.addClass('x-dlg-icon');
-                iconCls = icon;
-            }else{
-                iconEl.replaceClass(iconCls, 'x-hidden');
-                bodyEl.removeClass('x-dlg-icon');
-                iconCls = '';
+            else if (!def) {
+                throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
             }
-            return this;
-        },
-
-        /**
-         * Displays a message box with a progress bar.  This message box has no buttons and is not closeable by
-         * the user.  You are responsible for updating the progress bar as needed via {@link Ext.MessageBox#updateProgress}
-         * and closing the message box when the process is complete.
-         * @param {String} title The title bar text
-         * @param {String} msg The message box body text
-         * @param {String} progressText (optional) The text to display inside the progress bar (defaults to '')
-         * @return {Ext.MessageBox} this
-         */
-        progress : function(title, msg, progressText){
-            this.show({
-                title : title,
-                msg : msg,
-                buttons: false,
-                progress:true,
-                closable:false,
-                minWidth: this.minProgressWidth,
-                progressText: progressText
-            });
-            return this;
-        },
-
-        /**
-         * Displays a message box with an infinitely auto-updating progress bar.  This can be used to block user
-         * interaction while waiting for a long-running process to complete that does not have defined intervals.
-         * You are responsible for closing the message box when the process is complete.
-         * @param {String} msg The message box body text
-         * @param {String} title (optional) The title bar text
-         * @param {Object} config (optional) A {@link Ext.ProgressBar#waitConfig} object
-         * @return {Ext.MessageBox} this
-         */
-        wait : function(msg, title, config){
-            this.show({
-                title : title,
-                msg : msg,
-                buttons: false,
-                closable:false,
-                wait:true,
-                modal:true,
-                minWidth: this.minProgressWidth,
-                waitConfig: config
-            });
-            return this;
-        },
+        }
+        return res;
+    },
 
-        /**
-         * Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt).
-         * If a callback function is passed it will be called after the user clicks the button, and the
-         * id of the button that was clicked will be passed as the only parameter to the callback
-         * (could also be the top-right close button).
-         * @param {String} title The title bar text
-         * @param {String} msg The message box body text
-         * @param {Function} fn (optional) The callback function invoked after the message box is closed
-         * @param {Object} scope (optional) The scope of the callback function
-         * @return {Ext.MessageBox} this
-         */
-        alert : function(title, msg, fn, scope){
-            this.show({
-                title : title,
-                msg : msg,
-                buttons: this.OK,
-                fn: fn,
-                scope : scope
-            });
-            return this;
-        },
+    getSuccess : function() {
+        return true;
+    },
 
-        /**
-         * Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm).
-         * If a callback function is passed it will be called after the user clicks either button,
-         * and the id of the button that was clicked will be passed as the only parameter to the callback
-         * (could also be the top-right close button).
-         * @param {String} title The title bar text
-         * @param {String} msg The message box body text
-         * @param {Function} fn (optional) The callback function invoked after the message box is closed
-         * @param {Object} scope (optional) The scope of the callback function
-         * @return {Ext.MessageBox} this
-         */
-        confirm : function(title, msg, fn, scope){
-            this.show({
-                title : title,
-                msg : msg,
-                buttons: this.YESNO,
-                fn: fn,
-                scope : scope,
-                icon: this.QUESTION
-            });
-            return this;
-        },
+    /**
+     * build response-data extractor functions.
+     * @private
+     * @ignore
+     */
+    buildExtractors : function() {
+        if(this.ef){
+            return;
+        }
+        var s       = this.meta,
+            Record  = this.recordType,
+            f       = Record.prototype.fields,
+            fi      = f.items,
+            fl      = f.length;
 
-        /**
-         * Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt).
-         * The prompt can be a single-line or multi-line textbox.  If a callback function is passed it will be called after the user
-         * clicks either button, and the id of the button that was clicked (could also be the top-right
-         * close button) and the text that was entered will be passed as the two parameters to the callback.
-         * @param {String} title The title bar text
-         * @param {String} msg The message box body text
-         * @param {Function} fn (optional) The callback function invoked after the message box is closed
-         * @param {Object} scope (optional) The scope of the callback function
-         * @param {Boolean/Number} multiline (optional) True to create a multiline textbox using the defaultTextHeight
-         * property, or the height in pixels to create the textbox (defaults to false / single-line)
-         * @param {String} value (optional) Default value of the text input element (defaults to '')
-         * @return {Ext.MessageBox} this
-         */
-        prompt : function(title, msg, fn, scope, multiline, value){
-            this.show({
-                title : title,
-                msg : msg,
-                buttons: this.OKCANCEL,
-                fn: fn,
-                minWidth:250,
-                scope : scope,
-                prompt:true,
-                multiline: multiline,
-                value: value
-            });
-            return this;
-        },
+        if(s.totalProperty) {
+            this.getTotal = this.createAccessor(s.totalProperty);
+        }
+        if(s.successProperty) {
+            this.getSuccess = this.createAccessor(s.successProperty);
+        }
+        if (s.messageProperty) {
+            this.getMessage = this.createAccessor(s.messageProperty);
+        }
+        this.getRoot = function(res) {
+            return (!Ext.isEmpty(res[this.meta.record])) ? res[this.meta.record] : res[this.meta.root];
+        }
+        if (s.idPath || s.idProperty) {
+            var g = this.createAccessor(s.idPath || s.idProperty);
+            this.getId = function(rec) {
+                var id = g(rec) || rec.id;
+                return (id === undefined || id === '') ? null : id;
+            };
+        } else {
+            this.getId = function(){return null;};
+        }
+        var ef = [];
+        for(var i = 0; i < fl; i++){
+            f = fi[i];
+            var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
+            ef.push(this.createAccessor(map));
+        }
+        this.ef = ef;
+    },
 
-        /**
-         * Button config that displays a single OK button
-         * @type Object
-         */
-        OK : {ok:true},
-        /**
-         * Button config that displays a single Cancel button
-         * @type Object
-         */
-        CANCEL : {cancel:true},
-        /**
-         * Button config that displays OK and Cancel buttons
-         * @type Object
-         */
-        OKCANCEL : {ok:true, cancel:true},
-        /**
-         * Button config that displays Yes and No buttons
-         * @type Object
-         */
-        YESNO : {yes:true, no:true},
-        /**
-         * Button config that displays Yes, No and Cancel buttons
-         * @type Object
-         */
-        YESNOCANCEL : {yes:true, no:true, cancel:true},
-        /**
-         * The CSS class that provides the INFO icon image
-         * @type String
-         */
-        INFO : 'ext-mb-info',
-        /**
-         * The CSS class that provides the WARNING icon image
-         * @type String
-         */
-        WARNING : 'ext-mb-warning',
-        /**
-         * The CSS class that provides the QUESTION icon image
-         * @type String
-         */
-        QUESTION : 'ext-mb-question',
-        /**
-         * The CSS class that provides the ERROR icon image
-         * @type String
-         */
-        ERROR : 'ext-mb-error',
+    /**
+     * Creates a function to return some particular key of data from a response.
+     * @param {String} key
+     * @return {Function}
+     * @private
+     * @ignore
+     */
+    createAccessor : function(){
+        var q = Ext.DomQuery;
+        return function(key) {
+            switch(key) {
+                case this.meta.totalProperty:
+                    return function(root, def){
+                        return q.selectNumber(key, root, def);
+                    }
+                    break;
+                case this.meta.successProperty:
+                    return function(root, def) {
+                        var sv = q.selectValue(key, root, true);
+                        var success = sv !== false && sv !== 'false';
+                        return success;
+                    }
+                    break;
+                default:
+                    return function(root, def) {
+                        return q.selectValue(key, root, def);
+                    }
+                    break;
+            }
+        };
+    }(),
 
-        /**
-         * The default height in pixels of the message box's multiline textarea if displayed (defaults to 75)
-         * @type Number
-         */
-        defaultTextHeight : 75,
-        /**
-         * The maximum width in pixels of the message box (defaults to 600)
-         * @type Number
-         */
-        maxWidth : 600,
-        /**
-         * The minimum width in pixels of the message box (defaults to 110)
-         * @type Number
-         */
-        minWidth : 110,
-        /**
-         * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful
-         * for setting a different minimum width than text-only dialogs may need (defaults to 250)
-         * @type Number
-         */
-        minProgressWidth : 250,
-        /**
-         * An object containing the default button text strings that can be overriden for localized language support.
-         * Supported properties are: ok, cancel, yes and no.  Generally you should include a locale-specific
-         * resource file for handling language support across the framework.
-         * Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french
-         * @type Object
-         */
-        buttonText : {
-            ok : "OK",
-            cancel : "Cancel",
-            yes : "Yes",
-            no : "No"
+    /**
+     * extracts values and type-casts a row of data from server, extracted by #extractData
+     * @param {Hash} data
+     * @param {Ext.data.Field[]} items
+     * @param {Number} len
+     * @private
+     * @ignore
+     */
+    extractValues : function(data, items, len) {
+        var f, values = {};
+        for(var j = 0; j < len; j++){
+            f = items[j];
+            var v = this.ef[j](data);
+            values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data);
         }
-    };
-}();
-
-/**
- * Shorthand for {@link Ext.MessageBox}
- */
-Ext.Msg = Ext.MessageBox;/**\r
- * @class Ext.dd.PanelProxy\r
- * A custom drag proxy implementation specific to {@link Ext.Panel}s. This class is primarily used internally\r
- * for the Panel's drag drop implementation, and should never need to be created directly.\r
+        return values;
+    }
+});/**\r
+ * @class Ext.data.XmlStore\r
+ * @extends Ext.data.Store\r
+ * <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.\r
+ * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.</p>\r
+ * <p>A store configuration would be something like:<pre><code>\r
+var store = new Ext.data.XmlStore({\r
+    // store configs\r
+    autoDestroy: true,\r
+    storeId: 'myStore',\r
+    url: 'sheldon.xml', // automatically configures a HttpProxy\r
+    // reader configs\r
+    record: 'Item', // records will have an "Item" tag\r
+    idPath: 'ASIN',\r
+    totalRecords: '@TotalResults'\r
+    fields: [\r
+        // set up the fields mapping into the xml doc\r
+        // The first needs mapping, the others are very basic\r
+        {name: 'Author', mapping: 'ItemAttributes > Author'},\r
+        'Title', 'Manufacturer', 'ProductGroup'\r
+    ]\r
+});\r
+ * </code></pre></p>\r
+ * <p>This store is configured to consume a returned object of the form:<pre><code>\r
+&#60?xml version="1.0" encoding="UTF-8"?>\r
+&#60ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">\r
+    &#60Items>\r
+        &#60Request>\r
+            &#60IsValid>True&#60/IsValid>\r
+            &#60ItemSearchRequest>\r
+                &#60Author>Sidney Sheldon&#60/Author>\r
+                &#60SearchIndex>Books&#60/SearchIndex>\r
+            &#60/ItemSearchRequest>\r
+        &#60/Request>\r
+        &#60TotalResults>203&#60/TotalResults>\r
+        &#60TotalPages>21&#60/TotalPages>\r
+        &#60Item>\r
+            &#60ASIN>0446355453&#60/ASIN>\r
+            &#60DetailPageURL>\r
+                http://www.amazon.com/\r
+            &#60/DetailPageURL>\r
+            &#60ItemAttributes>\r
+                &#60Author>Sidney Sheldon&#60/Author>\r
+                &#60Manufacturer>Warner Books&#60/Manufacturer>\r
+                &#60ProductGroup>Book&#60/ProductGroup>\r
+                &#60Title>Master of the Game&#60/Title>\r
+            &#60/ItemAttributes>\r
+        &#60/Item>\r
+    &#60/Items>\r
+&#60/ItemSearchResponse>\r
+ * </code></pre>\r
+ * An object literal of this form could also be used as the {@link #data} config option.</p>\r
+ * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of \r
+ * <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>\r
+ * @constructor\r
+ * @param {Object} config\r
+ * @xtype xmlstore\r
+ */\r
+Ext.data.XmlStore = Ext.extend(Ext.data.Store, {\r
+    /**\r
+     * @cfg {Ext.data.DataReader} reader @hide\r
+     */\r
+    constructor: function(config){\r
+        Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, {\r
+            reader: new Ext.data.XmlReader(config)\r
+        }));\r
+    }\r
+});\r
+Ext.reg('xmlstore', Ext.data.XmlStore);/**\r
+ * @class Ext.data.GroupingStore\r
+ * @extends Ext.data.Store\r
+ * A specialized store implementation that provides for grouping records by one of the available fields. This\r
+ * is usually used in conjunction with an {@link Ext.grid.GroupingView} to proved the data model for\r
+ * a grouped GridPanel.\r
+ * @constructor\r
+ * Creates a new GroupingStore.\r
+ * @param {Object} config A config object containing the objects needed for the Store to access data,\r
+ * and read the data into Records.\r
+ * @xtype groupingstore\r
+ */\r
+Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {\r
+\r
+    //inherit docs\r
+    constructor: function(config){\r
+        Ext.data.GroupingStore.superclass.constructor.call(this, config);\r
+        this.applyGroupField();\r
+    },\r
+\r
+    /**\r
+     * @cfg {String} groupField\r
+     * The field name by which to sort the store's data (defaults to '').\r
+     */\r
+    /**\r
+     * @cfg {Boolean} remoteGroup\r
+     * True if the grouping should apply on the server side, false if it is local only (defaults to false).  If the\r
+     * grouping is local, it can be applied immediately to the data.  If it is remote, then it will simply act as a\r
+     * helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call.\r
+     */\r
+    remoteGroup : false,\r
+    /**\r
+     * @cfg {Boolean} groupOnSort\r
+     * True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the\r
+     * existing sort info (defaults to false).\r
+     */\r
+    groupOnSort:false,\r
+\r
+    groupDir : 'ASC',\r
+\r
+    /**\r
+     * Clears any existing grouping and refreshes the data using the default sort.\r
+     */\r
+    clearGrouping : function(){\r
+        this.groupField = false;\r
+\r
+        if(this.remoteGroup){\r
+            if(this.baseParams){\r
+                delete this.baseParams.groupBy;\r
+                delete this.baseParams.groupDir;\r
+            }\r
+            var lo = this.lastOptions;\r
+            if(lo && lo.params){\r
+                delete lo.params.groupBy;\r
+                delete lo.params.groupDir;\r
+            }\r
+\r
+            this.reload();\r
+        }else{\r
+            this.applySort();\r
+            this.fireEvent('datachanged', this);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Groups the data by the specified field.\r
+     * @param {String} field The field name by which to sort the store's data\r
+     * @param {Boolean} forceRegroup (optional) True to force the group to be refreshed even if the field passed\r
+     * in is the same as the current grouping field, false to skip grouping on the same field (defaults to false)\r
+     */\r
+    groupBy : function(field, forceRegroup, direction){\r
+        direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;\r
+        if(this.groupField == field && this.groupDir == direction && !forceRegroup){\r
+            return; // already grouped by this field\r
+        }\r
+        this.groupField = field;\r
+        this.groupDir = direction;\r
+        this.applyGroupField();\r
+        if(this.groupOnSort){\r
+            this.sort(field, direction);\r
+            return;\r
+        }\r
+        if(this.remoteGroup){\r
+            this.reload();\r
+        }else{\r
+            var si = this.sortInfo || {};\r
+            if(forceRegroup || si.field != field || si.direction != direction){\r
+                this.applySort();\r
+            }else{\r
+                this.sortData(field, direction);\r
+            }\r
+            this.fireEvent('datachanged', this);\r
+        }\r
+    },\r
+\r
+    // private\r
+    applyGroupField: function(){\r
+        if(this.remoteGroup){\r
+            if(!this.baseParams){\r
+                this.baseParams = {};\r
+            }\r
+            Ext.apply(this.baseParams, {\r
+                groupBy : this.groupField,\r
+                groupDir : this.groupDir\r
+            });\r
+\r
+            var lo = this.lastOptions;\r
+            if(lo && lo.params){\r
+                Ext.apply(lo.params, {\r
+                    groupBy : this.groupField,\r
+                    groupDir : this.groupDir\r
+                });\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    applySort : function(){\r
+        Ext.data.GroupingStore.superclass.applySort.call(this);\r
+        if(!this.groupOnSort && !this.remoteGroup){\r
+            var gs = this.getGroupState();\r
+            if(gs && (gs != this.sortInfo.field || this.groupDir != this.sortInfo.direction)){\r
+                this.sortData(this.groupField, this.groupDir);\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    applyGrouping : function(alwaysFireChange){\r
+        if(this.groupField !== false){\r
+            this.groupBy(this.groupField, true, this.groupDir);\r
+            return true;\r
+        }else{\r
+            if(alwaysFireChange === true){\r
+                this.fireEvent('datachanged', this);\r
+            }\r
+            return false;\r
+        }\r
+    },\r
+\r
+    // private\r
+    getGroupState : function(){\r
+        return this.groupOnSort && this.groupField !== false ?\r
+               (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField;\r
+    }\r
+});\r
+Ext.reg('groupingstore', Ext.data.GroupingStore);/**\r
+ * @class Ext.data.DirectProxy\r
+ * @extends Ext.data.DataProxy\r
+ */\r
+Ext.data.DirectProxy = function(config){\r
+    Ext.apply(this, config);\r
+    if(typeof this.paramOrder == 'string'){\r
+        this.paramOrder = this.paramOrder.split(/[\s,|]/);\r
+    }\r
+    Ext.data.DirectProxy.superclass.constructor.call(this, config);\r
+};\r
+\r
+Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, {\r
+    /**\r
+     * @cfg {Array/String} paramOrder Defaults to <tt>undefined</tt>. A list of params to be executed\r
+     * server side.  Specify the params in the order in which they must be executed on the server-side\r
+     * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace,\r
+     * comma, or pipe. For example,\r
+     * any of the following would be acceptable:<pre><code>\r
+paramOrder: ['param1','param2','param3']\r
+paramOrder: 'param1 param2 param3'\r
+paramOrder: 'param1,param2,param3'\r
+paramOrder: 'param1|param2|param'\r
+     </code></pre>\r
+     */\r
+    paramOrder: undefined,\r
+\r
+    /**\r
+     * @cfg {Boolean} paramsAsHash\r
+     * Send parameters as a collection of named arguments (defaults to <tt>true</tt>). Providing a\r
+     * <tt>{@link #paramOrder}</tt> nullifies this configuration.\r
+     */\r
+    paramsAsHash: true,\r
+\r
+    /**\r
+     * @cfg {Function} directFn\r
+     * Function to call when executing a request.  directFn is a simple alternative to defining the api configuration-parameter\r
+     * for Store's which will not implement a full CRUD api.\r
+     */\r
+    directFn : undefined,\r
+\r
+    /**\r
+     * DirectProxy implementation of {@link Ext.data.DataProxy#doRequest}\r
+     * @param {String} action The crud action type (create, read, update, destroy)\r
+     * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null\r
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
+     * for the request to the remote server.\r
+     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
+     * object into a block of Ext.data.Records.\r
+     * @param {Function} callback\r
+     * <div class="sub-desc"><p>A function to be called after the request.\r
+     * The <tt>callback</tt> is passed the following arguments:<ul>\r
+     * <li><tt>r</tt> : Ext.data.Record[] The block of Ext.data.Records.</li>\r
+     * <li><tt>options</tt>: Options object from the action request</li>\r
+     * <li><tt>success</tt>: Boolean success indicator</li></ul></p></div>\r
+     * @param {Object} scope The scope (<code>this</code> reference) in which the callback function is executed. Defaults to the browser window.\r
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
+     * @protected\r
+     */\r
+    doRequest : function(action, rs, params, reader, callback, scope, options) {\r
+        var args = [],\r
+            directFn = this.api[action] || this.directFn;\r
+\r
+        switch (action) {\r
+            case Ext.data.Api.actions.create:\r
+                args.push(params.jsonData);            // <-- create(Hash)\r
+                break;\r
+            case Ext.data.Api.actions.read:\r
+                // If the method has no parameters, ignore the paramOrder/paramsAsHash.\r
+                if(directFn.directCfg.method.len > 0){\r
+                    if(this.paramOrder){\r
+                        for(var i = 0, len = this.paramOrder.length; i < len; i++){\r
+                            args.push(params[this.paramOrder[i]]);\r
+                        }\r
+                    }else if(this.paramsAsHash){\r
+                        args.push(params);\r
+                    }\r
+                }\r
+                break;\r
+            case Ext.data.Api.actions.update:\r
+                args.push(params.jsonData);        // <-- update(Hash/Hash[])\r
+                break;\r
+            case Ext.data.Api.actions.destroy:\r
+                args.push(params.jsonData);        // <-- destroy(Int/Int[])\r
+                break;\r
+        }\r
+\r
+        var trans = {\r
+            params : params || {},\r
+            request: {\r
+                callback : callback,\r
+                scope : scope,\r
+                arg : options\r
+            },\r
+            reader: reader\r
+        };\r
+\r
+        args.push(this.createCallback(action, rs, trans), this);\r
+        directFn.apply(window, args);\r
+    },\r
+\r
+    // private\r
+    createCallback : function(action, rs, trans) {\r
+        return function(result, res) {\r
+            if (!res.status) {\r
+                // @deprecated fire loadexception\r
+                if (action === Ext.data.Api.actions.read) {\r
+                    this.fireEvent("loadexception", this, trans, res, null);\r
+                }\r
+                this.fireEvent('exception', this, 'remote', action, trans, res, null);\r
+                trans.request.callback.call(trans.request.scope, null, trans.request.arg, false);\r
+                return;\r
+            }\r
+            if (action === Ext.data.Api.actions.read) {\r
+                this.onRead(action, trans, result, res);\r
+            } else {\r
+                this.onWrite(action, trans, result, res, rs);\r
+            }\r
+        };\r
+    },\r
+    /**\r
+     * Callback for read actions\r
+     * @param {String} action [Ext.data.Api.actions.create|read|update|destroy]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} result Data object picked out of the server-response.\r
+     * @param {Object} res The server response\r
+     * @protected\r
+     */\r
+    onRead : function(action, trans, result, res) {\r
+        var records;\r
+        try {\r
+            records = trans.reader.readRecords(result);\r
+        }\r
+        catch (ex) {\r
+            // @deprecated: Fire old loadexception for backwards-compat.\r
+            this.fireEvent("loadexception", this, trans, res, ex);\r
+\r
+            this.fireEvent('exception', this, 'response', action, trans, res, ex);\r
+            trans.request.callback.call(trans.request.scope, null, trans.request.arg, false);\r
+            return;\r
+        }\r
+        this.fireEvent("load", this, res, trans.request.arg);\r
+        trans.request.callback.call(trans.request.scope, records, trans.request.arg, true);\r
+    },\r
+    /**\r
+     * Callback for write actions\r
+     * @param {String} action [{@link Ext.data.Api#actions create|read|update|destroy}]\r
+     * @param {Object} trans The request transaction object\r
+     * @param {Object} result Data object picked out of the server-response.\r
+     * @param {Object} res The server response\r
+     * @param {Ext.data.Record/[Ext.data.Record]} rs The Store resultset associated with the action.\r
+     * @protected\r
+     */\r
+    onWrite : function(action, trans, result, res, rs) {\r
+        var data = trans.reader.extractData(result, false);\r
+        this.fireEvent("write", this, action, data, res, rs, trans.request.arg);\r
+        trans.request.callback.call(trans.request.scope, data, res, true);\r
+    }\r
+});\r
+\r
+/**\r
+ * @class Ext.data.DirectStore\r
+ * @extends Ext.data.Store\r
+ * <p>Small helper class to create an {@link Ext.data.Store} configured with an\r
+ * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting\r
+ * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier.\r
+ * To create a different proxy/reader combination create a basic {@link Ext.data.Store}\r
+ * configured as needed.</p>\r
+ *\r
+ * <p><b>*Note:</b> Although they are not listed, this class inherits all of the config options of:</p>\r
+ * <div><ul class="mdetail-params">\r
+ * <li><b>{@link Ext.data.Store Store}</b></li>\r
+ * <div class="sub-desc"><ul class="mdetail-params">\r
+ *\r
+ * </ul></div>\r
+ * <li><b>{@link Ext.data.JsonReader JsonReader}</b></li>\r
+ * <div class="sub-desc"><ul class="mdetail-params">\r
+ * <li><tt><b>{@link Ext.data.JsonReader#root root}</b></tt></li>\r
+ * <li><tt><b>{@link Ext.data.JsonReader#idProperty idProperty}</b></tt></li>\r
+ * <li><tt><b>{@link Ext.data.JsonReader#totalProperty totalProperty}</b></tt></li>\r
+ * </ul></div>\r
+ *\r
+ * <li><b>{@link Ext.data.DirectProxy DirectProxy}</b></li>\r
+ * <div class="sub-desc"><ul class="mdetail-params">\r
+ * <li><tt><b>{@link Ext.data.DirectProxy#directFn directFn}</b></tt></li>\r
+ * <li><tt><b>{@link Ext.data.DirectProxy#paramOrder paramOrder}</b></tt></li>\r
+ * <li><tt><b>{@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}</b></tt></li>\r
+ * </ul></div>\r
+ * </ul></div>\r
+ *\r
+ * @xtype directstore\r
+ *\r
  * @constructor\r
- * @param panel The {@link Ext.Panel} to proxy for\r
- * @param config Configuration options\r
+ * @param {Object} config\r
+ */\r
+Ext.data.DirectStore = Ext.extend(Ext.data.Store, {\r
+    constructor : function(config){\r
+        // each transaction upon a singe record will generate a distinct Direct transaction since Direct queues them into one Ajax request.\r
+        var c = Ext.apply({}, {\r
+            batchTransactions: false\r
+        }, config);\r
+        Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, {\r
+            proxy: Ext.isDefined(c.proxy) ? c.proxy : new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')),\r
+            reader: (!Ext.isDefined(c.reader) && c.fields) ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader\r
+        }));\r
+    }\r
+});\r
+Ext.reg('directstore', Ext.data.DirectStore);
+/**\r
+ * @class Ext.Direct\r
+ * @extends Ext.util.Observable\r
+ * <p><b><u>Overview</u></b></p>\r
+ * \r
+ * <p>Ext.Direct aims to streamline communication between the client and server\r
+ * by providing a single interface that reduces the amount of common code\r
+ * typically required to validate data and handle returned data packets\r
+ * (reading data, error conditions, etc).</p>\r
+ *  \r
+ * <p>The Ext.direct namespace includes several classes for a closer integration\r
+ * with the server-side. The Ext.data namespace also includes classes for working\r
+ * with Ext.data.Stores which are backed by data from an Ext.Direct method.</p>\r
+ * \r
+ * <p><b><u>Specification</u></b></p>\r
+ * \r
+ * <p>For additional information consult the \r
+ * <a href="http://extjs.com/products/extjs/direct.php">Ext.Direct Specification</a>.</p>\r
+ *   \r
+ * <p><b><u>Providers</u></b></p>\r
+ * \r
+ * <p>Ext.Direct uses a provider architecture, where one or more providers are\r
+ * used to transport data to and from the server. There are several providers\r
+ * that exist in the core at the moment:</p><div class="mdetail-params"><ul>\r
+ * \r
+ * <li>{@link Ext.direct.JsonProvider JsonProvider} for simple JSON operations</li>\r
+ * <li>{@link Ext.direct.PollingProvider PollingProvider} for repeated requests</li>\r
+ * <li>{@link Ext.direct.RemotingProvider RemotingProvider} exposes server side\r
+ * on the client.</li>\r
+ * </ul></div>\r
+ * \r
+ * <p>A provider does not need to be invoked directly, providers are added via\r
+ * {@link Ext.Direct}.{@link Ext.Direct#add add}.</p>\r
+ * \r
+ * <p><b><u>Router</u></b></p>\r
+ * \r
+ * <p>Ext.Direct utilizes a "router" on the server to direct requests from the client\r
+ * to the appropriate server-side method. Because the Ext.Direct API is completely\r
+ * platform-agnostic, you could completely swap out a Java based server solution\r
+ * and replace it with one that uses C# without changing the client side JavaScript\r
+ * at all.</p>\r
+ * \r
+ * <p><b><u>Server side events</u></b></p>\r
+ * \r
+ * <p>Custom events from the server may be handled by the client by adding\r
+ * listeners, for example:</p>\r
+ * <pre><code>\r
+{"type":"event","name":"message","data":"Successfully polled at: 11:19:30 am"}\r
+\r
+// add a handler for a 'message' event sent by the server \r
+Ext.Direct.on('message', function(e){\r
+    out.append(String.format('&lt;p>&lt;i>{0}&lt;/i>&lt;/p>', e.data));\r
+            out.el.scrollTo('t', 100000, true);\r
+});\r
+ * </code></pre>\r
+ * @singleton\r
+ */\r
+Ext.Direct = Ext.extend(Ext.util.Observable, {\r
+    /**\r
+     * Each event type implements a getData() method. The default event types are:\r
+     * <div class="mdetail-params"><ul>\r
+     * <li><b><tt>event</tt></b> : Ext.Direct.Event</li>\r
+     * <li><b><tt>exception</tt></b> : Ext.Direct.ExceptionEvent</li>\r
+     * <li><b><tt>rpc</tt></b> : Ext.Direct.RemotingEvent</li>\r
+     * </ul></div>\r
+     * @property eventTypes\r
+     * @type Object\r
+     */\r
+\r
+    /**\r
+     * Four types of possible exceptions which can occur:\r
+     * <div class="mdetail-params"><ul>\r
+     * <li><b><tt>Ext.Direct.exceptions.TRANSPORT</tt></b> : 'xhr'</li>\r
+     * <li><b><tt>Ext.Direct.exceptions.PARSE</tt></b> : 'parse'</li>\r
+     * <li><b><tt>Ext.Direct.exceptions.LOGIN</tt></b> : 'login'</li>\r
+     * <li><b><tt>Ext.Direct.exceptions.SERVER</tt></b> : 'exception'</li>\r
+     * </ul></div>\r
+     * @property exceptions\r
+     * @type Object\r
+     */\r
+    exceptions: {\r
+        TRANSPORT: 'xhr',\r
+        PARSE: 'parse',\r
+        LOGIN: 'login',\r
+        SERVER: 'exception'\r
+    },\r
+    \r
+    // private\r
+    constructor: function(){\r
+        this.addEvents(\r
+            /**\r
+             * @event event\r
+             * Fires after an event.\r
+             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
+             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
+             */\r
+            'event',\r
+            /**\r
+             * @event exception\r
+             * Fires after an event exception.\r
+             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
+             */\r
+            'exception'\r
+        );\r
+        this.transactions = {};\r
+        this.providers = {};\r
+    },\r
+\r
+    /**\r
+     * Adds an Ext.Direct Provider and creates the proxy or stub methods to execute server-side methods.\r
+     * If the provider is not already connected, it will auto-connect.\r
+     * <pre><code>\r
+var pollProv = new Ext.direct.PollingProvider({\r
+    url: 'php/poll2.php'\r
+}); \r
+\r
+Ext.Direct.addProvider(\r
+    {\r
+        "type":"remoting",       // create a {@link Ext.direct.RemotingProvider} \r
+        "url":"php\/router.php", // url to connect to the Ext.Direct server-side router.\r
+        "actions":{              // each property within the actions object represents a Class \r
+            "TestAction":[       // array of methods within each server side Class   \r
+            {\r
+                "name":"doEcho", // name of method\r
+                "len":1\r
+            },{\r
+                "name":"multiply",\r
+                "len":1\r
+            },{\r
+                "name":"doForm",\r
+                "formHandler":true, // handle form on server with Ext.Direct.Transaction \r
+                "len":1\r
+            }]\r
+        },\r
+        "namespace":"myApplication",// namespace to create the Remoting Provider in\r
+    },{\r
+        type: 'polling', // create a {@link Ext.direct.PollingProvider} \r
+        url:  'php/poll.php'\r
+    },\r
+    pollProv // reference to previously created instance\r
+);\r
+     * </code></pre>\r
+     * @param {Object/Array} provider Accepts either an Array of Provider descriptions (an instance\r
+     * or config object for a Provider) or any number of Provider descriptions as arguments.  Each\r
+     * Provider description instructs Ext.Direct how to create client-side stub methods.\r
+     */\r
+    addProvider : function(provider){        \r
+        var a = arguments;\r
+        if(a.length > 1){\r
+            for(var i = 0, len = a.length; i < len; i++){\r
+                this.addProvider(a[i]);\r
+            }\r
+            return;\r
+        }\r
+        \r
+        // if provider has not already been instantiated\r
+        if(!provider.events){\r
+            provider = new Ext.Direct.PROVIDERS[provider.type](provider);\r
+        }\r
+        provider.id = provider.id || Ext.id();\r
+        this.providers[provider.id] = provider;\r
+\r
+        provider.on('data', this.onProviderData, this);\r
+        provider.on('exception', this.onProviderException, this);\r
+\r
+\r
+        if(!provider.isConnected()){\r
+            provider.connect();\r
+        }\r
+\r
+        return provider;\r
+    },\r
+\r
+    /**\r
+     * Retrieve a {@link Ext.direct.Provider provider} by the\r
+     * <b><tt>{@link Ext.direct.Provider#id id}</tt></b> specified when the provider is\r
+     * {@link #addProvider added}.\r
+     * @param {String} id Unique identifier assigned to the provider when calling {@link #addProvider} \r
+     */\r
+    getProvider : function(id){\r
+        return this.providers[id];\r
+    },\r
+\r
+    removeProvider : function(id){\r
+        var provider = id.id ? id : this.providers[id.id];\r
+        provider.un('data', this.onProviderData, this);\r
+        provider.un('exception', this.onProviderException, this);\r
+        delete this.providers[provider.id];\r
+        return provider;\r
+    },\r
+\r
+    addTransaction: function(t){\r
+        this.transactions[t.tid] = t;\r
+        return t;\r
+    },\r
+\r
+    removeTransaction: function(t){\r
+        delete this.transactions[t.tid || t];\r
+        return t;\r
+    },\r
+\r
+    getTransaction: function(tid){\r
+        return this.transactions[tid.tid || tid];\r
+    },\r
+\r
+    onProviderData : function(provider, e){\r
+        if(Ext.isArray(e)){\r
+            for(var i = 0, len = e.length; i < len; i++){\r
+                this.onProviderData(provider, e[i]);\r
+            }\r
+            return;\r
+        }\r
+        if(e.name && e.name != 'event' && e.name != 'exception'){\r
+            this.fireEvent(e.name, e);\r
+        }else if(e.type == 'exception'){\r
+            this.fireEvent('exception', e);\r
+        }\r
+        this.fireEvent('event', e, provider);\r
+    },\r
+\r
+    createEvent : function(response, extraProps){\r
+        return new Ext.Direct.eventTypes[response.type](Ext.apply(response, extraProps));\r
+    }\r
+});\r
+// overwrite impl. with static instance\r
+Ext.Direct = new Ext.Direct();\r
+\r
+Ext.Direct.TID = 1;\r
+Ext.Direct.PROVIDERS = {};/**\r
+ * @class Ext.Direct.Transaction\r
+ * @extends Object\r
+ * <p>Supporting Class for Ext.Direct (not intended to be used directly).</p>\r
+ * @constructor\r
+ * @param {Object} config\r
+ */\r
+Ext.Direct.Transaction = function(config){\r
+    Ext.apply(this, config);\r
+    this.tid = ++Ext.Direct.TID;\r
+    this.retryCount = 0;\r
+};\r
+Ext.Direct.Transaction.prototype = {\r
+    send: function(){\r
+        this.provider.queueTransaction(this);\r
+    },\r
+\r
+    retry: function(){\r
+        this.retryCount++;\r
+        this.send();\r
+    },\r
+\r
+    getProvider: function(){\r
+        return this.provider;\r
+    }\r
+};Ext.Direct.Event = function(config){\r
+    Ext.apply(this, config);\r
+}\r
+Ext.Direct.Event.prototype = {\r
+    status: true,\r
+    getData: function(){\r
+        return this.data;\r
+    }\r
+};\r
+\r
+Ext.Direct.RemotingEvent = Ext.extend(Ext.Direct.Event, {\r
+    type: 'rpc',\r
+    getTransaction: function(){\r
+        return this.transaction || Ext.Direct.getTransaction(this.tid);\r
+    }\r
+});\r
+\r
+Ext.Direct.ExceptionEvent = Ext.extend(Ext.Direct.RemotingEvent, {\r
+    status: false,\r
+    type: 'exception'\r
+});\r
+\r
+Ext.Direct.eventTypes = {\r
+    'rpc':  Ext.Direct.RemotingEvent,\r
+    'event':  Ext.Direct.Event,\r
+    'exception':  Ext.Direct.ExceptionEvent\r
+};\r
+\r
+/**\r
+ * @class Ext.direct.Provider\r
+ * @extends Ext.util.Observable\r
+ * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>\r
+ * \r
+ * <p>For example ExtJs implements the following subclasses:</p>\r
+ * <pre><code>\r
+Provider\r
+|\r
++---{@link Ext.direct.JsonProvider JsonProvider} \r
+    |\r
+    +---{@link Ext.direct.PollingProvider PollingProvider}   \r
+    |\r
+    +---{@link Ext.direct.RemotingProvider RemotingProvider}   \r
+ * </code></pre>\r
+ * @abstract\r
+ */\r
+Ext.direct.Provider = Ext.extend(Ext.util.Observable, {    \r
+    /**\r
+     * @cfg {String} id\r
+     * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}).\r
+     * You should assign an id if you need to be able to access the provider later and you do\r
+     * not have an object reference available, for example:\r
+     * <pre><code>\r
+Ext.Direct.addProvider(\r
+    {\r
+        type: 'polling',\r
+        url:  'php/poll.php',\r
+        id:   'poll-provider'\r
+    }\r
+);\r
+     \r
+var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');\r
+p.disconnect();\r
+     * </code></pre>\r
+     */\r
+        \r
+    /**\r
+     * @cfg {Number} priority\r
+     * Priority of the request. Lower is higher priority, <tt>0</tt> means "duplex" (always on).\r
+     * All Providers default to <tt>1</tt> except for PollingProvider which defaults to <tt>3</tt>.\r
+     */    \r
+    priority: 1,\r
+\r
+    /**\r
+     * @cfg {String} type\r
+     * <b>Required</b>, <tt>undefined</tt> by default.  The <tt>type</tt> of provider specified\r
+     * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a\r
+     * new Provider. Acceptable values by default are:<div class="mdetail-params"><ul>\r
+     * <li><b><tt>polling</tt></b> : {@link Ext.direct.PollingProvider PollingProvider}</li>\r
+     * <li><b><tt>remoting</tt></b> : {@link Ext.direct.RemotingProvider RemotingProvider}</li>\r
+     * </ul></div>\r
+     */    \r
\r
+    // private\r
+    constructor : function(config){\r
+        Ext.apply(this, config);\r
+        this.addEvents(\r
+            /**\r
+             * @event connect\r
+             * Fires when the Provider connects to the server-side\r
+             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
+             */            \r
+            'connect',\r
+            /**\r
+             * @event disconnect\r
+             * Fires when the Provider disconnects from the server-side\r
+             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
+             */            \r
+            'disconnect',\r
+            /**\r
+             * @event data\r
+             * Fires when the Provider receives data from the server-side\r
+             * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.\r
+             * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.\r
+             */            \r
+            'data',\r
+            /**\r
+             * @event exception\r
+             * Fires when the Provider receives an exception from the server-side\r
+             */                        \r
+            'exception'\r
+        );\r
+        Ext.direct.Provider.superclass.constructor.call(this, config);\r
+    },\r
+\r
+    /**\r
+     * Returns whether or not the server-side is currently connected.\r
+     * Abstract method for subclasses to implement.\r
+     */\r
+    isConnected: function(){\r
+        return false;\r
+    },\r
+\r
+    /**\r
+     * Abstract methods for subclasses to implement.\r
+     */\r
+    connect: Ext.emptyFn,\r
+    \r
+    /**\r
+     * Abstract methods for subclasses to implement.\r
+     */\r
+    disconnect: Ext.emptyFn\r
+});\r
+/**\r
+ * @class Ext.direct.JsonProvider\r
+ * @extends Ext.direct.Provider\r
+ */\r
+Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {\r
+    parseResponse: function(xhr){\r
+        if(!Ext.isEmpty(xhr.responseText)){\r
+            if(typeof xhr.responseText == 'object'){\r
+                return xhr.responseText;\r
+            }\r
+            return Ext.decode(xhr.responseText);\r
+        }\r
+        return null;\r
+    },\r
+\r
+    getEvents: function(xhr){\r
+        var data = null;\r
+        try{\r
+            data = this.parseResponse(xhr);\r
+        }catch(e){\r
+            var event = new Ext.Direct.ExceptionEvent({\r
+                data: e,\r
+                xhr: xhr,\r
+                code: Ext.Direct.exceptions.PARSE,\r
+                message: 'Error parsing json response: \n\n ' + data\r
+            })\r
+            return [event];\r
+        }\r
+        var events = [];\r
+        if(Ext.isArray(data)){\r
+            for(var i = 0, len = data.length; i < len; i++){\r
+                events.push(Ext.Direct.createEvent(data[i]));\r
+            }\r
+        }else{\r
+            events.push(Ext.Direct.createEvent(data));\r
+        }\r
+        return events;\r
+    }\r
+});/**\r
+ * @class Ext.direct.PollingProvider\r
+ * @extends Ext.direct.JsonProvider\r
+ *\r
+ * <p>Provides for repetitive polling of the server at distinct {@link #interval intervals}.\r
+ * The initial request for data originates from the client, and then is responded to by the\r
+ * server.</p>\r
+ * \r
+ * <p>All configurations for the PollingProvider should be generated by the server-side\r
+ * API portion of the Ext.Direct stack.</p>\r
+ *\r
+ * <p>An instance of PollingProvider may be created directly via the new keyword or by simply\r
+ * specifying <tt>type = 'polling'</tt>.  For example:</p>\r
+ * <pre><code>\r
+var pollA = new Ext.direct.PollingProvider({\r
+    type:'polling',\r
+    url: 'php/pollA.php',\r
+});\r
+Ext.Direct.addProvider(pollA);\r
+pollA.disconnect();\r
+\r
+Ext.Direct.addProvider(\r
+    {\r
+        type:'polling',\r
+        url: 'php/pollB.php',\r
+        id: 'pollB-provider'\r
+    }\r
+);\r
+var pollB = Ext.Direct.getProvider('pollB-provider');\r
+ * </code></pre>\r
+ */\r
+Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, {\r
+    /**\r
+     * @cfg {Number} priority\r
+     * Priority of the request (defaults to <tt>3</tt>). See {@link Ext.direct.Provider#priority}.\r
+     */\r
+    // override default priority\r
+    priority: 3,\r
+    \r
+    /**\r
+     * @cfg {Number} interval\r
+     * How often to poll the server-side in milliseconds (defaults to <tt>3000</tt> - every\r
+     * 3 seconds).\r
+     */\r
+    interval: 3000,\r
+\r
+    /**\r
+     * @cfg {Object} baseParams An object containing properties which are to be sent as parameters\r
+     * on every polling request\r
+     */\r
+    \r
+    /**\r
+     * @cfg {String/Function} url\r
+     * The url which the PollingProvider should contact with each request. This can also be\r
+     * an imported Ext.Direct method which will accept the baseParams as its only argument.\r
+     */\r
+\r
+    // private\r
+    constructor : function(config){\r
+        Ext.direct.PollingProvider.superclass.constructor.call(this, config);\r
+        this.addEvents(\r
+            /**\r
+             * @event beforepoll\r
+             * Fired immediately before a poll takes place, an event handler can return false\r
+             * in order to cancel the poll.\r
+             * @param {Ext.direct.PollingProvider}\r
+             */\r
+            'beforepoll',            \r
+            /**\r
+             * @event poll\r
+             * This event has not yet been implemented.\r
+             * @param {Ext.direct.PollingProvider}\r
+             */\r
+            'poll'\r
+        );\r
+    },\r
+\r
+    // inherited\r
+    isConnected: function(){\r
+        return !!this.pollTask;\r
+    },\r
+\r
+    /**\r
+     * Connect to the server-side and begin the polling process. To handle each\r
+     * response subscribe to the data event.\r
+     */\r
+    connect: function(){\r
+        if(this.url && !this.pollTask){\r
+            this.pollTask = Ext.TaskMgr.start({\r
+                run: function(){\r
+                    if(this.fireEvent('beforepoll', this) !== false){\r
+                        if(typeof this.url == 'function'){\r
+                            this.url(this.baseParams);\r
+                        }else{\r
+                            Ext.Ajax.request({\r
+                                url: this.url,\r
+                                callback: this.onData,\r
+                                scope: this,\r
+                                params: this.baseParams\r
+                            });\r
+                        }\r
+                    }\r
+                },\r
+                interval: this.interval,\r
+                scope: this\r
+            });\r
+            this.fireEvent('connect', this);\r
+        }else if(!this.url){\r
+            throw 'Error initializing PollingProvider, no url configured.';\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Disconnect from the server-side and stop the polling process. The disconnect\r
+     * event will be fired on a successful disconnect.\r
+     */\r
+    disconnect: function(){\r
+        if(this.pollTask){\r
+            Ext.TaskMgr.stop(this.pollTask);\r
+            delete this.pollTask;\r
+            this.fireEvent('disconnect', this);\r
+        }\r
+    },\r
+\r
+    // private\r
+    onData: function(opt, success, xhr){\r
+        if(success){\r
+            var events = this.getEvents(xhr);\r
+            for(var i = 0, len = events.length; i < len; i++){\r
+                var e = events[i];\r
+                this.fireEvent('data', this, e);\r
+            }\r
+        }else{\r
+            var e = new Ext.Direct.ExceptionEvent({\r
+                data: e,\r
+                code: Ext.Direct.exceptions.TRANSPORT,\r
+                message: 'Unable to connect to the server.',\r
+                xhr: xhr\r
+            });\r
+            this.fireEvent('data', this, e);\r
+        }\r
+    }\r
+});\r
+\r
+Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider;/**\r
+ * @class Ext.direct.RemotingProvider\r
+ * @extends Ext.direct.JsonProvider\r
+ * \r
+ * <p>The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to\r
+ * server side methods on the client (a remote procedure call (RPC) type of\r
+ * connection where the client can initiate a procedure on the server).</p>\r
+ * \r
+ * <p>This allows for code to be organized in a fashion that is maintainable,\r
+ * while providing a clear path between client and server, something that is\r
+ * not always apparent when using URLs.</p>\r
+ * \r
+ * <p>To accomplish this the server-side needs to describe what classes and methods\r
+ * are available on the client-side. This configuration will typically be\r
+ * outputted by the server-side Ext.Direct stack when the API description is built.</p>\r
+ */\r
+Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, {       \r
+    /**\r
+     * @cfg {Object} actions\r
+     * Object literal defining the server side actions and methods. For example, if\r
+     * the Provider is configured with:\r
+     * <pre><code>\r
+"actions":{ // each property within the 'actions' object represents a server side Class \r
+    "TestAction":[ // array of methods within each server side Class to be   \r
+    {              // stubbed out on client\r
+        "name":"doEcho", \r
+        "len":1            \r
+    },{\r
+        "name":"multiply",// name of method\r
+        "len":2           // The number of parameters that will be used to create an\r
+                          // array of data to send to the server side function.\r
+                          // Ensure the server sends back a Number, not a String. \r
+    },{\r
+        "name":"doForm",\r
+        "formHandler":true, // direct the client to use specialized form handling method \r
+        "len":1\r
+    }]\r
+}\r
+     * </code></pre>\r
+     * <p>Note that a Store is not required, a server method can be called at any time.\r
+     * In the following example a <b>client side</b> handler is used to call the\r
+     * server side method "multiply" in the server-side "TestAction" Class:</p>\r
+     * <pre><code>\r
+TestAction.multiply(\r
+    2, 4, // pass two arguments to server, so specify len=2\r
+    // callback function after the server is called\r
+    // result: the result returned by the server\r
+    //      e: Ext.Direct.RemotingEvent object\r
+    function(result, e){\r
+        var t = e.getTransaction();\r
+        var action = t.action; // server side Class called\r
+        var method = t.method; // server side method called\r
+        if(e.status){\r
+            var answer = Ext.encode(result); // 8\r
+    \r
+        }else{\r
+            var msg = e.message; // failure message\r
+        }\r
+    }\r
+);\r
+     * </code></pre>\r
+     * In the example above, the server side "multiply" function will be passed two\r
+     * arguments (2 and 4).  The "multiply" method should return the value 8 which will be\r
+     * available as the <tt>result</tt> in the example above. \r
+     */\r
+    \r
+    /**\r
+     * @cfg {String/Object} namespace\r
+     * Namespace for the Remoting Provider (defaults to the browser global scope of <i>window</i>).\r
+     * Explicitly specify the namespace Object, or specify a String to have a\r
+     * {@link Ext#namespace namespace created} implicitly.\r
+     */\r
+    \r
+    /**\r
+     * @cfg {String} url\r
+     * <b>Required<b>. The url to connect to the {@link Ext.Direct} server-side router. \r
+     */\r
+    \r
+    /**\r
+     * @cfg {String} enableUrlEncode\r
+     * Specify which param will hold the arguments for the method.\r
+     * Defaults to <tt>'data'</tt>.\r
+     */\r
+    \r
+    /**\r
+     * @cfg {Number/Boolean} enableBuffer\r
+     * <p><tt>true</tt> or <tt>false</tt> to enable or disable combining of method\r
+     * calls. If a number is specified this is the amount of time in milliseconds\r
+     * to wait before sending a batched request (defaults to <tt>10</tt>).</p>\r
+     * <br><p>Calls which are received within the specified timeframe will be\r
+     * concatenated together and sent in a single request, optimizing the\r
+     * application by reducing the amount of round trips that have to be made\r
+     * to the server.</p>\r
+     */\r
+    enableBuffer: 10,\r
+    \r
+    /**\r
+     * @cfg {Number} maxRetries\r
+     * Number of times to re-attempt delivery on failure of a call. Defaults to <tt>1</tt>.\r
+     */\r
+    maxRetries: 1,\r
+    \r
+    /**\r
+     * @cfg {Number} timeout\r
+     * The timeout to use for each request. Defaults to <tt>undefined</tt>.\r
+     */\r
+    timeout: undefined,\r
+\r
+    constructor : function(config){\r
+        Ext.direct.RemotingProvider.superclass.constructor.call(this, config);\r
+        this.addEvents(\r
+            /**\r
+             * @event beforecall\r
+             * Fires immediately before the client-side sends off the RPC call.\r
+             * By returning false from an event handler you can prevent the call from\r
+             * executing.\r
+             * @param {Ext.direct.RemotingProvider} provider\r
+             * @param {Ext.Direct.Transaction} transaction\r
+             */            \r
+            'beforecall',            \r
+            /**\r
+             * @event call\r
+             * Fires immediately after the request to the server-side is sent. This does\r
+             * NOT fire after the response has come back from the call.\r
+             * @param {Ext.direct.RemotingProvider} provider\r
+             * @param {Ext.Direct.Transaction} transaction\r
+             */            \r
+            'call'\r
+        );\r
+        this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window;\r
+        this.transactions = {};\r
+        this.callBuffer = [];\r
+    },\r
+\r
+    // private\r
+    initAPI : function(){\r
+        var o = this.actions;\r
+        for(var c in o){\r
+            var cls = this.namespace[c] || (this.namespace[c] = {}),\r
+                ms = o[c];\r
+            for(var i = 0, len = ms.length; i < len; i++){\r
+                var m = ms[i];\r
+                cls[m.name] = this.createMethod(c, m);\r
+            }\r
+        }\r
+    },\r
+\r
+    // inherited\r
+    isConnected: function(){\r
+        return !!this.connected;\r
+    },\r
+\r
+    connect: function(){\r
+        if(this.url){\r
+            this.initAPI();\r
+            this.connected = true;\r
+            this.fireEvent('connect', this);\r
+        }else if(!this.url){\r
+            throw 'Error initializing RemotingProvider, no url configured.';\r
+        }\r
+    },\r
+\r
+    disconnect: function(){\r
+        if(this.connected){\r
+            this.connected = false;\r
+            this.fireEvent('disconnect', this);\r
+        }\r
+    },\r
+\r
+    onData: function(opt, success, xhr){\r
+        if(success){\r
+            var events = this.getEvents(xhr);\r
+            for(var i = 0, len = events.length; i < len; i++){\r
+                var e = events[i],\r
+                    t = this.getTransaction(e);\r
+                this.fireEvent('data', this, e);\r
+                if(t){\r
+                    this.doCallback(t, e, true);\r
+                    Ext.Direct.removeTransaction(t);\r
+                }\r
+            }\r
+        }else{\r
+            var ts = [].concat(opt.ts);\r
+            for(var i = 0, len = ts.length; i < len; i++){\r
+                var t = this.getTransaction(ts[i]);\r
+                if(t && t.retryCount < this.maxRetries){\r
+                    t.retry();\r
+                }else{\r
+                    var e = new Ext.Direct.ExceptionEvent({\r
+                        data: e,\r
+                        transaction: t,\r
+                        code: Ext.Direct.exceptions.TRANSPORT,\r
+                        message: 'Unable to connect to the server.',\r
+                        xhr: xhr\r
+                    });\r
+                    this.fireEvent('data', this, e);\r
+                    if(t){\r
+                        this.doCallback(t, e, false);\r
+                        Ext.Direct.removeTransaction(t);\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    },\r
+\r
+    getCallData: function(t){\r
+        return {\r
+            action: t.action,\r
+            method: t.method,\r
+            data: t.data,\r
+            type: 'rpc',\r
+            tid: t.tid\r
+        };\r
+    },\r
+\r
+    doSend : function(data){\r
+        var o = {\r
+            url: this.url,\r
+            callback: this.onData,\r
+            scope: this,\r
+            ts: data,\r
+            timeout: this.timeout\r
+        }, callData;\r
+\r
+        if(Ext.isArray(data)){\r
+            callData = [];\r
+            for(var i = 0, len = data.length; i < len; i++){\r
+                callData.push(this.getCallData(data[i]));\r
+            }\r
+        }else{\r
+            callData = this.getCallData(data);\r
+        }\r
+\r
+        if(this.enableUrlEncode){\r
+            var params = {};\r
+            params[Ext.isString(this.enableUrlEncode) ? this.enableUrlEncode : 'data'] = Ext.encode(callData);\r
+            o.params = params;\r
+        }else{\r
+            o.jsonData = callData;\r
+        }\r
+        Ext.Ajax.request(o);\r
+    },\r
+\r
+    combineAndSend : function(){\r
+        var len = this.callBuffer.length;\r
+        if(len > 0){\r
+            this.doSend(len == 1 ? this.callBuffer[0] : this.callBuffer);\r
+            this.callBuffer = [];\r
+        }\r
+    },\r
+\r
+    queueTransaction: function(t){\r
+        if(t.form){\r
+            this.processForm(t);\r
+            return;\r
+        }\r
+        this.callBuffer.push(t);\r
+        if(this.enableBuffer){\r
+            if(!this.callTask){\r
+                this.callTask = new Ext.util.DelayedTask(this.combineAndSend, this);\r
+            }\r
+            this.callTask.delay(Ext.isNumber(this.enableBuffer) ? this.enableBuffer : 10);\r
+        }else{\r
+            this.combineAndSend();\r
+        }\r
+    },\r
+\r
+    doCall : function(c, m, args){\r
+        var data = null, hs = args[m.len], scope = args[m.len+1];\r
+\r
+        if(m.len !== 0){\r
+            data = args.slice(0, m.len);\r
+        }\r
+\r
+        var t = new Ext.Direct.Transaction({\r
+            provider: this,\r
+            args: args,\r
+            action: c,\r
+            method: m.name,\r
+            data: data,\r
+            cb: scope && Ext.isFunction(hs) ? hs.createDelegate(scope) : hs\r
+        });\r
+\r
+        if(this.fireEvent('beforecall', this, t) !== false){\r
+            Ext.Direct.addTransaction(t);\r
+            this.queueTransaction(t);\r
+            this.fireEvent('call', this, t);\r
+        }\r
+    },\r
+\r
+    doForm : function(c, m, form, callback, scope){\r
+        var t = new Ext.Direct.Transaction({\r
+            provider: this,\r
+            action: c,\r
+            method: m.name,\r
+            args:[form, callback, scope],\r
+            cb: scope && Ext.isFunction(callback) ? callback.createDelegate(scope) : callback,\r
+            isForm: true\r
+        });\r
+\r
+        if(this.fireEvent('beforecall', this, t) !== false){\r
+            Ext.Direct.addTransaction(t);\r
+            var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',\r
+                params = {\r
+                    extTID: t.tid,\r
+                    extAction: c,\r
+                    extMethod: m.name,\r
+                    extType: 'rpc',\r
+                    extUpload: String(isUpload)\r
+                };\r
+            \r
+            // change made from typeof callback check to callback.params\r
+            // to support addl param passing in DirectSubmit EAC 6/2\r
+            Ext.apply(t, {\r
+                form: Ext.getDom(form),\r
+                isUpload: isUpload,\r
+                params: callback && Ext.isObject(callback.params) ? Ext.apply(params, callback.params) : params\r
+            });\r
+            this.fireEvent('call', this, t);\r
+            this.processForm(t);\r
+        }\r
+    },\r
+    \r
+    processForm: function(t){\r
+        Ext.Ajax.request({\r
+            url: this.url,\r
+            params: t.params,\r
+            callback: this.onData,\r
+            scope: this,\r
+            form: t.form,\r
+            isUpload: t.isUpload,\r
+            ts: t\r
+        });\r
+    },\r
+\r
+    createMethod : function(c, m){\r
+        var f;\r
+        if(!m.formHandler){\r
+            f = function(){\r
+                this.doCall(c, m, Array.prototype.slice.call(arguments, 0));\r
+            }.createDelegate(this);\r
+        }else{\r
+            f = function(form, callback, scope){\r
+                this.doForm(c, m, form, callback, scope);\r
+            }.createDelegate(this);\r
+        }\r
+        f.directCfg = {\r
+            action: c,\r
+            method: m\r
+        };\r
+        return f;\r
+    },\r
+\r
+    getTransaction: function(opt){\r
+        return opt && opt.tid ? Ext.Direct.getTransaction(opt.tid) : null;\r
+    },\r
+\r
+    doCallback: function(t, e){\r
+        var fn = e.status ? 'success' : 'failure';\r
+        if(t && t.cb){\r
+            var hs = t.cb,\r
+                result = Ext.isDefined(e.result) ? e.result : e.data;\r
+            if(Ext.isFunction(hs)){\r
+                hs(result, e);\r
+            } else{\r
+                Ext.callback(hs[fn], hs.scope, [result, e]);\r
+                Ext.callback(hs.callback, hs.scope, [result, e]);\r
+            }\r
+        }\r
+    }\r
+});\r
+Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider;/*!\r
+ * Ext JS Library 3.1.1\r
+ * Copyright(c) 2006-2010 Ext JS, LLC\r
+ * licensing@extjs.com\r
+ * http://www.extjs.com/license\r
  */\r
-Ext.dd.PanelProxy = function(panel, config){\r
-    this.panel = panel;\r
-    this.id = this.panel.id +'-ddproxy';\r
-    Ext.apply(this, config);\r
-};\r
+/**\r
+ * @class Ext.Resizable\r
+ * @extends Ext.util.Observable\r
+ * <p>Applies drag handles to an element to make it resizable. The drag handles are inserted into the element \r
+ * and positioned absolute. Some elements, such as a textarea or image, don't support this. To overcome that, you can wrap\r
+ * the textarea in a div and set 'resizeChild' to true (or to the id of the element), <b>or</b> set wrap:true in your config and\r
+ * the element will be wrapped for you automatically.</p>\r
+ * <p>Here is the list of valid resize handles:</p>\r
+ * <pre>\r
+Value   Description\r
+------  -------------------\r
+ 'n'     north\r
+ 's'     south\r
+ 'e'     east\r
+ 'w'     west\r
+ 'nw'    northwest\r
+ 'sw'    southwest\r
+ 'se'    southeast\r
+ 'ne'    northeast\r
+ 'all'   all\r
+</pre>\r
+ * <p>Here's an example showing the creation of a typical Resizable:</p>\r
+ * <pre><code>\r
+var resizer = new Ext.Resizable('element-id', {\r
+    handles: 'all',\r
+    minWidth: 200,\r
+    minHeight: 100,\r
+    maxWidth: 500,\r
+    maxHeight: 400,\r
+    pinned: true\r
+});\r
+resizer.on('resize', myHandler);\r
+</code></pre>\r
+ * <p>To hide a particular handle, set its display to none in CSS, or through script:<br>\r
+ * resizer.east.setDisplayed(false);</p>\r
+ * @constructor\r
+ * Create a new resizable component\r
+ * @param {Mixed} el The id or element to resize\r
+ * @param {Object} config configuration options\r
+  */\r
+Ext.Resizable = Ext.extend(Ext.util.Observable, {\r
+    \r
+    constructor: function(el, config){\r
+        this.el = Ext.get(el);\r
+        if(config && config.wrap){\r
+            config.resizeChild = this.el;\r
+            this.el = this.el.wrap(typeof config.wrap == 'object' ? config.wrap : {cls:'xresizable-wrap'});\r
+            this.el.id = this.el.dom.id = config.resizeChild.id + '-rzwrap';\r
+            this.el.setStyle('overflow', 'hidden');\r
+            this.el.setPositioning(config.resizeChild.getPositioning());\r
+            config.resizeChild.clearPositioning();\r
+            if(!config.width || !config.height){\r
+                var csize = config.resizeChild.getSize();\r
+                this.el.setSize(csize.width, csize.height);\r
+            }\r
+            if(config.pinned && !config.adjustments){\r
+                config.adjustments = 'auto';\r
+            }\r
+        }\r
+    \r
+        /**\r
+         * The proxy Element that is resized in place of the real Element during the resize operation.\r
+         * This may be queried using {@link Ext.Element#getBox} to provide the new area to resize to.\r
+         * Read only.\r
+         * @type Ext.Element.\r
+         * @property proxy\r
+         */\r
+        this.proxy = this.el.createProxy({tag: 'div', cls: 'x-resizable-proxy', id: this.el.id + '-rzproxy'}, Ext.getBody());\r
+        this.proxy.unselectable();\r
+        this.proxy.enableDisplayMode('block');\r
+    \r
+        Ext.apply(this, config);\r
+        \r
+        if(this.pinned){\r
+            this.disableTrackOver = true;\r
+            this.el.addClass('x-resizable-pinned');\r
+        }\r
+        // if the element isn't positioned, make it relative\r
+        var position = this.el.getStyle('position');\r
+        if(position != 'absolute' && position != 'fixed'){\r
+            this.el.setStyle('position', 'relative');\r
+        }\r
+        if(!this.handles){ // no handles passed, must be legacy style\r
+            this.handles = 's,e,se';\r
+            if(this.multiDirectional){\r
+                this.handles += ',n,w';\r
+            }\r
+        }\r
+        if(this.handles == 'all'){\r
+            this.handles = 'n s e w ne nw se sw';\r
+        }\r
+        var hs = this.handles.split(/\s*?[,;]\s*?| /);\r
+        var ps = Ext.Resizable.positions;\r
+        for(var i = 0, len = hs.length; i < len; i++){\r
+            if(hs[i] && ps[hs[i]]){\r
+                var pos = ps[hs[i]];\r
+                this[pos] = new Ext.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent, this.handleCls);\r
+            }\r
+        }\r
+        // legacy\r
+        this.corner = this.southeast;\r
+        \r
+        if(this.handles.indexOf('n') != -1 || this.handles.indexOf('w') != -1){\r
+            this.updateBox = true;\r
+        }   \r
+       \r
+        this.activeHandle = null;\r
+        \r
+        if(this.resizeChild){\r
+            if(typeof this.resizeChild == 'boolean'){\r
+                this.resizeChild = Ext.get(this.el.dom.firstChild, true);\r
+            }else{\r
+                this.resizeChild = Ext.get(this.resizeChild, true);\r
+            }\r
+        }\r
+        \r
+        if(this.adjustments == 'auto'){\r
+            var rc = this.resizeChild;\r
+            var hw = this.west, he = this.east, hn = this.north, hs = this.south;\r
+            if(rc && (hw || hn)){\r
+                rc.position('relative');\r
+                rc.setLeft(hw ? hw.el.getWidth() : 0);\r
+                rc.setTop(hn ? hn.el.getHeight() : 0);\r
+            }\r
+            this.adjustments = [\r
+                (he ? -he.el.getWidth() : 0) + (hw ? -hw.el.getWidth() : 0),\r
+                (hn ? -hn.el.getHeight() : 0) + (hs ? -hs.el.getHeight() : 0) -1 \r
+            ];\r
+        }\r
+        \r
+        if(this.draggable){\r
+            this.dd = this.dynamic ? \r
+                this.el.initDD(null) : this.el.initDDProxy(null, {dragElId: this.proxy.id});\r
+            this.dd.setHandleElId(this.resizeChild ? this.resizeChild.id : this.el.id);\r
+            if(this.constrainTo){\r
+                this.dd.constrainTo(this.constrainTo);\r
+            }\r
+        }\r
+        \r
+        this.addEvents(\r
+            /**\r
+             * @event beforeresize\r
+             * Fired before resize is allowed. Set {@link #enabled} to false to cancel resize.\r
+             * @param {Ext.Resizable} this\r
+             * @param {Ext.EventObject} e The mousedown event\r
+             */\r
+            'beforeresize',\r
+            /**\r
+             * @event resize\r
+             * Fired after a resize.\r
+             * @param {Ext.Resizable} this\r
+             * @param {Number} width The new width\r
+             * @param {Number} height The new height\r
+             * @param {Ext.EventObject} e The mouseup event\r
+             */\r
+            'resize'\r
+        );\r
+        \r
+        if(this.width !== null && this.height !== null){\r
+            this.resizeTo(this.width, this.height);\r
+        }else{\r
+            this.updateChildSize();\r
+        }\r
+        if(Ext.isIE){\r
+            this.el.dom.style.zoom = 1;\r
+        }\r
+        Ext.Resizable.superclass.constructor.call(this);    \r
+    },\r
 \r
-Ext.dd.PanelProxy.prototype = {\r
     /**\r
-     * @cfg {Boolean} insertProxy True to insert a placeholder proxy element while dragging the panel,\r
-     * false to drag with no proxy (defaults to true).\r
+     * @cfg {Array/String} adjustments String 'auto' or an array [width, height] with values to be <b>added</b> to the\r
+     * resize operation's new size (defaults to <tt>[0, 0]</tt>)\r
+     */\r
+    adjustments : [0, 0],\r
+    /**\r
+     * @cfg {Boolean} animate True to animate the resize (not compatible with dynamic sizing, defaults to false)\r
+     */\r
+    animate : false,\r
+    /**\r
+     * @cfg {Mixed} constrainTo Constrain the resize to a particular element\r
+     */\r
+    /**\r
+     * @cfg {Boolean} disableTrackOver True to disable mouse tracking. This is only applied at config time. (defaults to false)\r
+     */\r
+    disableTrackOver : false,\r
+    /**\r
+     * @cfg {Boolean} draggable Convenience to initialize drag drop (defaults to false)\r
+     */\r
+    draggable: false,\r
+    /**\r
+     * @cfg {Number} duration Animation duration if animate = true (defaults to 0.35)\r
+     */\r
+    duration : 0.35,\r
+    /**\r
+     * @cfg {Boolean} dynamic True to resize the element while dragging instead of using a proxy (defaults to false)\r
+     */\r
+    dynamic : false,\r
+    /**\r
+     * @cfg {String} easing Animation easing if animate = true (defaults to <tt>'easingOutStrong'</tt>)\r
+     */\r
+    easing : 'easeOutStrong',\r
+    /**\r
+     * @cfg {Boolean} enabled False to disable resizing (defaults to true)\r
+     */\r
+    enabled : true,\r
+    /**\r
+     * @property enabled Writable. False if resizing is disabled.\r
+     * @type Boolean \r
+     */\r
+    /**\r
+     * @cfg {String} handles String consisting of the resize handles to display (defaults to undefined).\r
+     * Specify either <tt>'all'</tt> or any of <tt>'n s e w ne nw se sw'</tt>.\r
+     */\r
+    handles : false,\r
+    /**\r
+     * @cfg {Boolean} multiDirectional <b>Deprecated</b>.  Deprecated style of adding multi-direction resize handles.\r
+     */\r
+    multiDirectional : false,\r
+    /**\r
+     * @cfg {Number} height The height of the element in pixels (defaults to null)\r
+     */\r
+    height : null,\r
+    /**\r
+     * @cfg {Number} width The width of the element in pixels (defaults to null)\r
+     */\r
+    width : null,\r
+    /**\r
+     * @cfg {Number} heightIncrement The increment to snap the height resize in pixels\r
+     * (only applies if <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.\r
+     */\r
+    heightIncrement : 0,\r
+    /**\r
+     * @cfg {Number} widthIncrement The increment to snap the width resize in pixels\r
+     * (only applies if <code>{@link #dynamic}==true</code>). Defaults to <tt>0</tt>.\r
+     */\r
+    widthIncrement : 0,\r
+    /**\r
+     * @cfg {Number} minHeight The minimum height for the element (defaults to 5)\r
+     */\r
+    minHeight : 5,\r
+    /**\r
+     * @cfg {Number} minWidth The minimum width for the element (defaults to 5)\r
+     */\r
+    minWidth : 5,\r
+    /**\r
+     * @cfg {Number} maxHeight The maximum height for the element (defaults to 10000)\r
+     */\r
+    maxHeight : 10000,\r
+    /**\r
+     * @cfg {Number} maxWidth The maximum width for the element (defaults to 10000)\r
+     */\r
+    maxWidth : 10000,\r
+    /**\r
+     * @cfg {Number} minX The minimum x for the element (defaults to 0)\r
+     */\r
+    minX: 0,\r
+    /**\r
+     * @cfg {Number} minY The minimum x for the element (defaults to 0)\r
+     */\r
+    minY: 0,\r
+    /**\r
+     * @cfg {Boolean} pinned True to ensure that the resize handles are always visible, false to display them only when the\r
+     * user mouses over the resizable borders. This is only applied at config time. (defaults to false)\r
+     */\r
+    pinned : false,\r
+    /**\r
+     * @cfg {Boolean} preserveRatio True to preserve the original ratio between height\r
+     * and width during resize (defaults to false)\r
+     */\r
+    preserveRatio : false,\r
+    /**\r
+     * @cfg {Boolean/String/Element} resizeChild True to resize the first child, or id/element to resize (defaults to false) \r
+     */ \r
+    resizeChild : false,\r
+    /**\r
+     * @cfg {Boolean} transparent True for transparent handles. This is only applied at config time. (defaults to false)\r
+     */\r
+    transparent: false,\r
+    /**\r
+     * @cfg {Ext.lib.Region} resizeRegion Constrain the resize to a particular region\r
+     */\r
+    /**\r
+     * @cfg {Boolean} wrap True to wrap an element with a div if needed (required for textareas and images, defaults to false)\r
+     * in favor of the handles config option (defaults to false)\r
+     */\r
+    /**\r
+     * @cfg {String} handleCls A css class to add to each handle. Defaults to <tt>''</tt>.\r
      */\r
-    insertProxy : true,\r
 \r
-    // private overrides\r
-    setStatus : Ext.emptyFn,\r
-    reset : Ext.emptyFn,\r
-    update : Ext.emptyFn,\r
-    stop : Ext.emptyFn,\r
-    sync: Ext.emptyFn,\r
+    \r
+    /**\r
+     * Perform a manual resize and fires the 'resize' event.\r
+     * @param {Number} width\r
+     * @param {Number} height\r
+     */\r
+    resizeTo : function(width, height){\r
+        this.el.setSize(width, height);\r
+        this.updateChildSize();\r
+        this.fireEvent('resize', this, width, height, null);\r
+    },\r
+\r
+    // private\r
+    startSizing : function(e, handle){\r
+        this.fireEvent('beforeresize', this, e);\r
+        if(this.enabled){ // 2nd enabled check in case disabled before beforeresize handler\r
+\r
+            if(!this.overlay){\r
+                this.overlay = this.el.createProxy({tag: 'div', cls: 'x-resizable-overlay', html: '&#160;'}, Ext.getBody());\r
+                this.overlay.unselectable();\r
+                this.overlay.enableDisplayMode('block');\r
+                this.overlay.on({\r
+                    scope: this,\r
+                    mousemove: this.onMouseMove,\r
+                    mouseup: this.onMouseUp\r
+                });\r
+            }\r
+            this.overlay.setStyle('cursor', handle.el.getStyle('cursor'));\r
+\r
+            this.resizing = true;\r
+            this.startBox = this.el.getBox();\r
+            this.startPoint = e.getXY();\r
+            this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0],\r
+                            (this.startBox.y + this.startBox.height) - this.startPoint[1]];\r
+\r
+            this.overlay.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));\r
+            this.overlay.show();\r
+\r
+            if(this.constrainTo) {\r
+                var ct = Ext.get(this.constrainTo);\r
+                this.resizeRegion = ct.getRegion().adjust(\r
+                    ct.getFrameWidth('t'),\r
+                    ct.getFrameWidth('l'),\r
+                    -ct.getFrameWidth('b'),\r
+                    -ct.getFrameWidth('r')\r
+                );\r
+            }\r
+\r
+            this.proxy.setStyle('visibility', 'hidden'); // workaround display none\r
+            this.proxy.show();\r
+            this.proxy.setBox(this.startBox);\r
+            if(!this.dynamic){\r
+                this.proxy.setStyle('visibility', 'visible');\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    onMouseDown : function(handle, e){\r
+        if(this.enabled){\r
+            e.stopEvent();\r
+            this.activeHandle = handle;\r
+            this.startSizing(e, handle);\r
+        }          \r
+    },\r
+\r
+    // private\r
+    onMouseUp : function(e){\r
+        this.activeHandle = null;\r
+        var size = this.resizeElement();\r
+        this.resizing = false;\r
+        this.handleOut();\r
+        this.overlay.hide();\r
+        this.proxy.hide();\r
+        this.fireEvent('resize', this, size.width, size.height, e);\r
+    },\r
+\r
+    // private\r
+    updateChildSize : function(){\r
+        if(this.resizeChild){\r
+            var el = this.el;\r
+            var child = this.resizeChild;\r
+            var adj = this.adjustments;\r
+            if(el.dom.offsetWidth){\r
+                var b = el.getSize(true);\r
+                child.setSize(b.width+adj[0], b.height+adj[1]);\r
+            }\r
+            // Second call here for IE\r
+            // The first call enables instant resizing and\r
+            // the second call corrects scroll bars if they\r
+            // exist\r
+            if(Ext.isIE){\r
+                setTimeout(function(){\r
+                    if(el.dom.offsetWidth){\r
+                        var b = el.getSize(true);\r
+                        child.setSize(b.width+adj[0], b.height+adj[1]);\r
+                    }\r
+                }, 10);\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    snap : function(value, inc, min){\r
+        if(!inc || !value){\r
+            return value;\r
+        }\r
+        var newValue = value;\r
+        var m = value % inc;\r
+        if(m > 0){\r
+            if(m > (inc/2)){\r
+                newValue = value + (inc-m);\r
+            }else{\r
+                newValue = value - m;\r
+            }\r
+        }\r
+        return Math.max(min, newValue);\r
+    },\r
 \r
     /**\r
-     * Gets the proxy's element\r
-     * @return {Element} The proxy's element\r
+     * <p>Performs resizing of the associated Element. This method is called internally by this\r
+     * class, and should not be called by user code.</p>\r
+     * <p>If a Resizable is being used to resize an Element which encapsulates a more complex UI\r
+     * component such as a Panel, this method may be overridden by specifying an implementation\r
+     * as a config option to provide appropriate behaviour at the end of the resize operation on\r
+     * mouseup, for example resizing the Panel, and relaying the Panel's content.</p>\r
+     * <p>The new area to be resized to is available by examining the state of the {@link #proxy}\r
+     * Element. Example:\r
+<pre><code>\r
+new Ext.Panel({\r
+    title: 'Resize me',\r
+    x: 100,\r
+    y: 100,\r
+    renderTo: Ext.getBody(),\r
+    floating: true,\r
+    frame: true,\r
+    width: 400,\r
+    height: 200,\r
+    listeners: {\r
+        render: function(p) {\r
+            new Ext.Resizable(p.getEl(), {\r
+                handles: 'all',\r
+                pinned: true,\r
+                transparent: true,\r
+                resizeElement: function() {\r
+                    var box = this.proxy.getBox();\r
+                    p.updateBox(box);\r
+                    if (p.layout) {\r
+                        p.doLayout();\r
+                    }\r
+                    return box;\r
+                }\r
+           });\r
+       }\r
+    }\r
+}).show();\r
+</code></pre>\r
      */\r
-    getEl : function(){\r
-        return this.ghost;\r
+    resizeElement : function(){\r
+        var box = this.proxy.getBox();\r
+        if(this.updateBox){\r
+            this.el.setBox(box, false, this.animate, this.duration, null, this.easing);\r
+        }else{\r
+            this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing);\r
+        }\r
+        this.updateChildSize();\r
+        if(!this.dynamic){\r
+            this.proxy.hide();\r
+        }\r
+        if(this.draggable && this.constrainTo){\r
+            this.dd.resetConstraints();\r
+            this.dd.constrainTo(this.constrainTo);\r
+        }\r
+        return box;\r
     },\r
 \r
-    /**\r
-     * Gets the proxy's ghost element\r
-     * @return {Element} The proxy's ghost element\r
-     */\r
-    getGhost : function(){\r
-        return this.ghost;\r
+    // private\r
+    constrain : function(v, diff, m, mx){\r
+        if(v - diff < m){\r
+            diff = v - m;    \r
+        }else if(v - diff > mx){\r
+            diff = v - mx; \r
+        }\r
+        return diff;                \r
     },\r
 \r
-    /**\r
-     * Gets the proxy's element\r
-     * @return {Element} The proxy's element\r
-     */\r
-    getProxy : function(){\r
-        return this.proxy;\r
-    },\r
+    // private\r
+    onMouseMove : function(e){\r
+        if(this.enabled && this.activeHandle){\r
+            try{// try catch so if something goes wrong the user doesn't get hung\r
 \r
-    /**\r
-     * Hides the proxy\r
-     */\r
-    hide : function(){\r
-        if(this.ghost){\r
-            if(this.proxy){\r
-                this.proxy.remove();\r
-                delete this.proxy;\r
+            if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) {\r
+                return;\r
             }\r
-            this.panel.el.dom.style.display = '';\r
-            this.ghost.remove();\r
-            delete this.ghost;\r
-        }\r
-    },\r
 \r
-    /**\r
-     * Shows the proxy\r
-     */\r
-    show : function(){\r
-        if(!this.ghost){\r
-            this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody());\r
-            this.ghost.setXY(this.panel.el.getXY())\r
-            if(this.insertProxy){\r
-                this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'});\r
-                this.proxy.setSize(this.panel.getSize());\r
+            //var curXY = this.startPoint;\r
+            var curSize = this.curSize || this.startBox,\r
+                x = this.startBox.x, y = this.startBox.y,\r
+                ox = x, \r
+                oy = y,\r
+                w = curSize.width, \r
+                h = curSize.height,\r
+                ow = w, \r
+                oh = h,\r
+                mw = this.minWidth, \r
+                mh = this.minHeight,\r
+                mxw = this.maxWidth, \r
+                mxh = this.maxHeight,\r
+                wi = this.widthIncrement,\r
+                hi = this.heightIncrement,\r
+                eventXY = e.getXY(),\r
+                diffX = -(this.startPoint[0] - Math.max(this.minX, eventXY[0])),\r
+                diffY = -(this.startPoint[1] - Math.max(this.minY, eventXY[1])),\r
+                pos = this.activeHandle.position,\r
+                tw,\r
+                th;\r
+            \r
+            switch(pos){\r
+                case 'east':\r
+                    w += diffX; \r
+                    w = Math.min(Math.max(mw, w), mxw);\r
+                    break;\r
+                case 'south':\r
+                    h += diffY;\r
+                    h = Math.min(Math.max(mh, h), mxh);\r
+                    break;\r
+                case 'southeast':\r
+                    w += diffX; \r
+                    h += diffY;\r
+                    w = Math.min(Math.max(mw, w), mxw);\r
+                    h = Math.min(Math.max(mh, h), mxh);\r
+                    break;\r
+                case 'north':\r
+                    diffY = this.constrain(h, diffY, mh, mxh);\r
+                    y += diffY;\r
+                    h -= diffY;\r
+                    break;\r
+                case 'west':\r
+                    diffX = this.constrain(w, diffX, mw, mxw);\r
+                    x += diffX;\r
+                    w -= diffX;\r
+                    break;\r
+                case 'northeast':\r
+                    w += diffX; \r
+                    w = Math.min(Math.max(mw, w), mxw);\r
+                    diffY = this.constrain(h, diffY, mh, mxh);\r
+                    y += diffY;\r
+                    h -= diffY;\r
+                    break;\r
+                case 'northwest':\r
+                    diffX = this.constrain(w, diffX, mw, mxw);\r
+                    diffY = this.constrain(h, diffY, mh, mxh);\r
+                    y += diffY;\r
+                    h -= diffY;\r
+                    x += diffX;\r
+                    w -= diffX;\r
+                    break;\r
+               case 'southwest':\r
+                    diffX = this.constrain(w, diffX, mw, mxw);\r
+                    h += diffY;\r
+                    h = Math.min(Math.max(mh, h), mxh);\r
+                    x += diffX;\r
+                    w -= diffX;\r
+                    break;\r
             }\r
-            this.panel.el.dom.style.display = 'none';\r
+            \r
+            var sw = this.snap(w, wi, mw);\r
+            var sh = this.snap(h, hi, mh);\r
+            if(sw != w || sh != h){\r
+                switch(pos){\r
+                    case 'northeast':\r
+                        y -= sh - h;\r
+                    break;\r
+                    case 'north':\r
+                        y -= sh - h;\r
+                        break;\r
+                    case 'southwest':\r
+                        x -= sw - w;\r
+                    break;\r
+                    case 'west':\r
+                        x -= sw - w;\r
+                        break;\r
+                    case 'northwest':\r
+                        x -= sw - w;\r
+                        y -= sh - h;\r
+                    break;\r
+                }\r
+                w = sw;\r
+                h = sh;\r
+            }\r
+            \r
+            if(this.preserveRatio){\r
+                switch(pos){\r
+                    case 'southeast':\r
+                    case 'east':\r
+                        h = oh * (w/ow);\r
+                        h = Math.min(Math.max(mh, h), mxh);\r
+                        w = ow * (h/oh);\r
+                       break;\r
+                    case 'south':\r
+                        w = ow * (h/oh);\r
+                        w = Math.min(Math.max(mw, w), mxw);\r
+                        h = oh * (w/ow);\r
+                        break;\r
+                    case 'northeast':\r
+                        w = ow * (h/oh);\r
+                        w = Math.min(Math.max(mw, w), mxw);\r
+                        h = oh * (w/ow);\r
+                    break;\r
+                    case 'north':\r
+                        tw = w;\r
+                        w = ow * (h/oh);\r
+                        w = Math.min(Math.max(mw, w), mxw);\r
+                        h = oh * (w/ow);\r
+                        x += (tw - w) / 2;\r
+                        break;\r
+                    case 'southwest':\r
+                        h = oh * (w/ow);\r
+                        h = Math.min(Math.max(mh, h), mxh);\r
+                        tw = w;\r
+                        w = ow * (h/oh);\r
+                        x += tw - w;\r
+                        break;\r
+                    case 'west':\r
+                        th = h;\r
+                        h = oh * (w/ow);\r
+                        h = Math.min(Math.max(mh, h), mxh);\r
+                        y += (th - h) / 2;\r
+                        tw = w;\r
+                        w = ow * (h/oh);\r
+                        x += tw - w;\r
+                       break;\r
+                    case 'northwest':\r
+                        tw = w;\r
+                        th = h;\r
+                        h = oh * (w/ow);\r
+                        h = Math.min(Math.max(mh, h), mxh);\r
+                        w = ow * (h/oh);\r
+                        y += th - h;\r
+                        x += tw - w;\r
+                        break;\r
+                        \r
+                }\r
+            }\r
+            this.proxy.setBounds(x, y, w, h);\r
+            if(this.dynamic){\r
+                this.resizeElement();\r
+            }\r
+            }catch(ex){}\r
         }\r
     },\r
 \r
     // private\r
-    repair : function(xy, callback, scope){\r
-        this.hide();\r
-        if(typeof callback == "function"){\r
-            callback.call(scope || this);\r
+    handleOver : function(){\r
+        if(this.enabled){\r
+            this.el.addClass('x-resizable-over');\r
         }\r
     },\r
 \r
-    /**\r
-     * Moves the proxy to a different position in the DOM.  This is typically called while dragging the Panel\r
-     * to keep the proxy sync'd to the Panel's location.\r
-     * @param {HTMLElement} parentNode The proxy's parent DOM node\r
-     * @param {HTMLElement} before (optional) The sibling node before which the proxy should be inserted (defaults\r
-     * to the parent's last child if not specified)\r
-     */\r
-    moveProxy : function(parentNode, before){\r
-        if(this.proxy){\r
-            parentNode.insertBefore(this.proxy.dom, before);\r
+    // private\r
+    handleOut : function(){\r
+        if(!this.resizing){\r
+            this.el.removeClass('x-resizable-over');\r
         }\r
-    }\r
-};\r
-\r
-// private - DD implementation for Panels\r
-Ext.Panel.DD = function(panel, cfg){\r
-    this.panel = panel;\r
-    this.dragData = {panel: panel};\r
-    this.proxy = new Ext.dd.PanelProxy(panel, cfg);\r
-    Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg);\r
-    var h = panel.header;\r
-    if(h){\r
-        this.setHandleElId(h.id);\r
-    }\r
-    (h ? h : this.panel.body).setStyle('cursor', 'move');\r
-    this.scroll = false;\r
-};\r
-\r
-Ext.extend(Ext.Panel.DD, Ext.dd.DragSource, {\r
-    showFrame: Ext.emptyFn,\r
-    startDrag: Ext.emptyFn,\r
-    b4StartDrag: function(x, y) {\r
-        this.proxy.show();\r
-    },\r
-    b4MouseDown: function(e) {\r
-        var x = e.getPageX();\r
-        var y = e.getPageY();\r
-        this.autoOffset(x, y);\r
-    },\r
-    onInitDrag : function(x, y){\r
-        this.onStartDrag(x, y);\r
-        return true;\r
     },\r
-    createFrame : Ext.emptyFn,\r
-    getDragEl : function(e){\r
-        return this.proxy.ghost.dom;\r
+    \r
+    /**\r
+     * Returns the element this component is bound to.\r
+     * @return {Ext.Element}\r
+     */\r
+    getEl : function(){\r
+        return this.el;\r
     },\r
-    endDrag : function(e){\r
-        this.proxy.hide();\r
-        this.panel.saveState();\r
+    \r
+    /**\r
+     * Returns the resizeChild element (or null).\r
+     * @return {Ext.Element}\r
+     */\r
+    getResizeChild : function(){\r
+        return this.resizeChild;\r
     },\r
-\r
-    autoOffset : function(x, y) {\r
-        x -= this.startPageX;\r
-        y -= this.startPageY;\r
-        this.setDelta(x, y);\r
-    }\r
-});/**
- * @class Ext.state.Provider
- * Abstract base class for state provider implementations. This class provides methods
- * for encoding and decoding <b>typed</b> variables including dates and defines the
- * Provider interface.
- */
-Ext.state.Provider = function(){
-    /**
-     * @event statechange
-     * Fires when a state change occurs.
-     * @param {Provider} this This state provider
-     * @param {String} key The state key which was changed
-     * @param {String} value The encoded value for the state
-     */
-    this.addEvents("statechange");
-    this.state = {};
-    Ext.state.Provider.superclass.constructor.call(this);
-};
-Ext.extend(Ext.state.Provider, Ext.util.Observable, {
-    /**
-     * Returns the current value for a key
-     * @param {String} name The key name
-     * @param {Mixed} defaultValue A default value to return if the key's value is not found
-     * @return {Mixed} The state data
-     */
-    get : function(name, defaultValue){
-        return typeof this.state[name] == "undefined" ?
-            defaultValue : this.state[name];
-    },
-
-    /**
-     * Clears a value from the state
-     * @param {String} name The key name
-     */
-    clear : function(name){
-        delete this.state[name];
-        this.fireEvent("statechange", this, name, null);
-    },
-
-    /**
-     * Sets the value for a key
-     * @param {String} name The key name
-     * @param {Mixed} value The value to set
-     */
-    set : function(name, value){
-        this.state[name] = value;
-        this.fireEvent("statechange", this, name, value);
-    },
-
-    /**
-     * Decodes a string previously encoded with {@link #encodeValue}.
-     * @param {String} value The value to decode
-     * @return {Mixed} The decoded value
-     */
-    decodeValue : function(cookie){
-        var re = /^(a|n|d|b|s|o)\:(.*)$/;
-        var matches = re.exec(unescape(cookie));
-        if(!matches || !matches[1]) return; // non state cookie
-        var type = matches[1];
-        var v = matches[2];
-        switch(type){
-            case "n":
-                return parseFloat(v);
-            case "d":
-                return new Date(Date.parse(v));
-            case "b":
-                return (v == "1");
-            case "a":
-                var all = [];
-                var values = v.split("^");
-                for(var i = 0, len = values.length; i < len; i++){
-                    all.push(this.decodeValue(values[i]));
-                }
-                return all;
-           case "o":
-                var all = {};
-                var values = v.split("^");
-                for(var i = 0, len = values.length; i < len; i++){
-                    var kv = values[i].split("=");
-                    all[kv[0]] = this.decodeValue(kv[1]);
-                }
-                return all;
-           default:
-                return v;
-        }
-    },
-
-    /**
-     * Encodes a value including type information.  Decode with {@link #decodeValue}.
-     * @param {Mixed} value The value to encode
-     * @return {String} The encoded value
-     */
-    encodeValue : function(v){
-        var enc;
-        if(typeof v == "number"){
-            enc = "n:" + v;
-        }else if(typeof v == "boolean"){
-            enc = "b:" + (v ? "1" : "0");
-        }else if(Ext.isDate(v)){
-            enc = "d:" + v.toGMTString();
-        }else if(Ext.isArray(v)){
-            var flat = "";
-            for(var i = 0, len = v.length; i < len; i++){
-                flat += this.encodeValue(v[i]);
-                if(i != len-1) flat += "^";
-            }
-            enc = "a:" + flat;
-        }else if(typeof v == "object"){
-            var flat = "";
-            for(var key in v){
-                if(typeof v[key] != "function" && v[key] !== undefined){
-                    flat += key + "=" + this.encodeValue(v[key]) + "^";
-                }
-            }
-            enc = "o:" + flat.substring(0, flat.length-1);
-        }else{
-            enc = "s:" + v;
-        }
-        return escape(enc);
-    }
-});
-/**\r
- * @class Ext.state.Manager\r
- * This is the global state manager. By default all components that are "state aware" check this class\r
- * for state information if you don't pass them a custom state provider. In order for this class\r
- * to be useful, it must be initialized with a provider when your application initializes. Example usage:\r
- <pre><code>\r
-// in your initialization function\r
-init : function(){\r
-   Ext.state.Manager.setProvider(new Ext.state.CookieProvider());\r
-   var win = new Window(...);\r
-   win.restoreState();\r
-}\r
- </code></pre>\r
- * @singleton\r
- */\r
-Ext.state.Manager = function(){\r
-    var provider = new Ext.state.Provider();\r
-\r
-    return {\r
-        /**\r
-         * Configures the default state provider for your application\r
-         * @param {Provider} stateProvider The state provider to set\r
-         */\r
-        setProvider : function(stateProvider){\r
-            provider = stateProvider;\r
-        },\r
-\r
-        /**\r
-         * Returns the current value for a key\r
-         * @param {String} name The key name\r
-         * @param {Mixed} defaultValue The default value to return if the key lookup does not match\r
-         * @return {Mixed} The state data\r
-         */\r
-        get : function(key, defaultValue){\r
-            return provider.get(key, defaultValue);\r
-        },\r
-\r
-        /**\r
-         * Sets the value for a key\r
-         * @param {String} name The key name\r
-         * @param {Mixed} value The state data\r
-         */\r
-         set : function(key, value){\r
-            provider.set(key, value);\r
-        },\r
-\r
-        /**\r
-         * Clears a value from the state\r
-         * @param {String} name The key name\r
-         */\r
-        clear : function(key){\r
-            provider.clear(key);\r
-        },\r
-\r
-        /**\r
-         * Gets the currently configured state provider\r
-         * @return {Provider} The state provider\r
-         */\r
-        getProvider : function(){\r
-            return provider;\r
+    \r
+    /**\r
+     * Destroys this resizable. If the element was wrapped and \r
+     * removeEl is not true then the element remains.\r
+     * @param {Boolean} removeEl (optional) true to remove the element from the DOM\r
+     */\r
+    destroy : function(removeEl){\r
+        Ext.destroy(this.dd, this.overlay, this.proxy);\r
+        this.overlay = null;\r
+        this.proxy = null;\r
+        \r
+        var ps = Ext.Resizable.positions;\r
+        for(var k in ps){\r
+            if(typeof ps[k] != 'function' && this[ps[k]]){\r
+                this[ps[k]].destroy();\r
+            }\r
         }\r
-    };\r
-}();\r
-/**\r
- * @class Ext.state.CookieProvider\r
- * @extends Ext.state.Provider\r
- * The default Provider implementation which saves state via cookies.\r
- * <br />Usage:\r
- <pre><code>\r
-   var cp = new Ext.state.CookieProvider({\r
-       path: "/cgi-bin/",\r
-       expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days\r
-       domain: "extjs.com"\r
-   });\r
-   Ext.state.Manager.setProvider(cp);\r
- </code></pre>\r
- * @cfg {String} path The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)\r
- * @cfg {Date} expires The cookie expiration date (defaults to 7 days from now)\r
- * @cfg {String} domain The domain to save the cookie for.  Note that you cannot specify a different domain than\r
- * your page is on, but you can specify a sub-domain, or simply the domain itself like 'extjs.com' to include\r
- * all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same\r
- * domain the page is running on including the 'www' like 'www.extjs.com')\r
- * @cfg {Boolean} secure True if the site is using SSL (defaults to false)\r
- * @constructor\r
- * Create a new CookieProvider\r
- * @param {Object} config The configuration object\r
- */\r
-Ext.state.CookieProvider = function(config){\r
-    Ext.state.CookieProvider.superclass.constructor.call(this);\r
-    this.path = "/";\r
-    this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days\r
-    this.domain = null;\r
-    this.secure = false;\r
-    Ext.apply(this, config);\r
-    this.state = this.readCookies();\r
+        if(removeEl){\r
+            this.el.update('');\r
+            Ext.destroy(this.el);\r
+            this.el = null;\r
+        }\r
+        this.purgeListeners();\r
+    },\r
+\r
+    syncHandleHeight : function(){\r
+        var h = this.el.getHeight(true);\r
+        if(this.west){\r
+            this.west.el.setHeight(h);\r
+        }\r
+        if(this.east){\r
+            this.east.el.setHeight(h);\r
+        }\r
+    }\r
+});\r
+\r
+// private\r
+// hash to map config positions to true positions\r
+Ext.Resizable.positions = {\r
+    n: 'north', s: 'south', e: 'east', w: 'west', se: 'southeast', sw: 'southwest', nw: 'northwest', ne: 'northeast'\r
 };\r
 \r
-Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, {\r
-    // private\r
-    set : function(name, value){\r
-        if(typeof value == "undefined" || value === null){\r
-            this.clear(name);\r
-            return;\r
+Ext.Resizable.Handle = Ext.extend(Object, {\r
+    constructor : function(rz, pos, disableTrackOver, transparent, cls){\r
+       if(!this.tpl){\r
+            // only initialize the template if resizable is used\r
+            var tpl = Ext.DomHelper.createTemplate(\r
+                {tag: 'div', cls: 'x-resizable-handle x-resizable-handle-{0}'}\r
+            );\r
+            tpl.compile();\r
+            Ext.Resizable.Handle.prototype.tpl = tpl;\r
         }\r
-        this.setCookie(name, value);\r
-        Ext.state.CookieProvider.superclass.set.call(this, name, value);\r
+        this.position = pos;\r
+        this.rz = rz;\r
+        this.el = this.tpl.append(rz.el.dom, [this.position], true);\r
+        this.el.unselectable();\r
+        if(transparent){\r
+            this.el.setOpacity(0);\r
+        }\r
+        if(!Ext.isEmpty(cls)){\r
+            this.el.addClass(cls);    \r
+        }\r
+        this.el.on('mousedown', this.onMouseDown, this);\r
+        if(!disableTrackOver){\r
+            this.el.on({\r
+                scope: this,\r
+                mouseover: this.onMouseOver,\r
+                mouseout: this.onMouseOut\r
+            });\r
+        }        \r
     },\r
-\r
+    \r
     // private\r
-    clear : function(name){\r
-        this.clearCookie(name);\r
-        Ext.state.CookieProvider.superclass.clear.call(this, name);\r
+    afterResize : function(rz){\r
+        // do nothing    \r
     },\r
-\r
     // private\r
-    readCookies : function(){\r
-        var cookies = {};\r
-        var c = document.cookie + ";";\r
-        var re = /\s?(.*?)=(.*?);/g;\r
-       var matches;\r
-       while((matches = re.exec(c)) != null){\r
-            var name = matches[1];\r
-            var value = matches[2];\r
-            if(name && name.substring(0,3) == "ys-"){\r
-                cookies[name.substr(3)] = this.decodeValue(value);\r
-            }\r
-        }\r
-        return cookies;\r
+    onMouseDown : function(e){\r
+        this.rz.onMouseDown(this, e);\r
     },\r
-\r
     // private\r
-    setCookie : function(name, value){\r
-        document.cookie = "ys-"+ name + "=" + this.encodeValue(value) +\r
-           ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) +\r
-           ((this.path == null) ? "" : ("; path=" + this.path)) +\r
-           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +\r
-           ((this.secure == true) ? "; secure" : "");\r
+    onMouseOver : function(e){\r
+        this.rz.handleOver(this, e);\r
     },\r
-\r
     // private\r
-    clearCookie : function(name){\r
-        document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" +\r
-           ((this.path == null) ? "" : ("; path=" + this.path)) +\r
-           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +\r
-           ((this.secure == true) ? "; secure" : "");\r
+    onMouseOut : function(e){\r
+        this.rz.handleOut(this, e);\r
+    },\r
+    // private\r
+    destroy : function(){\r
+        Ext.destroy(this.el);\r
+        this.el = null;\r
     }\r
-});/**
- * @class Ext.DataView
- * @extends Ext.BoxComponent
- * A mechanism for displaying data using custom layout templates and formatting. DataView uses an {@link Ext.XTemplate}
- * as its internal templating mechanism, and is bound to an {@link Ext.data.Store}
- * so that as the data in the store changes the view is automatically updated to reflect the changes.  The view also
- * provides built-in behavior for many common events that can occur for its contained items including click, doubleclick,
- * mouseover, mouseout, etc. as well as a built-in selection model. <b>In order to use these features, an {@link #itemSelector}
- * config must be provided for the DataView to determine what nodes it will be working with.</b>
- *
- * <p>The example below binds a DataView to a {@link Ext.data.Store} and renders it into an {@link Ext.Panel}.</p>
- * <pre><code>
-var store = new Ext.data.JsonStore({
-    url: 'get-images.php',
-    root: 'images',
-    fields: [
-        'name', 'url',
-        {name:'size', type: 'float'},
-        {name:'lastmod', type:'date', dateFormat:'timestamp'}
-    ]
-});
-store.load();
-
-var tpl = new Ext.XTemplate(
-    '&lt;tpl for="."&gt;',
-        '&lt;div class="thumb-wrap" id="{name}"&gt;',
-        '&lt;div class="thumb"&gt;&lt;img src="{url}" title="{name}"&gt;&lt;/div&gt;',
-        '&lt;span class="x-editable"&gt;{shortName}&lt;/span&gt;&lt;/div&gt;',
-    '&lt;/tpl&gt;',
-    '&lt;div class="x-clear"&gt;&lt;/div&gt;'
-);
-
-var panel = new Ext.Panel({
-    id:'images-view',
-    frame:true,
-    width:535,
-    autoHeight:true,
-    collapsible:true,
-    layout:'fit',
-    title:'Simple DataView',
-
-    items: new Ext.DataView({
-        store: store,
-        tpl: tpl,
-        autoHeight:true,
-        multiSelect: true,
-        overClass:'x-view-over',
-        itemSelector:'div.thumb-wrap',
-        emptyText: 'No images to display'
-    })
-});
-panel.render(document.body);
-</code></pre>
+});\r
+/**
+ * @class Ext.Window
+ * @extends Ext.Panel
+ * <p>A specialized panel intended for use as an application window.  Windows are floated, {@link #resizable}, and
+ * {@link #draggable} by default.  Windows can be {@link #maximizable maximized} to fill the viewport,
+ * restored to their prior size, and can be {@link #minimize}d.</p>
+ * <p>Windows can also be linked to a {@link Ext.WindowGroup} or managed by the {@link Ext.WindowMgr} to provide
+ * grouping, activation, to front, to back and other application-specific behavior.</p>
+ * <p>By default, Windows will be rendered to document.body. To {@link #constrain} a Window to another element
+ * specify {@link Ext.Component#renderTo renderTo}.</p>
+ * <p><b>Note:</b> By default, the <code>{@link #closable close}</code> header tool <i>destroys</i> the Window resulting in
+ * destruction of any child Components. This makes the Window object, and all its descendants <b>unusable</b>. To enable
+ * re-use of a Window, use <b><code>{@link #closeAction closeAction: 'hide'}</code></b>.</p>
  * @constructor
- * Create a new DataView
  * @param {Object} config The config object
- * @xtype dataview
+ * @xtype window
  */
-Ext.DataView = Ext.extend(Ext.BoxComponent, {
+Ext.Window = Ext.extend(Ext.Panel, {
     /**
-     * @cfg {String/Array} tpl
-     * The HTML fragment or an array of fragments that will make up the template used by this DataView.  This should
-     * be specified in the same format expected by the constructor of {@link Ext.XTemplate}.
+     * @cfg {Number} x
+     * The X position of the left edge of the window on initial showing. Defaults to centering the Window within
+     * the width of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
      */
     /**
-     * @cfg {Ext.data.Store} store
-     * The {@link Ext.data.Store} to bind this DataView to.
+     * @cfg {Number} y
+     * The Y position of the top edge of the window on initial showing. Defaults to centering the Window within
+     * the height of the Window's container {@link Ext.Element Element) (The Element that the Window is rendered to).
      */
     /**
-     * @cfg {String} itemSelector
-     * <b>This is a required setting</b>. A simple CSS selector (e.g. <tt>div.some-class</tt> or 
-     * <tt>span:first-child</tt>) that will be used to determine what nodes this DataView will be
-     * working with.
+     * @cfg {Boolean} modal
+     * True to make the window modal and mask everything behind it when displayed, false to display it without
+     * restricting access to other UI elements (defaults to false).
      */
     /**
-     * @cfg {Boolean} multiSelect
-     * True to allow selection of more than one item at a time, false to allow selection of only a single item
-     * at a time or no selection at all, depending on the value of {@link #singleSelect} (defaults to false).
+     * @cfg {String/Element} animateTarget
+     * Id or element from which the window should animate while opening (defaults to null with no animation).
      */
     /**
-     * @cfg {Boolean} singleSelect
-     * True to allow selection of exactly one item at a time, false to allow no selection at all (defaults to false).
-     * Note that if {@link #multiSelect} = true, this value will be ignored.
+     * @cfg {String} resizeHandles
+     * A valid {@link Ext.Resizable} handles config string (defaults to 'all').  Only applies when resizable = true.
      */
     /**
-     * @cfg {Boolean} simpleSelect
-     * True to enable multiselection by clicking on multiple items without requiring the user to hold Shift or Ctrl,
-     * false to force the user to hold Ctrl or Shift to select more than on item (defaults to false).
+     * @cfg {Ext.WindowGroup} manager
+     * A reference to the WindowGroup that should manage this window (defaults to {@link Ext.WindowMgr}).
      */
     /**
-     * @cfg {String} overClass
-     * A CSS class to apply to each item in the view on mouseover (defaults to undefined).
+    * @cfg {String/Number/Component} defaultButton
+    * <p>Specifies a Component to receive focus when this Window is focussed.</p>
+    * <p>This may be one of:</p><div class="mdetail-params"><ul>
+    * <li>The index of a footer Button.</li>
+    * <li>The id of a Component.</li>
+    * <li>A Component.</li>
+    * </ul></div>
+    */
+    /**
+    * @cfg {Function} onEsc
+    * Allows override of the built-in processing for the escape key. Default action
+    * is to close the Window (performing whatever action is specified in {@link #closeAction}.
+    * To prevent the Window closing when the escape key is pressed, specify this as
+    * Ext.emptyFn (See {@link Ext#emptyFn}).
+    */
+    /**
+     * @cfg {Boolean} collapsed
+     * True to render the window collapsed, false to render it expanded (defaults to false). Note that if
+     * {@link #expandOnShow} is true (the default) it will override the <tt>collapsed</tt> config and the window
+     * will always be expanded when shown.
      */
     /**
-     * @cfg {String} loadingText
-     * A string to display during data load operations (defaults to undefined).  If specified, this text will be
-     * displayed in a loading div and the view's contents will be cleared while loading, otherwise the view's
-     * contents will continue to display normally until the new data is loaded and the contents are replaced.
+     * @cfg {Boolean} maximized
+     * True to initially display the window in a maximized state. (Defaults to false).
      */
+
     /**
-     * @cfg {String} selectedClass
-     * A CSS class to apply to each selected item in the view (defaults to 'x-view-selected').
+    * @cfg {String} baseCls
+    * The base CSS class to apply to this panel's element (defaults to 'x-window').
+    */
+    baseCls : 'x-window',
+    /**
+     * @cfg {Boolean} resizable
+     * True to allow user resizing at each edge and corner of the window, false to disable resizing (defaults to true).
      */
-    selectedClass : "x-view-selected",
+    resizable : true,
     /**
-     * @cfg {String} emptyText
-     * The text to display in the view when there is no data to display (defaults to '').
+     * @cfg {Boolean} draggable
+     * True to allow the window to be dragged by the header bar, false to disable dragging (defaults to true).  Note
+     * that by default the window will be centered in the viewport, so if dragging is disabled the window may need
+     * to be positioned programmatically after render (e.g., myWindow.setPosition(100, 100);).
      */
-    emptyText : "",
+    draggable : true,
+    /**
+     * @cfg {Boolean} closable
+     * <p>True to display the 'close' tool button and allow the user to close the window, false to
+     * hide the button and disallow closing the window (defaults to true).</p>
+     * <p>By default, when close is requested by either clicking the close button in the header
+     * or pressing ESC when the Window has focus, the {@link #close} method will be called. This
+     * will <i>{@link Ext.Component#destroy destroy}</i> the Window and its content meaning that
+     * it may not be reused.</p>
+     * <p>To make closing a Window <i>hide</i> the Window so that it may be reused, set
+     * {@link #closeAction} to 'hide'.
+     */
+    closable : true,
+    /**
+     * @cfg {String} closeAction
+     * <p>The action to take when the close header tool is clicked:
+     * <div class="mdetail-params"><ul>
+     * <li><b><code>'{@link #close}'</code></b> : <b>Default</b><div class="sub-desc">
+     * {@link #close remove} the window from the DOM and {@link Ext.Component#destroy destroy}
+     * it and all descendant Components. The window will <b>not</b> be available to be
+     * redisplayed via the {@link #show} method.
+     * </div></li>
+     * <li><b><code>'{@link #hide}'</code></b> : <div class="sub-desc">
+     * {@link #hide} the window by setting visibility to hidden and applying negative offsets.
+     * The window will be available to be redisplayed via the {@link #show} method.
+     * </div></li>
+     * </ul></div>
+     * <p><b>Note:</b> This setting does not affect the {@link #close} method
+     * which will always {@link Ext.Component#destroy destroy} the window. To
+     * programatically <i>hide</i> a window, call {@link #hide}.</p>
+     */
+    closeAction : 'close',
+    /**
+     * @cfg {Boolean} constrain
+     * True to constrain the window within its containing element, false to allow it to fall outside of its
+     * containing element. By default the window will be rendered to document.body.  To render and constrain the
+     * window within another element specify {@link #renderTo}.
+     * (defaults to false).  Optionally the header only can be constrained using {@link #constrainHeader}.
+     */
+    constrain : false,
+    /**
+     * @cfg {Boolean} constrainHeader
+     * True to constrain the window header within its containing element (allowing the window body to fall outside
+     * of its containing element) or false to allow the header to fall outside its containing element (defaults to
+     * false). Optionally the entire window can be constrained using {@link #constrain}.
+     */
+    constrainHeader : false,
+    /**
+     * @cfg {Boolean} plain
+     * True to render the window body with a transparent background so that it will blend into the framing
+     * elements, false to add a lighter background color to visually highlight the body element and separate it
+     * more distinctly from the surrounding frame (defaults to false).
+     */
+    plain : false,
+    /**
+     * @cfg {Boolean} minimizable
+     * True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button
+     * and disallow minimizing the window (defaults to false).  Note that this button provides no implementation --
+     * the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a
+     * custom minimize behavior implemented for this option to be useful.
+     */
+    minimizable : false,
+    /**
+     * @cfg {Boolean} maximizable
+     * True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button
+     * and disallow maximizing the window (defaults to false).  Note that when a window is maximized, the tool button
+     * will automatically change to a 'restore' button with the appropriate behavior already built-in that will
+     * restore the window to its previous size.
+     */
+    maximizable : false,
+    /**
+     * @cfg {Number} minHeight
+     * The minimum height in pixels allowed for this window (defaults to 100).  Only applies when resizable = true.
+     */
+    minHeight : 100,
+    /**
+     * @cfg {Number} minWidth
+     * The minimum width in pixels allowed for this window (defaults to 200).  Only applies when resizable = true.
+     */
+    minWidth : 200,
+    /**
+     * @cfg {Boolean} expandOnShow
+     * True to always expand the window when it is displayed, false to keep it in its current state (which may be
+     * {@link #collapsed}) when displayed (defaults to true).
+     */
+    expandOnShow : true,
+
+    // inherited docs, same default
+    collapsible : false,
+
+    /**
+     * @cfg {Boolean} initHidden
+     * True to hide the window until show() is explicitly called (defaults to true).
+     * @deprecated
+     */
+    initHidden : undefined,
+
+    /**
+     * @cfg {Boolean} hidden
+     * Render this component hidden (default is <tt>true</tt>). If <tt>true</tt>, the
+     * {@link #hide} method will be called internally.
+     */
+    hidden : true,
+
+    // The following configs are set to provide the basic functionality of a window.
+    // Changing them would require additional code to handle correctly and should
+    // usually only be done in subclasses that can provide custom behavior.  Changing them
+    // may have unexpected or undesirable results.
+    /** @cfg {String} elements @hide */
+    elements : 'header,body',
+    /** @cfg {Boolean} frame @hide */
+    frame : true,
+    /** @cfg {Boolean} floating @hide */
+    floating : true,
+
+    // private
+    initComponent : function(){
+        this.initTools();
+        Ext.Window.superclass.initComponent.call(this);
+        this.addEvents(
+            /**
+             * @event activate
+             * Fires after the window has been visually activated via {@link #setActive}.
+             * @param {Ext.Window} this
+             */
+            /**
+             * @event deactivate
+             * Fires after the window has been visually deactivated via {@link #setActive}.
+             * @param {Ext.Window} this
+             */
+            /**
+             * @event resize
+             * Fires after the window has been resized.
+             * @param {Ext.Window} this
+             * @param {Number} width The window's new width
+             * @param {Number} height The window's new height
+             */
+            'resize',
+            /**
+             * @event maximize
+             * Fires after the window has been maximized.
+             * @param {Ext.Window} this
+             */
+            'maximize',
+            /**
+             * @event minimize
+             * Fires after the window has been minimized.
+             * @param {Ext.Window} this
+             */
+            'minimize',
+            /**
+             * @event restore
+             * Fires after the window has been restored to its original size after being maximized.
+             * @param {Ext.Window} this
+             */
+            'restore'
+        );
+        // for backwards compat, this should be removed at some point
+        if(Ext.isDefined(this.initHidden)){
+            this.hidden = this.initHidden;
+        }
+        if(this.hidden === false){
+            this.hidden = true;
+            this.show();
+        }
+    },
+
+    // private
+    getState : function(){
+        return Ext.apply(Ext.Window.superclass.getState.call(this) || {}, this.getBox(true));
+    },
+
+    // private
+    onRender : function(ct, position){
+        Ext.Window.superclass.onRender.call(this, ct, position);
+
+        if(this.plain){
+            this.el.addClass('x-window-plain');
+        }
+
+        // this element allows the Window to be focused for keyboard events
+        this.focusEl = this.el.createChild({
+                    tag: 'a', href:'#', cls:'x-dlg-focus',
+                    tabIndex:'-1', html: '&#160;'});
+        this.focusEl.swallowEvent('click', true);
+
+        this.proxy = this.el.createProxy('x-window-proxy');
+        this.proxy.enableDisplayMode('block');
+
+        if(this.modal){
+            this.mask = this.container.createChild({cls:'ext-el-mask'}, this.el.dom);
+            this.mask.enableDisplayMode('block');
+            this.mask.hide();
+            this.mon(this.mask, 'click', this.focus, this);
+        }
+        if(this.maximizable){
+            this.mon(this.header, 'dblclick', this.toggleMaximize, this);
+        }
+    },
+
+    // private
+    initEvents : function(){
+        Ext.Window.superclass.initEvents.call(this);
+        if(this.animateTarget){
+            this.setAnimateTarget(this.animateTarget);
+        }
+
+        if(this.resizable){
+            this.resizer = new Ext.Resizable(this.el, {
+                minWidth: this.minWidth,
+                minHeight:this.minHeight,
+                handles: this.resizeHandles || 'all',
+                pinned: true,
+                resizeElement : this.resizerAction,
+                handleCls: 'x-window-handle'
+            });
+            this.resizer.window = this;
+            this.mon(this.resizer, 'beforeresize', this.beforeResize, this);
+        }
+
+        if(this.draggable){
+            this.header.addClass('x-window-draggable');
+        }
+        this.mon(this.el, 'mousedown', this.toFront, this);
+        this.manager = this.manager || Ext.WindowMgr;
+        this.manager.register(this);
+        if(this.maximized){
+            this.maximized = false;
+            this.maximize();
+        }
+        if(this.closable){
+            var km = this.getKeyMap();
+            km.on(27, this.onEsc, this);
+            km.disable();
+        }
+    },
+
+    initDraggable : function(){
+        /**
+         * If this Window is configured {@link #draggable}, this property will contain
+         * an instance of {@link Ext.dd.DD} which handles dragging the Window's DOM Element.
+         * @type Ext.dd.DD
+         * @property dd
+         */
+        this.dd = new Ext.Window.DD(this);
+    },
+
+   // private
+    onEsc : function(k, e){
+        e.stopEvent();
+        this[this.closeAction]();
+    },
+
+    // private
+    beforeDestroy : function(){
+        if (this.rendered){
+            this.hide();
+          if(this.doAnchor){
+                Ext.EventManager.removeResizeListener(this.doAnchor, this);
+              Ext.EventManager.un(window, 'scroll', this.doAnchor, this);
+            }
+            Ext.destroy(
+                this.focusEl,
+                this.resizer,
+                this.dd,
+                this.proxy,
+                this.mask
+            );
+        }
+        Ext.Window.superclass.beforeDestroy.call(this);
+    },
+
+    // private
+    onDestroy : function(){
+        if(this.manager){
+            this.manager.unregister(this);
+        }
+        Ext.Window.superclass.onDestroy.call(this);
+    },
+
+    // private
+    initTools : function(){
+        if(this.minimizable){
+            this.addTool({
+                id: 'minimize',
+                handler: this.minimize.createDelegate(this, [])
+            });
+        }
+        if(this.maximizable){
+            this.addTool({
+                id: 'maximize',
+                handler: this.maximize.createDelegate(this, [])
+            });
+            this.addTool({
+                id: 'restore',
+                handler: this.restore.createDelegate(this, []),
+                hidden:true
+            });
+        }
+        if(this.closable){
+            this.addTool({
+                id: 'close',
+                handler: this[this.closeAction].createDelegate(this, [])
+            });
+        }
+    },
 
-    /**
-     * @cfg {Boolean} deferEmptyText True to defer emptyText being applied until the store's first load
-     */
-    deferEmptyText: true,
-    /**
-     * @cfg {Boolean} trackOver True to enable mouseenter and mouseleave events
-     */
-    trackOver: false,
+    // private
+    resizerAction : function(){
+        var box = this.proxy.getBox();
+        this.proxy.hide();
+        this.window.handleResize(box);
+        return box;
+    },
 
-    //private
-    last: false,
+    // private
+    beforeResize : function(){
+        this.resizer.minHeight = Math.max(this.minHeight, this.getFrameHeight() + 40); // 40 is a magic minimum content size?
+        this.resizer.minWidth = Math.max(this.minWidth, this.getFrameWidth() + 40);
+        this.resizeBox = this.el.getBox();
+    },
 
     // private
-    initComponent : function(){
-        Ext.DataView.superclass.initComponent.call(this);
-        if(Ext.isString(this.tpl) || Ext.isArray(this.tpl)){
-            this.tpl = new Ext.XTemplate(this.tpl);
+    updateHandles : function(){
+        if(Ext.isIE && this.resizer){
+            this.resizer.syncHandleHeight();
+            this.el.repaint();
         }
+    },
 
-        this.addEvents(
-            /**
-             * @event beforeclick
-             * Fires before a click is processed. Returns false to cancel the default action.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "beforeclick",
-            /**
-             * @event click
-             * Fires when a template node is clicked.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "click",
-            /**
-             * @event mouseenter
-             * Fires when the mouse enters a template node. trackOver:true or an overCls must be set to enable this event.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "mouseenter",
-            /**
-             * @event mouseleave
-             * Fires when the mouse leaves a template node. trackOver:true or an overCls must be set to enable this event.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "mouseleave",
-            /**
-             * @event containerclick
-             * Fires when a click occurs and it is not on a template node.
-             * @param {Ext.DataView} this
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "containerclick",
-            /**
-             * @event dblclick
-             * Fires when a template node is double clicked.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "dblclick",
-            /**
-             * @event contextmenu
-             * Fires when a template node is right clicked.
-             * @param {Ext.DataView} this
-             * @param {Number} index The index of the target node
-             * @param {HTMLElement} node The target node
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "contextmenu",
-            /**
-             * @event containercontextmenu
-             * Fires when a right click occurs that is not on a template node.
-             * @param {Ext.DataView} this
-             * @param {Ext.EventObject} e The raw event object
-             */
-            "containercontextmenu",
-            /**
-             * @event selectionchange
-             * Fires when the selected nodes change.
-             * @param {Ext.DataView} this
-             * @param {Array} selections Array of the selected nodes
-             */
-            "selectionchange",
+    // private
+    handleResize : function(box){
+        var rz = this.resizeBox;
+        if(rz.x != box.x || rz.y != box.y){
+            this.updateBox(box);
+        }else{
+            this.setSize(box);
+        }
+        this.focus();
+        this.updateHandles();
+        this.saveState();
+        this.doLayout();
+    },
 
-            /**
-             * @event beforeselect
-             * Fires before a selection is made. If any handlers return false, the selection is cancelled.
-             * @param {Ext.DataView} this
-             * @param {HTMLElement} node The node to be selected
-             * @param {Array} selections Array of currently selected nodes
-             */
-            "beforeselect"
-        );
+    /**
+     * Focuses the window.  If a defaultButton is set, it will receive focus, otherwise the
+     * window itself will receive focus.
+     */
+    focus : function(){
+        var f = this.focusEl, db = this.defaultButton, t = typeof db;
+        if(Ext.isDefined(db)){
+            if(Ext.isNumber(db) && this.fbar){
+                f = this.fbar.items.get(db);
+            }else if(Ext.isString(db)){
+                f = Ext.getCmp(db);
+            }else{
+                f = db;
+            }
+        }
+        f = f || this.focusEl;
+        f.focus.defer(10, f);
+    },
 
-        this.store = Ext.StoreMgr.lookup(this.store);
-        this.all = new Ext.CompositeElementLite();
-        this.selected = new Ext.CompositeElementLite();
+    /**
+     * Sets the target element from which the window should animate while opening.
+     * @param {String/Element} el The target element or id
+     */
+    setAnimateTarget : function(el){
+        el = Ext.get(el);
+        this.animateTarget = el;
     },
 
     // private
-    afterRender : function(){
-        Ext.DataView.superclass.afterRender.call(this);
-
-               this.mon(this.getTemplateTarget(), {
-            "click": this.onClick,
-            "dblclick": this.onDblClick,
-            "contextmenu": this.onContextMenu,
-            scope:this
-        });
+    beforeShow : function(){
+        delete this.el.lastXY;
+        delete this.el.lastLT;
+        if(this.x === undefined || this.y === undefined){
+            var xy = this.el.getAlignToXY(this.container, 'c-c');
+            var pos = this.el.translatePoints(xy[0], xy[1]);
+            this.x = this.x === undefined? pos.left : this.x;
+            this.y = this.y === undefined? pos.top : this.y;
+        }
+        this.el.setLeftTop(this.x, this.y);
 
-        if(this.overClass || this.trackOver){
-            this.mon(this.getTemplateTarget(), {
-                "mouseover": this.onMouseOver,
-                "mouseout": this.onMouseOut,
-                scope:this
-            });
+        if(this.expandOnShow){
+            this.expand(false);
         }
 
-        if(this.store){
-            this.bindStore(this.store, true);
+        if(this.modal){
+            Ext.getBody().addClass('x-body-masked');
+            this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
+            this.mask.show();
         }
     },
 
     /**
-     * Refreshes the view by reloading the data from the store and re-rendering the template.
+     * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden.
+     * @param {String/Element} animateTarget (optional) The target element or id from which the window should
+     * animate while opening (defaults to null with no animation)
+     * @param {Function} callback (optional) A callback function to call after the window is displayed
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this Window.
+     * @return {Ext.Window} this
      */
-    refresh : function(){
-        this.clearSelections(false, true);
-        var el = this.getTemplateTarget();
-        el.update("");
-        var records = this.store.getRange();
-        if(records.length < 1){
-            if(!this.deferEmptyText || this.hasSkippedEmptyText){
-                el.update(this.emptyText);
-            }
-            this.all.clear();
+    show : function(animateTarget, cb, scope){
+        if(!this.rendered){
+            this.render(Ext.getBody());
+        }
+        if(this.hidden === false){
+            this.toFront();
+            return this;
+        }
+        if(this.fireEvent('beforeshow', this) === false){
+            return this;
+        }
+        if(cb){
+            this.on('show', cb, scope, {single:true});
+        }
+        this.hidden = false;
+        if(Ext.isDefined(animateTarget)){
+            this.setAnimateTarget(animateTarget);
+        }
+        this.beforeShow();
+        if(this.animateTarget){
+            this.animShow();
         }else{
-            this.tpl.overwrite(el, this.collectData(records, 0));
-            this.all.fill(Ext.query(this.itemSelector, el.dom));
-            this.updateIndexes(0);
+            this.afterShow();
         }
-        this.hasSkippedEmptyText = true;
+        return this;
     },
 
-    getTemplateTarget: function(){
-        return this.el;
+    // private
+    afterShow : function(isAnim){
+        if (this.isDestroyed){
+            return false;
+        }
+        this.proxy.hide();
+        this.el.setStyle('display', 'block');
+        this.el.show();
+        if(this.maximized){
+            this.fitContainer();
+        }
+        if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug
+            this.cascade(this.setAutoScroll);
+        }
+
+        if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
+            Ext.EventManager.onWindowResize(this.onWindowResize, this);
+        }
+        this.doConstrain();
+        this.doLayout();
+        if(this.keyMap){
+            this.keyMap.enable();
+        }
+        this.toFront();
+        this.updateHandles();
+        if(isAnim && (Ext.isIE || Ext.isWebKit)){
+            var sz = this.getSize();
+            this.onResize(sz.width, sz.height);
+        }
+        this.onShow();
+        this.fireEvent('show', this);
     },
 
-    /**
-     * Function which can be overridden to provide custom formatting for each Record that is used by this
-     * DataView's {@link #tpl template} to render each node.
-     * @param {Array/Object} data The raw data object that was used to create the Record.
-     * @param {Number} recordIndex the index number of the Record being prepared for rendering.
-     * @param {Record} record The Record being prepared for rendering.
-     * @return {Array/Object} The formatted data in a format expected by the internal {@link #tpl template}'s overwrite() method.
-     * (either an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}))
-     */
-    prepareData : function(data){
-        return data;
+    // private
+    animShow : function(){
+        this.proxy.show();
+        this.proxy.setBox(this.animateTarget.getBox());
+        this.proxy.setOpacity(0);
+        var b = this.getBox();
+        this.el.setStyle('display', 'none');
+        this.proxy.shift(Ext.apply(b, {
+            callback: this.afterShow.createDelegate(this, [true], false),
+            scope: this,
+            easing: 'easeNone',
+            duration: 0.25,
+            opacity: 0.5
+        }));
     },
 
     /**
-     * <p>Function which can be overridden which returns the data object passed to this
-     * DataView's {@link #tpl template} to render the whole DataView.</p>
-     * <p>This is usually an Array of data objects, each element of which is processed by an
-     * {@link Ext.XTemplate XTemplate} which uses <tt>'&lt;tpl for="."&gt;'</tt> to iterate over its supplied
-     * data object as an Array. However, <i>named</i> properties may be placed into the data object to
-     * provide non-repeating data such as headings, totals etc.</p>
-     * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView.
-     * @param {Number} startIndex the index number of the Record being prepared for rendering.
-     * @return {Array} An Array of data objects to be processed by a repeating XTemplate. May also
-     * contain <i>named</i> properties.
+     * Hides the window, setting it to invisible and applying negative offsets.
+     * @param {String/Element} animateTarget (optional) The target element or id to which the window should
+     * animate while hiding (defaults to null with no animation)
+     * @param {Function} callback (optional) A callback function to call after the window is hidden
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this Window.
+     * @return {Ext.Window} this
      */
-    collectData : function(records, startIndex){
-        var r = [];
-        for(var i = 0, len = records.length; i < len; i++){
-            r[r.length] = this.prepareData(records[i].data, startIndex+i, records[i]);
+    hide : function(animateTarget, cb, scope){
+        if(this.hidden || this.fireEvent('beforehide', this) === false){
+            return this;
         }
-        return r;
+        if(cb){
+            this.on('hide', cb, scope, {single:true});
+        }
+        this.hidden = true;
+        if(animateTarget !== undefined){
+            this.setAnimateTarget(animateTarget);
+        }
+        if(this.modal){
+            this.mask.hide();
+            Ext.getBody().removeClass('x-body-masked');
+        }
+        if(this.animateTarget){
+            this.animHide();
+        }else{
+            this.el.hide();
+            this.afterHide();
+        }
+        return this;
     },
 
     // private
-    bufferRender : function(records){
-        var div = document.createElement('div');
-        this.tpl.overwrite(div, this.collectData(records));
-        return Ext.query(this.itemSelector, div);
+    afterHide : function(){
+        this.proxy.hide();
+        if(this.monitorResize || this.modal || this.constrain || this.constrainHeader){
+            Ext.EventManager.removeResizeListener(this.onWindowResize, this);
+        }
+        if(this.keyMap){
+            this.keyMap.disable();
+        }
+        this.onHide();
+        this.fireEvent('hide', this);
     },
 
     // private
-    onUpdate : function(ds, record){
-        var index = this.store.indexOf(record);
-        var sel = this.isSelected(index);
-        var original = this.all.elements[index];
-        var node = this.bufferRender([record], index)[0];
-
-        this.all.replaceElement(index, node, true);
-        if(sel){
-            this.selected.replaceElement(original, node);
-            this.all.item(index).addClass(this.selectedClass);
-        }
-        this.updateIndexes(index, index);
+    animHide : function(){
+        this.proxy.setOpacity(0.5);
+        this.proxy.show();
+        var tb = this.getBox(false);
+        this.proxy.setBox(tb);
+        this.el.hide();
+        this.proxy.shift(Ext.apply(this.animateTarget.getBox(), {
+            callback: this.afterHide,
+            scope: this,
+            duration: 0.25,
+            easing: 'easeNone',
+            opacity: 0
+        }));
     },
 
+    /**
+     * Method that is called immediately before the <code>show</code> event is fired.
+     * Defaults to <code>Ext.emptyFn</code>.
+     */
+    onShow : Ext.emptyFn,
+
+    /**
+     * Method that is called immediately before the <code>hide</code> event is fired.
+     * Defaults to <code>Ext.emptyFn</code>.
+     */
+    onHide : Ext.emptyFn,
+
     // private
-    onAdd : function(ds, records, index){
-        if(this.all.getCount() === 0){
-            this.refresh();
-            return;
+    onWindowResize : function(){
+        if(this.maximized){
+            this.fitContainer();
         }
-        var nodes = this.bufferRender(records, index), n, a = this.all.elements;
-        if(index < this.all.getCount()){
-            n = this.all.item(index).insertSibling(nodes, 'before', true);
-            a.splice.apply(a, [index, 0].concat(nodes));
-        }else{
-            n = this.all.last().insertSibling(nodes, 'after', true);
-            a.push.apply(a, nodes);
+        if(this.modal){
+            this.mask.setSize('100%', '100%');
+            var force = this.mask.dom.offsetHeight;
+            this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));
         }
-        this.updateIndexes(index);
+        this.doConstrain();
     },
 
     // private
-    onRemove : function(ds, record, index){
-        this.deselect(index);
-        this.all.removeElement(index, true);
-        this.updateIndexes(index);
-        if (this.store.getCount() === 0){
-            this.refresh();
+    doConstrain : function(){
+        if(this.constrain || this.constrainHeader){
+            var offsets;
+            if(this.constrain){
+                offsets = {
+                    right:this.el.shadowOffset,
+                    left:this.el.shadowOffset,
+                    bottom:this.el.shadowOffset
+                };
+            }else {
+                var s = this.getSize();
+                offsets = {
+                    right:-(s.width - 100),
+                    bottom:-(s.height - 25)
+                };
+            }
+
+            var xy = this.el.getConstrainToXY(this.container, true, offsets);
+            if(xy){
+                this.setPosition(xy[0], xy[1]);
+            }
         }
     },
 
-    /**
-     * Refreshes an individual node's data from the store.
-     * @param {Number} index The item's data index in the store
-     */
-    refreshNode : function(index){
-        this.onUpdate(this.store, this.store.getAt(index));
+    // private - used for dragging
+    ghost : function(cls){
+        var ghost = this.createGhost(cls);
+        var box = this.getBox(true);
+        ghost.setLeftTop(box.x, box.y);
+        ghost.setWidth(box.width);
+        this.el.hide();
+        this.activeGhost = ghost;
+        return ghost;
     },
 
     // private
-    updateIndexes : function(startIndex, endIndex){
-        var ns = this.all.elements;
-        startIndex = startIndex || 0;
-        endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));
-        for(var i = startIndex; i <= endIndex; i++){
-            ns[i].viewIndex = i;
+    unghost : function(show, matchPosition){
+        if(!this.activeGhost) {
+            return;
+        }
+        if(show !== false){
+            this.el.show();
+            this.focus();
+            if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug
+                this.cascade(this.setAutoScroll);
+            }
         }
+        if(matchPosition !== false){
+            this.setPosition(this.activeGhost.getLeft(true), this.activeGhost.getTop(true));
+        }
+        this.activeGhost.hide();
+        this.activeGhost.remove();
+        delete this.activeGhost;
     },
-    
+
     /**
-     * Returns the store associated with this DataView.
-     * @return {Ext.data.Store} The store
+     * Placeholder method for minimizing the window.  By default, this method simply fires the {@link #minimize} event
+     * since the behavior of minimizing a window is application-specific.  To implement custom minimize behavior,
+     * either the minimize event can be handled or this method can be overridden.
+     * @return {Ext.Window} this
      */
-    getStore : function(){
-        return this.store;
+    minimize : function(){
+        this.fireEvent('minimize', this);
+        return this;
     },
 
     /**
-     * Changes the data store bound to this view and refreshes it.
-     * @param {Store} store The store to bind to this view
+     * <p>Closes the Window, removes it from the DOM, {@link Ext.Component#destroy destroy}s
+     * the Window object and all its descendant Components. The {@link Ext.Panel#beforeclose beforeclose}
+     * event is fired before the close happens and will cancel the close action if it returns false.<p>
+     * <p><b>Note:</b> This method is not affected by the {@link #closeAction} setting which
+     * only affects the action triggered when clicking the {@link #closable 'close' tool in the header}.
+     * To hide the Window without destroying it, call {@link #hide}.</p>
      */
-    bindStore : function(store, initial){
-        if(!initial && this.store){
-            this.store.un("beforeload", this.onBeforeLoad, this);
-            this.store.un("datachanged", this.refresh, this);
-            this.store.un("add", this.onAdd, this);
-            this.store.un("remove", this.onRemove, this);
-            this.store.un("update", this.onUpdate, this);
-            this.store.un("clear", this.refresh, this);
-            if(store !== this.store && this.store.autoDestroy){
-                this.store.destroy();
+    close : function(){
+        if(this.fireEvent('beforeclose', this) !== false){
+            if(this.hidden){
+                this.doClose();
+            }else{
+                this.hide(null, this.doClose, this);
             }
         }
-        if(store){
-            store = Ext.StoreMgr.lookup(store);
-            store.on({
-                scope: this,
-                beforeload: this.onBeforeLoad,
-                datachanged: this.refresh,
-                add: this.onAdd,
-                remove: this.onRemove,
-                update: this.onUpdate,
-                clear: this.refresh
-            });
-        }
-        this.store = store;
-        if(store){
-            this.refresh();
+    },
+
+    // private
+    doClose : function(){
+        this.fireEvent('close', this);
+        this.destroy();
+    },
+
+    /**
+     * Fits the window within its current container and automatically replaces
+     * the {@link #maximizable 'maximize' tool button} with the 'restore' tool button.
+     * Also see {@link #toggleMaximize}.
+     * @return {Ext.Window} this
+     */
+    maximize : function(){
+        if(!this.maximized){
+            this.expand(false);
+            this.restoreSize = this.getSize();
+            this.restorePos = this.getPosition(true);
+            if (this.maximizable){
+                this.tools.maximize.hide();
+                this.tools.restore.show();
+            }
+            this.maximized = true;
+            this.el.disableShadow();
+
+            if(this.dd){
+                this.dd.lock();
+            }
+            if(this.collapsible){
+                this.tools.toggle.hide();
+            }
+            this.el.addClass('x-window-maximized');
+            this.container.addClass('x-window-maximized-ct');
+
+            this.setPosition(0, 0);
+            this.fitContainer();
+            this.fireEvent('maximize', this);
         }
+        return this;
     },
 
     /**
-     * Returns the template node the passed child belongs to, or null if it doesn't belong to one.
-     * @param {HTMLElement} node
-     * @return {HTMLElement} The template node
+     * Restores a {@link #maximizable maximized}  window back to its original
+     * size and position prior to being maximized and also replaces
+     * the 'restore' tool button with the 'maximize' tool button.
+     * Also see {@link #toggleMaximize}.
+     * @return {Ext.Window} this
      */
-    findItemFromChild : function(node){
-        return Ext.fly(node).findParent(this.itemSelector, this.getTemplateTarget());
-    },
-
-    // private
-    onClick : function(e){
-        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
-        if(item){
-            var index = this.indexOf(item);
-            if(this.onItemClick(item, index, e) !== false){
-                this.fireEvent("click", this, index, item, e);
+    restore : function(){
+        if(this.maximized){
+            var t = this.tools;
+            this.el.removeClass('x-window-maximized');
+            if(t.restore){
+                t.restore.hide();
             }
-        }else{
-            if(this.fireEvent("containerclick", this, e) !== false){
-                this.onContainerClick(e);
+            if(t.maximize){
+                t.maximize.show();
             }
-        }
-    },
-
-    onContainerClick : function(e){
-        this.clearSelections();
-    },
+            this.setPosition(this.restorePos[0], this.restorePos[1]);
+            this.setSize(this.restoreSize.width, this.restoreSize.height);
+            delete this.restorePos;
+            delete this.restoreSize;
+            this.maximized = false;
+            this.el.enableShadow(true);
 
-    // private
-    onContextMenu : function(e){
-        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
-        if(item){
-            this.fireEvent("contextmenu", this, this.indexOf(item), item, e);
-        }else{
-            this.fireEvent("containercontextmenu", this, e);
-        }
-    },
+            if(this.dd){
+                this.dd.unlock();
+            }
+            if(this.collapsible && t.toggle){
+                t.toggle.show();
+            }
+            this.container.removeClass('x-window-maximized-ct');
 
-    // private
-    onDblClick : function(e){
-        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
-        if(item){
-            this.fireEvent("dblclick", this, this.indexOf(item), item, e);
+            this.doConstrain();
+            this.fireEvent('restore', this);
         }
+        return this;
     },
 
-    // private
-    onMouseOver : function(e){
-        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
-        if(item && item !== this.lastItem){
-            this.lastItem = item;
-            Ext.fly(item).addClass(this.overClass);
-            this.fireEvent("mouseenter", this, this.indexOf(item), item, e);
-        }
+    /**
+     * A shortcut method for toggling between {@link #maximize} and {@link #restore} based on the current maximized
+     * state of the window.
+     * @return {Ext.Window} this
+     */
+    toggleMaximize : function(){
+        return this[this.maximized ? 'restore' : 'maximize']();
     },
 
     // private
-    onMouseOut : function(e){
-        if(this.lastItem){
-            if(!e.within(this.lastItem, true, true)){
-                Ext.fly(this.lastItem).removeClass(this.overClass);
-                this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e);
-                delete this.lastItem;
-            }
-        }
+    fitContainer : function(){
+        var vs = this.container.getViewSize(false);
+        this.setSize(vs.width, vs.height);
     },
 
     // private
-    onItemClick : function(item, index, e){
-        if(this.fireEvent("beforeclick", this, index, item, e) === false){
-            return false;
-        }
-        if(this.multiSelect){
-            this.doMultiSelection(item, index, e);
-            e.preventDefault();
-        }else if(this.singleSelect){
-            this.doSingleSelection(item, index, e);
-            e.preventDefault();
+    // z-index is managed by the WindowManager and may be overwritten at any time
+    setZIndex : function(index){
+        if(this.modal){
+            this.mask.setStyle('z-index', index);
         }
-        return true;
-    },
+        this.el.setZIndex(++index);
+        index += 5;
 
-    // private
-    doSingleSelection : function(item, index, e){
-        if(e.ctrlKey && this.isSelected(index)){
-            this.deselect(index);
-        }else{
-            this.select(index, false);
+        if(this.resizer){
+            this.resizer.proxy.setStyle('z-index', ++index);
         }
-    },
 
-    // private
-    doMultiSelection : function(item, index, e){
-        if(e.shiftKey && this.last !== false){
-            var last = this.last;
-            this.selectRange(last, index, e.ctrlKey);
-            this.last = last; // reset the last
-        }else{
-            if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){
-                this.deselect(index);
-            }else{
-                this.select(index, e.ctrlKey || e.shiftKey || this.simpleSelect);
-            }
-        }
+        this.lastZIndex = index;
     },
 
     /**
-     * Gets the number of selected nodes.
-     * @return {Number} The node count
+     * Aligns the window to the specified element
+     * @param {Mixed} element The element to align to.
+     * @param {String} position (optional, defaults to "tl-bl?") The position to align to (see {@link Ext.Element#alignTo} for more details).
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @return {Ext.Window} this
      */
-    getSelectionCount : function(){
-        return this.selected.getCount();
+    alignTo : function(element, position, offsets){
+        var xy = this.el.getAlignToXY(element, position, offsets);
+        this.setPagePosition(xy[0], xy[1]);
+        return this;
     },
 
     /**
-     * Gets the currently selected nodes.
-     * @return {Array} An array of HTMLElements
+     * Anchors this window to another element and realigns it when the window is resized or scrolled.
+     * @param {Mixed} element The element to align to.
+     * @param {String} position The position to align to (see {@link Ext.Element#alignTo} for more details)
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @param {Boolean/Number} monitorScroll (optional) true to monitor body scroll and reposition. If this parameter
+     * is a number, it is used as the buffer delay (defaults to 50ms).
+     * @return {Ext.Window} this
      */
-    getSelectedNodes : function(){
-        return this.selected.elements;
+    anchorTo : function(el, alignment, offsets, monitorScroll){
+      if(this.doAnchor){
+          Ext.EventManager.removeResizeListener(this.doAnchor, this);
+          Ext.EventManager.un(window, 'scroll', this.doAnchor, this);
+      }
+      this.doAnchor = function(){
+          this.alignTo(el, alignment, offsets);
+      };
+      Ext.EventManager.onWindowResize(this.doAnchor, this);
+
+      var tm = typeof monitorScroll;
+      if(tm != 'undefined'){
+          Ext.EventManager.on(window, 'scroll', this.doAnchor, this,
+              {buffer: tm == 'number' ? monitorScroll : 50});
+      }
+      return this;
     },
 
     /**
-     * Gets the indexes of the selected nodes.
-     * @return {Array} An array of numeric indexes
+     * Brings this window to the front of any other visible windows
+     * @param {Boolean} e (optional) Specify <tt>false</tt> to prevent the window from being focused.
+     * @return {Ext.Window} this
      */
-    getSelectedIndexes : function(){
-        var indexes = [], s = this.selected.elements;
-        for(var i = 0, len = s.length; i < len; i++){
-            indexes.push(s[i].viewIndex);
+    toFront : function(e){
+        if(this.manager.bringToFront(this)){
+            if(!e || !e.getTarget().focus){
+                this.focus();
+            }
         }
-        return indexes;
+        return this;
     },
 
     /**
-     * Gets an array of the selected records
-     * @return {Array} An array of {@link Ext.data.Record} objects
+     * Makes this the active window by showing its shadow, or deactivates it by hiding its shadow.  This method also
+     * fires the {@link #activate} or {@link #deactivate} event depending on which action occurred. This method is
+     * called internally by {@link Ext.WindowMgr}.
+     * @param {Boolean} active True to activate the window, false to deactivate it (defaults to false)
      */
-    getSelectedRecords : function(){
-        var r = [], s = this.selected.elements;
-        for(var i = 0, len = s.length; i < len; i++){
-            r[r.length] = this.store.getAt(s[i].viewIndex);
+    setActive : function(active){
+        if(active){
+            if(!this.maximized){
+                this.el.enableShadow(true);
+            }
+            this.fireEvent('activate', this);
+        }else{
+            this.el.disableShadow();
+            this.fireEvent('deactivate', this);
         }
-        return r;
     },
 
     /**
-     * Gets an array of the records from an array of nodes
-     * @param {Array} nodes The nodes to evaluate
-     * @return {Array} records The {@link Ext.data.Record} objects
+     * Sends this window to the back of (lower z-index than) any other visible windows
+     * @return {Ext.Window} this
      */
-    getRecords : function(nodes){
-        var r = [], s = nodes;
-        for(var i = 0, len = s.length; i < len; i++){
-            r[r.length] = this.store.getAt(s[i].viewIndex);
-        }
-        return r;
+    toBack : function(){
+        this.manager.sendToBack(this);
+        return this;
     },
 
     /**
-     * Gets a record from a node
-     * @param {HTMLElement} node The node to evaluate
-     * @return {Record} record The {@link Ext.data.Record} object
+     * Centers this window in the viewport
+     * @return {Ext.Window} this
      */
-    getRecord : function(node){
-        return this.store.getAt(node.viewIndex);
-    },
+    center : function(){
+        var xy = this.el.getAlignToXY(this.container, 'c-c');
+        this.setPagePosition(xy[0], xy[1]);
+        return this;
+    }
 
     /**
-     * Clears all selections.
-     * @param {Boolean} suppressEvent (optional) True to skip firing of the selectionchange event
-     */
-    clearSelections : function(suppressEvent, skipUpdate){
-        if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){
-            if(!skipUpdate){
-                this.selected.removeClass(this.selectedClass);
-            }
-            this.selected.clear();
-            this.last = false;
-            if(!suppressEvent){
-                this.fireEvent("selectionchange", this, this.selected.elements);
-            }
+     * @cfg {Boolean} autoWidth @hide
+     **/
+});
+Ext.reg('window', Ext.Window);
+
+// private - custom Window DD implementation
+Ext.Window.DD = function(win){
+    this.win = win;
+    Ext.Window.DD.superclass.constructor.call(this, win.el.id, 'WindowDD-'+win.id);
+    this.setHandleElId(win.header.id);
+    this.scroll = false;
+};
+
+Ext.extend(Ext.Window.DD, Ext.dd.DD, {
+    moveOnly:true,
+    headerOffsets:[100, 25],
+    startDrag : function(){
+        var w = this.win;
+        this.proxy = w.ghost();
+        if(w.constrain !== false){
+            var so = w.el.shadowOffset;
+            this.constrainTo(w.container, {right: so, left: so, bottom: so});
+        }else if(w.constrainHeader !== false){
+            var s = this.proxy.getSize();
+            this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])});
         }
     },
+    b4Drag : Ext.emptyFn,
 
-    /**
-     * Returns true if the passed node is selected, else false.
-     * @param {HTMLElement/Number} node The node or node index to check
-     * @return {Boolean} True if selected, else false
-     */
-    isSelected : function(node){
-        return this.selected.contains(this.getNode(node));
+    onDrag : function(e){
+        this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY());
     },
 
-    /**
-     * Deselects a node.
-     * @param {HTMLElement/Number} node The node to deselect
-     */
-    deselect : function(node){
-        if(this.isSelected(node)){
-            node = this.getNode(node);
-            this.selected.removeElement(node);
-            if(this.last == node.viewIndex){
-                this.last = false;
+    endDrag : function(e){
+        this.win.unghost();
+        this.win.saveState();
+    }
+});
+/**
+ * @class Ext.WindowGroup
+ * An object that manages a group of {@link Ext.Window} instances and provides z-order management
+ * and window activation behavior.
+ * @constructor
+ */
+Ext.WindowGroup = function(){
+    var list = {};
+    var accessList = [];
+    var front = null;
+
+    // private
+    var sortWindows = function(d1, d2){
+        return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1;
+    };
+
+    // private
+    var orderWindows = function(){
+        var a = accessList, len = a.length;
+        if(len > 0){
+            a.sort(sortWindows);
+            var seed = a[0].manager.zseed;
+            for(var i = 0; i < len; i++){
+                var win = a[i];
+                if(win && !win.hidden){
+                    win.setZIndex(seed + (i*10));
+                }
             }
-            Ext.fly(node).removeClass(this.selectedClass);
-            this.fireEvent("selectionchange", this, this.selected.elements);
         }
-    },
+        activateLast();
+    };
 
-    /**
-     * Selects a set of nodes.
-     * @param {Array/HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node,
-     * id of a template node or an array of any of those to select
-     * @param {Boolean} keepExisting (optional) true to keep existing selections
-     * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent
-     */
-    select : function(nodeInfo, keepExisting, suppressEvent){
-        if(Ext.isArray(nodeInfo)){
-            if(!keepExisting){
-                this.clearSelections(true);
-            }
-            for(var i = 0, len = nodeInfo.length; i < len; i++){
-                this.select(nodeInfo[i], true, true);
-            }
-            if(!suppressEvent){
-                this.fireEvent("selectionchange", this, this.selected.elements);
-            }
-        } else{
-            var node = this.getNode(nodeInfo);
-            if(!keepExisting){
-                this.clearSelections(true);
+    // private
+    var setActiveWin = function(win){
+        if(win != front){
+            if(front){
+                front.setActive(false);
             }
-            if(node && !this.isSelected(node)){
-                if(this.fireEvent("beforeselect", this, node, this.selected.elements) !== false){
-                    Ext.fly(node).addClass(this.selectedClass);
-                    this.selected.add(node);
-                    this.last = node.viewIndex;
-                    if(!suppressEvent){
-                        this.fireEvent("selectionchange", this, this.selected.elements);
-                    }
-                }
+            front = win;
+            if(win){
+                win.setActive(true);
             }
         }
-    },
+    };
 
-    /**
-     * Selects a range of nodes. All nodes between start and end are selected.
-     * @param {Number} start The index of the first node in the range
-     * @param {Number} end The index of the last node in the range
-     * @param {Boolean} keepExisting (optional) True to retain existing selections
-     */
-    selectRange : function(start, end, keepExisting){
-        if(!keepExisting){
-            this.clearSelections(true);
+    // private
+    var activateLast = function(){
+        for(var i = accessList.length-1; i >=0; --i) {
+            if(!accessList[i].hidden){
+                setActiveWin(accessList[i]);
+                return;
+            }
         }
-        this.select(this.getNodes(start, end), true);
-    },
+        // none to activate
+        setActiveWin(null);
+    };
 
-    /**
-     * Gets a template node.
-     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
-     * @return {HTMLElement} The node or null if it wasn't found
-     */
-    getNode : function(nodeInfo){
-        if(Ext.isString(nodeInfo)){
-            return document.getElementById(nodeInfo);
-        }else if(Ext.isNumber(nodeInfo)){
-            return this.all.elements[nodeInfo];
-        }
-        return nodeInfo;
-    },
+    return {
+        /**
+         * The starting z-index for windows in this WindowGroup (defaults to 9000)
+         * @type Number The z-index value
+         */
+        zseed : 9000,
 
-    /**
-     * Gets a range nodes.
-     * @param {Number} start (optional) The index of the first node in the range
-     * @param {Number} end (optional) The index of the last node in the range
-     * @return {Array} An array of nodes
-     */
-    getNodes : function(start, end){
-        var ns = this.all.elements;
-        start = start || 0;
-        end = !Ext.isDefined(end) ? Math.max(ns.length - 1, 0) : end;
-        var nodes = [], i;
-        if(start <= end){
-            for(i = start; i <= end && ns[i]; i++){
-                nodes.push(ns[i]);
+        /**
+         * <p>Registers a {@link Ext.Window Window} with this WindowManager. This should not
+         * need to be called under normal circumstances. Windows are automatically registered
+         * with a {@link Ext.Window#manager manager} at construction time.</p>
+         * <p>Where this may be useful is moving Windows between two WindowManagers. For example,
+         * to bring the Ext.MessageBox dialog under the same manager as the Desktop's
+         * WindowManager in the desktop sample app:</p><code><pre>
+var msgWin = Ext.MessageBox.getDialog();
+MyDesktop.getDesktop().getManager().register(msgWin);
+</pre></code>
+         * @param {Window} win The Window to register.
+         */
+        register : function(win){
+            if(win.manager){
+                win.manager.unregister(win);
             }
-        } else{
-            for(i = start; i >= end && ns[i]; i--){
-                nodes.push(ns[i]);
+            win.manager = this;
+
+            list[win.id] = win;
+            accessList.push(win);
+            win.on('hide', activateLast);
+        },
+
+        /**
+         * <p>Unregisters a {@link Ext.Window Window} from this WindowManager. This should not
+         * need to be called. Windows are automatically unregistered upon destruction.
+         * See {@link #register}.</p>
+         * @param {Window} win The Window to unregister.
+         */
+        unregister : function(win){
+            delete win.manager;
+            delete list[win.id];
+            win.un('hide', activateLast);
+            accessList.remove(win);
+        },
+
+        /**
+         * Gets a registered window by id.
+         * @param {String/Object} id The id of the window or a {@link Ext.Window} instance
+         * @return {Ext.Window}
+         */
+        get : function(id){
+            return typeof id == "object" ? id : list[id];
+        },
+
+        /**
+         * Brings the specified window to the front of any other active windows in this WindowGroup.
+         * @param {String/Object} win The id of the window or a {@link Ext.Window} instance
+         * @return {Boolean} True if the dialog was brought to the front, else false
+         * if it was already in front
+         */
+        bringToFront : function(win){
+            win = this.get(win);
+            if(win != front){
+                win._lastAccess = new Date().getTime();
+                orderWindows();
+                return true;
             }
-        }
-        return nodes;
-    },
+            return false;
+        },
 
-    /**
-     * Finds the index of the passed node.
-     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
-     * @return {Number} The index of the node or -1
-     */
-    indexOf : function(node){
-        node = this.getNode(node);
-        if(Ext.isNumber(node.viewIndex)){
-            return node.viewIndex;
-        }
-        return this.all.indexOf(node);
-    },
+        /**
+         * Sends the specified window to the back of other active windows in this WindowGroup.
+         * @param {String/Object} win The id of the window or a {@link Ext.Window} instance
+         * @return {Ext.Window} The window
+         */
+        sendToBack : function(win){
+            win = this.get(win);
+            win._lastAccess = -(new Date().getTime());
+            orderWindows();
+            return win;
+        },
+
+        /**
+         * Hides all windows in this WindowGroup.
+         */
+        hideAll : function(){
+            for(var id in list){
+                if(list[id] && typeof list[id] != "function" && list[id].isVisible()){
+                    list[id].hide();
+                }
+            }
+        },
+
+        /**
+         * Gets the currently-active window in this WindowGroup.
+         * @return {Ext.Window} The active window
+         */
+        getActive : function(){
+            return front;
+        },
+
+        /**
+         * Returns zero or more windows in this WindowGroup using the custom search function passed to this method.
+         * The function should accept a single {@link Ext.Window} reference as its only argument and should
+         * return true if the window matches the search criteria, otherwise it should return false.
+         * @param {Function} fn The search function
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Window being tested.
+         * that gets passed to the function if not specified)
+         * @return {Array} An array of zero or more matching windows
+         */
+        getBy : function(fn, scope){
+            var r = [];
+            for(var i = accessList.length-1; i >=0; --i) {
+                var win = accessList[i];
+                if(fn.call(scope||win, win) !== false){
+                    r.push(win);
+                }
+            }
+            return r;
+        },
 
-    // private
-    onBeforeLoad : function(){
-        if(this.loadingText){
-            this.clearSelections(false, true);
-            this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+'</div>');
-            this.all.clear();
+        /**
+         * Executes the specified function once for every window in this WindowGroup, passing each
+         * window as the only parameter. Returning false from the function will stop the iteration.
+         * @param {Function} fn The function to execute for each item
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Window in the iteration.
+         */
+        each : function(fn, scope){
+            for(var id in list){
+                if(list[id] && typeof list[id] != "function"){
+                    if(fn.call(scope || list[id], list[id]) === false){
+                        return;
+                    }
+                }
+            }
         }
-    },
+    };
+};
 
-    onDestroy : function(){
-        Ext.DataView.superclass.onDestroy.call(this);
-        this.bindStore(null);
-    }
-});
 
 /**
- * Changes the data store bound to this view and refreshes it. (deprecated in favor of bindStore)
- * @param {Store} store The store to bind to this view
+ * @class Ext.WindowMgr
+ * @extends Ext.WindowGroup
+ * The default global window group that is available automatically.  To have more than one group of windows
+ * with separate z-order stacks, create additional instances of {@link Ext.WindowGroup} as needed.
+ * @singleton
  */
-Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore;
-
-Ext.reg('dataview', Ext.DataView);/**\r
- * @class Ext.ListView\r
- * @extends Ext.DataView\r
- * <p>Ext.ListView is a fast and light-weight implentation of a\r
- * {@link Ext.grid.GridPanel Grid} like view with the following characteristics:</p>\r
- * <div class="mdetail-params"><ul>\r
- * <li>resizable columns</li>\r
- * <li>selectable</li>\r
- * <li>column widths are initially proportioned by percentage based on the container\r
- * width and number of columns</li>\r
- * <li>uses templates to render the data in any required format</li>\r
- * <li>no horizontal scrolling</li>\r
- * <li>no editing</li>\r
- * </ul></div>\r
+Ext.WindowMgr = new Ext.WindowGroup();/**\r
+ * @class Ext.MessageBox\r
+ * <p>Utility class for generating different styles of message boxes.  The alias Ext.Msg can also be used.<p/>\r
+ * <p>Note that the MessageBox is asynchronous.  Unlike a regular JavaScript <code>alert</code> (which will halt\r
+ * browser execution), showing a MessageBox will not cause the code to stop.  For this reason, if you have code\r
+ * that should only run <em>after</em> some user feedback from the MessageBox, you must use a callback function\r
+ * (see the <code>function</code> parameter for {@link #show} for more details).</p>\r
  * <p>Example usage:</p>\r
- * <pre><code>\r
-// consume JSON of this form:\r
-{\r
-   "images":[\r
-      {\r
-         "name":"dance_fever.jpg",\r
-         "size":2067,\r
-         "lastmod":1236974993000,\r
-         "url":"images\/thumbs\/dance_fever.jpg"\r
-      },\r
-      {\r
-         "name":"zack_sink.jpg",\r
-         "size":2303,\r
-         "lastmod":1236974993000,\r
-         "url":"images\/thumbs\/zack_sink.jpg"\r
-      }\r
-   ]\r
-} \r
-var store = new Ext.data.JsonStore({\r
-    url: 'get-images.php',\r
-    root: 'images',\r
-    fields: [\r
-        'name', 'url',\r
-        {name:'size', type: 'float'},\r
-        {name:'lastmod', type:'date', dateFormat:'timestamp'}\r
-    ]\r
-});\r
-store.load();\r
-\r
-var listView = new Ext.ListView({\r
-    store: store,\r
-    multiSelect: true,\r
-    emptyText: 'No images to display',\r
-    reserveScrollOffset: true,\r
-    columns: [{\r
-        header: 'File',\r
-        width: .5,\r
-        dataIndex: 'name'\r
-    },{\r
-        header: 'Last Modified',\r
-        width: .35, \r
-        dataIndex: 'lastmod',\r
-        tpl: '{lastmod:date("m-d h:i a")}'\r
-    },{\r
-        header: 'Size',\r
-        dataIndex: 'size',\r
-        tpl: '{size:fileSize}', // format using Ext.util.Format.fileSize()\r
-        align: 'right'\r
-    }]\r
-});\r
-\r
-// put it in a Panel so it looks pretty\r
-var panel = new Ext.Panel({\r
-    id:'images-view',\r
-    width:425,\r
-    height:250,\r
-    collapsible:true,\r
-    layout:'fit',\r
-    title:'Simple ListView <i>(0 items selected)</i>',\r
-    items: listView\r
+ *<pre><code>\r
+// Basic alert:\r
+Ext.Msg.alert('Status', 'Changes saved successfully.');\r
+\r
+// Prompt for user data and process the result using a callback:\r
+Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){\r
+    if (btn == 'ok'){\r
+        // process text value and close...\r
+    }\r
 });\r
-panel.render(document.body);\r
 \r
-// little bit of feedback\r
-listView.on('selectionchange', function(view, nodes){\r
-    var l = nodes.length;\r
-    var s = l != 1 ? 's' : '';\r
-    panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');\r
+// Show a dialog using config options:\r
+Ext.Msg.show({\r
+   title:'Save Changes?',\r
+   msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',\r
+   buttons: Ext.Msg.YESNOCANCEL,\r
+   fn: processResult,\r
+   animEl: 'elId',\r
+   icon: Ext.MessageBox.QUESTION\r
 });\r
- * </code></pre>\r
- * @constructor\r
- * @param {Object} config\r
- * @xtype listview\r
+</code></pre>\r
+ * @singleton\r
  */\r
-Ext.ListView = Ext.extend(Ext.DataView, {\r
-    /**\r
-     * Set this property to <tt>true</tt> to disable the header click handler disabling sort\r
-     * (defaults to <tt>false</tt>).\r
-     * @type Boolean\r
-     * @property disableHeaders\r
-     */\r
-    /**\r
-     * @cfg {Boolean} hideHeaders\r
-     * <tt>true</tt> to hide the {@link #internalTpl header row} (defaults to <tt>false</tt> so\r
-     * the {@link #internalTpl header row} will be shown).\r
-     */\r
-    /**\r
-     * @cfg {String} itemSelector\r
-     * Defaults to <tt>'dl'</tt> to work with the preconfigured <b><tt>{@link Ext.DataView#tpl tpl}</tt></b>.\r
-     * This setting specifies the CSS selector (e.g. <tt>div.some-class</tt> or <tt>span:first-child</tt>)\r
-     * that will be used to determine what nodes the ListView will be working with.   \r
-     */\r
-    itemSelector: 'dl',\r
-    /**\r
-     * @cfg {String} selectedClass The CSS class applied to a selected row (defaults to\r
-     * <tt>'x-list-selected'</tt>). An example overriding the default styling:\r
-    <pre><code>\r
-    .x-list-selected {background-color: yellow;}\r
-    </code></pre>\r
-     * @type String\r
-     */\r
-    selectedClass:'x-list-selected',\r
-    /**\r
-     * @cfg {String} overClass The CSS class applied when over a row (defaults to\r
-     * <tt>'x-list-over'</tt>). An example overriding the default styling:\r
-    <pre><code>\r
-    .x-list-over {background-color: orange;}\r
-    </code></pre>\r
-     * @type String\r
-     */\r
-    overClass:'x-list-over',\r
-    /**\r
-     * @cfg {Boolean} reserveScrollOffset\r
-     * By default will defer accounting for the configured <b><tt>{@link #scrollOffset}</tt></b>\r
-     * for 10 milliseconds.  Specify <tt>true</tt> to account for the configured\r
-     * <b><tt>{@link #scrollOffset}</tt></b> immediately.\r
-     */\r
-    /**\r
-     * @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to\r
-     * <tt>19</tt> pixels)\r
-     */\r
-    scrollOffset : 19,\r
-    /**\r
-     * @cfg {Boolean/Object} columnResize\r
-     * Specify <tt>true</tt> or specify a configuration object for {@link Ext.ListView.ColumnResizer}\r
-     * to enable the columns to be resizable (defaults to <tt>true</tt>).\r
-     */\r
-    columnResize: true,\r
-    /**\r
-     * @cfg {Array} columns An array of column configuration objects, for example:\r
-     * <pre><code>\r
-{\r
-    align: 'right',\r
-    dataIndex: 'size',\r
-    header: 'Size',\r
-    tpl: '{size:fileSize}',\r
-    width: .35\r
-}\r
-     * </code></pre> \r
-     * Acceptable properties for each column configuration object are:\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b><tt>align</tt></b> : String<div class="sub-desc">Set the CSS text-align property\r
-     * of the column. Defaults to <tt>'left'</tt>.</div></li>\r
-     * <li><b><tt>dataIndex</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.\r
-     * {@link Ext.grid.Column#dataIndex dataIndex} for details.</div></li>\r
-     * <li><b><tt>header</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.\r
-     * {@link Ext.grid.Column#header header} for details.</div></li>\r
-     * <li><b><tt>tpl</tt></b> : String<div class="sub-desc">Specify a string to pass as the\r
-     * configuration string for {@link Ext.XTemplate}.  By default an {@link Ext.XTemplate}\r
-     * will be implicitly created using the <tt>dataIndex</tt>.</div></li>\r
-     * <li><b><tt>width</tt></b> : Number<div class="sub-desc">Percentage of the container width\r
-     * this column should be allocated.  Columns that have no width specified will be\r
-     * allocated with an equal percentage to fill 100% of the container width.  To easily take\r
-     * advantage of the full container width, leave the width of at least one column undefined.\r
-     * Note that if you do not want to take up the full width of the container, the width of\r
-     * every column needs to be explicitly defined.</div></li>\r
-     * </ul></div>\r
-     */\r
-    /**\r
-     * @cfg {Boolean/Object} columnSort\r
-     * Specify <tt>true</tt> or specify a configuration object for {@link Ext.ListView.Sorter}\r
-     * to enable the columns to be sortable (defaults to <tt>true</tt>).\r
-     */\r
-    columnSort: true,\r
-    /**\r
-     * @cfg {String/Array} internalTpl\r
-     * The template to be used for the header row.  See {@link #tpl} for more details.\r
-     */\r
+Ext.MessageBox = function(){\r
+    var dlg, opt, mask, waitTimer,\r
+        bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,\r
+        buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',\r
+        buttonNames = ['ok', 'yes', 'no', 'cancel'];\r
 \r
-    initComponent : function(){\r
-        if(this.columnResize){\r
-            this.colResizer = new Ext.ListView.ColumnResizer(this.colResizer);\r
-            this.colResizer.init(this);\r
+    // private\r
+    var handleButton = function(button){\r
+        buttons[button].blur();\r
+        if(dlg.isVisible()){\r
+            dlg.hide();\r
+            handleHide();\r
+            Ext.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value, opt], 1);\r
         }\r
-        if(this.columnSort){\r
-            this.colSorter = new Ext.ListView.Sorter(this.columnSort);\r
-            this.colSorter.init(this);\r
+    };\r
+\r
+    // private\r
+    var handleHide = function(){\r
+        if(opt && opt.cls){\r
+            dlg.el.removeClass(opt.cls);\r
         }\r
-        if(!this.internalTpl){\r
-            this.internalTpl = new Ext.XTemplate(\r
-                '<div class="x-list-header"><div class="x-list-header-inner">',\r
-                    '<tpl for="columns">',\r
-                    '<div style="width:{width}%;text-align:{align};"><em unselectable="on" id="',this.id, '-xlhd-{#}">',\r
-                        '{header}',\r
-                    '</em></div>',\r
-                    '</tpl>',\r
-                    '<div class="x-clear"></div>',\r
-                '</div></div>',\r
-                '<div class="x-list-body"><div class="x-list-body-inner">',\r
-                '</div></div>'\r
-            );\r
+        progressBar.reset();        \r
+    };\r
+\r
+    // private\r
+    var handleEsc = function(d, k, e){\r
+        if(opt && opt.closable !== false){\r
+            dlg.hide();\r
+            handleHide();\r
         }\r
-        if(!this.tpl){\r
-            this.tpl = new Ext.XTemplate(\r
-                '<tpl for="rows">',\r
-                    '<dl>',\r
-                        '<tpl for="parent.columns">',\r
-                        '<dt style="width:{width}%;text-align:{align};"><em unselectable="on">',\r
-                            '{[values.tpl.apply(parent)]}',\r
-                        '</em></dt>',\r
-                        '</tpl>',\r
-                        '<div class="x-clear"></div>',\r
-                    '</dl>',\r
-                '</tpl>'\r
-            );\r
-        };\r
-        var cs = this.columns, allocatedWidth = 0, colsWithWidth = 0, len = cs.length;\r
-        for(var i = 0; i < len; i++){\r
-            var c = cs[i];\r
-            if(!c.tpl){\r
-                c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}');\r
-            }else if(Ext.isString(c.tpl)){\r
-                c.tpl = new Ext.XTemplate(c.tpl);\r
-            }\r
-            c.align = c.align || 'left';\r
-            if(Ext.isNumber(c.width)){\r
-                c.width *= 100;\r
-                allocatedWidth += c.width;\r
-                colsWithWidth++;\r
-            }\r
+        if(e){\r
+            e.stopEvent();\r
         }\r
-        // auto calculate missing column widths\r
-        if(colsWithWidth < len){\r
-            var remaining = len - colsWithWidth;\r
-            if(allocatedWidth < 100){\r
-                var perCol = ((100-allocatedWidth) / remaining);\r
-                for(var j = 0; j < len; j++){\r
-                    var c = cs[j];\r
-                    if(!Ext.isNumber(c.width)){\r
-                        c.width = perCol;\r
+    };\r
+\r
+    // private\r
+    var updateButtons = function(b){\r
+        var width = 0,\r
+            cfg;\r
+        if(!b){\r
+            Ext.each(buttonNames, function(name){\r
+                buttons[name].hide();\r
+            });\r
+            return width;\r
+        }\r
+        dlg.footer.dom.style.display = '';\r
+        Ext.iterate(buttons, function(name, btn){\r
+            cfg = b[name];\r
+            if(cfg){\r
+                btn.show();\r
+                btn.setText(Ext.isString(cfg) ? cfg : Ext.MessageBox.buttonText[name]);\r
+                width += btn.getEl().getWidth() + 15;\r
+            }else{\r
+                btn.hide();\r
+            }\r
+        });\r
+        return width;\r
+    };\r
+\r
+    return {\r
+        /**\r
+         * Returns a reference to the underlying {@link Ext.Window} element\r
+         * @return {Ext.Window} The window\r
+         */\r
+        getDialog : function(titleText){\r
+           if(!dlg){\r
+                var btns = [];\r
+                \r
+                buttons = {};\r
+                Ext.each(buttonNames, function(name){\r
+                    btns.push(buttons[name] = new Ext.Button({\r
+                        text: this.buttonText[name],\r
+                        handler: handleButton.createCallback(name),\r
+                        hideMode: 'offsets'\r
+                    }));\r
+                }, this);\r
+                dlg = new Ext.Window({\r
+                    autoCreate : true,\r
+                    title:titleText,\r
+                    resizable:false,\r
+                    constrain:true,\r
+                    constrainHeader:true,\r
+                    minimizable : false,\r
+                    maximizable : false,\r
+                    stateful: false,\r
+                    modal: true,\r
+                    shim:true,\r
+                    buttonAlign:"center",\r
+                    width:400,\r
+                    height:100,\r
+                    minHeight: 80,\r
+                    plain:true,\r
+                    footer:true,\r
+                    closable:true,\r
+                    close : function(){\r
+                        if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){\r
+                            handleButton("no");\r
+                        }else{\r
+                            handleButton("cancel");\r
+                        }\r
+                    },\r
+                    fbar: new Ext.Toolbar({\r
+                        items: btns,\r
+                        enableOverflow: false\r
+                    })\r
+                });\r
+                dlg.render(document.body);\r
+                dlg.getEl().addClass('x-window-dlg');\r
+                mask = dlg.mask;\r
+                bodyEl = dlg.body.createChild({\r
+                    html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'\r
+                });\r
+                iconEl = Ext.get(bodyEl.dom.firstChild);\r
+                var contentEl = bodyEl.dom.childNodes[1];\r
+                msgEl = Ext.get(contentEl.firstChild);\r
+                textboxEl = Ext.get(contentEl.childNodes[2].firstChild);\r
+                textboxEl.enableDisplayMode();\r
+                textboxEl.addKeyListener([10,13], function(){\r
+                    if(dlg.isVisible() && opt && opt.buttons){\r
+                        if(opt.buttons.ok){\r
+                            handleButton("ok");\r
+                        }else if(opt.buttons.yes){\r
+                            handleButton("yes");\r
+                        }\r
                     }\r
+                });\r
+                textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]);\r
+                textareaEl.enableDisplayMode();\r
+                progressBar = new Ext.ProgressBar({\r
+                    renderTo:bodyEl\r
+                });\r
+               bodyEl.createChild({cls:'x-clear'});\r
+            }\r
+            return dlg;\r
+        },\r
+\r
+        /**\r
+         * Updates the message box body text\r
+         * @param {String} text (optional) Replaces the message box element's innerHTML with the specified string (defaults to\r
+         * the XHTML-compliant non-breaking space character '&amp;#160;')\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        updateText : function(text){\r
+            if(!dlg.isVisible() && !opt.width){\r
+                dlg.setSize(this.maxWidth, 100); // resize first so content is never clipped from previous shows\r
+            }\r
+            msgEl.update(text || '&#160;');\r
+\r
+            var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0,\r
+                mw = msgEl.getWidth() + msgEl.getMargins('lr'),\r
+                fw = dlg.getFrameWidth('lr'),\r
+                bw = dlg.body.getFrameWidth('lr'),\r
+                w;\r
+                \r
+            if (Ext.isIE && iw > 0){\r
+                //3 pixels get subtracted in the icon CSS for an IE margin issue,\r
+                //so we have to add it back here for the overall width to be consistent\r
+                iw += 3;\r
+            }\r
+            w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),\r
+                    Math.max(opt.minWidth || this.minWidth, bwidth || 0));\r
+\r
+            if(opt.prompt === true){\r
+                activeTextEl.setWidth(w-iw-fw-bw);\r
+            }\r
+            if(opt.progress === true || opt.wait === true){\r
+                progressBar.setSize(w-iw-fw-bw);\r
+            }\r
+            if(Ext.isIE && w == bwidth){\r
+                w += 4; //Add offset when the content width is smaller than the buttons.    \r
+            }\r
+            dlg.setSize(w, 'auto').center();\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Updates a progress-style message box's text and progress bar. Only relevant on message boxes\r
+         * initiated via {@link Ext.MessageBox#progress} or {@link Ext.MessageBox#wait},\r
+         * or by calling {@link Ext.MessageBox#show} with progress: true.\r
+         * @param {Number} value Any number between 0 and 1 (e.g., .5, defaults to 0)\r
+         * @param {String} progressText The progress text to display inside the progress bar (defaults to '')\r
+         * @param {String} msg The message box's body text is replaced with the specified string (defaults to undefined\r
+         * so that any existing body text will not get overwritten by default unless a new value is passed in)\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        updateProgress : function(value, progressText, msg){\r
+            progressBar.updateProgress(value, progressText);\r
+            if(msg){\r
+                this.updateText(msg);\r
+            }\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Returns true if the message box is currently displayed\r
+         * @return {Boolean} True if the message box is visible, else false\r
+         */\r
+        isVisible : function(){\r
+            return dlg && dlg.isVisible();\r
+        },\r
+\r
+        /**\r
+         * Hides the message box if it is displayed\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        hide : function(){\r
+            var proxy = dlg ? dlg.activeGhost : null;\r
+            if(this.isVisible() || proxy){\r
+                dlg.hide();\r
+                handleHide();\r
+                if (proxy){\r
+                    // unghost is a private function, but i saw no better solution\r
+                    // to fix the locking problem when dragging while it closes\r
+                    dlg.unghost(false, false);\r
+                } \r
+            }\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Displays a new message box, or reinitializes an existing message box, based on the config options\r
+         * passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally,\r
+         * although those calls are basic shortcuts and do not support all of the config options allowed here.\r
+         * @param {Object} config The following config options are supported: <ul>\r
+         * <li><b>animEl</b> : String/Element<div class="sub-desc">An id or Element from which the message box should animate as it\r
+         * opens and closes (defaults to undefined)</div></li>\r
+         * <li><b>buttons</b> : Object/Boolean<div class="sub-desc">A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo',\r
+         * cancel:'Bar'}), or false to not show any buttons (defaults to false)</div></li>\r
+         * <li><b>closable</b> : Boolean<div class="sub-desc">False to hide the top-right close button (defaults to true). Note that\r
+         * progress and wait dialogs will ignore this property and always hide the close button as they can only\r
+         * be closed programmatically.</div></li>\r
+         * <li><b>cls</b> : String<div class="sub-desc">A custom CSS class to apply to the message box's container element</div></li>\r
+         * <li><b>defaultTextHeight</b> : Number<div class="sub-desc">The default height in pixels of the message box's multiline textarea\r
+         * if displayed (defaults to 75)</div></li>\r
+         * <li><b>fn</b> : Function<div class="sub-desc">A callback function which is called when the dialog is dismissed either\r
+         * by clicking on the configured buttons, or on the dialog close button, or by pressing\r
+         * the return button to enter input.\r
+         * <p>Progress and wait dialogs will ignore this option since they do not respond to user\r
+         * actions and can only be closed programmatically, so any required function should be called\r
+         * by the same code after it closes the dialog. Parameters passed:<ul>\r
+         * <li><b>buttonId</b> : String<div class="sub-desc">The ID of the button pressed, one of:<div class="sub-desc"><ul>\r
+         * <li><tt>ok</tt></li>\r
+         * <li><tt>yes</tt></li>\r
+         * <li><tt>no</tt></li>\r
+         * <li><tt>cancel</tt></li>\r
+         * </ul></div></div></li>\r
+         * <li><b>text</b> : String<div class="sub-desc">Value of the input field if either <tt><a href="#show-option-prompt" ext:member="show-option-prompt" ext:cls="Ext.MessageBox">prompt</a></tt>\r
+         * or <tt><a href="#show-option-multiline" ext:member="show-option-multiline" ext:cls="Ext.MessageBox">multiline</a></tt> is true</div></li>\r
+         * <li><b>opt</b> : Object<div class="sub-desc">The config object passed to show.</div></li>\r
+         * </ul></p></div></li>\r
+         * <li><b>scope</b> : Object<div class="sub-desc">The scope of the callback function</div></li>\r
+         * <li><b>icon</b> : String<div class="sub-desc">A CSS class that provides a background image to be used as the body icon for the\r
+         * dialog (e.g. Ext.MessageBox.WARNING or 'custom-class') (defaults to '')</div></li>\r
+         * <li><b>iconCls</b> : String<div class="sub-desc">The standard {@link Ext.Window#iconCls} to\r
+         * add an optional header icon (defaults to '')</div></li>\r
+         * <li><b>maxWidth</b> : Number<div class="sub-desc">The maximum width in pixels of the message box (defaults to 600)</div></li>\r
+         * <li><b>minWidth</b> : Number<div class="sub-desc">The minimum width in pixels of the message box (defaults to 100)</div></li>\r
+         * <li><b>modal</b> : Boolean<div class="sub-desc">False to allow user interaction with the page while the message box is\r
+         * displayed (defaults to true)</div></li>\r
+         * <li><b>msg</b> : String<div class="sub-desc">A string that will replace the existing message box body text (defaults to the\r
+         * XHTML-compliant non-breaking space character '&amp;#160;')</div></li>\r
+         * <li><a id="show-option-multiline"></a><b>multiline</b> : Boolean<div class="sub-desc">\r
+         * True to prompt the user to enter multi-line text (defaults to false)</div></li>\r
+         * <li><b>progress</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>\r
+         * <li><b>progressText</b> : String<div class="sub-desc">The text to display inside the progress bar if progress = true (defaults to '')</div></li>\r
+         * <li><a id="show-option-prompt"></a><b>prompt</b> : Boolean<div class="sub-desc">True to prompt the user to enter single-line text (defaults to false)</div></li>\r
+         * <li><b>proxyDrag</b> : Boolean<div class="sub-desc">True to display a lightweight proxy while dragging (defaults to false)</div></li>\r
+         * <li><b>title</b> : String<div class="sub-desc">The title text</div></li>\r
+         * <li><b>value</b> : String<div class="sub-desc">The string value to set into the active textbox element if displayed</div></li>\r
+         * <li><b>wait</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>\r
+         * <li><b>waitConfig</b> : Object<div class="sub-desc">A {@link Ext.ProgressBar#waitConfig} object (applies only if wait = true)</div></li>\r
+         * <li><b>width</b> : Number<div class="sub-desc">The width of the dialog in pixels</div></li>\r
+         * </ul>\r
+         * Example usage:\r
+         * <pre><code>\r
+Ext.Msg.show({\r
+   title: 'Address',\r
+   msg: 'Please enter your address:',\r
+   width: 300,\r
+   buttons: Ext.MessageBox.OKCANCEL,\r
+   multiline: true,\r
+   fn: saveAddress,\r
+   animEl: 'addAddressBtn',\r
+   icon: Ext.MessageBox.INFO\r
+});\r
+</code></pre>\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        show : function(options){\r
+            if(this.isVisible()){\r
+                this.hide();\r
+            }\r
+            opt = options;\r
+            var d = this.getDialog(opt.title || "&#160;");\r
+\r
+            d.setTitle(opt.title || "&#160;");\r
+            var allowClose = (opt.closable !== false && opt.progress !== true && opt.wait !== true);\r
+            d.tools.close.setDisplayed(allowClose);\r
+            activeTextEl = textboxEl;\r
+            opt.prompt = opt.prompt || (opt.multiline ? true : false);\r
+            if(opt.prompt){\r
+                if(opt.multiline){\r
+                    textboxEl.hide();\r
+                    textareaEl.show();\r
+                    textareaEl.setHeight(Ext.isNumber(opt.multiline) ? opt.multiline : this.defaultTextHeight);\r
+                    activeTextEl = textareaEl;\r
+                }else{\r
+                    textboxEl.show();\r
+                    textareaEl.hide();\r
+                }\r
+            }else{\r
+                textboxEl.hide();\r
+                textareaEl.hide();\r
+            }\r
+            activeTextEl.dom.value = opt.value || "";\r
+            if(opt.prompt){\r
+                d.focusEl = activeTextEl;\r
+            }else{\r
+                var bs = opt.buttons;\r
+                var db = null;\r
+                if(bs && bs.ok){\r
+                    db = buttons["ok"];\r
+                }else if(bs && bs.yes){\r
+                    db = buttons["yes"];\r
+                }\r
+                if (db){\r
+                    d.focusEl = db;\r
                 }\r
             }\r
-        }\r
-        Ext.ListView.superclass.initComponent.call(this);\r
-    },\r
+            if(opt.iconCls){\r
+              d.setIconClass(opt.iconCls);\r
+            }\r
+            this.setIcon(Ext.isDefined(opt.icon) ? opt.icon : bufferIcon);\r
+            bwidth = updateButtons(opt.buttons);\r
+            progressBar.setVisible(opt.progress === true || opt.wait === true);\r
+            this.updateProgress(0, opt.progressText);\r
+            this.updateText(opt.msg);\r
+            if(opt.cls){\r
+                d.el.addClass(opt.cls);\r
+            }\r
+            d.proxyDrag = opt.proxyDrag === true;\r
+            d.modal = opt.modal !== false;\r
+            d.mask = opt.modal !== false ? mask : false;\r
+            if(!d.isVisible()){\r
+                // force it to the end of the z-index stack so it gets a cursor in FF\r
+                document.body.appendChild(dlg.el.dom);\r
+                d.setAnimateTarget(opt.animEl);\r
+                //workaround for window internally enabling keymap in afterShow\r
+                d.on('show', function(){\r
+                    if(allowClose === true){\r
+                        d.keyMap.enable();\r
+                    }else{\r
+                        d.keyMap.disable();\r
+                    }\r
+                }, this, {single:true});\r
+                d.show(opt.animEl);\r
+            }\r
+            if(opt.wait === true){\r
+                progressBar.wait(opt.waitConfig);\r
+            }\r
+            return this;\r
+        },\r
 \r
-    onRender : function(){\r
-        Ext.ListView.superclass.onRender.apply(this, arguments);\r
+        /**\r
+         * Adds the specified icon to the dialog.  By default, the class 'ext-mb-icon' is applied for default\r
+         * styling, and the class passed in is expected to supply the background image url. Pass in empty string ('')\r
+         * to clear any existing icon. This method must be called before the MessageBox is shown.\r
+         * The following built-in icon classes are supported, but you can also pass in a custom class name:\r
+         * <pre>\r
+Ext.MessageBox.INFO\r
+Ext.MessageBox.WARNING\r
+Ext.MessageBox.QUESTION\r
+Ext.MessageBox.ERROR\r
+         *</pre>\r
+         * @param {String} icon A CSS classname specifying the icon's background image url, or empty string to clear the icon\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        setIcon : function(icon){\r
+            if(!dlg){\r
+                bufferIcon = icon;\r
+                return;\r
+            }\r
+            bufferIcon = undefined;\r
+            if(icon && icon != ''){\r
+                iconEl.removeClass('x-hidden');\r
+                iconEl.replaceClass(iconCls, icon);\r
+                bodyEl.addClass('x-dlg-icon');\r
+                iconCls = icon;\r
+            }else{\r
+                iconEl.replaceClass(iconCls, 'x-hidden');\r
+                bodyEl.removeClass('x-dlg-icon');\r
+                iconCls = '';\r
+            }\r
+            return this;\r
+        },\r
 \r
-        this.internalTpl.overwrite(this.el, {columns: this.columns});\r
-        \r
-        this.innerBody = Ext.get(this.el.dom.childNodes[1].firstChild);\r
-        this.innerHd = Ext.get(this.el.dom.firstChild.firstChild);\r
+        /**\r
+         * Displays a message box with a progress bar.  This message box has no buttons and is not closeable by\r
+         * the user.  You are responsible for updating the progress bar as needed via {@link Ext.MessageBox#updateProgress}\r
+         * and closing the message box when the process is complete.\r
+         * @param {String} title The title bar text\r
+         * @param {String} msg The message box body text\r
+         * @param {String} progressText (optional) The text to display inside the progress bar (defaults to '')\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        progress : function(title, msg, progressText){\r
+            this.show({\r
+                title : title,\r
+                msg : msg,\r
+                buttons: false,\r
+                progress:true,\r
+                closable:false,\r
+                minWidth: this.minProgressWidth,\r
+                progressText: progressText\r
+            });\r
+            return this;\r
+        },\r
 \r
-        if(this.hideHeaders){\r
-            this.el.dom.firstChild.style.display = 'none';\r
+        /**\r
+         * Displays a message box with an infinitely auto-updating progress bar.  This can be used to block user\r
+         * interaction while waiting for a long-running process to complete that does not have defined intervals.\r
+         * You are responsible for closing the message box when the process is complete.\r
+         * @param {String} msg The message box body text\r
+         * @param {String} title (optional) The title bar text\r
+         * @param {Object} config (optional) A {@link Ext.ProgressBar#waitConfig} object\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        wait : function(msg, title, config){\r
+            this.show({\r
+                title : title,\r
+                msg : msg,\r
+                buttons: false,\r
+                closable:false,\r
+                wait:true,\r
+                modal:true,\r
+                minWidth: this.minProgressWidth,\r
+                waitConfig: config\r
+            });\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt).\r
+         * If a callback function is passed it will be called after the user clicks the button, and the\r
+         * id of the button that was clicked will be passed as the only parameter to the callback\r
+         * (could also be the top-right close button).\r
+         * @param {String} title The title bar text\r
+         * @param {String} msg The message box body text\r
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        alert : function(title, msg, fn, scope){\r
+            this.show({\r
+                title : title,\r
+                msg : msg,\r
+                buttons: this.OK,\r
+                fn: fn,\r
+                scope : scope,\r
+                minWidth: this.minWidth\r
+            });\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm).\r
+         * If a callback function is passed it will be called after the user clicks either button,\r
+         * and the id of the button that was clicked will be passed as the only parameter to the callback\r
+         * (could also be the top-right close button).\r
+         * @param {String} title The title bar text\r
+         * @param {String} msg The message box body text\r
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        confirm : function(title, msg, fn, scope){\r
+            this.show({\r
+                title : title,\r
+                msg : msg,\r
+                buttons: this.YESNO,\r
+                fn: fn,\r
+                scope : scope,\r
+                icon: this.QUESTION,\r
+                minWidth: this.minWidth\r
+            });\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt).\r
+         * The prompt can be a single-line or multi-line textbox.  If a callback function is passed it will be called after the user\r
+         * clicks either button, and the id of the button that was clicked (could also be the top-right\r
+         * close button) and the text that was entered will be passed as the two parameters to the callback.\r
+         * @param {String} title The title bar text\r
+         * @param {String} msg The message box body text\r
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.\r
+         * @param {Boolean/Number} multiline (optional) True to create a multiline textbox using the defaultTextHeight\r
+         * property, or the height in pixels to create the textbox (defaults to false / single-line)\r
+         * @param {String} value (optional) Default value of the text input element (defaults to '')\r
+         * @return {Ext.MessageBox} this\r
+         */\r
+        prompt : function(title, msg, fn, scope, multiline, value){\r
+            this.show({\r
+                title : title,\r
+                msg : msg,\r
+                buttons: this.OKCANCEL,\r
+                fn: fn,\r
+                minWidth: this.minPromptWidth,\r
+                scope : scope,\r
+                prompt:true,\r
+                multiline: multiline,\r
+                value: value\r
+            });\r
+            return this;\r
+        },\r
+\r
+        /**\r
+         * Button config that displays a single OK button\r
+         * @type Object\r
+         */\r
+        OK : {ok:true},\r
+        /**\r
+         * Button config that displays a single Cancel button\r
+         * @type Object\r
+         */\r
+        CANCEL : {cancel:true},\r
+        /**\r
+         * Button config that displays OK and Cancel buttons\r
+         * @type Object\r
+         */\r
+        OKCANCEL : {ok:true, cancel:true},\r
+        /**\r
+         * Button config that displays Yes and No buttons\r
+         * @type Object\r
+         */\r
+        YESNO : {yes:true, no:true},\r
+        /**\r
+         * Button config that displays Yes, No and Cancel buttons\r
+         * @type Object\r
+         */\r
+        YESNOCANCEL : {yes:true, no:true, cancel:true},\r
+        /**\r
+         * The CSS class that provides the INFO icon image\r
+         * @type String\r
+         */\r
+        INFO : 'ext-mb-info',\r
+        /**\r
+         * The CSS class that provides the WARNING icon image\r
+         * @type String\r
+         */\r
+        WARNING : 'ext-mb-warning',\r
+        /**\r
+         * The CSS class that provides the QUESTION icon image\r
+         * @type String\r
+         */\r
+        QUESTION : 'ext-mb-question',\r
+        /**\r
+         * The CSS class that provides the ERROR icon image\r
+         * @type String\r
+         */\r
+        ERROR : 'ext-mb-error',\r
+\r
+        /**\r
+         * The default height in pixels of the message box's multiline textarea if displayed (defaults to 75)\r
+         * @type Number\r
+         */\r
+        defaultTextHeight : 75,\r
+        /**\r
+         * The maximum width in pixels of the message box (defaults to 600)\r
+         * @type Number\r
+         */\r
+        maxWidth : 600,\r
+        /**\r
+         * The minimum width in pixels of the message box (defaults to 100)\r
+         * @type Number\r
+         */\r
+        minWidth : 100,\r
+        /**\r
+         * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful\r
+         * for setting a different minimum width than text-only dialogs may need (defaults to 250).\r
+         * @type Number\r
+         */\r
+        minProgressWidth : 250,\r
+        /**\r
+         * The minimum width in pixels of the message box if it is a prompt dialog.  This is useful\r
+         * for setting a different minimum width than text-only dialogs may need (defaults to 250).\r
+         * @type Number\r
+         */\r
+        minPromptWidth: 250,\r
+        /**\r
+         * An object containing the default button text strings that can be overriden for localized language support.\r
+         * Supported properties are: ok, cancel, yes and no.  Generally you should include a locale-specific\r
+         * resource file for handling language support across the framework.\r
+         * Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french\r
+         * @type Object\r
+         */\r
+        buttonText : {\r
+            ok : "OK",\r
+            cancel : "Cancel",\r
+            yes : "Yes",\r
+            no : "No"\r
         }\r
+    };\r
+}();\r
+\r
+/**\r
+ * Shorthand for {@link Ext.MessageBox}\r
+ */\r
+Ext.Msg = Ext.MessageBox;/**\r
+ * @class Ext.dd.PanelProxy\r
+ * A custom drag proxy implementation specific to {@link Ext.Panel}s. This class is primarily used internally\r
+ * for the Panel's drag drop implementation, and should never need to be created directly.\r
+ * @constructor\r
+ * @param panel The {@link Ext.Panel} to proxy for\r
+ * @param config Configuration options\r
+ */\r
+Ext.dd.PanelProxy = function(panel, config){\r
+    this.panel = panel;\r
+    this.id = this.panel.id +'-ddproxy';\r
+    Ext.apply(this, config);\r
+};\r
+\r
+Ext.dd.PanelProxy.prototype = {\r
+    /**\r
+     * @cfg {Boolean} insertProxy True to insert a placeholder proxy element while dragging the panel,\r
+     * false to drag with no proxy (defaults to true).\r
+     */\r
+    insertProxy : true,\r
+\r
+    // private overrides\r
+    setStatus : Ext.emptyFn,\r
+    reset : Ext.emptyFn,\r
+    update : Ext.emptyFn,\r
+    stop : Ext.emptyFn,\r
+    sync: Ext.emptyFn,\r
+\r
+    /**\r
+     * Gets the proxy's element\r
+     * @return {Element} The proxy's element\r
+     */\r
+    getEl : function(){\r
+        return this.ghost;\r
     },\r
 \r
-    getTemplateTarget : function(){\r
-        return this.innerBody;\r
+    /**\r
+     * Gets the proxy's ghost element\r
+     * @return {Element} The proxy's ghost element\r
+     */\r
+    getGhost : function(){\r
+        return this.ghost;\r
     },\r
 \r
     /**\r
-     * <p>Function which can be overridden which returns the data object passed to this\r
-     * view's {@link #tpl template} to render the whole ListView. The returned object \r
-     * shall contain the following properties:</p>\r
-     * <div class="mdetail-params"><ul>\r
-     * <li><b>columns</b> : String<div class="sub-desc">See <tt>{@link #columns}</tt></div></li>\r
-     * <li><b>rows</b> : String<div class="sub-desc">See\r
-     * <tt>{@link Ext.DataView}.{@link Ext.DataView#collectData collectData}</div></li>\r
-     * </ul></div>\r
-     * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView.\r
-     * @param {Number} startIndex the index number of the Record being prepared for rendering.\r
-     * @return {Object} A data object containing properties to be processed by a repeating\r
-     * XTemplate as described above.\r
+     * Gets the proxy's element\r
+     * @return {Element} The proxy's element\r
      */\r
-    collectData : function(){\r
-        var rs = Ext.ListView.superclass.collectData.apply(this, arguments);\r
-        return {\r
-            columns: this.columns,\r
-            rows: rs\r
-        }\r
+    getProxy : function(){\r
+        return this.proxy;\r
     },\r
 \r
-    verifyInternalSize : function(){\r
-        if(this.lastSize){\r
-            this.onResize(this.lastSize.width, this.lastSize.height);\r
+    /**\r
+     * Hides the proxy\r
+     */\r
+    hide : function(){\r
+        if(this.ghost){\r
+            if(this.proxy){\r
+                this.proxy.remove();\r
+                delete this.proxy;\r
+            }\r
+            this.panel.el.dom.style.display = '';\r
+            this.ghost.remove();\r
+            delete this.ghost;\r
         }\r
     },\r
 \r
-    // private\r
-    onResize : function(w, h){\r
-        var bd = this.innerBody.dom;\r
-        var hd = this.innerHd.dom\r
-        if(!bd){\r
-            return;\r
-        }\r
-        var bdp = bd.parentNode;\r
-        if(Ext.isNumber(w)){\r
-            var sw = w - this.scrollOffset;\r
-            if(this.reserveScrollOffset || ((bdp.offsetWidth - bdp.clientWidth) > 10)){\r
-                bd.style.width = sw + 'px';\r
-                hd.style.width = sw + 'px';\r
-            }else{\r
-                bd.style.width = w + 'px';\r
-                hd.style.width = w + 'px';\r
-                setTimeout(function(){\r
-                    if((bdp.offsetWidth - bdp.clientWidth) > 10){\r
-                        bd.style.width = sw + 'px';\r
-                        hd.style.width = sw + 'px';\r
-                    }\r
-                }, 10);\r
+    /**\r
+     * Shows the proxy\r
+     */\r
+    show : function(){\r
+        if(!this.ghost){\r
+            this.ghost = this.panel.createGhost(undefined, undefined, Ext.getBody());\r
+            this.ghost.setXY(this.panel.el.getXY())\r
+            if(this.insertProxy){\r
+                this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'});\r
+                this.proxy.setSize(this.panel.getSize());\r
             }\r
+            this.panel.el.dom.style.display = 'none';\r
         }\r
-        if(Ext.isNumber(h == 'number')){\r
-            bdp.style.height = (h - hd.parentNode.offsetHeight) + 'px';\r
-        }\r
-    },\r
-\r
-    updateIndexes : function(){\r
-        Ext.ListView.superclass.updateIndexes.apply(this, arguments);\r
-        this.verifyInternalSize();\r
     },\r
 \r
-    findHeaderIndex : function(hd){\r
-        hd = hd.dom || hd;\r
-        var pn = hd.parentNode, cs = pn.parentNode.childNodes;\r
-        for(var i = 0, c; c = cs[i]; i++){\r
-            if(c == pn){\r
-                return i;\r
-            }\r
+    // private\r
+    repair : function(xy, callback, scope){\r
+        this.hide();\r
+        if(typeof callback == "function"){\r
+            callback.call(scope || this);\r
         }\r
-        return -1;\r
     },\r
 \r
-    setHdWidths : function(){\r
-        var els = this.innerHd.dom.getElementsByTagName('div');\r
-        for(var i = 0, cs = this.columns, len = cs.length; i < len; i++){\r
-            els[i].style.width = cs[i].width + '%';\r
+    /**\r
+     * Moves the proxy to a different position in the DOM.  This is typically called while dragging the Panel\r
+     * to keep the proxy sync'd to the Panel's location.\r
+     * @param {HTMLElement} parentNode The proxy's parent DOM node\r
+     * @param {HTMLElement} before (optional) The sibling node before which the proxy should be inserted (defaults\r
+     * to the parent's last child if not specified)\r
+     */\r
+    moveProxy : function(parentNode, before){\r
+        if(this.proxy){\r
+            parentNode.insertBefore(this.proxy.dom, before);\r
         }\r
     }\r
-});\r
+};\r
 \r
-Ext.reg('listview', Ext.ListView);/**\r
- * @class Ext.ListView.ColumnResizer\r
- * @extends Ext.util.Observable\r
- * <p>Supporting Class for Ext.ListView.</p>\r
- * @constructor\r
- * @param {Object} config\r
- */\r
-Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, {\r
-    /**\r
-     * @cfg {Number} minPct The minimum percentage to allot for any column (defaults to <tt>.05</tt>)\r
-     */\r
-    minPct: .05,\r
+// private - DD implementation for Panels\r
+Ext.Panel.DD = function(panel, cfg){\r
+    this.panel = panel;\r
+    this.dragData = {panel: panel};\r
+    this.proxy = new Ext.dd.PanelProxy(panel, cfg);\r
+    Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg);\r
+    var h = panel.header;\r
+    if(h){\r
+        this.setHandleElId(h.id);\r
+    }\r
+    (h ? h : this.panel.body).setStyle('cursor', 'move');\r
+    this.scroll = false;\r
+};\r
 \r
-    constructor: function(config){\r
-        Ext.apply(this, config);\r
-        Ext.ListView.ColumnResizer.superclass.constructor.call(this);\r
+Ext.extend(Ext.Panel.DD, Ext.dd.DragSource, {\r
+    showFrame: Ext.emptyFn,\r
+    startDrag: Ext.emptyFn,\r
+    b4StartDrag: function(x, y) {\r
+        this.proxy.show();\r
     },\r
-    init : function(listView){\r
-        this.view = listView;\r
-        listView.on('render', this.initEvents, this);\r
+    b4MouseDown: function(e) {\r
+        var x = e.getPageX();\r
+        var y = e.getPageY();\r
+        this.autoOffset(x, y);\r
     },\r
-\r
-    initEvents : function(view){\r
-        view.mon(view.innerHd, 'mousemove', this.handleHdMove, this);\r
-        this.tracker = new Ext.dd.DragTracker({\r
-            onBeforeStart: this.onBeforeStart.createDelegate(this),\r
-            onStart: this.onStart.createDelegate(this),\r
-            onDrag: this.onDrag.createDelegate(this),\r
-            onEnd: this.onEnd.createDelegate(this),\r
-            tolerance: 3,\r
-            autoStart: 300\r
-        });\r
-        this.tracker.initEl(view.innerHd);\r
-        view.on('beforedestroy', this.tracker.destroy, this.tracker);\r
+    onInitDrag : function(x, y){\r
+        this.onStartDrag(x, y);\r
+        return true;\r
     },\r
-\r
-    handleHdMove : function(e, t){\r
-        var hw = 5;\r
-        var x = e.getPageX();\r
-        var hd = e.getTarget('em', 3, true);\r
-        if(hd){\r
-            var r = hd.getRegion();\r
-            var ss = hd.dom.style;\r
-            var pn = hd.dom.parentNode;\r
-\r
-            if(x - r.left <= hw && pn != pn.parentNode.firstChild){\r
-                this.activeHd = Ext.get(pn.previousSibling.firstChild);\r
-                               ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';\r
-            } else if(r.right - x <= hw && pn != pn.parentNode.lastChild.previousSibling){\r
-                this.activeHd = hd;\r
-                               ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';\r
-            } else{\r
-                delete this.activeHd;\r
-                ss.cursor = '';\r
-            }\r
-        }\r
+    createFrame : Ext.emptyFn,\r
+    getDragEl : function(e){\r
+        return this.proxy.ghost.dom;\r
     },\r
-\r
-    onBeforeStart : function(e){\r
-        this.dragHd = this.activeHd;\r
-        return !!this.dragHd;\r
+    endDrag : function(e){\r
+        this.proxy.hide();\r
+        this.panel.saveState();\r
     },\r
 \r
-    onStart: function(e){\r
-        this.view.disableHeaders = true;\r
-        this.proxy = this.view.el.createChild({cls:'x-list-resizer'});\r
-        this.proxy.setHeight(this.view.el.getHeight());\r
-\r
-        var x = this.tracker.getXY()[0];\r
-        var w = this.view.innerHd.getWidth();\r
-\r
-        this.hdX = this.dragHd.getX();\r
-        this.hdIndex = this.view.findHeaderIndex(this.dragHd);\r
-\r
-        this.proxy.setX(this.hdX);\r
-        this.proxy.setWidth(x-this.hdX);\r
-\r
-        this.minWidth = w*this.minPct;\r
-        this.maxWidth = w - (this.minWidth*(this.view.columns.length-1-this.hdIndex));\r
-    },\r
+    autoOffset : function(x, y) {\r
+        x -= this.startPageX;\r
+        y -= this.startPageY;\r
+        this.setDelta(x, y);\r
+    }\r
+});/**
+ * @class Ext.state.Provider
+ * Abstract base class for state provider implementations. This class provides methods
+ * for encoding and decoding <b>typed</b> variables including dates and defines the
+ * Provider interface.
+ */
+Ext.state.Provider = function(){
+    /**
+     * @event statechange
+     * Fires when a state change occurs.
+     * @param {Provider} this This state provider
+     * @param {String} key The state key which was changed
+     * @param {String} value The encoded value for the state
+     */
+    this.addEvents("statechange");
+    this.state = {};
+    Ext.state.Provider.superclass.constructor.call(this);
+};
+Ext.extend(Ext.state.Provider, Ext.util.Observable, {
+    /**
+     * Returns the current value for a key
+     * @param {String} name The key name
+     * @param {Mixed} defaultValue A default value to return if the key's value is not found
+     * @return {Mixed} The state data
+     */
+    get : function(name, defaultValue){
+        return typeof this.state[name] == "undefined" ?
+            defaultValue : this.state[name];
+    },
+
+    /**
+     * Clears a value from the state
+     * @param {String} name The key name
+     */
+    clear : function(name){
+        delete this.state[name];
+        this.fireEvent("statechange", this, name, null);
+    },
+
+    /**
+     * Sets the value for a key
+     * @param {String} name The key name
+     * @param {Mixed} value The value to set
+     */
+    set : function(name, value){
+        this.state[name] = value;
+        this.fireEvent("statechange", this, name, value);
+    },
+
+    /**
+     * Decodes a string previously encoded with {@link #encodeValue}.
+     * @param {String} value The value to decode
+     * @return {Mixed} The decoded value
+     */
+    decodeValue : function(cookie){
+        var re = /^(a|n|d|b|s|o)\:(.*)$/;
+        var matches = re.exec(unescape(cookie));
+        if(!matches || !matches[1]) return; // non state cookie
+        var type = matches[1];
+        var v = matches[2];
+        switch(type){
+            case "n":
+                return parseFloat(v);
+            case "d":
+                return new Date(Date.parse(v));
+            case "b":
+                return (v == "1");
+            case "a":
+                var all = [];
+                if(v != ''){
+                    Ext.each(v.split('^'), function(val){
+                        all.push(this.decodeValue(val));
+                    }, this);
+                }
+                return all;
+           case "o":
+                var all = {};
+                if(v != ''){
+                    Ext.each(v.split('^'), function(val){
+                        var kv = val.split('=');
+                        all[kv[0]] = this.decodeValue(kv[1]);
+                    }, this);
+                }
+                return all;
+           default:
+                return v;
+        }
+    },
+
+    /**
+     * Encodes a value including type information.  Decode with {@link #decodeValue}.
+     * @param {Mixed} value The value to encode
+     * @return {String} The encoded value
+     */
+    encodeValue : function(v){
+        var enc;
+        if(typeof v == "number"){
+            enc = "n:" + v;
+        }else if(typeof v == "boolean"){
+            enc = "b:" + (v ? "1" : "0");
+        }else if(Ext.isDate(v)){
+            enc = "d:" + v.toGMTString();
+        }else if(Ext.isArray(v)){
+            var flat = "";
+            for(var i = 0, len = v.length; i < len; i++){
+                flat += this.encodeValue(v[i]);
+                if(i != len-1) flat += "^";
+            }
+            enc = "a:" + flat;
+        }else if(typeof v == "object"){
+            var flat = "";
+            for(var key in v){
+                if(typeof v[key] != "function" && v[key] !== undefined){
+                    flat += key + "=" + this.encodeValue(v[key]) + "^";
+                }
+            }
+            enc = "o:" + flat.substring(0, flat.length-1);
+        }else{
+            enc = "s:" + v;
+        }
+        return escape(enc);
+    }
+});
+/**\r
+ * @class Ext.state.Manager\r
+ * This is the global state manager. By default all components that are "state aware" check this class\r
+ * for state information if you don't pass them a custom state provider. In order for this class\r
+ * to be useful, it must be initialized with a provider when your application initializes. Example usage:\r
+ <pre><code>\r
+// in your initialization function\r
+init : function(){\r
+   Ext.state.Manager.setProvider(new Ext.state.CookieProvider());\r
+   var win = new Window(...);\r
+   win.restoreState();\r
+}\r
+ </code></pre>\r
+ * @singleton\r
+ */\r
+Ext.state.Manager = function(){\r
+    var provider = new Ext.state.Provider();\r
 \r
-    onDrag: function(e){\r
-        var cursorX = this.tracker.getXY()[0];\r
-        this.proxy.setWidth((cursorX-this.hdX).constrain(this.minWidth, this.maxWidth));\r
-    },\r
+    return {\r
+        /**\r
+         * Configures the default state provider for your application\r
+         * @param {Provider} stateProvider The state provider to set\r
+         */\r
+        setProvider : function(stateProvider){\r
+            provider = stateProvider;\r
+        },\r
 \r
-    onEnd: function(e){\r
-        var nw = this.proxy.getWidth();\r
-        this.proxy.remove();\r
+        /**\r
+         * Returns the current value for a key\r
+         * @param {String} name The key name\r
+         * @param {Mixed} defaultValue The default value to return if the key lookup does not match\r
+         * @return {Mixed} The state data\r
+         */\r
+        get : function(key, defaultValue){\r
+            return provider.get(key, defaultValue);\r
+        },\r
 \r
-        var index = this.hdIndex;\r
-        var vw = this.view, cs = vw.columns, len = cs.length;\r
-        var w = this.view.innerHd.getWidth(), minPct = this.minPct * 100;\r
+        /**\r
+         * Sets the value for a key\r
+         * @param {String} name The key name\r
+         * @param {Mixed} value The state data\r
+         */\r
+         set : function(key, value){\r
+            provider.set(key, value);\r
+        },\r
 \r
-        var pct = Math.ceil((nw*100) / w);\r
-        var diff = cs[index].width - pct;\r
-        var each = Math.floor(diff / (len-1-index));\r
-        var mod = diff - (each * (len-1-index));\r
+        /**\r
+         * Clears a value from the state\r
+         * @param {String} name The key name\r
+         */\r
+        clear : function(key){\r
+            provider.clear(key);\r
+        },\r
 \r
-        for(var i = index+1; i < len; i++){\r
-            var cw = cs[i].width + each;\r
-            var ncw = Math.max(minPct, cw);\r
-            if(cw != ncw){\r
-                mod += cw - ncw;\r
-            }\r
-            cs[i].width = ncw;\r
+        /**\r
+         * Gets the currently configured state provider\r
+         * @return {Provider} The state provider\r
+         */\r
+        getProvider : function(){\r
+            return provider;\r
         }\r
-        cs[index].width = pct;\r
-        cs[index+1].width += mod;\r
-        delete this.dragHd;\r
-        this.view.setHdWidths();\r
-        this.view.refresh();\r
-        setTimeout(function(){\r
-            vw.disableHeaders = false;\r
-        }, 100);\r
-    }\r
-});/**\r
- * @class Ext.ListView.Sorter\r
- * @extends Ext.util.Observable\r
- * <p>Supporting Class for Ext.ListView.</p>\r
+    };\r
+}();\r
+/**\r
+ * @class Ext.state.CookieProvider\r
+ * @extends Ext.state.Provider\r
+ * The default Provider implementation which saves state via cookies.\r
+ * <br />Usage:\r
+ <pre><code>\r
+   var cp = new Ext.state.CookieProvider({\r
+       path: "/cgi-bin/",\r
+       expires: new Date(new Date().getTime()+(1000*60*60*24*30)), //30 days\r
+       domain: "extjs.com"\r
+   });\r
+   Ext.state.Manager.setProvider(cp);\r
+ </code></pre>\r
+ * @cfg {String} path The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)\r
+ * @cfg {Date} expires The cookie expiration date (defaults to 7 days from now)\r
+ * @cfg {String} domain The domain to save the cookie for.  Note that you cannot specify a different domain than\r
+ * your page is on, but you can specify a sub-domain, or simply the domain itself like 'extjs.com' to include\r
+ * all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same\r
+ * domain the page is running on including the 'www' like 'www.extjs.com')\r
+ * @cfg {Boolean} secure True if the site is using SSL (defaults to false)\r
  * @constructor\r
- * @param {Object} config\r
+ * Create a new CookieProvider\r
+ * @param {Object} config The configuration object\r
  */\r
-Ext.ListView.Sorter = Ext.extend(Ext.util.Observable, {\r
-    /**\r
-     * @cfg {Array} sortClasses\r
-     * The CSS classes applied to a header when it is sorted. (defaults to <tt>["sort-asc", "sort-desc"]</tt>)\r
-     */\r
-    sortClasses : ["sort-asc", "sort-desc"],\r
-\r
-    constructor: function(config){\r
-        Ext.apply(this, config);\r
-        Ext.ListView.Sorter.superclass.constructor.call(this);\r
-    },\r
-\r
-    init : function(listView){\r
-        this.view = listView;\r
-        listView.on('render', this.initEvents, this);\r
-    },\r
-\r
-    initEvents : function(view){\r
-        view.mon(view.innerHd, 'click', this.onHdClick, this);\r
-        view.innerHd.setStyle('cursor', 'pointer');\r
-        view.mon(view.store, 'datachanged', this.updateSortState, this);\r
-        this.updateSortState.defer(10, this, [view.store]);\r
-    },\r
+Ext.state.CookieProvider = function(config){\r
+    Ext.state.CookieProvider.superclass.constructor.call(this);\r
+    this.path = "/";\r
+    this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days\r
+    this.domain = null;\r
+    this.secure = false;\r
+    Ext.apply(this, config);\r
+    this.state = this.readCookies();\r
+};\r
 \r
-    updateSortState : function(store){\r
-        var state = store.getSortState();\r
-        if(!state){\r
+Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, {\r
+    // private\r
+    set : function(name, value){\r
+        if(typeof value == "undefined" || value === null){\r
+            this.clear(name);\r
             return;\r
         }\r
-        this.sortState = state;\r
-        var cs = this.view.columns, sortColumn = -1;\r
-        for(var i = 0, len = cs.length; i < len; i++){\r
-            if(cs[i].dataIndex == state.field){\r
-                sortColumn = i;\r
-                break;\r
-            }\r
-        }\r
-        if(sortColumn != -1){\r
-            var sortDir = state.direction;\r
-            this.updateSortIcon(sortColumn, sortDir);\r
-        }\r
+        this.setCookie(name, value);\r
+        Ext.state.CookieProvider.superclass.set.call(this, name, value);\r
     },\r
 \r
-    updateSortIcon : function(col, dir){\r
-        var sc = this.sortClasses;\r
-        var hds = this.view.innerHd.select('em').removeClass(sc);\r
-        hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]);\r
+    // private\r
+    clear : function(name){\r
+        this.clearCookie(name);\r
+        Ext.state.CookieProvider.superclass.clear.call(this, name);\r
     },\r
 \r
-    onHdClick : function(e){\r
-        var hd = e.getTarget('em', 3);\r
-        if(hd && !this.view.disableHeaders){\r
-            var index = this.view.findHeaderIndex(hd);\r
-            this.view.store.sort(this.view.columns[index].dataIndex);\r
+    // private\r
+    readCookies : function(){\r
+        var cookies = {};\r
+        var c = document.cookie + ";";\r
+        var re = /\s?(.*?)=(.*?);/g;\r
+       var matches;\r
+       while((matches = re.exec(c)) != null){\r
+            var name = matches[1];\r
+            var value = matches[2];\r
+            if(name && name.substring(0,3) == "ys-"){\r
+                cookies[name.substr(3)] = this.decodeValue(value);\r
+            }\r
         }\r
-    }\r
-});/**
- * @class Ext.TabPanel
- * <p>A basic tab container. TabPanels can be used exactly like a standard {@link Ext.Panel}
- * for layout purposes, but also have special support for containing child Components
- * (<tt>{@link Ext.Container#items items}</tt>) that are managed using a
- * {@link Ext.layout.CardLayout CardLayout layout manager}, and displayed as separate tabs.</p>
- *
- * <b>Note:</b> By default, a tab's close tool <i>destroys</i> the child tab Component
- * and all its descendants. This makes the child tab Component, and all its descendants <b>unusable</b>. To enable
- * re-use of a tab, configure the TabPanel with <b><code>{@link #autoDestroy autoDestroy: false}</code></b>.
- *
- * <p><b><u>TabPanel header/footer elements</u></b></p>
- * <p>TabPanels use their {@link Ext.Panel#header header} or {@link Ext.Panel#footer footer} element
- * (depending on the {@link #tabPosition} configuration) to accommodate the tab selector buttons.
- * This means that a TabPanel will not display any configured title, and will not display any
- * configured header {@link Ext.Panel#tools tools}.</p>
- * <p>To display a header, embed the TabPanel in a {@link Ext.Panel Panel} which uses
- * <b><tt>{@link Ext.Container#layout layout:'fit'}</tt></b>.</p>
- *
- * <p><b><u>Tab Events</u></b></p>
- * <p>There is no actual tab class &mdash; each tab is simply a {@link Ext.BoxComponent Component}
- * such as a {@link Ext.Panel Panel}. However, when rendered in a TabPanel, each child Component
- * can fire additional events that only exist for tabs and are not available from other Components.
- * These events are:</p>
- * <div><ul class="mdetail-params">
- * <li><tt><b>{@link Ext.Panel#activate activate}</b></tt> : Fires when this Component becomes
- * the active tab.</li>
- * <li><tt><b>{@link Ext.Panel#deactivate deactivate}</b></tt> : Fires when the Component that
- * was the active tab becomes deactivated.</li>
- * </ul></div>
- * <p><b><u>Creating TabPanels from Code</u></b></p>
- * <p>TabPanels can be created and rendered completely in code, as in this example:</p>
- * <pre><code>
-var tabs = new Ext.TabPanel({
-    renderTo: Ext.getBody(),
-    activeTab: 0,
-    items: [{
-        title: 'Tab 1',
-        html: 'A simple tab'
-    },{
-        title: 'Tab 2',
-        html: 'Another one'
-    }]
-});
-</code></pre>
- * <p><b><u>Creating TabPanels from Existing Markup</u></b></p>
- * <p>TabPanels can also be rendered from pre-existing markup in a couple of ways.</p>
- * <div><ul class="mdetail-params">
- *
- * <li>Pre-Structured Markup</li>
- * <div class="sub-desc">
- * <p>A container div with one or more nested tab divs with class <tt>'x-tab'</tt> can be rendered entirely
- * from existing markup (See the {@link #autoTabs} example).</p>
- * </div>
+        return cookies;\r
+    },\r
+\r
+    // private\r
+    setCookie : function(name, value){\r
+        document.cookie = "ys-"+ name + "=" + this.encodeValue(value) +\r
+           ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) +\r
+           ((this.path == null) ? "" : ("; path=" + this.path)) +\r
+           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +\r
+           ((this.secure == true) ? "; secure" : "");\r
+    },\r
+\r
+    // private\r
+    clearCookie : function(name){\r
+        document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" +\r
+           ((this.path == null) ? "" : ("; path=" + this.path)) +\r
+           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +\r
+           ((this.secure == true) ? "; secure" : "");\r
+    }\r
+});/**
+ * @class Ext.DataView
+ * @extends Ext.BoxComponent
+ * A mechanism for displaying data using custom layout templates and formatting. DataView uses an {@link Ext.XTemplate}
+ * as its internal templating mechanism, and is bound to an {@link Ext.data.Store}
+ * so that as the data in the store changes the view is automatically updated to reflect the changes.  The view also
+ * provides built-in behavior for many common events that can occur for its contained items including click, doubleclick,
+ * mouseover, mouseout, etc. as well as a built-in selection model. <b>In order to use these features, an {@link #itemSelector}
+ * config must be provided for the DataView to determine what nodes it will be working with.</b>
  *
- * <li>Un-Structured Markup</li>
- * <div class="sub-desc">
- * <p>A TabPanel can also be rendered from markup that is not strictly structured by simply specifying by id
- * which elements should be the container and the tabs. Using this method tab content can be pulled from different
- * elements within the page by id regardless of page structure. For example:</p>
+ * <p>The example below binds a DataView to a {@link Ext.data.Store} and renders it into an {@link Ext.Panel}.</p>
  * <pre><code>
-var tabs = new Ext.TabPanel({
-    renderTo: 'my-tabs',
-    activeTab: 0,
-    items:[
-        {contentEl:'tab1', title:'Tab 1'},
-        {contentEl:'tab2', title:'Tab 2'}
+var store = new Ext.data.JsonStore({
+    url: 'get-images.php',
+    root: 'images',
+    fields: [
+        'name', 'url',
+        {name:'size', type: 'float'},
+        {name:'lastmod', type:'date', dateFormat:'timestamp'}
     ]
 });
+store.load();
 
-// Note that the tabs do not have to be nested within the container (although they can be)
-&lt;div id="my-tabs">&lt;/div>
-&lt;div id="tab1" class="x-hide-display">A simple tab&lt;/div>
-&lt;div id="tab2" class="x-hide-display">Another one&lt;/div>
+var tpl = new Ext.XTemplate(
+    '&lt;tpl for="."&gt;',
+        '&lt;div class="thumb-wrap" id="{name}"&gt;',
+        '&lt;div class="thumb"&gt;&lt;img src="{url}" title="{name}"&gt;&lt;/div&gt;',
+        '&lt;span class="x-editable"&gt;{shortName}&lt;/span&gt;&lt;/div&gt;',
+    '&lt;/tpl&gt;',
+    '&lt;div class="x-clear"&gt;&lt;/div&gt;'
+);
+
+var panel = new Ext.Panel({
+    id:'images-view',
+    frame:true,
+    width:535,
+    autoHeight:true,
+    collapsible:true,
+    layout:'fit',
+    title:'Simple DataView',
+
+    items: new Ext.DataView({
+        store: store,
+        tpl: tpl,
+        autoHeight:true,
+        multiSelect: true,
+        overClass:'x-view-over',
+        itemSelector:'div.thumb-wrap',
+        emptyText: 'No images to display'
+    })
+});
+panel.render(document.body);
 </code></pre>
- * Note that the tab divs in this example contain the class <tt>'x-hide-display'</tt> so that they can be rendered
- * deferred without displaying outside the tabs. You could alternately set <tt>{@link #deferredRender} = false </tt>
- * to render all content tabs on page load.
- * </div>
- *
- * </ul></div>
- *
- * @extends Ext.Panel
  * @constructor
- * @param {Object} config The configuration options
- * @xtype tabpanel
+ * Create a new DataView
+ * @param {Object} config The config object
+ * @xtype dataview
  */
-Ext.TabPanel = Ext.extend(Ext.Panel,  {
-    /**
-     * @cfg {Boolean} layoutOnTabChange
-     * Set to true to force a layout of the active tab when the tab is changed. Defaults to false.
-     * See {@link Ext.layout.CardLayout}.<code>{@link Ext.layout.CardLayout#layoutOnCardChange layoutOnCardChange}</code>.
-     */
-    /**
-     * @cfg {String} tabCls <b>This config option is used on <u>child Components</u> of ths TabPanel.</b> A CSS
-     * class name applied to the tab strip item representing the child Component, allowing special
-     * styling to be applied.
-     */
-    /**
-     * @cfg {Boolean} monitorResize True to automatically monitor window resize events and rerender the layout on
-     * browser resize (defaults to true).
-     */
-    monitorResize : true,
-    /**
-     * @cfg {Boolean} deferredRender
-     * <p><tt>true</tt> by default to defer the rendering of child <tt>{@link Ext.Container#items items}</tt>
-     * to the browsers DOM until a tab is activated. <tt>false</tt> will render all contained
-     * <tt>{@link Ext.Container#items items}</tt> as soon as the {@link Ext.layout.CardLayout layout}
-     * is rendered. If there is a significant amount of content or a lot of heavy controls being
-     * rendered into panels that are not displayed by default, setting this to <tt>true</tt> might
-     * improve performance.</p>
-     * <br><p>The <tt>deferredRender</tt> property is internally passed to the layout manager for
-     * TabPanels ({@link Ext.layout.CardLayout}) as its {@link Ext.layout.CardLayout#deferredRender}
-     * configuration value.</p>
-     * <br><p><b>Note</b>: leaving <tt>deferredRender</tt> as <tt>true</tt> means that the content
-     * within an unactivated tab will not be available. For example, this means that if the TabPanel
-     * is within a {@link Ext.form.FormPanel form}, then until a tab is activated, any Fields within
-     * unactivated tabs will not be rendered, and will therefore not be submitted and will not be
-     * available to either {@link Ext.form.BasicForm#getValues getValues} or
-     * {@link Ext.form.BasicForm#setValues setValues}.</p>
-     */
-    deferredRender : true,
+Ext.DataView = Ext.extend(Ext.BoxComponent, {
     /**
-     * @cfg {Number} tabWidth The initial width in pixels of each new tab (defaults to 120).
+     * @cfg {String/Array} tpl
+     * The HTML fragment or an array of fragments that will make up the template used by this DataView.  This should
+     * be specified in the same format expected by the constructor of {@link Ext.XTemplate}.
      */
-    tabWidth : 120,
     /**
-     * @cfg {Number} minTabWidth The minimum width in pixels for each tab when {@link #resizeTabs} = true (defaults to 30).
+     * @cfg {Ext.data.Store} store
+     * The {@link Ext.data.Store} to bind this DataView to.
      */
-    minTabWidth : 30,
     /**
-     * @cfg {Boolean} resizeTabs True to automatically resize each tab so that the tabs will completely fill the
-     * tab strip (defaults to false).  Setting this to true may cause specific widths that might be set per tab to
-     * be overridden in order to fit them all into view (although {@link #minTabWidth} will always be honored).
+     * @cfg {String} itemSelector
+     * <b>This is a required setting</b>. A simple CSS selector (e.g. <tt>div.some-class</tt> or 
+     * <tt>span:first-child</tt>) that will be used to determine what nodes this DataView will be
+     * working with.
      */
-    resizeTabs : false,
     /**
-     * @cfg {Boolean} enableTabScroll True to enable scrolling to tabs that may be invisible due to overflowing the
-     * overall TabPanel width. Only available with tabPosition:'top' (defaults to false).
+     * @cfg {Boolean} multiSelect
+     * True to allow selection of more than one item at a time, false to allow selection of only a single item
+     * at a time or no selection at all, depending on the value of {@link #singleSelect} (defaults to false).
      */
-    enableTabScroll : false,
     /**
-     * @cfg {Number} scrollIncrement The number of pixels to scroll each time a tab scroll button is pressed
-     * (defaults to <tt>100</tt>, or if <tt>{@link #resizeTabs} = true</tt>, the calculated tab width).  Only
-     * applies when <tt>{@link #enableTabScroll} = true</tt>.
+     * @cfg {Boolean} singleSelect
+     * True to allow selection of exactly one item at a time, false to allow no selection at all (defaults to false).
+     * Note that if {@link #multiSelect} = true, this value will be ignored.
      */
-    scrollIncrement : 0,
     /**
-     * @cfg {Number} scrollRepeatInterval Number of milliseconds between each scroll while a tab scroll button is
-     * continuously pressed (defaults to <tt>400</tt>).
+     * @cfg {Boolean} simpleSelect
+     * True to enable multiselection by clicking on multiple items without requiring the user to hold Shift or Ctrl,
+     * false to force the user to hold Ctrl or Shift to select more than on item (defaults to false).
      */
-    scrollRepeatInterval : 400,
     /**
-     * @cfg {Float} scrollDuration The number of milliseconds that each scroll animation should last (defaults
-     * to <tt>.35</tt>). Only applies when <tt>{@link #animScroll} = true</tt>.
+     * @cfg {String} overClass
+     * A CSS class to apply to each item in the view on mouseover (defaults to undefined).
      */
-    scrollDuration : 0.35,
     /**
-     * @cfg {Boolean} animScroll True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults
-     * to <tt>true</tt>).  Only applies when <tt>{@link #enableTabScroll} = true</tt>.
+     * @cfg {String} loadingText
+     * A string to display during data load operations (defaults to undefined).  If specified, this text will be
+     * displayed in a loading div and the view's contents will be cleared while loading, otherwise the view's
+     * contents will continue to display normally until the new data is loaded and the contents are replaced.
      */
-    animScroll : true,
     /**
-     * @cfg {String} tabPosition The position where the tab strip should be rendered (defaults to <tt>'top'</tt>).
-     * The only other supported value is <tt>'bottom'</tt>.  <b>Note</b>: tab scrolling is only supported for
-     * <tt>tabPosition: 'top'</tt>.
+     * @cfg {String} selectedClass
+     * A CSS class to apply to each selected item in the view (defaults to 'x-view-selected').
      */
-    tabPosition : 'top',
+    selectedClass : "x-view-selected",
     /**
-     * @cfg {String} baseCls The base CSS class applied to the panel (defaults to <tt>'x-tab-panel'</tt>).
+     * @cfg {String} emptyText
+     * The text to display in the view when there is no data to display (defaults to '').
      */
-    baseCls : 'x-tab-panel',
-    /**
-     * @cfg {Boolean} autoTabs
-     * <p><tt>true</tt> to query the DOM for any divs with a class of 'x-tab' to be automatically converted
-     * to tabs and added to this panel (defaults to <tt>false</tt>).  Note that the query will be executed within
-     * the scope of the container element only (so that multiple tab panels from markup can be supported via this
-     * method).</p>
-     * <p>This method is only possible when the markup is structured correctly as a container with nested divs
-     * containing the class <tt>'x-tab'</tt>. To create TabPanels without these limitations, or to pull tab content
-     * from other elements on the page, see the example at the top of the class for generating tabs from markup.</p>
-     * <p>There are a couple of things to note when using this method:<ul>
-     * <li>When using the <tt>autoTabs</tt> config (as opposed to passing individual tab configs in the TabPanel's
-     * {@link #items} collection), you must use <tt>{@link #applyTo}</tt> to correctly use the specified <tt>id</tt>
-     * as the tab container. The <tt>autoTabs</tt> method <em>replaces</em> existing content with the TabPanel
-     * components.</li>
-     * <li>Make sure that you set <tt>{@link #deferredRender}: false</tt> so that the content elements for each
-     * tab will be rendered into the TabPanel immediately upon page load, otherwise they will not be transformed
-     * until each tab is activated and will be visible outside the TabPanel.</li>
-     * </ul>Example usage:</p>
-     * <pre><code>
-var tabs = new Ext.TabPanel({
-    applyTo: 'my-tabs',
-    activeTab: 0,
-    deferredRender: false,
-    autoTabs: true
-});
+    emptyText : "",
 
-// This markup will be converted to a TabPanel from the code above
-&lt;div id="my-tabs">
-    &lt;div class="x-tab" title="Tab 1">A simple tab&lt;/div>
-    &lt;div class="x-tab" title="Tab 2">Another one&lt;/div>
-&lt;/div>
-</code></pre>
-     */
-    autoTabs : false,
-    /**
-     * @cfg {String} autoTabSelector The CSS selector used to search for tabs in existing markup when
-     * <tt>{@link #autoTabs} = true</tt> (defaults to <tt>'div.x-tab'</tt>).  This can be any valid selector
-     * supported by {@link Ext.DomQuery#select}. Note that the query will be executed within the scope of this
-     * tab panel only (so that multiple tab panels from markup can be supported on a page).
-     */
-    autoTabSelector : 'div.x-tab',
-    /**
-     * @cfg {String/Number} activeTab A string id or the numeric index of the tab that should be initially
-     * activated on render (defaults to none).
-     */
-    activeTab : null,
-    /**
-     * @cfg {Number} tabMargin The number of pixels of space to calculate into the sizing and scrolling of
-     * tabs. If you change the margin in CSS, you will need to update this value so calculations are correct
-     * with either <tt>{@link #resizeTabs}</tt> or scrolling tabs. (defaults to <tt>2</tt>)
-     */
-    tabMargin : 2,
     /**
-     * @cfg {Boolean} plain </tt>true</tt> to render the tab strip without a background container image
-     * (defaults to <tt>false</tt>).
+     * @cfg {Boolean} deferEmptyText True to defer emptyText being applied until the store's first load
      */
-    plain : false,
+    deferEmptyText: true,
     /**
-     * @cfg {Number} wheelIncrement For scrolling tabs, the number of pixels to increment on mouse wheel
-     * scrolling (defaults to <tt>20</tt>).
-     */
-    wheelIncrement : 20,
-
-    /*
-     * This is a protected property used when concatenating tab ids to the TabPanel id for internal uniqueness.
-     * It does not generally need to be changed, but can be if external code also uses an id scheme that can
-     * potentially clash with this one.
+     * @cfg {Boolean} trackOver True to enable mouseenter and mouseleave events
      */
-    idDelimiter : '__',
-
-    // private
-    itemCls : 'x-tab-item',
+    trackOver: false,
 
-    // private config overrides
-    elements : 'body',
-    headerAsText : false,
-    frame : false,
-    hideBorders :true,
+    //private
+    last: false,
 
     // private
     initComponent : function(){
-        this.frame = false;
-        Ext.TabPanel.superclass.initComponent.call(this);
+        Ext.DataView.superclass.initComponent.call(this);
+        if(Ext.isString(this.tpl) || Ext.isArray(this.tpl)){
+            this.tpl = new Ext.XTemplate(this.tpl);
+        }
+
         this.addEvents(
             /**
-             * @event beforetabchange
-             * Fires before the active tab changes. Handlers can <tt>return false</tt> to cancel the tab change.
-             * @param {TabPanel} this
-             * @param {Panel} newTab The tab being activated
-             * @param {Panel} currentTab The current active tab
+             * @event beforeclick
+             * Fires before a click is processed. Returns false to cancel the default action.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
              */
-            'beforetabchange',
+            "beforeclick",
             /**
-             * @event tabchange
-             * Fires after the active tab has changed.
-             * @param {TabPanel} this
-             * @param {Panel} tab The new active tab
+             * @event click
+             * Fires when a template node is clicked.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
              */
-            'tabchange',
+            "click",
+            /**
+             * @event mouseenter
+             * Fires when the mouse enters a template node. trackOver:true or an overClass must be set to enable this event.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
+             */
+            "mouseenter",
+            /**
+             * @event mouseleave
+             * Fires when the mouse leaves a template node. trackOver:true or an overClass must be set to enable this event.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
+             */
+            "mouseleave",
+            /**
+             * @event containerclick
+             * Fires when a click occurs and it is not on a template node.
+             * @param {Ext.DataView} this
+             * @param {Ext.EventObject} e The raw event object
+             */
+            "containerclick",
+            /**
+             * @event dblclick
+             * Fires when a template node is double clicked.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
+             */
+            "dblclick",
             /**
              * @event contextmenu
-             * Relays the contextmenu event from a tab selector element in the tab strip.
-             * @param {TabPanel} this
-             * @param {Panel} tab The target tab
-             * @param {EventObject} e
+             * Fires when a template node is right clicked.
+             * @param {Ext.DataView} this
+             * @param {Number} index The index of the target node
+             * @param {HTMLElement} node The target node
+             * @param {Ext.EventObject} e The raw event object
              */
-            'contextmenu'
-        );
-        /**
-         * @cfg {Object} layoutConfig
-         * TabPanel implicitly uses {@link Ext.layout.CardLayout} as its layout manager.
-         * <code>layoutConfig</code> may be used to configure this layout manager.
-         * <code>{@link #deferredRender}</code> and <code>{@link #layoutOnTabChange}</code>
-         * configured on the TabPanel will be applied as configs to the layout manager.
-         */
-        this.setLayout(new Ext.layout.CardLayout(Ext.apply({
-            layoutOnCardChange: this.layoutOnTabChange,
-            deferredRender: this.deferredRender
-        }, this.layoutConfig)));
-
-        if(this.tabPosition == 'top'){
-            this.elements += ',header';
-            this.stripTarget = 'header';
-        }else {
-            this.elements += ',footer';
-            this.stripTarget = 'footer';
-        }
-        if(!this.stack){
-            this.stack = Ext.TabPanel.AccessStack();
-        }
-        this.initItems();
-    },
-
-    // private
-    onRender : function(ct, position){
-        Ext.TabPanel.superclass.onRender.call(this, ct, position);
-
-        if(this.plain){
-            var pos = this.tabPosition == 'top' ? 'header' : 'footer';
-            this[pos].addClass('x-tab-panel-'+pos+'-plain');
-        }
-
-        var st = this[this.stripTarget];
-
-        this.stripWrap = st.createChild({cls:'x-tab-strip-wrap', cn:{
-            tag:'ul', cls:'x-tab-strip x-tab-strip-'+this.tabPosition}});
-
-        var beforeEl = (this.tabPosition=='bottom' ? this.stripWrap : null);
-        this.stripSpacer = st.createChild({cls:'x-tab-strip-spacer'}, beforeEl);
-        this.strip = new Ext.Element(this.stripWrap.dom.firstChild);
-
-        this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge'});
-        this.strip.createChild({cls:'x-clear'});
-
-        this.body.addClass('x-tab-panel-body-'+this.tabPosition);
-
-        /**
-         * @cfg {Template/XTemplate} itemTpl <p>(Optional) A {@link Ext.Template Template} or
-         * {@link Ext.XTemplate XTemplate} which may be provided to process the data object returned from
-         * <tt>{@link #getTemplateArgs}</tt> to produce a clickable selector element in the tab strip.</p>
-         * <p>The main element created should be a <tt>&lt;li></tt> element. In order for a click event on
-         * a selector element to be connected to its item, it must take its <i>id</i> from the TabPanel's
-         * native <tt>{@link #getTemplateArgs}</tt>.</p>
-         * <p>The child element which contains the title text must be marked by the CSS class
-         * <tt>x-tab-strip-inner</tt>.</p>
-         * <p>To enable closability, the created element should contain an element marked by the CSS class
-         * <tt>x-tab-strip-close</tt>.</p>
-         * <p>If a custom <tt>itemTpl</tt> is supplied, it is the developer's responsibility to create CSS
-         * style rules to create the desired appearance.</p>
-         * Below is an example of how to create customized tab selector items:<pre><code>
-new Ext.TabPanel({
-    renderTo: document.body,
-    minTabWidth: 115,
-    tabWidth: 135,
-    enableTabScroll: true,
-    width: 600,
-    height: 250,
-    defaults: {autoScroll:true},
-    itemTpl: new Ext.XTemplate(
-    '&lt;li class="{cls}" id="{id}" style="overflow:hidden">',
-         '&lt;tpl if="closable">',
-            '&lt;a class="x-tab-strip-close" onclick="return false;">&lt;/a>',
-         '&lt;/tpl>',
-         '&lt;a class="x-tab-right" href="#" onclick="return false;" style="padding-left:6px">',
-            '&lt;em class="x-tab-left">',
-                '&lt;span class="x-tab-strip-inner">',
-                    '&lt;img src="{src}" style="float:left;margin:3px 3px 0 0">',
-                    '&lt;span style="margin-left:20px" class="x-tab-strip-text {iconCls}">{text} {extra}&lt;/span>',
-                '&lt;/span>',
-            '&lt;/em>',
-        '&lt;/a>',
-    '&lt;/li>'
-    ),
-    getTemplateArgs: function(item) {
-//      Call the native method to collect the base data. Like the ID!
-        var result = Ext.TabPanel.prototype.getTemplateArgs.call(this, item);
-
-//      Add stuff used in our template
-        return Ext.apply(result, {
-            closable: item.closable,
-            src: item.iconSrc,
-            extra: item.extraText || ''
-        });
-    },
-    items: [{
-        title: 'New Tab 1',
-        iconSrc: '../shared/icons/fam/grid.png',
-        html: 'Tab Body 1',
-        closable: true
-    }, {
-        title: 'New Tab 2',
-        iconSrc: '../shared/icons/fam/grid.png',
-        html: 'Tab Body 2',
-        extraText: 'Extra stuff in the tab button'
-    }]
-});
-</code></pre>
-         */
-        if(!this.itemTpl){
-            var tt = new Ext.Template(
-                 '<li class="{cls}" id="{id}"><a class="x-tab-strip-close" onclick="return false;"></a>',
-                 '<a class="x-tab-right" href="#" onclick="return false;"><em class="x-tab-left">',
-                 '<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',
-                 '</em></a></li>'
-            );
-            tt.disableFormats = true;
-            tt.compile();
-            Ext.TabPanel.prototype.itemTpl = tt;
-        }
-
-        this.items.each(this.initTab, this);
-    },
-
-    // private
-    afterRender : function(){
-        Ext.TabPanel.superclass.afterRender.call(this);
-        if(this.autoTabs){
-            this.readTabs(false);
-        }
-        if(this.activeTab !== undefined){
-            var item = Ext.isObject(this.activeTab) ? this.activeTab : this.items.get(this.activeTab);
-            delete this.activeTab;
-            this.setActiveTab(item);
-        }
-    },
-
-    // private
-    initEvents : function(){
-        Ext.TabPanel.superclass.initEvents.call(this);
-        this.on('add', this.onAdd, this, {target: this});
-        this.on('remove', this.onRemove, this, {target: this});
-
-        this.mon(this.strip, 'mousedown', this.onStripMouseDown, this);
-        this.mon(this.strip, 'contextmenu', this.onStripContextMenu, this);
-        if(this.enableTabScroll){
-            this.mon(this.strip, 'mousewheel', this.onWheel, this);
-        }
-    },
+            "contextmenu",
+            /**
+             * @event containercontextmenu
+             * Fires when a right click occurs that is not on a template node.
+             * @param {Ext.DataView} this
+             * @param {Ext.EventObject} e The raw event object
+             */
+            "containercontextmenu",
+            /**
+             * @event selectionchange
+             * Fires when the selected nodes change.
+             * @param {Ext.DataView} this
+             * @param {Array} selections Array of the selected nodes
+             */
+            "selectionchange",
 
-    // private
-    findTargets : function(e){
-        var item = null;
-        var itemEl = e.getTarget('li', this.strip);
-        if(itemEl){
-            item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]);
-            if(item.disabled){
-                return {
-                    close : null,
-                    item : null,
-                    el : null
-                };
-            }
-        }
-        return {
-            close : e.getTarget('.x-tab-strip-close', this.strip),
-            item : item,
-            el : itemEl
-        };
+            /**
+             * @event beforeselect
+             * Fires before a selection is made. If any handlers return false, the selection is cancelled.
+             * @param {Ext.DataView} this
+             * @param {HTMLElement} node The node to be selected
+             * @param {Array} selections Array of currently selected nodes
+             */
+            "beforeselect"
+        );
+
+        this.store = Ext.StoreMgr.lookup(this.store);
+        this.all = new Ext.CompositeElementLite();
+        this.selected = new Ext.CompositeElementLite();
     },
 
     // private
-    onStripMouseDown : function(e){
-        if(e.button !== 0){
-            return;
-        }
-        e.preventDefault();
-        var t = this.findTargets(e);
-        if(t.close){
-            if (t.item.fireEvent('beforeclose', t.item) !== false) {
-                t.item.fireEvent('close', t.item);
-                this.remove(t.item);
-            }
-            return;
-        }
-        if(t.item && t.item != this.activeTab){
-            this.setActiveTab(t.item);
+    afterRender : function(){
+        Ext.DataView.superclass.afterRender.call(this);
+
+               this.mon(this.getTemplateTarget(), {
+            "click": this.onClick,
+            "dblclick": this.onDblClick,
+            "contextmenu": this.onContextMenu,
+            scope:this
+        });
+
+        if(this.overClass || this.trackOver){
+            this.mon(this.getTemplateTarget(), {
+                "mouseover": this.onMouseOver,
+                "mouseout": this.onMouseOut,
+                scope:this
+            });
         }
-    },
 
-    // private
-    onStripContextMenu : function(e){
-        e.preventDefault();
-        var t = this.findTargets(e);
-        if(t.item){
-            this.fireEvent('contextmenu', this, t.item, e);
+        if(this.store){
+            this.bindStore(this.store, true);
         }
     },
 
     /**
-     * True to scan the markup in this tab panel for <tt>{@link #autoTabs}</tt> using the
-     * <tt>{@link #autoTabSelector}</tt>
-     * @param {Boolean} removeExisting True to remove existing tabs
+     * Refreshes the view by reloading the data from the store and re-rendering the template.
      */
-    readTabs : function(removeExisting){
-        if(removeExisting === true){
-            this.items.each(function(item){
-                this.remove(item);
-            }, this);
-        }
-        var tabs = this.el.query(this.autoTabSelector);
-        for(var i = 0, len = tabs.length; i < len; i++){
-            var tab = tabs[i];
-            var title = tab.getAttribute('title');
-            tab.removeAttribute('title');
-            this.add({
-                title: title,
-                contentEl: tab
-            });
+    refresh : function(){
+        this.clearSelections(false, true);
+        var el = this.getTemplateTarget();
+        el.update("");
+        var records = this.store.getRange();
+        if(records.length < 1){
+            if(!this.deferEmptyText || this.hasSkippedEmptyText){
+                el.update(this.emptyText);
+            }
+            this.all.clear();
+        }else{
+            this.tpl.overwrite(el, this.collectData(records, 0));
+            this.all.fill(Ext.query(this.itemSelector, el.dom));
+            this.updateIndexes(0);
         }
+        this.hasSkippedEmptyText = true;
     },
 
-    // private
-    initTab : function(item, index){
-        var before = this.strip.dom.childNodes[index];
-        var p = this.getTemplateArgs(item);
-        var el = before ?
-                 this.itemTpl.insertBefore(before, p) :
-                 this.itemTpl.append(this.strip, p);
-
-        Ext.fly(el).addClassOnOver('x-tab-strip-over');
-
-        if(item.tabTip){
-            Ext.fly(el).child('span.x-tab-strip-text', true).qtip = item.tabTip;
-        }
-        item.tabEl = el;
-
-        item.on('disable', this.onItemDisabled, this);
-        item.on('enable', this.onItemEnabled, this);
-        item.on('titlechange', this.onItemTitleChanged, this);
-        item.on('iconchange', this.onItemIconChanged, this);
-        item.on('beforeshow', this.onBeforeShowItem, this);
+    getTemplateTarget: function(){
+        return this.el;
     },
 
     /**
-     * <p>Provides template arguments for rendering a tab selector item in the tab strip.</p>
-     * <p>This method returns an object hash containing properties used by the TabPanel's <tt>{@link #itemTpl}</tt>
-     * to create a formatted, clickable tab selector element. The properties which must be returned
-     * are:</p><div class="mdetail-params"><ul>
-     * <li><b>id</b> : String<div class="sub-desc">A unique identifier which links to the item</div></li>
-     * <li><b>text</b> : String<div class="sub-desc">The text to display</div></li>
-     * <li><b>cls</b> : String<div class="sub-desc">The CSS class name</div></li>
-     * <li><b>iconCls</b> : String<div class="sub-desc">A CSS class to provide appearance for an icon.</div></li>
-     * </ul></div>
-     * @param {BoxComponent} item The {@link Ext.BoxComponent BoxComponent} for which to create a selector element in the tab strip.
-     * @return {Object} An object hash containing the properties required to render the selector element.
+     * Function which can be overridden to provide custom formatting for each Record that is used by this
+     * DataView's {@link #tpl template} to render each node.
+     * @param {Array/Object} data The raw data object that was used to create the Record.
+     * @param {Number} recordIndex the index number of the Record being prepared for rendering.
+     * @param {Record} record The Record being prepared for rendering.
+     * @return {Array/Object} The formatted data in a format expected by the internal {@link #tpl template}'s overwrite() method.
+     * (either an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}))
      */
-    getTemplateArgs : function(item) {
-        var cls = item.closable ? 'x-tab-strip-closable' : '';
-        if(item.disabled){
-            cls += ' x-item-disabled';
-        }
-        if(item.iconCls){
-            cls += ' x-tab-with-icon';
-        }
-        if(item.tabCls){
-            cls += ' ' + item.tabCls;
-        }
-
-        return {
-            id: this.id + this.idDelimiter + item.getItemId(),
-            text: item.title,
-            cls: cls,
-            iconCls: item.iconCls || ''
-        };
+    prepareData : function(data){
+        return data;
     },
 
-    // private
-    onAdd : function(tp, item, index){
-        this.initTab(item, index);
-        if(this.items.getCount() == 1){
-            this.syncSize();
+    /**
+     * <p>Function which can be overridden which returns the data object passed to this
+     * DataView's {@link #tpl template} to render the whole DataView.</p>
+     * <p>This is usually an Array of data objects, each element of which is processed by an
+     * {@link Ext.XTemplate XTemplate} which uses <tt>'&lt;tpl for="."&gt;'</tt> to iterate over its supplied
+     * data object as an Array. However, <i>named</i> properties may be placed into the data object to
+     * provide non-repeating data such as headings, totals etc.</p>
+     * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView.
+     * @param {Number} startIndex the index number of the Record being prepared for rendering.
+     * @return {Array} An Array of data objects to be processed by a repeating XTemplate. May also
+     * contain <i>named</i> properties.
+     */
+    collectData : function(records, startIndex){
+        var r = [];
+        for(var i = 0, len = records.length; i < len; i++){
+            r[r.length] = this.prepareData(records[i].data, startIndex+i, records[i]);
         }
-        this.delegateUpdates();
+        return r;
     },
 
     // private
-    onBeforeAdd : function(item){
-        var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item);
-        if(existing){
-            this.setActiveTab(item);
-            return false;
-        }
-        Ext.TabPanel.superclass.onBeforeAdd.apply(this, arguments);
-        var es = item.elements;
-        item.elements = es ? es.replace(',header', '') : es;
-        item.border = (item.border === true);
+    bufferRender : function(records){
+        var div = document.createElement('div');
+        this.tpl.overwrite(div, this.collectData(records));
+        return Ext.query(this.itemSelector, div);
     },
 
     // private
-    onRemove : function(tp, item){
-        Ext.destroy(Ext.get(this.getTabEl(item)));
-        this.stack.remove(item);
-        item.un('disable', this.onItemDisabled, this);
-        item.un('enable', this.onItemEnabled, this);
-        item.un('titlechange', this.onItemTitleChanged, this);
-        item.un('iconchange', this.onItemIconChanged, this);
-        item.un('beforeshow', this.onBeforeShowItem, this);
-        if(item == this.activeTab){
-            var next = this.stack.next();
-            if(next){
-                this.setActiveTab(next);
-            }else if(this.items.getCount() > 0){
-                this.setActiveTab(0);
-            }else{
-                this.activeTab = null;
-            }
-        }
-        this.delegateUpdates();
-    },
+    onUpdate : function(ds, record){
+        var index = this.store.indexOf(record);
+        if(index > -1){
+            var sel = this.isSelected(index);
+            var original = this.all.elements[index];
+            var node = this.bufferRender([record], index)[0];
 
-    // private
-    onBeforeShowItem : function(item){
-        if(item != this.activeTab){
-            this.setActiveTab(item);
-            return false;
+            this.all.replaceElement(index, node, true);
+            if(sel){
+                this.selected.replaceElement(original, node);
+                this.all.item(index).addClass(this.selectedClass);
+            }
+            this.updateIndexes(index, index);
         }
     },
 
     // private
-    onItemDisabled : function(item){
-        var el = this.getTabEl(item);
-        if(el){
-            Ext.fly(el).addClass('x-item-disabled');
+    onAdd : function(ds, records, index){
+        if(this.all.getCount() === 0){
+            this.refresh();
+            return;
         }
-        this.stack.remove(item);
-    },
-
-    // private
-    onItemEnabled : function(item){
-        var el = this.getTabEl(item);
-        if(el){
-            Ext.fly(el).removeClass('x-item-disabled');
+        var nodes = this.bufferRender(records, index), n, a = this.all.elements;
+        if(index < this.all.getCount()){
+            n = this.all.item(index).insertSibling(nodes, 'before', true);
+            a.splice.apply(a, [index, 0].concat(nodes));
+        }else{
+            n = this.all.last().insertSibling(nodes, 'after', true);
+            a.push.apply(a, nodes);
         }
+        this.updateIndexes(index);
     },
 
     // private
-    onItemTitleChanged : function(item){
-        var el = this.getTabEl(item);
-        if(el){
-            Ext.fly(el).child('span.x-tab-strip-text', true).innerHTML = item.title;
-        }
-    },
-
-    //private
-    onItemIconChanged : function(item, iconCls, oldCls){
-        var el = this.getTabEl(item);
-        if(el){
-            Ext.fly(el).child('span.x-tab-strip-text').replaceClass(oldCls, iconCls);
+    onRemove : function(ds, record, index){
+        this.deselect(index);
+        this.all.removeElement(index, true);
+        this.updateIndexes(index);
+        if (this.store.getCount() === 0){
+            this.refresh();
         }
     },
 
     /**
-     * Gets the DOM element for the tab strip item which activates the child panel with the specified
-     * ID. Access this to change the visual treatment of the item, for example by changing the CSS class name.
-     * @param {Panel/Number/String} tab The tab component, or the tab's index, or the tabs id or itemId.
-     * @return {HTMLElement} The DOM node
+     * Refreshes an individual node's data from the store.
+     * @param {Number} index The item's data index in the store
      */
-    getTabEl : function(item){
-        return document.getElementById(this.id + this.idDelimiter + this.getComponent(item).getItemId());
+    refreshNode : function(index){
+        this.onUpdate(this.store, this.store.getAt(index));
     },
 
     // private
-    onResize : function(){
-        Ext.TabPanel.superclass.onResize.apply(this, arguments);
-        this.delegateUpdates();
-    },
-
-    /**
-     * Suspends any internal calculations or scrolling while doing a bulk operation. See {@link #endUpdate}
-     */
-    beginUpdate : function(){
-        this.suspendUpdates = true;
+    updateIndexes : function(startIndex, endIndex){
+        var ns = this.all.elements;
+        startIndex = startIndex || 0;
+        endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));
+        for(var i = startIndex; i <= endIndex; i++){
+            ns[i].viewIndex = i;
+        }
     },
-
+    
     /**
-     * Resumes calculations and scrolling at the end of a bulk operation. See {@link #beginUpdate}
+     * Returns the store associated with this DataView.
+     * @return {Ext.data.Store} The store
      */
-    endUpdate : function(){
-        this.suspendUpdates = false;
-        this.delegateUpdates();
+    getStore : function(){
+        return this.store;
     },
 
     /**
-     * Hides the tab strip item for the passed tab
-     * @param {Number/String/Panel} item The tab index, id or item
+     * Changes the data store bound to this view and refreshes it.
+     * @param {Store} store The store to bind to this view
      */
-    hideTabStripItem : function(item){
-        item = this.getComponent(item);
-        var el = this.getTabEl(item);
-        if(el){
-            el.style.display = 'none';
-            this.delegateUpdates();
+    bindStore : function(store, initial){
+        if(!initial && this.store){
+            if(store !== this.store && this.store.autoDestroy){
+                this.store.destroy();
+            }else{
+                this.store.un("beforeload", this.onBeforeLoad, this);
+                this.store.un("datachanged", this.refresh, this);
+                this.store.un("add", this.onAdd, this);
+                this.store.un("remove", this.onRemove, this);
+                this.store.un("update", this.onUpdate, this);
+                this.store.un("clear", this.refresh, this);
+            }
+            if(!store){
+                this.store = null;
+            }
+        }
+        if(store){
+            store = Ext.StoreMgr.lookup(store);
+            store.on({
+                scope: this,
+                beforeload: this.onBeforeLoad,
+                datachanged: this.refresh,
+                add: this.onAdd,
+                remove: this.onRemove,
+                update: this.onUpdate,
+                clear: this.refresh
+            });
+        }
+        this.store = store;
+        if(store){
+            this.refresh();
         }
-        this.stack.remove(item);
     },
 
     /**
-     * Unhides the tab strip item for the passed tab
-     * @param {Number/String/Panel} item The tab index, id or item
+     * Returns the template node the passed child belongs to, or null if it doesn't belong to one.
+     * @param {HTMLElement} node
+     * @return {HTMLElement} The template node
      */
-    unhideTabStripItem : function(item){
-        item = this.getComponent(item);
-        var el = this.getTabEl(item);
-        if(el){
-            el.style.display = '';
-            this.delegateUpdates();
-        }
+    findItemFromChild : function(node){
+        return Ext.fly(node).findParent(this.itemSelector, this.getTemplateTarget());
     },
 
     // private
-    delegateUpdates : function(){
-        if(this.suspendUpdates){
-            return;
-        }
-        if(this.resizeTabs && this.rendered){
-            this.autoSizeTabs();
-        }
-        if(this.enableTabScroll && this.rendered){
-            this.autoScrollTabs();
+    onClick : function(e){
+        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
+        if(item){
+            var index = this.indexOf(item);
+            if(this.onItemClick(item, index, e) !== false){
+                this.fireEvent("click", this, index, item, e);
+            }
+        }else{
+            if(this.fireEvent("containerclick", this, e) !== false){
+                this.onContainerClick(e);
+            }
         }
     },
 
-    // private
-    autoSizeTabs : function(){
-        var count = this.items.length;
-        var ce = this.tabPosition != 'bottom' ? 'header' : 'footer';
-        var ow = this[ce].dom.offsetWidth;
-        var aw = this[ce].dom.clientWidth;
-
-        if(!this.resizeTabs || count < 1 || !aw){ // !aw for display:none
-            return;
-        }
-
-        var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); // -4 for float errors in IE
-        this.lastTabWidth = each;
-        var lis = this.strip.query("li:not([className^=x-tab-edge])");
-        for(var i = 0, len = lis.length; i < len; i++) {
-            var li = lis[i];
-            var inner = Ext.fly(li).child('.x-tab-strip-inner', true);
-            var tw = li.offsetWidth;
-            var iw = inner.offsetWidth;
-            inner.style.width = (each - (tw-iw)) + 'px';
-        }
+    onContainerClick : function(e){
+        this.clearSelections();
     },
 
     // private
-    adjustBodyWidth : function(w){
-        if(this.header){
-            this.header.setWidth(w);
-        }
-        if(this.footer){
-            this.footer.setWidth(w);
+    onContextMenu : function(e){
+        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
+        if(item){
+            this.fireEvent("contextmenu", this, this.indexOf(item), item, e);
+        }else{
+            this.fireEvent("containercontextmenu", this, e);
         }
-        return w;
     },
 
-    /**
-     * Sets the specified tab as the active tab. This method fires the {@link #beforetabchange} event which
-     * can <tt>return false</tt> to cancel the tab change.
-     * @param {String/Number} item
-     * The id or tab Panel to activate. This parameter may be any of the following:
-     * <div><ul class="mdetail-params">
-     * <li>a <b><tt>String</tt></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
-     * or <code>{@link Ext.Component#id id}</code> of the child component </li>
-     * <li>a <b><tt>Number</tt></b> : representing the position of the child component
-     * within the <code>{@link Ext.Container#items items}</code> <b>property</b></li>
-     * </ul></div>
-     * <p>For additional information see {@link Ext.util.MixedCollection#get}.
-     */
-    setActiveTab : function(item){
-        item = this.getComponent(item);
-        if(!item || this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
-            return;
-        }
-        if(!this.rendered){
-            this.activeTab = item;
-            return;
-        }
-        if(this.activeTab != item){
-            if(this.activeTab){
-                var oldEl = this.getTabEl(this.activeTab);
-                if(oldEl){
-                    Ext.fly(oldEl).removeClass('x-tab-strip-active');
-                }
-                this.activeTab.fireEvent('deactivate', this.activeTab);
-            }
-            var el = this.getTabEl(item);
-            Ext.fly(el).addClass('x-tab-strip-active');
-            this.activeTab = item;
-            this.stack.add(item);
-
-            this.layout.setActiveItem(item);
-            if(this.scrolling){
-                this.scrollToTab(item, this.animScroll);
-            }
-
-            item.fireEvent('activate', item);
-            this.fireEvent('tabchange', this, item);
+    // private
+    onDblClick : function(e){
+        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
+        if(item){
+            this.fireEvent("dblclick", this, this.indexOf(item), item, e);
         }
     },
 
-    /**
-     * Gets the currently active tab.
-     * @return {Panel} The active tab
-     */
-    getActiveTab : function(){
-        return this.activeTab || null;
-    },
-
-    /**
-     * Gets the specified tab by id.
-     * @param {String} id The tab id
-     * @return {Panel} The tab
-     */
-    getItem : function(item){
-        return this.getComponent(item);
+    // private
+    onMouseOver : function(e){
+        var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
+        if(item && item !== this.lastItem){
+            this.lastItem = item;
+            Ext.fly(item).addClass(this.overClass);
+            this.fireEvent("mouseenter", this, this.indexOf(item), item, e);
+        }
     },
 
     // private
-    autoScrollTabs : function(){
-        this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
-        var count = this.items.length;
-        var ow = this.pos.dom.offsetWidth;
-        var tw = this.pos.dom.clientWidth;
-
-        var wrap = this.stripWrap;
-        var wd = wrap.dom;
-        var cw = wd.offsetWidth;
-        var pos = this.getScrollPos();
-        var l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos;
-
-        if(!this.enableTabScroll || count < 1 || cw < 20){ // 20 to prevent display:none issues
-            return;
-        }
-        if(l <= tw){
-            wd.scrollLeft = 0;
-            wrap.setWidth(tw);
-            if(this.scrolling){
-                this.scrolling = false;
-                this.pos.removeClass('x-tab-scrolling');
-                this.scrollLeft.hide();
-                this.scrollRight.hide();
-                // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari
-                if(Ext.isAir || Ext.isWebKit){
-                    wd.style.marginLeft = '';
-                    wd.style.marginRight = '';
-                }
-            }
-        }else{
-            if(!this.scrolling){
-                this.pos.addClass('x-tab-scrolling');
-                // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari
-                if(Ext.isAir || Ext.isWebKit){
-                    wd.style.marginLeft = '18px';
-                    wd.style.marginRight = '18px';
-                }
-            }
-            tw -= wrap.getMargins('lr');
-            wrap.setWidth(tw > 20 ? tw : 20);
-            if(!this.scrolling){
-                if(!this.scrollLeft){
-                    this.createScrollers();
-                }else{
-                    this.scrollLeft.show();
-                    this.scrollRight.show();
-                }
-            }
-            this.scrolling = true;
-            if(pos > (l-tw)){ // ensure it stays within bounds
-                wd.scrollLeft = l-tw;
-            }else{ // otherwise, make sure the active tab is still visible
-                this.scrollToTab(this.activeTab, false);
+    onMouseOut : function(e){
+        if(this.lastItem){
+            if(!e.within(this.lastItem, true, true)){
+                Ext.fly(this.lastItem).removeClass(this.overClass);
+                this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e);
+                delete this.lastItem;
             }
-            this.updateScrollButtons();
         }
     },
 
     // private
-    createScrollers : function(){
-        this.pos.addClass('x-tab-scrolling-' + this.tabPosition);
-        var h = this.stripWrap.dom.offsetHeight;
-
-        // left
-        var sl = this.pos.insertFirst({
-            cls:'x-tab-scroller-left'
-        });
-        sl.setHeight(h);
-        sl.addClassOnOver('x-tab-scroller-left-over');
-        this.leftRepeater = new Ext.util.ClickRepeater(sl, {
-            interval : this.scrollRepeatInterval,
-            handler: this.onScrollLeft,
-            scope: this
-        });
-        this.scrollLeft = sl;
-
-        // right
-        var sr = this.pos.insertFirst({
-            cls:'x-tab-scroller-right'
-        });
-        sr.setHeight(h);
-        sr.addClassOnOver('x-tab-scroller-right-over');
-        this.rightRepeater = new Ext.util.ClickRepeater(sr, {
-            interval : this.scrollRepeatInterval,
-            handler: this.onScrollRight,
-            scope: this
-        });
-        this.scrollRight = sr;
+    onItemClick : function(item, index, e){
+        if(this.fireEvent("beforeclick", this, index, item, e) === false){
+            return false;
+        }
+        if(this.multiSelect){
+            this.doMultiSelection(item, index, e);
+            e.preventDefault();
+        }else if(this.singleSelect){
+            this.doSingleSelection(item, index, e);
+            e.preventDefault();
+        }
+        return true;
     },
 
     // private
-    getScrollWidth : function(){
-        return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos();
+    doSingleSelection : function(item, index, e){
+        if(e.ctrlKey && this.isSelected(index)){
+            this.deselect(index);
+        }else{
+            this.select(index, false);
+        }
     },
 
     // private
-    getScrollPos : function(){
-        return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0;
+    doMultiSelection : function(item, index, e){
+        if(e.shiftKey && this.last !== false){
+            var last = this.last;
+            this.selectRange(last, index, e.ctrlKey);
+            this.last = last; // reset the last
+        }else{
+            if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){
+                this.deselect(index);
+            }else{
+                this.select(index, e.ctrlKey || e.shiftKey || this.simpleSelect);
+            }
+        }
     },
 
-    // private
-    getScrollArea : function(){
-        return parseInt(this.stripWrap.dom.clientWidth, 10) || 0;
+    /**
+     * Gets the number of selected nodes.
+     * @return {Number} The node count
+     */
+    getSelectionCount : function(){
+        return this.selected.getCount();
     },
 
-    // private
-    getScrollAnim : function(){
-        return {duration:this.scrollDuration, callback: this.updateScrollButtons, scope: this};
+    /**
+     * Gets the currently selected nodes.
+     * @return {Array} An array of HTMLElements
+     */
+    getSelectedNodes : function(){
+        return this.selected.elements;
     },
 
-    // private
-    getScrollIncrement : function(){
-        return this.scrollIncrement || (this.resizeTabs ? this.lastTabWidth+2 : 100);
+    /**
+     * Gets the indexes of the selected nodes.
+     * @return {Array} An array of numeric indexes
+     */
+    getSelectedIndexes : function(){
+        var indexes = [], s = this.selected.elements;
+        for(var i = 0, len = s.length; i < len; i++){
+            indexes.push(s[i].viewIndex);
+        }
+        return indexes;
     },
 
     /**
-     * Scrolls to a particular tab if tab scrolling is enabled
-     * @param {Panel} item The item to scroll to
-     * @param {Boolean} animate True to enable animations
+     * Gets an array of the selected records
+     * @return {Array} An array of {@link Ext.data.Record} objects
      */
+    getSelectedRecords : function(){
+        var r = [], s = this.selected.elements;
+        for(var i = 0, len = s.length; i < len; i++){
+            r[r.length] = this.store.getAt(s[i].viewIndex);
+        }
+        return r;
+    },
 
-    scrollToTab : function(item, animate){
-        if(!item){ return; }
-        var el = this.getTabEl(item);
-        var pos = this.getScrollPos(), area = this.getScrollArea();
-        var left = Ext.fly(el).getOffsetsTo(this.stripWrap)[0] + pos;
-        var right = left + el.offsetWidth;
-        if(left < pos){
-            this.scrollTo(left, animate);
-        }else if(right > (pos + area)){
-            this.scrollTo(right - area, animate);
+    /**
+     * Gets an array of the records from an array of nodes
+     * @param {Array} nodes The nodes to evaluate
+     * @return {Array} records The {@link Ext.data.Record} objects
+     */
+    getRecords : function(nodes){
+        var r = [], s = nodes;
+        for(var i = 0, len = s.length; i < len; i++){
+            r[r.length] = this.store.getAt(s[i].viewIndex);
         }
+        return r;
     },
 
-    // private
-    scrollTo : function(pos, animate){
-        this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false);
-        if(!animate){
-            this.updateScrollButtons();
+    /**
+     * Gets a record from a node
+     * @param {HTMLElement} node The node to evaluate
+     * @return {Record} record The {@link Ext.data.Record} object
+     */
+    getRecord : function(node){
+        return this.store.getAt(node.viewIndex);
+    },
+
+    /**
+     * Clears all selections.
+     * @param {Boolean} suppressEvent (optional) True to skip firing of the selectionchange event
+     */
+    clearSelections : function(suppressEvent, skipUpdate){
+        if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){
+            if(!skipUpdate){
+                this.selected.removeClass(this.selectedClass);
+            }
+            this.selected.clear();
+            this.last = false;
+            if(!suppressEvent){
+                this.fireEvent("selectionchange", this, this.selected.elements);
+            }
         }
     },
 
-    onWheel : function(e){
-        var d = e.getWheelDelta()*this.wheelIncrement*-1;
-        e.stopEvent();
+    /**
+     * Returns true if the passed node is selected, else false.
+     * @param {HTMLElement/Number} node The node or node index to check
+     * @return {Boolean} True if selected, else false
+     */
+    isSelected : function(node){
+        return this.selected.contains(this.getNode(node));
+    },
 
-        var pos = this.getScrollPos();
-        var newpos = pos + d;
-        var sw = this.getScrollWidth()-this.getScrollArea();
+    /**
+     * Deselects a node.
+     * @param {HTMLElement/Number} node The node to deselect
+     */
+    deselect : function(node){
+        if(this.isSelected(node)){
+            node = this.getNode(node);
+            this.selected.removeElement(node);
+            if(this.last == node.viewIndex){
+                this.last = false;
+            }
+            Ext.fly(node).removeClass(this.selectedClass);
+            this.fireEvent("selectionchange", this, this.selected.elements);
+        }
+    },
 
-        var s = Math.max(0, Math.min(sw, newpos));
-        if(s != pos){
-            this.scrollTo(s, false);
+    /**
+     * Selects a set of nodes.
+     * @param {Array/HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node,
+     * id of a template node or an array of any of those to select
+     * @param {Boolean} keepExisting (optional) true to keep existing selections
+     * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent
+     */
+    select : function(nodeInfo, keepExisting, suppressEvent){
+        if(Ext.isArray(nodeInfo)){
+            if(!keepExisting){
+                this.clearSelections(true);
+            }
+            for(var i = 0, len = nodeInfo.length; i < len; i++){
+                this.select(nodeInfo[i], true, true);
+            }
+            if(!suppressEvent){
+                this.fireEvent("selectionchange", this, this.selected.elements);
+            }
+        } else{
+            var node = this.getNode(nodeInfo);
+            if(!keepExisting){
+                this.clearSelections(true);
+            }
+            if(node && !this.isSelected(node)){
+                if(this.fireEvent("beforeselect", this, node, this.selected.elements) !== false){
+                    Ext.fly(node).addClass(this.selectedClass);
+                    this.selected.add(node);
+                    this.last = node.viewIndex;
+                    if(!suppressEvent){
+                        this.fireEvent("selectionchange", this, this.selected.elements);
+                    }
+                }
+            }
         }
     },
 
-    // private
-    onScrollRight : function(){
-        var sw = this.getScrollWidth()-this.getScrollArea();
-        var pos = this.getScrollPos();
-        var s = Math.min(sw, pos + this.getScrollIncrement());
-        if(s != pos){
-            this.scrollTo(s, this.animScroll);
+    /**
+     * Selects a range of nodes. All nodes between start and end are selected.
+     * @param {Number} start The index of the first node in the range
+     * @param {Number} end The index of the last node in the range
+     * @param {Boolean} keepExisting (optional) True to retain existing selections
+     */
+    selectRange : function(start, end, keepExisting){
+        if(!keepExisting){
+            this.clearSelections(true);
         }
+        this.select(this.getNodes(start, end), true);
     },
 
-    // private
-    onScrollLeft : function(){
-        var pos = this.getScrollPos();
-        var s = Math.max(0, pos - this.getScrollIncrement());
-        if(s != pos){
-            this.scrollTo(s, this.animScroll);
+    /**
+     * Gets a template node.
+     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+     * @return {HTMLElement} The node or null if it wasn't found
+     */
+    getNode : function(nodeInfo){
+        if(Ext.isString(nodeInfo)){
+            return document.getElementById(nodeInfo);
+        }else if(Ext.isNumber(nodeInfo)){
+            return this.all.elements[nodeInfo];
         }
+        return nodeInfo;
     },
 
-    // private
-    updateScrollButtons : function(){
-        var pos = this.getScrollPos();
-        this.scrollLeft[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled');
-        this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled');
+    /**
+     * Gets a range nodes.
+     * @param {Number} start (optional) The index of the first node in the range
+     * @param {Number} end (optional) The index of the last node in the range
+     * @return {Array} An array of nodes
+     */
+    getNodes : function(start, end){
+        var ns = this.all.elements;
+        start = start || 0;
+        end = !Ext.isDefined(end) ? Math.max(ns.length - 1, 0) : end;
+        var nodes = [], i;
+        if(start <= end){
+            for(i = start; i <= end && ns[i]; i++){
+                nodes.push(ns[i]);
+            }
+        } else{
+            for(i = start; i >= end && ns[i]; i--){
+                nodes.push(ns[i]);
+            }
+        }
+        return nodes;
     },
 
-    // private
-    beforeDestroy : function() {
-        if(this.items){
-            this.items.each(function(item){
-                if(item && item.tabEl){
-                    Ext.get(item.tabEl).removeAllListeners();
-                    item.tabEl = null;
-                }
-            }, this);
+    /**
+     * Finds the index of the passed node.
+     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+     * @return {Number} The index of the node or -1
+     */
+    indexOf : function(node){
+        node = this.getNode(node);
+        if(Ext.isNumber(node.viewIndex)){
+            return node.viewIndex;
         }
-        if(this.strip){
-            this.strip.removeAllListeners();
+        return this.all.indexOf(node);
+    },
+
+    // private
+    onBeforeLoad : function(){
+        if(this.loadingText){
+            this.clearSelections(false, true);
+            this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+'</div>');
+            this.all.clear();
         }
-        Ext.TabPanel.superclass.beforeDestroy.apply(this);
+    },
+
+    onDestroy : function(){
+        this.all.clear();
+        this.selected.clear();
+        Ext.DataView.superclass.onDestroy.call(this);
+        this.bindStore(null);
     }
+});
 
+/**
+ * Changes the data store bound to this view and refreshes it. (deprecated in favor of bindStore)
+ * @param {Store} store The store to bind to this view
+ */
+Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore;
+
+Ext.reg('dataview', Ext.DataView);
+/**\r
+ * @class Ext.list.ListView\r
+ * @extends Ext.DataView\r
+ * <p>Ext.list.ListView is a fast and light-weight implentation of a\r
+ * {@link Ext.grid.GridPanel Grid} like view with the following characteristics:</p>\r
+ * <div class="mdetail-params"><ul>\r
+ * <li>resizable columns</li>\r
+ * <li>selectable</li>\r
+ * <li>column widths are initially proportioned by percentage based on the container\r
+ * width and number of columns</li>\r
+ * <li>uses templates to render the data in any required format</li>\r
+ * <li>no horizontal scrolling</li>\r
+ * <li>no editing</li>\r
+ * </ul></div>\r
+ * <p>Example usage:</p>\r
+ * <pre><code>\r
+// consume JSON of this form:\r
+{\r
+   "images":[\r
+      {\r
+         "name":"dance_fever.jpg",\r
+         "size":2067,\r
+         "lastmod":1236974993000,\r
+         "url":"images\/thumbs\/dance_fever.jpg"\r
+      },\r
+      {\r
+         "name":"zack_sink.jpg",\r
+         "size":2303,\r
+         "lastmod":1236974993000,\r
+         "url":"images\/thumbs\/zack_sink.jpg"\r
+      }\r
+   ]\r
+} \r
+var store = new Ext.data.JsonStore({\r
+    url: 'get-images.php',\r
+    root: 'images',\r
+    fields: [\r
+        'name', 'url',\r
+        {name:'size', type: 'float'},\r
+        {name:'lastmod', type:'date', dateFormat:'timestamp'}\r
+    ]\r
+});\r
+store.load();\r
+\r
+var listView = new Ext.list.ListView({\r
+    store: store,\r
+    multiSelect: true,\r
+    emptyText: 'No images to display',\r
+    reserveScrollOffset: true,\r
+    columns: [{\r
+        header: 'File',\r
+        width: .5,\r
+        dataIndex: 'name'\r
+    },{\r
+        header: 'Last Modified',\r
+        width: .35, \r
+        dataIndex: 'lastmod',\r
+        tpl: '{lastmod:date("m-d h:i a")}'\r
+    },{\r
+        header: 'Size',\r
+        dataIndex: 'size',\r
+        tpl: '{size:fileSize}', // format using Ext.util.Format.fileSize()\r
+        align: 'right'\r
+    }]\r
+});\r
+\r
+// put it in a Panel so it looks pretty\r
+var panel = new Ext.Panel({\r
+    id:'images-view',\r
+    width:425,\r
+    height:250,\r
+    collapsible:true,\r
+    layout:'fit',\r
+    title:'Simple ListView <i>(0 items selected)</i>',\r
+    items: listView\r
+});\r
+panel.render(document.body);\r
+\r
+// little bit of feedback\r
+listView.on('selectionchange', function(view, nodes){\r
+    var l = nodes.length;\r
+    var s = l != 1 ? 's' : '';\r
+    panel.setTitle('Simple ListView <i>('+l+' item'+s+' selected)</i>');\r
+});\r
+ * </code></pre>\r
+ * @constructor\r
+ * @param {Object} config\r
+ * @xtype listview\r
+ */\r
+Ext.list.ListView = Ext.extend(Ext.DataView, {\r
+    /**\r
+     * Set this property to <tt>true</tt> to disable the header click handler disabling sort\r
+     * (defaults to <tt>false</tt>).\r
+     * @type Boolean\r
+     * @property disableHeaders\r
+     */\r
+    /**\r
+     * @cfg {Boolean} hideHeaders\r
+     * <tt>true</tt> to hide the {@link #internalTpl header row} (defaults to <tt>false</tt> so\r
+     * the {@link #internalTpl header row} will be shown).\r
+     */\r
+    /**\r
+     * @cfg {String} itemSelector\r
+     * Defaults to <tt>'dl'</tt> to work with the preconfigured <b><tt>{@link Ext.DataView#tpl tpl}</tt></b>.\r
+     * This setting specifies the CSS selector (e.g. <tt>div.some-class</tt> or <tt>span:first-child</tt>)\r
+     * that will be used to determine what nodes the ListView will be working with.   \r
+     */\r
+    itemSelector: 'dl',\r
+    /**\r
+     * @cfg {String} selectedClass The CSS class applied to a selected row (defaults to\r
+     * <tt>'x-list-selected'</tt>). An example overriding the default styling:\r
+    <pre><code>\r
+    .x-list-selected {background-color: yellow;}\r
+    </code></pre>\r
+     * @type String\r
+     */\r
+    selectedClass:'x-list-selected',\r
+    /**\r
+     * @cfg {String} overClass The CSS class applied when over a row (defaults to\r
+     * <tt>'x-list-over'</tt>). An example overriding the default styling:\r
+    <pre><code>\r
+    .x-list-over {background-color: orange;}\r
+    </code></pre>\r
+     * @type String\r
+     */\r
+    overClass:'x-list-over',\r
+    /**\r
+     * @cfg {Boolean} reserveScrollOffset\r
+     * By default will defer accounting for the configured <b><tt>{@link #scrollOffset}</tt></b>\r
+     * for 10 milliseconds.  Specify <tt>true</tt> to account for the configured\r
+     * <b><tt>{@link #scrollOffset}</tt></b> immediately.\r
+     */\r
+    /**\r
+     * @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to\r
+     * <tt>undefined</tt>). If an explicit value isn't specified, this will be automatically\r
+     * calculated.\r
+     */\r
+    scrollOffset : undefined,\r
+    /**\r
+     * @cfg {Boolean/Object} columnResize\r
+     * Specify <tt>true</tt> or specify a configuration object for {@link Ext.list.ListView.ColumnResizer}\r
+     * to enable the columns to be resizable (defaults to <tt>true</tt>).\r
+     */\r
+    columnResize: true,\r
+    /**\r
+     * @cfg {Array} columns An array of column configuration objects, for example:\r
+     * <pre><code>\r
+{\r
+    align: 'right',\r
+    dataIndex: 'size',\r
+    header: 'Size',\r
+    tpl: '{size:fileSize}',\r
+    width: .35\r
+}\r
+     * </code></pre> \r
+     * Acceptable properties for each column configuration object are:\r
+     * <div class="mdetail-params"><ul>\r
+     * <li><b><tt>align</tt></b> : String<div class="sub-desc">Set the CSS text-align property\r
+     * of the column. Defaults to <tt>'left'</tt>.</div></li>\r
+     * <li><b><tt>dataIndex</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.\r
+     * {@link Ext.grid.Column#dataIndex dataIndex} for details.</div></li>\r
+     * <li><b><tt>header</tt></b> : String<div class="sub-desc">See {@link Ext.grid.Column}.\r
+     * {@link Ext.grid.Column#header header} for details.</div></li>\r
+     * <li><b><tt>tpl</tt></b> : String<div class="sub-desc">Specify a string to pass as the\r
+     * configuration string for {@link Ext.XTemplate}.  By default an {@link Ext.XTemplate}\r
+     * will be implicitly created using the <tt>dataIndex</tt>.</div></li>\r
+     * <li><b><tt>width</tt></b> : Number<div class="sub-desc">Percentage of the container width\r
+     * this column should be allocated.  Columns that have no width specified will be\r
+     * allocated with an equal percentage to fill 100% of the container width.  To easily take\r
+     * advantage of the full container width, leave the width of at least one column undefined.\r
+     * Note that if you do not want to take up the full width of the container, the width of\r
+     * every column needs to be explicitly defined.</div></li>\r
+     * </ul></div>\r
+     */\r
+    /**\r
+     * @cfg {Boolean/Object} columnSort\r
+     * Specify <tt>true</tt> or specify a configuration object for {@link Ext.list.ListView.Sorter}\r
+     * to enable the columns to be sortable (defaults to <tt>true</tt>).\r
+     */\r
+    columnSort: true,\r
+    /**\r
+     * @cfg {String/Array} internalTpl\r
+     * The template to be used for the header row.  See {@link #tpl} for more details.\r
+     */\r
+\r
+    /*\r
+     * IE has issues when setting percentage based widths to 100%. Default to 99.\r
+     */\r
+    maxWidth: Ext.isIE ? 99 : 100,\r
+    \r
+    initComponent : function(){\r
+        if(this.columnResize){\r
+            this.colResizer = new Ext.list.ColumnResizer(this.colResizer);\r
+            this.colResizer.init(this);\r
+        }\r
+        if(this.columnSort){\r
+            this.colSorter = new Ext.list.Sorter(this.columnSort);\r
+            this.colSorter.init(this);\r
+        }\r
+        if(!this.internalTpl){\r
+            this.internalTpl = new Ext.XTemplate(\r
+                '<div class="x-list-header"><div class="x-list-header-inner">',\r
+                    '<tpl for="columns">',\r
+                    '<div style="width:{[values.width*100]}%;text-align:{align};"><em unselectable="on" id="',this.id, '-xlhd-{#}">',\r
+                        '{header}',\r
+                    '</em></div>',\r
+                    '</tpl>',\r
+                    '<div class="x-clear"></div>',\r
+                '</div></div>',\r
+                '<div class="x-list-body"><div class="x-list-body-inner">',\r
+                '</div></div>'\r
+            );\r
+        }\r
+        if(!this.tpl){\r
+            this.tpl = new Ext.XTemplate(\r
+                '<tpl for="rows">',\r
+                    '<dl>',\r
+                        '<tpl for="parent.columns">',\r
+                        '<dt style="width:{[values.width*100]}%;text-align:{align};">',\r
+                        '<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',\r
+                            '{[values.tpl.apply(parent)]}',\r
+                        '</em></dt>',\r
+                        '</tpl>',\r
+                        '<div class="x-clear"></div>',\r
+                    '</dl>',\r
+                '</tpl>'\r
+            );\r
+        };\r
+        \r
+        var cs = this.columns, \r
+            allocatedWidth = 0, \r
+            colsWithWidth = 0, \r
+            len = cs.length, \r
+            columns = [];\r
+            \r
+        for(var i = 0; i < len; i++){\r
+            var c = cs[i];\r
+            if(!c.isColumn) {\r
+                c.xtype = c.xtype ? (/^lv/.test(c.xtype) ? c.xtype : 'lv' + c.xtype) : 'lvcolumn';\r
+                c = Ext.create(c);\r
+            }\r
+            if(c.width) {\r
+                allocatedWidth += c.width*100;\r
+                colsWithWidth++;\r
+            }\r
+            columns.push(c);\r
+        }\r
+        \r
+        cs = this.columns = columns;\r
+        \r
+        // auto calculate missing column widths\r
+        if(colsWithWidth < len){\r
+            var remaining = len - colsWithWidth;\r
+            if(allocatedWidth < this.maxWidth){\r
+                var perCol = ((this.maxWidth-allocatedWidth) / remaining)/100;\r
+                for(var j = 0; j < len; j++){\r
+                    var c = cs[j];\r
+                    if(!c.width){\r
+                        c.width = perCol;\r
+                    }\r
+                }\r
+            }\r
+        }\r
+        Ext.list.ListView.superclass.initComponent.call(this);\r
+    },\r
+\r
+    onRender : function(){\r
+        this.autoEl = {\r
+            cls: 'x-list-wrap'  \r
+        };\r
+        Ext.list.ListView.superclass.onRender.apply(this, arguments);\r
+\r
+        this.internalTpl.overwrite(this.el, {columns: this.columns});\r
+        \r
+        this.innerBody = Ext.get(this.el.dom.childNodes[1].firstChild);\r
+        this.innerHd = Ext.get(this.el.dom.firstChild.firstChild);\r
+\r
+        if(this.hideHeaders){\r
+            this.el.dom.firstChild.style.display = 'none';\r
+        }\r
+    },\r
+\r
+    getTemplateTarget : function(){\r
+        return this.innerBody;\r
+    },\r
+\r
+    /**\r
+     * <p>Function which can be overridden which returns the data object passed to this\r
+     * view's {@link #tpl template} to render the whole ListView. The returned object \r
+     * shall contain the following properties:</p>\r
+     * <div class="mdetail-params"><ul>\r
+     * <li><b>columns</b> : String<div class="sub-desc">See <tt>{@link #columns}</tt></div></li>\r
+     * <li><b>rows</b> : String<div class="sub-desc">See\r
+     * <tt>{@link Ext.DataView}.{@link Ext.DataView#collectData collectData}</div></li>\r
+     * </ul></div>\r
+     * @param {Array} records An Array of {@link Ext.data.Record}s to be rendered into the DataView.\r
+     * @param {Number} startIndex the index number of the Record being prepared for rendering.\r
+     * @return {Object} A data object containing properties to be processed by a repeating\r
+     * XTemplate as described above.\r
+     */\r
+    collectData : function(){\r
+        var rs = Ext.list.ListView.superclass.collectData.apply(this, arguments);\r
+        return {\r
+            columns: this.columns,\r
+            rows: rs\r
+        }\r
+    },\r
+\r
+    verifyInternalSize : function(){\r
+        if(this.lastSize){\r
+            this.onResize(this.lastSize.width, this.lastSize.height);\r
+        }\r
+    },\r
+\r
+    // private\r
+    onResize : function(w, h){\r
+        var bd = this.innerBody.dom;\r
+        var hd = this.innerHd.dom\r
+        if(!bd){\r
+            return;\r
+        }\r
+        var bdp = bd.parentNode;\r
+        if(Ext.isNumber(w)){\r
+            var sw = w - Ext.num(this.scrollOffset, Ext.getScrollBarWidth());\r
+            if(this.reserveScrollOffset || ((bdp.offsetWidth - bdp.clientWidth) > 10)){\r
+                bd.style.width = sw + 'px';\r
+                hd.style.width = sw + 'px';\r
+            }else{\r
+                bd.style.width = w + 'px';\r
+                hd.style.width = w + 'px';\r
+                setTimeout(function(){\r
+                    if((bdp.offsetWidth - bdp.clientWidth) > 10){\r
+                        bd.style.width = sw + 'px';\r
+                        hd.style.width = sw + 'px';\r
+                    }\r
+                }, 10);\r
+            }\r
+        }\r
+        if(Ext.isNumber(h)){\r
+            bdp.style.height = (h - hd.parentNode.offsetHeight) + 'px';\r
+        }\r
+    },\r
+\r
+    updateIndexes : function(){\r
+        Ext.list.ListView.superclass.updateIndexes.apply(this, arguments);\r
+        this.verifyInternalSize();\r
+    },\r
+\r
+    findHeaderIndex : function(hd){\r
+        hd = hd.dom || hd;\r
+        var pn = hd.parentNode, cs = pn.parentNode.childNodes;\r
+        for(var i = 0, c; c = cs[i]; i++){\r
+            if(c == pn){\r
+                return i;\r
+            }\r
+        }\r
+        return -1;\r
+    },\r
+\r
+    setHdWidths : function(){\r
+        var els = this.innerHd.dom.getElementsByTagName('div');\r
+        for(var i = 0, cs = this.columns, len = cs.length; i < len; i++){\r
+            els[i].style.width = (cs[i].width*100) + '%';\r
+        }\r
+    }\r
+});\r
+\r
+Ext.reg('listview', Ext.list.ListView);\r
+\r
+// Backwards compatibility alias\r
+Ext.ListView = Ext.list.ListView;/**
+ * @class Ext.list.Column
+ * <p>This class encapsulates column configuration data to be used in the initialization of a
+ * {@link Ext.list.ListView ListView}.</p>
+ * <p>While subclasses are provided to render data in different ways, this class renders a passed
+ * data field unchanged and is usually used for textual columns.</p>
+ */
+Ext.list.Column = Ext.extend(Object, {
     /**
-     * @cfg {Boolean} collapsible
-     * @hide
-     */
-    /**
-     * @cfg {String} header
-     * @hide
+     * @private
+     * @cfg {Boolean} isColumn
+     * Used by ListView constructor method to avoid reprocessing a Column
+     * if <code>isColumn</code> is not set ListView will recreate a new Ext.list.Column
+     * Defaults to true.
      */
+    isColumn: true,
+    
     /**
-     * @cfg {Boolean} headerAsText
-     * @hide
-     */
+     * @cfg {String} align
+     * Set the CSS text-align property of the column. Defaults to <tt>'left'</tt>.
+     */        
+    align: 'left',
     /**
-     * @property header
-     * @hide
-     */
+     * @cfg {String} header Optional. The header text to be used as innerHTML
+     * (html tags are accepted) to display in the ListView.  <b>Note</b>: to
+     * have a clickable header with no text displayed use <tt>'&#160;'</tt>.
+     */    
+    header: '',
+    
     /**
-     * @property title
-     * @hide
-     */
+     * @cfg {Number} width Optional. Percentage of the container width
+     * this column should be allocated.  Columns that have no width specified will be
+     * allocated with an equal percentage to fill 100% of the container width.  To easily take
+     * advantage of the full container width, leave the width of at least one column undefined.
+     * Note that if you do not want to take up the full width of the container, the width of
+     * every column needs to be explicitly defined.
+     */    
+    width: null,
+
     /**
-     * @cfg {Array} tools
-     * @hide
+     * @cfg {String} cls Optional. This option can be used to add a CSS class to the cell of each
+     * row for this column.
      */
+    cls: '',
+    
     /**
-     * @cfg {Array} toolTemplate
-     * @hide
+     * @cfg {String} tpl Optional. Specify a string to pass as the
+     * configuration string for {@link Ext.XTemplate}.  By default an {@link Ext.XTemplate}
+     * will be implicitly created using the <tt>dataIndex</tt>.
      */
+
     /**
-     * @cfg {Boolean} hideCollapseTool
-     * @hide
+     * @cfg {String} dataIndex <p><b>Required</b>. The name of the field in the
+     * ListViews's {@link Ext.data.Store}'s {@link Ext.data.Record} definition from
+     * which to draw the column's value.</p>
      */
+    
+    constructor : function(c){
+        if(!c.tpl){
+            c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}');
+        }
+        else if(Ext.isString(c.tpl)){
+            c.tpl = new Ext.XTemplate(c.tpl);
+        }
+        
+        Ext.apply(this, c);
+    }
+});
+
+Ext.reg('lvcolumn', Ext.list.Column);
+
+/**
+ * @class Ext.list.NumberColumn
+ * @extends Ext.list.Column
+ * <p>A Column definition class which renders a numeric data field according to a {@link #format} string.  See the
+ * {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column} for more details.</p>
+ */
+Ext.list.NumberColumn = Ext.extend(Ext.list.Column, {
     /**
-     * @cfg {Boolean} titleCollapse
-     * @hide
-     */
+     * @cfg {String} format
+     * A formatting string as used by {@link Ext.util.Format#number} to format a numeric value for this Column
+     * (defaults to <tt>'0,000.00'</tt>).
+     */    
+    format: '0,000.00',
+    
+    constructor : function(c) {
+        c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':number("' + (c.format || this.format) + '")}');       
+        Ext.list.NumberColumn.superclass.constructor.call(this, c);
+    }
+});
+
+Ext.reg('lvnumbercolumn', Ext.list.NumberColumn);
+
+/**
+ * @class Ext.list.DateColumn
+ * @extends Ext.list.Column
+ * <p>A Column definition class which renders a passed date according to the default locale, or a configured
+ * {@link #format}. See the {@link Ext.list.Column#xtype xtype} config option of {@link Ext.list.Column}
+ * for more details.</p>
+ */
+Ext.list.DateColumn = Ext.extend(Ext.list.Column, {
+    format: 'm/d/Y',
+    constructor : function(c) {
+        c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':date("' + (c.format || this.format) + '")}');      
+        Ext.list.DateColumn.superclass.constructor.call(this, c);
+    }
+});
+Ext.reg('lvdatecolumn', Ext.list.DateColumn);
+
+/**
+ * @class Ext.list.BooleanColumn
+ * @extends Ext.list.Column
+ * <p>A Column definition class which renders boolean data fields.  See the {@link Ext.list.Column#xtype xtype}
+ * config option of {@link Ext.list.Column} for more details.</p>
+ */
+Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, {
     /**
-     * @cfg {Boolean} collapsed
-     * @hide
+     * @cfg {String} trueText
+     * The string returned by the renderer when the column value is not falsey (defaults to <tt>'true'</tt>).
      */
+    trueText: 'true',
     /**
-     * @cfg {String} layout
-     * @hide
+     * @cfg {String} falseText
+     * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
+     * <tt>'false'</tt>).
      */
+    falseText: 'false',
     /**
-     * @cfg {Boolean} preventBodyReset
-     * @hide
+     * @cfg {String} undefinedText
+     * The string returned by the renderer when the column value is undefined (defaults to <tt>'&#160;'</tt>).
      */
-});
-Ext.reg('tabpanel', Ext.TabPanel);
-
-/**
- * See {@link #setActiveTab}. Sets the specified tab as the active tab. This method fires
- * the {@link #beforetabchange} event which can <tt>return false</tt> to cancel the tab change.
- * @param {String/Panel} tab The id or tab Panel to activate
- * @method activate
- */
-Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab;
-
-// private utility class used by TabPanel
-Ext.TabPanel.AccessStack = function(){
-    var items = [];
-    return {
-        add : function(item){
-            items.push(item);
-            if(items.length > 10){
-                items.shift();
+    undefinedText: '&#160;',
+    
+    constructor : function(c) {
+        c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
+        
+        var t = this.trueText, f = this.falseText, u = this.undefinedText;
+        c.tpl.format = function(v){
+            if(v === undefined){
+                return u;
             }
-        },
-
-        remove : function(item){
-            var s = [];
-            for(var i = 0, len = items.length; i < len; i++) {
-                if(items[i] != item){
-                    s.push(items[i]);
-                }
+            if(!v || v === 'false'){
+                return f;
             }
-            items = s;
-        },
+            return t;
+        };
+        
+        Ext.list.DateColumn.superclass.constructor.call(this, c);
+    }
+});
 
-        next : function(){
-            return items.pop();
-        }
-    };
-};/**
- * @class Ext.Button
- * @extends Ext.BoxComponent
- * Simple Button class
- * @cfg {String} text The button text to be used as innerHTML (html tags are accepted)
- * @cfg {String} icon The path to an image to display in the button (the image will be set as the background-image
- * CSS property of the button by default, so if you want a mixed icon/text button, set cls:'x-btn-text-icon')
- * @cfg {Function} handler A function called when the button is clicked (can be used instead of click event).
- * The handler is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><code>b</code> : Button<div class="sub-desc">This Button.</div></li>
- * <li><code>e</code> : EventObject<div class="sub-desc">The click event.</div></li>
+Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn);/**\r
+ * @class Ext.list.ColumnResizer\r
+ * @extends Ext.util.Observable\r
+ * <p>Supporting Class for Ext.list.ListView</p>\r
+ * @constructor\r
+ * @param {Object} config\r
+ */\r
+Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {\r
+    /**\r
+     * @cfg {Number} minPct The minimum percentage to allot for any column (defaults to <tt>.05</tt>)\r
+     */\r
+    minPct: .05,\r
+\r
+    constructor: function(config){\r
+        Ext.apply(this, config);\r
+        Ext.list.ColumnResizer.superclass.constructor.call(this);\r
+    },\r
+    init : function(listView){\r
+        this.view = listView;\r
+        listView.on('render', this.initEvents, this);\r
+    },\r
+\r
+    initEvents : function(view){\r
+        view.mon(view.innerHd, 'mousemove', this.handleHdMove, this);\r
+        this.tracker = new Ext.dd.DragTracker({\r
+            onBeforeStart: this.onBeforeStart.createDelegate(this),\r
+            onStart: this.onStart.createDelegate(this),\r
+            onDrag: this.onDrag.createDelegate(this),\r
+            onEnd: this.onEnd.createDelegate(this),\r
+            tolerance: 3,\r
+            autoStart: 300\r
+        });\r
+        this.tracker.initEl(view.innerHd);\r
+        view.on('beforedestroy', this.tracker.destroy, this.tracker);\r
+    },\r
+\r
+    handleHdMove : function(e, t){\r
+        var hw = 5,\r
+            x = e.getPageX(),\r
+            hd = e.getTarget('em', 3, true);\r
+        if(hd){\r
+            var r = hd.getRegion(),\r
+                ss = hd.dom.style,\r
+                pn = hd.dom.parentNode;\r
+\r
+            if(x - r.left <= hw && pn != pn.parentNode.firstChild){\r
+                this.activeHd = Ext.get(pn.previousSibling.firstChild);\r
+                ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';\r
+            } else if(r.right - x <= hw && pn != pn.parentNode.lastChild.previousSibling){\r
+                this.activeHd = hd;\r
+                ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';\r
+            } else{\r
+                delete this.activeHd;\r
+                ss.cursor = '';\r
+            }\r
+        }\r
+    },\r
+\r
+    onBeforeStart : function(e){\r
+        this.dragHd = this.activeHd;\r
+        return !!this.dragHd;\r
+    },\r
+\r
+    onStart: function(e){\r
+        this.view.disableHeaders = true;\r
+        this.proxy = this.view.el.createChild({cls:'x-list-resizer'});\r
+        this.proxy.setHeight(this.view.el.getHeight());\r
+\r
+        var x = this.tracker.getXY()[0],\r
+            w = this.view.innerHd.getWidth();\r
+\r
+        this.hdX = this.dragHd.getX();\r
+        this.hdIndex = this.view.findHeaderIndex(this.dragHd);\r
+\r
+        this.proxy.setX(this.hdX);\r
+        this.proxy.setWidth(x-this.hdX);\r
+\r
+        this.minWidth = w*this.minPct;\r
+        this.maxWidth = w - (this.minWidth*(this.view.columns.length-1-this.hdIndex));\r
+    },\r
+\r
+    onDrag: function(e){\r
+        var cursorX = this.tracker.getXY()[0];\r
+        this.proxy.setWidth((cursorX-this.hdX).constrain(this.minWidth, this.maxWidth));\r
+    },\r
+\r
+    onEnd: function(e){\r
+        /* calculate desired width by measuring proxy and then remove it */\r
+        var nw = this.proxy.getWidth();\r
+        this.proxy.remove();\r
+\r
+        var index = this.hdIndex,\r
+            vw = this.view,\r
+            cs = vw.columns,\r
+            len = cs.length,\r
+            w = this.view.innerHd.getWidth(),\r
+            minPct = this.minPct * 100,\r
+            pct = Math.ceil((nw * vw.maxWidth) / w),\r
+            diff = (cs[index].width * 100) - pct,\r
+            each = Math.floor(diff / (len-1-index)),\r
+            mod = diff - (each * (len-1-index));\r
+\r
+        for(var i = index+1; i < len; i++){\r
+            var cw = (cs[i].width * 100) + each,\r
+                ncw = Math.max(minPct, cw);\r
+            if(cw != ncw){\r
+                mod += cw - ncw;\r
+            }\r
+            cs[i].width = ncw / 100;\r
+        }\r
+        cs[index].width = pct / 100;\r
+        cs[index+1].width += (mod / 100);\r
+        delete this.dragHd;\r
+        vw.setHdWidths();\r
+        vw.refresh();\r
+        setTimeout(function(){\r
+            vw.disableHeaders = false;\r
+        }, 100);\r
+    }\r
+});\r
+\r
+// Backwards compatibility alias\r
+Ext.ListView.ColumnResizer = Ext.list.ColumnResizer;/**\r
+ * @class Ext.list.Sorter\r
+ * @extends Ext.util.Observable\r
+ * <p>Supporting Class for Ext.list.ListView</p>\r
+ * @constructor\r
+ * @param {Object} config\r
+ */\r
+Ext.list.Sorter = Ext.extend(Ext.util.Observable, {\r
+    /**\r
+     * @cfg {Array} sortClasses\r
+     * The CSS classes applied to a header when it is sorted. (defaults to <tt>["sort-asc", "sort-desc"]</tt>)\r
+     */\r
+    sortClasses : ["sort-asc", "sort-desc"],\r
+\r
+    constructor: function(config){\r
+        Ext.apply(this, config);\r
+        Ext.list.Sorter.superclass.constructor.call(this);\r
+    },\r
+\r
+    init : function(listView){\r
+        this.view = listView;\r
+        listView.on('render', this.initEvents, this);\r
+    },\r
+\r
+    initEvents : function(view){\r
+        view.mon(view.innerHd, 'click', this.onHdClick, this);\r
+        view.innerHd.setStyle('cursor', 'pointer');\r
+        view.mon(view.store, 'datachanged', this.updateSortState, this);\r
+        this.updateSortState.defer(10, this, [view.store]);\r
+    },\r
+\r
+    updateSortState : function(store){\r
+        var state = store.getSortState();\r
+        if(!state){\r
+            return;\r
+        }\r
+        this.sortState = state;\r
+        var cs = this.view.columns, sortColumn = -1;\r
+        for(var i = 0, len = cs.length; i < len; i++){\r
+            if(cs[i].dataIndex == state.field){\r
+                sortColumn = i;\r
+                break;\r
+            }\r
+        }\r
+        if(sortColumn != -1){\r
+            var sortDir = state.direction;\r
+            this.updateSortIcon(sortColumn, sortDir);\r
+        }\r
+    },\r
+\r
+    updateSortIcon : function(col, dir){\r
+        var sc = this.sortClasses;\r
+        var hds = this.view.innerHd.select('em').removeClass(sc);\r
+        hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]);\r
+    },\r
+\r
+    onHdClick : function(e){\r
+        var hd = e.getTarget('em', 3);\r
+        if(hd && !this.view.disableHeaders){\r
+            var index = this.view.findHeaderIndex(hd);\r
+            this.view.store.sort(this.view.columns[index].dataIndex);\r
+        }\r
+    }\r
+});\r
+\r
+// Backwards compatibility alias\r
+Ext.ListView.Sorter = Ext.list.Sorter;/**
+ * @class Ext.TabPanel
+ * <p>A basic tab container. TabPanels can be used exactly like a standard {@link Ext.Panel}
+ * for layout purposes, but also have special support for containing child Components
+ * (<tt>{@link Ext.Container#items items}</tt>) that are managed using a
+ * {@link Ext.layout.CardLayout CardLayout layout manager}, and displayed as separate tabs.</p>
+ *
+ * <b>Note:</b> By default, a tab's close tool <i>destroys</i> the child tab Component
+ * and all its descendants. This makes the child tab Component, and all its descendants <b>unusable</b>. To enable
+ * re-use of a tab, configure the TabPanel with <b><code>{@link #autoDestroy autoDestroy: false}</code></b>.
+ *
+ * <p><b><u>TabPanel header/footer elements</u></b></p>
+ * <p>TabPanels use their {@link Ext.Panel#header header} or {@link Ext.Panel#footer footer} element
+ * (depending on the {@link #tabPosition} configuration) to accommodate the tab selector buttons.
+ * This means that a TabPanel will not display any configured title, and will not display any
+ * configured header {@link Ext.Panel#tools tools}.</p>
+ * <p>To display a header, embed the TabPanel in a {@link Ext.Panel Panel} which uses
+ * <b><tt>{@link Ext.Container#layout layout:'fit'}</tt></b>.</p>
+ *
+ * <p><b><u>Tab Events</u></b></p>
+ * <p>There is no actual tab class &mdash; each tab is simply a {@link Ext.BoxComponent Component}
+ * such as a {@link Ext.Panel Panel}. However, when rendered in a TabPanel, each child Component
+ * can fire additional events that only exist for tabs and are not available from other Components.
+ * These events are:</p>
+ * <div><ul class="mdetail-params">
+ * <li><tt><b>{@link Ext.Panel#activate activate}</b></tt> : Fires when this Component becomes
+ * the active tab.</li>
+ * <li><tt><b>{@link Ext.Panel#deactivate deactivate}</b></tt> : Fires when the Component that
+ * was the active tab becomes deactivated.</li>
+ * <li><tt><b>{@link Ext.Panel#beforeclose beforeclose}</b></tt> : Fires when the user clicks on the close tool of a closeable tab.
+ * May be vetoed by returning <code>false</code> from a handler.</li>
+ * <li><tt><b>{@link Ext.Panel#close close}</b></tt> : Fires a closeable tab has been closed by the user.</li>
+ * </ul></div>
+ * <p><b><u>Creating TabPanels from Code</u></b></p>
+ * <p>TabPanels can be created and rendered completely in code, as in this example:</p>
+ * <pre><code>
+var tabs = new Ext.TabPanel({
+    renderTo: Ext.getBody(),
+    activeTab: 0,
+    items: [{
+        title: 'Tab 1',
+        html: 'A simple tab'
+    },{
+        title: 'Tab 2',
+        html: 'Another one'
+    }]
+});
+</code></pre>
+ * <p><b><u>Creating TabPanels from Existing Markup</u></b></p>
+ * <p>TabPanels can also be rendered from pre-existing markup in a couple of ways.</p>
+ * <div><ul class="mdetail-params">
+ *
+ * <li>Pre-Structured Markup</li>
+ * <div class="sub-desc">
+ * <p>A container div with one or more nested tab divs with class <tt>'x-tab'</tt> can be rendered entirely
+ * from existing markup (See the {@link #autoTabs} example).</p>
+ * </div>
+ *
+ * <li>Un-Structured Markup</li>
+ * <div class="sub-desc">
+ * <p>A TabPanel can also be rendered from markup that is not strictly structured by simply specifying by id
+ * which elements should be the container and the tabs. Using this method tab content can be pulled from different
+ * elements within the page by id regardless of page structure. For example:</p>
+ * <pre><code>
+var tabs = new Ext.TabPanel({
+    renderTo: 'my-tabs',
+    activeTab: 0,
+    items:[
+        {contentEl:'tab1', title:'Tab 1'},
+        {contentEl:'tab2', title:'Tab 2'}
+    ]
+});
+
+// Note that the tabs do not have to be nested within the container (although they can be)
+&lt;div id="my-tabs">&lt;/div>
+&lt;div id="tab1" class="x-hide-display">A simple tab&lt;/div>
+&lt;div id="tab2" class="x-hide-display">Another one&lt;/div>
+</code></pre>
+ * Note that the tab divs in this example contain the class <tt>'x-hide-display'</tt> so that they can be rendered
+ * deferred without displaying outside the tabs. You could alternately set <tt>{@link #deferredRender} = false </tt>
+ * to render all content tabs on page load.
+ * </div>
+ *
  * </ul></div>
- * @cfg {Object} scope The scope (<tt><b>this</b></tt> reference) in which the handler is executed. Defaults to this Button.
- * @cfg {Number} minWidth The minimum width for this button (used to give a set of buttons a common width).
- * See also {@link Ext.Panel}.<tt>{@link Ext.Panel#minButtonWidth minButtonWidth}</tt>.
- * @cfg {String/Object} tooltip The tooltip for the button - can be a string to be used as innerHTML (html tags are accepted) or QuickTips config object
- * @cfg {Boolean} hidden True to start hidden (defaults to false)
- * @cfg {Boolean} disabled True to start disabled (defaults to false)
- * @cfg {Boolean} pressed True to start pressed (only if enableToggle = true)
- * @cfg {String} toggleGroup The group this toggle button is a member of (only 1 per group can be pressed)
- * @cfg {Boolean/Object} repeat True to repeat fire the click event while the mouse is down. This can also be
- * a {@link Ext.util.ClickRepeater ClickRepeater} config object (defaults to false).
+ *
+ * @extends Ext.Panel
  * @constructor
- * Create a new button
- * @param {Object} config The config object
- * @xtype button
+ * @param {Object} config The configuration options
+ * @xtype tabpanel
  */
-Ext.Button = Ext.extend(Ext.BoxComponent, {
+Ext.TabPanel = Ext.extend(Ext.Panel,  {
     /**
-     * Read-only. True if this button is hidden
-     * @type Boolean
+     * @cfg {Boolean} layoutOnTabChange
+     * Set to true to force a layout of the active tab when the tab is changed. Defaults to false.
+     * See {@link Ext.layout.CardLayout}.<code>{@link Ext.layout.CardLayout#layoutOnCardChange layoutOnCardChange}</code>.
      */
-    hidden : false,
     /**
-     * Read-only. True if this button is disabled
-     * @type Boolean
+     * @cfg {String} tabCls <b>This config option is used on <u>child Components</u> of ths TabPanel.</b> A CSS
+     * class name applied to the tab strip item representing the child Component, allowing special
+     * styling to be applied.
      */
-    disabled : false,
     /**
-     * Read-only. True if this button is pressed (only if enableToggle = true)
-     * @type Boolean
+     * @cfg {Boolean} deferredRender
+     * <p><tt>true</tt> by default to defer the rendering of child <tt>{@link Ext.Container#items items}</tt>
+     * to the browsers DOM until a tab is activated. <tt>false</tt> will render all contained
+     * <tt>{@link Ext.Container#items items}</tt> as soon as the {@link Ext.layout.CardLayout layout}
+     * is rendered. If there is a significant amount of content or a lot of heavy controls being
+     * rendered into panels that are not displayed by default, setting this to <tt>true</tt> might
+     * improve performance.</p>
+     * <br><p>The <tt>deferredRender</tt> property is internally passed to the layout manager for
+     * TabPanels ({@link Ext.layout.CardLayout}) as its {@link Ext.layout.CardLayout#deferredRender}
+     * configuration value.</p>
+     * <br><p><b>Note</b>: leaving <tt>deferredRender</tt> as <tt>true</tt> means that the content
+     * within an unactivated tab will not be available. For example, this means that if the TabPanel
+     * is within a {@link Ext.form.FormPanel form}, then until a tab is activated, any Fields within
+     * unactivated tabs will not be rendered, and will therefore not be submitted and will not be
+     * available to either {@link Ext.form.BasicForm#getValues getValues} or
+     * {@link Ext.form.BasicForm#setValues setValues}.</p>
      */
-    pressed : false,
+    deferredRender : true,
     /**
-     * The Button's owner {@link Ext.Panel} (defaults to undefined, and is set automatically when
-     * the Button is added to a container).  Read-only.
-     * @type Ext.Panel
-     * @property ownerCt
+     * @cfg {Number} tabWidth The initial width in pixels of each new tab (defaults to 120).
      */
-
+    tabWidth : 120,
     /**
-     * @cfg {Number} tabIndex Set a DOM tabIndex for this button (defaults to undefined)
+     * @cfg {Number} minTabWidth The minimum width in pixels for each tab when {@link #resizeTabs} = true (defaults to 30).
      */
-
+    minTabWidth : 30,
     /**
-     * @cfg {Boolean} allowDepress
-     * False to not allow a pressed Button to be depressed (defaults to undefined). Only valid when {@link #enableToggle} is true.
+     * @cfg {Boolean} resizeTabs True to automatically resize each tab so that the tabs will completely fill the
+     * tab strip (defaults to false).  Setting this to true may cause specific widths that might be set per tab to
+     * be overridden in order to fit them all into view (although {@link #minTabWidth} will always be honored).
      */
-
+    resizeTabs : false,
     /**
-     * @cfg {Boolean} enableToggle
-     * True to enable pressed/not pressed toggling (defaults to false)
+     * @cfg {Boolean} enableTabScroll True to enable scrolling to tabs that may be invisible due to overflowing the
+     * overall TabPanel width. Only available with tabPosition:'top' (defaults to false).
      */
-    enableToggle: false,
+    enableTabScroll : false,
     /**
-     * @cfg {Function} toggleHandler
-     * Function called when a Button with {@link #enableToggle} set to true is clicked. Two arguments are passed:<ul class="mdetail-params">
-     * <li><b>button</b> : Ext.Button<div class="sub-desc">this Button object</div></li>
-     * <li><b>state</b> : Boolean<div class="sub-desc">The next state if the Button, true means pressed.</div></li>
-     * </ul>
+     * @cfg {Number} scrollIncrement The number of pixels to scroll each time a tab scroll button is pressed
+     * (defaults to <tt>100</tt>, or if <tt>{@link #resizeTabs} = true</tt>, the calculated tab width).  Only
+     * applies when <tt>{@link #enableTabScroll} = true</tt>.
      */
+    scrollIncrement : 0,
     /**
-     * @cfg {Mixed} menu
-     * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob (defaults to undefined).
+     * @cfg {Number} scrollRepeatInterval Number of milliseconds between each scroll while a tab scroll button is
+     * continuously pressed (defaults to <tt>400</tt>).
      */
+    scrollRepeatInterval : 400,
     /**
-     * @cfg {String} menuAlign
-     * The position to align the menu to (see {@link Ext.Element#alignTo} for more details, defaults to 'tl-bl?').
+     * @cfg {Float} scrollDuration The number of milliseconds that each scroll animation should last (defaults
+     * to <tt>.35</tt>). Only applies when <tt>{@link #animScroll} = true</tt>.
      */
-    menuAlign : 'tl-bl?',
-
+    scrollDuration : 0.35,
     /**
-     * @cfg {String} overflowText If used in a {@link Ext.Toolbar Toolbar}, the
-     * text to be used if this item is shown in the overflow menu. See also
-     * {@link Ext.Toolbar.Item}.<code>{@link Ext.Toolbar.Item#overflowText overflowText}</code>.
+     * @cfg {Boolean} animScroll True to animate tab scrolling so that hidden tabs slide smoothly into view (defaults
+     * to <tt>true</tt>).  Only applies when <tt>{@link #enableTabScroll} = true</tt>.
      */
+    animScroll : true,
     /**
-     * @cfg {String} iconCls
-     * A css class which sets a background image to be used as the icon for this button
+     * @cfg {String} tabPosition The position where the tab strip should be rendered (defaults to <tt>'top'</tt>).
+     * The only other supported value is <tt>'bottom'</tt>.  <b>Note</b>: tab scrolling is only supported for
+     * <tt>tabPosition: 'top'</tt>.
      */
+    tabPosition : 'top',
     /**
-     * @cfg {String} type
-     * submit, reset or button - defaults to 'button'
+     * @cfg {String} baseCls The base CSS class applied to the panel (defaults to <tt>'x-tab-panel'</tt>).
      */
-    type : 'button',
-
-    // private
-    menuClassTarget: 'tr:nth(2)',
+    baseCls : 'x-tab-panel',
+    /**
+     * @cfg {Boolean} autoTabs
+     * <p><tt>true</tt> to query the DOM for any divs with a class of 'x-tab' to be automatically converted
+     * to tabs and added to this panel (defaults to <tt>false</tt>).  Note that the query will be executed within
+     * the scope of the container element only (so that multiple tab panels from markup can be supported via this
+     * method).</p>
+     * <p>This method is only possible when the markup is structured correctly as a container with nested divs
+     * containing the class <tt>'x-tab'</tt>. To create TabPanels without these limitations, or to pull tab content
+     * from other elements on the page, see the example at the top of the class for generating tabs from markup.</p>
+     * <p>There are a couple of things to note when using this method:<ul>
+     * <li>When using the <tt>autoTabs</tt> config (as opposed to passing individual tab configs in the TabPanel's
+     * {@link #items} collection), you must use <tt>{@link #applyTo}</tt> to correctly use the specified <tt>id</tt>
+     * as the tab container. The <tt>autoTabs</tt> method <em>replaces</em> existing content with the TabPanel
+     * components.</li>
+     * <li>Make sure that you set <tt>{@link #deferredRender}: false</tt> so that the content elements for each
+     * tab will be rendered into the TabPanel immediately upon page load, otherwise they will not be transformed
+     * until each tab is activated and will be visible outside the TabPanel.</li>
+     * </ul>Example usage:</p>
+     * <pre><code>
+var tabs = new Ext.TabPanel({
+    applyTo: 'my-tabs',
+    activeTab: 0,
+    deferredRender: false,
+    autoTabs: true
+});
 
-    /**
-     * @cfg {String} clickEvent
-     * The type of event to map to the button's event handler (defaults to 'click')
+// This markup will be converted to a TabPanel from the code above
+&lt;div id="my-tabs">
+    &lt;div class="x-tab" title="Tab 1">A simple tab&lt;/div>
+    &lt;div class="x-tab" title="Tab 2">Another one&lt;/div>
+&lt;/div>
+</code></pre>
      */
-    clickEvent : 'click',
-
+    autoTabs : false,
     /**
-     * @cfg {Boolean} handleMouseEvents
-     * False to disable visual cues on mouseover, mouseout and mousedown (defaults to true)
+     * @cfg {String} autoTabSelector The CSS selector used to search for tabs in existing markup when
+     * <tt>{@link #autoTabs} = true</tt> (defaults to <tt>'div.x-tab'</tt>).  This can be any valid selector
+     * supported by {@link Ext.DomQuery#select}. Note that the query will be executed within the scope of this
+     * tab panel only (so that multiple tab panels from markup can be supported on a page).
      */
-    handleMouseEvents : true,
-
+    autoTabSelector : 'div.x-tab',
     /**
-     * @cfg {String} tooltipType
-     * The type of tooltip to use. Either 'qtip' (default) for QuickTips or 'title' for title attribute.
+     * @cfg {String/Number} activeTab A string id or the numeric index of the tab that should be initially
+     * activated on render (defaults to undefined).
      */
-    tooltipType : 'qtip',
-
+    activeTab : undefined,
     /**
-     * @cfg {String} buttonSelector
-     * <p>(Optional) A {@link Ext.DomQuery DomQuery} selector which is used to extract the active, clickable element from the
-     * DOM structure created.</p>
-     * <p>When a custom {@link #template} is used, you  must ensure that this selector results in the selection of
-     * a focussable element.</p>
-     * <p>Defaults to <b><tt>"button:first-child"</tt></b>.</p>
+     * @cfg {Number} tabMargin The number of pixels of space to calculate into the sizing and scrolling of
+     * tabs. If you change the margin in CSS, you will need to update this value so calculations are correct
+     * with either <tt>{@link #resizeTabs}</tt> or scrolling tabs. (defaults to <tt>2</tt>)
      */
-    buttonSelector : 'button:first-child',
-
+    tabMargin : 2,
     /**
-     * @cfg {String} scale
-     * <p>(Optional) The size of the Button. Three values are allowed:</p>
-     * <ul class="mdetail-params">
-     * <li>'small'<div class="sub-desc">Results in the button element being 16px high.</div></li>
-     * <li>'medium'<div class="sub-desc">Results in the button element being 24px high.</div></li>
-     * <li>'large'<div class="sub-desc">Results in the button element being 32px high.</div></li>
-     * </ul>
-     * <p>Defaults to <b><tt>'small'</tt></b>.</p>
+     * @cfg {Boolean} plain </tt>true</tt> to render the tab strip without a background container image
+     * (defaults to <tt>false</tt>).
      */
-    scale: 'small',
-
+    plain : false,
     /**
-     * @cfg {String} iconAlign
-     * <p>(Optional) The side of the Button box to render the icon. Four values are allowed:</p>
-     * <ul class="mdetail-params">
-     * <li>'top'<div class="sub-desc"></div></li>
-     * <li>'right'<div class="sub-desc"></div></li>
-     * <li>'bottom'<div class="sub-desc"></div></li>
-     * <li>'left'<div class="sub-desc"></div></li>
-     * </ul>
-     * <p>Defaults to <b><tt>'left'</tt></b>.</p>
+     * @cfg {Number} wheelIncrement For scrolling tabs, the number of pixels to increment on mouse wheel
+     * scrolling (defaults to <tt>20</tt>).
      */
-    iconAlign : 'left',
+    wheelIncrement : 20,
 
-    /**
-     * @cfg {String} arrowAlign
-     * <p>(Optional) The side of the Button box to render the arrow if the button has an associated {@link #menu}.
-     * Two values are allowed:</p>
-     * <ul class="mdetail-params">
-     * <li>'right'<div class="sub-desc"></div></li>
-     * <li>'bottom'<div class="sub-desc"></div></li>
-     * </ul>
-     * <p>Defaults to <b><tt>'right'</tt></b>.</p>
+    /*
+     * This is a protected property used when concatenating tab ids to the TabPanel id for internal uniqueness.
+     * It does not generally need to be changed, but can be if external code also uses an id scheme that can
+     * potentially clash with this one.
      */
-    arrowAlign : 'right',
+    idDelimiter : '__',
 
-    /**
-     * @cfg {Ext.Template} template (Optional)
-     * <p>A {@link Ext.Template Template} used to create the Button's DOM structure.</p>
-     * Instances, or subclasses which need a different DOM structure may provide a different
-     * template layout in conjunction with an implementation of {@link #getTemplateArgs}.
-     * @type Ext.Template
-     * @property template
-     */
-    /**
-     * @cfg {String} cls
-     * A CSS class string to apply to the button's main element.
-     */
-    /**
-     * @property menu
-     * @type Menu
-     * The {@link Ext.menu.Menu Menu} object associated with this Button when configured with the {@link #menu} config option.
-     */
+    // private
+    itemCls : 'x-tab-item',
 
-    initComponent : function(){
-        Ext.Button.superclass.initComponent.call(this);
+    // private config overrides
+    elements : 'body',
+    headerAsText : false,
+    frame : false,
+    hideBorders :true,
 
+    // private
+    initComponent : function(){
+        this.frame = false;
+        Ext.TabPanel.superclass.initComponent.call(this);
         this.addEvents(
             /**
-             * @event click
-             * Fires when this button is clicked
-             * @param {Button} this
-             * @param {EventObject} e The click event
-             */
-            'click',
-            /**
-             * @event toggle
-             * Fires when the 'pressed' state of this button changes (only if enableToggle = true)
-             * @param {Button} this
-             * @param {Boolean} pressed
-             */
-            'toggle',
-            /**
-             * @event mouseover
-             * Fires when the mouse hovers over the button
-             * @param {Button} this
-             * @param {Event} e The event object
-             */
-            'mouseover',
-            /**
-             * @event mouseout
-             * Fires when the mouse exits the button
-             * @param {Button} this
-             * @param {Event} e The event object
-             */
-            'mouseout',
-            /**
-             * @event menushow
-             * If this button has a menu, this event fires when it is shown
-             * @param {Button} this
-             * @param {Menu} menu
-             */
-            'menushow',
-            /**
-             * @event menuhide
-             * If this button has a menu, this event fires when it is hidden
-             * @param {Button} this
-             * @param {Menu} menu
+             * @event beforetabchange
+             * Fires before the active tab changes. Handlers can <tt>return false</tt> to cancel the tab change.
+             * @param {TabPanel} this
+             * @param {Panel} newTab The tab being activated
+             * @param {Panel} currentTab The current active tab
              */
-            'menuhide',
+            'beforetabchange',
             /**
-             * @event menutriggerover
-             * If this button has a menu, this event fires when the mouse enters the menu triggering element
-             * @param {Button} this
-             * @param {Menu} menu
-             * @param {EventObject} e
+             * @event tabchange
+             * Fires after the active tab has changed.
+             * @param {TabPanel} this
+             * @param {Panel} tab The new active tab
              */
-            'menutriggerover',
+            'tabchange',
             /**
-             * @event menutriggerout
-             * If this button has a menu, this event fires when the mouse leaves the menu triggering element
-             * @param {Button} this
-             * @param {Menu} menu
+             * @event contextmenu
+             * Relays the contextmenu event from a tab selector element in the tab strip.
+             * @param {TabPanel} this
+             * @param {Panel} tab The target tab
              * @param {EventObject} e
              */
-            'menutriggerout'
+            'contextmenu'
         );
-        if(this.menu){
-            this.menu = Ext.menu.MenuMgr.get(this.menu);
+        /**
+         * @cfg {Object} layoutConfig
+         * TabPanel implicitly uses {@link Ext.layout.CardLayout} as its layout manager.
+         * <code>layoutConfig</code> may be used to configure this layout manager.
+         * <code>{@link #deferredRender}</code> and <code>{@link #layoutOnTabChange}</code>
+         * configured on the TabPanel will be applied as configs to the layout manager.
+         */
+        this.setLayout(new Ext.layout.CardLayout(Ext.apply({
+            layoutOnCardChange: this.layoutOnTabChange,
+            deferredRender: this.deferredRender
+        }, this.layoutConfig)));
+
+        if(this.tabPosition == 'top'){
+            this.elements += ',header';
+            this.stripTarget = 'header';
+        }else {
+            this.elements += ',footer';
+            this.stripTarget = 'footer';
         }
-        if(Ext.isString(this.toggleGroup)){
-            this.enableToggle = true;
+        if(!this.stack){
+            this.stack = Ext.TabPanel.AccessStack();
         }
+        this.initItems();
     },
 
-/**
-  * <p>This method returns an object which provides substitution parameters for the {@link #template Template} used
-  * to create this Button's DOM structure.</p>
-  * <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their
-  * own implementation of this method.</p>
-  * <p>The default implementation which provides data for the default {@link #template} returns an Array containing the
-  * following items:</p><div class="mdetail-params"><ul>
-  * <li>The Button's {@link #text}</li>
-  * <li>The &lt;button&gt;'s {@link #type}</li>
-  * <li>The {@link iconCls} applied to the &lt;button&gt; {@link #btnEl element}</li>
-  * <li>The {@link #cls} applied to the Button's main {@link #getEl Element}</li>
-  * <li>A CSS class name controlling the Button's {@link #scale} and {@link #iconAlign icon alignment}</li>
-  * <li>A CSS class name which applies an arrow to the Button if configured with a {@link #menu}</li>
-  * </ul></div>
-  * @return {Object} Substitution data for a Template.
- */
-    getTemplateArgs : function(){
-        var cls = (this.cls || '');
-        cls += (this.iconCls || this.icon) ? (this.text ? ' x-btn-text-icon' : ' x-btn-icon') : ' x-btn-noicon';
-        if(this.pressed){
-            cls += ' x-btn-pressed';
+    // private
+    onRender : function(ct, position){
+        Ext.TabPanel.superclass.onRender.call(this, ct, position);
+
+        if(this.plain){
+            var pos = this.tabPosition == 'top' ? 'header' : 'footer';
+            this[pos].addClass('x-tab-panel-'+pos+'-plain');
         }
-        return [this.text || '&#160;', this.type, this.iconCls || '', cls, 'x-btn-' + this.scale + ' x-btn-icon-' + this.scale + '-' + this.iconAlign, this.getMenuClass()];
+
+        var st = this[this.stripTarget];
+
+        this.stripWrap = st.createChild({cls:'x-tab-strip-wrap', cn:{
+            tag:'ul', cls:'x-tab-strip x-tab-strip-'+this.tabPosition}});
+
+        var beforeEl = (this.tabPosition=='bottom' ? this.stripWrap : null);
+        st.createChild({cls:'x-tab-strip-spacer'}, beforeEl);
+        this.strip = new Ext.Element(this.stripWrap.dom.firstChild);
+
+        // create an empty span with class x-tab-strip-text to force the height of the header element when there's no tabs.
+        this.edge = this.strip.createChild({tag:'li', cls:'x-tab-edge', cn: [{tag: 'span', cls: 'x-tab-strip-text', cn: '&#160;'}]});
+        this.strip.createChild({cls:'x-clear'});
+
+        this.body.addClass('x-tab-panel-body-'+this.tabPosition);
+
+        /**
+         * @cfg {Template/XTemplate} itemTpl <p>(Optional) A {@link Ext.Template Template} or
+         * {@link Ext.XTemplate XTemplate} which may be provided to process the data object returned from
+         * <tt>{@link #getTemplateArgs}</tt> to produce a clickable selector element in the tab strip.</p>
+         * <p>The main element created should be a <tt>&lt;li></tt> element. In order for a click event on
+         * a selector element to be connected to its item, it must take its <i>id</i> from the TabPanel's
+         * native <tt>{@link #getTemplateArgs}</tt>.</p>
+         * <p>The child element which contains the title text must be marked by the CSS class
+         * <tt>x-tab-strip-inner</tt>.</p>
+         * <p>To enable closability, the created element should contain an element marked by the CSS class
+         * <tt>x-tab-strip-close</tt>.</p>
+         * <p>If a custom <tt>itemTpl</tt> is supplied, it is the developer's responsibility to create CSS
+         * style rules to create the desired appearance.</p>
+         * Below is an example of how to create customized tab selector items:<pre><code>
+new Ext.TabPanel({
+    renderTo: document.body,
+    minTabWidth: 115,
+    tabWidth: 135,
+    enableTabScroll: true,
+    width: 600,
+    height: 250,
+    defaults: {autoScroll:true},
+    itemTpl: new Ext.XTemplate(
+    '&lt;li class="{cls}" id="{id}" style="overflow:hidden">',
+         '&lt;tpl if="closable">',
+            '&lt;a class="x-tab-strip-close">&lt;/a>',
+         '&lt;/tpl>',
+         '&lt;a class="x-tab-right" href="#" style="padding-left:6px">',
+            '&lt;em class="x-tab-left">',
+                '&lt;span class="x-tab-strip-inner">',
+                    '&lt;img src="{src}" style="float:left;margin:3px 3px 0 0">',
+                    '&lt;span style="margin-left:20px" class="x-tab-strip-text {iconCls}">{text} {extra}&lt;/span>',
+                '&lt;/span>',
+            '&lt;/em>',
+        '&lt;/a>',
+    '&lt;/li>'
+    ),
+    getTemplateArgs: function(item) {
+//      Call the native method to collect the base data. Like the ID!
+        var result = Ext.TabPanel.prototype.getTemplateArgs.call(this, item);
+
+//      Add stuff used in our template
+        return Ext.apply(result, {
+            closable: item.closable,
+            src: item.iconSrc,
+            extra: item.extraText || ''
+        });
     },
+    items: [{
+        title: 'New Tab 1',
+        iconSrc: '../shared/icons/fam/grid.png',
+        html: 'Tab Body 1',
+        closable: true
+    }, {
+        title: 'New Tab 2',
+        iconSrc: '../shared/icons/fam/grid.png',
+        html: 'Tab Body 2',
+        extraText: 'Extra stuff in the tab button'
+    }]
+});
+</code></pre>
+         */
+        if(!this.itemTpl){
+            var tt = new Ext.Template(
+                 '<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>',
+                 '<a class="x-tab-right" href="#"><em class="x-tab-left">',
+                 '<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',
+                 '</em></a></li>'
+            );
+            tt.disableFormats = true;
+            tt.compile();
+            Ext.TabPanel.prototype.itemTpl = tt;
+        }
 
-    // protected
-    getMenuClass : function(){
-        return this.menu ? (this.arrowAlign != 'bottom' ? 'x-btn-arrow' : 'x-btn-arrow-bottom') : '';
+        this.items.each(this.initTab, this);
     },
 
     // private
-    onRender : function(ct, position){
-        if(!this.template){
-            if(!Ext.Button.buttonTemplate){
-                // hideous table template
-                Ext.Button.buttonTemplate = new Ext.Template(
-                    '<table cellspacing="0" class="x-btn {3}"><tbody class="{4}">',
-                    '<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>',
-                    '<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{5}" unselectable="on"><button class="x-btn-text {2}" type="{1}">{0}</button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',
-                    '<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',
-                    "</tbody></table>");
-                Ext.Button.buttonTemplate.compile();
-            }
-            this.template = Ext.Button.buttonTemplate;
+    afterRender : function(){
+        Ext.TabPanel.superclass.afterRender.call(this);
+        if(this.autoTabs){
+            this.readTabs(false);
         }
-
-        var btn, targs = this.getTemplateArgs();
-
-        if(position){
-            btn = this.template.insertBefore(position, targs, true);
-        }else{
-            btn = this.template.append(ct, targs, true);
+        if(this.activeTab !== undefined){
+            var item = Ext.isObject(this.activeTab) ? this.activeTab : this.items.get(this.activeTab);
+            delete this.activeTab;
+            this.setActiveTab(item);
         }
-        /**
-         * An {@link Ext.Element Element} encapsulating the Button's clickable element. By default,
-         * this references a <tt>&lt;button&gt;</tt> element. Read only.
-         * @type Ext.Element
-         * @property btnEl
-         */
-        this.btnEl = btn.child(this.buttonSelector);
-        this.mon(this.btnEl, {
+    },
+
+    // private
+    initEvents : function(){
+        Ext.TabPanel.superclass.initEvents.call(this);
+        this.mon(this.strip, {
             scope: this,
-            focus: this.onFocus,
-            blur: this.onBlur
+            mousedown: this.onStripMouseDown,
+            contextmenu: this.onStripContextMenu
         });
-
-        this.initButtonEl(btn, this.btnEl);
-
-        Ext.ButtonToggleMgr.register(this);
+        if(this.enableTabScroll){
+            this.mon(this.strip, 'mousewheel', this.onWheel, this);
+        }
     },
 
     // private
-    initButtonEl : function(btn, btnEl){
-        this.el = btn;
+    findTargets : function(e){
+        var item = null,
+            itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);
 
-        if(this.id){
-            this.el.dom.id = this.el.id = this.id;
+        if(itemEl){
+            item = this.getComponent(itemEl.id.split(this.idDelimiter)[1]);
+            if(item.disabled){
+                return {
+                    close : null,
+                    item : null,
+                    el : null
+                };
+            }
         }
-        if(this.icon){
-            btnEl.setStyle('background-image', 'url(' +this.icon +')');
+        return {
+            close : e.getTarget('.x-tab-strip-close', this.strip),
+            item : item,
+            el : itemEl
+        };
+    },
+
+    // private
+    onStripMouseDown : function(e){
+        if(e.button !== 0){
+            return;
         }
-        if(this.tabIndex !== undefined){
-            btnEl.dom.tabIndex = this.tabIndex;
+        e.preventDefault();
+        var t = this.findTargets(e);
+        if(t.close){
+            if (t.item.fireEvent('beforeclose', t.item) !== false) {
+                t.item.fireEvent('close', t.item);
+                this.remove(t.item);
+            }
+            return;
         }
-        if(this.tooltip){
-            this.setTooltip(this.tooltip, true);
+        if(t.item && t.item != this.activeTab){
+            this.setActiveTab(t.item);
         }
+    },
 
-        if(this.handleMouseEvents){
-            this.mon(btn, {
-                scope: this,
-                mouseover: this.onMouseOver,
-                mousedown: this.onMouseDown
-            });
-            
-            // new functionality for monitoring on the document level
-            //this.mon(btn, 'mouseout', this.onMouseOut, this);
+    // private
+    onStripContextMenu : function(e){
+        e.preventDefault();
+        var t = this.findTargets(e);
+        if(t.item){
+            this.fireEvent('contextmenu', this, t.item, e);
         }
+    },
 
-        if(this.menu){
-            this.mon(this.menu, {
-                scope: this,
-                show: this.onMenuShow,
-                hide: this.onMenuHide
-            });
+    /**
+     * True to scan the markup in this tab panel for <tt>{@link #autoTabs}</tt> using the
+     * <tt>{@link #autoTabSelector}</tt>
+     * @param {Boolean} removeExisting True to remove existing tabs
+     */
+    readTabs : function(removeExisting){
+        if(removeExisting === true){
+            this.items.each(function(item){
+                this.remove(item);
+            }, this);
         }
-
-        if(this.repeat){
-            var repeater = new Ext.util.ClickRepeater(btn, Ext.isObject(this.repeat) ? this.repeat : {});
-            this.mon(repeater, 'click', this.onClick, this);
+        var tabs = this.el.query(this.autoTabSelector);
+        for(var i = 0, len = tabs.length; i < len; i++){
+            var tab = tabs[i],
+                title = tab.getAttribute('title');
+            tab.removeAttribute('title');
+            this.add({
+                title: title,
+                contentEl: tab
+            });
         }
-        
-        this.mon(btn, this.clickEvent, this.onClick, this);
     },
 
     // private
-    afterRender : function(){
-        Ext.Button.superclass.afterRender.call(this);
-        this.doAutoWidth();
-    },
+    initTab : function(item, index){
+        var before = this.strip.dom.childNodes[index],
+            p = this.getTemplateArgs(item),
+            el = before ?
+                 this.itemTpl.insertBefore(before, p) :
+                 this.itemTpl.append(this.strip, p),
+            cls = 'x-tab-strip-over',
+            tabEl = Ext.get(el);
 
-    /**
-     * Sets the CSS class that provides a background image to use as the button's icon.  This method also changes
-     * the value of the {@link iconCls} config internally.
-     * @param {String} cls The CSS class providing the icon image
-     * @return {Ext.Button} this
-     */
-    setIconClass : function(cls){
-        if(this.el){
-            this.btnEl.replaceClass(this.iconCls, cls);
+        tabEl.hover(function(){
+            if(!item.disabled){
+                tabEl.addClass(cls);
+            }
+        }, function(){
+            tabEl.removeClass(cls);
+        });
+
+        if(item.tabTip){
+            tabEl.child('span.x-tab-strip-text', true).qtip = item.tabTip;
         }
-        this.iconCls = cls;
-        return this;
+        item.tabEl = el;
+
+        // Route *keyboard triggered* click events to the tab strip mouse handler.
+        tabEl.select('a').on('click', function(e){
+            if(!e.getPageX()){
+                this.onStripMouseDown(e);
+            }
+        }, this, {preventDefault: true});
+
+        item.on({
+            scope: this,
+            disable: this.onItemDisabled,
+            enable: this.onItemEnabled,
+            titlechange: this.onItemTitleChanged,
+            iconchange: this.onItemIconChanged,
+            beforeshow: this.onBeforeShowItem
+        });
     },
 
+
+
     /**
-     * Sets the tooltip for this Button.
-     * @param {String/Object} tooltip. This may be:<div class="mdesc-details"><ul>
-     * <li><b>String</b> : A string to be used as innerHTML (html tags are accepted) to show in a tooltip</li>
-     * <li><b>Object</b> : A configuration object for {@link Ext.QuickTips#register}.</li>
+     * <p>Provides template arguments for rendering a tab selector item in the tab strip.</p>
+     * <p>This method returns an object hash containing properties used by the TabPanel's <tt>{@link #itemTpl}</tt>
+     * to create a formatted, clickable tab selector element. The properties which must be returned
+     * are:</p><div class="mdetail-params"><ul>
+     * <li><b>id</b> : String<div class="sub-desc">A unique identifier which links to the item</div></li>
+     * <li><b>text</b> : String<div class="sub-desc">The text to display</div></li>
+     * <li><b>cls</b> : String<div class="sub-desc">The CSS class name</div></li>
+     * <li><b>iconCls</b> : String<div class="sub-desc">A CSS class to provide appearance for an icon.</div></li>
      * </ul></div>
-     * @return {Ext.Button} this
+     * @param {BoxComponent} item The {@link Ext.BoxComponent BoxComponent} for which to create a selector element in the tab strip.
+     * @return {Object} An object hash containing the properties required to render the selector element.
      */
-    setTooltip : function(tooltip, /* private */ initial){
+    getTemplateArgs : function(item) {
+        var cls = item.closable ? 'x-tab-strip-closable' : '';
+        if(item.disabled){
+            cls += ' x-item-disabled';
+        }
+        if(item.iconCls){
+            cls += ' x-tab-with-icon';
+        }
+        if(item.tabCls){
+            cls += ' ' + item.tabCls;
+        }
+
+        return {
+            id: this.id + this.idDelimiter + item.getItemId(),
+            text: item.title,
+            cls: cls,
+            iconCls: item.iconCls || ''
+        };
+    },
+
+    // private
+    onAdd : function(c){
+        Ext.TabPanel.superclass.onAdd.call(this, c);
         if(this.rendered){
-            if(!initial){
-                this.clearTip();
-            }
-            if(Ext.isObject(tooltip)){
-                Ext.QuickTips.register(Ext.apply({
-                      target: this.btnEl.id
-                }, tooltip));
-                this.tooltip = tooltip;
+            var items = this.items;
+            this.initTab(c, items.indexOf(c));
+            if(items.getCount() == 1){
+                this.syncSize();
+            }
+            this.delegateUpdates();
+        }
+    },
+
+    // private
+    onBeforeAdd : function(item){
+        var existing = item.events ? (this.items.containsKey(item.getItemId()) ? item : null) : this.items.get(item);
+        if(existing){
+            this.setActiveTab(item);
+            return false;
+        }
+        Ext.TabPanel.superclass.onBeforeAdd.apply(this, arguments);
+        var es = item.elements;
+        item.elements = es ? es.replace(',header', '') : es;
+        item.border = (item.border === true);
+    },
+
+    // private
+    onRemove : function(c){
+        var te = Ext.get(c.tabEl);
+        // check if the tabEl exists, it won't if the tab isn't rendered
+        if(te){
+            te.select('a').removeAllListeners();
+            Ext.destroy(te);
+        }
+        Ext.TabPanel.superclass.onRemove.call(this, c);
+        this.stack.remove(c);
+        delete c.tabEl;
+        c.un('disable', this.onItemDisabled, this);
+        c.un('enable', this.onItemEnabled, this);
+        c.un('titlechange', this.onItemTitleChanged, this);
+        c.un('iconchange', this.onItemIconChanged, this);
+        c.un('beforeshow', this.onBeforeShowItem, this);
+        if(c == this.activeTab){
+            var next = this.stack.next();
+            if(next){
+                this.setActiveTab(next);
+            }else if(this.items.getCount() > 0){
+                this.setActiveTab(0);
             }else{
-                this.btnEl.dom[this.tooltipType] = tooltip;
+                this.setActiveTab(null);
             }
-        }else{
-            this.tooltip = tooltip;
         }
-        return this;
+        if(!this.destroying){
+            this.delegateUpdates();
+        }
     },
-    
+
     // private
-    clearTip: function(){
-        if(Ext.isObject(this.tooltip)){
-            Ext.QuickTips.unregister(this.btnEl);
+    onBeforeShowItem : function(item){
+        if(item != this.activeTab){
+            this.setActiveTab(item);
+            return false;
         }
     },
-    
+
     // private
-    beforeDestroy: function(){
-        if(this.rendered){
-            this.clearTip();
+    onItemDisabled : function(item){
+        var el = this.getTabEl(item);
+        if(el){
+            Ext.fly(el).addClass('x-item-disabled');
         }
-        Ext.destroy(this.menu, this.repeater);
+        this.stack.remove(item);
     },
 
     // private
-    onDestroy : function(){
-        var doc = Ext.getDoc();
-        doc.un('mouseover', this.monitorMouseOver, this);
-        doc.un('mouseup', this.onMouseUp, this);
-        if(this.rendered){
-            Ext.ButtonToggleMgr.unregister(this);
+    onItemEnabled : function(item){
+        var el = this.getTabEl(item);
+        if(el){
+            Ext.fly(el).removeClass('x-item-disabled');
         }
     },
 
     // private
-    doAutoWidth : function(){
-        if(this.el && this.text && this.width === undefined){
-            this.el.setWidth('auto');
-            if(Ext.isIE7 && Ext.isStrict){
-                var ib = this.btnEl;
-                if(ib && ib.getWidth() > 20){
-                    ib.clip();
-                    ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));
-                }
-            }
-            if(this.minWidth){
-                if(this.el.getWidth() < this.minWidth){
-                    this.el.setWidth(this.minWidth);
-                }
-            }
+    onItemTitleChanged : function(item){
+        var el = this.getTabEl(item);
+        if(el){
+            Ext.fly(el).child('span.x-tab-strip-text', true).innerHTML = item.title;
+        }
+    },
+
+    //private
+    onItemIconChanged : function(item, iconCls, oldCls){
+        var el = this.getTabEl(item);
+        if(el){
+            el = Ext.get(el);
+            el.child('span.x-tab-strip-text').replaceClass(oldCls, iconCls);
+            el[Ext.isEmpty(iconCls) ? 'removeClass' : 'addClass']('x-tab-with-icon');
         }
     },
 
     /**
-     * Assigns this Button's click handler
-     * @param {Function} handler The function to call when the button is clicked
-     * @param {Object} scope (optional) Scope for the function passed in
-     * @return {Ext.Button} this
+     * Gets the DOM element for the tab strip item which activates the child panel with the specified
+     * ID. Access this to change the visual treatment of the item, for example by changing the CSS class name.
+     * @param {Panel/Number/String} tab The tab component, or the tab's index, or the tabs id or itemId.
+     * @return {HTMLElement} The DOM node
      */
-    setHandler : function(handler, scope){
-        this.handler = handler;
-        this.scope = scope;
-        return this;
+    getTabEl : function(item){
+        var c = this.getComponent(item);
+        return c ? c.tabEl : null;
+    },
+
+    // private
+    onResize : function(){
+        Ext.TabPanel.superclass.onResize.apply(this, arguments);
+        this.delegateUpdates();
     },
 
     /**
-     * Sets this Button's text
-     * @param {String} text The button text
-     * @return {Ext.Button} this
+     * Suspends any internal calculations or scrolling while doing a bulk operation. See {@link #endUpdate}
      */
-    setText : function(text){
-        this.text = text;
-        if(this.el){
-            this.el.child('td.x-btn-mc ' + this.buttonSelector).update(text);
-        }
-        this.doAutoWidth();
-        return this;
+    beginUpdate : function(){
+        this.suspendUpdates = true;
     },
 
     /**
-     * Gets the text for this Button
-     * @return {String} The button text
+     * Resumes calculations and scrolling at the end of a bulk operation. See {@link #beginUpdate}
      */
-    getText : function(){
-        return this.text;
+    endUpdate : function(){
+        this.suspendUpdates = false;
+        this.delegateUpdates();
     },
 
     /**
-     * If a state it passed, it becomes the pressed state otherwise the current state is toggled.
-     * @param {Boolean} state (optional) Force a particular state
-     * @param {Boolean} supressEvent (optional) True to stop events being fired when calling this method.
-     * @return {Ext.Button} this
+     * Hides the tab strip item for the passed tab
+     * @param {Number/String/Panel} item The tab index, id or item
      */
-    toggle : function(state, suppressEvent){
-        state = state === undefined ? !this.pressed : !!state;
-        if(state != this.pressed){
-            this.el[state ? 'addClass' : 'removeClass']('x-btn-pressed');
-            this.pressed = state;
-            if(!suppressEvent){
-                this.fireEvent('toggle', this, state);
-                if(this.toggleHandler){
-                    this.toggleHandler.call(this.scope || this, this, state);
-                }
-            }
+    hideTabStripItem : function(item){
+        item = this.getComponent(item);
+        var el = this.getTabEl(item);
+        if(el){
+            el.style.display = 'none';
+            this.delegateUpdates();
         }
-        return this;
+        this.stack.remove(item);
     },
 
     /**
-     * Focus the button
+     * Unhides the tab strip item for the passed tab
+     * @param {Number/String/Panel} item The tab index, id or item
      */
-    focus : function(){
-        this.btnEl.focus();
+    unhideTabStripItem : function(item){
+        item = this.getComponent(item);
+        var el = this.getTabEl(item);
+        if(el){
+            el.style.display = '';
+            this.delegateUpdates();
+        }
     },
 
     // private
-    onDisable : function(){
-        this.onDisableChange(true);
+    delegateUpdates : function(){
+        if(this.suspendUpdates){
+            return;
+        }
+        if(this.resizeTabs && this.rendered){
+            this.autoSizeTabs();
+        }
+        if(this.enableTabScroll && this.rendered){
+            this.autoScrollTabs();
+        }
     },
 
     // private
-    onEnable : function(){
-        this.onDisableChange(false);
+    autoSizeTabs : function(){
+        var count = this.items.length,
+            ce = this.tabPosition != 'bottom' ? 'header' : 'footer',
+            ow = this[ce].dom.offsetWidth,
+            aw = this[ce].dom.clientWidth;
+
+        if(!this.resizeTabs || count < 1 || !aw){ // !aw for display:none
+            return;
+        }
+
+        var each = Math.max(Math.min(Math.floor((aw-4) / count) - this.tabMargin, this.tabWidth), this.minTabWidth); // -4 for float errors in IE
+        this.lastTabWidth = each;
+        var lis = this.strip.query('li:not(.x-tab-edge)');
+        for(var i = 0, len = lis.length; i < len; i++) {
+            var li = lis[i],
+                inner = Ext.fly(li).child('.x-tab-strip-inner', true),
+                tw = li.offsetWidth,
+                iw = inner.offsetWidth;
+            inner.style.width = (each - (tw-iw)) + 'px';
+        }
     },
-    
-    onDisableChange : function(disabled){
-        if(this.el){
-            if(!Ext.isIE6 || !this.text){
-                this.el[disabled ? 'addClass' : 'removeClass'](this.disabledClass);
-            }
-            this.el.dom.disabled = disabled;
+
+    // private
+    adjustBodyWidth : function(w){
+        if(this.header){
+            this.header.setWidth(w);
+        }
+        if(this.footer){
+            this.footer.setWidth(w);
+        }
+        return w;
+    },
+
+    /**
+     * Sets the specified tab as the active tab. This method fires the {@link #beforetabchange} event which
+     * can <tt>return false</tt> to cancel the tab change.
+     * @param {String/Number} item
+     * The id or tab Panel to activate. This parameter may be any of the following:
+     * <div><ul class="mdetail-params">
+     * <li>a <b><tt>String</tt></b> : representing the <code>{@link Ext.Component#itemId itemId}</code>
+     * or <code>{@link Ext.Component#id id}</code> of the child component </li>
+     * <li>a <b><tt>Number</tt></b> : representing the position of the child component
+     * within the <code>{@link Ext.Container#items items}</code> <b>property</b></li>
+     * </ul></div>
+     * <p>For additional information see {@link Ext.util.MixedCollection#get}.
+     */
+    setActiveTab : function(item){
+        item = this.getComponent(item);
+        if(this.fireEvent('beforetabchange', this, item, this.activeTab) === false){
+            return;
         }
-        this.disabled = disabled;
-    },
+        if(!this.rendered){
+            this.activeTab = item;
+            return;
+        }
+        if(this.activeTab != item){
+            if(this.activeTab){
+                var oldEl = this.getTabEl(this.activeTab);
+                if(oldEl){
+                    Ext.fly(oldEl).removeClass('x-tab-strip-active');
+                }
+            }
+            if(item){
+                var el = this.getTabEl(item);
+                Ext.fly(el).addClass('x-tab-strip-active');
+                this.activeTab = item;
+                this.stack.add(item);
 
-    /**
-     * Show this button's menu (if it has one)
-     */
-    showMenu : function(){
-        if(this.rendered && this.menu){
-            if(this.tooltip){
-                Ext.QuickTips.getQuickTip().cancelShow(this.btnEl);
+                this.layout.setActiveItem(item);
+                if(this.scrolling){
+                    this.scrollToTab(item, this.animScroll);
+                }
             }
-            this.menu.show(this.el, this.menuAlign);
+            this.fireEvent('tabchange', this, item);
         }
-        return this;
     },
 
     /**
-     * Hide this button's menu (if it has one)
+     * Returns the Component which is the currently active tab. <b>Note that before the TabPanel
+     * first activates a child Component, this method will return whatever was configured in the
+     * {@link #activeTab} config option.</b>
+     * @return {BoxComponent} The currently active child Component if one <i>is</i> active, or the {@link #activeTab} config value.
      */
-    hideMenu : function(){
-        if(this.menu){
-            this.menu.hide();
-        }
-        return this;
+    getActiveTab : function(){
+        return this.activeTab || null;
     },
 
     /**
-     * Returns true if the button has a menu and it is visible
-     * @return {Boolean}
+     * Gets the specified tab by id.
+     * @param {String} id The tab id
+     * @return {Panel} The tab
      */
-    hasVisibleMenu : function(){
-        return this.menu && this.menu.isVisible();
+    getItem : function(item){
+        return this.getComponent(item);
     },
 
     // private
-    onClick : function(e){
-        if(e){
-            e.preventDefault();
-        }
-        if(e.button !== 0){
+    autoScrollTabs : function(){
+        this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
+        var count = this.items.length,
+            ow = this.pos.dom.offsetWidth,
+            tw = this.pos.dom.clientWidth,
+            wrap = this.stripWrap,
+            wd = wrap.dom,
+            cw = wd.offsetWidth,
+            pos = this.getScrollPos(),
+            l = this.edge.getOffsetsTo(this.stripWrap)[0] + pos;
+
+        if(!this.enableTabScroll || count < 1 || cw < 20){ // 20 to prevent display:none issues
             return;
         }
-        if(!this.disabled){
-            if(this.enableToggle && (this.allowDepress !== false || !this.pressed)){
-                this.toggle();
+        if(l <= tw){
+            wd.scrollLeft = 0;
+            wrap.setWidth(tw);
+            if(this.scrolling){
+                this.scrolling = false;
+                this.pos.removeClass('x-tab-scrolling');
+                this.scrollLeft.hide();
+                this.scrollRight.hide();
+                // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari
+                if(Ext.isAir || Ext.isWebKit){
+                    wd.style.marginLeft = '';
+                    wd.style.marginRight = '';
+                }
+            }
+        }else{
+            if(!this.scrolling){
+                this.pos.addClass('x-tab-scrolling');
+                // See here: http://extjs.com/forum/showthread.php?t=49308&highlight=isSafari
+                if(Ext.isAir || Ext.isWebKit){
+                    wd.style.marginLeft = '18px';
+                    wd.style.marginRight = '18px';
+                }
             }
-            if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){
-                this.showMenu();
+            tw -= wrap.getMargins('lr');
+            wrap.setWidth(tw > 20 ? tw : 20);
+            if(!this.scrolling){
+                if(!this.scrollLeft){
+                    this.createScrollers();
+                }else{
+                    this.scrollLeft.show();
+                    this.scrollRight.show();
+                }
             }
-            this.fireEvent('click', this, e);
-            if(this.handler){
-                //this.el.removeClass('x-btn-over');
-                this.handler.call(this.scope || this, this, e);
+            this.scrolling = true;
+            if(pos > (l-tw)){ // ensure it stays within bounds
+                wd.scrollLeft = l-tw;
+            }else{ // otherwise, make sure the active tab is still visible
+                this.scrollToTab(this.activeTab, false);
             }
+            this.updateScrollButtons();
         }
     },
 
     // private
-    isMenuTriggerOver : function(e, internal){
-        return this.menu && !internal;
+    createScrollers : function(){
+        this.pos.addClass('x-tab-scrolling-' + this.tabPosition);
+        var h = this.stripWrap.dom.offsetHeight;
+
+        // left
+        var sl = this.pos.insertFirst({
+            cls:'x-tab-scroller-left'
+        });
+        sl.setHeight(h);
+        sl.addClassOnOver('x-tab-scroller-left-over');
+        this.leftRepeater = new Ext.util.ClickRepeater(sl, {
+            interval : this.scrollRepeatInterval,
+            handler: this.onScrollLeft,
+            scope: this
+        });
+        this.scrollLeft = sl;
+
+        // right
+        var sr = this.pos.insertFirst({
+            cls:'x-tab-scroller-right'
+        });
+        sr.setHeight(h);
+        sr.addClassOnOver('x-tab-scroller-right-over');
+        this.rightRepeater = new Ext.util.ClickRepeater(sr, {
+            interval : this.scrollRepeatInterval,
+            handler: this.onScrollRight,
+            scope: this
+        });
+        this.scrollRight = sr;
     },
 
     // private
-    isMenuTriggerOut : function(e, internal){
-        return this.menu && !internal;
+    getScrollWidth : function(){
+        return this.edge.getOffsetsTo(this.stripWrap)[0] + this.getScrollPos();
     },
 
     // private
-    onMouseOver : function(e){
-        if(!this.disabled){
-            var internal = e.within(this.el,  true);
-            if(!internal){
-                this.el.addClass('x-btn-over');
-                if(!this.monitoringMouseOver){
-                    Ext.getDoc().on('mouseover', this.monitorMouseOver, this);
-                    this.monitoringMouseOver = true;
-                }
-                this.fireEvent('mouseover', this, e);
-            }
-            if(this.isMenuTriggerOver(e, internal)){
-                this.fireEvent('menutriggerover', this, this.menu, e);
-            }
-        }
+    getScrollPos : function(){
+        return parseInt(this.stripWrap.dom.scrollLeft, 10) || 0;
     },
 
     // private
-    monitorMouseOver : function(e){
-        if(e.target != this.el.dom && !e.within(this.el)){
-            if(this.monitoringMouseOver){
-                Ext.getDoc().un('mouseover', this.monitorMouseOver, this);
-                this.monitoringMouseOver = false;
-            }
-            this.onMouseOut(e);
-        }
+    getScrollArea : function(){
+        return parseInt(this.stripWrap.dom.clientWidth, 10) || 0;
     },
 
     // private
-    onMouseOut : function(e){
-        var internal = e.within(this.el) && e.target != this.el.dom;
-        this.el.removeClass('x-btn-over');
-        this.fireEvent('mouseout', this, e);
-        if(this.isMenuTriggerOut(e, internal)){
-            this.fireEvent('menutriggerout', this, this.menu, e);
-        }
+    getScrollAnim : function(){
+        return {duration:this.scrollDuration, callback: this.updateScrollButtons, scope: this};
     },
+
     // private
-    onFocus : function(e){
-        if(!this.disabled){
-            this.el.addClass('x-btn-focus');
-        }
+    getScrollIncrement : function(){
+        return this.scrollIncrement || (this.resizeTabs ? this.lastTabWidth+2 : 100);
     },
-    // private
-    onBlur : function(e){
-        this.el.removeClass('x-btn-focus');
+
+    /**
+     * Scrolls to a particular tab if tab scrolling is enabled
+     * @param {Panel} item The item to scroll to
+     * @param {Boolean} animate True to enable animations
+     */
+
+    scrollToTab : function(item, animate){
+        if(!item){
+            return;
+        }
+        var el = this.getTabEl(item),
+            pos = this.getScrollPos(),
+            area = this.getScrollArea(),
+            left = Ext.fly(el).getOffsetsTo(this.stripWrap)[0] + pos,
+            right = left + el.offsetWidth;
+        if(left < pos){
+            this.scrollTo(left, animate);
+        }else if(right > (pos + area)){
+            this.scrollTo(right - area, animate);
+        }
     },
 
     // private
-    getClickEl : function(e, isUp){
-       return this.el;
+    scrollTo : function(pos, animate){
+        this.stripWrap.scrollTo('left', pos, animate ? this.getScrollAnim() : false);
+        if(!animate){
+            this.updateScrollButtons();
+        }
     },
 
-    // private
-    onMouseDown : function(e){
-        if(!this.disabled && e.button === 0){
-            this.getClickEl(e).addClass('x-btn-click');
-            Ext.getDoc().on('mouseup', this.onMouseUp, this);
+    onWheel : function(e){
+        var d = e.getWheelDelta()*this.wheelIncrement*-1;
+        e.stopEvent();
+
+        var pos = this.getScrollPos(),
+            newpos = pos + d,
+            sw = this.getScrollWidth()-this.getScrollArea();
+
+        var s = Math.max(0, Math.min(sw, newpos));
+        if(s != pos){
+            this.scrollTo(s, false);
         }
     },
+
     // private
-    onMouseUp : function(e){
-        if(e.button === 0){
-            this.getClickEl(e, true).removeClass('x-btn-click');
-            Ext.getDoc().un('mouseup', this.onMouseUp, this);
+    onScrollRight : function(){
+        var sw = this.getScrollWidth()-this.getScrollArea(),
+            pos = this.getScrollPos(),
+            s = Math.min(sw, pos + this.getScrollIncrement());
+        if(s != pos){
+            this.scrollTo(s, this.animScroll);
         }
     },
+
     // private
-    onMenuShow : function(e){
-        this.ignoreNextClick = 0;
-        this.el.addClass('x-btn-menu-active');
-        this.fireEvent('menushow', this, this.menu);
+    onScrollLeft : function(){
+        var pos = this.getScrollPos(),
+            s = Math.max(0, pos - this.getScrollIncrement());
+        if(s != pos){
+            this.scrollTo(s, this.animScroll);
+        }
     },
+
     // private
-    onMenuHide : function(e){
-        this.el.removeClass('x-btn-menu-active');
-        this.ignoreNextClick = this.restoreClick.defer(250, this);
-        this.fireEvent('menuhide', this, this.menu);
+    updateScrollButtons : function(){
+        var pos = this.getScrollPos();
+        this.scrollLeft[pos === 0 ? 'addClass' : 'removeClass']('x-tab-scroller-left-disabled');
+        this.scrollRight[pos >= (this.getScrollWidth()-this.getScrollArea()) ? 'addClass' : 'removeClass']('x-tab-scroller-right-disabled');
     },
 
     // private
-    restoreClick : function(){
-        this.ignoreNextClick = 0;
+    beforeDestroy : function() {
+        Ext.destroy(this.leftRepeater, this.rightRepeater);
+        this.deleteMembers('strip', 'edge', 'scrollLeft', 'scrollRight', 'stripWrap');
+        this.activeTab = null;
+        Ext.TabPanel.superclass.beforeDestroy.apply(this);
     }
 
-
-
     /**
-     * @cfg {String} autoEl @hide
+     * @cfg {Boolean} collapsible
+     * @hide
+     */
+    /**
+     * @cfg {String} header
+     * @hide
+     */
+    /**
+     * @cfg {Boolean} headerAsText
+     * @hide
+     */
+    /**
+     * @property header
+     * @hide
+     */
+    /**
+     * @cfg title
+     * @hide
+     */
+    /**
+     * @cfg {Array} tools
+     * @hide
+     */
+    /**
+     * @cfg {Array} toolTemplate
+     * @hide
+     */
+    /**
+     * @cfg {Boolean} hideCollapseTool
+     * @hide
+     */
+    /**
+     * @cfg {Boolean} titleCollapse
+     * @hide
+     */
+    /**
+     * @cfg {Boolean} collapsed
+     * @hide
+     */
+    /**
+     * @cfg {String} layout
+     * @hide
+     */
+    /**
+     * @cfg {Boolean} preventBodyReset
+     * @hide
      */
 });
-Ext.reg('button', Ext.Button);
-
-// Private utility class used by Button
-Ext.ButtonToggleMgr = function(){
-   var groups = {};
+Ext.reg('tabpanel', Ext.TabPanel);
 
-   function toggleGroup(btn, state){
-       if(state){
-           var g = groups[btn.toggleGroup];
-           for(var i = 0, l = g.length; i < l; i++){
-               if(g[i] != btn){
-                   g[i].toggle(false);
-               }
-           }
-       }
-   }
+/**
+ * See {@link #setActiveTab}. Sets the specified tab as the active tab. This method fires
+ * the {@link #beforetabchange} event which can <tt>return false</tt> to cancel the tab change.
+ * @param {String/Panel} tab The id or tab Panel to activate
+ * @method activate
+ */
+Ext.TabPanel.prototype.activate = Ext.TabPanel.prototype.setActiveTab;
 
-   return {
-       register : function(btn){
-           if(!btn.toggleGroup){
-               return;
-           }
-           var g = groups[btn.toggleGroup];
-           if(!g){
-               g = groups[btn.toggleGroup] = [];
-           }
-           g.push(btn);
-           btn.on('toggle', toggleGroup);
-       },
+// private utility class used by TabPanel
+Ext.TabPanel.AccessStack = function(){
+    var items = [];
+    return {
+        add : function(item){
+            items.push(item);
+            if(items.length > 10){
+                items.shift();
+            }
+        },
 
-       unregister : function(btn){
-           if(!btn.toggleGroup){
-               return;
-           }
-           var g = groups[btn.toggleGroup];
-           if(g){
-               g.remove(btn);
-               btn.un('toggle', toggleGroup);
-           }
-       },
+        remove : function(item){
+            var s = [];
+            for(var i = 0, len = items.length; i < len; i++) {
+                if(items[i] != item){
+                    s.push(items[i]);
+                }
+            }
+            items = s;
+        },
 
-       /**
-        * Gets the pressed button in the passed group or null
-        * @param {String} group
-        * @return Button
-        */
-       getPressed : function(group){
-           var g = groups[group];
-           if(g){
-               for(var i = 0, len = g.length; i < len; i++){
-                   if(g[i].pressed === true){
-                       return g[i];
-                   }
-               }
-           }
-           return null;
-       }
-   };
-}();/**\r
+        next : function(){
+            return items.pop();
+        }
+    };
+};
+/**\r
+ * @class Ext.Button\r
+ * @extends Ext.BoxComponent\r
+ * Simple Button class\r
+ * @cfg {String} text The button text to be used as innerHTML (html tags are accepted)\r
+ * @cfg {String} icon The path to an image to display in the button (the image will be set as the background-image\r
+ * CSS property of the button by default, so if you want a mixed icon/text button, set cls:'x-btn-text-icon')\r
+ * @cfg {Function} handler A function called when the button is clicked (can be used instead of click event).\r
+ * The handler is passed the following parameters:<div class="mdetail-params"><ul>\r
+ * <li><code>b</code> : Button<div class="sub-desc">This Button.</div></li>\r
+ * <li><code>e</code> : EventObject<div class="sub-desc">The click event.</div></li>\r
+ * </ul></div>\r
+ * @cfg {Number} minWidth The minimum width for this button (used to give a set of buttons a common width).\r
+ * See also {@link Ext.Panel}.<tt>{@link Ext.Panel#minButtonWidth minButtonWidth}</tt>.\r
+ * @cfg {String/Object} tooltip The tooltip for the button - can be a string to be used as innerHTML (html tags are accepted) or QuickTips config object\r
+ * @cfg {Boolean} hidden True to start hidden (defaults to false)\r
+ * @cfg {Boolean} disabled True to start disabled (defaults to false)\r
+ * @cfg {Boolean} pressed True to start pressed (only if enableToggle = true)\r
+ * @cfg {String} toggleGroup The group this toggle button is a member of (only 1 per group can be pressed)\r
+ * @cfg {Boolean/Object} repeat True to repeat fire the click event while the mouse is down. This can also be\r
+ * a {@link Ext.util.ClickRepeater ClickRepeater} config object (defaults to false).\r
+ * @constructor\r
+ * Create a new button\r
+ * @param {Object} config The config object\r
+ * @xtype button\r
+ */\r
+Ext.Button = Ext.extend(Ext.BoxComponent, {\r
+    /**\r
+     * Read-only. True if this button is hidden\r
+     * @type Boolean\r
+     */\r
+    hidden : false,\r
+    /**\r
+     * Read-only. True if this button is disabled\r
+     * @type Boolean\r
+     */\r
+    disabled : false,\r
+    /**\r
+     * Read-only. True if this button is pressed (only if enableToggle = true)\r
+     * @type Boolean\r
+     */\r
+    pressed : false,\r
+\r
+    /**\r
+     * @cfg {Number} tabIndex Set a DOM tabIndex for this button (defaults to undefined)\r
+     */\r
+\r
+    /**\r
+     * @cfg {Boolean} allowDepress\r
+     * False to not allow a pressed Button to be depressed (defaults to undefined). Only valid when {@link #enableToggle} is true.\r
+     */\r
+\r
+    /**\r
+     * @cfg {Boolean} enableToggle\r
+     * True to enable pressed/not pressed toggling (defaults to false)\r
+     */\r
+    enableToggle : false,\r
+    /**\r
+     * @cfg {Function} toggleHandler\r
+     * Function called when a Button with {@link #enableToggle} set to true is clicked. Two arguments are passed:<ul class="mdetail-params">\r
+     * <li><b>button</b> : Ext.Button<div class="sub-desc">this Button object</div></li>\r
+     * <li><b>state</b> : Boolean<div class="sub-desc">The next state of the Button, true means pressed.</div></li>\r
+     * </ul>\r
+     */\r
+    /**\r
+     * @cfg {Mixed} menu\r
+     * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob (defaults to undefined).\r
+     */\r
+    /**\r
+     * @cfg {String} menuAlign\r
+     * The position to align the menu to (see {@link Ext.Element#alignTo} for more details, defaults to 'tl-bl?').\r
+     */\r
+    menuAlign : 'tl-bl?',\r
+\r
+    /**\r
+     * @cfg {String} overflowText If used in a {@link Ext.Toolbar Toolbar}, the\r
+     * text to be used if this item is shown in the overflow menu. See also\r
+     * {@link Ext.Toolbar.Item}.<code>{@link Ext.Toolbar.Item#overflowText overflowText}</code>.\r
+     */\r
+    /**\r
+     * @cfg {String} iconCls\r
+     * A css class which sets a background image to be used as the icon for this button\r
+     */\r
+    /**\r
+     * @cfg {String} type\r
+     * submit, reset or button - defaults to 'button'\r
+     */\r
+    type : 'button',\r
+\r
+    // private\r
+    menuClassTarget : 'tr:nth(2)',\r
+\r
+    /**\r
+     * @cfg {String} clickEvent\r
+     * The DOM event that will fire the handler of the button. This can be any valid event name (dblclick, contextmenu).\r
+     * Defaults to <tt>'click'</tt>.\r
+     */\r
+    clickEvent : 'click',\r
+\r
+    /**\r
+     * @cfg {Boolean} handleMouseEvents\r
+     * False to disable visual cues on mouseover, mouseout and mousedown (defaults to true)\r
+     */\r
+    handleMouseEvents : true,\r
+\r
+    /**\r
+     * @cfg {String} tooltipType\r
+     * The type of tooltip to use. Either 'qtip' (default) for QuickTips or 'title' for title attribute.\r
+     */\r
+    tooltipType : 'qtip',\r
+\r
+    /**\r
+     * @cfg {String} buttonSelector\r
+     * <p>(Optional) A {@link Ext.DomQuery DomQuery} selector which is used to extract the active, clickable element from the\r
+     * DOM structure created.</p>\r
+     * <p>When a custom {@link #template} is used, you  must ensure that this selector results in the selection of\r
+     * a focussable element.</p>\r
+     * <p>Defaults to <b><tt>'button:first-child'</tt></b>.</p>\r
+     */\r
+    buttonSelector : 'button:first-child',\r
+\r
+    /**\r
+     * @cfg {String} scale\r
+     * <p>(Optional) The size of the Button. Three values are allowed:</p>\r
+     * <ul class="mdetail-params">\r
+     * <li>'small'<div class="sub-desc">Results in the button element being 16px high.</div></li>\r
+     * <li>'medium'<div class="sub-desc">Results in the button element being 24px high.</div></li>\r
+     * <li>'large'<div class="sub-desc">Results in the button element being 32px high.</div></li>\r
+     * </ul>\r
+     * <p>Defaults to <b><tt>'small'</tt></b>.</p>\r
+     */\r
+    scale : 'small',\r
+\r
+    /**\r
+     * @cfg {Object} scope The scope (<tt><b>this</b></tt> reference) in which the\r
+     * <code>{@link #handler}</code> and <code>{@link #toggleHandler}</code> is\r
+     * executed. Defaults to this Button.\r
+     */\r
+\r
+    /**\r
+     * @cfg {String} iconAlign\r
+     * <p>(Optional) The side of the Button box to render the icon. Four values are allowed:</p>\r
+     * <ul class="mdetail-params">\r
+     * <li>'top'<div class="sub-desc"></div></li>\r
+     * <li>'right'<div class="sub-desc"></div></li>\r
+     * <li>'bottom'<div class="sub-desc"></div></li>\r
+     * <li>'left'<div class="sub-desc"></div></li>\r
+     * </ul>\r
+     * <p>Defaults to <b><tt>'left'</tt></b>.</p>\r
+     */\r
+    iconAlign : 'left',\r
+\r
+    /**\r
+     * @cfg {String} arrowAlign\r
+     * <p>(Optional) The side of the Button box to render the arrow if the button has an associated {@link #menu}.\r
+     * Two values are allowed:</p>\r
+     * <ul class="mdetail-params">\r
+     * <li>'right'<div class="sub-desc"></div></li>\r
+     * <li>'bottom'<div class="sub-desc"></div></li>\r
+     * </ul>\r
+     * <p>Defaults to <b><tt>'right'</tt></b>.</p>\r
+     */\r
+    arrowAlign : 'right',\r
+\r
+    /**\r
+     * @cfg {Ext.Template} template (Optional)\r
+     * <p>A {@link Ext.Template Template} used to create the Button's DOM structure.</p>\r
+     * Instances, or subclasses which need a different DOM structure may provide a different\r
+     * template layout in conjunction with an implementation of {@link #getTemplateArgs}.\r
+     * @type Ext.Template\r
+     * @property template\r
+     */\r
+    /**\r
+     * @cfg {String} cls\r
+     * A CSS class string to apply to the button's main element.\r
+     */\r
+    /**\r
+     * @property menu\r
+     * @type Menu\r
+     * The {@link Ext.menu.Menu Menu} object associated with this Button when configured with the {@link #menu} config option.\r
+     */\r
+\r
+    initComponent : function(){\r
+        Ext.Button.superclass.initComponent.call(this);\r
+\r
+        this.addEvents(\r
+            /**\r
+             * @event click\r
+             * Fires when this button is clicked\r
+             * @param {Button} this\r
+             * @param {EventObject} e The click event\r
+             */\r
+            'click',\r
+            /**\r
+             * @event toggle\r
+             * Fires when the 'pressed' state of this button changes (only if enableToggle = true)\r
+             * @param {Button} this\r
+             * @param {Boolean} pressed\r
+             */\r
+            'toggle',\r
+            /**\r
+             * @event mouseover\r
+             * Fires when the mouse hovers over the button\r
+             * @param {Button} this\r
+             * @param {Event} e The event object\r
+             */\r
+            'mouseover',\r
+            /**\r
+             * @event mouseout\r
+             * Fires when the mouse exits the button\r
+             * @param {Button} this\r
+             * @param {Event} e The event object\r
+             */\r
+            'mouseout',\r
+            /**\r
+             * @event menushow\r
+             * If this button has a menu, this event fires when it is shown\r
+             * @param {Button} this\r
+             * @param {Menu} menu\r
+             */\r
+            'menushow',\r
+            /**\r
+             * @event menuhide\r
+             * If this button has a menu, this event fires when it is hidden\r
+             * @param {Button} this\r
+             * @param {Menu} menu\r
+             */\r
+            'menuhide',\r
+            /**\r
+             * @event menutriggerover\r
+             * If this button has a menu, this event fires when the mouse enters the menu triggering element\r
+             * @param {Button} this\r
+             * @param {Menu} menu\r
+             * @param {EventObject} e\r
+             */\r
+            'menutriggerover',\r
+            /**\r
+             * @event menutriggerout\r
+             * If this button has a menu, this event fires when the mouse leaves the menu triggering element\r
+             * @param {Button} this\r
+             * @param {Menu} menu\r
+             * @param {EventObject} e\r
+             */\r
+            'menutriggerout'\r
+        );\r
+        if(this.menu){\r
+            this.menu = Ext.menu.MenuMgr.get(this.menu);\r
+        }\r
+        if(Ext.isString(this.toggleGroup)){\r
+            this.enableToggle = true;\r
+        }\r
+    },\r
+\r
+/**\r
+  * <p>This method returns an Array which provides substitution parameters for the {@link #template Template} used\r
+  * to create this Button's DOM structure.</p>\r
+  * <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their\r
+  * own implementation of this method.</p>\r
+  * <p>The default implementation which provides data for the default {@link #template} returns an Array containing the\r
+  * following items:</p><div class="mdetail-params"><ul>\r
+  * <li>The &lt;button&gt;'s {@link #type}</li>\r
+  * <li>A CSS class name applied to the Button's main &lt;tbody&gt; element which determines the button's scale and icon alignment.</li>\r
+  * <li>A CSS class to determine the presence and position of an arrow icon. (<code>'x-btn-arrow'</code> or <code>'x-btn-arrow-bottom'</code> or <code>''</code>)</li>\r
+  * <li>The {@link #cls} CSS class name applied to the button's wrapping &lt;table&gt; element.</li>\r
+  * <li>The Component id which is applied to the button's wrapping &lt;table&gt; element.</li>\r
+  * </ul></div>\r
+  * @return {Array} Substitution data for a Template.\r
+ */\r
+    getTemplateArgs : function(){\r
+        return [this.type, 'x-btn-' + this.scale + ' x-btn-icon-' + this.scale + '-' + this.iconAlign, this.getMenuClass(), this.cls, this.id];\r
+    },\r
+\r
+    // private\r
+    setButtonClass : function(){\r
+        if(this.useSetClass){\r
+            if(!Ext.isEmpty(this.oldCls)){\r
+                this.el.removeClass([this.oldCls, 'x-btn-pressed']);\r
+            }\r
+            this.oldCls = (this.iconCls || this.icon) ? (this.text ? ' x-btn-text-icon' : ' x-btn-icon') : ' x-btn-noicon';\r
+            this.el.addClass([this.oldCls, this.pressed ? 'x-btn-pressed' : null]);\r
+        }\r
+    },\r
+\r
+    // protected\r
+    getMenuClass : function(){\r
+        return this.menu ? (this.arrowAlign != 'bottom' ? 'x-btn-arrow' : 'x-btn-arrow-bottom') : '';\r
+    },\r
+\r
+    // private\r
+    onRender : function(ct, position){\r
+        if(!this.template){\r
+            if(!Ext.Button.buttonTemplate){\r
+                // hideous table template\r
+                Ext.Button.buttonTemplate = new Ext.Template(\r
+                    '<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',\r
+                    '<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>',\r
+                    '<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',\r
+                    '<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',\r
+                    '</tbody></table>');\r
+                Ext.Button.buttonTemplate.compile();\r
+            }\r
+            this.template = Ext.Button.buttonTemplate;\r
+        }\r
+\r
+        var btn, targs = this.getTemplateArgs();\r
+\r
+        if(position){\r
+            btn = this.template.insertBefore(position, targs, true);\r
+        }else{\r
+            btn = this.template.append(ct, targs, true);\r
+        }\r
+        /**\r
+         * An {@link Ext.Element Element} encapsulating the Button's clickable element. By default,\r
+         * this references a <tt>&lt;button&gt;</tt> element. Read only.\r
+         * @type Ext.Element\r
+         * @property btnEl\r
+         */\r
+        this.btnEl = btn.child(this.buttonSelector);\r
+        this.mon(this.btnEl, {\r
+            scope: this,\r
+            focus: this.onFocus,\r
+            blur: this.onBlur\r
+        });\r
+\r
+        this.initButtonEl(btn, this.btnEl);\r
+\r
+        Ext.ButtonToggleMgr.register(this);\r
+    },\r
+\r
+    // private\r
+    initButtonEl : function(btn, btnEl){\r
+        this.el = btn;\r
+        this.setIcon(this.icon);\r
+        this.setText(this.text);\r
+        this.setIconClass(this.iconCls);\r
+        if(Ext.isDefined(this.tabIndex)){\r
+            btnEl.dom.tabIndex = this.tabIndex;\r
+        }\r
+        if(this.tooltip){\r
+            this.setTooltip(this.tooltip, true);\r
+        }\r
+\r
+        if(this.handleMouseEvents){\r
+            this.mon(btn, {\r
+                scope: this,\r
+                mouseover: this.onMouseOver,\r
+                mousedown: this.onMouseDown\r
+            });\r
+\r
+            // new functionality for monitoring on the document level\r
+            //this.mon(btn, 'mouseout', this.onMouseOut, this);\r
+        }\r
+\r
+        if(this.menu){\r
+            this.mon(this.menu, {\r
+                scope: this,\r
+                show: this.onMenuShow,\r
+                hide: this.onMenuHide\r
+            });\r
+        }\r
+\r
+        if(this.repeat){\r
+            var repeater = new Ext.util.ClickRepeater(btn, Ext.isObject(this.repeat) ? this.repeat : {});\r
+            this.mon(repeater, 'click', this.onClick, this);\r
+        }\r
+        this.mon(btn, this.clickEvent, this.onClick, this);\r
+    },\r
+\r
+    // private\r
+    afterRender : function(){\r
+        Ext.Button.superclass.afterRender.call(this);\r
+        this.useSetClass = true;\r
+        this.setButtonClass();\r
+        this.doc = Ext.getDoc();\r
+        this.doAutoWidth();\r
+    },\r
+\r
+    /**\r
+     * Sets the CSS class that provides a background image to use as the button's icon.  This method also changes\r
+     * the value of the {@link iconCls} config internally.\r
+     * @param {String} cls The CSS class providing the icon image\r
+     * @return {Ext.Button} this\r
+     */\r
+    setIconClass : function(cls){\r
+        this.iconCls = cls;\r
+        if(this.el){\r
+            this.btnEl.dom.className = '';\r
+            this.btnEl.addClass(['x-btn-text', cls || '']);\r
+            this.setButtonClass();\r
+        }\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the tooltip for this Button.\r
+     * @param {String/Object} tooltip. This may be:<div class="mdesc-details"><ul>\r
+     * <li><b>String</b> : A string to be used as innerHTML (html tags are accepted) to show in a tooltip</li>\r
+     * <li><b>Object</b> : A configuration object for {@link Ext.QuickTips#register}.</li>\r
+     * </ul></div>\r
+     * @return {Ext.Button} this\r
+     */\r
+    setTooltip : function(tooltip, /* private */ initial){\r
+        if(this.rendered){\r
+            if(!initial){\r
+                this.clearTip();\r
+            }\r
+            if(Ext.isObject(tooltip)){\r
+                Ext.QuickTips.register(Ext.apply({\r
+                      target: this.btnEl.id\r
+                }, tooltip));\r
+                this.tooltip = tooltip;\r
+            }else{\r
+                this.btnEl.dom[this.tooltipType] = tooltip;\r
+            }\r
+        }else{\r
+            this.tooltip = tooltip;\r
+        }\r
+        return this;\r
+    },\r
+\r
+    // private\r
+    clearTip : function(){\r
+        if(Ext.isObject(this.tooltip)){\r
+            Ext.QuickTips.unregister(this.btnEl);\r
+        }\r
+    },\r
+\r
+    // private\r
+    beforeDestroy : function(){\r
+        if(this.rendered){\r
+            this.clearTip();\r
+        }\r
+        if(this.menu && this.destroyMenu !== false) {\r
+            Ext.destroy(this.menu);\r
+        }\r
+        Ext.destroy(this.repeater);\r
+    },\r
+\r
+    // private\r
+    onDestroy : function(){\r
+        if(this.rendered){\r
+            this.doc.un('mouseover', this.monitorMouseOver, this);\r
+            this.doc.un('mouseup', this.onMouseUp, this);\r
+            delete this.doc;\r
+            delete this.btnEl;\r
+            Ext.ButtonToggleMgr.unregister(this);\r
+        }\r
+        Ext.Button.superclass.onDestroy.call(this);\r
+    },\r
+\r
+    // private\r
+    doAutoWidth : function(){\r
+        if(this.el && this.text && this.width === undefined){\r
+            this.el.setWidth('auto');\r
+            if(Ext.isIE7 && Ext.isStrict){\r
+                var ib = this.btnEl;\r
+                if(ib && ib.getWidth() > 20){\r
+                    ib.clip();\r
+                    ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));\r
+                }\r
+            }\r
+            if(this.minWidth){\r
+                if(this.el.getWidth() < this.minWidth){\r
+                    this.el.setWidth(this.minWidth);\r
+                }\r
+            }\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Assigns this Button's click handler\r
+     * @param {Function} handler The function to call when the button is clicked\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function is executed.\r
+     * Defaults to this Button.\r
+     * @return {Ext.Button} this\r
+     */\r
+    setHandler : function(handler, scope){\r
+        this.handler = handler;\r
+        this.scope = scope;\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets this Button's text\r
+     * @param {String} text The button text\r
+     * @return {Ext.Button} this\r
+     */\r
+    setText : function(text){\r
+        this.text = text;\r
+        if(this.el){\r
+            this.btnEl.update(text || '&#160;');\r
+            this.setButtonClass();\r
+        }\r
+        this.doAutoWidth();\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Sets the background image (inline style) of the button.  This method also changes\r
+     * the value of the {@link icon} config internally.\r
+     * @param {String} icon The path to an image to display in the button\r
+     * @return {Ext.Button} this\r
+     */\r
+    setIcon : function(icon){\r
+        this.icon = icon;\r
+        if(this.el){\r
+            this.btnEl.setStyle('background-image', icon ? 'url(' + icon + ')' : '');\r
+            this.setButtonClass();\r
+        }\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Gets the text for this Button\r
+     * @return {String} The button text\r
+     */\r
+    getText : function(){\r
+        return this.text;\r
+    },\r
+\r
+    /**\r
+     * If a state it passed, it becomes the pressed state otherwise the current state is toggled.\r
+     * @param {Boolean} state (optional) Force a particular state\r
+     * @param {Boolean} supressEvent (optional) True to stop events being fired when calling this method.\r
+     * @return {Ext.Button} this\r
+     */\r
+    toggle : function(state, suppressEvent){\r
+        state = state === undefined ? !this.pressed : !!state;\r
+        if(state != this.pressed){\r
+            if(this.rendered){\r
+                this.el[state ? 'addClass' : 'removeClass']('x-btn-pressed');\r
+            }\r
+            this.pressed = state;\r
+            if(!suppressEvent){\r
+                this.fireEvent('toggle', this, state);\r
+                if(this.toggleHandler){\r
+                    this.toggleHandler.call(this.scope || this, this, state);\r
+                }\r
+            }\r
+        }\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Focus the button\r
+     */\r
+    focus : function(){\r
+        this.btnEl.focus();\r
+    },\r
+\r
+    // private\r
+    onDisable : function(){\r
+        this.onDisableChange(true);\r
+    },\r
+\r
+    // private\r
+    onEnable : function(){\r
+        this.onDisableChange(false);\r
+    },\r
+\r
+    onDisableChange : function(disabled){\r
+        if(this.el){\r
+            if(!Ext.isIE6 || !this.text){\r
+                this.el[disabled ? 'addClass' : 'removeClass'](this.disabledClass);\r
+            }\r
+            this.el.dom.disabled = disabled;\r
+        }\r
+        this.disabled = disabled;\r
+    },\r
+\r
+    /**\r
+     * Show this button's menu (if it has one)\r
+     */\r
+    showMenu : function(){\r
+        if(this.rendered && this.menu){\r
+            if(this.tooltip){\r
+                Ext.QuickTips.getQuickTip().cancelShow(this.btnEl);\r
+            }\r
+            if(this.menu.isVisible()){\r
+                this.menu.hide();\r
+            }\r
+            this.menu.ownerCt = this;\r
+            this.menu.show(this.el, this.menuAlign);\r
+        }\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Hide this button's menu (if it has one)\r
+     */\r
+    hideMenu : function(){\r
+        if(this.hasVisibleMenu()){\r
+            this.menu.hide();\r
+        }\r
+        return this;\r
+    },\r
+\r
+    /**\r
+     * Returns true if the button has a menu and it is visible\r
+     * @return {Boolean}\r
+     */\r
+    hasVisibleMenu : function(){\r
+        return this.menu && this.menu.ownerCt == this && this.menu.isVisible();\r
+    },\r
+\r
+    // private\r
+    onClick : function(e){\r
+        if(e){\r
+            e.preventDefault();\r
+        }\r
+        if(e.button !== 0){\r
+            return;\r
+        }\r
+        if(!this.disabled){\r
+            if(this.enableToggle && (this.allowDepress !== false || !this.pressed)){\r
+                this.toggle();\r
+            }\r
+            if(this.menu && !this.hasVisibleMenu() && !this.ignoreNextClick){\r
+                this.showMenu();\r
+            }\r
+            this.fireEvent('click', this, e);\r
+            if(this.handler){\r
+                //this.el.removeClass('x-btn-over');\r
+                this.handler.call(this.scope || this, this, e);\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    isMenuTriggerOver : function(e, internal){\r
+        return this.menu && !internal;\r
+    },\r
+\r
+    // private\r
+    isMenuTriggerOut : function(e, internal){\r
+        return this.menu && !internal;\r
+    },\r
+\r
+    // private\r
+    onMouseOver : function(e){\r
+        if(!this.disabled){\r
+            var internal = e.within(this.el,  true);\r
+            if(!internal){\r
+                this.el.addClass('x-btn-over');\r
+                if(!this.monitoringMouseOver){\r
+                    this.doc.on('mouseover', this.monitorMouseOver, this);\r
+                    this.monitoringMouseOver = true;\r
+                }\r
+                this.fireEvent('mouseover', this, e);\r
+            }\r
+            if(this.isMenuTriggerOver(e, internal)){\r
+                this.fireEvent('menutriggerover', this, this.menu, e);\r
+            }\r
+        }\r
+    },\r
+\r
+    // private\r
+    monitorMouseOver : function(e){\r
+        if(e.target != this.el.dom && !e.within(this.el)){\r
+            if(this.monitoringMouseOver){\r
+                this.doc.un('mouseover', this.monitorMouseOver, this);\r
+                this.monitoringMouseOver = false;\r
+            }\r
+            this.onMouseOut(e);\r
+        }\r
+    },\r
+\r
+    // private\r
+    onMouseOut : function(e){\r
+        var internal = e.within(this.el) && e.target != this.el.dom;\r
+        this.el.removeClass('x-btn-over');\r
+        this.fireEvent('mouseout', this, e);\r
+        if(this.isMenuTriggerOut(e, internal)){\r
+            this.fireEvent('menutriggerout', this, this.menu, e);\r
+        }\r
+    },\r
+\r
+    focus : function() {\r
+        this.btnEl.focus();\r
+    },\r
+\r
+    blur : function() {\r
+        this.btnEl.blur();\r
+    },\r
+\r
+    // private\r
+    onFocus : function(e){\r
+        if(!this.disabled){\r
+            this.el.addClass('x-btn-focus');\r
+        }\r
+    },\r
+    // private\r
+    onBlur : function(e){\r
+        this.el.removeClass('x-btn-focus');\r
+    },\r
+\r
+    // private\r
+    getClickEl : function(e, isUp){\r
+       return this.el;\r
+    },\r
+\r
+    // private\r
+    onMouseDown : function(e){\r
+        if(!this.disabled && e.button === 0){\r
+            this.getClickEl(e).addClass('x-btn-click');\r
+            this.doc.on('mouseup', this.onMouseUp, this);\r
+        }\r
+    },\r
+    // private\r
+    onMouseUp : function(e){\r
+        if(e.button === 0){\r
+            this.getClickEl(e, true).removeClass('x-btn-click');\r
+            this.doc.un('mouseup', this.onMouseUp, this);\r
+        }\r
+    },\r
+    // private\r
+    onMenuShow : function(e){\r
+        if(this.menu.ownerCt == this){\r
+            this.menu.ownerCt = this;\r
+            this.ignoreNextClick = 0;\r
+            this.el.addClass('x-btn-menu-active');\r
+            this.fireEvent('menushow', this, this.menu);\r
+        }\r
+    },\r
+    // private\r
+    onMenuHide : function(e){\r
+        if(this.menu.ownerCt == this){\r
+            this.el.removeClass('x-btn-menu-active');\r
+            this.ignoreNextClick = this.restoreClick.defer(250, this);\r
+            this.fireEvent('menuhide', this, this.menu);\r
+            delete this.menu.ownerCt;\r
+        }\r
+    },\r
+\r
+    // private\r
+    restoreClick : function(){\r
+        this.ignoreNextClick = 0;\r
+    }\r
+\r
+    /**\r
+     * @cfg {String} autoEl @hide\r
+     */\r
+    /**\r
+     * @cfg {String/Object} html @hide\r
+     */\r
+    /**\r
+     * @cfg {String} contentEl  @hide\r
+     */\r
+    /**\r
+     * @cfg {Mixed} data  @hide\r
+     */\r
+    /**\r
+     * @cfg {Mixed} tpl  @hide\r
+     */\r
+    /**\r
+     * @cfg {String} tplWriteMode  @hide\r
+     */\r
+});\r
+Ext.reg('button', Ext.Button);\r
+\r
+// Private utility class used by Button\r
+Ext.ButtonToggleMgr = function(){\r
+   var groups = {};\r
+\r
+   function toggleGroup(btn, state){\r
+       if(state){\r
+           var g = groups[btn.toggleGroup];\r
+           for(var i = 0, l = g.length; i < l; i++){\r
+               if(g[i] != btn){\r
+                   g[i].toggle(false);\r
+               }\r
+           }\r
+       }\r
+   }\r
+\r
+   return {\r
+       register : function(btn){\r
+           if(!btn.toggleGroup){\r
+               return;\r
+           }\r
+           var g = groups[btn.toggleGroup];\r
+           if(!g){\r
+               g = groups[btn.toggleGroup] = [];\r
+           }\r
+           g.push(btn);\r
+           btn.on('toggle', toggleGroup);\r
+       },\r
+\r
+       unregister : function(btn){\r
+           if(!btn.toggleGroup){\r
+               return;\r
+           }\r
+           var g = groups[btn.toggleGroup];\r
+           if(g){\r
+               g.remove(btn);\r
+               btn.un('toggle', toggleGroup);\r
+           }\r
+       },\r
+\r
+       /**\r
+        * Gets the pressed button in the passed group or null\r
+        * @param {String} group\r
+        * @return Button\r
+        */\r
+       getPressed : function(group){\r
+           var g = groups[group];\r
+           if(g){\r
+               for(var i = 0, len = g.length; i < len; i++){\r
+                   if(g[i].pressed === true){\r
+                       return g[i];\r
+                   }\r
+               }\r
+           }\r
+           return null;\r
+       }\r
+   };\r
+}();\r
+/**\r
  * @class Ext.SplitButton\r
  * @extends Ext.Button\r
  * A split button that provides a built-in dropdown arrow that can fire an event separately from the default\r
@@ -41247,9 +44795,13 @@ Ext.SplitButton = Ext.extend(Ext.Button, {
     },\r
 \r
     isClickOnArrow : function(e){\r
-        return this.arrowAlign != 'bottom' ?\r
-               e.getPageX() > this.el.child(this.buttonSelector).getRegion().right :\r
-               e.getPageY() > this.el.child(this.buttonSelector).getRegion().bottom;\r
+       if (this.arrowAlign != 'bottom') {\r
+           var visBtn = this.el.child('em.x-btn-split');\r
+           var right = visBtn.getRegion().right - visBtn.getPadding('r');\r
+           return e.getPageX() > right;\r
+       } else {\r
+           return e.getPageY() > this.btnEl.getRegion().bottom;\r
+       }\r
     },\r
 \r
     // private\r
@@ -41278,12 +44830,12 @@ Ext.SplitButton = Ext.extend(Ext.Button, {
 \r
     // private\r
     isMenuTriggerOver : function(e){\r
-        return this.menu && e.target.tagName == 'em';\r
+        return this.menu && e.target.tagName == this.arrowSelector;\r
     },\r
 \r
     // private\r
     isMenuTriggerOut : function(e, internal){\r
-        return this.menu && e.target.tagName != 'em';\r
+        return this.menu && e.target.tagName != this.arrowSelector;\r
     }\r
 });\r
 \r
@@ -41364,8 +44916,8 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
      * @param {Boolean} suppressEvent True to prevent the button's change event from firing (defaults to false)\r
      */\r
     setActiveItem : function(item, suppressEvent){\r
-        if(typeof item != 'object'){\r
-            item = this.menu.items.get(item);\r
+        if(!Ext.isObject(item)){\r
+            item = this.menu.getComponent(item);\r
         }\r
         if(item){\r
             if(!this.rendered){\r
@@ -41380,7 +44932,7 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             }\r
             this.activeItem = item;\r
             if(!item.checked){\r
-                item.setChecked(true, true);\r
+                item.setChecked(true, false);\r
             }\r
             if(this.forceIcon){\r
                 this.setIconClass(this.forceIcon);\r
@@ -41388,861 +44940,667 @@ Ext.CycleButton = Ext.extend(Ext.SplitButton, {
             if(!suppressEvent){\r
                 this.fireEvent('change', this, item);\r
             }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Gets the currently active menu item.\r
-     * @return {Ext.menu.CheckItem} The active item\r
-     */\r
-    getActiveItem : function(){\r
-        return this.activeItem;\r
-    },\r
-\r
-    // private\r
-    initComponent : function(){\r
-        this.addEvents(\r
-            /**\r
-             * @event change\r
-             * Fires after the button's active menu item has changed.  Note that if a {@link #changeHandler} function\r
-             * is set on this CycleButton, it will be called instead on active item change and this change event will\r
-             * not be fired.\r
-             * @param {Ext.CycleButton} this\r
-             * @param {Ext.menu.CheckItem} item The menu item that was selected\r
-             */\r
-            "change"\r
-        );\r
-\r
-        if(this.changeHandler){\r
-            this.on('change', this.changeHandler, this.scope||this);\r
-            delete this.changeHandler;\r
-        }\r
-\r
-        this.itemCount = this.items.length;\r
-\r
-        this.menu = {cls:'x-cycle-menu', items:[]};\r
-        var checked;\r
-        for(var i = 0, len = this.itemCount; i < len; i++){\r
-            var item = this.items[i];\r
-            item.group = item.group || this.id;\r
-            item.itemIndex = i;\r
-            item.checkHandler = this.checkHandler;\r
-            item.scope = this;\r
-            item.checked = item.checked || false;\r
-            this.menu.items.push(item);\r
-            if(item.checked){\r
-                checked = item;\r
-            }\r
-        }\r
-        this.setActiveItem(checked, true);\r
-        Ext.CycleButton.superclass.initComponent.call(this);\r
-\r
-        this.on('click', this.toggleSelected, this);\r
-    },\r
-\r
-    // private\r
-    checkHandler : function(item, pressed){\r
-        if(pressed){\r
-            this.setActiveItem(item);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * This is normally called internally on button click, but can be called externally to advance the button's\r
-     * active item programmatically to the next one in the menu.  If the current item is the last one in the menu\r
-     * the active item will be set to the first item in the menu.\r
-     */\r
-    toggleSelected : function(){\r
-        this.menu.render();\r
-        \r
-        var nextIdx, checkItem;\r
-        for (var i = 1; i < this.itemCount; i++) {\r
-            nextIdx = (this.activeItem.itemIndex + i) % this.itemCount;\r
-            // check the potential item\r
-            checkItem = this.menu.items.itemAt(nextIdx);\r
-            // if its not disabled then check it.\r
-            if (!checkItem.disabled) {\r
-                checkItem.setChecked(true);\r
-                break;\r
-            }\r
-        }\r
-    }\r
-});\r
-Ext.reg('cycle', Ext.CycleButton);/**\r
- * @class Ext.layout.ToolbarLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * Layout manager implicitly used by Ext.Toolbar.\r
- */\r
-Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    monitorResize : true,\r
-    triggerWidth : 18,\r
-    lastOverflow : false,\r
-\r
-    noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',\r
-    // private\r
-    onLayout : function(ct, target){\r
-        if(!this.leftTr){\r
-            target.addClass('x-toolbar-layout-ct');\r
-            target.insertHtml('beforeEnd',\r
-                 '<table cellspacing="0" class="x-toolbar-ct"><tbody><tr><td class="x-toolbar-left" align="left"><table cellspacing="0"><tbody><tr class="x-toolbar-left-row"></tr></tbody></table></td><td class="x-toolbar-right" align="right"><table cellspacing="0" class="x-toolbar-right-ct"><tbody><tr><td><table cellspacing="0"><tbody><tr class="x-toolbar-right-row"></tr></tbody></table></td><td><table cellspacing="0"><tbody><tr class="x-toolbar-extras-row"></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>');\r
-            this.leftTr = target.child('tr.x-toolbar-left-row', true);\r
-            this.rightTr = target.child('tr.x-toolbar-right-row', true);\r
-            this.extrasTr = target.child('tr.x-toolbar-extras-row', true);\r
-        }\r
-        var side = this.leftTr;\r
-        var pos = 0;\r
-\r
-        var items = ct.items.items;\r
-        for(var i = 0, len = items.length, c; i < len; i++, pos++) {\r
-            c = items[i];\r
-            if(c.isFill){\r
-                side = this.rightTr;\r
-                pos = -1;\r
-            }else if(!c.rendered){\r
-                c.render(this.insertCell(c, side, pos));\r
-            }else{\r
-                if(!c.xtbHidden && !this.isValidParent(c, side.childNodes[pos])){\r
-                    var td = this.insertCell(c, side, pos);\r
-                    td.appendChild(c.getDomPositionEl().dom);\r
-                    c.container = Ext.get(td);\r
-                }\r
-            }\r
-        }\r
-        //strip extra empty cells\r
-        this.cleanup(this.leftTr);\r
-        this.cleanup(this.rightTr);\r
-        this.cleanup(this.extrasTr);\r
-        this.fitToSize(target);\r
-    },\r
-\r
-    cleanup : function(row){\r
-        var cn = row.childNodes;\r
-        for(var i = cn.length-1, c; i >= 0 && (c = cn[i]); i--){\r
-            if(!c.firstChild){\r
-                row.removeChild(c);\r
-            }\r
-        }\r
-    },\r
-\r
-    insertCell : function(c, side, pos){\r
-        var td = document.createElement('td');\r
-        td.className='x-toolbar-cell';\r
-        side.insertBefore(td, side.childNodes[pos]||null);\r
-        return td;\r
-    },\r
-\r
-    hideItem : function(item){\r
-        var h = (this.hiddens = this.hiddens || []);\r
-        h.push(item);\r
-        item.xtbHidden = true;\r
-        item.xtbWidth = item.getDomPositionEl().dom.parentNode.offsetWidth;\r
-        item.hide();\r
-    },\r
-\r
-    unhideItem : function(item){\r
-        item.show();\r
-        item.xtbHidden = false;\r
-        this.hiddens.remove(item);\r
-        if(this.hiddens.length < 1){\r
-            delete this.hiddens;\r
-        }\r
-    },\r
-\r
-    getItemWidth : function(c){\r
-        return c.hidden ? (c.xtbWidth || 0) : c.getDomPositionEl().dom.parentNode.offsetWidth;\r
-    },\r
-\r
-    fitToSize : function(t){\r
-        if(this.container.enableOverflow === false){\r
-            return;\r
-        }\r
-        var w = t.dom.clientWidth;\r
-        var lw = this.lastWidth || 0;\r
-        this.lastWidth = w;\r
-        var iw = t.dom.firstChild.offsetWidth;\r
-\r
-        var clipWidth = w - this.triggerWidth;\r
-        var hideIndex = -1;\r
-\r
-        if(iw > w || (this.hiddens && w >= lw)){\r
-            var i, items = this.container.items.items, len = items.length, c;\r
-            var loopWidth = 0;\r
-            for(i = 0; i < len; i++) {\r
-                c = items[i];\r
-                if(!c.isFill){\r
-                    loopWidth += this.getItemWidth(c);\r
-                    if(loopWidth > clipWidth){\r
-                        if(!c.xtbHidden){\r
-                            this.hideItem(c);\r
-                        }\r
-                    }else{\r
-                        if(c.xtbHidden){\r
-                            this.unhideItem(c);\r
-                        }\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        if(this.hiddens){\r
-            this.initMore();\r
-            if(!this.lastOverflow){\r
-                this.container.fireEvent('overflowchange', this.container, true);\r
-                this.lastOverflow = true;\r
-            }\r
-        }else if(this.more){\r
-            this.clearMenu();\r
-            this.more.destroy();\r
-            delete this.more;\r
-            if(this.lastOverflow){\r
-                this.container.fireEvent('overflowchange', this.container, false);\r
-                this.lastOverflow = false;\r
-            }\r
-        }\r
-    },\r
-\r
-    createMenuConfig : function(c, hideOnClick){\r
-        var cfg = Ext.apply({}, c.initialConfig),\r
-            group = c.toggleGroup;\r
-\r
-        Ext.apply(cfg, {\r
-            text: c.overflowText || c.text,\r
-            iconCls: c.iconCls,\r
-            icon: c.icon,\r
-            itemId: c.itemId,\r
-            disabled: c.disabled,\r
-            handler: c.handler,\r
-            scope: c.scope,\r
-            menu: c.menu,\r
-            hideOnClick: hideOnClick\r
-        });\r
-        if(group || c.enableToggle){\r
-            Ext.apply(cfg, {\r
-                group: group,\r
-                checked: c.pressed,\r
-                listeners: {\r
-                    checkchange: function(item, checked){\r
-                        c.toggle(checked);\r
-                    }\r
-                }\r
-            });\r
-        }\r
-        delete cfg.xtype;\r
-        delete cfg.id;\r
-        return cfg;\r
-    },\r
-\r
-    // private\r
-    addComponentToMenu : function(m, c){\r
-        if(c instanceof Ext.Toolbar.Separator){\r
-            m.add('-');\r
-        }else if(Ext.isFunction(c.isXType)){\r
-            if(c.isXType('splitbutton')){\r
-                m.add(this.createMenuConfig(c, true));\r
-            }else if(c.isXType('button')){\r
-                m.add(this.createMenuConfig(c, !c.menu));\r
-            }else if(c.isXType('buttongroup')){\r
-                c.items.each(function(item){\r
-                     this.addComponentToMenu(m, item);\r
-                }, this);\r
-            }\r
-        }\r
-    },\r
-\r
-    clearMenu : function(){\r
-        var m = this.moreMenu;\r
-        if(m && m.items){\r
-            this.moreMenu.items.each(function(item){\r
-                delete item.menu;\r
-            });\r
-        }\r
-    },\r
-\r
-    // private\r
-    beforeMoreShow : function(m){\r
-        var h = this.container.items.items,\r
-            len = h.length,\r
-            c,\r
-            prev,\r
-            needsSep = function(group, item){\r
-                return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator);\r
-            };\r
-\r
-        this.clearMenu();\r
-        m.removeAll();\r
-        for(var i = 0; i < len; i++){\r
-            c = h[i];\r
-            if(c.xtbHidden){\r
-                if(prev && (needsSep(c, prev) || needsSep(prev, c))){\r
-                    m.add('-');\r
-                }\r
-                this.addComponentToMenu(m, c);\r
-                prev = c;\r
-            }\r
-        }\r
-        // put something so the menu isn't empty\r
-        // if no compatible items found\r
-        if(m.items.length < 1){\r
-            m.add(this.noItemsMenuText);\r
-        }\r
-    },\r
-\r
-    initMore : function(){\r
-        if(!this.more){\r
-            this.moreMenu = new Ext.menu.Menu({\r
-                listeners: {\r
-                    beforeshow: this.beforeMoreShow,\r
-                    scope: this\r
-                }\r
-            });\r
-            this.more = new Ext.Button({\r
-                iconCls: 'x-toolbar-more-icon',\r
-                cls: 'x-toolbar-more',\r
-                menu: this.moreMenu\r
-            });\r
-            var td = this.insertCell(this.more, this.extrasTr, 100);\r
-            this.more.render(td);\r
-        }\r
-    },\r
-\r
-    destroy : function(){\r
-        Ext.destroy(this.more, this.moreMenu);\r
-        Ext.layout.ToolbarLayout.superclass.destroy.call(this);\r
-    }\r
-    /**\r
-     * @property activeItem\r
-     * @hide\r
-     */\r
-});\r
-\r
-Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;\r
-\r
-/**\r
- * @class Ext.Toolbar\r
- * @extends Ext.Container\r
- * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar\r
- * is <tt>{@link Ext.Button button}</tt>, Toolbar elements (child items for the Toolbar container) may\r
- * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors,\r
- * or implicitly via their xtypes, and can be <tt>{@link #add}</tt>ed dynamically.</p>\r
- * <p>Some items have shortcut strings for creation:</p>\r
- * <pre>\r
-<u>Shortcut</u>  <u>xtype</u>          <u>Class</u>                  <u>Description</u>\r
-'->'      'tbfill'       {@link Ext.Toolbar.Fill}       begin using the right-justified button container\r
-'-'       'tbseparator'  {@link Ext.Toolbar.Separator}  add a vertical separator bar between toolbar items\r
-' '       'tbspacer'     {@link Ext.Toolbar.Spacer}     add horiztonal space between elements\r
- * </pre>\r
- *\r
- * Example usage of various elements:\r
- * <pre><code>\r
-var tb = new Ext.Toolbar({\r
-    renderTo: document.body,\r
-    width: 600,\r
-    height: 100,\r
-    items: [\r
-        {\r
-            // xtype: 'button', // default for Toolbars, same as 'tbbutton'\r
-            text: 'Button'\r
-        },\r
-        {\r
-            xtype: 'splitbutton', // same as 'tbsplitbutton'\r
-            text: 'Split Button'\r
-        },\r
-        // begin using the right-justified button container\r
-        '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill\r
-        {\r
-            xtype: 'textfield',\r
-            name: 'field1',\r
-            emptyText: 'enter search term'\r
-        },\r
-        // add a vertical separator bar between toolbar items\r
-        '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator\r
-        'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem\r
-        {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer\r
-        'text 2',\r
-        {xtype: 'tbspacer', width: 50}, // add a 50px space\r
-        'text 3'\r
-    ]\r
-});\r
- * </code></pre>\r
- * Example adding a ComboBox within a menu of a button:\r
- * <pre><code>\r
-// ComboBox creation\r
-var combo = new Ext.form.ComboBox({\r
-    store: new Ext.data.ArrayStore({\r
-        autoDestroy: true,\r
-        fields: ['initials', 'fullname'],\r
-        data : [\r
-            ['FF', 'Fred Flintstone'],\r
-            ['BR', 'Barney Rubble']\r
-        ]\r
-    }),\r
-    displayField: 'fullname',\r
-    typeAhead: true,\r
-    mode: 'local',\r
-    forceSelection: true,\r
-    triggerAction: 'all',\r
-    emptyText: 'Select a name...',\r
-    selectOnFocus: true,\r
-    width: 135,\r
-    getListParent: function() {\r
-        return this.el.up('.x-menu');\r
-    },\r
-    iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu\r
-});\r
-\r
-// put ComboBox in a Menu\r
-var menu = new Ext.menu.Menu({\r
-    id: 'mainMenu',\r
-    items: [\r
-        combo // A Field in a Menu\r
-    ]\r
-});\r
-\r
-// add a Button with the menu\r
-tb.add({\r
-        text:'Button w/ Menu',\r
-        menu: menu  // assign menu by instance\r
-    });\r
-tb.doLayout();\r
- * </code></pre>\r
- * @constructor\r
- * Creates a new Toolbar\r
- * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>\r
- * @xtype toolbar\r
- */\r
-Ext.Toolbar = function(config){\r
-    if(Ext.isArray(config)){\r
-        config = {items: config, layout: 'toolbar'};\r
-    } else {\r
-        config = Ext.apply({\r
-            layout: 'toolbar'\r
-        }, config);\r
-        if(config.buttons) {\r
-            config.items = config.buttons;\r
-        }\r
-    }\r
-    Ext.Toolbar.superclass.constructor.call(this, config);\r
-};\r
-\r
-(function(){\r
-\r
-var T = Ext.Toolbar;\r
-\r
-Ext.extend(T, Ext.Container, {\r
-\r
-    defaultType: 'button',\r
-\r
-    trackMenus : true,\r
-    internalDefaults: {removeMode: 'container', hideParent: true},\r
-    toolbarCls: 'x-toolbar',\r
-\r
-    initComponent : function(){\r
-        T.superclass.initComponent.call(this);\r
-\r
-        /**\r
-         * @event overflowchange\r
-         * Fires after the overflow state has changed.\r
-         * @param {Object} c The Container\r
-         * @param {Boolean} lastOverflow overflow state\r
-         */\r
-        this.addEvents('overflowchange');\r
-    },\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        if(!this.el){\r
-            if(!this.autoCreate){\r
-                this.autoCreate = {\r
-                    cls: this.toolbarCls + ' x-small-editor'\r
-                };\r
-            }\r
-            this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Adds element(s) to the toolbar -- this function takes a variable number of\r
-     * arguments of mixed type and adds them to the toolbar.\r
-     * @param {Mixed} arg1 The following types of arguments are all valid:<br />\r
-     * <ul>\r
-     * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>\r
-     * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>\r
-     * <li>Field: Any form field (equivalent to {@link #addField})</li>\r
-     * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>\r
-     * <li>String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}).\r
-     * Note that there are a few special strings that are treated differently as explained next.</li>\r
-     * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>\r
-     * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>\r
-     * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>\r
-     * </ul>\r
-     * @param {Mixed} arg2\r
-     * @param {Mixed} etc.\r
-     * @method add\r
-     */\r
-\r
-    // private\r
-    lookupComponent : function(c){\r
-        if(Ext.isString(c)){\r
-            if(c == '-'){\r
-                c = new T.Separator();\r
-            }else if(c == ' '){\r
-                c = new T.Spacer();\r
-            }else if(c == '->'){\r
-                c = new T.Fill();\r
-            }else{\r
-                c = new T.TextItem(c);\r
-            }\r
-            this.applyDefaults(c);\r
-        }else{\r
-            if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item\r
-                c = this.constructItem(c);\r
-            }else if(c.tag){ // DomHelper spec\r
-                c = new T.Item({autoEl: c});\r
-            }else if(c.tagName){ // element\r
-                c = new T.Item({el:c});\r
-            }else if(Ext.isObject(c)){ // must be button config?\r
-                c = c.xtype ? this.constructItem(c) : this.constructButton(c);\r
-            }\r
-        }\r
-        return c;\r
-    },\r
-\r
-    // private\r
-    applyDefaults : function(c){\r
-        if(!Ext.isString(c)){\r
-            c = Ext.Toolbar.superclass.applyDefaults.call(this, c);\r
-            var d = this.internalDefaults;\r
-            if(c.events){\r
-                Ext.applyIf(c.initialConfig, d);\r
-                Ext.apply(c, d);\r
-            }else{\r
-                Ext.applyIf(c, d);\r
-            }\r
-        }\r
-        return c;\r
-    },\r
-\r
-    // private\r
-    constructItem : function(item, type){\r
-        return Ext.create(item, type || this.defaultType);\r
-    },\r
-\r
-    /**\r
-     * Adds a separator\r
-     * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}\r
-     */\r
-    addSeparator : function(){\r
-        return this.add(new T.Separator());\r
-    },\r
-\r
-    /**\r
-     * Adds a spacer element\r
-     * @return {Ext.Toolbar.Spacer} The spacer item\r
-     */\r
-    addSpacer : function(){\r
-        return this.add(new T.Spacer());\r
-    },\r
-\r
-    /**\r
-     * Forces subsequent additions into the float:right toolbar\r
-     */\r
-    addFill : function(){\r
-        this.add(new T.Fill());\r
-    },\r
-\r
-    /**\r
-     * Adds any standard HTML element to the toolbar\r
-     * @param {Mixed} el The element or id of the element to add\r
-     * @return {Ext.Toolbar.Item} The element's item\r
-     */\r
-    addElement : function(el){\r
-        return this.addItem(new T.Item({el:el}));\r
-    },\r
-\r
-    /**\r
-     * Adds any Toolbar.Item or subclass\r
-     * @param {Ext.Toolbar.Item} item\r
-     * @return {Ext.Toolbar.Item} The item\r
-     */\r
-    addItem : function(item){\r
-        return Ext.Toolbar.superclass.add.apply(this, arguments);\r
-    },\r
-\r
-    /**\r
-     * Adds a button (or buttons). See {@link Ext.Button} for more info on the config.\r
-     * @param {Object/Array} config A button config or array of configs\r
-     * @return {Ext.Button/Array}\r
-     */\r
-    addButton : function(config){\r
-        if(Ext.isArray(config)){\r
-            var buttons = [];\r
-            for(var i = 0, len = config.length; i < len; i++) {\r
-                buttons.push(this.addButton(config[i]));\r
-            }\r
-            return buttons;\r
-        }\r
-        return this.add(this.constructButton(config));\r
-    },\r
-\r
-    /**\r
-     * Adds text to the toolbar\r
-     * @param {String} text The text to add\r
-     * @return {Ext.Toolbar.Item} The element's item\r
-     */\r
-    addText : function(text){\r
-        return this.addItem(new T.TextItem(text));\r
-    },\r
-\r
-    /**\r
-     * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config\r
-     * @param {Object} config\r
-     * @return {Ext.Toolbar.Item} The element's item\r
-     */\r
-    addDom : function(config){\r
-        return this.add(new T.Item({autoEl: config}));\r
-    },\r
-\r
-    /**\r
-     * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have\r
-     * been rendered yet. For a field that has already been rendered, use {@link #addElement}.\r
-     * @param {Ext.form.Field} field\r
-     * @return {Ext.Toolbar.Item}\r
-     */\r
-    addField : function(field){\r
-        return this.add(field);\r
-    },\r
-\r
-    /**\r
-     * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index.\r
-     * @param {Number} index The index where the item is to be inserted\r
-     * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be\r
-     * inserted, or an array of buttons/configs.\r
-     * @return {Ext.Button/Item}\r
-     */\r
-    insertButton : function(index, item){\r
-        if(Ext.isArray(item)){\r
-            var buttons = [];\r
-            for(var i = 0, len = item.length; i < len; i++) {\r
-               buttons.push(this.insertButton(index + i, item[i]));\r
-            }\r
-            return buttons;\r
-        }\r
-        return Ext.Toolbar.superclass.insert.call(this, index, item);\r
-    },\r
-\r
-    // private\r
-    initMenuTracking : function(item){\r
-        if(this.trackMenus && item.menu){\r
-            this.mon(item, {\r
-                'menutriggerover' : this.onButtonTriggerOver,\r
-                'menushow' : this.onButtonMenuShow,\r
-                'menuhide' : this.onButtonMenuHide,\r
-                scope: this\r
-            });\r
-        }\r
-    },\r
-\r
-    // private\r
-    constructButton : function(item){\r
-        var b = item.events ? item : this.constructItem(item, item.split ? 'splitbutton' : this.defaultType);\r
-        this.initMenuTracking(b);\r
-        return b;\r
-    },\r
-\r
-    // private\r
-    onDisable : function(){\r
-        this.items.each(function(item){\r
-             if(item.disable){\r
-                 item.disable();\r
-             }\r
-        });\r
-    },\r
-\r
-    // private\r
-    onEnable : function(){\r
-        this.items.each(function(item){\r
-             if(item.enable){\r
-                 item.enable();\r
-             }\r
-        });\r
-    },\r
-\r
-    // private\r
-    onButtonTriggerOver : function(btn){\r
-        if(this.activeMenuBtn && this.activeMenuBtn != btn){\r
-            this.activeMenuBtn.hideMenu();\r
-            btn.showMenu();\r
-            this.activeMenuBtn = btn;\r
-        }\r
-    },\r
-\r
-    // private\r
-    onButtonMenuShow : function(btn){\r
-        this.activeMenuBtn = btn;\r
-    },\r
-\r
-    // private\r
-    onButtonMenuHide : function(btn){\r
-        delete this.activeMenuBtn;\r
-    }\r
-});\r
-Ext.reg('toolbar', Ext.Toolbar);\r
-\r
-/**\r
- * @class Ext.Toolbar.Item\r
- * @extends Ext.BoxComponent\r
- * The base class that other non-interacting Toolbar Item classes should extend in order to\r
- * get some basic common toolbar item functionality.\r
- * @constructor\r
- * Creates a new Item\r
- * @param {HTMLElement} el\r
- * @xtype tbitem\r
- */\r
-T.Item = Ext.extend(Ext.BoxComponent, {\r
-    hideParent: true, //  Hiding a Toolbar.Item hides its containing TD\r
-    enable:Ext.emptyFn,\r
-    disable:Ext.emptyFn,\r
-    focus:Ext.emptyFn\r
-    /**\r
-     * @cfg {String} overflowText Text to be used for the menu if the item is overflowed.\r
-     */\r
-});\r
-Ext.reg('tbitem', T.Item);\r
-\r
-/**\r
- * @class Ext.Toolbar.Separator\r
- * @extends Ext.Toolbar.Item\r
- * A simple class that adds a vertical separator bar between toolbar items\r
- * (css class:<tt>'xtb-sep'</tt>). Example usage:\r
- * <pre><code>\r
-new Ext.Panel({\r
-    tbar : [\r
-        'Item 1',\r
-        {xtype: 'tbseparator'}, // or '-'\r
-        'Item 2'\r
-    ]\r
-});\r
-</code></pre>\r
- * @constructor\r
- * Creates a new Separator\r
- * @xtype tbseparator\r
- */\r
-T.Separator = Ext.extend(T.Item, {\r
-    onRender : function(ct, position){\r
-        this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position);\r
-    }\r
-});\r
-Ext.reg('tbseparator', T.Separator);\r
-\r
-/**\r
- * @class Ext.Toolbar.Spacer\r
- * @extends Ext.Toolbar.Item\r
- * A simple element that adds extra horizontal space between items in a toolbar.\r
- * By default a 2px wide space is added via css specification:<pre><code>\r
-.x-toolbar .xtb-spacer {\r
-    width:2px;\r
-}\r
- * </code></pre>\r
- * <p>Example usage:</p>\r
- * <pre><code>\r
-new Ext.Panel({\r
-    tbar : [\r
-        'Item 1',\r
-        {xtype: 'tbspacer'}, // or ' '\r
-        'Item 2',\r
-        // space width is also configurable via javascript\r
-        {xtype: 'tbspacer', width: 50}, // add a 50px space\r
-        'Item 3'\r
-    ]\r
-});\r
-</code></pre>\r
- * @constructor\r
- * Creates a new Spacer\r
- * @xtype tbspacer\r
- */\r
-T.Spacer = Ext.extend(T.Item, {\r
+        }\r
+    },\r
+\r
     /**\r
-     * @cfg {Number} width\r
-     * The width of the spacer in pixels (defaults to 2px via css style <tt>.x-toolbar .xtb-spacer</tt>).\r
+     * Gets the currently active menu item.\r
+     * @return {Ext.menu.CheckItem} The active item\r
      */\r
+    getActiveItem : function(){\r
+        return this.activeItem;\r
+    },\r
 \r
-    onRender : function(ct, position){\r
-        this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);\r
-    }\r
-});\r
-Ext.reg('tbspacer', T.Spacer);\r
-\r
-/**\r
- * @class Ext.Toolbar.Fill\r
- * @extends Ext.Toolbar.Spacer\r
- * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using\r
- * the right-justified button container.\r
- * <pre><code>\r
-new Ext.Panel({\r
-    tbar : [\r
-        'Item 1',\r
-        {xtype: 'tbfill'}, // or '->'\r
-        'Item 2'\r
-    ]\r
-});\r
-</code></pre>\r
- * @constructor\r
- * Creates a new Fill\r
- * @xtype tbfill\r
- */\r
-T.Fill = Ext.extend(T.Item, {\r
     // private\r
-    render : Ext.emptyFn,\r
-    isFill : true\r
-});\r
-Ext.reg('tbfill', T.Fill);\r
+    initComponent : function(){\r
+        this.addEvents(\r
+            /**\r
+             * @event change\r
+             * Fires after the button's active menu item has changed.  Note that if a {@link #changeHandler} function\r
+             * is set on this CycleButton, it will be called instead on active item change and this change event will\r
+             * not be fired.\r
+             * @param {Ext.CycleButton} this\r
+             * @param {Ext.menu.CheckItem} item The menu item that was selected\r
+             */\r
+            "change"\r
+        );\r
 \r
-/**\r
- * @class Ext.Toolbar.TextItem\r
- * @extends Ext.Toolbar.Item\r
- * A simple class that renders text directly into a toolbar\r
- * (with css class:<tt>'xtb-text'</tt>). Example usage:\r
- * <pre><code>\r
-new Ext.Panel({\r
-    tbar : [\r
-        {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'\r
-    ]\r
-});\r
-</code></pre>\r
- * @constructor\r
- * Creates a new TextItem\r
- * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> property\r
- * @xtype tbtext\r
- */\r
-T.TextItem = Ext.extend(T.Item, {\r
-    constructor: function(config){\r
-        if (Ext.isString(config)) {\r
-            config = { autoEl: {cls: 'xtb-text', html: config }};\r
-        } else {\r
-            config.autoEl = {cls: 'xtb-text', html: config.text || ''};\r
+        if(this.changeHandler){\r
+            this.on('change', this.changeHandler, this.scope||this);\r
+            delete this.changeHandler;\r
+        }\r
+\r
+        this.itemCount = this.items.length;\r
+\r
+        this.menu = {cls:'x-cycle-menu', items:[]};\r
+        var checked = 0;\r
+        Ext.each(this.items, function(item, i){\r
+            Ext.apply(item, {\r
+                group: item.group || this.id,\r
+                itemIndex: i,\r
+                checkHandler: this.checkHandler,\r
+                scope: this,\r
+                checked: item.checked || false\r
+            });\r
+            this.menu.items.push(item);\r
+            if(item.checked){\r
+                checked = i;\r
+            }\r
+        }, this);\r
+        Ext.CycleButton.superclass.initComponent.call(this);\r
+        this.on('click', this.toggleSelected, this);\r
+        this.setActiveItem(checked, true);\r
+    },\r
+\r
+    // private\r
+    checkHandler : function(item, pressed){\r
+        if(pressed){\r
+            this.setActiveItem(item);\r
         }\r
-        T.TextItem.superclass.constructor.call(this, config);\r
     },\r
+\r
     /**\r
-     * Updates this item's text, setting the text to be used as innerHTML.\r
-     * @param {String} t The text to display (html accepted).\r
+     * This is normally called internally on button click, but can be called externally to advance the button's\r
+     * active item programmatically to the next one in the menu.  If the current item is the last one in the menu\r
+     * the active item will be set to the first item in the menu.\r
      */\r
-    setText : function(t) {\r
-        if (this.rendered) {\r
-            this.el.dom.innerHTML = t;\r
-        } else {\r
-            this.autoEl.html = t;\r
+    toggleSelected : function(){\r
+        var m = this.menu;\r
+        m.render();\r
+        // layout if we haven't before so the items are active\r
+        if(!m.hasLayout){\r
+            m.doLayout();\r
+        }\r
+        \r
+        var nextIdx, checkItem;\r
+        for (var i = 1; i < this.itemCount; i++) {\r
+            nextIdx = (this.activeItem.itemIndex + i) % this.itemCount;\r
+            // check the potential item\r
+            checkItem = m.items.itemAt(nextIdx);\r
+            // if its not disabled then check it.\r
+            if (!checkItem.disabled) {\r
+                checkItem.setChecked(true);\r
+                break;\r
+            }\r
         }\r
     }\r
 });\r
-Ext.reg('tbtext', T.TextItem);\r
-\r
-// backwards compat\r
-T.Button = Ext.extend(Ext.Button, {});\r
-T.SplitButton = Ext.extend(Ext.SplitButton, {});\r
-Ext.reg('tbbutton', T.Button);\r
-Ext.reg('tbsplit', T.SplitButton);\r
-\r
-})();\r
+Ext.reg('cycle', Ext.CycleButton);/**
+ * @class Ext.Toolbar
+ * @extends Ext.Container
+ * <p>Basic Toolbar class. Although the <tt>{@link Ext.Container#defaultType defaultType}</tt> for Toolbar
+ * is <tt>{@link Ext.Button button}</tt>, Toolbar elements (child items for the Toolbar container) may
+ * be virtually any type of Component. Toolbar elements can be created explicitly via their constructors,
+ * or implicitly via their xtypes, and can be <tt>{@link #add}</tt>ed dynamically.</p>
+ * <p>Some items have shortcut strings for creation:</p>
+ * <pre>
+<u>Shortcut</u>  <u>xtype</u>          <u>Class</u>                  <u>Description</u>
+'->'      'tbfill'       {@link Ext.Toolbar.Fill}       begin using the right-justified button container
+'-'       'tbseparator'  {@link Ext.Toolbar.Separator}  add a vertical separator bar between toolbar items
+' '       'tbspacer'     {@link Ext.Toolbar.Spacer}     add horiztonal space between elements
+ * </pre>
+ *
+ * Example usage of various elements:
+ * <pre><code>
+var tb = new Ext.Toolbar({
+    renderTo: document.body,
+    width: 600,
+    height: 100,
+    items: [
+        {
+            // xtype: 'button', // default for Toolbars, same as 'tbbutton'
+            text: 'Button'
+        },
+        {
+            xtype: 'splitbutton', // same as 'tbsplitbutton'
+            text: 'Split Button'
+        },
+        // begin using the right-justified button container
+        '->', // same as {xtype: 'tbfill'}, // Ext.Toolbar.Fill
+        {
+            xtype: 'textfield',
+            name: 'field1',
+            emptyText: 'enter search term'
+        },
+        // add a vertical separator bar between toolbar items
+        '-', // same as {xtype: 'tbseparator'} to create Ext.Toolbar.Separator
+        'text 1', // same as {xtype: 'tbtext', text: 'text1'} to create Ext.Toolbar.TextItem
+        {xtype: 'tbspacer'},// same as ' ' to create Ext.Toolbar.Spacer
+        'text 2',
+        {xtype: 'tbspacer', width: 50}, // add a 50px space
+        'text 3'
+    ]
+});
+ * </code></pre>
+ * Example adding a ComboBox within a menu of a button:
+ * <pre><code>
+// ComboBox creation
+var combo = new Ext.form.ComboBox({
+    store: new Ext.data.ArrayStore({
+        autoDestroy: true,
+        fields: ['initials', 'fullname'],
+        data : [
+            ['FF', 'Fred Flintstone'],
+            ['BR', 'Barney Rubble']
+        ]
+    }),
+    displayField: 'fullname',
+    typeAhead: true,
+    mode: 'local',
+    forceSelection: true,
+    triggerAction: 'all',
+    emptyText: 'Select a name...',
+    selectOnFocus: true,
+    width: 135,
+    getListParent: function() {
+        return this.el.up('.x-menu');
+    },
+    iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
+});
+
+// put ComboBox in a Menu
+var menu = new Ext.menu.Menu({
+    id: 'mainMenu',
+    items: [
+        combo // A Field in a Menu
+    ]
+});
+
+// add a Button with the menu
+tb.add({
+        text:'Button w/ Menu',
+        menu: menu  // assign menu by instance
+    });
+tb.doLayout();
+ * </code></pre>
+ * @constructor
+ * Creates a new Toolbar
+ * @param {Object/Array} config A config object or an array of buttons to <tt>{@link #add}</tt>
+ * @xtype toolbar
+ */
+Ext.Toolbar = function(config){
+    if(Ext.isArray(config)){
+        config = {items: config, layout: 'toolbar'};
+    } else {
+        config = Ext.apply({
+            layout: 'toolbar'
+        }, config);
+        if(config.buttons) {
+            config.items = config.buttons;
+        }
+    }
+    Ext.Toolbar.superclass.constructor.call(this, config);
+};
+
+(function(){
+
+var T = Ext.Toolbar;
+
+Ext.extend(T, Ext.Container, {
+
+    defaultType: 'button',
+
+    /**
+     * @cfg {String/Object} layout
+     * This class assigns a default layout (<code>layout:'<b>toolbar</b>'</code>).
+     * Developers <i>may</i> override this configuration option if another layout
+     * is required (the constructor must be passed a configuration object in this
+     * case instead of an array).
+     * See {@link Ext.Container#layout} for additional information.
+     */
+
+    enableOverflow : false,
+
+    /**
+     * @cfg {Boolean} enableOverflow
+     * Defaults to false. Configure <code>true<code> to make the toolbar provide a button
+     * which activates a dropdown Menu to show items which overflow the Toolbar's width.
+     */
+    /**
+     * @cfg {String} buttonAlign
+     * <p>The default position at which to align child items. Defaults to <code>"left"</code></p>
+     * <p>May be specified as <code>"center"</code> to cause items added before a Fill (A <code>"->"</code>) item
+     * to be centered in the Toolbar. Items added after a Fill are still right-aligned.</p>
+     * <p>Specify as <code>"right"</code> to right align all child items.</p>
+     */
+
+    trackMenus : true,
+    internalDefaults: {removeMode: 'container', hideParent: true},
+    toolbarCls: 'x-toolbar',
+
+    initComponent : function(){
+        T.superclass.initComponent.call(this);
+
+        /**
+         * @event overflowchange
+         * Fires after the overflow state has changed.
+         * @param {Object} c The Container
+         * @param {Boolean} lastOverflow overflow state
+         */
+        this.addEvents('overflowchange');
+    },
+
+    // private
+    onRender : function(ct, position){
+        if(!this.el){
+            if(!this.autoCreate){
+                this.autoCreate = {
+                    cls: this.toolbarCls + ' x-small-editor'
+                };
+            }
+            this.el = ct.createChild(Ext.apply({ id: this.id },this.autoCreate), position);
+            Ext.Toolbar.superclass.onRender.apply(this, arguments);
+        }
+    },
+
+    /**
+     * <p>Adds element(s) to the toolbar -- this function takes a variable number of
+     * arguments of mixed type and adds them to the toolbar.</p>
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Mixed} arg1 The following types of arguments are all valid:<br />
+     * <ul>
+     * <li>{@link Ext.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
+     * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
+     * <li>Field: Any form field (equivalent to {@link #addField})</li>
+     * <li>Item: Any subclass of {@link Ext.Toolbar.Item} (equivalent to {@link #addItem})</li>
+     * <li>String: Any generic string (gets wrapped in a {@link Ext.Toolbar.TextItem}, equivalent to {@link #addText}).
+     * Note that there are a few special strings that are treated differently as explained next.</li>
+     * <li>'-': Creates a separator element (equivalent to {@link #addSeparator})</li>
+     * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
+     * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
+     * </ul>
+     * @param {Mixed} arg2
+     * @param {Mixed} etc.
+     * @method add
+     */
+
+    // private
+    lookupComponent : function(c){
+        if(Ext.isString(c)){
+            if(c == '-'){
+                c = new T.Separator();
+            }else if(c == ' '){
+                c = new T.Spacer();
+            }else if(c == '->'){
+                c = new T.Fill();
+            }else{
+                c = new T.TextItem(c);
+            }
+            this.applyDefaults(c);
+        }else{
+            if(c.isFormField || c.render){ // some kind of form field, some kind of Toolbar.Item
+                c = this.createComponent(c);
+            }else if(c.tag){ // DomHelper spec
+                c = new T.Item({autoEl: c});
+            }else if(c.tagName){ // element
+                c = new T.Item({el:c});
+            }else if(Ext.isObject(c)){ // must be button config?
+                c = c.xtype ? this.createComponent(c) : this.constructButton(c);
+            }
+        }
+        return c;
+    },
+
+    // private
+    applyDefaults : function(c){
+        if(!Ext.isString(c)){
+            c = Ext.Toolbar.superclass.applyDefaults.call(this, c);
+            var d = this.internalDefaults;
+            if(c.events){
+                Ext.applyIf(c.initialConfig, d);
+                Ext.apply(c, d);
+            }else{
+                Ext.applyIf(c, d);
+            }
+        }
+        return c;
+    },
+
+    /**
+     * Adds a separator
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @return {Ext.Toolbar.Item} The separator {@link Ext.Toolbar.Item item}
+     */
+    addSeparator : function(){
+        return this.add(new T.Separator());
+    },
+
+    /**
+     * Adds a spacer element
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @return {Ext.Toolbar.Spacer} The spacer item
+     */
+    addSpacer : function(){
+        return this.add(new T.Spacer());
+    },
+
+    /**
+     * Forces subsequent additions into the float:right toolbar
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     */
+    addFill : function(){
+        this.add(new T.Fill());
+    },
+
+    /**
+     * Adds any standard HTML element to the toolbar
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Mixed} el The element or id of the element to add
+     * @return {Ext.Toolbar.Item} The element's item
+     */
+    addElement : function(el){
+        return this.addItem(new T.Item({el:el}));
+    },
+
+    /**
+     * Adds any Toolbar.Item or subclass
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Ext.Toolbar.Item} item
+     * @return {Ext.Toolbar.Item} The item
+     */
+    addItem : function(item){
+        return this.add.apply(this, arguments);
+    },
+
+    /**
+     * Adds a button (or buttons). See {@link Ext.Button} for more info on the config.
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Object/Array} config A button config or array of configs
+     * @return {Ext.Button/Array}
+     */
+    addButton : function(config){
+        if(Ext.isArray(config)){
+            var buttons = [];
+            for(var i = 0, len = config.length; i < len; i++) {
+                buttons.push(this.addButton(config[i]));
+            }
+            return buttons;
+        }
+        return this.add(this.constructButton(config));
+    },
+
+    /**
+     * Adds text to the toolbar
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {String} text The text to add
+     * @return {Ext.Toolbar.Item} The element's item
+     */
+    addText : function(text){
+        return this.addItem(new T.TextItem(text));
+    },
+
+    /**
+     * Adds a new element to the toolbar from the passed {@link Ext.DomHelper} config
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Object} config
+     * @return {Ext.Toolbar.Item} The element's item
+     */
+    addDom : function(config){
+        return this.add(new T.Item({autoEl: config}));
+    },
+
+    /**
+     * Adds a dynamically rendered Ext.form field (TextField, ComboBox, etc). Note: the field should not have
+     * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Ext.form.Field} field
+     * @return {Ext.Toolbar.Item}
+     */
+    addField : function(field){
+        return this.add(field);
+    },
+
+    /**
+     * Inserts any {@link Ext.Toolbar.Item}/{@link Ext.Button} at the specified index.
+     * <br><p><b>Note</b>: See the notes within {@link Ext.Container#add}.</p>
+     * @param {Number} index The index where the item is to be inserted
+     * @param {Object/Ext.Toolbar.Item/Ext.Button/Array} item The button, or button config object to be
+     * inserted, or an array of buttons/configs.
+     * @return {Ext.Button/Item}
+     */
+    insertButton : function(index, item){
+        if(Ext.isArray(item)){
+            var buttons = [];
+            for(var i = 0, len = item.length; i < len; i++) {
+               buttons.push(this.insertButton(index + i, item[i]));
+            }
+            return buttons;
+        }
+        return Ext.Toolbar.superclass.insert.call(this, index, item);
+    },
+
+    // private
+    trackMenu : function(item, remove){
+        if(this.trackMenus && item.menu){
+            var method = remove ? 'mun' : 'mon';
+            this[method](item, 'menutriggerover', this.onButtonTriggerOver, this);
+            this[method](item, 'menushow', this.onButtonMenuShow, this);
+            this[method](item, 'menuhide', this.onButtonMenuHide, this);
+        }
+    },
+
+    // private
+    constructButton : function(item){
+        var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType);
+        return b;
+    },
+
+    // private
+    onAdd : function(c){
+        Ext.Toolbar.superclass.onAdd.call(this);
+        this.trackMenu(c);
+        if(this.disabled){
+            c.disable();
+        }
+    },
+
+    // private
+    onRemove : function(c){
+        Ext.Toolbar.superclass.onRemove.call(this);
+        this.trackMenu(c, true);
+    },
+
+    // private
+    onDisable : function(){
+        this.items.each(function(item){
+             if(item.disable){
+                 item.disable();
+             }
+        });
+    },
+
+    // private
+    onEnable : function(){
+        this.items.each(function(item){
+             if(item.enable){
+                 item.enable();
+             }
+        });
+    },
+
+    // private
+    onButtonTriggerOver : function(btn){
+        if(this.activeMenuBtn && this.activeMenuBtn != btn){
+            this.activeMenuBtn.hideMenu();
+            btn.showMenu();
+            this.activeMenuBtn = btn;
+        }
+    },
+
+    // private
+    onButtonMenuShow : function(btn){
+        this.activeMenuBtn = btn;
+    },
+
+    // private
+    onButtonMenuHide : function(btn){
+        delete this.activeMenuBtn;
+    }
+});
+Ext.reg('toolbar', Ext.Toolbar);
+
+/**
+ * @class Ext.Toolbar.Item
+ * @extends Ext.BoxComponent
+ * The base class that other non-interacting Toolbar Item classes should extend in order to
+ * get some basic common toolbar item functionality.
+ * @constructor
+ * Creates a new Item
+ * @param {HTMLElement} el
+ * @xtype tbitem
+ */
+T.Item = Ext.extend(Ext.BoxComponent, {
+    hideParent: true, //  Hiding a Toolbar.Item hides its containing TD
+    enable:Ext.emptyFn,
+    disable:Ext.emptyFn,
+    focus:Ext.emptyFn
+    /**
+     * @cfg {String} overflowText Text to be used for the menu if the item is overflowed.
+     */
+});
+Ext.reg('tbitem', T.Item);
+
+/**
+ * @class Ext.Toolbar.Separator
+ * @extends Ext.Toolbar.Item
+ * A simple class that adds a vertical separator bar between toolbar items
+ * (css class:<tt>'xtb-sep'</tt>). Example usage:
+ * <pre><code>
+new Ext.Panel({
+    tbar : [
+        'Item 1',
+        {xtype: 'tbseparator'}, // or '-'
+        'Item 2'
+    ]
+});
+</code></pre>
+ * @constructor
+ * Creates a new Separator
+ * @xtype tbseparator
+ */
+T.Separator = Ext.extend(T.Item, {
+    onRender : function(ct, position){
+        this.el = ct.createChild({tag:'span', cls:'xtb-sep'}, position);
+    }
+});
+Ext.reg('tbseparator', T.Separator);
+
+/**
+ * @class Ext.Toolbar.Spacer
+ * @extends Ext.Toolbar.Item
+ * A simple element that adds extra horizontal space between items in a toolbar.
+ * By default a 2px wide space is added via css specification:<pre><code>
+.x-toolbar .xtb-spacer {
+    width:2px;
+}
+ * </code></pre>
+ * <p>Example usage:</p>
+ * <pre><code>
+new Ext.Panel({
+    tbar : [
+        'Item 1',
+        {xtype: 'tbspacer'}, // or ' '
+        'Item 2',
+        // space width is also configurable via javascript
+        {xtype: 'tbspacer', width: 50}, // add a 50px space
+        'Item 3'
+    ]
+});
+</code></pre>
+ * @constructor
+ * Creates a new Spacer
+ * @xtype tbspacer
+ */
+T.Spacer = Ext.extend(T.Item, {
+    /**
+     * @cfg {Number} width
+     * The width of the spacer in pixels (defaults to 2px via css style <tt>.x-toolbar .xtb-spacer</tt>).
+     */
+
+    onRender : function(ct, position){
+        this.el = ct.createChild({tag:'div', cls:'xtb-spacer', style: this.width?'width:'+this.width+'px':''}, position);
+    }
+});
+Ext.reg('tbspacer', T.Spacer);
+
+/**
+ * @class Ext.Toolbar.Fill
+ * @extends Ext.Toolbar.Spacer
+ * A non-rendering placeholder item which instructs the Toolbar's Layout to begin using
+ * the right-justified button container.
+ * <pre><code>
+new Ext.Panel({
+    tbar : [
+        'Item 1',
+        {xtype: 'tbfill'}, // or '->'
+        'Item 2'
+    ]
+});
+</code></pre>
+ * @constructor
+ * Creates a new Fill
+ * @xtype tbfill
+ */
+T.Fill = Ext.extend(T.Item, {
+    // private
+    render : Ext.emptyFn,
+    isFill : true
+});
+Ext.reg('tbfill', T.Fill);
+
+/**
+ * @class Ext.Toolbar.TextItem
+ * @extends Ext.Toolbar.Item
+ * A simple class that renders text directly into a toolbar
+ * (with css class:<tt>'xtb-text'</tt>). Example usage:
+ * <pre><code>
+new Ext.Panel({
+    tbar : [
+        {xtype: 'tbtext', text: 'Item 1'} // or simply 'Item 1'
+    ]
+});
+</code></pre>
+ * @constructor
+ * Creates a new TextItem
+ * @param {String/Object} text A text string, or a config object containing a <tt>text</tt> property
+ * @xtype tbtext
+ */
+T.TextItem = Ext.extend(T.Item, {
+    /**
+     * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
+     */
+
+    constructor: function(config){
+        T.TextItem.superclass.constructor.call(this, Ext.isString(config) ? {text: config} : config);
+    },
+
+    // private
+    onRender : function(ct, position) {
+        this.autoEl = {cls: 'xtb-text', html: this.text || ''};
+        T.TextItem.superclass.onRender.call(this, ct, position);
+    },
+
+    /**
+     * Updates this item's text, setting the text to be used as innerHTML.
+     * @param {String} t The text to display (html accepted).
+     */
+    setText : function(t) {
+        if(this.rendered){
+            this.el.update(t);
+        }else{
+            this.text = t;
+        }
+    }
+});
+Ext.reg('tbtext', T.TextItem);
+
+// backwards compat
+T.Button = Ext.extend(Ext.Button, {});
+T.SplitButton = Ext.extend(Ext.SplitButton, {});
+Ext.reg('tbbutton', T.Button);
+Ext.reg('tbsplit', T.SplitButton);
+
+})();
 /**\r
  * @class Ext.ButtonGroup\r
  * @extends Ext.Panel\r
@@ -42283,6 +45641,9 @@ var p = new Ext.Panel({
     }]\r
 });\r
  * </code></pre>\r
+ * @constructor\r
+ * Create a new ButtonGroup.\r
+ * @param {Object} config The config object\r
  * @xtype buttongroup\r
  */\r
 Ext.ButtonGroup = Ext.extend(Ext.Panel, {\r
@@ -42359,10 +45720,14 @@ Ext.reg('buttongroup', Ext.ButtonGroup);
 Ext.QuickTips.init(); // to display button quicktips
 
 var myStore = new Ext.data.Store({
+    reader: new Ext.data.JsonReader({
+        {@link Ext.data.JsonReader#totalProperty totalProperty}: 'results', 
+        ...
+    }),
     ...
 });
 
-var myPageSize = 25;  // server script should only send back 25 items
+var myPageSize = 25;  // server script should only send back 25 items at a time
 
 var grid = new Ext.grid.GridPanel({
     ...
@@ -42383,20 +45748,43 @@ var grid = new Ext.grid.GridPanel({
  * <pre><code>
 store.load({
     params: {
-        start: 0,          // specify params for the first page load if using paging
+        // specify params for the first page load if using paging
+        start: 0,          
         limit: myPageSize,
+        // other params
         foo:   'bar'
     }
 });
+ * </code></pre>
+ * 
+ * <p>If using {@link Ext.data.Store#autoLoad store's autoLoad} configuration:</p>
+ * <pre><code>
+var myStore = new Ext.data.Store({
+    {@link Ext.data.Store#autoLoad autoLoad}: {params:{start: 0, limit: 25}},
+    ...
+});
+ * </code></pre>
+ * 
+ * <p>The packet sent back from the server would have this form:</p>
+ * <pre><code>
+{
+    "success": true,
+    "results": 2000, 
+    "rows": [ // <b>*Note:</b> this must be an Array 
+        { "id":  1, "name": "Bill", "occupation": "Gardener" },
+        { "id":  2, "name":  "Ben", "occupation": "Horticulturalist" },
+        ...
+        { "id": 25, "name":  "Sue", "occupation": "Botanist" }
+    ]
+}
  * </code></pre>
  * <p><u>Paging with Local Data</u></p>
  * <p>Paging can also be accomplished with local data using extensions:</p>
  * <div class="mdetail-params"><ul>
- * <li><a href="http://extjs.com/forum/showthread.php?t=57386">Ext.ux.data.PagingStore</a></li>
+ * <li><a href="http://extjs.com/forum/showthread.php?t=71532">Ext.ux.data.PagingStore</a></li>
  * <li>Paging Memory Proxy (examples/ux/PagingMemoryProxy.js)</li>
  * </ul></div>
- * @constructor
- * Create a new PagingToolbar
+ * @constructor Create a new PagingToolbar
  * @param {Object} config The config object
  * @xtype paging
  */
@@ -42481,10 +45869,13 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
     refreshText : 'Refresh',
 
     /**
-     * @deprecated
-     * <b>The defaults for these should be set in the data store.</b>
-     * Object mapping of parameter names used for load calls, initially set to:
+     * <p><b>Deprecated</b>. <code>paramNames</code> should be set in the <b>data store</b>
+     * (see {@link Ext.data.Store#paramNames}).</p>
+     * <br><p>Object mapping of parameter names used for load calls, initially set to:</p>
      * <pre>{start: 'start', limit: 'limit'}</pre>
+     * @type Object
+     * @property paramNames
+     * @deprecated
      */
 
     /**
@@ -42525,6 +45916,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
             allowNegative: false,
             enableKeyEvents: true,
             selectOnFocus: true,
+            submitValue: false,
             listeners: {
                 scope: this,
                 keydown: this.onPagingKeyDown,
@@ -42550,7 +45942,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
             tooltip: this.refreshText,
             overflowText: this.refreshText,
             iconCls: 'x-tbar-loading',
-            handler: this.refresh,
+            handler: this.doRefresh,
             scope: this
         })];
 
@@ -42600,7 +45992,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
         );
         this.on('afterlayout', this.onFirstLayout, this, {single: true});
         this.cursor = 0;
-        this.bindStore(this.store);
+        this.bindStore(this.store, true);
     },
 
     // private
@@ -42776,7 +46168,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
     /**
      * Refresh the current page, has the same effect as clicking the 'refresh' button.
      */
-    refresh : function(){
+    doRefresh : function(){
         this.doLoad(this.cursor);
     },
 
@@ -42788,11 +46180,15 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
     bindStore : function(store, initial){
         var doLoad;
         if(!initial && this.store){
-            this.store.un('beforeload', this.beforeLoad, this);
-            this.store.un('load', this.onLoad, this);
-            this.store.un('exception', this.onLoadError, this);
             if(store !== this.store && this.store.autoDestroy){
                 this.store.destroy();
+            }else{
+                this.store.un('beforeload', this.beforeLoad, this);
+                this.store.un('load', this.onLoad, this);
+                this.store.un('exception', this.onLoadError, this);
+            }
+            if(!store){
+                this.store = null;
             }
         }
         if(store){
@@ -42803,7 +46199,7 @@ Ext.PagingToolbar = Ext.extend(Ext.Toolbar, {
                 load: this.onLoad,
                 exception: this.onLoadError
             });
-            doLoad = store.getCount() > 0;
+            doLoad = true;
         }
         this.store = store;
         if(doLoad){
@@ -42864,7 +46260,7 @@ Ext.History = (function () {
     }\r
 \r
     function updateIFrame (token) {\r
-        var html = ['<html><body><div id="state">',token,'</div></body></html>'].join('');\r
+        var html = ['<html><body><div id="state">',Ext.util.Format.htmlEncode(token),'</div></body></html>'].join('');\r
         try {\r
             var doc = iframe.contentWindow.document;\r
             doc.open();\r
@@ -42948,14 +46344,14 @@ Ext.History = (function () {
          * @property\r
          */\r
         iframeId: 'x-history-frame',\r
-        \r
+\r
         events:{},\r
 \r
         /**\r
          * Initialize the global History instance.\r
          * @param {Boolean} onReady (optional) A callback function that will be called once the history\r
          * component is fully initialized.\r
-         * @param {Object} scope (optional) The callback scope\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser window.\r
          */\r
         init: function (onReady, scope) {\r
             if(ready) {\r
@@ -42972,7 +46368,20 @@ Ext.History = (function () {
             if (Ext.isIE) {\r
                 iframe = Ext.getDom(Ext.History.iframeId);\r
             }\r
-            this.addEvents('ready', 'change');\r
+            this.addEvents(\r
+                /**\r
+                 * @event ready\r
+                 * Fires when the Ext.History singleton has been initialized and is ready for use.\r
+                 * @param {Ext.History} The Ext.History singleton.\r
+                 */\r
+                'ready',\r
+                /**\r
+                 * @event change\r
+                 * Fires when navigation back or forwards within the local page's history occurs.\r
+                 * @param {String} token An identifier associated with the page state at that point in its history.\r
+                 */\r
+                'change'\r
+            );\r
             if(onReady){\r
                 this.on('ready', onReady, scope, {single:true});\r
             }\r
@@ -43034,6 +46443,7 @@ tabPanel.on('tabchange', function(tabPanel, tab){
 Ext.apply(Ext.History, new Ext.util.Observable());/**\r
  * @class Ext.Tip\r
  * @extends Ext.Panel\r
+ * @xtype tip\r
  * This is the base class for {@link Ext.QuickTip} and {@link Ext.Tooltip} that provides the basic layout and\r
  * positioning that all tip-based classes require. This class can be used directly for simple, statically-positioned\r
  * tips that are displayed programmatically, or it can be extended to provide custom tip implementations.\r
@@ -43120,12 +46530,13 @@ tip.showAt([50,100]);
     },\r
 \r
     // protected\r
-    doAutoWidth : function(){\r
+    doAutoWidth : function(adjust){\r
+        adjust = adjust || 0;\r
         var bw = this.body.getTextWidth();\r
         if(this.title){\r
             bw = Math.max(bw, this.header.child('span').getTextWidth(this.title));\r
         }\r
-        bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr");\r
+        bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr") + adjust;\r
         this.setWidth(bw.constrain(this.minWidth, this.maxWidth));\r
         \r
         // IE7 repaint bug on initial show\r
@@ -43162,6 +46573,8 @@ tip.showBy('my-el', 'tl-tr');
     }\r
 });\r
 \r
+Ext.reg('tip', Ext.Tip);\r
+\r
 // private - custom Tip DD implementation\r
 Ext.Tip.DD = function(tip, config){\r
     Ext.apply(this, config);\r
@@ -43185,69 +46598,85 @@ Ext.extend(Ext.Tip.DD, Ext.dd.DD, {
  * @class Ext.ToolTip\r
  * @extends Ext.Tip\r
  * A standard tooltip implementation for providing additional information when hovering over a target element.\r
+ * @xtype tooltip\r
  * @constructor\r
  * Create a new Tooltip\r
  * @param {Object} config The configuration options\r
  */\r
 Ext.ToolTip = Ext.extend(Ext.Tip, {\r
     /**\r
-     * When a Tooltip is configured with the {@link #delegate} option to cause selected child elements of the {@link #target}\r
-     * Element to each trigger a seperate show event, this property is set to the DOM element which triggered the show.\r
+     * When a Tooltip is configured with the <code>{@link #delegate}</code>\r
+     * option to cause selected child elements of the <code>{@link #target}</code>\r
+     * Element to each trigger a seperate show event, this property is set to\r
+     * the DOM element which triggered the show.\r
      * @type DOMElement\r
      * @property triggerElement\r
      */\r
     /**\r
-     * @cfg {Mixed} target The target HTMLElement, Ext.Element or id to monitor for mouseover events to trigger\r
-     * showing this ToolTip.\r
+     * @cfg {Mixed} target The target HTMLElement, Ext.Element or id to monitor\r
+     * for mouseover events to trigger showing this ToolTip.\r
      */\r
     /**\r
-     * @cfg {Boolean} autoHide True to automatically hide the tooltip after the mouse exits the target element\r
-     * or after the {@link #dismissDelay} has expired if set (defaults to true).  If {@link closable} = true a close\r
-     * tool button will be rendered into the tooltip header.\r
+     * @cfg {Boolean} autoHide True to automatically hide the tooltip after the\r
+     * mouse exits the target element or after the <code>{@link #dismissDelay}</code>\r
+     * has expired if set (defaults to true).  If <code>{@link closable} = true</code>\r
+     * a close tool button will be rendered into the tooltip header.\r
      */\r
     /**\r
-     * @cfg {Number} showDelay Delay in milliseconds before the tooltip displays after the mouse enters the\r
-     * target element (defaults to 500)\r
+     * @cfg {Number} showDelay Delay in milliseconds before the tooltip displays\r
+     * after the mouse enters the target element (defaults to 500)\r
      */\r
-    showDelay: 500,\r
+    showDelay : 500,\r
     /**\r
-     * @cfg {Number} hideDelay Delay in milliseconds after the mouse exits the target element but before the\r
-     * tooltip actually hides (defaults to 200).  Set to 0 for the tooltip to hide immediately.\r
+     * @cfg {Number} hideDelay Delay in milliseconds after the mouse exits the\r
+     * target element but before the tooltip actually hides (defaults to 200).\r
+     * Set to 0 for the tooltip to hide immediately.\r
      */\r
-    hideDelay: 200,\r
+    hideDelay : 200,\r
     /**\r
-     * @cfg {Number} dismissDelay Delay in milliseconds before the tooltip automatically hides (defaults to 5000).\r
-     * To disable automatic hiding, set dismissDelay = 0.\r
+     * @cfg {Number} dismissDelay Delay in milliseconds before the tooltip\r
+     * automatically hides (defaults to 5000). To disable automatic hiding, set\r
+     * dismissDelay = 0.\r
      */\r
-    dismissDelay: 5000,\r
+    dismissDelay : 5000,\r
     /**\r
-     * @cfg {Array} mouseOffset An XY offset from the mouse position where the tooltip should be shown (defaults to [15,18]).\r
+     * @cfg {Array} mouseOffset An XY offset from the mouse position where the\r
+     * tooltip should be shown (defaults to [15,18]).\r
      */\r
     /**\r
-     * @cfg {Boolean} trackMouse True to have the tooltip follow the mouse as it moves over the target element (defaults to false).\r
+     * @cfg {Boolean} trackMouse True to have the tooltip follow the mouse as it\r
+     * moves over the target element (defaults to false).\r
      */\r
     trackMouse : false,\r
     /**\r
-     * @cfg {Boolean} anchorToTarget True to anchor the tooltip to the target element, false to\r
-     * anchor it relative to the mouse coordinates (defaults to true).  When anchorToTarget is\r
-     * true, use {@link #defaultAlign} to control tooltip alignment to the target element.  When\r
-     * anchorToTarget is false, use {@link #anchorPosition} instead to control alignment.\r
-     */\r
-    anchorToTarget: true,\r
-    /**\r
-     * @cfg {Number} anchorOffset A numeric pixel value used to offset the default position of the\r
-     * anchor arrow (defaults to 0).  When the anchor position is on the top or bottom of the tooltip,\r
-     * anchorOffset will be used as a horizontal offset.  Likewise, when the anchor position is on the\r
-     * left or right side, anchorOffset will be used as a vertical offset.\r
-     */\r
-    anchorOffset: 0,\r
-    /**\r
-     * @cfg {String} delegate <p>Optional. A {@link Ext.DomQuery DomQuery} selector which allows selection of individual elements\r
-     * within the {@link #target} element to trigger showing and hiding the ToolTip as the mouse moves within the target.</p>\r
-     * <p>When specified, the child element of the target which caused a show event is placed into the {@link #triggerElement} property\r
+     * @cfg {Boolean} anchorToTarget True to anchor the tooltip to the target\r
+     * element, false to anchor it relative to the mouse coordinates (defaults\r
+     * to true).  When <code>anchorToTarget</code> is true, use\r
+     * <code>{@link #defaultAlign}</code> to control tooltip alignment to the\r
+     * target element.  When <code>anchorToTarget</code> is false, use\r
+     * <code>{@link #anchorPosition}</code> instead to control alignment.\r
+     */\r
+    anchorToTarget : true,\r
+    /**\r
+     * @cfg {Number} anchorOffset A numeric pixel value used to offset the\r
+     * default position of the anchor arrow (defaults to 0).  When the anchor\r
+     * position is on the top or bottom of the tooltip, <code>anchorOffset</code>\r
+     * will be used as a horizontal offset.  Likewise, when the anchor position\r
+     * is on the left or right side, <code>anchorOffset</code> will be used as\r
+     * a vertical offset.\r
+     */\r
+    anchorOffset : 0,\r
+    /**\r
+     * @cfg {String} delegate <p>Optional. A {@link Ext.DomQuery DomQuery}\r
+     * selector which allows selection of individual elements within the\r
+     * <code>{@link #target}</code> element to trigger showing and hiding the\r
+     * ToolTip as the mouse moves within the target.</p>\r
+     * <p>When specified, the child element of the target which caused a show\r
+     * event is placed into the <code>{@link #triggerElement}</code> property\r
      * before the ToolTip is shown.</p>\r
-     * <p>This may be useful when a Component has regular, repeating elements in it, each of which need a Tooltip which contains\r
-     * information specific to that element. For example:</p><pre><code>\r
+     * <p>This may be useful when a Component has regular, repeating elements\r
+     * in it, each of which need a Tooltip which contains information specific\r
+     * to that element. For example:</p><pre><code>\r
 var myGrid = new Ext.grid.gridPanel(gridConfig);\r
 myGrid.on('render', function(grid) {\r
     var store = grid.getStore();  // Capture the Store.\r
@@ -43256,24 +46685,27 @@ myGrid.on('render', function(grid) {
         target: view.mainBody,    // The overall target element.\r
         delegate: '.x-grid3-row', // Each grid row causes its own seperate show and hide.\r
         trackMouse: true,         // Moving within the row should not hide the tip.\r
-        renderTo: document.body,  // Render immediately so that tip.body can be referenced prior to the first show.\r
-        listeners: {              // Change content dynamically depending on which element triggered the show.\r
+        renderTo: document.body,  // Render immediately so that tip.body can be\r
+                                  //  referenced prior to the first show.\r
+        listeners: {              // Change content dynamically depending on which element\r
+                                  //  triggered the show.\r
             beforeshow: function updateTipBody(tip) {\r
                 var rowIndex = view.findRowIndex(tip.triggerElement);\r
-                tip.body.dom.innerHTML = "Over Record ID " + store.getAt(rowIndex).id;\r
+                tip.body.dom.innerHTML = 'Over Record ID ' + store.getAt(rowIndex).id;\r
             }\r
         }\r
     });\r
-});</code></pre>\r
+});\r
+     *</code></pre>\r
      */\r
 \r
     // private\r
-    targetCounter: 0,\r
+    targetCounter : 0,\r
 \r
-    constrainPosition: false,\r
+    constrainPosition : false,\r
 \r
     // private\r
-    initComponent: function(){\r
+    initComponent : function(){\r
         Ext.ToolTip.superclass.initComponent.call(this);\r
         this.lastActive = new Date();\r
         this.initTarget(this.target);\r
@@ -43303,10 +46735,10 @@ myGrid.on('render', function(grid) {
         var t;\r
         if((t = Ext.get(target))){\r
             if(this.target){\r
-                this.target = Ext.get(this.target);\r
-                this.target.un('mouseover', this.onTargetOver, this);\r
-                this.target.un('mouseout', this.onTargetOut, this);\r
-                this.target.un('mousemove', this.onMouseMove, this);\r
+                var tg = Ext.get(this.target);\r
+                this.mun(tg, 'mouseover', this.onTargetOver, this);\r
+                this.mun(tg, 'mouseout', this.onTargetOut, this);\r
+                this.mun(tg, 'mousemove', this.onMouseMove, this);\r
             }\r
             this.mon(t, {\r
                 mouseover: this.onTargetOver,\r
@@ -43342,20 +46774,22 @@ myGrid.on('render', function(grid) {
 \r
     // private\r
     getTargetXY : function(){\r
+        if(this.delegate){\r
+            this.anchorTarget = this.triggerElement;\r
+        }\r
         if(this.anchor){\r
             this.targetCounter++;\r
-            var offsets = this.getOffsets();\r
-            var xy = (this.anchorToTarget && !this.trackMouse) ?\r
-                this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) :\r
-                this.targetXY;\r
-\r
-            var dw = Ext.lib.Dom.getViewWidth()-5;\r
-            var dh = Ext.lib.Dom.getViewHeight()-5;\r
-            var scrollX = (document.documentElement.scrollLeft || document.body.scrollLeft || 0)+5;\r
-            var scrollY = (document.documentElement.scrollTop || document.body.scrollTop || 0)+5;\r
-\r
-            var axy = [xy[0] + offsets[0], xy[1] + offsets[1]];\r
-            var sz = this.getSize();\r
+            var offsets = this.getOffsets(),\r
+                xy = (this.anchorToTarget && !this.trackMouse) ? this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) : this.targetXY,\r
+                dw = Ext.lib.Dom.getViewWidth() - 5,\r
+                dh = Ext.lib.Dom.getViewHeight() - 5,\r
+                de = document.documentElement,\r
+                bd = document.body,\r
+                scrollX = (de.scrollLeft || bd.scrollLeft || 0) + 5,\r
+                scrollY = (de.scrollTop || bd.scrollTop || 0) + 5,\r
+                axy = [xy[0] + offsets[0], xy[1] + offsets[1]],\r
+                sz = this.getSize();\r
+                \r
             this.anchorEl.removeClass(this.anchorCls);\r
 \r
             if(this.targetCounter < 2){\r
@@ -43419,7 +46853,7 @@ myGrid.on('render', function(grid) {
         }else{\r
             var m = this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);\r
             if(!m){\r
-               throw "AnchorTip.defaultAlign is invalid";\r
+               throw 'AnchorTip.defaultAlign is invalid';\r
             }\r
             this.tipAnchor = m[1].charAt(0);\r
         }\r
@@ -43443,8 +46877,9 @@ myGrid.on('render', function(grid) {
     },\r
 \r
     // private\r
-    getOffsets: function(){\r
-        var offsets, ap = this.getAnchorPosition().charAt(0);\r
+    getOffsets : function(){\r
+        var offsets, \r
+            ap = this.getAnchorPosition().charAt(0);\r
         if(this.anchorToTarget && !this.trackMouse){\r
             switch(ap){\r
                 case 't':\r
@@ -43572,6 +47007,10 @@ myGrid.on('render', function(grid) {
         if(this.dismissDelay && this.autoHide !== false){\r
             this.dismissTimer = this.hide.defer(this.dismissDelay, this);\r
         }\r
+        if(this.anchor && !this.anchorEl.isVisible()){\r
+            this.syncAnchor();\r
+            this.anchorEl.show();\r
+        }\r
     },\r
 \r
     // private\r
@@ -43660,15 +47099,28 @@ myGrid.on('render', function(grid) {
         }\r
         return {x : x, y: y};\r
     },\r
+    \r
+    beforeDestroy : function(){\r
+        this.clearTimers();\r
+        Ext.destroy(this.anchorEl);\r
+        delete this.anchorEl;\r
+        delete this.target;\r
+        delete this.anchorTarget;\r
+        delete this.triggerElement;\r
+        Ext.ToolTip.superclass.beforeDestroy.call(this);    \r
+    },\r
 \r
     // private\r
     onDestroy : function(){\r
         Ext.getDoc().un('mousedown', this.onDocMouseDown, this);\r
         Ext.ToolTip.superclass.onDestroy.call(this);\r
     }\r
-});/**\r
+});\r
+\r
+Ext.reg('tooltip', Ext.ToolTip);/**\r
  * @class Ext.QuickTip\r
  * @extends Ext.ToolTip\r
+ * @xtype quicktip\r
  * A specialized tooltip class for tooltips that can be specified in markup and automatically managed by the global\r
  * {@link Ext.QuickTips} instance.  See the QuickTips class header for additional usage details and examples.\r
  * @constructor\r
@@ -43757,6 +47209,22 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
             this.clearTimer('show');\r
         }\r
     },\r
+    \r
+    getTipCfg: function(e) {\r
+        var t = e.getTarget(), \r
+            ttp, \r
+            cfg;\r
+        if(this.interceptTitles && t.title && Ext.isString(t.title)){\r
+            ttp = t.title;\r
+            t.qtip = ttp;\r
+            t.removeAttribute("title");\r
+            e.preventDefault();\r
+        }else{\r
+            cfg = this.tagConfig;\r
+            ttp = t.qtip || Ext.fly(t).getAttribute(cfg.attribute, cfg.namespace);\r
+        }\r
+        return ttp;\r
+    },\r
 \r
     // private\r
     onTargetOver : function(e){\r
@@ -43768,7 +47236,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         if(!t || t.nodeType !== 1 || t == document || t == document.body){\r
             return;\r
         }\r
-        if(this.activeTarget && t == this.activeTarget.el){\r
+        if(this.activeTarget && ((t == this.activeTarget.el) || Ext.fly(this.activeTarget.el).contains(t))){\r
             this.clearTimer('hide');\r
             this.show();\r
             return;\r
@@ -43783,18 +47251,8 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
             this.delayShow();\r
             return;\r
         }\r
-        \r
-        var ttp, et = Ext.fly(t), cfg = this.tagConfig;\r
-        var ns = cfg.namespace;\r
-        if(this.interceptTitles && t.title){\r
-            ttp = t.title;\r
-            t.qtip = ttp;\r
-            t.removeAttribute("title");\r
-            e.preventDefault();\r
-        } else{\r
-            ttp = t.qtip || et.getAttribute(cfg.attribute, ns);\r
-        }\r
-        if(ttp){\r
+        var ttp, et = Ext.fly(t), cfg = this.tagConfig, ns = cfg.namespace;\r
+        if(ttp = this.getTipCfg(e)){\r
             var autoHide = et.getAttribute(cfg.hide, ns);\r
             this.activeTarget = {\r
                 el: t,\r
@@ -43816,6 +47274,12 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
 \r
     // private\r
     onTargetOut : function(e){\r
+\r
+        // If moving within the current target, and it does not have a new tip, ignore the mouseout\r
+        if (this.activeTarget && e.within(this.activeTarget.el) && !this.getTipCfg(e)) {\r
+            return;\r
+        }\r
+\r
         this.clearTimer('show');\r
         if(this.autoHide !== false){\r
             this.delayHide();\r
@@ -43866,7 +47330,8 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         delete this.activeTarget;\r
         Ext.QuickTip.superclass.hide.call(this);\r
     }\r
-});/**\r
+});\r
+Ext.reg('quicktip', Ext.QuickTip);/**\r
  * @class Ext.QuickTips\r
  * <p>Provides attractive and customizable tooltips for any element. The QuickTips\r
  * singleton is used to configure and manage tooltips globally for multiple elements\r
@@ -44132,11 +47597,19 @@ new Ext.Viewport({
  */\r
 Ext.tree.TreePanel = Ext.extend(Ext.Panel, {\r
     rootVisible : true,\r
-    animate: Ext.enableFx,\r
+    animate : Ext.enableFx,\r
     lines : true,\r
     enableDD : false,\r
     hlDrop : Ext.enableFx,\r
-    pathSeparator: "/",\r
+    pathSeparator : '/',\r
+\r
+    /**\r
+     * @cfg {Array} bubbleEvents\r
+     * <p>An array of events that, when fired, should be bubbled to any parent container.\r
+     * See {@link Ext.util.Observable#enableBubble}.\r
+     * Defaults to <tt>[]</tt>.\r
+     */\r
+    bubbleEvents : [],\r
 \r
     initComponent : function(){\r
         Ext.tree.TreePanel.superclass.initComponent.call(this);\r
@@ -44152,7 +47625,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
                 dataUrl: this.dataUrl,\r
                 requestMethod: this.requestMethod\r
             });\r
-        }else if(typeof l == 'object' && !l.load){\r
+        }else if(Ext.isObject(l) && !l.load){\r
             l = new Ext.tree.TreeLoader(l);\r
         }\r
         this.loader = l;\r
@@ -44181,7 +47654,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} node The newly appended node\r
             * @param {Number} index The index of the newly appended node\r
             */\r
-           "append",\r
+           'append',\r
            /**\r
             * @event remove\r
             * Fires when a child node is removed from a node in this tree.\r
@@ -44189,7 +47662,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} parent The parent node\r
             * @param {Node} node The child node removed\r
             */\r
-           "remove",\r
+           'remove',\r
            /**\r
             * @event movenode\r
             * Fires when a node is moved to a new location in the tree\r
@@ -44199,7 +47672,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} newParent The new parent of this node\r
             * @param {Number} index The index it was moved to\r
             */\r
-           "movenode",\r
+           'movenode',\r
            /**\r
             * @event insert\r
             * Fires when a new child node is inserted in a node in this tree.\r
@@ -44208,7 +47681,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} node The child node inserted\r
             * @param {Node} refNode The child node the node was inserted before\r
             */\r
-           "insert",\r
+           'insert',\r
            /**\r
             * @event beforeappend\r
             * Fires before a new child is appended to a node in this tree, return false to cancel the append.\r
@@ -44216,7 +47689,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} parent The parent node\r
             * @param {Node} node The child node to be appended\r
             */\r
-           "beforeappend",\r
+           'beforeappend',\r
            /**\r
             * @event beforeremove\r
             * Fires before a child is removed from a node in this tree, return false to cancel the remove.\r
@@ -44224,7 +47697,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} parent The parent node\r
             * @param {Node} node The child node to be removed\r
             */\r
-           "beforeremove",\r
+           'beforeremove',\r
            /**\r
             * @event beforemovenode\r
             * Fires before a node is moved to a new location in the tree. Return false to cancel the move.\r
@@ -44234,7 +47707,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} newParent The new parent the node is moving to\r
             * @param {Number} index The index it is being moved to\r
             */\r
-           "beforemovenode",\r
+           'beforemovenode',\r
            /**\r
             * @event beforeinsert\r
             * Fires before a new child is inserted in a node in this tree, return false to cancel the insert.\r
@@ -44243,20 +47716,20 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Node} node The child node to be inserted\r
             * @param {Node} refNode The child node the node is being inserted before\r
             */\r
-            "beforeinsert",\r
+            'beforeinsert',\r
 \r
             /**\r
             * @event beforeload\r
             * Fires before a node is loaded, return false to cancel\r
             * @param {Node} node The node being loaded\r
             */\r
-            "beforeload",\r
+            'beforeload',\r
             /**\r
             * @event load\r
             * Fires when a node is loaded\r
             * @param {Node} node The node that was loaded\r
             */\r
-            "load",\r
+            'load',\r
             /**\r
             * @event textchange\r
             * Fires when the text for a node is changed\r
@@ -44264,7 +47737,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {String} text The new text\r
             * @param {String} oldText The old text\r
             */\r
-            "textchange",\r
+            'textchange',\r
             /**\r
             * @event beforeexpandnode\r
             * Fires before a node is expanded, return false to cancel.\r
@@ -44272,7 +47745,7 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Boolean} deep\r
             * @param {Boolean} anim\r
             */\r
-            "beforeexpandnode",\r
+            'beforeexpandnode',\r
             /**\r
             * @event beforecollapsenode\r
             * Fires before a node is collapsed, return false to cancel.\r
@@ -44280,54 +47753,75 @@ Ext.tree.TreePanel = Ext.extend(Ext.Panel, {
             * @param {Boolean} deep\r
             * @param {Boolean} anim\r
             */\r
-            "beforecollapsenode",\r
+            'beforecollapsenode',\r
             /**\r
             * @event expandnode\r
             * Fires when a node is expanded\r
             * @param {Node} node The node\r
             */\r
-            "expandnode",\r
+            'expandnode',\r
             /**\r
             * @event disabledchange\r
             * Fires when the disabled status of a node changes\r
             * @param {Node} node The node\r
             * @param {Boolean} disabled\r
             */\r
-            "disabledchange",\r
+            'disabledchange',\r
             /**\r
             * @event collapsenode\r
             * Fires when a node is collapsed\r
             * @param {Node} node The node\r
             */\r
-            "collapsenode",\r
+            'collapsenode',\r
             /**\r
             * @event beforeclick\r
             * Fires before click processing on a node. Return false to cancel the default action.\r
             * @param {Node} node The node\r
             * @param {Ext.EventObject} e The event object\r
             */\r
-            "beforeclick",\r
+            'beforeclick',\r
             /**\r
             * @event click\r
             * Fires when a node is clicked\r
             * @param {Node} node The node\r
             * @param {Ext.EventObject} e The event object\r
             */\r
-            "click",\r
+            'click',\r
+            /**\r
+            * @event containerclick\r
+            * Fires when the tree container is clicked\r
+            * @param {Tree} this\r
+            * @param {Ext.EventObject} e The event object\r
+            */\r
+            'containerclick',\r
             /**\r
             * @event checkchange\r
             * Fires when a node with a checkbox's checked property changes\r
             * @param {Node} this This node\r
             * @param {Boolean} checked\r
             */\r
-            "checkchange",\r
+            'checkchange',\r
+            /**\r
+            * @event beforedblclick\r
+            * Fires before double click processing on a node. Return false to cancel the default action.\r
+            * @param {Node} node The node\r
+            * @param {Ext.EventObject} e The event object\r
+            */\r
+            'beforedblclick',\r
             /**\r
             * @event dblclick\r
             * Fires when a node is double clicked\r
             * @param {Node} node The node\r
             * @param {Ext.EventObject} e The event object\r
             */\r
-            "dblclick",\r
+            'dblclick',\r
+            /**\r
+            * @event containerdblclick\r
+            * Fires when the tree container is double clicked\r
+            * @param {Tree} this\r
+            * @param {Ext.EventObject} e The event object\r
+            */\r
+            'containerdblclick',\r
             /**\r
             * @event contextmenu\r
             * Fires when a node is right clicked. To display a context menu in response to this\r
@@ -44375,13 +47869,20 @@ new Ext.tree.TreePanel({
             * @param {Node} node The node\r
             * @param {Ext.EventObject} e The event object\r
             */\r
-            "contextmenu",\r
+            'contextmenu',\r
+            /**\r
+            * @event containercontextmenu\r
+            * Fires when the tree container is right clicked\r
+            * @param {Tree} this\r
+            * @param {Ext.EventObject} e The event object\r
+            */\r
+            'containercontextmenu',\r
             /**\r
             * @event beforechildrenrendered\r
             * Fires right before the child nodes for a node are rendered\r
             * @param {Node} node The node\r
             */\r
-            "beforechildrenrendered",\r
+            'beforechildrenrendered',\r
            /**\r
              * @event startdrag\r
              * Fires when a node starts being dragged\r
@@ -44389,7 +47890,7 @@ new Ext.tree.TreePanel({
              * @param {Ext.tree.TreeNode} node\r
              * @param {event} e The raw browser event\r
              */\r
-            "startdrag",\r
+            'startdrag',\r
             /**\r
              * @event enddrag\r
              * Fires when a drag operation is complete\r
@@ -44397,7 +47898,7 @@ new Ext.tree.TreePanel({
              * @param {Ext.tree.TreeNode} node\r
              * @param {event} e The raw browser event\r
              */\r
-            "enddrag",\r
+            'enddrag',\r
             /**\r
              * @event dragdrop\r
              * Fires when a dragged node is dropped on a valid DD target\r
@@ -44406,7 +47907,7 @@ new Ext.tree.TreePanel({
              * @param {DD} dd The dd it was dropped on\r
              * @param {event} e The raw browser event\r
              */\r
-            "dragdrop",\r
+            'dragdrop',\r
             /**\r
              * @event beforenodedrop\r
              * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent\r
@@ -44422,11 +47923,11 @@ new Ext.tree.TreePanel({
              * to be inserted by setting them on this object.</li>\r
              * <li>cancel - Set this to true to cancel the drop.</li>\r
              * <li>dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true\r
-             * will prevent the animated "repair" from appearing.</li>\r
+             * will prevent the animated 'repair' from appearing.</li>\r
              * </ul>\r
              * @param {Object} dropEvent\r
              */\r
-            "beforenodedrop",\r
+            'beforenodedrop',\r
             /**\r
              * @event nodedrop\r
              * Fires after a DD object is dropped on a node in this tree. The dropEvent\r
@@ -44442,7 +47943,7 @@ new Ext.tree.TreePanel({
              * </ul>\r
              * @param {Object} dropEvent\r
              */\r
-            "nodedrop",\r
+            'nodedrop',\r
              /**\r
              * @event nodedragover\r
              * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent\r
@@ -44459,10 +47960,10 @@ new Ext.tree.TreePanel({
              * </ul>\r
              * @param {Object} dragOverEvent\r
              */\r
-            "nodedragover"\r
+            'nodedragover'\r
         );\r
         if(this.singleExpand){\r
-            this.on("beforeexpandnode", this.restrictExpand, this);\r
+            this.on('beforeexpandnode', this.restrictExpand, this);\r
         }\r
     },\r
 \r
@@ -44503,12 +48004,24 @@ new Ext.tree.TreePanel({
             var uiP = node.attributes.uiProvider;\r
             node.ui = uiP ? new uiP(node) : new Ext.tree.RootTreeNodeUI(node);\r
         }\r
-        if (this.innerCt) {\r
-            this.innerCt.update('');\r
-            this.afterRender();\r
+        if(this.innerCt){\r
+            this.clearInnerCt();\r
+            this.renderRoot();\r
         }\r
         return node;\r
     },\r
+    \r
+    clearInnerCt : function(){\r
+        this.innerCt.update('');    \r
+    },\r
+    \r
+    // private\r
+    renderRoot : function(){\r
+        this.root.render();\r
+        if(!this.rootVisible){\r
+            this.root.renderChildren();\r
+        }\r
+    },\r
 \r
     /**\r
      * Gets a node in this tree by its id\r
@@ -44531,7 +48044,7 @@ new Ext.tree.TreePanel({
 \r
     // private\r
     toString : function(){\r
-        return "[Tree"+(this.id?" "+this.id:"")+"]";\r
+        return '[Tree'+(this.id?' '+this.id:'')+']';\r
     },\r
 \r
     // private\r
@@ -44546,7 +48059,7 @@ new Ext.tree.TreePanel({
     },\r
 \r
     /**\r
-     * Retrieve an array of checked nodes, or an array of a specific attribute of checked nodes (e.g. "id")\r
+     * Retrieve an array of checked nodes, or an array of a specific attribute of checked nodes (e.g. 'id')\r
      * @param {String} attribute (optional) Defaults to null (return the actual nodes)\r
      * @param {TreeNode} startNode (optional) The node to start from, defaults to the root\r
      * @return {Array}\r
@@ -44563,14 +48076,6 @@ new Ext.tree.TreePanel({
         return r;\r
     },\r
 \r
-    /**\r
-     * Returns the container element for this TreePanel.\r
-     * @return {Element} The container element for this TreePanel.\r
-     */\r
-    getEl : function(){\r
-        return this.el;\r
-    },\r
-\r
     /**\r
      * Returns the default {@link Ext.tree.TreeLoader} for this TreePanel.\r
      * @return {Ext.tree.TreeLoader} The TreeLoader for this TreePanel.\r
@@ -44612,7 +48117,7 @@ new Ext.tree.TreePanel({
      * (bSuccess, oLastNode) where bSuccess is if the expand was successful and oLastNode is the last node that was expanded.\r
      */\r
     expandPath : function(path, attr, callback){\r
-        attr = attr || "id";\r
+        attr = attr || 'id';\r
         var keys = path.split(this.pathSeparator);\r
         var curNode = this.root;\r
         if(curNode.attributes[attr] != keys[1]){ // invalid root\r
@@ -44650,10 +48155,10 @@ new Ext.tree.TreePanel({
      * (bSuccess, oSelNode) where bSuccess is if the selection was successful and oSelNode is the selected node.\r
      */\r
     selectPath : function(path, attr, callback){\r
-        attr = attr || "id";\r
-        var keys = path.split(this.pathSeparator);\r
-        var v = keys.pop();\r
-        if(keys.length > 0){\r
+        attr = attr || 'id';\r
+        var keys = path.split(this.pathSeparator),\r
+            v = keys.pop();\r
+        if(keys.length > 1){\r
             var f = function(success, node){\r
                 if(success && node){\r
                     var n = node.findChild(attr, v);\r
@@ -44692,9 +48197,9 @@ new Ext.tree.TreePanel({
     onRender : function(ct, position){\r
         Ext.tree.TreePanel.superclass.onRender.call(this, ct, position);\r
         this.el.addClass('x-tree');\r
-        this.innerCt = this.body.createChild({tag:"ul",\r
-               cls:"x-tree-root-ct " +\r
-               (this.useArrows ? 'x-tree-arrows' : this.lines ? "x-tree-lines" : "x-tree-no-lines")});\r
+        this.innerCt = this.body.createChild({tag:'ul',\r
+               cls:'x-tree-root-ct ' +\r
+               (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')});\r
     },\r
 \r
     // private\r
@@ -44711,7 +48216,7 @@ new Ext.tree.TreePanel({
             * @type Ext.tree.TreeDropZone\r
             */\r
              this.dropZone = new Ext.tree.TreeDropZone(this, this.dropConfig || {\r
-               ddGroup: this.ddGroup || "TreeDD", appendOnly: this.ddAppendOnly === true\r
+               ddGroup: this.ddGroup || 'TreeDD', appendOnly: this.ddAppendOnly === true\r
            });\r
         }\r
         if((this.enableDD || this.enableDrag) && !this.dragZone){\r
@@ -44721,7 +48226,7 @@ new Ext.tree.TreePanel({
             * @type Ext.tree.TreeDragZone\r
             */\r
             this.dragZone = new Ext.tree.TreeDragZone(this, this.dragConfig || {\r
-               ddGroup: this.ddGroup || "TreeDD",\r
+               ddGroup: this.ddGroup || 'TreeDD',\r
                scroll: this.ddScroll\r
            });\r
         }\r
@@ -44731,26 +48236,17 @@ new Ext.tree.TreePanel({
     // private\r
     afterRender : function(){\r
         Ext.tree.TreePanel.superclass.afterRender.call(this);\r
-        this.root.render();\r
-        if(!this.rootVisible){\r
-            this.root.renderChildren();\r
-        }\r
+        this.renderRoot();\r
     },\r
 \r
-    onDestroy : function(){\r
+    beforeDestroy : function(){\r
         if(this.rendered){\r
-            this.body.removeAllListeners();\r
             Ext.dd.ScrollManager.unregister(this.body);\r
-            if(this.dropZone){\r
-                this.dropZone.unreg();\r
-            }\r
-            if(this.dragZone){\r
-               this.dragZone.unreg();\r
-            }\r
+            Ext.destroy(this.dropZone, this.dragZone);\r
         }\r
-        this.root.destroy();\r
-        this.nodeHash = null;\r
-        Ext.tree.TreePanel.superclass.onDestroy.call(this);\r
+        Ext.destroy(this.root, this.loader);\r
+        this.nodeHash = this.root = this.loader = null;\r
+        Ext.tree.TreePanel.superclass.beforeDestroy.call(this);\r
     }\r
 \r
     /**\r
@@ -44892,6 +48388,15 @@ new Ext.tree.TreePanel({
     /**\r
      * @cfg {String} contentEl  @hide\r
      */\r
+    /**\r
+     * @cfg {Mixed} data  @hide\r
+     */\r
+    /**\r
+     * @cfg {Mixed} tpl  @hide\r
+     */\r
+    /**\r
+     * @cfg {String} tplWriteMode  @hide\r
+     */\r
     /**\r
      * @cfg {String} disabledClass  @hide\r
      */\r
@@ -44936,14 +48441,21 @@ Ext.reg('treepanel', Ext.tree.TreePanel);Ext.tree.TreeEventModel = function(tree
 \r
 Ext.tree.TreeEventModel.prototype = {\r
     initEvents : function(){\r
-        var el = this.tree.getTreeEl();\r
-        el.on('click', this.delegateClick, this);\r
-        if(this.tree.trackMouseOver !== false){\r
-            this.tree.innerCt.on('mouseover', this.delegateOver, this);\r
-            this.tree.innerCt.on('mouseout', this.delegateOut, this);\r
+        var t = this.tree;\r
+\r
+        if(t.trackMouseOver !== false){\r
+            t.mon(t.innerCt, {\r
+                scope: this,\r
+                mouseover: this.delegateOver,\r
+                mouseout: this.delegateOut\r
+            });\r
         }\r
-        el.on('dblclick', this.delegateDblClick, this);\r
-        el.on('contextmenu', this.delegateContextMenu, this);\r
+        t.mon(t.getTreeEl(), {\r
+            scope: this,\r
+            click: this.delegateClick,\r
+            dblclick: this.delegateDblClick,\r
+            contextmenu: this.delegateContextMenu\r
+        });\r
     },\r
 \r
     getNode : function(e){\r
@@ -45003,42 +48515,55 @@ Ext.tree.TreeEventModel.prototype = {
     },\r
 \r
     trackExit : function(e){\r
-        if(this.lastOverNode && !e.within(this.lastOverNode.ui.getEl())){\r
-            this.onNodeOut(e, this.lastOverNode);\r
+        if(this.lastOverNode){\r
+            if(this.lastOverNode.ui && !e.within(this.lastOverNode.ui.getEl())){\r
+                this.onNodeOut(e, this.lastOverNode);\r
+            }\r
             delete this.lastOverNode;\r
             Ext.getBody().un('mouseover', this.trackExit, this);\r
             this.trackingDoc = false;\r
         }\r
+\r
     },\r
 \r
     delegateClick : function(e, t){\r
-        if(!this.beforeEvent(e)){\r
-            return;\r
-        }\r
-\r
-        if(e.getTarget('input[type=checkbox]', 1)){\r
-            this.onCheckboxClick(e, this.getNode(e));\r
-        }\r
-        else if(e.getTarget('.x-tree-ec-icon', 1)){\r
-            this.onIconClick(e, this.getNode(e));\r
-        }\r
-        else if(this.getNodeTarget(e)){\r
-            this.onNodeClick(e, this.getNode(e));\r
+        if(this.beforeEvent(e)){\r
+            if(e.getTarget('input[type=checkbox]', 1)){\r
+                this.onCheckboxClick(e, this.getNode(e));\r
+            }else if(e.getTarget('.x-tree-ec-icon', 1)){\r
+                this.onIconClick(e, this.getNode(e));\r
+            }else if(this.getNodeTarget(e)){\r
+                this.onNodeClick(e, this.getNode(e));\r
+            }else{\r
+                this.onContainerEvent(e, 'click');\r
+            }\r
         }\r
     },\r
 \r
     delegateDblClick : function(e, t){\r
-        if(this.beforeEvent(e) && this.getNodeTarget(e)){\r
-            this.onNodeDblClick(e, this.getNode(e));\r
+        if(this.beforeEvent(e)){\r
+            if(this.getNodeTarget(e)){\r
+                this.onNodeDblClick(e, this.getNode(e));\r
+            }else{\r
+                this.onContainerEvent(e, 'dblclick');\r
+            }\r
         }\r
     },\r
 \r
     delegateContextMenu : function(e, t){\r
-        if(this.beforeEvent(e) && this.getNodeTarget(e)){\r
-            this.onNodeContextMenu(e, this.getNode(e));\r
+        if(this.beforeEvent(e)){\r
+            if(this.getNodeTarget(e)){\r
+                this.onNodeContextMenu(e, this.getNode(e));\r
+            }else{\r
+                this.onContainerEvent(e, 'contextmenu');\r
+            }\r
         }\r
     },\r
 \r
+    onContainerEvent: function(e, type){\r
+        this.tree.fireEvent('container' + type, this.tree, e);\r
+    },\r
+\r
     onNodeClick : function(e, node){\r
         node.ui.onClick(e);\r
     },\r
@@ -45077,7 +48602,8 @@ Ext.tree.TreeEventModel.prototype = {
     },\r
 \r
     beforeEvent : function(e){\r
-        if(this.disabled){\r
+        var node = this.getNode(e);\r
+        if(this.disabled || !node || !node.ui){\r
             e.stopEvent();\r
             return false;\r
         }\r
@@ -45106,7 +48632,7 @@ Ext.tree.DefaultSelectionModel = function(config){
         * @param {DefaultSelectionModel} this\r
         * @param {TreeNode} node the new selection\r
         */\r
-       "selectionchange",\r
+       'selectionchange',\r
 \r
        /**\r
         * @event beforeselect\r
@@ -45115,7 +48641,7 @@ Ext.tree.DefaultSelectionModel = function(config){
         * @param {TreeNode} node the new selection\r
         * @param {TreeNode} node the old selection\r
         */\r
-       "beforeselect"\r
+       'beforeselect'\r
    );\r
 \r
     Ext.apply(this, config);\r
@@ -45125,8 +48651,8 @@ Ext.tree.DefaultSelectionModel = function(config){
 Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {\r
     init : function(tree){\r
         this.tree = tree;\r
-        tree.getTreeEl().on("keydown", this.onKeyDown, this);\r
-        tree.on("click", this.onNodeClick, this);\r
+        tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
+        tree.on('click', this.onNodeClick, this);\r
     },\r
     \r
     onNodeClick : function(node, e){\r
@@ -45138,17 +48664,21 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
      * @param {TreeNode} node The node to select\r
      * @return {TreeNode} The selected node\r
      */\r
-    select : function(node){\r
+    select : function(node, /* private*/ selectNextNode){\r
+        // If node is hidden, select the next node in whatever direction was being moved in.\r
+        if (!Ext.fly(node.ui.wrap).isVisible() && selectNextNode) {\r
+            return selectNextNode.call(this, node);\r
+        }\r
         var last = this.selNode;\r
         if(node == last){\r
             node.ui.onSelectedChange(true);\r
         }else if(this.fireEvent('beforeselect', this, node, last) !== false){\r
-            if(last){\r
+            if(last && last.ui){\r
                 last.ui.onSelectedChange(false);\r
             }\r
             this.selNode = node;\r
             node.ui.onSelectedChange(true);\r
-            this.fireEvent("selectionchange", this, node, last);\r
+            this.fireEvent('selectionchange', this, node, last);\r
         }\r
         return node;\r
     },\r
@@ -45156,22 +48686,26 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
     /**\r
      * Deselect a node.\r
      * @param {TreeNode} node The node to unselect\r
+     * @param {Boolean} silent True to stop the selectionchange event from firing.\r
      */\r
-    unselect : function(node){\r
+    unselect : function(node, silent){\r
         if(this.selNode == node){\r
-            this.clearSelections();\r
+            this.clearSelections(silent);\r
         }    \r
     },\r
     \r
     /**\r
      * Clear all selections\r
+     * @param {Boolean} silent True to stop the selectionchange event from firing.\r
      */\r
-    clearSelections : function(){\r
+    clearSelections : function(silent){\r
         var n = this.selNode;\r
         if(n){\r
             n.ui.onSelectedChange(false);\r
             this.selNode = null;\r
-            this.fireEvent("selectionchange", this, null);\r
+            if(silent !== true){\r
+                this.fireEvent('selectionchange', this, null);\r
+            }\r
         }\r
         return n;\r
     },\r
@@ -45197,24 +48731,24 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
      * Selects the node above the selected node in the tree, intelligently walking the nodes\r
      * @return TreeNode The new selection\r
      */\r
-    selectPrevious : function(){\r
-        var s = this.selNode || this.lastSelNode;\r
-        if(!s){\r
+    selectPrevious : function(/* private */ s){\r
+        if(!(s = s || this.selNode || this.lastSelNode)){\r
             return null;\r
         }\r
+        // Here we pass in the current function to select to indicate the direction we're moving\r
         var ps = s.previousSibling;\r
         if(ps){\r
             if(!ps.isExpanded() || ps.childNodes.length < 1){\r
-                return this.select(ps);\r
+                return this.select(ps, this.selectPrevious);\r
             } else{\r
                 var lc = ps.lastChild;\r
-                while(lc && lc.isExpanded() && lc.childNodes.length > 0){\r
+                while(lc && lc.isExpanded() && Ext.fly(lc.ui.wrap).isVisible() && lc.childNodes.length > 0){\r
                     lc = lc.lastChild;\r
                 }\r
-                return this.select(lc);\r
+                return this.select(lc, this.selectPrevious);\r
             }\r
         } else if(s.parentNode && (this.tree.rootVisible || !s.parentNode.isRoot)){\r
-            return this.select(s.parentNode);\r
+            return this.select(s.parentNode, this.selectPrevious);\r
         }\r
         return null;\r
     },\r
@@ -45223,20 +48757,20 @@ Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {
      * Selects the node above the selected node in the tree, intelligently walking the nodes\r
      * @return TreeNode The new selection\r
      */\r
-    selectNext : function(){\r
-        var s = this.selNode || this.lastSelNode;\r
-        if(!s){\r
+    selectNext : function(/* private */ s){\r
+        if(!(s = s || this.selNode || this.lastSelNode)){\r
             return null;\r
         }\r
-        if(s.firstChild && s.isExpanded()){\r
-             return this.select(s.firstChild);\r
+        // Here we pass in the current function to select to indicate the direction we're moving\r
+        if(s.firstChild && s.isExpanded() && Ext.fly(s.ui.wrap).isVisible()){\r
+             return this.select(s.firstChild, this.selectNext);\r
          }else if(s.nextSibling){\r
-             return this.select(s.nextSibling);\r
+             return this.select(s.nextSibling, this.selectNext);\r
          }else if(s.parentNode){\r
             var newS = null;\r
             s.parentNode.bubble(function(){\r
                 if(this.nextSibling){\r
-                    newS = this.getOwnerTree().selModel.select(this.nextSibling);\r
+                    newS = this.getOwnerTree().selModel.select(this.nextSibling, this.selectNext);\r
                     return false;\r
                 }\r
             });\r
@@ -45299,7 +48833,7 @@ Ext.tree.MultiSelectionModel = function(config){
         * @param {MultiSelectionModel} this\r
         * @param {Array} nodes Array of the selected nodes\r
         */\r
-       "selectionchange"\r
+       'selectionchange'\r
    );\r
     Ext.apply(this, config);\r
     Ext.tree.MultiSelectionModel.superclass.constructor.call(this);\r
@@ -45308,8 +48842,8 @@ Ext.tree.MultiSelectionModel = function(config){
 Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {\r
     init : function(tree){\r
         this.tree = tree;\r
-        tree.getTreeEl().on("keydown", this.onKeyDown, this);\r
-        tree.on("click", this.onNodeClick, this);\r
+        tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
+        tree.on('click', this.onNodeClick, this);\r
     },\r
     \r
     onNodeClick : function(node, e){\r
@@ -45339,7 +48873,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {
         this.selMap[node.id] = node;\r
         this.lastSelNode = node;\r
         node.ui.onSelectedChange(true);\r
-        this.fireEvent("selectionchange", this, this.selNodes);\r
+        this.fireEvent('selectionchange', this, this.selNodes);\r
         return node;\r
     },\r
     \r
@@ -45356,7 +48890,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {
                 this.selNodes.splice(index, 1);\r
             }\r
             delete this.selMap[node.id];\r
-            this.fireEvent("selectionchange", this, this.selNodes);\r
+            this.fireEvent('selectionchange', this, this.selNodes);\r
         }\r
     },\r
     \r
@@ -45372,7 +48906,7 @@ Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {
             this.selNodes = [];\r
             this.selMap = {};\r
             if(suppressEvent !== true){\r
-                this.fireEvent("selectionchange", this, this.selNodes);\r
+                this.fireEvent('selectionchange', this, this.selNodes);\r
             }\r
         }\r
     },\r
@@ -45812,9 +49346,10 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
     /**\r
      * Removes a child node from this node.\r
      * @param {Node} node The node to remove\r
+     * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
      * @return {Node} The removed node\r
      */\r
-    removeChild : function(node){\r
+    removeChild : function(node, destroy){\r
         var index = this.childNodes.indexOf(node);\r
         if(index == -1){\r
             return false;\r
@@ -45842,14 +49377,35 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
             this.setLastChild(node.previousSibling);\r
         }\r
 \r
-        node.setOwnerTree(null);\r
-        // clear any references from the node\r
-        node.parentNode = null;\r
-        node.previousSibling = null;\r
-        node.nextSibling = null;\r
+        node.clear();\r
         this.fireEvent("remove", this.ownerTree, this, node);\r
+        if(destroy){\r
+            node.destroy();\r
+        }\r
         return node;\r
     },\r
+    \r
+    // private\r
+    clear : function(destroy){\r
+        // clear any references from the node\r
+        this.setOwnerTree(null, destroy);\r
+        this.parentNode = this.previousSibling = this.nextSibling = null\r
+        if(destroy){\r
+            this.firstChild = this.lastChild = null; \r
+        }\r
+    },\r
+    \r
+    /**\r
+     * Destroys the node.\r
+     */\r
+    destroy : function(){\r
+        this.purgeListeners();\r
+        this.clear(true);  \r
+        Ext.each(this.childNodes, function(n){\r
+            n.destroy();\r
+        });\r
+        this.childNodes = null;\r
+    },\r
 \r
     /**\r
      * Inserts the first node before the second node in this nodes childNodes collection.\r
@@ -45909,10 +49465,25 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
 \r
     /**\r
      * Removes this node from its parent\r
+     * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
      * @return {Node} this\r
      */\r
-    remove : function(){\r
-        this.parentNode.removeChild(this);\r
+    remove : function(destroy){\r
+        this.parentNode.removeChild(this, destroy);\r
+        return this;\r
+    },\r
+    \r
+    /**\r
+     * Removes all child nodes from this node.\r
+     * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
+     * @return {Node} this\r
+     */\r
+    removeAll : function(destroy){\r
+        var cn = this.childNodes,\r
+            n;\r
+        while((n = cn[0])){\r
+            this.removeChild(n, destroy);\r
+        }\r
         return this;\r
     },\r
 \r
@@ -45981,741 +49552,765 @@ Ext.extend(Ext.data.Node, Ext.util.Observable, {
     },\r
 \r
     // private\r
-    setOwnerTree : function(tree){\r
+    setOwnerTree : function(tree, destroy){\r
         // if it is a move, we need to update everyone\r
         if(tree != this.ownerTree){\r
             if(this.ownerTree){\r
                 this.ownerTree.unregisterNode(this);\r
             }\r
-            this.ownerTree = tree;\r
-            var cs = this.childNodes;\r
-            for(var i = 0, len = cs.length; i < len; i++) {\r
-               cs[i].setOwnerTree(tree);\r
-            }\r
-            if(tree){\r
-                tree.registerNode(this);\r
-            }\r
-        }\r
-    },\r
-    \r
-    /**\r
-     * Changes the id of this node.\r
-     * @param {String} id The new id for the node.\r
-     */\r
-    setId: function(id){\r
-        if(id !== this.id){\r
-            var t = this.ownerTree;\r
-            if(t){\r
-                t.unregisterNode(this);\r
-            }\r
-            this.id = id;\r
-            if(t){\r
-                t.registerNode(this);\r
-            }\r
-            this.onIdChange(id);\r
-        }\r
-    },\r
-    \r
-    // private\r
-    onIdChange: Ext.emptyFn,\r
-\r
-    /**\r
-     * Returns the path for this node. The path can be used to expand or select this node programmatically.\r
-     * @param {String} attr (optional) The attr to use for the path (defaults to the node's id)\r
-     * @return {String} The path\r
-     */\r
-    getPath : function(attr){\r
-        attr = attr || "id";\r
-        var p = this.parentNode;\r
-        var b = [this.attributes[attr]];\r
-        while(p){\r
-            b.unshift(p.attributes[attr]);\r
-            p = p.parentNode;\r
-        }\r
-        var sep = this.getOwnerTree().pathSeparator;\r
-        return sep + b.join(sep);\r
-    },\r
-\r
-    /**\r
-     * Bubbles up the tree from this node, calling the specified function with each node. The scope (<i>this</i>) of\r
-     * function call will be the scope provided or the current node. The arguments to the function\r
-     * will be the args provided or the current node. If the function returns false at any point,\r
-     * the bubble is stopped.\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function (defaults to current node)\r
-     * @param {Array} args (optional) The args to call the function with (default to passing the current node)\r
-     */\r
-    bubble : function(fn, scope, args){\r
-        var p = this;\r
-        while(p){\r
-            if(fn.apply(scope || p, args || [p]) === false){\r
-                break;\r
-            }\r
-            p = p.parentNode;\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Cascades down the tree from this node, calling the specified function with each node. The scope (<i>this</i>) of\r
-     * function call will be the scope provided or the current node. The arguments to the function\r
-     * will be the args provided or the current node. If the function returns false at any point,\r
-     * the cascade is stopped on that branch.\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function (defaults to current node)\r
-     * @param {Array} args (optional) The args to call the function with (default to passing the current node)\r
-     */\r
-    cascade : function(fn, scope, args){\r
-        if(fn.apply(scope || this, args || [this]) !== false){\r
-            var cs = this.childNodes;\r
-            for(var i = 0, len = cs.length; i < len; i++) {\r
-               cs[i].cascade(fn, scope, args);\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Interates the child nodes of this node, calling the specified function with each node. The scope (<i>this</i>) of\r
-     * function call will be the scope provided or the current node. The arguments to the function\r
-     * will be the args provided or the current node. If the function returns false at any point,\r
-     * the iteration stops.\r
-     * @param {Function} fn The function to call\r
-     * @param {Object} scope (optional) The scope of the function (defaults to current node)\r
-     * @param {Array} args (optional) The args to call the function with (default to passing the current node)\r
-     */\r
-    eachChild : function(fn, scope, args){\r
-        var cs = this.childNodes;\r
-        for(var i = 0, len = cs.length; i < len; i++) {\r
-               if(fn.apply(scope || this, args || [cs[i]]) === false){\r
-                   break;\r
-               }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Finds the first child that has the attribute with the specified value.\r
-     * @param {String} attribute The attribute name\r
-     * @param {Mixed} value The value to search for\r
-     * @return {Node} The found child or null if none was found\r
-     */\r
-    findChild : function(attribute, value){\r
-        var cs = this.childNodes;\r
-        for(var i = 0, len = cs.length; i < len; i++) {\r
-               if(cs[i].attributes[attribute] == value){\r
-                   return cs[i];\r
-               }\r
-        }\r
-        return null;\r
-    },\r
-\r
-    /**\r
-     * Finds the first child by a custom function. The child matches if the function passed\r
-     * returns true.\r
-     * @param {Function} fn\r
-     * @param {Object} scope (optional)\r
-     * @return {Node} The found child or null if none was found\r
-     */\r
-    findChildBy : function(fn, scope){\r
-        var cs = this.childNodes;\r
-        for(var i = 0, len = cs.length; i < len; i++) {\r
-               if(fn.call(scope||cs[i], cs[i]) === true){\r
-                   return cs[i];\r
-               }\r
-        }\r
-        return null;\r
-    },\r
-\r
-    /**\r
-     * Sorts this nodes children using the supplied sort function\r
-     * @param {Function} fn\r
-     * @param {Object} scope (optional)\r
-     */\r
-    sort : function(fn, scope){\r
-        var cs = this.childNodes;\r
-        var len = cs.length;\r
-        if(len > 0){\r
-            var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn;\r
-            cs.sort(sortFn);\r
-            for(var i = 0; i < len; i++){\r
-                var n = cs[i];\r
-                n.previousSibling = cs[i-1];\r
-                n.nextSibling = cs[i+1];\r
-                if(i === 0){\r
-                    this.setFirstChild(n);\r
-                }\r
-                if(i == len-1){\r
-                    this.setLastChild(n);\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns true if this node is an ancestor (at any point) of the passed node.\r
-     * @param {Node} node\r
-     * @return {Boolean}\r
-     */\r
-    contains : function(node){\r
-        return node.isAncestor(this);\r
-    },\r
-\r
-    /**\r
-     * Returns true if the passed node is an ancestor (at any point) of this node.\r
-     * @param {Node} node\r
-     * @return {Boolean}\r
-     */\r
-    isAncestor : function(node){\r
-        var p = this.parentNode;\r
-        while(p){\r
-            if(p == node){\r
-                return true;\r
-            }\r
-            p = p.parentNode;\r
-        }\r
-        return false;\r
-    },\r
-\r
-    toString : function(){\r
-        return "[Node"+(this.id?" "+this.id:"")+"]";\r
-    }\r
-});/**\r
- * @class Ext.tree.TreeNode\r
- * @extends Ext.data.Node\r
- * @cfg {String} text The text for this node\r
- * @cfg {Boolean} expanded true to start the node expanded\r
- * @cfg {Boolean} allowDrag False to make this node undraggable if {@link #draggable} = true (defaults to true)\r
- * @cfg {Boolean} allowDrop False if this node cannot have child nodes dropped on it (defaults to true)\r
- * @cfg {Boolean} disabled true to start the node disabled\r
- * @cfg {String} icon The path to an icon for the node. The preferred way to do this\r
- * is to use the cls or iconCls attributes and add the icon via a CSS background image.\r
- * @cfg {String} cls A css class to be added to the node\r
- * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images\r
- * @cfg {String} href URL of the link used for the node (defaults to #)\r
- * @cfg {String} hrefTarget target frame for the link\r
- * @cfg {Boolean} hidden True to render hidden. (Defaults to false).\r
- * @cfg {String} qtip An Ext QuickTip for the node\r
- * @cfg {Boolean} expandable If set to true, the node will always show a plus/minus icon, even when empty\r
- * @cfg {String} qtipCfg An Ext QuickTip config for the node (used instead of qtip)\r
- * @cfg {Boolean} singleClickExpand True for single click expand on this node\r
- * @cfg {Function} uiProvider A UI <b>class</b> to use for this node (defaults to Ext.tree.TreeNodeUI)\r
- * @cfg {Boolean} checked True to render a checked checkbox for this node, false to render an unchecked checkbox\r
- * (defaults to undefined with no checkbox rendered)\r
- * @cfg {Boolean} draggable True to make this node draggable (defaults to false)\r
- * @cfg {Boolean} isTarget False to not allow this node to act as a drop target (defaults to true)\r
- * @cfg {Boolean} allowChildren False to not allow this node to have child nodes (defaults to true)\r
- * @cfg {Boolean} editable False to not allow this node to be edited by an (@link Ext.tree.TreeEditor} (defaults to true)\r
- * @constructor\r
- * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node\r
- */\r
-Ext.tree.TreeNode = function(attributes){\r
-    attributes = attributes || {};\r
-    if(typeof attributes == "string"){\r
-        attributes = {text: attributes};\r
-    }\r
-    this.childrenRendered = false;\r
-    this.rendered = false;\r
-    Ext.tree.TreeNode.superclass.constructor.call(this, attributes);\r
-    this.expanded = attributes.expanded === true;\r
-    this.isTarget = attributes.isTarget !== false;\r
-    this.draggable = attributes.draggable !== false && attributes.allowDrag !== false;\r
-    this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false;\r
-\r
-    /**\r
-     * Read-only. The text for this node. To change it use setText().\r
-     * @type String\r
-     */\r
-    this.text = attributes.text;\r
-    /**\r
-     * True if this node is disabled.\r
-     * @type Boolean\r
-     */\r
-    this.disabled = attributes.disabled === true;\r
-    /**\r
-     * True if this node is hidden.\r
-     * @type Boolean\r
-     */\r
-    this.hidden = attributes.hidden === true;\r
-\r
-    this.addEvents(\r
-        /**\r
-        * @event textchange\r
-        * Fires when the text for this node is changed\r
-        * @param {Node} this This node\r
-        * @param {String} text The new text\r
-        * @param {String} oldText The old text\r
-        */\r
-        "textchange",\r
-        /**\r
-        * @event beforeexpand\r
-        * Fires before this node is expanded, return false to cancel.\r
-        * @param {Node} this This node\r
-        * @param {Boolean} deep\r
-        * @param {Boolean} anim\r
-        */\r
-        "beforeexpand",\r
-        /**\r
-        * @event beforecollapse\r
-        * Fires before this node is collapsed, return false to cancel.\r
-        * @param {Node} this This node\r
-        * @param {Boolean} deep\r
-        * @param {Boolean} anim\r
-        */\r
-        "beforecollapse",\r
-        /**\r
-        * @event expand\r
-        * Fires when this node is expanded\r
-        * @param {Node} this This node\r
-        */\r
-        "expand",\r
-        /**\r
-        * @event disabledchange\r
-        * Fires when the disabled status of this node changes\r
-        * @param {Node} this This node\r
-        * @param {Boolean} disabled\r
-        */\r
-        "disabledchange",\r
-        /**\r
-        * @event collapse\r
-        * Fires when this node is collapsed\r
-        * @param {Node} this This node\r
-        */\r
-        "collapse",\r
-        /**\r
-        * @event beforeclick\r
-        * Fires before click processing. Return false to cancel the default action.\r
-        * @param {Node} this This node\r
-        * @param {Ext.EventObject} e The event object\r
-        */\r
-        "beforeclick",\r
-        /**\r
-        * @event click\r
-        * Fires when this node is clicked\r
-        * @param {Node} this This node\r
-        * @param {Ext.EventObject} e The event object\r
-        */\r
-        "click",\r
-        /**\r
-        * @event checkchange\r
-        * Fires when a node with a checkbox's checked property changes\r
-        * @param {Node} this This node\r
-        * @param {Boolean} checked\r
-        */\r
-        "checkchange",\r
-        /**\r
-        * @event dblclick\r
-        * Fires when this node is double clicked\r
-        * @param {Node} this This node\r
-        * @param {Ext.EventObject} e The event object\r
-        */\r
-        "dblclick",\r
-        /**\r
-        * @event contextmenu\r
-        * Fires when this node is right clicked\r
-        * @param {Node} this This node\r
-        * @param {Ext.EventObject} e The event object\r
-        */\r
-        "contextmenu",\r
-        /**\r
-        * @event beforechildrenrendered\r
-        * Fires right before the child nodes for this node are rendered\r
-        * @param {Node} this This node\r
-        */\r
-        "beforechildrenrendered"\r
-    );\r
-\r
-    var uiClass = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI;\r
-\r
-    /**\r
-     * Read-only. The UI for this node\r
-     * @type TreeNodeUI\r
-     */\r
-    this.ui = new uiClass(this);\r
-};\r
-Ext.extend(Ext.tree.TreeNode, Ext.data.Node, {\r
-    preventHScroll: true,\r
-    /**\r
-     * Returns true if this node is expanded\r
-     * @return {Boolean}\r
-     */\r
-    isExpanded : function(){\r
-        return this.expanded;\r
-    },\r
-\r
-/**\r
- * Returns the UI object for this node.\r
- * @return {TreeNodeUI} The object which is providing the user interface for this tree\r
- * node. Unless otherwise specified in the {@link #uiProvider}, this will be an instance\r
- * of {@link Ext.tree.TreeNodeUI}\r
- */\r
-    getUI : function(){\r
-        return this.ui;\r
-    },\r
-\r
-    getLoader : function(){\r
-        var owner;\r
-        return this.loader || ((owner = this.getOwnerTree()) && owner.loader ? owner.loader : new Ext.tree.TreeLoader());\r
-    },\r
-\r
-    // private override\r
-    setFirstChild : function(node){\r
-        var of = this.firstChild;\r
-        Ext.tree.TreeNode.superclass.setFirstChild.call(this, node);\r
-        if(this.childrenRendered && of && node != of){\r
-            of.renderIndent(true, true);\r
-        }\r
-        if(this.rendered){\r
-            this.renderIndent(true, true);\r
-        }\r
-    },\r
-\r
-    // private override\r
-    setLastChild : function(node){\r
-        var ol = this.lastChild;\r
-        Ext.tree.TreeNode.superclass.setLastChild.call(this, node);\r
-        if(this.childrenRendered && ol && node != ol){\r
-            ol.renderIndent(true, true);\r
-        }\r
-        if(this.rendered){\r
-            this.renderIndent(true, true);\r
-        }\r
-    },\r
-\r
-    // these methods are overridden to provide lazy rendering support\r
-    // private override\r
-    appendChild : function(n){\r
-        if(!n.render && !Ext.isArray(n)){\r
-            n = this.getLoader().createNode(n);\r
-        }\r
-        var node = Ext.tree.TreeNode.superclass.appendChild.call(this, n);\r
-        if(node && this.childrenRendered){\r
-            node.render();\r
-        }\r
-        this.ui.updateExpandIcon();\r
-        return node;\r
-    },\r
-\r
-    // private override\r
-    removeChild : function(node){\r
-        this.ownerTree.getSelectionModel().unselect(node);\r
-        Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments);\r
-        // if it's been rendered remove dom node\r
-        if(this.childrenRendered){\r
-            node.ui.remove();\r
-        }\r
-        if(this.childNodes.length < 1){\r
-            this.collapse(false, false);\r
-        }else{\r
-            this.ui.updateExpandIcon();\r
-        }\r
-        if(!this.firstChild && !this.isHiddenRoot()) {\r
-            this.childrenRendered = false;\r
-        }\r
-        return node;\r
-    },\r
-\r
-    // private override\r
-    insertBefore : function(node, refNode){\r
-        if(!node.render){ \r
-            node = this.getLoader().createNode(node);\r
-        }\r
-        var newNode = Ext.tree.TreeNode.superclass.insertBefore.call(this, node, refNode);\r
-        if(newNode && refNode && this.childrenRendered){\r
-            node.render();\r
-        }\r
-        this.ui.updateExpandIcon();\r
-        return newNode;\r
-    },\r
-\r
-    /**\r
-     * Sets the text for this node\r
-     * @param {String} text\r
-     */\r
-    setText : function(text){\r
-        var oldText = this.text;\r
-        this.text = text;\r
-        this.attributes.text = text;\r
-        if(this.rendered){ // event without subscribing\r
-            this.ui.onTextChange(this, text, oldText);\r
-        }\r
-        this.fireEvent("textchange", this, text, oldText);\r
-    },\r
-\r
-    /**\r
-     * Triggers selection of this node\r
-     */\r
-    select : function(){\r
-        this.getOwnerTree().getSelectionModel().select(this);\r
-    },\r
-\r
-    /**\r
-     * Triggers deselection of this node\r
-     */\r
-    unselect : function(){\r
-        this.getOwnerTree().getSelectionModel().unselect(this);\r
-    },\r
-\r
-    /**\r
-     * Returns true if this node is selected\r
-     * @return {Boolean}\r
-     */\r
-    isSelected : function(){\r
-        return this.getOwnerTree().getSelectionModel().isSelected(this);\r
-    },\r
-\r
-    /**\r
-     * Expand this node.\r
-     * @param {Boolean} deep (optional) True to expand all children as well\r
-     * @param {Boolean} anim (optional) false to cancel the default animation\r
-     * @param {Function} callback (optional) A callback to be called when\r
-     * expanding this node completes (does not wait for deep expand to complete).\r
-     * Called with 1 parameter, this node.\r
-     * @param {Object} scope (optional) The scope in which to execute the callback.\r
-     */\r
-    expand : function(deep, anim, callback, scope){\r
-        if(!this.expanded){\r
-            if(this.fireEvent("beforeexpand", this, deep, anim) === false){\r
-                return;\r
-            }\r
-            if(!this.childrenRendered){\r
-                this.renderChildren();\r
+            this.ownerTree = tree;\r
+            // If we're destroying, we don't need to recurse since it will be called on each child node\r
+            if(destroy !== true){\r
+                Ext.each(this.childNodes, function(n){\r
+                    n.setOwnerTree(tree);\r
+                });\r
             }\r
-            this.expanded = true;\r
-            if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){\r
-                this.ui.animExpand(function(){\r
-                    this.fireEvent("expand", this);\r
-                    this.runCallback(callback, scope || this, [this]);\r
-                    if(deep === true){\r
-                        this.expandChildNodes(true);\r
-                    }\r
-                }.createDelegate(this));\r
-                return;\r
-            }else{\r
-                this.ui.expand();\r
-                this.fireEvent("expand", this);\r
-                this.runCallback(callback, scope || this, [this]);\r
+            if(tree){\r
+                tree.registerNode(this);\r
             }\r
-        }else{\r
-           this.runCallback(callback, scope || this, [this]);\r
-        }\r
-        if(deep === true){\r
-            this.expandChildNodes(true);\r
         }\r
     },\r
     \r
-    runCallback: function(cb, scope, args){\r
-        if(Ext.isFunction(cb)){\r
-            cb.apply(scope, args);\r
-        }\r
-    },\r
-\r
-    isHiddenRoot : function(){\r
-        return this.isRoot && !this.getOwnerTree().rootVisible;\r
-    },\r
-\r
     /**\r
-     * Collapse this node.\r
-     * @param {Boolean} deep (optional) True to collapse all children as well\r
-     * @param {Boolean} anim (optional) false to cancel the default animation\r
-     * @param {Function} callback (optional) A callback to be called when\r
-     * expanding this node completes (does not wait for deep expand to complete).\r
-     * Called with 1 parameter, this node.\r
-     * @param {Object} scope (optional) The scope in which to execute the callback.\r
+     * Changes the id of this node.\r
+     * @param {String} id The new id for the node.\r
      */\r
-    collapse : function(deep, anim, callback, scope){\r
-        if(this.expanded && !this.isHiddenRoot()){\r
-            if(this.fireEvent("beforecollapse", this, deep, anim) === false){\r
-                return;\r
-            }\r
-            this.expanded = false;\r
-            if((this.getOwnerTree().animate && anim !== false) || anim){\r
-                this.ui.animCollapse(function(){\r
-                    this.fireEvent("collapse", this);\r
-                    this.runCallback(callback, scope || this, [this]);\r
-                    if(deep === true){\r
-                        this.collapseChildNodes(true);\r
-                    }\r
-                }.createDelegate(this));\r
-                return;\r
-            }else{\r
-                this.ui.collapse();\r
-                this.fireEvent("collapse", this);\r
-                this.runCallback(callback, scope || this, [this]);\r
+    setId: function(id){\r
+        if(id !== this.id){\r
+            var t = this.ownerTree;\r
+            if(t){\r
+                t.unregisterNode(this);\r
             }\r
-        }else if(!this.expanded){\r
-            this.runCallback(callback, scope || this, [this]);\r
-        }\r
-        if(deep === true){\r
-            var cs = this.childNodes;\r
-            for(var i = 0, len = cs.length; i < len; i++) {\r
-               cs[i].collapse(true, false);\r
+            this.id = this.attributes.id = id;\r
+            if(t){\r
+                t.registerNode(this);\r
             }\r
+            this.onIdChange(id);\r
         }\r
     },\r
-\r
+    \r
     // private\r
-    delayedExpand : function(delay){\r
-        if(!this.expandProcId){\r
-            this.expandProcId = this.expand.defer(delay, this);\r
-        }\r
-    },\r
+    onIdChange: Ext.emptyFn,\r
 \r
-    // private\r
-    cancelExpand : function(){\r
-        if(this.expandProcId){\r
-            clearTimeout(this.expandProcId);\r
+    /**\r
+     * Returns the path for this node. The path can be used to expand or select this node programmatically.\r
+     * @param {String} attr (optional) The attr to use for the path (defaults to the node's id)\r
+     * @return {String} The path\r
+     */\r
+    getPath : function(attr){\r
+        attr = attr || "id";\r
+        var p = this.parentNode;\r
+        var b = [this.attributes[attr]];\r
+        while(p){\r
+            b.unshift(p.attributes[attr]);\r
+            p = p.parentNode;\r
         }\r
-        this.expandProcId = false;\r
+        var sep = this.getOwnerTree().pathSeparator;\r
+        return sep + b.join(sep);\r
     },\r
 \r
     /**\r
-     * Toggles expanded/collapsed state of the node\r
+     * Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function\r
+     * will be the args provided or the current node. If the function returns false at any point,\r
+     * the bubble is stopped.\r
+     * @param {Function} fn The function to call\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.\r
+     * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
      */\r
-    toggle : function(){\r
-        if(this.expanded){\r
-            this.collapse();\r
-        }else{\r
-            this.expand();\r
+    bubble : function(fn, scope, args){\r
+        var p = this;\r
+        while(p){\r
+            if(fn.apply(scope || p, args || [p]) === false){\r
+                break;\r
+            }\r
+            p = p.parentNode;\r
         }\r
     },\r
 \r
     /**\r
-     * Ensures all parent nodes are expanded, and if necessary, scrolls\r
-     * the node into view.\r
-     * @param {Function} callback (optional) A function to call when the node has been made visible.\r
-     * @param {Object} scope (optional) The scope in which to execute the callback.\r
+     * Cascades down the tree from this node, calling the specified function with each node. The arguments to the function\r
+     * will be the args provided or the current node. If the function returns false at any point,\r
+     * the cascade is stopped on that branch.\r
+     * @param {Function} fn The function to call\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.\r
+     * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
      */\r
-    ensureVisible : function(callback, scope){\r
-        var tree = this.getOwnerTree();\r
-        tree.expandPath(this.parentNode ? this.parentNode.getPath() : this.getPath(), false, function(){\r
-            var node = tree.getNodeById(this.id);  // Somehow if we don't do this, we lose changes that happened to node in the meantime\r
-            tree.getTreeEl().scrollChildIntoView(node.ui.anchor);\r
-            this.runCallback(callback, scope || this, [this]);\r
-        }.createDelegate(this));\r
+    cascade : function(fn, scope, args){\r
+        if(fn.apply(scope || this, args || [this]) !== false){\r
+            var cs = this.childNodes;\r
+            for(var i = 0, len = cs.length; i < len; i++) {\r
+               cs[i].cascade(fn, scope, args);\r
+            }\r
+        }\r
     },\r
 \r
     /**\r
-     * Expand all child nodes\r
-     * @param {Boolean} deep (optional) true if the child nodes should also expand their child nodes\r
+     * Interates the child nodes of this node, calling the specified function with each node. The arguments to the function\r
+     * will be the args provided or the current node. If the function returns false at any point,\r
+     * the iteration stops.\r
+     * @param {Function} fn The function to call\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node in the iteration.\r
+     * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
      */\r
-    expandChildNodes : function(deep){\r
+    eachChild : function(fn, scope, args){\r
         var cs = this.childNodes;\r
         for(var i = 0, len = cs.length; i < len; i++) {\r
-               cs[i].expand(deep);\r
+               if(fn.apply(scope || this, args || [cs[i]]) === false){\r
+                   break;\r
+               }\r
         }\r
     },\r
 \r
     /**\r
-     * Collapse all child nodes\r
-     * @param {Boolean} deep (optional) true if the child nodes should also collapse their child nodes\r
+     * Finds the first child that has the attribute with the specified value.\r
+     * @param {String} attribute The attribute name\r
+     * @param {Mixed} value The value to search for\r
+     * @return {Node} The found child or null if none was found\r
      */\r
-    collapseChildNodes : function(deep){\r
+    findChild : function(attribute, value){\r
         var cs = this.childNodes;\r
         for(var i = 0, len = cs.length; i < len; i++) {\r
-               cs[i].collapse(deep);\r
+               if(cs[i].attributes[attribute] == value){\r
+                   return cs[i];\r
+               }\r
         }\r
+        return null;\r
     },\r
 \r
     /**\r
-     * Disables this node\r
+     * Finds the first child by a custom function. The child matches if the function passed returns <code>true</code>.\r
+     * @param {Function} fn A function which must return <code>true</code> if the passed Node is the required Node.\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Node being tested.\r
+     * @return {Node} The found child or null if none was found\r
      */\r
-    disable : function(){\r
-        this.disabled = true;\r
-        this.unselect();\r
-        if(this.rendered && this.ui.onDisableChange){ // event without subscribing\r
-            this.ui.onDisableChange(this, true);\r
+    findChildBy : function(fn, scope){\r
+        var cs = this.childNodes;\r
+        for(var i = 0, len = cs.length; i < len; i++) {\r
+               if(fn.call(scope||cs[i], cs[i]) === true){\r
+                   return cs[i];\r
+               }\r
         }\r
-        this.fireEvent("disabledchange", this, true);\r
+        return null;\r
     },\r
 \r
     /**\r
-     * Enables this node\r
+     * Sorts this nodes children using the supplied sort function.\r
+     * @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order.\r
+     * @param {Object} scope (optional)The scope (<code>this</code> reference) in which the function is executed. Defaults to the browser window.\r
      */\r
-    enable : function(){\r
-        this.disabled = false;\r
-        if(this.rendered && this.ui.onDisableChange){ // event without subscribing\r
-            this.ui.onDisableChange(this, false);\r
-        }\r
-        this.fireEvent("disabledchange", this, false);\r
-    },\r
-\r
-    // private\r
-    renderChildren : function(suppressEvent){\r
-        if(suppressEvent !== false){\r
-            this.fireEvent("beforechildrenrendered", this);\r
-        }\r
-        var cs = this.childNodes;\r
-        for(var i = 0, len = cs.length; i < len; i++){\r
-            cs[i].render(true);\r
-        }\r
-        this.childrenRendered = true;\r
-    },\r
-\r
-    // private\r
     sort : function(fn, scope){\r
-        Ext.tree.TreeNode.superclass.sort.apply(this, arguments);\r
-        if(this.childrenRendered){\r
-            var cs = this.childNodes;\r
-            for(var i = 0, len = cs.length; i < len; i++){\r
-                cs[i].render(true);\r
+        var cs = this.childNodes;\r
+        var len = cs.length;\r
+        if(len > 0){\r
+            var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn;\r
+            cs.sort(sortFn);\r
+            for(var i = 0; i < len; i++){\r
+                var n = cs[i];\r
+                n.previousSibling = cs[i-1];\r
+                n.nextSibling = cs[i+1];\r
+                if(i === 0){\r
+                    this.setFirstChild(n);\r
+                }\r
+                if(i == len-1){\r
+                    this.setLastChild(n);\r
+                }\r
             }\r
         }\r
     },\r
 \r
-    // private\r
-    render : function(bulkRender){\r
-        this.ui.render(bulkRender);\r
-        if(!this.rendered){\r
-            // make sure it is registered\r
-            this.getOwnerTree().registerNode(this);\r
-            this.rendered = true;\r
-            if(this.expanded){\r
-                this.expanded = false;\r
-                this.expand(false, false);\r
-            }\r
-        }\r
+    /**\r
+     * Returns true if this node is an ancestor (at any point) of the passed node.\r
+     * @param {Node} node\r
+     * @return {Boolean}\r
+     */\r
+    contains : function(node){\r
+        return node.isAncestor(this);\r
     },\r
 \r
-    // private\r
-    renderIndent : function(deep, refresh){\r
-        if(refresh){\r
-            this.ui.childIndent = null;\r
-        }\r
-        this.ui.renderIndent();\r
-        if(deep === true && this.childrenRendered){\r
-            var cs = this.childNodes;\r
-            for(var i = 0, len = cs.length; i < len; i++){\r
-                cs[i].renderIndent(true, refresh);\r
+    /**\r
+     * Returns true if the passed node is an ancestor (at any point) of this node.\r
+     * @param {Node} node\r
+     * @return {Boolean}\r
+     */\r
+    isAncestor : function(node){\r
+        var p = this.parentNode;\r
+        while(p){\r
+            if(p == node){\r
+                return true;\r
             }\r
+            p = p.parentNode;\r
         }\r
+        return false;\r
     },\r
 \r
-    beginUpdate : function(){\r
-        this.childrenRendered = false;\r
-    },\r
-\r
-    endUpdate : function(){\r
-        if(this.expanded && this.rendered){\r
-            this.renderChildren();\r
-        }\r
-    },\r
-\r
-    destroy : function(){\r
-        if(this.childNodes){\r
-            for(var i = 0,l = this.childNodes.length; i < l; i++){\r
-                this.childNodes[i].destroy();\r
-            }\r
-            this.childNodes = null;\r
-        }\r
-        if(this.ui.destroy){\r
-            this.ui.destroy();\r
-        }\r
-    },\r
-    \r
-    // private\r
-    onIdChange: function(id){\r
-        this.ui.onIdChange(id);\r
+    toString : function(){\r
+        return "[Node"+(this.id?" "+this.id:"")+"]";\r
     }\r
-});\r
-\r
+});/**
+ * @class Ext.tree.TreeNode
+ * @extends Ext.data.Node
+ * @cfg {String} text The text for this node
+ * @cfg {Boolean} expanded true to start the node expanded
+ * @cfg {Boolean} allowDrag False to make this node undraggable if {@link #draggable} = true (defaults to true)
+ * @cfg {Boolean} allowDrop False if this node cannot have child nodes dropped on it (defaults to true)
+ * @cfg {Boolean} disabled true to start the node disabled
+ * @cfg {String} icon The path to an icon for the node. The preferred way to do this
+ * is to use the cls or iconCls attributes and add the icon via a CSS background image.
+ * @cfg {String} cls A css class to be added to the node
+ * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images
+ * @cfg {String} href URL of the link used for the node (defaults to #)
+ * @cfg {String} hrefTarget target frame for the link
+ * @cfg {Boolean} hidden True to render hidden. (Defaults to false).
+ * @cfg {String} qtip An Ext QuickTip for the node
+ * @cfg {Boolean} expandable If set to true, the node will always show a plus/minus icon, even when empty
+ * @cfg {String} qtipCfg An Ext QuickTip config for the node (used instead of qtip)
+ * @cfg {Boolean} singleClickExpand True for single click expand on this node
+ * @cfg {Function} uiProvider A UI <b>class</b> to use for this node (defaults to Ext.tree.TreeNodeUI)
+ * @cfg {Boolean} checked True to render a checked checkbox for this node, false to render an unchecked checkbox
+ * (defaults to undefined with no checkbox rendered)
+ * @cfg {Boolean} draggable True to make this node draggable (defaults to false)
+ * @cfg {Boolean} isTarget False to not allow this node to act as a drop target (defaults to true)
+ * @cfg {Boolean} allowChildren False to not allow this node to have child nodes (defaults to true)
+ * @cfg {Boolean} editable False to not allow this node to be edited by an {@link Ext.tree.TreeEditor} (defaults to true)
+ * @constructor
+ * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node
+ */
+Ext.tree.TreeNode = function(attributes){
+    attributes = attributes || {};
+    if(Ext.isString(attributes)){
+        attributes = {text: attributes};
+    }
+    this.childrenRendered = false;
+    this.rendered = false;
+    Ext.tree.TreeNode.superclass.constructor.call(this, attributes);
+    this.expanded = attributes.expanded === true;
+    this.isTarget = attributes.isTarget !== false;
+    this.draggable = attributes.draggable !== false && attributes.allowDrag !== false;
+    this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false;
+
+    /**
+     * Read-only. The text for this node. To change it use <code>{@link #setText}</code>.
+     * @type String
+     */
+    this.text = attributes.text;
+    /**
+     * True if this node is disabled.
+     * @type Boolean
+     */
+    this.disabled = attributes.disabled === true;
+    /**
+     * True if this node is hidden.
+     * @type Boolean
+     */
+    this.hidden = attributes.hidden === true;
+
+    this.addEvents(
+        /**
+        * @event textchange
+        * Fires when the text for this node is changed
+        * @param {Node} this This node
+        * @param {String} text The new text
+        * @param {String} oldText The old text
+        */
+        'textchange',
+        /**
+        * @event beforeexpand
+        * Fires before this node is expanded, return false to cancel.
+        * @param {Node} this This node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        'beforeexpand',
+        /**
+        * @event beforecollapse
+        * Fires before this node is collapsed, return false to cancel.
+        * @param {Node} this This node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        'beforecollapse',
+        /**
+        * @event expand
+        * Fires when this node is expanded
+        * @param {Node} this This node
+        */
+        'expand',
+        /**
+        * @event disabledchange
+        * Fires when the disabled status of this node changes
+        * @param {Node} this This node
+        * @param {Boolean} disabled
+        */
+        'disabledchange',
+        /**
+        * @event collapse
+        * Fires when this node is collapsed
+        * @param {Node} this This node
+        */
+        'collapse',
+        /**
+        * @event beforeclick
+        * Fires before click processing. Return false to cancel the default action.
+        * @param {Node} this This node
+        * @param {Ext.EventObject} e The event object
+        */
+        'beforeclick',
+        /**
+        * @event click
+        * Fires when this node is clicked
+        * @param {Node} this This node
+        * @param {Ext.EventObject} e The event object
+        */
+        'click',
+        /**
+        * @event checkchange
+        * Fires when a node with a checkbox's checked property changes
+        * @param {Node} this This node
+        * @param {Boolean} checked
+        */
+        'checkchange',
+        /**
+        * @event beforedblclick
+        * Fires before double click processing. Return false to cancel the default action.
+        * @param {Node} this This node
+        * @param {Ext.EventObject} e The event object
+        */
+        'beforedblclick',
+        /**
+        * @event dblclick
+        * Fires when this node is double clicked
+        * @param {Node} this This node
+        * @param {Ext.EventObject} e The event object
+        */
+        'dblclick',
+        /**
+        * @event contextmenu
+        * Fires when this node is right clicked
+        * @param {Node} this This node
+        * @param {Ext.EventObject} e The event object
+        */
+        'contextmenu',
+        /**
+        * @event beforechildrenrendered
+        * Fires right before the child nodes for this node are rendered
+        * @param {Node} this This node
+        */
+        'beforechildrenrendered'
+    );
+
+    var uiClass = this.attributes.uiProvider || this.defaultUI || Ext.tree.TreeNodeUI;
+
+    /**
+     * Read-only. The UI for this node
+     * @type TreeNodeUI
+     */
+    this.ui = new uiClass(this);
+};
+Ext.extend(Ext.tree.TreeNode, Ext.data.Node, {
+    preventHScroll : true,
+    /**
+     * Returns true if this node is expanded
+     * @return {Boolean}
+     */
+    isExpanded : function(){
+        return this.expanded;
+    },
+
+/**
+ * Returns the UI object for this node.
+ * @return {TreeNodeUI} The object which is providing the user interface for this tree
+ * node. Unless otherwise specified in the {@link #uiProvider}, this will be an instance
+ * of {@link Ext.tree.TreeNodeUI}
+ */
+    getUI : function(){
+        return this.ui;
+    },
+
+    getLoader : function(){
+        var owner;
+        return this.loader || ((owner = this.getOwnerTree()) && owner.loader ? owner.loader : (this.loader = new Ext.tree.TreeLoader()));
+    },
+
+    // private override
+    setFirstChild : function(node){
+        var of = this.firstChild;
+        Ext.tree.TreeNode.superclass.setFirstChild.call(this, node);
+        if(this.childrenRendered && of && node != of){
+            of.renderIndent(true, true);
+        }
+        if(this.rendered){
+            this.renderIndent(true, true);
+        }
+    },
+
+    // private override
+    setLastChild : function(node){
+        var ol = this.lastChild;
+        Ext.tree.TreeNode.superclass.setLastChild.call(this, node);
+        if(this.childrenRendered && ol && node != ol){
+            ol.renderIndent(true, true);
+        }
+        if(this.rendered){
+            this.renderIndent(true, true);
+        }
+    },
+
+    // these methods are overridden to provide lazy rendering support
+    // private override
+    appendChild : function(n){
+        var node, exists;
+        if(!n.render && !Ext.isArray(n)){
+            n = this.getLoader().createNode(n);
+        }else{
+            exists = !n.parentNode;
+        }
+        node = Ext.tree.TreeNode.superclass.appendChild.call(this, n);
+        if(node){
+            this.afterAdd(node, exists);
+        }
+        this.ui.updateExpandIcon();
+        return node;
+    },
+
+    // private override
+    removeChild : function(node, destroy){
+        this.ownerTree.getSelectionModel().unselect(node);
+        Ext.tree.TreeNode.superclass.removeChild.apply(this, arguments);
+        // if it's been rendered remove dom node
+        if(node.ui.rendered){
+            node.ui.remove();
+        }
+        if(this.childNodes.length < 1){
+            this.collapse(false, false);
+        }else{
+            this.ui.updateExpandIcon();
+        }
+        if(!this.firstChild && !this.isHiddenRoot()) {
+            this.childrenRendered = false;
+        }
+        return node;
+    },
+
+    // private override
+    insertBefore : function(node, refNode){
+        var newNode, exists;
+        if(!node.render){
+            node = this.getLoader().createNode(node);
+        } else {
+            exists = Ext.isObject(node.parentNode);
+        }
+        newNode = Ext.tree.TreeNode.superclass.insertBefore.call(this, node, refNode);
+        if(newNode && refNode){
+            this.afterAdd(newNode, exists);
+        }
+        this.ui.updateExpandIcon();
+        return newNode;
+    },
+    
+    // private
+    afterAdd : function(node, exists){
+        if(this.childrenRendered){
+            // bulk render if the node already exists
+            node.render(exists);
+        }else if(exists){
+            // make sure we update the indent
+            node.renderIndent(true, true);
+        }
+    },
+
+    /**
+     * Sets the text for this node
+     * @param {String} text
+     */
+    setText : function(text){
+        var oldText = this.text;
+        this.text = this.attributes.text = text;
+        if(this.rendered){ // event without subscribing
+            this.ui.onTextChange(this, text, oldText);
+        }
+        this.fireEvent('textchange', this, text, oldText);
+    },
+
+    /**
+     * Triggers selection of this node
+     */
+    select : function(){
+        var t = this.getOwnerTree();
+        if(t){
+            t.getSelectionModel().select(this);
+        }
+    },
+
+    /**
+     * Triggers deselection of this node
+     * @param {Boolean} silent (optional) True to stop selection change events from firing.
+     */
+    unselect : function(silent){
+        var t = this.getOwnerTree();
+        if(t){
+            t.getSelectionModel().unselect(this, silent);
+        }
+    },
+
+    /**
+     * Returns true if this node is selected
+     * @return {Boolean}
+     */
+    isSelected : function(){
+        var t = this.getOwnerTree();
+        return t ? t.getSelectionModel().isSelected(this) : false;
+    },
+
+    /**
+     * Expand this node.
+     * @param {Boolean} deep (optional) True to expand all children as well
+     * @param {Boolean} anim (optional) false to cancel the default animation
+     * @param {Function} callback (optional) A callback to be called when
+     * expanding this node completes (does not wait for deep expand to complete).
+     * Called with 1 parameter, this node.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this TreeNode.
+     */
+    expand : function(deep, anim, callback, scope){
+        if(!this.expanded){
+            if(this.fireEvent('beforeexpand', this, deep, anim) === false){
+                return;
+            }
+            if(!this.childrenRendered){
+                this.renderChildren();
+            }
+            this.expanded = true;
+            if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){
+                this.ui.animExpand(function(){
+                    this.fireEvent('expand', this);
+                    this.runCallback(callback, scope || this, [this]);
+                    if(deep === true){
+                        this.expandChildNodes(true);
+                    }
+                }.createDelegate(this));
+                return;
+            }else{
+                this.ui.expand();
+                this.fireEvent('expand', this);
+                this.runCallback(callback, scope || this, [this]);
+            }
+        }else{
+           this.runCallback(callback, scope || this, [this]);
+        }
+        if(deep === true){
+            this.expandChildNodes(true);
+        }
+    },
+
+    runCallback : function(cb, scope, args){
+        if(Ext.isFunction(cb)){
+            cb.apply(scope, args);
+        }
+    },
+
+    isHiddenRoot : function(){
+        return this.isRoot && !this.getOwnerTree().rootVisible;
+    },
+
+    /**
+     * Collapse this node.
+     * @param {Boolean} deep (optional) True to collapse all children as well
+     * @param {Boolean} anim (optional) false to cancel the default animation
+     * @param {Function} callback (optional) A callback to be called when
+     * expanding this node completes (does not wait for deep expand to complete).
+     * Called with 1 parameter, this node.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this TreeNode.
+     */
+    collapse : function(deep, anim, callback, scope){
+        if(this.expanded && !this.isHiddenRoot()){
+            if(this.fireEvent('beforecollapse', this, deep, anim) === false){
+                return;
+            }
+            this.expanded = false;
+            if((this.getOwnerTree().animate && anim !== false) || anim){
+                this.ui.animCollapse(function(){
+                    this.fireEvent('collapse', this);
+                    this.runCallback(callback, scope || this, [this]);
+                    if(deep === true){
+                        this.collapseChildNodes(true);
+                    }
+                }.createDelegate(this));
+                return;
+            }else{
+                this.ui.collapse();
+                this.fireEvent('collapse', this);
+                this.runCallback(callback, scope || this, [this]);
+            }
+        }else if(!this.expanded){
+            this.runCallback(callback, scope || this, [this]);
+        }
+        if(deep === true){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].collapse(true, false);
+            }
+        }
+    },
+
+    // private
+    delayedExpand : function(delay){
+        if(!this.expandProcId){
+            this.expandProcId = this.expand.defer(delay, this);
+        }
+    },
+
+    // private
+    cancelExpand : function(){
+        if(this.expandProcId){
+            clearTimeout(this.expandProcId);
+        }
+        this.expandProcId = false;
+    },
+
+    /**
+     * Toggles expanded/collapsed state of the node
+     */
+    toggle : function(){
+        if(this.expanded){
+            this.collapse();
+        }else{
+            this.expand();
+        }
+    },
+
+    /**
+     * Ensures all parent nodes are expanded, and if necessary, scrolls
+     * the node into view.
+     * @param {Function} callback (optional) A function to call when the node has been made visible.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this TreeNode.
+     */
+    ensureVisible : function(callback, scope){
+        var tree = this.getOwnerTree();
+        tree.expandPath(this.parentNode ? this.parentNode.getPath() : this.getPath(), false, function(){
+            var node = tree.getNodeById(this.id);  // Somehow if we don't do this, we lose changes that happened to node in the meantime
+            tree.getTreeEl().scrollChildIntoView(node.ui.anchor);
+            this.runCallback(callback, scope || this, [this]);
+        }.createDelegate(this));
+    },
+
+    /**
+     * Expand all child nodes
+     * @param {Boolean} deep (optional) true if the child nodes should also expand their child nodes
+     */
+    expandChildNodes : function(deep){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].expand(deep);
+        }
+    },
+
+    /**
+     * Collapse all child nodes
+     * @param {Boolean} deep (optional) true if the child nodes should also collapse their child nodes
+     */
+    collapseChildNodes : function(deep){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].collapse(deep);
+        }
+    },
+
+    /**
+     * Disables this node
+     */
+    disable : function(){
+        this.disabled = true;
+        this.unselect();
+        if(this.rendered && this.ui.onDisableChange){ // event without subscribing
+            this.ui.onDisableChange(this, true);
+        }
+        this.fireEvent('disabledchange', this, true);
+    },
+
+    /**
+     * Enables this node
+     */
+    enable : function(){
+        this.disabled = false;
+        if(this.rendered && this.ui.onDisableChange){ // event without subscribing
+            this.ui.onDisableChange(this, false);
+        }
+        this.fireEvent('disabledchange', this, false);
+    },
+
+    // private
+    renderChildren : function(suppressEvent){
+        if(suppressEvent !== false){
+            this.fireEvent('beforechildrenrendered', this);
+        }
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++){
+            cs[i].render(true);
+        }
+        this.childrenRendered = true;
+    },
+
+    // private
+    sort : function(fn, scope){
+        Ext.tree.TreeNode.superclass.sort.apply(this, arguments);
+        if(this.childrenRendered){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++){
+                cs[i].render(true);
+            }
+        }
+    },
+
+    // private
+    render : function(bulkRender){
+        this.ui.render(bulkRender);
+        if(!this.rendered){
+            // make sure it is registered
+            this.getOwnerTree().registerNode(this);
+            this.rendered = true;
+            if(this.expanded){
+                this.expanded = false;
+                this.expand(false, false);
+            }
+        }
+    },
+
+    // private
+    renderIndent : function(deep, refresh){
+        if(refresh){
+            this.ui.childIndent = null;
+        }
+        this.ui.renderIndent();
+        if(deep === true && this.childrenRendered){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++){
+                cs[i].renderIndent(true, refresh);
+            }
+        }
+    },
+
+    beginUpdate : function(){
+        this.childrenRendered = false;
+    },
+
+    endUpdate : function(){
+        if(this.expanded && this.rendered){
+            this.renderChildren();
+        }
+    },
+
+    destroy : function(){
+        this.unselect(true);
+        Ext.tree.TreeNode.superclass.destroy.call(this);
+        Ext.destroy(this.ui, this.loader);
+        this.ui = this.loader = null;
+    },
+
+    // private
+    onIdChange : function(id){
+        this.ui.onIdChange(id);
+    }
+});
+
 Ext.tree.TreePanel.nodeTypes.node = Ext.tree.TreeNode;/**\r
  * @class Ext.tree.AsyncTreeNode\r
  * @extends Ext.tree.TreeNode\r
@@ -46807,7 +50402,7 @@ Ext.extend(Ext.tree.AsyncTreeNode, Ext.tree.TreeNode, {
     /**\r
      * Trigger a reload for this node\r
      * @param {Function} callback\r
-     * @param {Object} scope (optional) The scope in which to execute the callback.\r
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to this Node.\r
      */\r
     reload : function(callback, scope){\r
         this.collapse(false, false);\r
@@ -46850,7 +50445,7 @@ Ext.tree.TreeNodeUI.prototype = {
     removeChild : function(node){\r
         if(this.rendered){\r
             this.ctNode.removeChild(node.ui.getEl());\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
@@ -46873,14 +50468,14 @@ Ext.tree.TreeNodeUI.prototype = {
     // private\r
     onDisableChange : function(node, state){\r
         this.disabled = state;\r
-               if (this.checkbox) {\r
-                       this.checkbox.disabled = state;\r
-               }        \r
+        if (this.checkbox) {\r
+            this.checkbox.disabled = state;\r
+        }\r
         if(state){\r
             this.addClass("x-tree-node-disabled");\r
         }else{\r
             this.removeClass("x-tree-node-disabled");\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
@@ -46931,7 +50526,7 @@ Ext.tree.TreeNodeUI.prototype = {
  */\r
     removeClass : function(cls){\r
         if(this.elNode){\r
-            Ext.fly(this.elNode).removeClass(cls);  \r
+            Ext.fly(this.elNode).removeClass(cls);\r
         }\r
     },\r
 \r
@@ -46940,12 +50535,12 @@ Ext.tree.TreeNodeUI.prototype = {
         if(this.rendered){\r
             this.holder = document.createElement("div");\r
             this.holder.appendChild(this.wrap);\r
-        }  \r
+        }\r
     },\r
 \r
     // private\r
     fireEvent : function(){\r
-        return this.node.fireEvent.apply(this.node, arguments);  \r
+        return this.node.fireEvent.apply(this.node, arguments);\r
     },\r
 \r
     // private\r
@@ -46953,10 +50548,7 @@ Ext.tree.TreeNodeUI.prototype = {
         this.node.on("move", this.onMove, this);\r
 \r
         if(this.node.disabled){\r
-            this.addClass("x-tree-node-disabled");\r
-                       if (this.checkbox) {\r
-                               this.checkbox.disabled = true;\r
-                       }            \r
+            this.onDisableChange(this.node, true);\r
         }\r
         if(this.node.hidden){\r
             this.hide();\r
@@ -46994,7 +50586,7 @@ Ext.tree.TreeNodeUI.prototype = {
         this.node.hidden = false;\r
         if(this.wrap){\r
             this.wrap.style.display = "";\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
@@ -47041,13 +50633,15 @@ Ext.tree.TreeNodeUI.prototype = {
         if(this.disabled){\r
             return;\r
         }\r
-        if(this.checkbox){\r
-            this.toggleCheck();\r
-        }\r
-        if(!this.animating && this.node.isExpandable()){\r
-            this.node.toggle();\r
+        if(this.fireEvent("beforedblclick", this.node, e) !== false){\r
+            if(this.checkbox){\r
+                this.toggleCheck();\r
+            }\r
+            if(!this.animating && this.node.isExpandable()){\r
+                this.node.toggle();\r
+            }\r
+            this.fireEvent("dblclick", this.node, e);\r
         }\r
-        this.fireEvent("dblclick", this.node, e);\r
     },\r
 \r
     onOver : function(e){\r
@@ -47061,8 +50655,8 @@ Ext.tree.TreeNodeUI.prototype = {
     // private\r
     onCheckChange : function(){\r
         var checked = this.checkbox.checked;\r
-               // fix for IE6\r
-               this.checkbox.defaultChecked = checked;         \r
+        // fix for IE6\r
+        this.checkbox.defaultChecked = checked;\r
         this.node.attributes.checked = checked;\r
         this.fireEvent('checkchange', this.node, checked);\r
     },\r
@@ -47078,12 +50672,12 @@ Ext.tree.TreeNodeUI.prototype = {
     startDrop : function(){\r
         this.dropping = true;\r
     },\r
-    \r
+\r
     // delayed drop so the click event doesn't get fired on a drop\r
-    endDrop : function(){ \r
+    endDrop : function(){\r
        setTimeout(function(){\r
            this.dropping = false;\r
-       }.createDelegate(this), 50); \r
+       }.createDelegate(this), 50);\r
     },\r
 \r
     // private\r
@@ -47124,7 +50718,7 @@ Ext.tree.TreeNodeUI.prototype = {
     blur : function(){\r
         try{\r
             this.anchor.blur();\r
-        }catch(e){} \r
+        }catch(e){}\r
     },\r
 \r
     // private\r
@@ -47139,7 +50733,7 @@ Ext.tree.TreeNodeUI.prototype = {
         }\r
         this.animating = true;\r
         this.updateExpandIcon();\r
-        \r
+\r
         ct.slideIn('t', {\r
            callback : function(){\r
                this.animating = false;\r
@@ -47186,12 +50780,15 @@ Ext.tree.TreeNodeUI.prototype = {
 \r
     // private\r
     getContainer : function(){\r
-        return this.ctNode;  \r
+        return this.ctNode;\r
     },\r
 \r
-    // private\r
+/**\r
+ * Returns the element which encapsulates this node.\r
+ * @return {HtmlElement} The DOM element. The default implementation uses a <code>&lt;li></code>.\r
+ */\r
     getEl : function(){\r
-        return this.wrap;  \r
+        return this.wrap;\r
     },\r
 \r
     // private\r
@@ -47206,15 +50803,15 @@ Ext.tree.TreeNodeUI.prototype = {
 \r
     // private\r
     onRender : function(){\r
-        this.render();    \r
+        this.render();\r
     },\r
 \r
     // private\r
     render : function(bulkRender){\r
         var n = this.node, a = n.attributes;\r
-        var targetNode = n.parentNode ? \r
+        var targetNode = n.parentNode ?\r
               n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;\r
-        \r
+\r
         if(!this.rendered){\r
             this.rendered = true;\r
 \r
@@ -47231,7 +50828,7 @@ Ext.tree.TreeNodeUI.prototype = {
                    if(a.qtipTitle){\r
                        this.textNode.setAttribute("ext:qtitle", a.qtipTitle);\r
                    }\r
-               } \r
+               }\r
             }else if(a.qtipCfg){\r
                 a.qtipCfg.target = Ext.id(this.textNode);\r
                 Ext.QuickTips.register(a.qtipCfg);\r
@@ -47252,10 +50849,10 @@ Ext.tree.TreeNodeUI.prototype = {
         // add some indent caching, this helps performance when rendering a large tree\r
         this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';\r
 \r
-        var cb = typeof a.checked == 'boolean';\r
-\r
-        var href = a.href ? a.href : Ext.isGecko ? "" : "#";\r
-        var buf = ['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ', a.cls,'" unselectable="on">',\r
+        var cb = Ext.isBoolean(a.checked),\r
+            nel,\r
+            href = a.href ? a.href : Ext.isGecko ? "" : "#",\r
+            buf = ['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ', a.cls,'" unselectable="on">',\r
             '<span class="x-tree-node-indent">',this.indentMarkup,"</span>",\r
             '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />',\r
             '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',\r
@@ -47265,13 +50862,12 @@ Ext.tree.TreeNodeUI.prototype = {
             '<ul class="x-tree-node-ct" style="display:none;"></ul>',\r
             "</li>"].join('');\r
 \r
-        var nel;\r
         if(bulkRender !== true && n.nextSibling && (nel = n.nextSibling.ui.getEl())){\r
             this.wrap = Ext.DomHelper.insertHtml("beforeBegin", nel, buf);\r
         }else{\r
             this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf);\r
         }\r
-        \r
+\r
         this.elNode = this.wrap.childNodes[0];\r
         this.ctNode = this.wrap.childNodes[1];\r
         var cs = this.elNode.childNodes;\r
@@ -47281,8 +50877,8 @@ Ext.tree.TreeNodeUI.prototype = {
         var index = 3;\r
         if(cb){\r
             this.checkbox = cs[3];\r
-                       // fix for IE6\r
-                       this.checkbox.defaultChecked = this.checkbox.checked;                                           \r
+            // fix for IE6\r
+            this.checkbox.defaultChecked = this.checkbox.checked;\r
             index++;\r
         }\r
         this.anchor = cs[index];\r
@@ -47296,7 +50892,7 @@ Ext.tree.TreeNodeUI.prototype = {
     getAnchor : function(){\r
         return this.anchor;\r
     },\r
-    \r
+\r
 /**\r
  * Returns the text node.\r
  * @return {HtmlNode} The DOM text node.\r
@@ -47304,7 +50900,7 @@ Ext.tree.TreeNodeUI.prototype = {
     getTextEl : function(){\r
         return this.textNode;\r
     },\r
-    \r
+\r
 /**\r
  * Returns the icon &lt;img> element.\r
  * @return {HtmlElement} The DOM image element.\r
@@ -47319,15 +50915,17 @@ Ext.tree.TreeNodeUI.prototype = {
  * @return {Boolean} The checked flag.\r
  */\r
     isChecked : function(){\r
-        return this.checkbox ? this.checkbox.checked : false; \r
+        return this.checkbox ? this.checkbox.checked : false;\r
     },\r
 \r
     // private\r
     updateExpandIcon : function(){\r
         if(this.rendered){\r
-            var n = this.node, c1, c2;\r
-            var cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow";\r
-            var hasChild = n.hasChildNodes();\r
+            var n = this.node,\r
+                c1,\r
+                c2,\r
+                cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow",\r
+                hasChild = n.hasChildNodes();\r
             if(hasChild || n.attributes.expandable){\r
                 if(n.expanded){\r
                     cls += "-minus";\r
@@ -47348,7 +50946,7 @@ Ext.tree.TreeNodeUI.prototype = {
                 }\r
             }else{\r
                 if(!this.wasLeaf){\r
-                    Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-leaf");\r
+                    Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-collapsed");\r
                     delete this.c1;\r
                     delete this.c2;\r
                     this.wasLeaf = true;\r
@@ -47361,7 +50959,7 @@ Ext.tree.TreeNodeUI.prototype = {
             }\r
         }\r
     },\r
-    \r
+\r
     // private\r
     onIdChange: function(id){\r
         if(this.rendered){\r
@@ -47372,8 +50970,8 @@ Ext.tree.TreeNodeUI.prototype = {
     // private\r
     getChildIndent : function(){\r
         if(!this.childIndent){\r
-            var buf = [];\r
-            var p = this.node;\r
+            var buf = [],\r
+                p = this.node;\r
             while(p){\r
                 if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){\r
                     if(!p.isLast()) {\r
@@ -47392,8 +50990,8 @@ Ext.tree.TreeNodeUI.prototype = {
     // private\r
     renderIndent : function(){\r
         if(this.rendered){\r
-            var indent = "";\r
-            var p = this.node.parentNode;\r
+            var indent = "",\r
+                p = this.node.parentNode;\r
             if(p){\r
                 indent = p.ui.getChildIndent();\r
             }\r
@@ -47409,23 +51007,14 @@ Ext.tree.TreeNodeUI.prototype = {
         if(this.elNode){\r
             Ext.dd.Registry.unregister(this.elNode.id);\r
         }\r
-        delete this.elNode;\r
-        delete this.ctNode;\r
-        delete this.indentNode;\r
-        delete this.ecNode;\r
-        delete this.iconNode;\r
-        delete this.checkbox;\r
-        delete this.anchor;\r
-        delete this.textNode;\r
-        \r
-        if (this.holder){\r
-             delete this.wrap;\r
-             Ext.removeNode(this.holder);\r
-             delete this.holder;\r
-        }else{\r
-            Ext.removeNode(this.wrap);\r
-            delete this.wrap;\r
-        }\r
+\r
+        Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){\r
+            if(this[el]){\r
+                Ext.fly(this[el]).remove();\r
+                delete this[el];\r
+            }\r
+        }, this);\r
+        delete this.node;\r
     }\r
 };\r
 \r
@@ -47519,7 +51108,7 @@ Ext.tree.TreeLoader = function(config){
         "loadexception"\r
     );\r
     Ext.tree.TreeLoader.superclass.constructor.call(this);\r
-    if(typeof this.paramOrder == 'string'){\r
+    if(Ext.isString(this.paramOrder)){\r
         this.paramOrder = this.paramOrder.split(/[\s,|]/);\r
     }\r
 };\r
@@ -47565,15 +51154,15 @@ Ext.extend(Ext.tree.TreeLoader, Ext.util.Observable, {
 \r
     /**\r
      * @cfg {Array/String} paramOrder Defaults to <tt>undefined</tt>. Only used when using directFn.\r
-     * A list of params to be executed\r
-     * server side.  Specify the params in the order in which they must be executed on the server-side\r
+     * Specifies the params in the order in which they must be passed to the server-side Direct method\r
      * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace,\r
      * comma, or pipe. For example,\r
      * any of the following would be acceptable:<pre><code>\r
+nodeParameter: 'node',\r
 paramOrder: ['param1','param2','param3']\r
-paramOrder: 'param1 param2 param3'\r
-paramOrder: 'param1,param2,param3'\r
-paramOrder: 'param1|param2|param'\r
+paramOrder: 'node param1 param2 param3'\r
+paramOrder: 'param1,node,param2,param3'\r
+paramOrder: 'param1|param2|param|node'\r
      </code></pre>\r
      */\r
     paramOrder: undefined,\r
@@ -47585,6 +51174,12 @@ paramOrder: 'param1|param2|param'
      */\r
     paramsAsHash: false,\r
 \r
+    /**\r
+     * @cfg {String} nodeParameter The name of the parameter sent to the server which contains\r
+     * the identifier of the node. Defaults to <tt>'node'</tt>.\r
+     */\r
+    nodeParameter: 'node',\r
+\r
     /**\r
      * @cfg {Function} directFn\r
      * Function to call when executing a request.\r
@@ -47596,8 +51191,10 @@ paramOrder: 'param1|param2|param'
      * This is called automatically when a node is expanded, but may be used to reload\r
      * a node (or append new children if the {@link #clearOnLoad} option is false.)\r
      * @param {Ext.tree.TreeNode} node\r
-     * @param {Function} callback\r
-     * @param (Object) scope\r
+     * @param {Function} callback Function to call after the node has been loaded. The\r
+     * function is passed the TreeNode which was requested to be loaded.\r
+     * @param (Object) scope The cope (<code>this</code> reference) in which the callback is executed.\r
+     * defaults to the loaded TreeNode.\r
      */\r
     load : function(node, callback, scope){\r
         if(this.clearOnLoad){\r
@@ -47606,7 +51203,7 @@ paramOrder: 'param1|param2|param'
             }\r
         }\r
         if(this.doPreload(node)){ // preloaded json children\r
-            this.runCallback(callback, scope || node, []);\r
+            this.runCallback(callback, scope || node, [node]);\r
         }else if(this.directFn || this.dataUrl || this.url){\r
             this.requestData(node, callback, scope || node);\r
         }\r
@@ -47631,27 +51228,29 @@ paramOrder: 'param1|param2|param'
     },\r
 \r
     getParams: function(node){\r
-        var buf = [], bp = this.baseParams;\r
+        var bp = Ext.apply({}, this.baseParams),\r
+            np = this.nodeParameter,\r
+            po = this.paramOrder;\r
+\r
+        np && (bp[ np ] = node.id);\r
+\r
         if(this.directFn){\r
-            buf.push(node.id);\r
-            if(bp){\r
-                if(this.paramOrder){\r
-                    for(var i = 0, len = this.paramOrder.length; i < len; i++){\r
-                        buf.push(bp[this.paramOrder[i]]);\r
-                    }\r
-                }else if(this.paramsAsHash){\r
-                    buf.push(bp);\r
+            var buf = [node.id];\r
+            if(po){\r
+                // reset 'buf' if the nodeParameter was included in paramOrder\r
+                if(np && po.indexOf(np) > -1){\r
+                    buf = [];\r
+                }\r
+\r
+                for(var i = 0, len = po.length; i < len; i++){\r
+                    buf.push(bp[ po[i] ]);\r
                 }\r
+            }else if(this.paramsAsHash){\r
+                buf = [bp];\r
             }\r
             return buf;\r
         }else{\r
-            for(var key in bp){\r
-                if(!Ext.isFunction(bp[key])){\r
-                    buf.push(encodeURIComponent(key), "=", encodeURIComponent(bp[key]), "&");\r
-                }\r
-            }\r
-            buf.push("node=", encodeURIComponent(node.id));\r
-            return buf.join("");\r
+            return bp;\r
         }\r
     },\r
 \r
@@ -47716,7 +51315,7 @@ paramOrder: 'param1|param2|param'
     * Example:<pre><code>\r
 new Ext.tree.TreePanel({\r
     ...\r
-    new Ext.tree.TreeLoader({\r
+    loader: new Ext.tree.TreeLoader({\r
         url: 'dataUrl',\r
         createNode: function(attr) {\r
 //          Allow consolidation consignments to have\r
@@ -47725,7 +51324,7 @@ new Ext.tree.TreePanel({
                 attr.iconCls = 'x-consol',\r
                 attr.allowDrop = true;\r
             }\r
-            return Ext.tree.TreeLoader.prototype.call(this, attr);\r
+            return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);\r
         }\r
     }),\r
     ...\r
@@ -47738,10 +51337,10 @@ new Ext.tree.TreePanel({
         if(this.baseAttrs){\r
             Ext.applyIf(attr, this.baseAttrs);\r
         }\r
-        if(this.applyLoader !== false){\r
+        if(this.applyLoader !== false && !attr.loader){\r
             attr.loader = this;\r
         }\r
-        if(typeof attr.uiProvider == 'string'){\r
+        if(Ext.isString(attr.uiProvider)){\r
            attr.uiProvider = this.uiProviders[attr.uiProvider] || eval(attr.uiProvider);\r
         }\r
         if(attr.nodeType){\r
@@ -47783,6 +51382,11 @@ new Ext.tree.TreePanel({
         var a = response.argument;\r
         this.fireEvent("loadexception", this, a.node, response);\r
         this.runCallback(a.callback, a.scope || a.node, [a.node]);\r
+    },\r
+\r
+    destroy : function(){\r
+        this.abort();\r
+        this.purgeListeners();\r
     }\r
 });/**
  * @class Ext.tree.TreeFilter
@@ -47838,7 +51442,7 @@ Ext.tree.TreeFilter.prototype = {
      * node in the tree (or from the startNode). If the function returns true, the node is kept
      * otherwise it is filtered. If a node is filtered, its children are also filtered.
      * @param {Function} fn The filter function
-     * @param {Object} scope (optional) The scope of the function (defaults to the current node)
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.
      */
     filterBy : function(fn, scope, startNode){
         startNode = startNode || this.tree.root;
@@ -47894,7 +51498,7 @@ Ext.tree.TreeFilter.prototype = {
 };
 /**\r
  * @class Ext.tree.TreeSorter\r
- * Provides sorting of nodes in a {@link Ext.tree.TreePanel}.  The TreeSorter automatically monitors events on the \r
+ * Provides sorting of nodes in a {@link Ext.tree.TreePanel}.  The TreeSorter automatically monitors events on the\r
  * associated TreePanel that might affect the tree's sort order (beforechildrenrendered, append, insert and textchange).\r
  * Example usage:<br />\r
  * <pre><code>\r
@@ -47915,33 +51519,33 @@ Ext.tree.TreeSorter = function(tree, config){
     /**\r
      * @cfg {Boolean} folderSort True to sort leaf nodes under non-leaf nodes (defaults to false)\r
      */\r
-    /** \r
-     * @cfg {String} property The named attribute on the node to sort by (defaults to "text").  Note that this \r
+    /**\r
+     * @cfg {String} property The named attribute on the node to sort by (defaults to "text").  Note that this\r
      * property is only used if no {@link #sortType} function is specified, otherwise it is ignored.\r
      */\r
-    /** \r
+    /**\r
      * @cfg {String} dir The direction to sort ("asc" or "desc," case-insensitive, defaults to "asc")\r
      */\r
-    /** \r
+    /**\r
      * @cfg {String} leafAttr The attribute used to determine leaf nodes when {@link #folderSort} = true (defaults to "leaf")\r
      */\r
-    /** \r
+    /**\r
      * @cfg {Boolean} caseSensitive true for case-sensitive sort (defaults to false)\r
      */\r
-    /** \r
+    /**\r
      * @cfg {Function} sortType A custom "casting" function used to convert node values before sorting.  The function\r
      * will be called with a single parameter (the {@link Ext.tree.TreeNode} being evaluated) and is expected to return\r
      * the node's sort value cast to the specific data type required for sorting.  This could be used, for example, when\r
-     * a node's text (or other attribute) should be sorted as a date or numeric value.  See the class description for \r
+     * a node's text (or other attribute) should be sorted as a date or numeric value.  See the class description for\r
      * example usage.  Note that if a sortType is specified, any {@link #property} config will be ignored.\r
      */\r
-    \r
+\r
     Ext.apply(this, config);\r
     tree.on("beforechildrenrendered", this.doSort, this);\r
     tree.on("append", this.updateSort, this);\r
     tree.on("insert", this.updateSort, this);\r
     tree.on("textchange", this.updateSortParent, this);\r
-    \r
+\r
     var dsc = this.dir && this.dir.toLowerCase() == "desc";\r
     var p = this.property || "text";\r
     var sortType = this.sortType;\r
@@ -47958,14 +51562,14 @@ Ext.tree.TreeSorter = function(tree, config){
                 return -1;\r
             }\r
         }\r
-       var v1 = sortType ? sortType(n1) : (cs ? n1.attributes[p] : n1.attributes[p].toUpperCase());\r
-       var v2 = sortType ? sortType(n2) : (cs ? n2.attributes[p] : n2.attributes[p].toUpperCase());\r
-       if(v1 < v2){\r
-                       return dsc ? +1 : -1;\r
-               }else if(v1 > v2){\r
-                       return dsc ? -1 : +1;\r
+        var v1 = sortType ? sortType(n1) : (cs ? n1.attributes[p] : n1.attributes[p].toUpperCase());\r
+        var v2 = sortType ? sortType(n2) : (cs ? n2.attributes[p] : n2.attributes[p].toUpperCase());\r
+        if(v1 < v2){\r
+            return dsc ? +1 : -1;\r
+        }else if(v1 > v2){\r
+            return dsc ? -1 : +1;\r
         }else{\r
-               return 0;\r
+            return 0;\r
         }\r
     };\r
 };\r
@@ -47974,20 +51578,20 @@ Ext.tree.TreeSorter.prototype = {
     doSort : function(node){\r
         node.sort(this.sortFn);\r
     },\r
-    \r
+\r
     compareNodes : function(n1, n2){\r
         return (n1.text.toUpperCase() > n2.text.toUpperCase() ? 1 : -1);\r
     },\r
-    \r
+\r
     updateSort : function(tree, node){\r
         if(node.childrenRendered){\r
             this.doSort.defer(1, this, [node]);\r
         }\r
     },\r
-    \r
+\r
     updateSortParent : function(node){\r
-               var p = node.parentNode;\r
-               if(p && p.childrenRendered){\r
+        var p = node.parentNode;\r
+        if(p && p.childrenRendered){\r
             this.doSort.defer(1, this, [p]);\r
         }\r
     }\r
@@ -48394,6 +51998,7 @@ Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
 Ext.tree.TreeEditor = function(tree, fc, config){
     fc = fc || {};
     var field = fc.events ? fc : new Ext.form.TextField(fc);
+    
     Ext.tree.TreeEditor.superclass.constructor.call(this, field, config);
 
     this.tree = tree;
@@ -48445,12 +52050,20 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
     editDelay : 350,
 
     initEditor : function(tree){
-        tree.on('beforeclick', this.beforeNodeClick, this);
-        tree.on('dblclick', this.onNodeDblClick, this);
-        this.on('complete', this.updateNode, this);
-        this.on('beforestartedit', this.fitToTree, this);
+        tree.on({
+            scope      : this,
+            beforeclick: this.beforeNodeClick,
+            dblclick   : this.onNodeDblClick
+        });
+        
+        this.on({
+            scope          : this,
+            complete       : this.updateNode,
+            beforestartedit: this.fitToTree,
+            specialkey     : this.onSpecialKey
+        });
+        
         this.on('startedit', this.bindScroll, this, {delay:10});
-        this.on('specialkey', this.onSpecialKey, this);
     },
 
     // private
@@ -48532,6 +52145,14 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, {
             e.stopEvent();
             this.completeEdit();
         }
+    },
+    
+    onDestroy : function(){
+        clearTimeout(this.autoEditTimer);
+        Ext.tree.TreeEditor.superclass.onDestroy.call(this);
+        var tree = this.tree;
+        tree.un('beforeclick', this.beforeNodeClick, this);
+        tree.un('dblclick', this.onNodeDblClick, this);
     }
 });/*! SWFObject v2.2 <http://code.google.com/p/swfobject/> \r
     is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> \r
@@ -49321,7 +52942,7 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
      * @cfg {String} flashVersion
      * Indicates the version the flash content was published for. Defaults to <tt>'9.0.45'</tt>.
      */
-    flashVersion : '9.0.45',
+    flashVersion : '9.0.115',
 
     /**
      * @cfg {String} backgroundColor
@@ -49334,6 +52955,19 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
      * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
      */
     wmode: 'opaque',
+    
+    /**
+     * @cfg {Object} flashVars
+     * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
+     */
+    flashVars: undefined,
+    
+    /**
+     * @cfg {Object} flashParams
+     * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
+     * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
+     */
+    flashParams: undefined,
 
     /**
      * @cfg {String} url
@@ -49354,21 +52988,28 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
     initComponent : function(){
         Ext.FlashComponent.superclass.initComponent.call(this);
 
-        this.addEvents('initialize');
+        this.addEvents(
+            /**
+             * @event initialize
+             * 
+             * @param {Chart} this
+             */
+            'initialize'
+        );
     },
 
     onRender : function(){
         Ext.FlashComponent.superclass.onRender.apply(this, arguments);
 
-        var params = {
+        var params = Ext.apply({
             allowScriptAccess: 'always',
             bgcolor: this.backgroundColor,
             wmode: this.wmode
-        }, vars = {
+        }, this.flashParams), vars = Ext.apply({
             allowedDomain: document.location.hostname,
             elementID: this.getId(),
             eventHandler: 'Ext.FlashEventProxy.onEvent'
-        };
+        }, this.flashVars);
 
         new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
             this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
@@ -49438,17 +53079,23 @@ Ext.FlashEventProxy = {
  * @extends Ext.FlashComponent\r
  * The Ext.chart package provides the capability to visualize data with flash based charting.\r
  * Each chart binds directly to an Ext.data.Store enabling automatic updates of the chart.\r
+ * To change the look and feel of a chart, see the {@link #chartStyle} and {@link #extraStyle} config options.\r
  * @constructor\r
  * @xtype chart\r
  */\r
  \r
  Ext.chart.Chart = Ext.extend(Ext.FlashComponent, {\r
     refreshBuffer: 100,\r
+    \r
+    /**\r
+     * @cfg {String} backgroundColor\r
+     * @hide\r
+     */\r
 \r
     /**\r
      * @cfg {Object} chartStyle\r
-     * Sets styles for this chart. Contains a number of default values. Modifying this property will override\r
-     * the base styles on the chart.\r
+     * Sets styles for this chart. This contains default styling, so modifying this property will <b>override</b>\r
+     * the built in styles of the chart. Use {@link #extraStyle} to add customizations to the default styling. \r
      */\r
     chartStyle: {\r
         padding: 10,\r
@@ -49486,9 +53133,75 @@ Ext.FlashEventProxy = {
     /**\r
      * @cfg {Object} extraStyle\r
      * Contains extra styles that will be added or overwritten to the default chartStyle. Defaults to <tt>null</tt>.\r
+     * For a detailed list of the options available, visit the YUI Charts site \r
+     * at <a href="http://developer.yahoo.com/yui/charts/#basicstyles">http://developer.yahoo.com/yui/charts/#basicstyles</a><br/>\r
+     * Some of the options availabe:<br />\r
+     * <ul style="padding:5px;padding-left:16px;list-style-type:inherit;">\r
+     * <li><b>padding</b> - The space around the edge of the chart's contents. Padding does not increase the size of the chart.</li>\r
+     * <li><b>animationEnabled</b> - A Boolean value that specifies whether marker animations are enabled or not. Enabled by default.</li>\r
+     * <li><b>font</b> - An Object defining the font style to be used in the chart. Defaults to <tt>{ name: 'Tahoma', color: 0x444444, size: 11 }</tt><br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>name</b> - font name</li>\r
+     *      <li><b>color</b> - font color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>\r
+     *      <li><b>size</b> - font size in points (numeric portion only, ie: 11)</li>\r
+     *      <li><b>bold</b> - boolean</li>\r
+     *      <li><b>italic</b> - boolean</li>\r
+     *      <li><b>underline</b> - boolean</li>\r
+     *  </ul>\r
+     * </li>\r
+     * <li><b>border</b> - An object defining the border style around the chart. The chart itself will decrease in dimensions to accomodate the border.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>\r
+     *      <li><b>size</b> - border size in pixels (numeric portion only, ie: 1)</li>\r
+     *  </ul>\r
+     * </li>\r
+     * <li><b>background</b> - An object defining the background style of the chart.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>\r
+     *      <li><b>image</b> - an image URL. May be relative to the current document or absolute.</li>\r
+     *  </ul>\r
+     * </li>\r
+     * <li><b>legend</b> - An object defining the legend style<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>display</b> - location of the legend. Possible values are "none", "left", "right", "top", and "bottom".</li>\r
+     *      <li><b>spacing</b> - an image URL. May be relative to the current document or absolute.</li>\r
+     *      <li><b>padding, border, background, font</b> - same options as described above.</li>\r
+     *  </ul></li>\r
+     * <li><b>dataTip</b> - An object defining the style of the data tip (tooltip).<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>padding, border, background, font</b> - same options as described above.</li>\r
+     *  </ul></li>\r
+     * <li><b>xAxis and yAxis</b> - An object defining the style of the style of either axis.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color</b> - same option as described above.</li>\r
+     *      <li><b>size</b> - same option as described above.</li>\r
+     *      <li><b>showLabels</b> - boolean</li>\r
+     *      <li><b>labelRotation</b> - a value in degrees from -90 through 90. Default is zero.</li>\r
+     *  </ul></li>\r
+     * <li><b>majorGridLines and minorGridLines</b> - An object defining the style of the style of the grid lines.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color, size</b> - same options as described above.</li>\r
+     *  </ul></li></li>\r
+     * <li><b>zeroGridLine</b> - An object defining the style of the style of the zero grid line.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color, size</b> - same options as described above.</li>\r
+     *  </ul></li></li>\r
+     * <li><b>majorTicks and minorTicks</b> - An object defining the style of the style of ticks in the chart.<br/>\r
+     *  <ul style="padding:5px;padding-left:26px;list-style-type:circle;">\r
+     *      <li><b>color, size</b> - same options as described above.</li>\r
+     *      <li><b>length</b> - the length of each tick in pixels extending from the axis.</li>\r
+     *      <li><b>display</b> - how the ticks are drawn. Possible values are "none", "inside", "outside", and "cross".</li>\r
+     *  </ul></li></li>\r
+     * </ul>\r
      */\r
     extraStyle: null,\r
     \r
+    /**\r
+     * @cfg {Object} seriesStyles\r
+     * Contains styles to apply to the series after a refresh. Defaults to <tt>null</tt>.\r
+     */\r
+    seriesStyles: null,\r
+    \r
     /**\r
      * @cfg {Boolean} disableCaching\r
      * True to add a "cache buster" to the end of the chart url. Defaults to true for Opera and IE.\r
@@ -49511,7 +53224,20 @@ Ext.FlashEventProxy = {
             'itemdoubleclick',\r
             'itemdragstart',\r
             'itemdrag',\r
-            'itemdragend'\r
+            'itemdragend',\r
+            /**\r
+             * @event beforerefresh\r
+             * Fires before a refresh to the chart data is called.  If the beforerefresh handler returns\r
+             * <tt>false</tt> the {@link #refresh} action will be cancelled.\r
+             * @param {Chart} this\r
+             */\r
+            'beforerefresh',\r
+            /**\r
+             * @event refresh\r
+             * Fires after the chart data has been refreshed.\r
+             * @param {Chart} this\r
+             */\r
+            'refresh'\r
         );\r
         this.store = Ext.StoreMgr.lookup(this.store);\r
     },\r
@@ -49541,6 +53267,7 @@ Ext.FlashEventProxy = {
      * @param styles {Array} Initializer for all Chart series styles.\r
      */\r
     setSeriesStyles: function(styles){\r
+        this.seriesStyles = styles;\r
         var s = [];\r
         Ext.each(styles, function(style){\r
             s.push(Ext.encode(style));\r
@@ -49572,13 +53299,14 @@ Ext.FlashEventProxy = {
      */\r
     bindStore : function(store, initial){\r
         if(!initial && this.store){\r
-            this.store.un("datachanged", this.refresh, this);\r
-            this.store.un("add", this.delayRefresh, this);\r
-            this.store.un("remove", this.delayRefresh, this);\r
-            this.store.un("update", this.delayRefresh, this);\r
-            this.store.un("clear", this.refresh, this);\r
             if(store !== this.store && this.store.autoDestroy){\r
                 this.store.destroy();\r
+            }else{\r
+                this.store.un("datachanged", this.refresh, this);\r
+                this.store.un("add", this.delayRefresh, this);\r
+                this.store.un("remove", this.delayRefresh, this);\r
+                this.store.un("update", this.delayRefresh, this);\r
+                this.store.un("clear", this.refresh, this);\r
             }\r
         }\r
         if(store){\r
@@ -49603,7 +53331,7 @@ Ext.FlashEventProxy = {
         this.swf.setType(this.type);\r
 \r
         if(this.chartStyle){\r
-            this.setStyles(Ext.apply(this.extraStyle || {}, this.chartStyle));\r
+            this.setStyles(Ext.apply({}, this.extraStyle, this.chartStyle));\r
         }\r
 \r
         if(this.categoryNames){\r
@@ -49627,51 +53355,57 @@ Ext.FlashEventProxy = {
     },\r
 \r
     refresh : function(){\r
-        var styleChanged = false;\r
-        // convert the store data into something YUI charts can understand\r
-        var data = [], rs = this.store.data.items;\r
-        for(var j = 0, len = rs.length; j < len; j++){\r
-            data[j] = rs[j].data;\r
-        }\r
-        //make a copy of the series definitions so that we aren't\r
-        //editing them directly.\r
-        var dataProvider = [];\r
-        var seriesCount = 0;\r
-        var currentSeries = null;\r
-        var i = 0;\r
-        if(this.series){\r
-            seriesCount = this.series.length;\r
-            for(i = 0; i < seriesCount; i++){\r
-                currentSeries = this.series[i];\r
-                var clonedSeries = {};\r
-                for(var prop in currentSeries){\r
-                    if(prop == "style" && currentSeries.style !== null){\r
-                        clonedSeries.style = Ext.encode(currentSeries.style);\r
-                        styleChanged = true;\r
-                        //we don't want to modify the styles again next time\r
-                        //so null out the style property.\r
-                        // this causes issues\r
-                        // currentSeries.style = null;\r
-                    } else{\r
-                        clonedSeries[prop] = currentSeries[prop];\r
-                    }\r
-                }\r
-                dataProvider.push(clonedSeries);\r
-            }\r
-        }\r
-\r
-        if(seriesCount > 0){\r
-            for(i = 0; i < seriesCount; i++){\r
-                currentSeries = dataProvider[i];\r
-                if(!currentSeries.type){\r
-                    currentSeries.type = this.type;\r
-                }\r
-                currentSeries.dataProvider = data;\r
-            }\r
-        } else{\r
-            dataProvider.push({type: this.type, dataProvider: data});\r
+        if(this.fireEvent('beforerefresh', this) !== false){\r
+               var styleChanged = false;\r
+               // convert the store data into something YUI charts can understand\r
+               var data = [], rs = this.store.data.items;\r
+               for(var j = 0, len = rs.length; j < len; j++){\r
+                   data[j] = rs[j].data;\r
+               }\r
+               //make a copy of the series definitions so that we aren't\r
+               //editing them directly.\r
+               var dataProvider = [];\r
+               var seriesCount = 0;\r
+               var currentSeries = null;\r
+               var i = 0;\r
+               if(this.series){\r
+                   seriesCount = this.series.length;\r
+                   for(i = 0; i < seriesCount; i++){\r
+                       currentSeries = this.series[i];\r
+                       var clonedSeries = {};\r
+                       for(var prop in currentSeries){\r
+                           if(prop == "style" && currentSeries.style !== null){\r
+                               clonedSeries.style = Ext.encode(currentSeries.style);\r
+                               styleChanged = true;\r
+                               //we don't want to modify the styles again next time\r
+                               //so null out the style property.\r
+                               // this causes issues\r
+                               // currentSeries.style = null;\r
+                           } else{\r
+                               clonedSeries[prop] = currentSeries[prop];\r
+                           }\r
+                       }\r
+                       dataProvider.push(clonedSeries);\r
+                   }\r
+               }\r
+       \r
+               if(seriesCount > 0){\r
+                   for(i = 0; i < seriesCount; i++){\r
+                       currentSeries = dataProvider[i];\r
+                       if(!currentSeries.type){\r
+                           currentSeries.type = this.type;\r
+                       }\r
+                       currentSeries.dataProvider = data;\r
+                   }\r
+               } else{\r
+                   dataProvider.push({type: this.type, dataProvider: data});\r
+               }\r
+               this.swf.setDataProvider(dataProvider);\r
+               if(this.seriesStyles){\r
+                   this.setSeriesStyles(this.seriesStyles);\r
+               }\r
+            this.fireEvent('refresh', this);\r
         }\r
-        this.swf.setDataProvider(dataProvider);\r
     },\r
 \r
     createFnProxy : function(fn, old){\r
@@ -49685,7 +53419,11 @@ Ext.FlashEventProxy = {
     \r
     onDestroy: function(){\r
         Ext.chart.Chart.superclass.onDestroy.call(this);\r
-        delete window[this.tipFnName];\r
+        this.bindStore(null);\r
+        var tip = this.tipFnName;\r
+        if(!Ext.isEmpty(tip)){\r
+            delete window[tip];\r
+        }\r
     }\r
 });\r
 Ext.reg('chart', Ext.chart.Chart);\r
@@ -50033,847 +53771,829 @@ Ext.chart.TimeAxis = Ext.extend(Ext.chart.Axis, {
      * on the minimum value.\r
      *\r
      * @property snapToUnits\r
-     * @type Boolean\r
-     */\r
-    snapToUnits: true\r
-});\r
-\r
-/**\r
- * @class Ext.chart.CategoryAxis\r
- * @extends Ext.chart.Axis\r
- * A type of axis that displays items in categories.\r
- * @constructor\r
- */\r
-Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, {\r
-    type: "category",\r
-\r
-    /**\r
-     * A list of category names to display along this axis.\r
-     *\r
-     * @property categoryNames\r
-     * @type Array\r
-     */\r
-    categoryNames: null\r
-});\r
-\r
-/**\r
- * @class Ext.chart.Series\r
- * Series class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.Series = function(config) { Ext.apply(this, config); };\r
-\r
-Ext.chart.Series.prototype =\r
-{\r
-    /**\r
-     * The type of series.\r
-     *\r
-     * @property type\r
-     * @type String\r
-     */\r
-    type: null,\r
-\r
-    /**\r
-     * The human-readable name of the series.\r
-     *\r
-     * @property displayName\r
-     * @type String\r
-     */\r
-    displayName: null\r
-};\r
-\r
-/**\r
- * @class Ext.chart.CartesianSeries\r
- * @extends Ext.chart.Series\r
- * CartesianSeries class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, {\r
-    /**\r
-     * The field used to access the x-axis value from the items from the data source.\r
-     *\r
-     * @property xField\r
-     * @type String\r
-     */\r
-    xField: null,\r
-\r
-    /**\r
-     * The field used to access the y-axis value from the items from the data source.\r
-     *\r
-     * @property yField\r
-     * @type String\r
-     */\r
-    yField: null\r
-});\r
-\r
-/**\r
- * @class Ext.chart.ColumnSeries\r
- * @extends Ext.chart.CartesianSeries\r
- * ColumnSeries class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
-    type: "column"\r
-});\r
-\r
-/**\r
- * @class Ext.chart.LineSeries\r
- * @extends Ext.chart.CartesianSeries\r
- * LineSeries class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.LineSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
-    type: "line"\r
-});\r
-\r
-/**\r
- * @class Ext.chart.BarSeries\r
- * @extends Ext.chart.CartesianSeries\r
- * BarSeries class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.BarSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
-    type: "bar"\r
-});\r
-\r
-\r
-/**\r
- * @class Ext.chart.PieSeries\r
- * @extends Ext.chart.Series\r
- * PieSeries class for the charts widget.\r
- * @constructor\r
- */\r
-Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, {\r
-    type: "pie",\r
-    dataField: null,\r
-    categoryField: null\r
-});/**\r
- * @class Ext.layout.MenuLayout\r
- * @extends Ext.layout.ContainerLayout\r
- * <p>Layout manager used by {@link Ext.menu.Menu}. Generally this class should not need to be used directly.</p>\r
- */\r
- Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, {\r
-    monitorResize: true,\r
-\r
-    setContainer : function(ct){\r
-        this.monitorResize = !ct.floating;\r
-        Ext.layout.MenuLayout.superclass.setContainer.call(this, ct);\r
-    },\r
-\r
-    renderItem : function(c, position, target){\r
-        if (!this.itemTpl) {\r
-            this.itemTpl = Ext.layout.MenuLayout.prototype.itemTpl = new Ext.XTemplate(\r
-                '<li id="{itemId}" class="{itemCls}">',\r
-                    '<tpl if="needsIcon">',\r
-                        '<img src="{icon}" class="{iconCls}"/>',\r
-                    '</tpl>',\r
-                '</li>'\r
-            );\r
-        }\r
-\r
-        if(c && !c.rendered){\r
-            if(Ext.isNumber(position)){\r
-                position = target.dom.childNodes[position];\r
-            }\r
-            var a = this.getItemArgs(c);\r
-\r
-//          The Component's positionEl is the <li> it is rendered into\r
-            c.render(c.positionEl = position ?\r
-                this.itemTpl.insertBefore(position, a, true) :\r
-                this.itemTpl.append(target, a, true));\r
-\r
-//          Link the containing <li> to the item.\r
-            c.positionEl.menuItemId = c.itemId || c.id;\r
-\r
-//          If rendering a regular Component, and it needs an icon,\r
-//          move the Component rightwards.\r
-            if (!a.isMenuItem && a.needsIcon) {\r
-                c.positionEl.addClass('x-menu-list-item-indent');\r
-            }\r
-        }else if(c && !this.isValidParent(c, target)){\r
-            if(Ext.isNumber(position)){\r
-                position = target.dom.childNodes[position];\r
-            }\r
-            target.dom.insertBefore(c.getActionEl().dom, position || null);\r
-        }\r
-    },\r
-\r
-    getItemArgs: function(c) {\r
-        var isMenuItem = c instanceof Ext.menu.Item;\r
-        return {\r
-            isMenuItem: isMenuItem,\r
-            needsIcon: !isMenuItem && (c.icon || c.iconCls),\r
-            icon: c.icon || Ext.BLANK_IMAGE_URL,\r
-            iconCls: 'x-menu-item-icon ' + (c.iconCls || ''),\r
-            itemId: 'x-menu-el-' + c.id,\r
-            itemCls: 'x-menu-list-item ' + (this.extraCls || '')\r
-        };\r
-    },\r
-\r
-//  Valid if the Component is in a <li> which is part of our target <ul>\r
-    isValidParent: function(c, target) {\r
-        return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target);\r
-    },\r
-\r
-    onLayout : function(ct, target){\r
-        this.renderAll(ct, target);\r
-        this.doAutoSize();\r
-    },\r
-\r
-    doAutoSize : function(){\r
-        var ct = this.container, w = ct.width;\r
-        if(ct.floating){\r
-            if(w){\r
-                ct.setWidth(w);\r
-            }else if(Ext.isIE){\r
-                ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8) ? 'auto' : ct.minWidth);\r
-                var el = ct.getEl(), t = el.dom.offsetWidth; // force recalc\r
-                ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr'));\r
-            }\r
-        }\r
-    }\r
-});\r
-Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout;\r
-\r
-/**\r
- * @class Ext.menu.Menu\r
- * @extends Ext.Container\r
- * <p>A menu object.  This is the container to which you may add menu items.  Menu can also serve as a base class\r
- * when you want a specialized menu based off of another component (like {@link Ext.menu.DateMenu} for example).</p>\r
- * <p>Menus may contain either {@link Ext.menu.Item menu items}, or general {@link Ext.Component Component}s.</p>\r
- * <p>To make a contained general {@link Ext.Component Component} line up with other {@link Ext.menu.Item menu items}\r
- * specify <tt>iconCls: 'no-icon'</tt>.  This reserves a space for an icon, and indents the Component in line\r
- * with the other menu items.  See {@link Ext.form.ComboBox}.{@link Ext.form.ComboBox#getListParent getListParent}\r
- * for an example.</p>\r
- * <p>By default, Menus are absolutely positioned, floating Components. By configuring a Menu with\r
- * <b><tt>{@link #floating}:false</tt></b>, a Menu may be used as child of a Container.</p>\r
- *\r
- * @xtype menu\r
- */\r
-Ext.menu.Menu = Ext.extend(Ext.Container, {\r
-    /**\r
-     * @cfg {Object} defaults\r
-     * A config object that will be applied to all items added to this container either via the {@link #items}\r
-     * config or via the {@link #add} method.  The defaults config can contain any number of\r
-     * name/value property pairs to be added to each item, and should be valid for the types of items\r
-     * being added to the menu.\r
-     */\r
-    /**\r
-     * @cfg {Mixed} items\r
-     * An array of items to be added to this menu. Menus may contain either {@link Ext.menu.Item menu items},\r
-     * or general {@link Ext.Component Component}s.\r
-     */\r
-    /**\r
-     * @cfg {Number} minWidth The minimum width of the menu in pixels (defaults to 120)\r
-     */\r
-    minWidth : 120,\r
-    /**\r
-     * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop"\r
-     * for bottom-right shadow (defaults to "sides")\r
-     */\r
-    shadow : "sides",\r
-    /**\r
-     * @cfg {String} subMenuAlign The {@link Ext.Element#alignTo} anchor position value to use for submenus of\r
-     * this menu (defaults to "tl-tr?")\r
-     */\r
-    subMenuAlign : "tl-tr?",\r
-    /**\r
-     * @cfg {String} defaultAlign The default {@link Ext.Element#alignTo} anchor position value for this menu\r
-     * relative to its element of origin (defaults to "tl-bl?")\r
-     */\r
-    defaultAlign : "tl-bl?",\r
-    /**\r
-     * @cfg {Boolean} allowOtherMenus True to allow multiple menus to be displayed at the same time (defaults to false)\r
-     */\r
-    allowOtherMenus : false,\r
-    /**\r
-     * @cfg {Boolean} ignoreParentClicks True to ignore clicks on any item in this menu that is a parent item (displays\r
-     * a submenu) so that the submenu is not dismissed when clicking the parent item (defaults to false).\r
-     */\r
-    ignoreParentClicks : false,\r
-    /**\r
-     * @cfg {Boolean} enableScrolling True to allow the menu container to have scroller controls if the menu is too long (defaults to true).\r
-     */\r
-    enableScrolling: true,\r
-    /**\r
-     * @cfg {Number} maxHeight The maximum height of the menu. Only applies when enableScrolling is set to True (defaults to null).\r
-     */\r
-    maxHeight: null,\r
-    /**\r
-     * @cfg {Number} scrollIncrement The amount to scroll the menu. Only applies when enableScrolling is set to True (defaults to 24).\r
-     */\r
-    scrollIncrement: 24,\r
-    /**\r
-     * @cfg {Boolean} showSeparator True to show the icon separator. (defaults to true).\r
-     */\r
-    showSeparator: true,\r
-    /**\r
-     * @cfg {Array} defaultOffsets An array specifying the [x, y] offset in pixels by which to\r
-     * change the default Menu popup position after aligning according to the {@link #defaultAlign}\r
-     * configuration. Defaults to <tt>[0, 0]</tt>.\r
-     */\r
-    defaultOffsets : [0, 0],\r
-\r
-\r
-    /**\r
-     * @cfg {Boolean} floating\r
-     * May be specified as false to create a Menu which may be used as a child item of another Container\r
-     * instead of a free-floating {@link Ext.Layer Layer}. (defaults to true).\r
-     */\r
-    floating: true,         // Render as a Layer by default\r
-\r
-    // private\r
-    hidden: true,\r
-    layout: 'menu',\r
-    hideMode: 'offsets',    // Important for laying out Components\r
-    scrollerHeight: 8,\r
-    autoLayout: true,       // Provided for backwards compat\r
-    defaultType: 'menuitem',\r
-\r
-    initComponent: function(){\r
-        if(Ext.isArray(this.initialConfig)){\r
-            Ext.apply(this, {items:this.initialConfig});\r
-        }\r
-        this.addEvents(\r
-            /**\r
-             * @event click\r
-             * Fires when this menu is clicked (or when the enter key is pressed while it is active)\r
-             * @param {Ext.menu.Menu} this\r
-            * @param {Ext.menu.Item} menuItem The menu item that was clicked\r
-             * @param {Ext.EventObject} e\r
-             */\r
-            'click',\r
-            /**\r
-             * @event mouseover\r
-             * Fires when the mouse is hovering over this menu\r
-             * @param {Ext.menu.Menu} this\r
-             * @param {Ext.EventObject} e\r
-             * @param {Ext.menu.Item} menuItem The menu item that was clicked\r
-             */\r
-            'mouseover',\r
-            /**\r
-             * @event mouseout\r
-             * Fires when the mouse exits this menu\r
-             * @param {Ext.menu.Menu} this\r
-             * @param {Ext.EventObject} e\r
-             * @param {Ext.menu.Item} menuItem The menu item that was clicked\r
-             */\r
-            'mouseout',\r
-            /**\r
-             * @event itemclick\r
-             * Fires when a menu item contained in this menu is clicked\r
-             * @param {Ext.menu.BaseItem} baseItem The BaseItem that was clicked\r
-             * @param {Ext.EventObject} e\r
-             */\r
-            'itemclick'\r
-        );\r
-        Ext.menu.MenuMgr.register(this);\r
-        if(this.floating){\r
-            Ext.EventManager.onWindowResize(this.hide, this);\r
-        }else{\r
-            if(this.initialConfig.hidden !== false){\r
-                this.hidden = false;\r
-            }\r
-            this.internalDefaults = {hideOnClick: false};\r
-        }\r
-        Ext.menu.Menu.superclass.initComponent.call(this);\r
-        if(this.autoLayout){\r
-            this.on({\r
-                add: this.doLayout,\r
-                remove: this.doLayout,\r
-                scope: this\r
-            });\r
-        }\r
-    },\r
-\r
-    //private\r
-    getLayoutTarget : function() {\r
-        return this.ul;\r
-    },\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        if(!ct){\r
-            ct = Ext.getBody();\r
-        }\r
-\r
-        var dh = {\r
-            id: this.getId(),\r
-            cls: 'x-menu ' + ((this.floating) ? 'x-menu-floating x-layer ' : '') + (this.cls || '') + (this.plain ? ' x-menu-plain' : '') + (this.showSeparator ? '' : ' x-menu-nosep'),\r
-            style: this.style,\r
-            cn: [\r
-                {tag: 'a', cls: 'x-menu-focus', href: '#', onclick: 'return false;', tabIndex: '-1'},\r
-                {tag: 'ul', cls: 'x-menu-list'}\r
-            ]\r
-        };\r
-        if(this.floating){\r
-            this.el = new Ext.Layer({\r
-                shadow: this.shadow,\r
-                dh: dh,\r
-                constrain: false,\r
-                parentEl: ct,\r
-                zindex:15000\r
-            });\r
-        }else{\r
-            this.el = ct.createChild(dh);\r
-        }\r
-        Ext.menu.Menu.superclass.onRender.call(this, ct, position);\r
-\r
-        if(!this.keyNav){\r
-            this.keyNav = new Ext.menu.MenuNav(this);\r
-        }\r
-        // generic focus element\r
-        this.focusEl = this.el.child('a.x-menu-focus');\r
-        this.ul = this.el.child('ul.x-menu-list');\r
-        this.mon(this.ul, {\r
-            scope: this,\r
-            click: this.onClick,\r
-            mouseover: this.onMouseOver,\r
-            mouseout: this.onMouseOut\r
-        });\r
-        if(this.enableScrolling){\r
-            this.mon(this.el, {\r
-                scope: this,\r
-                delegate: '.x-menu-scroller',\r
-                click: this.onScroll,\r
-                mouseover: this.deactivateActive\r
-            });\r
-        }\r
-    },\r
-\r
-    // private\r
-    findTargetItem : function(e){\r
-        var t = e.getTarget(".x-menu-list-item", this.ul, true);\r
-        if(t && t.menuItemId){\r
-            return this.items.get(t.menuItemId);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onClick : function(e){\r
-        var t = this.findTargetItem(e);\r
-        if(t){\r
-            if(t.isFormField){\r
-                this.setActiveItem(t);\r
-            }else{\r
-                if(t.menu && this.ignoreParentClicks){\r
-                    t.expandMenu();\r
-                    e.preventDefault();\r
-                }else if(t.onClick){\r
-                    t.onClick(e);\r
-                    this.fireEvent("click", this, t, e);\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    setActiveItem : function(item, autoExpand){\r
-        if(item != this.activeItem){\r
-            this.deactivateActive();\r
-            if((this.activeItem = item).isFormField){\r
-                item.focus();\r
-            }else{\r
-                item.activate(autoExpand);\r
-            }\r
-        }else if(autoExpand){\r
-            item.expandMenu();\r
-        }\r
-    },\r
-\r
-    deactivateActive: function(){\r
-        var a = this.activeItem;\r
-        if(a){\r
-            if(a.isFormField){\r
-                //Fields cannot deactivate, but Combos must collapse\r
-                if(a.collapse){\r
-                    a.collapse();\r
-                }\r
-            }else{\r
-                a.deactivate();\r
-            }\r
-            delete this.activeItem;\r
-        }\r
-    },\r
-\r
-    // private\r
-    tryActivate : function(start, step){\r
-        var items = this.items;\r
-        for(var i = start, len = items.length; i >= 0 && i < len; i+= step){\r
-            var item = items.get(i);\r
-            if(!item.disabled && (item.canActivate || item.isFormField)){\r
-                this.setActiveItem(item, false);\r
-                return item;\r
-            }\r
-        }\r
-        return false;\r
-    },\r
-\r
-    // private\r
-    onMouseOver : function(e){\r
-        var t = this.findTargetItem(e);\r
-        if(t){\r
-            if(t.canActivate && !t.disabled){\r
-                this.setActiveItem(t, true);\r
-            }\r
-        }\r
-        this.over = true;\r
-        this.fireEvent("mouseover", this, e, t);\r
-    },\r
-\r
-    // private\r
-    onMouseOut : function(e){\r
-        var t = this.findTargetItem(e);\r
-        if(t){\r
-            if(t == this.activeItem && t.shouldDeactivate && t.shouldDeactivate(e)){\r
-                this.activeItem.deactivate();\r
-                delete this.activeItem;\r
-            }\r
-        }\r
-        this.over = false;\r
-        this.fireEvent("mouseout", this, e, t);\r
-    },\r
-\r
-    // private\r
-    onScroll: function(e, t){\r
-        if(e){\r
-            e.stopEvent();\r
-        }\r
-        var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top');\r
-        ul.scrollTop += this.scrollIncrement * (top ? -1 : 1);\r
-        if(top ? ul.scrollTop <= 0 : ul.scrollTop + this.activeMax >= ul.scrollHeight){\r
-           this.onScrollerOut(null, t);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onScrollerIn: function(e, t){\r
-        var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top');\r
-        if(top ? ul.scrollTop > 0 : ul.scrollTop + this.activeMax < ul.scrollHeight){\r
-            Ext.fly(t).addClass(['x-menu-item-active', 'x-menu-scroller-active']);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onScrollerOut: function(e, t){\r
-        Ext.fly(t).removeClass(['x-menu-item-active', 'x-menu-scroller-active']);\r
-    },\r
-\r
-    /**\r
-     * Displays this menu relative to another element\r
-     * @param {Mixed} element The element to align to\r
-     * @param {String} position (optional) The {@link Ext.Element#alignTo} anchor position to use in aligning to\r
-     * the element (defaults to this.defaultAlign)\r
-     * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)\r
-     */\r
-    show : function(el, pos, parentMenu){\r
-        if(this.floating){\r
-            this.parentMenu = parentMenu;\r
-            if(!this.el){\r
-                this.render();\r
-                this.doLayout(false, true);\r
-            }\r
-            if(this.fireEvent('beforeshow', this) !== false){\r
-                this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign, this.defaultOffsets), parentMenu, false);\r
-            }\r
-        }else{\r
-            Ext.menu.Menu.superclass.show.call(this);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Displays this menu at a specific xy position\r
-     * @param {Array} xyPosition Contains X & Y [x, y] values for the position at which to show the menu (coordinates are page-based)\r
-     * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)\r
-     */\r
-    showAt : function(xy, parentMenu, /* private: */_e){\r
-        this.parentMenu = parentMenu;\r
-        if(!this.el){\r
-            this.render();\r
-        }\r
-        this.el.setXY(xy);\r
-        if(this.enableScrolling){\r
-            this.constrainScroll(xy[1]);\r
-        }\r
-        this.el.show();\r
-        Ext.menu.Menu.superclass.onShow.call(this);\r
-        if(Ext.isIE){\r
-            this.layout.doAutoSize();\r
-            if(!Ext.isIE8){\r
-                this.el.repaint();\r
-            }\r
-        }\r
-        this.hidden = false;\r
-        this.focus();\r
-        this.fireEvent("show", this);\r
-    },\r
-\r
-    constrainScroll: function(y){\r
-        var max, full = this.ul.setHeight('auto').getHeight();\r
-        if(this.floating){\r
-            max = this.maxHeight ? this.maxHeight : Ext.fly(this.el.dom.parentNode).getViewSize().height - y;\r
-        }else{\r
-            max = this.getHeight();\r
-        }\r
-        if(full > max && max > 0){\r
-            this.activeMax = max - this.scrollerHeight * 2 - this.el.getFrameWidth('tb') - Ext.num(this.el.shadowOffset, 0);\r
-            this.ul.setHeight(this.activeMax);\r
-            this.createScrollers();\r
-            this.el.select('.x-menu-scroller').setDisplayed('');\r
-        }else{\r
-            this.ul.setHeight(full);\r
-            this.el.select('.x-menu-scroller').setDisplayed('none');\r
-        }\r
-        this.ul.dom.scrollTop = 0;\r
-    },\r
-\r
-    createScrollers: function(){\r
-        if(!this.scroller){\r
-            this.scroller = {\r
-                pos: 0,\r
-                top: this.el.insertFirst({\r
-                    tag: 'div',\r
-                    cls: 'x-menu-scroller x-menu-scroller-top',\r
-                    html: '&#160;'\r
-                }),\r
-                bottom: this.el.createChild({\r
-                    tag: 'div',\r
-                    cls: 'x-menu-scroller x-menu-scroller-bottom',\r
-                    html: '&#160;'\r
-                })\r
-            };\r
-            this.scroller.top.hover(this.onScrollerIn, this.onScrollerOut, this);\r
-            this.scroller.topRepeater = new Ext.util.ClickRepeater(this.scroller.top, {\r
-                listeners: {\r
-                    click: this.onScroll.createDelegate(this, [null, this.scroller.top], false)\r
-                }\r
-            });\r
-            this.scroller.bottom.hover(this.onScrollerIn, this.onScrollerOut, this);\r
-            this.scroller.bottomRepeater = new Ext.util.ClickRepeater(this.scroller.bottom, {\r
-                listeners: {\r
-                    click: this.onScroll.createDelegate(this, [null, this.scroller.bottom], false)\r
-                }\r
-            });\r
-        }\r
-    },\r
-\r
-    onLayout: function(){\r
-        if(this.isVisible()){\r
-            if(this.enableScrolling){\r
-                this.constrainScroll(this.el.getTop());\r
-            }\r
-            if(this.floating){\r
-                this.el.sync();\r
-            }\r
-        }\r
-    },\r
-\r
-    focus : function(){\r
-        if(!this.hidden){\r
-            this.doFocus.defer(50, this);\r
-        }\r
-    },\r
-\r
-    doFocus : function(){\r
-        if(!this.hidden){\r
-            this.focusEl.focus();\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Hides this menu and optionally all parent menus\r
-     * @param {Boolean} deep (optional) True to hide all parent menus recursively, if any (defaults to false)\r
-     */\r
-    hide : function(deep){\r
-        this.deepHide = deep;\r
-        Ext.menu.Menu.superclass.hide.call(this);\r
-        delete this.deepHide;\r
-    },\r
-\r
-    // private\r
-    onHide: function(){\r
-        Ext.menu.Menu.superclass.onHide.call(this);\r
-        this.deactivateActive();\r
-        if(this.el && this.floating){\r
-            this.el.hide();\r
-        }\r
-        if(this.deepHide === true && this.parentMenu){\r
-            this.parentMenu.hide(true);\r
-        }\r
-    },\r
-\r
-    // private\r
-    lookupComponent: function(c){\r
-         if(Ext.isString(c)){\r
-            c = (c == 'separator' || c == '-') ? new Ext.menu.Separator() : new Ext.menu.TextItem(c);\r
-             this.applyDefaults(c);\r
-         }else{\r
-            if(Ext.isObject(c)){\r
-                c = this.getMenuItem(c);\r
-            }else if(c.tagName || c.el){ // element. Wrap it.\r
-                c = new Ext.BoxComponent({\r
-                    el: c\r
-                });\r
-            }\r
-         }\r
-         return c;\r
-    },\r
-\r
-    applyDefaults : function(c){\r
-        if(!Ext.isString(c)){\r
-            c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);\r
-            var d = this.internalDefaults;\r
-            if(d){\r
-                if(c.events){\r
-                    Ext.applyIf(c.initialConfig, d);\r
-                    Ext.apply(c, d);\r
-                }else{\r
-                    Ext.applyIf(c, d);\r
-                }\r
-            }\r
-        }\r
-        return c;\r
-    },\r
+     * @type Boolean\r
+     */\r
+    snapToUnits: true\r
+});\r
 \r
-    // private\r
-    getMenuItem: function(config){\r
-       if(!config.isXType){\r
-            if(!config.xtype && Ext.isBoolean(config.checked)){\r
-                return new Ext.menu.CheckItem(config)\r
-            }\r
-            return Ext.create(config, this.defaultType);\r
-        }\r
-        return config;\r
-    },\r
+/**\r
+ * @class Ext.chart.CategoryAxis\r
+ * @extends Ext.chart.Axis\r
+ * A type of axis that displays items in categories.\r
+ * @constructor\r
+ */\r
+Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, {\r
+    type: "category",\r
 \r
     /**\r
-     * Adds a separator bar to the menu\r
-     * @return {Ext.menu.Item} The menu item that was added\r
+     * A list of category names to display along this axis.\r
+     *\r
+     * @property categoryNames\r
+     * @type Array\r
      */\r
-    addSeparator : function(){\r
-        return this.add(new Ext.menu.Separator());\r
-    },\r
+    categoryNames: null\r
+});\r
+\r
+/**\r
+ * @class Ext.chart.Series\r
+ * Series class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.Series = function(config) { Ext.apply(this, config); };\r
 \r
+Ext.chart.Series.prototype =\r
+{\r
     /**\r
-     * Adds an {@link Ext.Element} object to the menu\r
-     * @param {Mixed} el The element or DOM node to add, or its id\r
-     * @return {Ext.menu.Item} The menu item that was added\r
+     * The type of series.\r
+     *\r
+     * @property type\r
+     * @type String\r
      */\r
-    addElement : function(el){\r
-        return this.add(new Ext.menu.BaseItem(el));\r
-    },\r
+    type: null,\r
 \r
     /**\r
-     * Adds an existing object based on {@link Ext.menu.BaseItem} to the menu\r
-     * @param {Ext.menu.Item} item The menu item to add\r
-     * @return {Ext.menu.Item} The menu item that was added\r
+     * The human-readable name of the series.\r
+     *\r
+     * @property displayName\r
+     * @type String\r
      */\r
-    addItem : function(item){\r
-        return this.add(item);\r
-    },\r
+    displayName: null\r
+};\r
 \r
+/**\r
+ * @class Ext.chart.CartesianSeries\r
+ * @extends Ext.chart.Series\r
+ * CartesianSeries class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, {\r
     /**\r
-     * Creates a new {@link Ext.menu.Item} based an the supplied config object and adds it to the menu\r
-     * @param {Object} config A MenuItem config object\r
-     * @return {Ext.menu.Item} The menu item that was added\r
+     * The field used to access the x-axis value from the items from the data source.\r
+     *\r
+     * @property xField\r
+     * @type String\r
      */\r
-    addMenuItem : function(config){\r
-        return this.add(this.getMenuItem(config));\r
-    },\r
+    xField: null,\r
 \r
     /**\r
-     * Creates a new {@link Ext.menu.TextItem} with the supplied text and adds it to the menu\r
-     * @param {String} text The text to display in the menu item\r
-     * @return {Ext.menu.Item} The menu item that was added\r
+     * The field used to access the y-axis value from the items from the data source.\r
+     *\r
+     * @property yField\r
+     * @type String\r
      */\r
-    addText : function(text){\r
-        return this.add(new Ext.menu.TextItem(text));\r
-    },\r
-\r
-    //private\r
-    onDestroy : function(){\r
-        Ext.menu.Menu.superclass.onDestroy.call(this);\r
-        Ext.menu.MenuMgr.unregister(this);\r
-        Ext.EventManager.removeResizeListener(this.hide, this);\r
-        if(this.keyNav) {\r
-            this.keyNav.disable();\r
-        }\r
-        var s = this.scroller;\r
-        if(s){\r
-            Ext.destroy(s.topRepeater, s.bottomRepeater, s.top, s.bottom);\r
-        }\r
-    }\r
+    yField: null\r
 });\r
 \r
-Ext.reg('menu', Ext.menu.Menu);\r
-\r
-// MenuNav is a private utility class used internally by the Menu\r
-Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){\r
-    function up(e, m){\r
-        if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){\r
-            m.tryActivate(m.items.length-1, -1);\r
-        }\r
-    }\r
-    function down(e, m){\r
-        if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){\r
-            m.tryActivate(0, 1);\r
-        }\r
-    }\r
-    return {\r
-        constructor: function(menu){\r
-            Ext.menu.MenuNav.superclass.constructor.call(this, menu.el);\r
-            this.scope = this.menu = menu;\r
-        },\r
-\r
-        doRelay : function(e, h){\r
-            var k = e.getKey();\r
-//          Keystrokes within a form Field (e.g.: down in a Combo) do not navigate. Allow only TAB\r
-            if (this.menu.activeItem && this.menu.activeItem.isFormField && k != e.TAB) {\r
-                return false;\r
-            }\r
-            if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){\r
-                this.menu.tryActivate(0, 1);\r
-                return false;\r
-            }\r
-            return h.call(this.scope || this, e, this.menu);\r
-        },\r
-\r
-        tab: function(e, m) {\r
-            e.stopEvent();\r
-            if (e.shiftKey) {\r
-                up(e, m);\r
-            } else {\r
-                down(e, m);\r
-            }\r
-        },\r
-\r
-        up : up,\r
+/**\r
+ * @class Ext.chart.ColumnSeries\r
+ * @extends Ext.chart.CartesianSeries\r
+ * ColumnSeries class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
+    type: "column"\r
+});\r
 \r
-        down : down,\r
+/**\r
+ * @class Ext.chart.LineSeries\r
+ * @extends Ext.chart.CartesianSeries\r
+ * LineSeries class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.LineSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
+    type: "line"\r
+});\r
 \r
-        right : function(e, m){\r
-            if(m.activeItem){\r
-                m.activeItem.expandMenu(true);\r
-            }\r
-        },\r
+/**\r
+ * @class Ext.chart.BarSeries\r
+ * @extends Ext.chart.CartesianSeries\r
+ * BarSeries class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.BarSeries = Ext.extend(Ext.chart.CartesianSeries, {\r
+    type: "bar"\r
+});\r
 \r
-        left : function(e, m){\r
-            m.hide();\r
-            if(m.parentMenu && m.parentMenu.activeItem){\r
-                m.parentMenu.activeItem.activate();\r
-            }\r
-        },\r
 \r
-        enter : function(e, m){\r
-            if(m.activeItem){\r
-                e.stopPropagation();\r
-                m.activeItem.onClick(e);\r
-                m.fireEvent("click", this, m.activeItem);\r
-                return true;\r
-            }\r
-        }\r
-    };\r
-}());/**
+/**\r
+ * @class Ext.chart.PieSeries\r
+ * @extends Ext.chart.Series\r
+ * PieSeries class for the charts widget.\r
+ * @constructor\r
+ */\r
+Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, {\r
+    type: "pie",\r
+    dataField: null,\r
+    categoryField: null\r
+});/**
+ * @class Ext.menu.Menu
+ * @extends Ext.Container
+ * <p>A menu object.  This is the container to which you may add menu items.  Menu can also serve as a base class
+ * when you want a specialized menu based off of another component (like {@link Ext.menu.DateMenu} for example).</p>
+ * <p>Menus may contain either {@link Ext.menu.Item menu items}, or general {@link Ext.Component Component}s.</p>
+ * <p>To make a contained general {@link Ext.Component Component} line up with other {@link Ext.menu.Item menu items}
+ * specify <tt>iconCls: 'no-icon'</tt>.  This reserves a space for an icon, and indents the Component in line
+ * with the other menu items.  See {@link Ext.form.ComboBox}.{@link Ext.form.ComboBox#getListParent getListParent}
+ * for an example.</p>
+ * <p>By default, Menus are absolutely positioned, floating Components. By configuring a Menu with
+ * <b><tt>{@link #floating}:false</tt></b>, a Menu may be used as child of a Container.</p>
+ *
+ * @xtype menu
+ */
+Ext.menu.Menu = Ext.extend(Ext.Container, {
+    /**
+     * @cfg {Object} defaults
+     * A config object that will be applied to all items added to this container either via the {@link #items}
+     * config or via the {@link #add} method.  The defaults config can contain any number of
+     * name/value property pairs to be added to each item, and should be valid for the types of items
+     * being added to the menu.
+     */
+    /**
+     * @cfg {Mixed} items
+     * An array of items to be added to this menu. Menus may contain either {@link Ext.menu.Item menu items},
+     * or general {@link Ext.Component Component}s.
+     */
+    /**
+     * @cfg {Number} minWidth The minimum width of the menu in pixels (defaults to 120)
+     */
+    minWidth : 120,
+    /**
+     * @cfg {Boolean/String} shadow True or 'sides' for the default effect, 'frame' for 4-way shadow, and 'drop'
+     * for bottom-right shadow (defaults to 'sides')
+     */
+    shadow : 'sides',
+    /**
+     * @cfg {String} subMenuAlign The {@link Ext.Element#alignTo} anchor position value to use for submenus of
+     * this menu (defaults to 'tl-tr?')
+     */
+    subMenuAlign : 'tl-tr?',
+    /**
+     * @cfg {String} defaultAlign The default {@link Ext.Element#alignTo} anchor position value for this menu
+     * relative to its element of origin (defaults to 'tl-bl?')
+     */
+    defaultAlign : 'tl-bl?',
+    /**
+     * @cfg {Boolean} allowOtherMenus True to allow multiple menus to be displayed at the same time (defaults to false)
+     */
+    allowOtherMenus : false,
+    /**
+     * @cfg {Boolean} ignoreParentClicks True to ignore clicks on any item in this menu that is a parent item (displays
+     * a submenu) so that the submenu is not dismissed when clicking the parent item (defaults to false).
+     */
+    ignoreParentClicks : false,
+    /**
+     * @cfg {Boolean} enableScrolling True to allow the menu container to have scroller controls if the menu is too long (defaults to true).
+     */
+    enableScrolling : true,
+    /**
+     * @cfg {Number} maxHeight The maximum height of the menu. Only applies when enableScrolling is set to True (defaults to null).
+     */
+    maxHeight : null,
+    /**
+     * @cfg {Number} scrollIncrement The amount to scroll the menu. Only applies when enableScrolling is set to True (defaults to 24).
+     */
+    scrollIncrement : 24,
+    /**
+     * @cfg {Boolean} showSeparator True to show the icon separator. (defaults to true).
+     */
+    showSeparator : true,
+    /**
+     * @cfg {Array} defaultOffsets An array specifying the [x, y] offset in pixels by which to
+     * change the default Menu popup position after aligning according to the {@link #defaultAlign}
+     * configuration. Defaults to <tt>[0, 0]</tt>.
+     */
+    defaultOffsets : [0, 0],
+
+    /**
+     * @cfg {Boolean} plain
+     * True to remove the incised line down the left side of the menu. Defaults to <tt>false</tt>.
+     */
+    plain : false,
+
+    /**
+     * @cfg {Boolean} floating
+     * <p>By default, a Menu configured as <b><code>floating:true</code></b>
+     * will be rendered as an {@link Ext.Layer} (an absolutely positioned,
+     * floating Component with zindex=15000).
+     * If configured as <b><code>floating:false</code></b>, the Menu may be
+     * used as child item of another Container instead of a free-floating
+     * {@link Ext.Layer Layer}.
+     */
+    floating : true,
+
+
+    /**
+     * @cfg {Number} zIndex
+     * zIndex to use when the menu is floating.
+     */
+    zIndex: 15000,
+
+    // private
+    hidden : true,
+
+    /**
+     * @cfg {String/Object} layout
+     * This class assigns a default layout (<code>layout:'<b>menu</b>'</code>).
+     * Developers <i>may</i> override this configuration option if another layout is required.
+     * See {@link Ext.Container#layout} for additional information.
+     */
+    layout : 'menu',
+    hideMode : 'offsets',    // Important for laying out Components
+    scrollerHeight : 8,
+    autoLayout : true,       // Provided for backwards compat
+    defaultType : 'menuitem',
+    bufferResize : false,
+
+    initComponent : function(){
+        if(Ext.isArray(this.initialConfig)){
+            Ext.apply(this, {items:this.initialConfig});
+        }
+        this.addEvents(
+            /**
+             * @event click
+             * Fires when this menu is clicked (or when the enter key is pressed while it is active)
+             * @param {Ext.menu.Menu} this
+            * @param {Ext.menu.Item} menuItem The menu item that was clicked
+             * @param {Ext.EventObject} e
+             */
+            'click',
+            /**
+             * @event mouseover
+             * Fires when the mouse is hovering over this menu
+             * @param {Ext.menu.Menu} this
+             * @param {Ext.EventObject} e
+             * @param {Ext.menu.Item} menuItem The menu item that was clicked
+             */
+            'mouseover',
+            /**
+             * @event mouseout
+             * Fires when the mouse exits this menu
+             * @param {Ext.menu.Menu} this
+             * @param {Ext.EventObject} e
+             * @param {Ext.menu.Item} menuItem The menu item that was clicked
+             */
+            'mouseout',
+            /**
+             * @event itemclick
+             * Fires when a menu item contained in this menu is clicked
+             * @param {Ext.menu.BaseItem} baseItem The BaseItem that was clicked
+             * @param {Ext.EventObject} e
+             */
+            'itemclick'
+        );
+        Ext.menu.MenuMgr.register(this);
+        if(this.floating){
+            Ext.EventManager.onWindowResize(this.hide, this);
+        }else{
+            if(this.initialConfig.hidden !== false){
+                this.hidden = false;
+            }
+            this.internalDefaults = {hideOnClick: false};
+        }
+        Ext.menu.Menu.superclass.initComponent.call(this);
+        if(this.autoLayout){
+            var fn = this.doLayout.createDelegate(this, []);
+            this.on({
+                add: fn,
+                remove: fn
+            });
+        }
+    },
+
+    //private
+    getLayoutTarget : function() {
+        return this.ul;
+    },
+
+    // private
+    onRender : function(ct, position){
+        if(!ct){
+            ct = Ext.getBody();
+        }
+
+        var dh = {
+            id: this.getId(),
+            cls: 'x-menu ' + ((this.floating) ? 'x-menu-floating x-layer ' : '') + (this.cls || '') + (this.plain ? ' x-menu-plain' : '') + (this.showSeparator ? '' : ' x-menu-nosep'),
+            style: this.style,
+            cn: [
+                {tag: 'a', cls: 'x-menu-focus', href: '#', onclick: 'return false;', tabIndex: '-1'},
+                {tag: 'ul', cls: 'x-menu-list'}
+            ]
+        };
+        if(this.floating){
+            this.el = new Ext.Layer({
+                shadow: this.shadow,
+                dh: dh,
+                constrain: false,
+                parentEl: ct,
+                zindex: this.zIndex
+            });
+        }else{
+            this.el = ct.createChild(dh);
+        }
+        Ext.menu.Menu.superclass.onRender.call(this, ct, position);
+
+        if(!this.keyNav){
+            this.keyNav = new Ext.menu.MenuNav(this);
+        }
+        // generic focus element
+        this.focusEl = this.el.child('a.x-menu-focus');
+        this.ul = this.el.child('ul.x-menu-list');
+        this.mon(this.ul, {
+            scope: this,
+            click: this.onClick,
+            mouseover: this.onMouseOver,
+            mouseout: this.onMouseOut
+        });
+        if(this.enableScrolling){
+            this.mon(this.el, {
+                scope: this,
+                delegate: '.x-menu-scroller',
+                click: this.onScroll,
+                mouseover: this.deactivateActive
+            });
+        }
+    },
+
+    // private
+    findTargetItem : function(e){
+        var t = e.getTarget('.x-menu-list-item', this.ul, true);
+        if(t && t.menuItemId){
+            return this.items.get(t.menuItemId);
+        }
+    },
+
+    // private
+    onClick : function(e){
+        var t = this.findTargetItem(e);
+        if(t){
+            if(t.isFormField){
+                this.setActiveItem(t);
+            }else if(t instanceof Ext.menu.BaseItem){
+                if(t.menu && this.ignoreParentClicks){
+                    t.expandMenu();
+                    e.preventDefault();
+                }else if(t.onClick){
+                    t.onClick(e);
+                    this.fireEvent('click', this, t, e);
+                }
+            }
+        }
+    },
+
+    // private
+    setActiveItem : function(item, autoExpand){
+        if(item != this.activeItem){
+            this.deactivateActive();
+            if((this.activeItem = item).isFormField){
+                item.focus();
+            }else{
+                item.activate(autoExpand);
+            }
+        }else if(autoExpand){
+            item.expandMenu();
+        }
+    },
+
+    deactivateActive : function(){
+        var a = this.activeItem;
+        if(a){
+            if(a.isFormField){
+                //Fields cannot deactivate, but Combos must collapse
+                if(a.collapse){
+                    a.collapse();
+                }
+            }else{
+                a.deactivate();
+            }
+            delete this.activeItem;
+        }
+    },
+
+    // private
+    tryActivate : function(start, step){
+        var items = this.items;
+        for(var i = start, len = items.length; i >= 0 && i < len; i+= step){
+            var item = items.get(i);
+            if(!item.disabled && (item.canActivate || item.isFormField)){
+                this.setActiveItem(item, false);
+                return item;
+            }
+        }
+        return false;
+    },
+
+    // private
+    onMouseOver : function(e){
+        var t = this.findTargetItem(e);
+        if(t){
+            if(t.canActivate && !t.disabled){
+                this.setActiveItem(t, true);
+            }
+        }
+        this.over = true;
+        this.fireEvent('mouseover', this, e, t);
+    },
+
+    // private
+    onMouseOut : function(e){
+        var t = this.findTargetItem(e);
+        if(t){
+            if(t == this.activeItem && t.shouldDeactivate && t.shouldDeactivate(e)){
+                this.activeItem.deactivate();
+                delete this.activeItem;
+            }
+        }
+        this.over = false;
+        this.fireEvent('mouseout', this, e, t);
+    },
+
+    // private
+    onScroll : function(e, t){
+        if(e){
+            e.stopEvent();
+        }
+        var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top');
+        ul.scrollTop += this.scrollIncrement * (top ? -1 : 1);
+        if(top ? ul.scrollTop <= 0 : ul.scrollTop + this.activeMax >= ul.scrollHeight){
+           this.onScrollerOut(null, t);
+        }
+    },
+
+    // private
+    onScrollerIn : function(e, t){
+        var ul = this.ul.dom, top = Ext.fly(t).is('.x-menu-scroller-top');
+        if(top ? ul.scrollTop > 0 : ul.scrollTop + this.activeMax < ul.scrollHeight){
+            Ext.fly(t).addClass(['x-menu-item-active', 'x-menu-scroller-active']);
+        }
+    },
+
+    // private
+    onScrollerOut : function(e, t){
+        Ext.fly(t).removeClass(['x-menu-item-active', 'x-menu-scroller-active']);
+    },
+
+    /**
+     * If <code>{@link #floating}=true</code>, shows this menu relative to
+     * another element using {@link #showat}, otherwise uses {@link Ext.Component#show}.
+     * @param {Mixed} element The element to align to
+     * @param {String} position (optional) The {@link Ext.Element#alignTo} anchor position to use in aligning to
+     * the element (defaults to this.defaultAlign)
+     * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)
+     */
+    show : function(el, pos, parentMenu){
+        if(this.floating){
+            this.parentMenu = parentMenu;
+            if(!this.el){
+                this.render();
+                this.doLayout(false, true);
+            }
+            this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign, this.defaultOffsets), parentMenu);
+        }else{
+            Ext.menu.Menu.superclass.show.call(this);
+        }
+    },
+
+    /**
+     * Displays this menu at a specific xy position and fires the 'show' event if a
+     * handler for the 'beforeshow' event does not return false cancelling the operation.
+     * @param {Array} xyPosition Contains X & Y [x, y] values for the position at which to show the menu (coordinates are page-based)
+     * @param {Ext.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)
+     */
+    showAt : function(xy, parentMenu){
+        if(this.fireEvent('beforeshow', this) !== false){
+            this.parentMenu = parentMenu;
+            if(!this.el){
+                this.render();
+            }
+            if(this.enableScrolling){
+                // set the position so we can figure out the constrain value.
+                this.el.setXY(xy);
+                //constrain the value, keep the y coordinate the same
+                xy[1] = this.constrainScroll(xy[1]);
+                xy = [this.el.adjustForConstraints(xy)[0], xy[1]];
+            }else{
+                //constrain to the viewport.
+                xy = this.el.adjustForConstraints(xy);
+            }
+            this.el.setXY(xy);
+            this.el.show();
+            Ext.menu.Menu.superclass.onShow.call(this);
+            if(Ext.isIE){
+                // internal event, used so we don't couple the layout to the menu
+                this.fireEvent('autosize', this);
+                if(!Ext.isIE8){
+                    this.el.repaint();
+                }
+            }
+            this.hidden = false;
+            this.focus();
+            this.fireEvent('show', this);
+        }
+    },
+
+    constrainScroll : function(y){
+        var max, full = this.ul.setHeight('auto').getHeight(),
+            returnY = y, normalY, parentEl, scrollTop, viewHeight;
+        if(this.floating){
+            parentEl = Ext.fly(this.el.dom.parentNode);
+            scrollTop = parentEl.getScroll().top;
+            viewHeight = parentEl.getViewSize().height;
+            //Normalize y by the scroll position for the parent element.  Need to move it into the coordinate space
+            //of the view.
+            normalY = y - scrollTop;
+            max = this.maxHeight ? this.maxHeight : viewHeight - normalY;
+            if(full > viewHeight) {
+                max = viewHeight;
+                //Set returnY equal to (0,0) in view space by reducing y by the value of normalY
+                returnY = y - normalY;
+            } else if(max < full) {
+                returnY = y - (full - max);
+                max = full;
+            }
+        }else{
+            max = this.getHeight();
+        }
+        if(full > max && max > 0){
+            this.activeMax = max - this.scrollerHeight * 2 - this.el.getFrameWidth('tb') - Ext.num(this.el.shadowOffset, 0);
+            this.ul.setHeight(this.activeMax);
+            this.createScrollers();
+            this.el.select('.x-menu-scroller').setDisplayed('');
+        }else{
+            this.ul.setHeight(full);
+            this.el.select('.x-menu-scroller').setDisplayed('none');
+        }
+        this.ul.dom.scrollTop = 0;
+        return returnY;
+    },
+
+    createScrollers : function(){
+        if(!this.scroller){
+            this.scroller = {
+                pos: 0,
+                top: this.el.insertFirst({
+                    tag: 'div',
+                    cls: 'x-menu-scroller x-menu-scroller-top',
+                    html: '&#160;'
+                }),
+                bottom: this.el.createChild({
+                    tag: 'div',
+                    cls: 'x-menu-scroller x-menu-scroller-bottom',
+                    html: '&#160;'
+                })
+            };
+            this.scroller.top.hover(this.onScrollerIn, this.onScrollerOut, this);
+            this.scroller.topRepeater = new Ext.util.ClickRepeater(this.scroller.top, {
+                listeners: {
+                    click: this.onScroll.createDelegate(this, [null, this.scroller.top], false)
+                }
+            });
+            this.scroller.bottom.hover(this.onScrollerIn, this.onScrollerOut, this);
+            this.scroller.bottomRepeater = new Ext.util.ClickRepeater(this.scroller.bottom, {
+                listeners: {
+                    click: this.onScroll.createDelegate(this, [null, this.scroller.bottom], false)
+                }
+            });
+        }
+    },
+
+    onLayout : function(){
+        if(this.isVisible()){
+            if(this.enableScrolling){
+                this.constrainScroll(this.el.getTop());
+            }
+            if(this.floating){
+                this.el.sync();
+            }
+        }
+    },
+
+    focus : function(){
+        if(!this.hidden){
+            this.doFocus.defer(50, this);
+        }
+    },
+
+    doFocus : function(){
+        if(!this.hidden){
+            this.focusEl.focus();
+        }
+    },
+
+    /**
+     * Hides this menu and optionally all parent menus
+     * @param {Boolean} deep (optional) True to hide all parent menus recursively, if any (defaults to false)
+     */
+    hide : function(deep){
+        if (!this.isDestroyed) {
+            this.deepHide = deep;
+            Ext.menu.Menu.superclass.hide.call(this);
+            delete this.deepHide;
+        }
+    },
+
+    // private
+    onHide : function(){
+        Ext.menu.Menu.superclass.onHide.call(this);
+        this.deactivateActive();
+        if(this.el && this.floating){
+            this.el.hide();
+        }
+        var pm = this.parentMenu;
+        if(this.deepHide === true && pm){
+            if(pm.floating){
+                pm.hide(true);
+            }else{
+                pm.deactivateActive();
+            }
+        }
+    },
+
+    // private
+    lookupComponent : function(c){
+         if(Ext.isString(c)){
+            c = (c == 'separator' || c == '-') ? new Ext.menu.Separator() : new Ext.menu.TextItem(c);
+             this.applyDefaults(c);
+         }else{
+            if(Ext.isObject(c)){
+                c = this.getMenuItem(c);
+            }else if(c.tagName || c.el){ // element. Wrap it.
+                c = new Ext.BoxComponent({
+                    el: c
+                });
+            }
+         }
+         return c;
+    },
+
+    applyDefaults : function(c){
+        if(!Ext.isString(c)){
+            c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);
+            var d = this.internalDefaults;
+            if(d){
+                if(c.events){
+                    Ext.applyIf(c.initialConfig, d);
+                    Ext.apply(c, d);
+                }else{
+                    Ext.applyIf(c, d);
+                }
+            }
+        }
+        return c;
+    },
+
+    // private
+    getMenuItem : function(config){
+       if(!config.isXType){
+            if(!config.xtype && Ext.isBoolean(config.checked)){
+                return new Ext.menu.CheckItem(config)
+            }
+            return Ext.create(config, this.defaultType);
+        }
+        return config;
+    },
+
+    /**
+     * Adds a separator bar to the menu
+     * @return {Ext.menu.Item} The menu item that was added
+     */
+    addSeparator : function(){
+        return this.add(new Ext.menu.Separator());
+    },
+
+    /**
+     * Adds an {@link Ext.Element} object to the menu
+     * @param {Mixed} el The element or DOM node to add, or its id
+     * @return {Ext.menu.Item} The menu item that was added
+     */
+    addElement : function(el){
+        return this.add(new Ext.menu.BaseItem({
+            el: el
+        }));
+    },
+
+    /**
+     * Adds an existing object based on {@link Ext.menu.BaseItem} to the menu
+     * @param {Ext.menu.Item} item The menu item to add
+     * @return {Ext.menu.Item} The menu item that was added
+     */
+    addItem : function(item){
+        return this.add(item);
+    },
+
+    /**
+     * Creates a new {@link Ext.menu.Item} based an the supplied config object and adds it to the menu
+     * @param {Object} config A MenuItem config object
+     * @return {Ext.menu.Item} The menu item that was added
+     */
+    addMenuItem : function(config){
+        return this.add(this.getMenuItem(config));
+    },
+
+    /**
+     * Creates a new {@link Ext.menu.TextItem} with the supplied text and adds it to the menu
+     * @param {String} text The text to display in the menu item
+     * @return {Ext.menu.Item} The menu item that was added
+     */
+    addText : function(text){
+        return this.add(new Ext.menu.TextItem(text));
+    },
+
+    //private
+    onDestroy : function(){
+        Ext.EventManager.removeResizeListener(this.hide, this);
+        var pm = this.parentMenu;
+        if(pm && pm.activeChild == this){
+            delete pm.activeChild;
+        }
+        delete this.parentMenu;
+        Ext.menu.Menu.superclass.onDestroy.call(this);
+        Ext.menu.MenuMgr.unregister(this);
+        if(this.keyNav) {
+            this.keyNav.disable();
+        }
+        var s = this.scroller;
+        if(s){
+            Ext.destroy(s.topRepeater, s.bottomRepeater, s.top, s.bottom);
+        }
+        Ext.destroy(
+            this.el,
+            this.focusEl,
+            this.ul
+        );
+    }
+});
+
+Ext.reg('menu', Ext.menu.Menu);
+
+// MenuNav is a private utility class used internally by the Menu
+Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){
+    function up(e, m){
+        if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){
+            m.tryActivate(m.items.length-1, -1);
+        }
+    }
+    function down(e, m){
+        if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){
+            m.tryActivate(0, 1);
+        }
+    }
+    return {
+        constructor : function(menu){
+            Ext.menu.MenuNav.superclass.constructor.call(this, menu.el);
+            this.scope = this.menu = menu;
+        },
+
+        doRelay : function(e, h){
+            var k = e.getKey();
+//          Keystrokes within a form Field (e.g.: down in a Combo) do not navigate. Allow only TAB
+            if (this.menu.activeItem && this.menu.activeItem.isFormField && k != e.TAB) {
+                return false;
+            }
+            if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){
+                this.menu.tryActivate(0, 1);
+                return false;
+            }
+            return h.call(this.scope || this, e, this.menu);
+        },
+
+        tab: function(e, m) {
+            e.stopEvent();
+            if (e.shiftKey) {
+                up(e, m);
+            } else {
+                down(e, m);
+            }
+        },
+
+        up : up,
+
+        down : down,
+
+        right : function(e, m){
+            if(m.activeItem){
+                m.activeItem.expandMenu(true);
+            }
+        },
+
+        left : function(e, m){
+            m.hide();
+            if(m.parentMenu && m.parentMenu.activeItem){
+                m.parentMenu.activeItem.activate();
+            }
+        },
+
+        enter : function(e, m){
+            if(m.activeItem){
+                e.stopPropagation();
+                m.activeItem.onClick(e);
+                m.fireEvent('click', this, m.activeItem);
+                return true;
+            }
+        }
+    };
+}());
+/**
  * @class Ext.menu.MenuMgr
  * Provides a common registry of all menu items on a page so that they can be easily accessed by id.
  * @singleton
@@ -50899,7 +54619,9 @@ Ext.menu.MenuMgr = function(){
            c.each(function(m){
                m.hide();
            });
+           return true;
        }
+       return false;
    }
 
    // private
@@ -50923,7 +54645,7 @@ Ext.menu.MenuMgr = function(){
        if(m.parentMenu){
           m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3);
           m.parentMenu.activeChild = m;
-       }else if(last && last.isVisible()){
+       }else if(last && !last.isDestroyed && last.isVisible()){
           m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3);
        }
    }
@@ -50972,9 +54694,10 @@ Ext.menu.MenuMgr = function(){
 
        /**
         * Hides all menus that are currently visible
+        * @return {Boolean} success True if any active menus were hidden.
         */
        hideAll : function(){
-            hideAll();  
+            return hideAll();
        },
 
        // private
@@ -50983,18 +54706,12 @@ Ext.menu.MenuMgr = function(){
                init();
            }
            menus[menu.id] = menu;
-           menu.on("beforehide", onBeforeHide);
-           menu.on("hide", onHide);
-           menu.on("beforeshow", onBeforeShow);
-           menu.on("show", onShow);
-           var g = menu.group;
-           if(g && menu.events["checkchange"]){
-               if(!groups[g]){
-                   groups[g] = [];
-               }
-               groups[g].push(menu);
-               menu.on("checkchange", onCheck);
-           }
+           menu.on({
+               beforehide: onBeforeHide,
+               hide: onHide,
+               beforeshow: onBeforeShow,
+               show: onShow
+           });
        },
 
         /**
@@ -51025,11 +54742,6 @@ Ext.menu.MenuMgr = function(){
            menu.un("hide", onHide);
            menu.un("beforeshow", onBeforeShow);
            menu.un("show", onShow);
-           var g = menu.group;
-           if(g && menu.events["checkchange"]){
-               groups[g].remove(menu);
-               menu.un("checkchange", onCheck);
-           }
        },
 
        // private
@@ -51088,37 +54800,7 @@ Ext.menu.MenuMgr = function(){
  * @param {Object} config Configuration options
  * @xtype menubaseitem
  */
-Ext.menu.BaseItem = function(config){
-    Ext.menu.BaseItem.superclass.constructor.call(this, config);
-
-    this.addEvents(
-        /**
-         * @event click
-         * Fires when this item is clicked
-         * @param {Ext.menu.BaseItem} this
-         * @param {Ext.EventObject} e
-         */
-        'click',
-        /**
-         * @event activate
-         * Fires when this item is activated
-         * @param {Ext.menu.BaseItem} this
-         */
-        'activate',
-        /**
-         * @event deactivate
-         * Fires when this item is deactivated
-         * @param {Ext.menu.BaseItem} this
-         */
-        'deactivate'
-    );
-
-    if(this.handler){
-        this.on("click", this.handler, this.scope);
-    }
-};
-
-Ext.extend(Ext.menu.BaseItem, Ext.Component, {
+Ext.menu.BaseItem = Ext.extend(Ext.Component, {
     /**
      * @property parentMenu
      * @type Ext.menu.Menu
@@ -51158,6 +54840,34 @@ Ext.extend(Ext.menu.BaseItem, Ext.Component, {
 
     // private
     actionMode : "container",
+    
+    initComponent : function(){
+        Ext.menu.BaseItem.superclass.initComponent.call(this);
+        this.addEvents(
+               /**
+                * @event click
+                * Fires when this item is clicked
+                * @param {Ext.menu.BaseItem} this
+                * @param {Ext.EventObject} e
+                */
+               'click',
+               /**
+                * @event activate
+                * Fires when this item is activated
+                * @param {Ext.menu.BaseItem} this
+                */
+               'activate',
+               /**
+                * @event deactivate
+                * Fires when this item is deactivated
+                * @param {Ext.menu.BaseItem} this
+                */
+               'deactivate'
+           );
+           if(this.handler){
+               this.on("click", this.handler, this.scope);
+           }
+    },
 
     // private
     onRender : function(container, position){
@@ -51166,9 +54876,12 @@ Ext.extend(Ext.menu.BaseItem, Ext.Component, {
             this.parentMenu = this.ownerCt;
         }else{
             this.container.addClass('x-menu-list-item');
-            this.mon(this.el, 'click', this.onClick, this);
-            this.mon(this.el, 'mouseenter', this.activate, this);
-            this.mon(this.el, 'mouseleave', this.deactivate, this);
+            this.mon(this.el, {
+                scope: this,
+                click: this.onClick,
+                mouseenter: this.activate,
+                mouseleave: this.deactivate
+            });
         }
     },
 
@@ -51176,7 +54889,7 @@ Ext.extend(Ext.menu.BaseItem, Ext.Component, {
      * Sets the function that will handle click events for this item (equivalent to passing in the {@link #handler}
      * config property).  If an existing handler is already registered, it will be unregistered for you.
      * @param {Function} handler The function that should be called on click
-     * @param {Object} scope The scope that should be passed to the handler
+     * @param {Object} scope The scope (<code>this</code> reference) in which the handler function is executed. Defaults to this menu item.
      */
     setHandler : function(handler, scope){
         if(this.handler){
@@ -51220,8 +54933,13 @@ Ext.extend(Ext.menu.BaseItem, Ext.Component, {
 
     // private
     handleClick : function(e){
+        var pm = this.parentMenu;
         if(this.hideOnClick){
-            this.parentMenu.hide.defer(this.clickHideDelay, this.parentMenu, [true]);
+            if(pm.floating){
+                pm.hide.defer(this.clickHideDelay, pm, [true]);
+            }else{
+                pm.deactivateActive();
+            }
         }
     },
 
@@ -51241,14 +54959,7 @@ Ext.reg('menubaseitem', Ext.menu.BaseItem);/**
  * is applied as a config object (and should contain a <tt>text</tt> property).
  * @xtype menutextitem
  */
-Ext.menu.TextItem = function(cfg){
-    if(typeof cfg == 'string'){
-        cfg = {text: cfg}
-    }
-    Ext.menu.TextItem.superclass.constructor.call(this, cfg);
-};
-
-Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
+Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
     /**
      * @cfg {String} text The text to display for this item (defaults to '')
      */
@@ -51260,6 +54971,13 @@ Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
      * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
      */
     itemCls : "x-menu-text",
+    
+    constructor : function(config){
+        if(typeof config == 'string'){
+            config = {text: config}
+        }
+        Ext.menu.TextItem.superclass.constructor.call(this, config);
+    },
 
     // private
     onRender : function(){
@@ -51279,11 +54997,7 @@ Ext.reg('menutextitem', Ext.menu.TextItem);/**
  * @param {Object} config Configuration options
  * @xtype menuseparator
  */
-Ext.menu.Separator = function(config){
-    Ext.menu.Separator.superclass.constructor.call(this, config);
-};
-
-Ext.extend(Ext.menu.Separator, Ext.menu.BaseItem, {
+Ext.menu.Separator = Ext.extend(Ext.menu.BaseItem, {
     /**
      * @cfg {String} itemCls The default CSS class to use for separators (defaults to "x-menu-sep")
      */
@@ -51320,13 +55034,7 @@ Ext.reg('menuseparator', Ext.menu.Separator);/**
  * @param {Object} config Configuration options\r
  * @xtype menuitem\r
  */\r
-Ext.menu.Item = function(config){\r
-    Ext.menu.Item.superclass.constructor.call(this, config);\r
-    if(this.menu){\r
-        this.menu = Ext.menu.MenuMgr.get(this.menu);\r
-    }\r
-};\r
-Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, {\r
+Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {\r
     /**\r
      * @property menu\r
      * @type Ext.menu.Menu\r
@@ -51371,6 +55079,14 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, {
     // private\r
     ctype: 'Ext.menu.Item',\r
 \r
+    initComponent : function(){\r
+        Ext.menu.Item.superclass.initComponent.call(this);\r
+        if(this.menu){\r
+            this.menu = Ext.menu.MenuMgr.get(this.menu);\r
+            this.menu.ownerCt = this;\r
+        }\r
+    },\r
+\r
     // private\r
     onRender : function(container, position){\r
         if (!this.itemTpl) {\r
@@ -51389,6 +55105,9 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, {
         this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true);\r
         this.iconEl = this.el.child('img.x-menu-item-icon');\r
         this.textEl = this.el.child('.x-menu-item-text');\r
+        if(!this.href) { // if no link defined, prevent the default anchor event\r
+            this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true });\r
+        }\r
         Ext.menu.Item.superclass.onRender.call(this, container, position);\r
     },\r
 \r
@@ -51427,10 +55146,11 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, {
             this.iconEl.replaceClass(oldCls, this.iconCls);\r
         }\r
     },\r
-    \r
+\r
     //private\r
     beforeDestroy: function(){\r
         if (this.menu){\r
+            delete this.menu.ownerCt;\r
             this.menu.destroy();\r
         }\r
         Ext.menu.Item.superclass.beforeDestroy.call(this);\r
@@ -51522,37 +55242,7 @@ Ext.reg('menuitem', Ext.menu.Item);/**
  * @param {Object} config Configuration options
  * @xtype menucheckitem
  */
-Ext.menu.CheckItem = function(config){
-    Ext.menu.CheckItem.superclass.constructor.call(this, config);
-    this.addEvents(
-        /**
-         * @event beforecheckchange
-         * Fires before the checked value is set, providing an opportunity to cancel if needed
-         * @param {Ext.menu.CheckItem} this
-         * @param {Boolean} checked The new checked value that will be set
-         */
-        "beforecheckchange" ,
-        /**
-         * @event checkchange
-         * Fires after the checked value has been set
-         * @param {Ext.menu.CheckItem} this
-         * @param {Boolean} checked The checked value that was set
-         */
-        "checkchange"
-    );
-    /**
-     * A function that handles the checkchange event.  The function is undefined by default, but if an implementation
-     * is provided, it will be called automatically when the checkchange event fires.
-     * @param {Ext.menu.CheckItem} this
-     * @param {Boolean} checked The checked value that was set
-     * @method checkHandler
-     */
-    if(this.checkHandler){
-        this.on('checkchange', this.checkHandler, this.scope);
-    }
-    Ext.menu.MenuMgr.registerCheckable(this);
-};
-Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, {
+Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
     /**
      * @cfg {String} group
      * All check items with the same group name will automatically be grouped into a single-select
@@ -51576,6 +55266,37 @@ Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, {
 
     // private
     ctype: "Ext.menu.CheckItem",
+    
+    initComponent : function(){
+        Ext.menu.CheckItem.superclass.initComponent.call(this);
+           this.addEvents(
+               /**
+                * @event beforecheckchange
+                * Fires before the checked value is set, providing an opportunity to cancel if needed
+                * @param {Ext.menu.CheckItem} this
+                * @param {Boolean} checked The new checked value that will be set
+                */
+               "beforecheckchange" ,
+               /**
+                * @event checkchange
+                * Fires after the checked value has been set
+                * @param {Ext.menu.CheckItem} this
+                * @param {Boolean} checked The checked value that was set
+                */
+               "checkchange"
+           );
+           /**
+            * A function that handles the checkchange event.  The function is undefined by default, but if an implementation
+            * is provided, it will be called automatically when the checkchange event fires.
+            * @param {Ext.menu.CheckItem} this
+            * @param {Boolean} checked The checked value that was set
+            * @method checkHandler
+            */
+           if(this.checkHandler){
+               this.on('checkchange', this.checkHandler, this.scope);
+           }
+           Ext.menu.MenuMgr.registerCheckable(this);
+    },
 
     // private
     onRender : function(c){
@@ -51601,12 +55322,13 @@ Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, {
      * @param {Boolean} suppressEvent (optional) True to prevent the checkchange event from firing (defaults to false)
      */
     setChecked : function(state, suppressEvent){
-        if(this.checked != state && this.fireEvent("beforecheckchange", this, state) !== false){
+        var suppress = suppressEvent === true;
+        if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
             if(this.container){
                 this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
             }
             this.checked = state;
-            if(suppressEvent !== true){
+            if(!suppress){
                 this.fireEvent("checkchange", this, state);
             }
         }
@@ -51623,7 +55345,15 @@ Ext.extend(Ext.menu.CheckItem, Ext.menu.Item, {
 Ext.reg('menucheckitem', Ext.menu.CheckItem);/**\r
  * @class Ext.menu.DateMenu\r
  * @extends Ext.menu.Menu\r
- * A menu containing a {@link Ext.DatePicker} Component.\r
+ * <p>A menu containing an {@link Ext.DatePicker} Component.</p>\r
+ * <p>Notes:</p><div class="mdetail-params"><ul>\r
+ * <li>Although not listed here, the <b>constructor</b> for this class\r
+ * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>\r
+ * <li>If subclassing DateMenu, any configuration options for the DatePicker must be\r
+ * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.\r
+ * Applying {@link Ext.DatePicker DatePicker} configuration settings to\r
+ * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>\r
+ * </ul></div>\r
  * @xtype datemenu\r
  */\r
  Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {\r
@@ -51631,13 +55361,31 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
      * @cfg {Boolean} enableScrolling\r
      * @hide \r
      */\r
-    enableScrolling: false,\r
-    \r
+    enableScrolling : false,\r
+    /**\r
+     * @cfg {Function} handler\r
+     * Optional. A function that will handle the select event of this menu.\r
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>\r
+     * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>\r
+     * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>\r
+     * </ul></div>\r
+     */\r
+    /**\r
+     * @cfg {Object} scope\r
+     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>\r
+     * function will be called.  Defaults to this DateMenu instance.\r
+     */    \r
     /** \r
      * @cfg {Boolean} hideOnClick\r
      * False to continue showing the menu after a date is selected, defaults to true.\r
      */\r
-    hideOnClick: true,\r
+    hideOnClick : true,\r
+    \r
+    /** \r
+     * @cfg {String} pickerId\r
+     * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.\r
+     */\r
+    pickerId : null,\r
     \r
     /** \r
      * @cfg {Number} maxHeight\r
@@ -51648,11 +55396,11 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
      * @hide \r
      */\r
     /**\r
+     * The {@link Ext.DatePicker} instance for this DateMenu\r
      * @property picker\r
      * @type DatePicker\r
-     * The {@link Ext.DatePicker} instance for this DateMenu\r
      */\r
-    cls: 'x-date-menu',\r
+    cls : 'x-date-menu',\r
     \r
     /**\r
      * @event click\r
@@ -51664,7 +55412,7 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
      * @hide\r
      */\r
 \r
-    initComponent: function(){\r
+    initComponent : function(){\r
         this.on('beforeshow', this.onBeforeShow, this);\r
         if(this.strict = (Ext.isIE7 && Ext.isStrict)){\r
             this.on('show', this.onShow, this, {single: true, delay: 20});\r
@@ -51672,41 +55420,58 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
         Ext.apply(this, {\r
             plain: true,\r
             showSeparator: false,\r
-            items: this.picker = new Ext.DatePicker(Ext.apply({\r
+            items: this.picker = new Ext.DatePicker(Ext.applyIf({\r
                 internalRender: this.strict || !Ext.isIE,\r
-                ctCls: 'x-menu-date-item'\r
+                ctCls: 'x-menu-date-item',\r
+                id: this.pickerId\r
             }, this.initialConfig))\r
         });\r
         this.picker.purgeListeners();\r
         Ext.menu.DateMenu.superclass.initComponent.call(this);\r
-        this.relayEvents(this.picker, ["select"]);\r
+        /**\r
+         * @event select\r
+         * Fires when a date is selected from the {@link #picker Ext.DatePicker}\r
+         * @param {DatePicker} picker The {@link #picker Ext.DatePicker}\r
+         * @param {Date} date The selected date\r
+         */\r
+        this.relayEvents(this.picker, ['select']);\r
+        this.on('show', this.picker.focus, this.picker);\r
         this.on('select', this.menuHide, this);\r
         if(this.handler){\r
             this.on('select', this.handler, this.scope || this);\r
         }\r
     },\r
 \r
-    menuHide: function() {\r
+    menuHide : function() {\r
         if(this.hideOnClick){\r
             this.hide(true);\r
         }\r
     },\r
 \r
-    onBeforeShow: function(){\r
+    onBeforeShow : function(){\r
         if(this.picker){\r
             this.picker.hideMonthPicker(true);\r
         }\r
     },\r
 \r
-    onShow: function(){\r
+    onShow : function(){\r
         var el = this.picker.getEl();\r
         el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode\r
     }\r
  });\r
- Ext.reg('datemenu', Ext.menu.DateMenu);/**\r
+ Ext.reg('datemenu', Ext.menu.DateMenu);\r
+ /**\r
  * @class Ext.menu.ColorMenu\r
  * @extends Ext.menu.Menu\r
- * A menu containing a {@link Ext.ColorPalette} Component.\r
+ * <p>A menu containing a {@link Ext.ColorPalette} Component.</p>\r
+ * <p>Notes:</p><div class="mdetail-params"><ul>\r
+ * <li>Although not listed here, the <b>constructor</b> for this class\r
+ * accepts all of the configuration options of <b>{@link Ext.ColorPalette}</b>.</li>\r
+ * <li>If subclassing ColorMenu, any configuration options for the ColorPalette must be\r
+ * applied to the <tt><b>initialConfig</b></tt> property of the ColorMenu.\r
+ * Applying {@link Ext.ColorPalette ColorPalette} configuration settings to\r
+ * <b><tt>this</tt></b> will <b>not</b> affect the ColorPalette's configuration.</li>\r
+ * </ul></div> * \r
  * @xtype colormenu\r
  */\r
  Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {\r
@@ -51714,13 +55479,34 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
      * @cfg {Boolean} enableScrolling\r
      * @hide \r
      */\r
-    enableScrolling: false,\r
+    enableScrolling : false,\r
+    /**\r
+     * @cfg {Function} handler\r
+     * Optional. A function that will handle the select event of this menu.\r
+     * The handler is passed the following parameters:<div class="mdetail-params"><ul>\r
+     * <li><code>palette</code> : ColorPalette<div class="sub-desc">The {@link #palette Ext.ColorPalette}.</div></li>\r
+     * <li><code>color</code> : String<div class="sub-desc">The 6-digit color hex code (without the # symbol).</div></li>\r
+     * </ul></div>\r
+     */\r
+    /**\r
+     * @cfg {Object} scope\r
+     * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>\r
+     * function will be called.  Defaults to this ColorMenu instance.\r
+     */    \r
     \r
     /** \r
      * @cfg {Boolean} hideOnClick\r
      * False to continue showing the menu after a color is selected, defaults to true.\r
      */\r
-    hideOnClick: true,\r
+    hideOnClick : true,\r
+    \r
+    cls : 'x-color-menu',\r
+    \r
+    /** \r
+     * @cfg {String} paletteId\r
+     * An id to assign to the underlying color palette. Defaults to <tt>null</tt>.\r
+     */\r
+    paletteId : null,\r
     \r
     /** \r
      * @cfg {Number} maxHeight\r
@@ -51747,28 +55533,37 @@ Ext.reg('menucheckitem', Ext.menu.CheckItem);/**
      * @hide\r
      */\r
     \r
-    initComponent: function(){\r
+    initComponent : function(){\r
         Ext.apply(this, {\r
             plain: true,\r
             showSeparator: false,\r
-            items: this.palette = new Ext.ColorPalette(this.initialConfig)\r
+            items: this.palette = new Ext.ColorPalette(Ext.applyIf({\r
+                id: this.paletteId\r
+            }, this.initialConfig))\r
         });\r
         this.palette.purgeListeners();\r
         Ext.menu.ColorMenu.superclass.initComponent.call(this);\r
+        /**\r
+         * @event select\r
+         * Fires when a color is selected from the {@link #palette Ext.ColorPalette}\r
+         * @param {Ext.ColorPalette} palette The {@link #palette Ext.ColorPalette}\r
+            * @param {String} color The 6-digit color hex code (without the # symbol)\r
+         */\r
         this.relayEvents(this.palette, ['select']);\r
         this.on('select', this.menuHide, this);\r
         if(this.handler){\r
-            this.on('select', this.handler, this.scope || this)\r
+            this.on('select', this.handler, this.scope || this);\r
         }\r
     },\r
 \r
-    menuHide: function(){\r
+    menuHide : function(){\r
         if(this.hideOnClick){\r
             this.hide(true);\r
         }\r
     }\r
 });\r
-Ext.reg('colormenu', Ext.menu.ColorMenu);/**
+Ext.reg('colormenu', Ext.menu.ColorMenu);\r
+/**
  * @class Ext.form.Field
  * @extends Ext.BoxComponent
  * Base class for form fields that provides default event handling, sizing, value handling and other functionality.
@@ -51778,9 +55573,15 @@ Ext.reg('colormenu', Ext.menu.ColorMenu);/**
  * @xtype field
  */
 Ext.form.Field = Ext.extend(Ext.BoxComponent,  {
+    /**
+     * <p>The label Element associated with this Field. <b>Only available after this Field has been rendered by a
+     * {@link form Ext.layout.FormLayout} layout manager.</b></p>
+     * @type Ext.Element
+     * @property label
+     */
     /**
      * @cfg {String} inputType The type attribute for input fields -- e.g. radio, text, password, file (defaults
-     * to "text"). The types "file" and "password" must be used to render those field types currently -- there are
+     * to 'text'). The types 'file' and 'password' must be used to render those field types currently -- there are
      * no separate Ext components for those. Note that if you use <tt>inputType:'file'</tt>, {@link #emptyText}
      * is not supported and should be avoided.
      */
@@ -51792,32 +55593,37 @@ Ext.form.Field = Ext.extend(Ext.BoxComponent,  {
      * @cfg {Mixed} value A value to initialize this field with (defaults to undefined).
      */
     /**
-     * @cfg {String} name The field's HTML name attribute (defaults to "").
+     * @cfg {String} name The field's HTML name attribute (defaults to '').
      * <b>Note</b>: this property must be set if this field is to be automatically included with
      * {@link Ext.form.BasicForm#submit form submit()}.
      */
     /**
-     * @cfg {String} cls A custom CSS class to apply to the field's underlying element (defaults to "").
+     * @cfg {String} cls A custom CSS class to apply to the field's underlying element (defaults to '').
      */
 
     /**
-     * @cfg {String} invalidClass The CSS class to use when marking a field invalid (defaults to "x-form-invalid")
+     * @cfg {String} invalidClass The CSS class to use when marking a field invalid (defaults to 'x-form-invalid')
      */
-    invalidClass : "x-form-invalid",
+    invalidClass : 'x-form-invalid',
     /**
      * @cfg {String} invalidText The error text to use when marking a field invalid and no message is provided
-     * (defaults to "The value in this field is invalid")
+     * (defaults to 'The value in this field is invalid')
      */
-    invalidText : "The value in this field is invalid",
+    invalidText : 'The value in this field is invalid',
     /**
-     * @cfg {String} focusClass The CSS class to use when the field receives focus (defaults to "x-form-focus")
+     * @cfg {String} focusClass The CSS class to use when the field receives focus (defaults to 'x-form-focus')
+     */
+    focusClass : 'x-form-focus',
+    /**
+     * @cfg {Boolean} preventMark
+     * <tt>true</tt> to disable {@link #markInvalid marking the field invalid}.
+     * Defaults to <tt>false</tt>.
      */
-    focusClass : "x-form-focus",
     /**
      * @cfg {String/Boolean} validationEvent The event that should initiate field validation. Set to false to disable
-      automatic validation (defaults to "keyup").
+      automatic validation (defaults to 'keyup').
      */
-    validationEvent : "keyup",
+    validationEvent : 'keyup',
     /**
      * @cfg {Boolean} validateOnBlur Whether the field should validate when it loses focus (defaults to true).
      */
@@ -51831,25 +55637,24 @@ Ext.form.Field = Ext.extend(Ext.BoxComponent,  {
      * @cfg {String/Object} autoCreate <p>A {@link Ext.DomHelper DomHelper} element spec, or true for a default
      * element spec. Used to create the {@link Ext.Component#getEl Element} which will encapsulate this Component.
      * See <tt>{@link Ext.Component#autoEl autoEl}</tt> for details.  Defaults to:</p>
-     * <pre><code>{tag: "input", type: "text", size: "20", autocomplete: "off"}</code></pre>
+     * <pre><code>{tag: 'input', type: 'text', size: '20', autocomplete: 'off'}</code></pre>
      */
-    defaultAutoCreate : {tag: "input", type: "text", size: "20", autocomplete: "off"},
+    defaultAutoCreate : {tag: 'input', type: 'text', size: '20', autocomplete: 'off'},
     /**
-     * @cfg {String} fieldClass The default CSS class for the field (defaults to "x-form-field")
+     * @cfg {String} fieldClass The default CSS class for the field (defaults to 'x-form-field')
      */
-    fieldClass : "x-form-field",
+    fieldClass : 'x-form-field',
     /**
-     * @cfg {String} msgTarget The location where error text should display.  Should be one of the following values
-     * (defaults to 'qtip'):
-     *<pre>
-Value         Description
------------   ----------------------------------------------------------------------
-qtip          Display a quick tip when the user hovers over the field
-title         Display a default browser title attribute popup
-under         Add a block div beneath the field containing the error text
-side          Add an error icon to the right of the field with a popup on hover
-[element id]  Add the error text directly to the innerHTML of the specified element
-</pre>
+     * @cfg {String} msgTarget<p>The location where the message text set through {@link #markInvalid} should display.
+     * Must be one of the following values:</p>
+     * <div class="mdetail-params"><ul>
+     * <li><code>qtip</code> Display a quick tip containing the message when the user hovers over the field. This is the default.
+     * <div class="subdesc"><b>{@link Ext.QuickTips#init Ext.QuickTips.init} must have been called for this setting to work.</b></div</li>
+     * <li><code>title</code> Display the message in a default browser title attribute popup.</li>
+     * <li><code>under</code> Add a block div beneath the field containing the error message.</li>
+     * <li><code>side</code> Add an error icon to the right of the field, displaying the message in a popup on hover.</li>
+     * <li><code>[element id]</code> Add the error message directly to the innerHTML of the specified element.</li>
+     * </ul></div>
      */
     msgTarget : 'qtip',
     /**
@@ -51873,10 +55678,18 @@ side          Add an error icon to the right of the field with a popup on hover
      * disabled Fields will not be {@link Ext.form.BasicForm#submit submitted}.</p>
      */
     disabled : false,
+    /**
+     * @cfg {Boolean} submitValue False to clear the name attribute on the field so that it is not submitted during a form post.
+     * Defaults to <tt>true</tt>.
+     */
+    submitValue: true,
 
     // private
     isFormField : true,
 
+    // private
+    msgDisplay: '',
+
     // private
     hasFocus : false,
 
@@ -51957,9 +55770,9 @@ var form = new Ext.form.FormPanel({
     /**
      * Returns the {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName}
      * attribute of the field if available.
-     * @return {String} name The field {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName}  
+     * @return {String} name The field {@link Ext.form.Field#name name} or {@link Ext.form.ComboBox#hiddenName hiddenName}
      */
-    getName: function(){
+    getName : function(){
         return this.rendered && this.el.dom.name ? this.el.dom.name : this.name || this.id || '';
     },
 
@@ -51977,7 +55790,9 @@ var form = new Ext.form.FormPanel({
             this.autoEl = cfg;
         }
         Ext.form.Field.superclass.onRender.call(this, ct, position);
-        
+        if(this.submitValue === false){
+            this.el.dom.removeAttribute('name');
+        }
         var type = this.el.dom.type;
         if(type){
             if(type == 'password'){
@@ -51986,7 +55801,7 @@ var form = new Ext.form.FormPanel({
             this.el.addClass('x-form-'+type);
         }
         if(this.readOnly){
-            this.el.dom.readOnly = true;
+            this.setReadOnly(true);
         }
         if(this.tabIndex !== undefined){
             this.el.dom.setAttribute('tabIndex', this.tabIndex);
@@ -51997,7 +55812,7 @@ var form = new Ext.form.FormPanel({
 
     // private
     getItemCt : function(){
-        return this.el.up('.x-form-item', 4);
+        return this.itemCt;
     },
 
     // private
@@ -52034,6 +55849,17 @@ var form = new Ext.form.FormPanel({
         return String(this.getValue()) !== String(this.originalValue);
     },
 
+    /**
+     * Sets the read only state of this field.
+     * @param {Boolean} readOnly Whether the field should be read only.
+     */
+    setReadOnly : function(readOnly){
+        if(this.rendered){
+            this.el.dom.readOnly = readOnly;
+        }
+        this.readOnly = readOnly;
+    },
+
     // private
     afterRender : function(){
         Ext.form.Field.superclass.afterRender.call(this);
@@ -52044,7 +55870,7 @@ var form = new Ext.form.FormPanel({
     // private
     fireKey : function(e){
         if(e.isSpecialKey()){
-            this.fireEvent("specialkey", this, e);
+            this.fireEvent('specialkey', this, e);
         }
     },
 
@@ -52059,23 +55885,34 @@ var form = new Ext.form.FormPanel({
 
     // private
     initEvents : function(){
-        this.mon(this.el, Ext.EventManager.useKeydown ? "keydown" : "keypress", this.fireKey,  this);
+        this.mon(this.el, Ext.EventManager.useKeydown ? 'keydown' : 'keypress', this.fireKey,  this);
         this.mon(this.el, 'focus', this.onFocus, this);
 
-        // fix weird FF/Win editor issue when changing OS window focus
-        var o = this.inEditor && Ext.isWindows && Ext.isGecko ? {buffer:10} : null;
-        this.mon(this.el, 'blur', this.onBlur, this, o);
+        // standardise buffer across all browsers + OS-es for consistent event order.
+        // (the 10ms buffer for Editors fixes a weird FF/Win editor issue when changing OS window focus)
+        this.mon(this.el, 'blur', this.onBlur, this, this.inEditor ? {buffer:10} : null);
     },
 
+    // private
+    preFocus: Ext.emptyFn,
+
     // private
     onFocus : function(){
+        this.preFocus();
         if(this.focusClass){
             this.el.addClass(this.focusClass);
         }
         if(!this.hasFocus){
             this.hasFocus = true;
+            /**
+             * <p>The value that the Field had at the time it was last focused. This is the value that is passed
+             * to the {@link #change} event which is fired if the value has been changed when the Field is blurred.</p>
+             * <p><b>This will be undefined until the Field has been visited.</b> Compare {@link #originalValue}.</p>
+             * @type mixed
+             * @property startValue
+             */
             this.startValue = this.getValue();
-            this.fireEvent("focus", this);
+            this.fireEvent('focus', this);
         }
     },
 
@@ -52089,18 +55926,24 @@ var form = new Ext.form.FormPanel({
             this.el.removeClass(this.focusClass);
         }
         this.hasFocus = false;
-        if(this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur"){
+        if(this.validationEvent !== false && (this.validateOnBlur || this.validationEvent == 'blur')){
             this.validate();
         }
         var v = this.getValue();
         if(String(v) !== String(this.startValue)){
             this.fireEvent('change', this, v, this.startValue);
         }
-        this.fireEvent("blur", this);
+        this.fireEvent('blur', this);
+        this.postBlur();
     },
 
+    // private
+    postBlur : Ext.emptyFn,
+
     /**
-     * Returns whether or not the field value is currently valid
+     * Returns whether or not the field value is currently valid by
+     * {@link #validateValue validating} the {@link #processValue processed value}
+     * of the field. <b>Note</b>: {@link #disabled} fields are ignored.
      * @param {Boolean} preventMark True to disable marking the field invalid
      * @return {Boolean} True if the value is valid, else false
      */
@@ -52127,20 +55970,41 @@ var form = new Ext.form.FormPanel({
         return false;
     },
 
-    // protected - should be overridden by subclasses if necessary to prepare raw values for validation
+    /**
+     * This method should only be overridden if necessary to prepare raw values
+     * for validation (see {@link #validate} and {@link #isValid}).  This method
+     * is expected to return the processed value for the field which will
+     * be used for validation (see validateValue method).
+     * @param {Mixed} value
+     */
     processValue : function(value){
         return value;
     },
 
-    // private
-    // Subclasses should provide the validation implementation by overriding this
+    /**
+     * @private
+     * Subclasses should provide the validation implementation by overriding this
+     * @param {Mixed} value
+     */
     validateValue : function(value){
         return true;
     },
 
     /**
-     * Mark this field as invalid, using {@link #msgTarget} to determine how to display the error and
-     * applying {@link #invalidClass} to the field's element.
+     * Gets the active error message for this field.
+     * @return {String} Returns the active error message on the field, if there is no error, an empty string is returned.
+     */
+    getActiveError : function(){
+        return this.activeError || '';
+    },
+
+    /**
+     * <p>Display an error message associated with this field, using {@link #msgTarget} to determine how to
+     * display the message and applying {@link #invalidClass} to the field's UI element.</p>
+     * <p><b>Note</b>: this method does not cause the Field's {@link #validate} method to return <code>false</code>
+     * if the value does <i>pass</i> validation. So simply marking a Field as invalid will not prevent
+     * submission of forms submitted with the {@link Ext.form.Action.Submit#clientValidation} option set.</p>
+     * {@link #isValid invalid}.
      * @param {String} msg (optional) The validation message (defaults to {@link #invalidText})
      */
     markInvalid : function(msg){
@@ -52160,6 +56024,7 @@ var form = new Ext.form.FormPanel({
                 t.style.display = this.msgDisplay;
             }
         }
+        this.activeError = msg;
         this.fireEvent('invalid', this, msg);
     },
 
@@ -52182,6 +56047,7 @@ var form = new Ext.form.FormPanel({
                 t.style.display = 'none';
             }
         }
+        delete this.activeError;
         this.fireEvent('valid', this);
     },
 
@@ -52196,7 +56062,12 @@ var form = new Ext.form.FormPanel({
             this.el.findParent('.x-form-field-wrap', 5, true);   // else direct field wrap
     },
 
-    // private
+    // Alignment for 'under' target
+    alignErrorEl : function(){
+        this.errorEl.setWidth(this.getErrorCt().getWidth(true) - 20);
+    },
+
+    // Alignment for 'side' target
     alignErrorIcon : function(){
         this.errorIcon.alignTo(this.el, 'tl-tr', [2, 0]);
     },
@@ -52234,7 +56105,7 @@ var form = new Ext.form.FormPanel({
      * @return {Mixed} value The field value that is set
      */
     setRawValue : function(v){
-        return (this.el.dom.value = (Ext.isEmpty(v) ? '' : v));
+        return this.rendered ? (this.el.dom.value = (Ext.isEmpty(v) ? '' : v)) : '';
     },
 
     /**
@@ -52254,26 +56125,6 @@ var form = new Ext.form.FormPanel({
     // private, does not work for all fields
     append : function(v){
          this.setValue([this.getValue(), v].join(''));
-    },
-
-    // private
-    adjustSize : function(w, h){
-        var s = Ext.form.Field.superclass.adjustSize.call(this, w, h);
-        s.width = this.adjustWidth(this.el.dom.tagName, s.width);
-        if(this.offsetCt){
-            var ct = this.getItemCt();
-            s.width -= ct.getFrameWidth('lr');
-            s.height -= ct.getFrameWidth('tb');
-        }
-        return s;
-    },
-
-    // private
-    adjustWidth : function(tag, w){
-        if(typeof w == 'number' && (Ext.isIE && (Ext.isIE6 || !Ext.isStrict)) && /input|textarea/i.test(tag) && !this.inEditor){
-            return w - 3;
-        }
-        return w;
     }
 
     /**
@@ -52323,8 +56174,12 @@ Ext.form.MessageTargets = {
                     return;
                 }
                 field.errorEl = elp.createChild({cls:'x-form-invalid-msg'});
-                field.errorEl.setWidth(elp.getWidth(true)-20);
+                field.on('resize', field.alignErrorEl, field);
+                field.on('destroy', function(){
+                    Ext.destroy(this.errorEl);
+                }, field);
             }
+            field.alignErrorEl();
             field.errorEl.update(msg);
             Ext.form.Field.msgFx[field.msgFx].show(field.errorEl, field);
         },
@@ -52347,19 +56202,21 @@ Ext.form.MessageTargets = {
                     return;
                 }
                 field.errorIcon = elp.createChild({cls:'x-form-invalid-icon'});
+                field.on('resize', field.alignErrorIcon, field);
+                field.on('destroy', function(){
+                    Ext.destroy(this.errorIcon);
+                }, field);
             }
             field.alignErrorIcon();
             field.errorIcon.dom.qtip = msg;
             field.errorIcon.dom.qclass = 'x-form-invalid-tip';
             field.errorIcon.show();
-            field.on('resize', field.alignErrorIcon, field);
         },
         clear: function(field){
             field.el.removeClass(field.invalidClass);
             if(field.errorIcon){
                 field.errorIcon.dom.qtip = '';
                 field.errorIcon.hide();
-                field.un('resize', field.alignErrorIcon, field);
             }else{
                 field.el.dom.title = '';
             }
@@ -52409,44 +56266,10 @@ Ext.reg('field', Ext.form.Field);
  * or as the base class for more sophisticated input controls (like {@link Ext.form.TextArea}
  * and {@link Ext.form.ComboBox}).</p>
  * <p><b><u>Validation</u></b></p>
- * <p>Field validation is processed in a particular order.  If validation fails at any particular
- * step the validation routine halts.</p>
+ * <p>The validation procedure is described in the documentation for {@link #validateValue}.</p>
+ * <p><b><u>Alter Validation Behavior</u></b></p>
+ * <p>Validation behavior for each field can be configured:</p>
  * <div class="mdetail-params"><ul>
- * <li><b>1. Field specific validator</b>
- * <div class="sub-desc">
- * <p>If a field is configured with a <code>{@link Ext.form.TextField#validator validator}</code> function,
- * it will be passed the current field value.  The <code>{@link Ext.form.TextField#validator validator}</code>
- * function is expected to return boolean <tt>true</tt> if the value is valid or return a string to
- * represent the invalid message if invalid.</p>
- * </div></li>
- * <li><b>2. Built in Validation</b>
- * <div class="sub-desc">
- * <p>Basic validation is affected with the following configuration properties:</p>
- * <pre>
- * <u>Validation</u>    <u>Invalid Message</u>
- * <code>{@link Ext.form.TextField#allowBlank allowBlank}    {@link Ext.form.TextField#emptyText emptyText}</code>
- * <code>{@link Ext.form.TextField#minLength minLength}     {@link Ext.form.TextField#minLengthText minLengthText}</code>
- * <code>{@link Ext.form.TextField#maxLength maxLength}     {@link Ext.form.TextField#maxLengthText maxLengthText}</code>
- * </pre>
- * </div></li>
- * <li><b>3. Preconfigured Validation Types (VTypes)</b>
- * <div class="sub-desc">
- * <p>Using VTypes offers a convenient way to reuse validation. If a field is configured with a
- * <code>{@link Ext.form.TextField#vtype vtype}</code>, the corresponding {@link Ext.form.VTypes VTypes}
- * validation function will be used for validation.  If invalid, either the field's
- * <code>{@link Ext.form.TextField#vtypeText vtypeText}</code> or the VTypes vtype Text property will be
- * used for the invalid message.  Keystrokes on the field will be filtered according to the VTypes
- * vtype Mask property.</p>
- * </div></li>
- * <li><b>4. Field specific regex test</b>
- * <div class="sub-desc">
- * <p>Each field may also specify a <code>{@link Ext.form.TextField#regex regex}</code> test.
- * The invalid message for this test is configured with
- * <code>{@link Ext.form.TextField#regexText regexText}</code>.</p>
- * </div></li>
- * <li><b>Alter Validation Behavior</b>
- * <div class="sub-desc">
- * <p>Validation behavior for each field can be configured:</p><ul>
  * <li><code>{@link Ext.form.TextField#invalidText invalidText}</code> : the default validation message to
  * show if any validation step above does not provide a message when invalid</li>
  * <li><code>{@link Ext.form.TextField#maskRe maskRe}</code> : filter out keystrokes before any validation occurs</li>
@@ -52456,12 +56279,11 @@ Ext.reg('field', Ext.form.Field);
  * <li><code>{@link Ext.form.Field#validateOnBlur validateOnBlur}</code>,
  * <code>{@link Ext.form.Field#validationDelay validationDelay}</code>, and
  * <code>{@link Ext.form.Field#validationEvent validationEvent}</code> : modify how/when validation is triggered</li>
- * </ul>
- * </div></li>
  * </ul></div>
- * @constructor
- * Creates a new TextField
+ * 
+ * @constructor Creates a new TextField
  * @param {Object} config Configuration options
+ * 
  * @xtype textfield
  */
 Ext.form.TextField = Ext.extend(Ext.form.Field,  {
@@ -52549,11 +56371,22 @@ var myField = new Ext.form.NumberField({
      */
     blankText : 'This field is required',
     /**
-     * @cfg {Function} validator A custom validation function to be called during field validation
+     * @cfg {Function} validator
+     * <p>A custom validation function to be called during field validation ({@link #validateValue})
      * (defaults to <tt>null</tt>). If specified, this function will be called first, allowing the
-     * developer to override the default validation process. This function will be passed the current
-     * field value and expected to return boolean <tt>true</tt> if the value is valid or a string
-     * error message if invalid.
+     * developer to override the default validation process.</p>
+     * <br><p>This function will be passed the following Parameters:</p>
+     * <div class="mdetail-params"><ul>
+     * <li><code>value</code>: <i>Mixed</i>
+     * <div class="sub-desc">The current field value</div></li>
+     * </ul></div>
+     * <br><p>This function is to Return:</p>
+     * <div class="mdetail-params"><ul>
+     * <li><code>true</code>: <i>Boolean</i>
+     * <div class="sub-desc"><code>true</code> if the value is valid</div></li>
+     * <li><code>msg</code>: <i>String</i>
+     * <div class="sub-desc">An error message if the value is invalid</div></li>
+     * </ul></div>
      */
     validator : null,
     /**
@@ -52632,22 +56465,13 @@ var myField = new Ext.form.NumberField({
             this.validationTask = new Ext.util.DelayedTask(this.validate, this);
             this.mon(this.el, 'keyup', this.filterValidation, this);
         }
-        else if(this.validationEvent !== false){
+        else if(this.validationEvent !== false && this.validationEvent != 'blur'){
                this.mon(this.el, this.validationEvent, this.validate, this, {buffer: this.validationDelay});
         }
-        if(this.selectOnFocus || this.emptyText){
-            this.on('focus', this.preFocus, this);
-            
-            this.mon(this.el, 'mousedown', function(){
-                if(!this.hasFocus){
-                    this.el.on('mouseup', function(e){
-                        e.preventDefault();
-                    }, this, {single:true});
-                }
-            }, this);
+        if(this.selectOnFocus || this.emptyText){            
+            this.mon(this.el, 'mousedown', this.onMouseDown, this);
             
             if(this.emptyText){
-                this.on('blur', this.postBlur, this);
                 this.applyEmptyText();
             }
         }
@@ -52659,9 +56483,18 @@ var myField = new Ext.form.NumberField({
                        this.mon(this.el, 'click', this.autoSize, this);
         }
         if(this.enableKeyEvents){
-               this.mon(this.el, 'keyup', this.onKeyUp, this);
-               this.mon(this.el, 'keydown', this.onKeyDown, this);
-               this.mon(this.el, 'keypress', this.onKeyPress, this);
+            this.mon(this.el, {
+                scope: this,
+                keyup: this.onKeyUp,
+                keydown: this.onKeyDown,
+                keypress: this.onKeyPress
+            });
+        }
+    },
+    
+    onMouseDown: function(e){
+        if(!this.hasFocus){
+            this.mon(this.el, 'mouseup', Ext.emptyFn, this, { single: true, preventDefault: true });
         }
     },
 
@@ -52700,10 +56533,15 @@ var myField = new Ext.form.NumberField({
 
     // private
     onKeyUpBuffered : function(e){
-        if(!e.isNavKeyPress()){
+        if(this.doAutoSize(e)){
             this.autoSize();
         }
     },
+    
+    // private
+    doAutoSize : function(e){
+        return !e.isNavKeyPress();
+    },
 
     // private
     onKeyUp : function(e){
@@ -52747,9 +56585,7 @@ var myField = new Ext.form.NumberField({
             el.removeClass(this.emptyClass);
         }
         if(this.selectOnFocus){
-            (function(){
-                el.dom.select();
-            }).defer(this.inEditor && Ext.isIE ? 50 : 0);    
+            el.dom.select();
         }
     },
 
@@ -52760,12 +56596,18 @@ var myField = new Ext.form.NumberField({
 
     // private
     filterKeys : function(e){
-        // special keys don't generate charCodes, so leave them alone
-        if(e.ctrlKey || e.isSpecialKey()){
+        if(e.ctrlKey){
             return;
         }
-        
-        if(!this.maskRe.test(String.fromCharCode(e.getCharCode()))){
+        var k = e.getKey();
+        if(Ext.isGecko && (e.isNavKeyPress() || k == e.BACKSPACE || (k == e.DELETE && e.button == -1))){
+            return;
+        }
+        var cc = String.fromCharCode(e.getCharCode());
+        if(!Ext.isGecko && e.isSpecialKey() && !cc){
+            return;
+        }
+        if(!this.maskRe.test(cc)){
             e.stopEvent();
         }
     },
@@ -52781,8 +56623,70 @@ var myField = new Ext.form.NumberField({
     },
 
     /**
-     * Validates a value according to the field's validation rules and marks the field as invalid
-     * if the validation fails
+     * <p>Validates a value according to the field's validation rules and marks the field as invalid
+     * if the validation fails. Validation rules are processed in the following order:</p>
+     * <div class="mdetail-params"><ul>
+     * 
+     * <li><b>1. Field specific validator</b>
+     * <div class="sub-desc">
+     * <p>A validator offers a way to customize and reuse a validation specification.
+     * If a field is configured with a <code>{@link #validator}</code>
+     * function, it will be passed the current field value.  The <code>{@link #validator}</code>
+     * function is expected to return either:
+     * <div class="mdetail-params"><ul>
+     * <li>Boolean <tt>true</tt> if the value is valid (validation continues).</li>
+     * <li>a String to represent the invalid message if invalid (validation halts).</li>
+     * </ul></div>
+     * </div></li>
+     * 
+     * <li><b>2. Basic Validation</b>
+     * <div class="sub-desc">
+     * <p>If the <code>{@link #validator}</code> has not halted validation,
+     * basic validation proceeds as follows:</p>
+     * 
+     * <div class="mdetail-params"><ul>
+     * 
+     * <li><code>{@link #allowBlank}</code> : (Invalid message =
+     * <code>{@link #emptyText}</code>)<div class="sub-desc">
+     * Depending on the configuration of <code>{@link #allowBlank}</code>, a
+     * blank field will cause validation to halt at this step and return
+     * Boolean true or false accordingly.  
+     * </div></li>
+     * 
+     * <li><code>{@link #minLength}</code> : (Invalid message =
+     * <code>{@link #minLengthText}</code>)<div class="sub-desc">
+     * If the passed value does not satisfy the <code>{@link #minLength}</code>
+     * specified, validation halts.
+     * </div></li>
+     * 
+     * <li><code>{@link #maxLength}</code> : (Invalid message =
+     * <code>{@link #maxLengthText}</code>)<div class="sub-desc">
+     * If the passed value does not satisfy the <code>{@link #maxLength}</code>
+     * specified, validation halts.
+     * </div></li>
+     * 
+     * </ul></div>
+     * </div></li>
+     * 
+     * <li><b>3. Preconfigured Validation Types (VTypes)</b>
+     * <div class="sub-desc">
+     * <p>If none of the prior validation steps halts validation, a field
+     * configured with a <code>{@link #vtype}</code> will utilize the
+     * corresponding {@link Ext.form.VTypes VTypes} validation function.
+     * If invalid, either the field's <code>{@link #vtypeText}</code> or
+     * the VTypes vtype Text property will be used for the invalid message.
+     * Keystrokes on the field will be filtered according to the VTypes
+     * vtype Mask property.</p>
+     * </div></li>
+     * 
+     * <li><b>4. Field specific regex test</b>
+     * <div class="sub-desc">
+     * <p>If none of the prior validation steps halts validation, a field's
+     * configured <code>{@link #regex}</code> test will be processed.
+     * The invalid message for this test is configured with
+     * <code>{@link #regexText}</code>.</p>
+     * </div></li>
+     * 
      * @param {Mixed} value The value to validate
      * @return {Boolean} True if the value is valid, else false
      */
@@ -52870,8 +56774,8 @@ var myField = new Ext.form.NumberField({
         var d = document.createElement('div');
         d.appendChild(document.createTextNode(v));
         v = d.innerHTML;
-        d = null;
         Ext.removeNode(d);
+        d = null;
         v += '&#160;';
         var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + /* add extra padding */ 10, this.growMin));
         this.el.setWidth(w);
@@ -52902,7 +56806,7 @@ trigger.applyToMarkup('my-field');
  *
  * However, in general you will most likely want to use TriggerField as the base class for a reusable component.
  * {@link Ext.form.DateField} and {@link Ext.form.ComboBox} are perfect examples of this.
- * 
+ *
  * @constructor
  * Create a new TriggerField.
  * @param {Object} config Configuration options (valid {@Ext.form.TextField} config options will also be applied
@@ -52938,16 +56842,22 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
     hideTrigger:false,
     /**
      * @cfg {Boolean} editable <tt>false</tt> to prevent the user from typing text directly into the field,
-     * the field will only respond to a click on the trigger to set the value. (defaults to <tt>true</tt>)
+     * the field will only respond to a click on the trigger to set the value. (defaults to <tt>true</tt>).
      */
     editable: true,
+    /**
+     * @cfg {Boolean} readOnly <tt>true</tt> to prevent the user from changing the field, and
+     * hides the trigger.  Superceeds the editable and hideTrigger options if the value is true.
+     * (defaults to <tt>false</tt>)
+     */
+    readOnly: false,
     /**
      * @cfg {String} wrapFocusClass The class added to the to the wrap of the trigger element. Defaults to
      * <tt>x-trigger-wrap-focus</tt>.
      */
     wrapFocusClass: 'x-trigger-wrap-focus',
     /**
-     * @hide 
+     * @hide
      * @method autoSize
      */
     autoSize: Ext.emptyFn,
@@ -52957,29 +56867,27 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
     deferHeight : true,
     // private
     mimicing : false,
-    
+
     actionMode: 'wrap',
 
+    defaultTriggerWidth: 17,
+
     // private
     onResize : function(w, h){
         Ext.form.TriggerField.superclass.onResize.call(this, w, h);
-        if(typeof w == 'number'){
-            this.el.setWidth(this.adjustWidth('input', w - this.trigger.getWidth()));
+        var tw = this.getTriggerWidth();
+        if(Ext.isNumber(w)){
+            this.el.setWidth(w - tw);
         }
-        this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());
-    },
-
-    // private
-    adjustSize : Ext.BoxComponent.prototype.adjustSize,
-
-    // private
-    getResizeEl : function(){
-        return this.wrap;
+        this.wrap.setWidth(this.el.getWidth() + tw);
     },
 
-    // private
-    getPositionEl : function(){
-        return this.wrap;
+    getTriggerWidth: function(){
+        var tw = this.trigger.getWidth();
+        if(!this.hideTrigger && tw === 0){
+            tw = this.defaultTriggerWidth;
+        }
+        return tw;
     },
 
     // private
@@ -52991,41 +56899,96 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
 
     // private
     onRender : function(ct, position){
+        this.doc = Ext.isIE ? Ext.getBody() : Ext.getDoc();
         Ext.form.TriggerField.superclass.onRender.call(this, ct, position);
 
         this.wrap = this.el.wrap({cls: 'x-form-field-wrap x-form-field-trigger-wrap'});
         this.trigger = this.wrap.createChild(this.triggerConfig ||
                 {tag: "img", src: Ext.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass});
-        if(this.hideTrigger){
-            this.trigger.setDisplayed(false);
-        }
         this.initTrigger();
         if(!this.width){
             this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());
         }
-        if(!this.editable){
-            this.editable = true;
-            this.setEditable(false);
+        this.resizeEl = this.positionEl = this.wrap;
+    },
+
+    updateEditState: function(){
+        if(this.rendered){
+            if (this.readOnly) {
+                this.el.dom.readOnly = true;
+                this.el.addClass('x-trigger-noedit');
+                this.mun(this.el, 'click', this.onTriggerClick, this);
+                this.trigger.setDisplayed(false);
+            } else {
+                if (!this.editable) {
+                    this.el.dom.readOnly = true;
+                    this.el.addClass('x-trigger-noedit');
+                    this.mon(this.el, 'click', this.onTriggerClick, this);
+                } else {
+                    this.el.dom.readOnly = false;
+                    this.el.removeClass('x-trigger-noedit');
+                    this.mun(this.el, 'click', this.onTriggerClick, this);
+                }
+                this.trigger.setDisplayed(!this.hideTrigger);
+            }
+            this.onResize(this.width || this.wrap.getWidth());
+        }
+    },
+
+    setHideTrigger: function(hideTrigger){
+        if(hideTrigger != this.hideTrigger){
+            this.hideTrigger = hideTrigger;
+            this.updateEditState();
+        }
+    },
+
+    /**
+     * @param {Boolean} value True to allow the user to directly edit the field text
+     * Allow or prevent the user from directly editing the field text.  If false is passed,
+     * the user will only be able to modify the field using the trigger.  Will also add
+     * a click event to the text field which will call the trigger. This method
+     * is the runtime equivalent of setting the 'editable' config option at config time.
+     */
+    setEditable: function(editable){
+        if(editable != this.editable){
+            this.editable = editable;
+            this.updateEditState();
+        }
+    },
+
+    /**
+     * @param {Boolean} value True to prevent the user changing the field and explicitly
+     * hide the trigger.
+     * Setting this to true will superceed settings editable and hideTrigger.
+     * Setting this to false will defer back to editable and hideTrigger. This method
+     * is the runtime equivalent of setting the 'readOnly' config option at config time.
+     */
+    setReadOnly: function(readOnly){
+        if(readOnly != this.readOnly){
+            this.readOnly = readOnly;
+            this.updateEditState();
         }
     },
 
     afterRender : function(){
         Ext.form.TriggerField.superclass.afterRender.call(this);
+        this.updateEditState();
     },
 
     // private
     initTrigger : function(){
-       this.mon(this.trigger, 'click', this.onTriggerClick, this, {preventDefault:true});
+        this.mon(this.trigger, 'click', this.onTriggerClick, this, {preventDefault:true});
         this.trigger.addClassOnOver('x-form-trigger-over');
         this.trigger.addClassOnClick('x-form-trigger-click');
     },
 
     // private
     onDestroy : function(){
-               Ext.destroy(this.trigger, this.wrap);
+        Ext.destroy(this.trigger, this.wrap);
         if (this.mimicing){
-            Ext.get(Ext.isIE ? document.body : document).un("mousedown", this.mimicBlur, this);
+            this.doc.un('mousedown', this.mimicBlur, this);
         }
+        delete this.doc;
         Ext.form.TriggerField.superclass.onDestroy.call(this);
     },
 
@@ -53035,28 +56998,26 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
         if(!this.mimicing){
             this.wrap.addClass(this.wrapFocusClass);
             this.mimicing = true;
-            Ext.get(Ext.isIE ? document.body : document).on("mousedown", this.mimicBlur, this, {delay: 10});
+            this.doc.on('mousedown', this.mimicBlur, this, {delay: 10});
             if(this.monitorTab){
-               this.el.on('keydown', this.checkTab, this);
+                this.on('specialkey', this.checkTab, this);
             }
         }
     },
 
     // private
-    checkTab : function(e){
+    checkTab : function(me, e){
         if(e.getKey() == e.TAB){
             this.triggerBlur();
         }
     },
 
     // private
-    onBlur : function(){
-        // do nothing
-    },
+    onBlur : Ext.emptyFn,
 
     // private
     mimicBlur : function(e){
-        if(!this.wrap.contains(e.target) && this.validateBlur(e)){
+        if(!this.isDestroyed && !this.wrap.contains(e.target) && this.validateBlur(e)){
             this.triggerBlur();
         }
     },
@@ -53064,9 +57025,9 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
     // private
     triggerBlur : function(){
         this.mimicing = false;
-        Ext.get(Ext.isIE ? document.body : document).un("mousedown", this.mimicBlur, this);
+        this.doc.un('mousedown', this.mimicBlur, this);
         if(this.monitorTab && this.el){
-            this.el.un("keydown", this.checkTab, this);
+            this.un('specialkey', this.checkTab, this);
         }
         Ext.form.TriggerField.superclass.onBlur.call(this);
         if(this.wrap){
@@ -53074,25 +57035,7 @@ Ext.form.TriggerField = Ext.extend(Ext.form.TextField,  {
         }
     },
 
-    beforeBlur : Ext.emptyFn, 
-    
-    /**
-     * Allow or prevent the user from directly editing the field text.  If false is passed,
-     * the user will only be able to modify the field using the trigger.  This method
-     * is the runtime equivalent of setting the 'editable' config option at config time.
-     * @param {Boolean} value True to allow the user to directly edit the field text
-     */
-    setEditable : function(value){
-        if(value == this.editable){
-            return;
-        }
-        this.editable = value;
-        if(!value){
-            this.el.addClass('x-trigger-noedit').on('click', this.onTriggerClick, this).dom.setAttribute('readOnly', true);
-        }else{
-            this.el.removeClass('x-trigger-noedit').un('click', this.onTriggerClick,  this).dom.removeAttribute('readOnly');
-        }
-    },
+    beforeBlur : Ext.emptyFn,
 
     // private
     // This should be overriden by any subclass that needs to check whether or not the field can be blurred.
@@ -53166,23 +57109,25 @@ Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, {
 
     initTrigger : function(){
         var ts = this.trigger.select('.x-form-trigger', true);
-        this.wrap.setStyle('overflow', 'hidden');
         var triggerField = this;
         ts.each(function(t, all, index){
+            var triggerIndex = 'Trigger'+(index+1);
             t.hide = function(){
                 var w = triggerField.wrap.getWidth();
                 this.dom.style.display = 'none';
                 triggerField.el.setWidth(w-triggerField.trigger.getWidth());
+                this['hidden' + triggerIndex] = true;
             };
             t.show = function(){
                 var w = triggerField.wrap.getWidth();
                 this.dom.style.display = '';
                 triggerField.el.setWidth(w-triggerField.trigger.getWidth());
+                this['hidden' + triggerIndex] = false;
             };
-            var triggerIndex = 'Trigger'+(index+1);
 
             if(this['hide'+triggerIndex]){
                 t.dom.style.display = 'none';
+                this['hidden' + triggerIndex] = true;
             }
             this.mon(t, 'click', this['on'+triggerIndex+'Click'], this, {preventDefault:true});
             t.addClassOnOver('x-form-trigger-over');
@@ -53191,10 +57136,30 @@ Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, {
         this.triggers = ts.elements;
     },
 
+    getTriggerWidth: function(){
+        var tw = 0;
+        Ext.each(this.triggers, function(t, index){
+            var triggerIndex = 'Trigger' + (index + 1),
+                w = t.getWidth();
+            if(w === 0 && !this['hidden' + triggerIndex]){
+                tw += this.defaultTriggerWidth;
+            }else{
+                tw += w;
+            }
+        }, this);
+        return tw;
+    },
+
+    // private
+    onDestroy : function() {
+        Ext.destroy(this.triggers);
+        Ext.form.TwinTriggerField.superclass.onDestroy.call(this);
+    },
+
     /**
      * The function that should handle the trigger's click event.  This method does nothing by default
      * until overridden by an implementing function. See {@link Ext.form.TriggerField#onTriggerClick}
-     * for additional information.  
+     * for additional information.
      * @method
      * @param {EventObject} e
      */
@@ -53202,13 +57167,14 @@ Ext.form.TwinTriggerField = Ext.extend(Ext.form.TriggerField, {
     /**
      * The function that should handle the trigger's click event.  This method does nothing by default
      * until overridden by an implementing function. See {@link Ext.form.TriggerField#onTriggerClick}
-     * for additional information.  
+     * for additional information.
      * @method
      * @param {EventObject} e
      */
     onTrigger2Click : Ext.emptyFn
 });
-Ext.reg('trigger', Ext.form.TriggerField);/**
+Ext.reg('trigger', Ext.form.TriggerField);
+/**
  * @class Ext.form.TextArea
  * @extends Ext.form.TextField
  * Multiline text field.  Can be used as a direct replacement for traditional textarea fields, plus adds
@@ -53230,13 +57196,13 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField,  {
      */
     growMax: 1000,
     growAppend : '&#160;\n&#160;',
-    growPad : Ext.isWebKit ? -6 : 0,
 
     enterIsSpecial : false,
 
     /**
      * @cfg {Boolean} preventScrollbars <tt>true</tt> to prevent scrollbars from appearing regardless of how much text is
-     * in the field (equivalent to setting overflow: hidden, defaults to <tt>false</tt>)
+     * in the field. This option is only relevant when {@link #grow} is <tt>true</tt>. Equivalent to setting overflow: hidden, defaults to 
+     * <tt>false</tt>.
      */
     preventScrollbars: false,
     /**
@@ -53268,7 +57234,7 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField,  {
     },
 
     onDestroy : function(){
-        Ext.destroy(this.textSizeEl);
+        Ext.removeNode(this.textSizeEl);
         Ext.form.TextArea.superclass.onDestroy.call(this);
     },
 
@@ -53277,13 +57243,10 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField,  {
             this.fireEvent("specialkey", this, e);
         }
     },
-
+    
     // private
-    onKeyUp : function(e){
-        if(!e.isNavKeyPress() || e.getKey() == e.ENTER){
-            this.autoSize();
-        }
-        Ext.form.TextArea.superclass.onKeyUp.call(this, e);
+    doAutoSize : function(e){
+        return !e.isNavKeyPress() || e.getKey() == e.ENTER;
     },
 
     /**
@@ -53294,23 +57257,22 @@ Ext.form.TextArea = Ext.extend(Ext.form.TextField,  {
         if(!this.grow || !this.textSizeEl){
             return;
         }
-        var el = this.el;
-        var v = el.dom.value;
-        var ts = this.textSizeEl;
-        ts.innerHTML = '';
-        ts.appendChild(document.createTextNode(v));
-        v = ts.innerHTML;
+        var el = this.el,
+            v = Ext.util.Format.htmlEncode(el.dom.value),
+            ts = this.textSizeEl,
+            h;
+            
         Ext.fly(ts).setWidth(this.el.getWidth());
         if(v.length < 1){
             v = "&#160;&#160;";
         }else{
             v += this.growAppend;
             if(Ext.isIE){
-                v = v.replace(/\n/g, '<br />');
+                v = v.replace(/\n/g, '&#160;<br />');
             }
         }
         ts.innerHTML = v;
-        var h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin) + this.growPad);
+        h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin));
         if(h != this.lastHeight){
             this.lastHeight = h;
             this.el.setHeight(h);
@@ -53423,10 +57385,26 @@ Ext.form.NumberField = Ext.extend(Ext.form.TextField,  {
     },
 
     setValue : function(v){
-       v = typeof v == 'number' ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
+       v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
         v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator);
         return Ext.form.NumberField.superclass.setValue.call(this, v);
     },
+    
+    /**
+     * Replaces any existing {@link #minValue} with the new value.
+     * @param {Number} value The minimum value
+     */
+    setMinValue : function(value){
+        this.minValue = Ext.num(value, Number.NEGATIVE_INFINITY);
+    },
+    
+    /**
+     * Replaces any existing {@link #maxValue} with the new value.
+     * @param {Number} value The maximum value
+     */
+    setMaxValue : function(value){
+        this.maxValue = Ext.num(value, Number.MAX_VALUE);    
+    },
 
     // private
     parseValue : function(value){
@@ -53585,6 +57563,18 @@ disabledDates: ["^03"]
         this.disabledDatesRE = null;
         this.initDisabledDays();
     },
+    
+    initEvents: function() {
+        Ext.form.DateField.superclass.initEvents.call(this);
+        this.keyNav = new Ext.KeyNav(this.el, {
+            "down": function(e) {
+                this.onTriggerClick();
+            },
+            scope: this,
+            forceKeyDown: true
+        });
+    },
+
 
     // private
     initDisabledDays : function(){
@@ -53750,7 +57740,7 @@ dateField.setValue('2006-05-04');
 
     // private
     onDestroy : function(){
-               Ext.destroy(this.menu);
+               Ext.destroy(this.menu, this.keyNav);
         Ext.form.DateField.superclass.onDestroy.call(this);
     },
 
@@ -53771,7 +57761,8 @@ dateField.setValue('2006-05-04');
         }
         if(this.menu == null){
             this.menu = new Ext.menu.DateMenu({
-                hideOnClick: false
+                hideOnClick: false,
+                focusOnSelect: false
             });
         }
         this.onFocus();
@@ -54021,14 +58012,15 @@ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
      * Acceptable values for this property are:
      * <div class="mdetail-params"><ul>
      * <li><b>any {@link Ext.data.Store Store} subclass</b></li>
-     * <li><b>an Array</b> : Arrays will be converted to a {@link Ext.data.ArrayStore} internally.
+     * <li><b>an Array</b> : Arrays will be converted to a {@link Ext.data.ArrayStore} internally,
+     * automatically generating {@link Ext.data.Field#name field names} to work with all data components.
      * <div class="mdetail-params"><ul>
      * <li><b>1-dimensional array</b> : (e.g., <tt>['Foo','Bar']</tt>)<div class="sub-desc">
-     * A 1-dimensional array will automatically be expanded (each array item will be the combo
-     * {@link #valueField value} and {@link #displayField text})</div></li>
+     * A 1-dimensional array will automatically be expanded (each array item will be used for both the combo
+     * {@link #valueField} and {@link #displayField})</div></li>
      * <li><b>2-dimensional array</b> : (e.g., <tt>[['f','Foo'],['b','Bar']]</tt>)<div class="sub-desc">
      * For a multi-dimensional array, the value in index 0 of each item will be assumed to be the combo
-     * {@link #valueField value}, while the value at index 1 is assumed to be the combo {@link #displayField text}.
+     * {@link #valueField}, while the value at index 1 is assumed to be the combo {@link #displayField}.
      * </div></li></ul></div></li></ul></div>
      * <p>See also <tt>{@link #mode}</tt>.</p>
      */
@@ -54045,8 +58037,9 @@ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
      */
     /**
      * @cfg {String} displayField The underlying {@link Ext.data.Field#name data field name} to bind to this
-     * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'text'</tt> if
-     * {@link #transform transforming a select} a select).
+     * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'field1'</tt> if
+     * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on
+     * the store configuration}).
      * <p>See also <tt>{@link #valueField}</tt>.</p>
      * <p><b>Note</b>: if using a ComboBox in an {@link Ext.grid.EditorGridPanel Editor Grid} a
      * {@link Ext.grid.Column#renderer renderer} will be needed to show the displayField when the editor is not
@@ -54054,8 +58047,9 @@ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
      */
     /**
      * @cfg {String} valueField The underlying {@link Ext.data.Field#name data value name} to bind to this
-     * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'value'</tt> if
-     * {@link #transform transforming a select}).
+     * ComboBox (defaults to undefined if <tt>{@link #mode} = 'remote'</tt> or <tt>'field2'</tt> if
+     * {@link #transform transforming a select} or if the {@link #store field name is autogenerated based on
+     * the store configuration}).
      * <p><b>Note</b>: use of a <tt>valueField</tt> requires the user to make a selection in order for a value to be
      * mapped.  See also <tt>{@link #hiddenName}</tt>, <tt>{@link #hiddenValue}</tt>, and <tt>{@link #displayField}</tt>.</p>
      */
@@ -54106,8 +58100,10 @@ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
      */
     shadow : 'sides',
     /**
-     * @cfg {String} listAlign A valid anchor position value. See <tt>{@link Ext.Element#alignTo}</tt> for details
-     * on supported anchor positions (defaults to <tt>'tl-bl?'</tt>)
+     * @cfg {String/Array} listAlign A valid anchor position value. See <tt>{@link Ext.Element#alignTo}</tt> for details
+     * on supported anchor positions and offsets. To specify x/y offsets as well, this value
+     * may be specified as an Array of <tt>{@link Ext.Element#alignTo}</tt> method arguments.</p>
+     * <pre><code>[ 'tl-bl?', [6,0] ]</code></pre>(defaults to <tt>'tl-bl?'</tt>)
      */
     listAlign : 'tl-bl?',
     /**
@@ -54138,6 +58134,12 @@ Ext.form.ComboBox = Ext.extend(Ext.form.TriggerField, {
      * <tt>{@link Ext.form.TriggerField#editable editable} = false</tt>).
      */
     minChars : 4,
+    /**
+     * @cfg {Boolean} autoSelect <tt>true</tt> to select the first result gathered by the data store (defaults
+     * to <tt>true</tt>).  A false value would require a manual selection from the dropdown list to set the components value
+     * unless the value of ({@link #typeAheadDelay}) were true.
+     */
+    autoSelect : true,
     /**
      * @cfg {Boolean} typeAhead <tt>true</tt> to populate and autoselect the remainder of the text being
      * typed after a configurable delay ({@link #typeAheadDelay}) if it matches a known value (defaults
@@ -54246,6 +58248,19 @@ var combo = new Ext.form.ComboBox({
      */
     lazyInit : true,
 
+    /**
+     * @cfg {Boolean} clearFilterOnReset <tt>true</tt> to clear any filters on the store (when in local mode) when reset is called
+     * (defaults to <tt>true</tt>)
+     */
+    clearFilterOnReset : true,
+
+    /**
+     * @cfg {Boolean} submitValue False to clear the name attribute on the field so that it is not submitted during a form post.
+     * If a hiddenName is specified, setting this to true will cause both the hidden field and the element to be submitted.
+     * Defaults to <tt>undefined</tt>.
+     */
+    submitValue: undefined,
+
     /**
      * The value of the match string used to filter the store. Delete this property to force a requery.
      * Example use:
@@ -54293,6 +58308,7 @@ var combo = new Ext.form.ComboBox({
              * @param {Ext.form.ComboBox} combo This combo box
              */
             'collapse',
+
             /**
              * @event beforeselect
              * Fires before a list item is selected. Return false to cancel the selection.
@@ -54352,10 +58368,8 @@ var combo = new Ext.form.ComboBox({
                 this.target = true;
                 this.el = Ext.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate);
                 this.render(this.el.parentNode, s);
-                Ext.removeNode(s); // remove it
-            }else{
-                Ext.removeNode(s); // remove it
             }
+            Ext.removeNode(s);
         }
         //auto-configure store from local array data
         else if(this.store){
@@ -54382,13 +58396,14 @@ var combo = new Ext.form.ComboBox({
 
     // private
     onRender : function(ct, position){
+        if(this.hiddenName && !Ext.isDefined(this.submitValue)){
+            this.submitValue = false;
+        }
         Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
         if(this.hiddenName){
             this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName,
                     id: (this.hiddenId||this.hiddenName)}, 'before', true);
 
-            // prevent input submission
-            this.el.dom.removeAttribute('name');
         }
         if(Ext.isGecko){
             this.el.dom.setAttribute('autocomplete', 'off');
@@ -54406,21 +58421,30 @@ var combo = new Ext.form.ComboBox({
         Ext.form.ComboBox.superclass.initValue.call(this);
         if(this.hiddenField){
             this.hiddenField.value =
-                Ext.isDefined(this.hiddenValue) ? this.hiddenValue :
-                Ext.isDefined(this.value) ? this.value : '';
+                Ext.value(Ext.isDefined(this.hiddenValue) ? this.hiddenValue : this.value, '');
         }
     },
 
     // private
     initList : function(){
         if(!this.list){
-            var cls = 'x-combo-list';
+            var cls = 'x-combo-list',
+                listParent = Ext.getDom(this.getListParent() || Ext.getBody()),
+                zindex = parseInt(Ext.fly(listParent).getStyle('z-index') ,10);
+
+            if (this.ownerCt && !zindex){
+                this.findParentBy(function(ct){
+                    zindex = parseInt(ct.getPositionEl().getStyle('z-index'), 10);
+                    return !!zindex;
+                });
+            }
 
             this.list = new Ext.Layer({
-                parentEl: this.getListParent(),
+                parentEl: listParent,
                 shadow: this.shadow,
                 cls: [cls, this.listClass].join(' '),
-                constrain:false
+                constrain:false,
+                zindex: (zindex || 12000) + 5
             });
 
             var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
@@ -54491,10 +58515,15 @@ var combo = new Ext.form.ComboBox({
                 singleSelect: true,
                 selectedClass: this.selectedClass,
                 itemSelector: this.itemSelector || '.' + cls + '-item',
-                emptyText: this.listEmptyText
+                emptyText: this.listEmptyText,
+                deferEmptyText: false
             });
 
-            this.mon(this.view, 'click', this.onViewClick, this);
+            this.mon(this.view, {
+                containerclick : this.onViewClick,
+                click : this.onViewClick,
+                scope :this
+            });
 
             this.bindStore(this.store, true);
 
@@ -54567,17 +58596,21 @@ var menu = new Ext.menu.Menu({
     // private
     bindStore : function(store, initial){
         if(this.store && !initial){
-            this.store.un('beforeload', this.onBeforeLoad, this);
-            this.store.un('load', this.onLoad, this);
-            this.store.un('exception', this.collapse, this);
             if(this.store !== store && this.store.autoDestroy){
                 this.store.destroy();
+            }else{
+                this.store.un('beforeload', this.onBeforeLoad, this);
+                this.store.un('load', this.onLoad, this);
+                this.store.un('exception', this.collapse, this);
             }
             if(!store){
                 this.store = null;
                 if(this.view){
                     this.view.bindStore(null);
                 }
+                if(this.pageTb){
+                    this.pageTb.bindStore(null);
+                }
             }
         }
         if(store){
@@ -54602,10 +58635,18 @@ var menu = new Ext.menu.Menu({
         }
     },
 
+    reset : function(){
+        Ext.form.ComboBox.superclass.reset.call(this);
+        if(this.clearFilterOnReset && this.mode == 'local'){
+            this.store.clearFilter();
+        }
+    },
+
     // private
     initEvents : function(){
         Ext.form.ComboBox.superclass.initEvents.call(this);
 
+
         this.keyNav = new Ext.KeyNav(this.el, {
             "up" : function(e){
                 this.inKeyMode = true;
@@ -54623,8 +58664,6 @@ var menu = new Ext.menu.Menu({
 
             "enter" : function(e){
                 this.onViewClick();
-                this.delayedCheck = true;
-                this.unsetDelayCheck.defer(10, this);
             },
 
             "esc" : function(e){
@@ -54632,20 +58671,27 @@ var menu = new Ext.menu.Menu({
             },
 
             "tab" : function(e){
-                this.onViewClick(false);
+                this.collapse();
                 return true;
             },
 
             scope : this,
 
-            doRelay : function(foo, bar, hname){
+            doRelay : function(e, h, hname){
                 if(hname == 'down' || this.scope.isExpanded()){
-                   return Ext.KeyNav.prototype.doRelay.apply(this, arguments);
+                    // this MUST be called before ComboBox#fireKey()
+                    var relay = Ext.KeyNav.prototype.doRelay.apply(this, arguments);
+                    if(!Ext.isIE && Ext.EventManager.useKeydown){
+                        // call Combo#fireKey() for browsers which use keydown event (except IE)
+                        this.scope.fireKey(e);
+                    }
+                    return relay;
                 }
                 return true;
             },
 
-            forceKeyDown : true
+            forceKeyDown : true,
+            defaultEventAction: 'stopEvent'
         });
         this.queryDelay = Math.max(this.queryDelay || 10,
                 this.mode == 'local' ? 10 : 250);
@@ -54653,11 +58699,12 @@ var menu = new Ext.menu.Menu({
         if(this.typeAhead){
             this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);
         }
-        if(this.editable !== false && !this.enableKeyEvents){
+        if(!this.enableKeyEvents){
             this.mon(this.el, 'keyup', this.onKeyUp, this);
         }
     },
 
+
     // private
     onDestroy : function(){
         if (this.dqTask){
@@ -54671,34 +58718,29 @@ var menu = new Ext.menu.Menu({
             this.pageTb,
             this.list
         );
+        Ext.destroyMembers(this, 'hiddenField');
         Ext.form.ComboBox.superclass.onDestroy.call(this);
     },
 
-    // private
-    unsetDelayCheck : function(){
-        delete this.delayedCheck;
-    },
-
     // private
     fireKey : function(e){
-        var fn = function(ev){
-            if (ev.isNavKeyPress() && !this.isExpanded() && !this.delayedCheck) {
-                this.fireEvent("specialkey", this, ev);
-            }
-        };
-        //For some reason I can't track down, the events fire in a different order in webkit.
-        //Need a slight delay here
-        if(this.inEditor && Ext.isWebKit && e.getKey() == e.TAB){
-            fn.defer(10, this, [new Ext.EventObjectImpl(e)]);
-        }else{
-            fn.call(this, e);
+        if (!this.isExpanded()) {
+            Ext.form.ComboBox.superclass.fireKey.call(this, e);
         }
     },
 
     // private
     onResize : function(w, h){
         Ext.form.ComboBox.superclass.onResize.apply(this, arguments);
-        if(this.list && !Ext.isDefined(this.listWidth)){
+        if(this.isVisible() && this.list){
+            this.doResize(w);
+        }else{
+            this.bufferSize = w;
+        }
+    },
+
+    doResize: function(w){
+        if(!Ext.isDefined(this.listWidth)){
             var lw = Math.max(w, this.minListWidth);
             this.list.setWidth(lw);
             this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
@@ -54737,26 +58779,29 @@ var menu = new Ext.menu.Menu({
         if(!this.hasFocus){
             return;
         }
-        if(this.store.getCount() > 0){
+        if(this.store.getCount() > 0 || this.listEmptyText){
             this.expand();
             this.restrictHeight();
             if(this.lastQuery == this.allQuery){
                 if(this.editable){
                     this.el.dom.select();
                 }
-                if(!this.selectByValue(this.value, true)){
+
+                if(this.autoSelect !== false && !this.selectByValue(this.value, true)){
                     this.select(0, true);
                 }
             }else{
-                this.selectNext();
+                if(this.autoSelect !== false){
+                    this.selectNext();
+                }
                 if(this.typeAhead && this.lastKey != Ext.EventObject.BACKSPACE && this.lastKey != Ext.EventObject.DELETE){
                     this.taTask.delay(this.typeAheadDelay);
                 }
             }
         }else{
-            this.onEmptyResults();
+            this.collapse();
         }
-        //this.el.focus();
+
     },
 
     // private
@@ -54773,6 +58818,28 @@ var menu = new Ext.menu.Menu({
         }
     },
 
+    // private
+    assertValue  : function(){
+
+        var val = this.getRawValue(),
+            rec = this.findRecord(this.displayField, val);
+
+        if(!rec && this.forceSelection){
+            if(val.length > 0 && val != this.emptyText){
+                this.el.dom.value = Ext.value(this.lastSelectionText, '');
+                this.applyEmptyText();
+            }else{
+                this.clearValue();
+            }
+        }else{
+            if(rec){
+                val = rec.get(this.valueField || this.displayField);
+            }
+            this.setValue(val);
+        }
+
+    },
+
     // private
     onSelect : function(record, index){
         if(this.fireEvent('beforeselect', this, record, index) !== false){
@@ -54833,7 +58900,7 @@ var menu = new Ext.menu.Menu({
         }
         this.lastSelectionText = text;
         if(this.hiddenField){
-            this.hiddenField.value = v;
+            this.hiddenField.value = Ext.value(v, '');
         }
         Ext.form.ComboBox.superclass.setValue.call(this, text);
         this.value = v;
@@ -54873,39 +58940,39 @@ var menu = new Ext.menu.Menu({
 
     // private
     onViewClick : function(doFocus){
-        var index = this.view.getSelectedIndexes()[0];
-        var r = this.store.getAt(index);
+        var index = this.view.getSelectedIndexes()[0],
+            s = this.store,
+            r = s.getAt(index);
         if(r){
             this.onSelect(r, index);
+        }else {
+            this.collapse();
         }
         if(doFocus !== false){
             this.el.focus();
         }
     },
 
+
     // private
     restrictHeight : function(){
         this.innerList.dom.style.height = '';
-        var inner = this.innerList.dom;
-        var pad = this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight;
-        var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
-        var ha = this.getPosition()[1]-Ext.getBody().getScroll().top;
-        var hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height;
-        var space = Math.max(ha, hb, this.minHeight || 0)-this.list.shadowOffset-pad-5;
+        var inner = this.innerList.dom,
+            pad = this.list.getFrameWidth('tb') + (this.resizable ? this.handleHeight : 0) + this.assetHeight,
+            h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight),
+            ha = this.getPosition()[1]-Ext.getBody().getScroll().top,
+            hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height,
+            space = Math.max(ha, hb, this.minHeight || 0)-this.list.shadowOffset-pad-5;
+
         h = Math.min(h, space, this.maxHeight);
 
         this.innerList.setHeight(h);
         this.list.beginUpdate();
         this.list.setHeight(h+pad);
-        this.list.alignTo(this.wrap, this.listAlign);
+        this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign));
         this.list.endUpdate();
     },
 
-    // private
-    onEmptyResults : function(){
-        this.collapse();
-    },
-
     /**
      * Returns true if the dropdown list is expanded, else false.
      */
@@ -54948,6 +59015,7 @@ var menu = new Ext.menu.Menu({
                 this.innerList.scrollChildIntoView(el, false);
             }
         }
+
     },
 
     // private
@@ -54977,7 +59045,8 @@ var menu = new Ext.menu.Menu({
     // private
     onKeyUp : function(e){
         var k = e.getKey();
-        if(this.editable !== false && (k == e.BACKSPACE || !e.isSpecialKey())){
+        if(this.editable !== false && this.readOnly !== true && (k == e.BACKSPACE || !e.isSpecialKey())){
+
             this.lastKey = k;
             this.dqTask.delay(this.queryDelay);
         }
@@ -54996,21 +59065,14 @@ var menu = new Ext.menu.Menu({
 
     // private
     beforeBlur : function(){
-        var val = this.getRawValue();
-        if(this.forceSelection){
-            if(val.length > 0 && val != this.emptyText){
-               this.el.dom.value = Ext.isDefined(this.lastSelectionText) ? this.lastSelectionText : '';
-                this.applyEmptyText();
-            }else{
-                this.clearValue();
-            }
-        }else{
-            var rec = this.findRecord(this.displayField, val);
-            if(rec){
-                val = rec.get(this.valueField || this.displayField);
-            }
-            this.setValue(val);
-        }
+        this.assertValue();
+    },
+
+    // private
+    postBlur  : function(){
+        Ext.form.ComboBox.superclass.postBlur.call(this);
+        this.collapse();
+        this.inKeyMode = false;
     },
 
     /**
@@ -55097,12 +59159,16 @@ var menu = new Ext.menu.Menu({
         if(this.isExpanded() || !this.hasFocus){
             return;
         }
-        this.list.alignTo(this.wrap, this.listAlign);
+        if(this.bufferSize){
+            this.doResize(this.bufferSize);
+            delete this.bufferSize;
+        }
+        this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign));
         this.list.show();
         if(Ext.isGecko2){
             this.innerList.setOverflow('auto'); // necessary for FF 2.0/Mac
         }
-        Ext.getDoc().on({
+        this.mon(Ext.getDoc(), {
             scope: this,
             mousewheel: this.collapseIf,
             mousedown: this.collapseIf
@@ -55117,7 +59183,7 @@ var menu = new Ext.menu.Menu({
     // private
     // Implements the default empty TriggerField.onTriggerClick function
     onTriggerClick : function(){
-        if(this.disabled){
+        if(this.readOnly || this.disabled){
             return;
         }
         if(this.isExpanded()){
@@ -55149,7 +59215,8 @@ var menu = new Ext.menu.Menu({
      */
 
 });
-Ext.reg('combo', Ext.form.ComboBox);/**
+Ext.reg('combo', Ext.form.ComboBox);
+/**
  * @class Ext.form.Checkbox
  * @extends Ext.form.Field
  * Single checkbox field.  Can be used as a direct replacement for traditional checkbox fields.
@@ -55223,18 +59290,11 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field,  {
     // private
     initEvents : function(){
         Ext.form.Checkbox.superclass.initEvents.call(this);
-        this.mon(this.el, 'click', this.onClick, this);
-        this.mon(this.el, 'change', this.onClick, this);
-    },
-
-       // private
-    getResizeEl : function(){
-        return this.wrap;
-    },
-
-    // private
-    getPositionEl : function(){
-        return this.wrap;
+        this.mon(this.el, {
+            scope: this,
+            click: this.onClick,
+            change: this.onClick
+        });
     },
 
     /**
@@ -55265,6 +59325,11 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field,  {
         }else{
             this.checked = this.el.dom.checked;
         }
+        // Need to repaint for IE, otherwise positioning is broken
+        if(Ext.isIE){
+            this.wrap.repaint();
+        }
+        this.resizeEl = this.positionEl = this.wrap;
     },
 
     // private
@@ -55286,7 +59351,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field,  {
         if(this.rendered){
             return this.el.dom.checked;
         }
-        return false;
+        return this.checked;
     },
 
        // private
@@ -55355,7 +59420,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
      * checkbox/radio controls using automatic layout.  This config can take several types of values:
      * <ul><li><b>'auto'</b> : <p class="sub-desc">The controls will be rendered one per column on one row and the width
      * of each column will be evenly distributed based on the width of the overall field container. This is the default.</p></li>
-     * <li><b>Number</b> : <p class="sub-desc">If you specific a number (e.g., 3) that number of columns will be 
+     * <li><b>Number</b> : <p class="sub-desc">If you specific a number (e.g., 3) that number of columns will be
      * created and the contained controls will be automatically distributed based on the value of {@link #vertical}.</p></li>
      * <li><b>Array</b> : Object<p class="sub-desc">You can also specify an array of column widths, mixing integer
      * (fixed width) and float (percentage width) values as needed (e.g., [100, .25, .75]). Any integer values will
@@ -55365,7 +59430,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
      */
     columns : 'auto',
     /**
-     * @cfg {Boolean} vertical True to distribute contained controls across columns, completely filling each column 
+     * @cfg {Boolean} vertical True to distribute contained controls across columns, completely filling each column
      * top to bottom before starting on the next column.  The number of controls in each column will be automatically
      * calculated to keep columns as even as possible.  The default value is false, so that controls will be added
      * to columns one at a time, completely filling each row left to right before starting on the next row.
@@ -55377,17 +59442,17 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
      */
     allowBlank : true,
     /**
-     * @cfg {String} blankText Error text to display if the {@link #allowBlank} validation fails (defaults to "You must 
+     * @cfg {String} blankText Error text to display if the {@link #allowBlank} validation fails (defaults to "You must
      * select at least one item in this group")
      */
     blankText : "You must select at least one item in this group",
-    
+
     // private
     defaultType : 'checkbox',
-    
+
     // private
     groupCls : 'x-form-check-group',
-    
+
     // private
     initComponent: function(){
         this.addEvents(
@@ -55398,33 +59463,37 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
              * @param {Array} checked An array containing the checked boxes.
              */
             'change'
-        );   
+        );
+        this.on('change', this.validate, this);
         Ext.form.CheckboxGroup.superclass.initComponent.call(this);
     },
-    
+
     // private
     onRender : function(ct, position){
         if(!this.el){
             var panelCfg = {
+                autoEl: {
+                    id: this.id
+                },
                 cls: this.groupCls,
                 layout: 'column',
-                border: false,
-                renderTo: ct
+                renderTo: ct,
+                bufferResize: false // Default this to false, since it doesn't really have a proper ownerCt.
             };
             var colCfg = {
+                xtype: 'container',
                 defaultType: this.defaultType,
                 layout: 'form',
-                border: false,
                 defaults: {
                     hideLabel: true,
                     anchor: '100%'
                 }
             };
-            
+
             if(this.items[0].items){
-                
+
                 // The container has standard ColumnLayout configs, so pass them in directly
-                
+
                 Ext.apply(panelCfg, {
                     layoutConfig: {columns: this.items.length},
                     defaults: this.defaults,
@@ -55433,14 +59502,14 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
                 for(var i=0, len=this.items.length; i<len; i++){
                     Ext.applyIf(this.items[i], colCfg);
                 }
-                
+
             }else{
-                
+
                 // The container has field item configs, so we have to generate the column
                 // panels first then move the items into the columns as needed.
-                
+
                 var numCols, cols = [];
-                
+
                 if(typeof this.columns == 'string'){ // 'auto' so create a col per item
                     this.columns = this.items.length;
                 }
@@ -55451,9 +59520,9 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
                     }
                     this.columns = cs;
                 }
-                
+
                 numCols = this.columns.length;
-                
+
                 // Generate the column configs with the correct width setting
                 for(var i=0; i<numCols; i++){
                     var cc = Ext.apply({items:[]}, colCfg);
@@ -55463,7 +59532,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
                     }
                     cols.push(cc);
                 };
-                
+
                 // Distribute the original items into the columns
                 if(this.vertical){
                     var rows = Math.ceil(this.items.length / numCols), ri = 0;
@@ -55485,46 +59554,50 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
                         cols[ci].items.push(this.items[i]);
                     };
                 }
-                
+
                 Ext.apply(panelCfg, {
                     layoutConfig: {columns: numCols},
                     items: cols
                 });
             }
-            
-            this.panel = new Ext.Panel(panelCfg);
+
+            this.panel = new Ext.Container(panelCfg);
             this.panel.ownerCt = this;
             this.el = this.panel.getEl();
-            
+
             if(this.forId && this.itemCls){
                 var l = this.el.up(this.itemCls).child('label', true);
                 if(l){
                     l.setAttribute('htmlFor', this.forId);
                 }
             }
-            
+
             var fields = this.panel.findBy(function(c){
                 return c.isFormField;
             }, this);
-            
+
             this.items = new Ext.util.MixedCollection();
             this.items.addAll(fields);
         }
         Ext.form.CheckboxGroup.superclass.onRender.call(this, ct, position);
     },
-    
+
+    initValue : function(){
+        if(this.value){
+            this.setValue.apply(this, this.buffered ? this.value : [this.value]);
+            delete this.buffered;
+            delete this.value;
+        }
+    },
+
     afterRender : function(){
         Ext.form.CheckboxGroup.superclass.afterRender.call(this);
-        if(this.values){
-            this.setValue.apply(this, this.values);
-            delete this.values;
-        }
         this.eachItem(function(item){
             item.on('check', this.fireChecked, this);
             item.inGroup = true;
         });
     },
-    
+
     // private
     doLayout: function(){
         //ugly method required to layout hidden items
@@ -55533,7 +59606,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
             this.panel.doLayout();
         }
     },
-    
+
     // private
     fireChecked: function(){
         var arr = [];
@@ -55544,7 +59617,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
         });
         this.fireEvent('change', this, arr);
     },
-    
+
     // private
     validateValue : function(value){
         if(!this.allowBlank){
@@ -55561,7 +59634,24 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
         }
         return true;
     },
-    
+
+    // private
+    isDirty: function(){
+        //override the behaviour to check sub items.
+        if (this.disabled || !this.rendered) {
+            return false;
+        }
+
+        var dirty = false;
+        this.eachItem(function(item){
+            if(item.isDirty()){
+                dirty = true;
+                return false;
+            }
+        });
+        return dirty;
+    },
+
     // private
     onDisable : function(){
         this.eachItem(function(item){
@@ -55575,7 +59665,7 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
             item.enable();
         });
     },
-    
+
     // private
     doLayout: function(){
         if(this.rendered){
@@ -55583,30 +59673,34 @@ Ext.form.CheckboxGroup = Ext.extend(Ext.form.Field, {
             this.panel.doLayout();
         }
     },
-    
+
     // private
     onResize : function(w, h){
         this.panel.setSize(w, h);
         this.panel.doLayout();
     },
-    
+
     // inherit docs from Field
     reset : function(){
-        Ext.form.CheckboxGroup.superclass.reset.call(this);
         this.eachItem(function(c){
             if(c.reset){
                 c.reset();
             }
         });
+        // Defer the clearInvalid so if BaseForm's collection is being iterated it will be called AFTER it is complete.
+        // Important because reset is being called on both the group and the individual items.
+        (function() {
+            this.clearInvalid();
+        }).defer(50, this);
     },
-    
+
     /**
      * {@link Ext.form.Checkbox#setValue Set the value(s)} of an item or items
      * in the group. Examples illustrating how this method may be called:
      * <pre><code>
 // call with name and value
 myCheckboxGroup.setValue('cb-col-1', true);
-// call with an array of boolean values 
+// call with an array of boolean values
 myCheckboxGroup.setValue([true, false, false]);
 // call with an object literal specifying item:value pairs
 myCheckboxGroup.setValue({
@@ -55621,47 +59715,52 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
      * @param {Boolean} value (optional) The value to set the item.
      * @return {Ext.form.CheckboxGroup} this
      */
-    setValue : function(id, value){
+    setValue: function(){
         if(this.rendered){
-            if(arguments.length == 1){
-                if(Ext.isArray(id)){
-                    //an array of boolean values
-                    Ext.each(id, function(val, idx){
-                        var item = this.items.itemAt(idx);
-                        if(item){
-                            item.setValue(val);
-                        }
-                    }, this);
-                }else if(Ext.isObject(id)){
-                    //set of name/value pairs
-                    for(var i in id){
-                        var f = this.getBox(i);
-                        if(f){
-                            f.setValue(id[i]);
-                        }
+            this.onSetValue.apply(this, arguments);
+        }else{
+            this.buffered = true;
+            this.value = arguments;
+        }
+        return this;
+    },
+
+    onSetValue: function(id, value){
+        if(arguments.length == 1){
+            if(Ext.isArray(id)){
+                // an array of boolean values
+                Ext.each(id, function(val, idx){
+                    var item = this.items.itemAt(idx);
+                    if(item){
+                        item.setValue(val);
+                    }
+                }, this);
+            }else if(Ext.isObject(id)){
+                // set of name/value pairs
+                for(var i in id){
+                    var f = this.getBox(i);
+                    if(f){
+                        f.setValue(id[i]);
                     }
-                }else{
-                    this.setValueForItem(id);
                 }
             }else{
-                var f = this.getBox(id);
-                if(f){
-                    f.setValue(value);
-                }
+                this.setValueForItem(id);
             }
         }else{
-            this.values = arguments;
+            var f = this.getBox(id);
+            if(f){
+                f.setValue(value);
+            }
         }
-        return this;
     },
-    
+
     // private
-    onDestroy: function(){
+    beforeDestroy: function(){
         Ext.destroy(this.panel);
-        Ext.form.CheckboxGroup.superclass.onDestroy.call(this);
+        Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this);
 
     },
-    
+
     setValueForItem : function(val){
         val = String(val).split(',');
         this.eachItem(function(item){
@@ -55670,7 +59769,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
             }
         });
     },
-    
+
     // private
     getBox : function(id){
         var box = null;
@@ -55682,7 +59781,7 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
         });
         return box;
     },
-    
+
     /**
      * Gets an array of the selected {@link Ext.form.Checkbox} in the group.
      * @return {Array} An array of the selected checkboxes.
@@ -55696,40 +59795,31 @@ myCheckboxGroup.setValue('cb-col-1,cb-col-3');
         });
         return out;
     },
-    
+
     // private
     eachItem: function(fn){
         if(this.items && this.items.each){
             this.items.each(fn, this);
         }
     },
-    
+
     /**
      * @cfg {String} name
      * @hide
      */
-    /**
-     * @method initValue
-     * @hide
-     */
-    initValue : Ext.emptyFn,
-    /**
-     * @method getValue
-     * @hide
-     */
-    getValue : Ext.emptyFn,
+
     /**
      * @method getRawValue
      * @hide
      */
     getRawValue : Ext.emptyFn,
-    
+
     /**
      * @method setRawValue
      * @hide
      */
     setRawValue : Ext.emptyFn
-    
+
 });
 
 Ext.reg('checkboxgroup', Ext.form.CheckboxGroup);
@@ -55790,7 +59880,7 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
     setValue : function(v){
        if (typeof v == 'boolean') {
             Ext.form.Radio.superclass.setValue.call(this, v);
-        } else {
+        } else if (this.rendered) {
             var r = this.getCheckEl().child('input[name=' + this.el.dom.name + '][value=' + v + ']', true);
             if(r){
                 Ext.getCmp(r.id).setValue(true);
@@ -55798,7 +59888,7 @@ Ext.form.Radio = Ext.extend(Ext.form.Checkbox, {
         }
         return this;
     },
-    
+
     // private
     getCheckEl: function(){
         if(this.inGroup){
@@ -55818,6 +59908,10 @@ Ext.reg('radio', Ext.form.Radio);
  * @xtype radiogroup
  */
 Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
+    /**
+     * @cfg {Array} items An Array of {@link Ext.form.Radio Radio}s or Radio config objects
+     * to arrange in the group.
+     */
     /**
      * @cfg {Boolean} allowBlank True to allow every item in the group to be blank (defaults to true).
      * If allowBlank = false and no items are selected at validation time, {@link @blankText} will
@@ -55864,27 +59958,29 @@ Ext.form.RadioGroup = Ext.extend(Ext.form.CheckboxGroup, {
      * @param {Boolean} value The value to set the radio.
      * @return {Ext.form.RadioGroup} this
      */
-    setValue : function(id, value){
-        if(this.rendered){
-            if(arguments.length > 1){
-                var f = this.getBox(id);
-                if(f){
-                    f.setValue(value);
-                    if(f.checked){
-                        this.eachItem(function(item){
-                            if (item !== f){
-                                item.setValue(false);
-                            }
-                        });
-                    }
+    onSetValue : function(id, value){
+        if(arguments.length > 1){
+            var f = this.getBox(id);
+            if(f){
+                f.setValue(value);
+                if(f.checked){
+                    this.eachItem(function(item){
+                        if (item !== f){
+                            item.setValue(false);
+                        }
+                    });
                 }
-            }else{
-                this.setValueForItem(id);
             }
         }else{
-            this.values = arguments;
+            this.setValueForItem(id);
         }
-        return this;
+    },
+    
+    setValueForItem : function(val){
+        val = String(val).split(',')[0];
+        this.eachItem(function(item){
+            item.setValue(val == item.inputValue);
+        });
     },
     
     // private
@@ -55980,50 +60076,51 @@ Ext.reg('hidden', Ext.form.Hidden);/**
  * @param {Mixed} el The form element or its id
  * @param {Object} config Configuration options
  */
-Ext.form.BasicForm = function(el, config){
-    Ext.apply(this, config);
-    if(Ext.isString(this.paramOrder)){
-        this.paramOrder = this.paramOrder.split(/[\s,|]/);
-    }
-    /*
-     * @property items
-     * A {@link Ext.util.MixedCollection MixedCollection) containing all the Ext.form.Fields in this form.
-     * @type MixedCollection
-     */
-    this.items = new Ext.util.MixedCollection(false, function(o){
-        return o.itemId || o.id || (o.id = Ext.id());
-    });
-    this.addEvents(
-        /**
-         * @event beforeaction
-         * Fires before any action is performed. Return false to cancel the action.
-         * @param {Form} this
-         * @param {Action} action The {@link Ext.form.Action} to be performed
-         */
-        'beforeaction',
-        /**
-         * @event actionfailed
-         * Fires when an action fails.
-         * @param {Form} this
-         * @param {Action} action The {@link Ext.form.Action} that failed
-         */
-        'actionfailed',
+Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {
+    
+    constructor: function(el, config){
+        Ext.apply(this, config);
+        if(Ext.isString(this.paramOrder)){
+            this.paramOrder = this.paramOrder.split(/[\s,|]/);
+        }
         /**
-         * @event actioncomplete
-         * Fires when an action is completed.
-         * @param {Form} this
-         * @param {Action} action The {@link Ext.form.Action} that completed
+         * A {@link Ext.util.MixedCollection MixedCollection} containing all the Ext.form.Fields in this form.
+         * @type MixedCollection
+         * @property items
          */
-        'actioncomplete'
-    );
-
-    if(el){
-        this.initEl(el);
-    }
-    Ext.form.BasicForm.superclass.constructor.call(this);
-};
+        this.items = new Ext.util.MixedCollection(false, function(o){
+            return o.getItemId();
+        });
+        this.addEvents(
+            /**
+             * @event beforeaction
+             * Fires before any action is performed. Return false to cancel the action.
+             * @param {Form} this
+             * @param {Action} action The {@link Ext.form.Action} to be performed
+             */
+            'beforeaction',
+            /**
+             * @event actionfailed
+             * Fires when an action fails.
+             * @param {Form} this
+             * @param {Action} action The {@link Ext.form.Action} that failed
+             */
+            'actionfailed',
+            /**
+             * @event actioncomplete
+             * Fires when an action is completed.
+             * @param {Form} this
+             * @param {Action} action The {@link Ext.form.Action} that completed
+             */
+            'actioncomplete'
+        );
 
-Ext.extend(Ext.form.BasicForm, Ext.util.Observable, {
+        if(el){
+            this.initEl(el);
+        }
+        Ext.form.BasicForm.superclass.constructor.call(this);    
+    },
+    
     /**
      * @cfg {String} method
      * The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
@@ -56129,7 +60226,12 @@ paramOrder: 'param1|param2|param'
      * <tt>{@link #paramOrder}</tt> nullifies this configuration.
      */
     paramsAsHash: false,
-
+    
+    /**
+     * @cfg {String} waitTitle
+     * The default title to show for the waiting message box (defaults to <tt>'Please Wait...'</tt>)
+     */
+    waitTitle: 'Please Wait...',
 
     // private
     activeAction : null,
@@ -56141,23 +60243,21 @@ paramOrder: 'param1|param2|param'
     trackResetOnLoad : false,
 
     /**
-     * @cfg {Boolean} standardSubmit If set to true, standard HTML form submits are used instead of XHR (Ajax) style
-     * form submissions. (defaults to false)<br>
-     * <p><b>Note:</b> When using standardSubmit, the options to {@link #submit} are ignored because Ext's
-     * Ajax infrastracture is bypassed. To pass extra parameters (baseParams and params), you will need to
-     * create hidden fields within the form.</p>
-     * <p>The url config option is also bypassed, so set the action as well:</p>
-     * <pre><code>
-PANEL.getForm().getEl().dom.action = 'URL'
-     * </code></pre>
-     * An example encapsulating the above:
+     * @cfg {Boolean} standardSubmit
+     * <p>If set to <tt>true</tt>, standard HTML form submits are used instead
+     * of XHR (Ajax) style form submissions. Defaults to <tt>false</tt>.</p>
+     * <br><p><b>Note:</b> When using <code>standardSubmit</code>, the
+     * <code>options</code> to <code>{@link #submit}</code> are ignored because
+     * Ext's Ajax infrastracture is bypassed. To pass extra parameters (e.g.
+     * <code>baseParams</code> and <code>params</code>), utilize hidden fields
+     * to submit extra data, for example:</p>
      * <pre><code>
 new Ext.FormPanel({
     standardSubmit: true,
     baseParams: {
         foo: 'bar'
     },
-    url: 'myProcess.php',
+    {@link url}: 'myProcess.php',
     items: [{
         xtype: 'textfield',
         name: 'userName'
@@ -56165,21 +60265,25 @@ new Ext.FormPanel({
     buttons: [{
         text: 'Save',
         handler: function(){
-            var O = this.ownerCt;
-            if (O.getForm().isValid()) {
-                if (O.url)
-                    O.getForm().getEl().dom.action = O.url;
-                if (O.baseParams) {
-                    for (i in O.baseParams) {
-                        O.add({
+            var fp = this.ownerCt.ownerCt,
+                form = fp.getForm();
+            if (form.isValid()) {
+                // check if there are baseParams and if
+                // hiddent items have been added already
+                if (fp.baseParams && !fp.paramsAdded) {
+                    // add hidden items for all baseParams
+                    for (i in fp.baseParams) {
+                        fp.add({
                             xtype: 'hidden',
                             name: i,
-                            value: O.baseParams[i]
-                        })
+                            value: fp.baseParams[i]
+                        });
                     }
-                    O.doLayout();
+                    fp.doLayout();
+                    // set a custom flag to prevent re-adding
+                    fp.paramsAdded = true;
                 }
-                O.getForm().submit();
+                form.{@link #submit}();
             }
         }
     }]
@@ -56376,7 +60480,11 @@ myFormPanel.getForm().submit({
         if(this.standardSubmit){
             var v = this.isValid();
             if(v){
-                this.el.dom.submit();
+                var el = this.el.dom;
+                if(this.url && Ext.isEmpty(el.action)){
+                    el.action = this.url;
+                }
+                el.submit();
             }
             return v;
         }
@@ -56436,7 +60544,7 @@ myFormPanel.getForm().submit({
                 this.waitMsgTarget = Ext.get(this.waitMsgTarget);
                 this.waitMsgTarget.mask(o.waitMsg, 'x-mask-loading');
             }else{
-                Ext.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle || 'Please Wait...');
+                Ext.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle);
             }
         }
     },
@@ -56569,10 +60677,33 @@ myFormPanel.getForm().submit({
         return Ext.urlDecode(fs);
     },
 
-    getFieldValues : function(){
-        var o = {};
+    /**
+     * Retrieves the fields in the form as a set of key/value pairs, using the {@link Ext.form.Field#getValue getValue()} method.
+     * If multiple fields exist with the same name they are returned as an array.
+     * @param {Boolean} dirtyOnly (optional) True to return only fields that are dirty.
+     * @return {Object} The values in the form
+     */
+    getFieldValues : function(dirtyOnly){
+        var o = {},
+            n,
+            key,
+            val;
         this.items.each(function(f){
-           o[f.getName()] = f.getValue();
+            if(dirtyOnly !== true || f.isDirty()){
+                n = f.getName();
+                key = o[n];
+                val = f.getValue();
+                
+                if(Ext.isDefined(key)){
+                    if(Ext.isArray(key)){
+                        o[n].push(val);
+                    }else{
+                        o[n] = [key, val];
+                    }
+                }else{
+                    o[n] = val;
+                }
+            }
         });
         return o;
     },
@@ -56682,13 +60813,13 @@ Ext.BasicForm = Ext.form.BasicForm;/**
  * @class Ext.form.FormPanel
  * @extends Ext.Panel
  * <p>Standard form container.</p>
- * 
+ *
  * <p><b><u>Layout</u></b></p>
  * <p>By default, FormPanel is configured with <tt>layout:'form'</tt> to use an {@link Ext.layout.FormLayout}
  * layout manager, which styles and renders fields and labels correctly. When nesting additional Containers
  * within a FormPanel, you should ensure that any descendant Containers which host input Fields use the
  * {@link Ext.layout.FormLayout} layout manager.</p>
- * 
+ *
  * <p><b><u>BasicForm</u></b></p>
  * <p>Although <b>not listed</b> as configuration options of FormPanel, the FormPanel class accepts all
  * of the config options required to configure its internal {@link Ext.form.BasicForm} for:
@@ -56696,11 +60827,11 @@ Ext.BasicForm = Ext.form.BasicForm;/**
  * <li>{@link Ext.form.BasicForm#fileUpload file uploads}</li>
  * <li>functionality for {@link Ext.form.BasicForm#doAction loading, validating and submitting} the form</li>
  * </ul></div>
- *  
+ *
  * <p><b>Note</b>: If subclassing FormPanel, any configuration options for the BasicForm must be applied to
  * the <tt><b>initialConfig</b></tt> property of the FormPanel. Applying {@link Ext.form.BasicForm BasicForm}
  * configuration settings to <b><tt>this</tt></b> will <b>not</b> affect the BasicForm's configuration.</p>
- * 
+ *
  * <p><b><u>Form Validation</u></b></p>
  * <p>For information on form validation see the following:</p>
  * <div class="mdetail-params"><ul>
@@ -56709,20 +60840,20 @@ Ext.BasicForm = Ext.form.BasicForm;/**
  * <li>{@link Ext.form.BasicForm#doAction BasicForm.doAction <b>clientValidation</b> notes}</li>
  * <li><tt>{@link Ext.form.FormPanel#monitorValid monitorValid}</tt></li>
  * </ul></div>
- * 
+ *
  * <p><b><u>Form Submission</u></b></p>
  * <p>By default, Ext Forms are submitted through Ajax, using {@link Ext.form.Action}. To enable normal browser
  * submission of the {@link Ext.form.BasicForm BasicForm} contained in this FormPanel, see the
  * <tt><b>{@link Ext.form.BasicForm#standardSubmit standardSubmit}</b></tt> option.</p>
- * 
+ *
  * @constructor
  * @param {Object} config Configuration options
  * @xtype form
  */
 Ext.FormPanel = Ext.extend(Ext.Panel, {
-       /**
-        * @cfg {String} formId (optional) The id of the FORM tag (defaults to an auto-generated id).
-        */
+    /**
+     * @cfg {String} formId (optional) The id of the FORM tag (defaults to an auto-generated id).
+     */
     /**
      * @cfg {Boolean} hideLabels
      * <p><tt>true</tt> to hide field labels by default (sets <tt>display:none</tt>). Defaults to
@@ -56784,7 +60915,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
     monitorPoll : 200,
 
     /**
-     * @cfg {String} layout Defaults to <tt>'form'</tt>.  Normally this configuration property should not be altered. 
+     * @cfg {String} layout Defaults to <tt>'form'</tt>.  Normally this configuration property should not be altered.
      * For additional details see {@link Ext.layout.FormLayout} and {@link Ext.Container#layout Ext.Container.layout}.
      */
     layout : 'form',
@@ -56804,7 +60935,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
             this.bodyCfg.enctype = 'multipart/form-data';
         }
         this.initItems();
-        
+
         this.addEvents(
             /**
              * @event clientvalidation
@@ -56831,19 +60962,8 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
         var fn = function(c){
             if(formPanel.isField(c)){
                 f.add(c);
-            }if(c.isFieldWrap){
-                Ext.applyIf(c, {
-                    labelAlign: c.ownerCt.labelAlign,
-                    labelWidth: c.ownerCt.labelWidth,
-                    itemCls: c.ownerCt.itemCls
-                });
-                f.add(c.field);
-            }else if(c.doLayout && c != formPanel){
-                Ext.applyIf(c, {
-                    labelAlign: c.ownerCt.labelAlign,
-                    labelWidth: c.ownerCt.labelWidth,
-                    itemCls: c.ownerCt.itemCls
-                });
+            }else if(c.findBy && c != formPanel){
+                formPanel.applySettings(c);
                 //each check required for check/radio groups.
                 if(c.items && c.items.each){
                     c.items.each(fn, this);
@@ -56853,6 +60973,16 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
         this.items.each(fn, this);
     },
 
+    // private
+    applySettings: function(c){
+        var ct = c.ownerCt;
+        Ext.applyIf(c, {
+            labelAlign: ct.labelAlign,
+            labelWidth: ct.labelWidth,
+            itemCls: ct.itemCls
+        });
+    },
+
     // private
     getLayoutTarget : function(){
         return this.form.el;
@@ -56872,21 +61002,20 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
         Ext.FormPanel.superclass.onRender.call(this, ct, position);
         this.form.initEl(this.body);
     },
-    
+
     // private
     beforeDestroy : function(){
         this.stopMonitoring();
-        Ext.FormPanel.superclass.beforeDestroy.call(this);
         /*
-         * Clear the items here to prevent them being destroyed again.
          * Don't move this behaviour to BasicForm because it can be used
          * on it's own.
          */
-        this.form.items.clear();
         Ext.destroy(this.form);
+        this.form.items.clear();
+        Ext.FormPanel.superclass.beforeDestroy.call(this);
     },
 
-       // Determine if a Component is usable as a form Field.
+    // Determine if a Component is usable as a form Field.
     isField : function(c) {
         return !!c.setValue && !!c.getValue && !!c.markInvalid && !!c.clearInvalid;
     },
@@ -56894,38 +61023,65 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
     // private
     initEvents : function(){
         Ext.FormPanel.superclass.initEvents.call(this);
-        this.on('remove', this.onRemove, this);
-        this.on('add', this.onAdd, this);
+        // Listeners are required here to catch bubbling events from children.
+        this.on({
+            scope: this,
+            add: this.onAddEvent,
+            remove: this.onRemoveEvent
+        });
         if(this.monitorValid){ // initialize after render
             this.startMonitoring();
         }
     },
-    
+
+    // private
+    onAdd: function(c){
+        Ext.FormPanel.superclass.onAdd.call(this, c);
+        this.processAdd(c);
+    },
+
     // private
-    onAdd : function(ct, c) {
-               // If a single form Field, add it
-        if (this.isField(c)) {
+    onAddEvent: function(ct, c){
+        if(ct !== this){
+            this.processAdd(c);
+        }
+    },
+
+    // private
+    processAdd : function(c){
+        // If a single form Field, add it
+        if(this.isField(c)){
             this.form.add(c);
-               // If a Container, add any Fields it might contain
-        } else if (c.findBy) {
-            Ext.applyIf(c, {
-                labelAlign: c.ownerCt.labelAlign,
-                labelWidth: c.ownerCt.labelWidth,
-                itemCls: c.ownerCt.itemCls
-            });
+        // If a Container, add any Fields it might contain
+        }else if(c.findBy){
+            this.applySettings(c);
             this.form.add.apply(this.form, c.findBy(this.isField));
         }
     },
-       
+
+    // private
+    onRemove: function(c){
+        Ext.FormPanel.superclass.onRemove.call(this, c);
+        this.processRemove(c);
+    },
+
+    onRemoveEvent: function(ct, c){
+        if(ct !== this){
+            this.processRemove(c);
+        }
+    },
+
     // private
-    onRemove : function(ct, c) {
-               // If a single form Field, remove it
-        if (this.isField(c)) {
-            Ext.destroy(c.container.up('.x-form-item'));
-               this.form.remove(c);
-               // If a Container, remove any Fields it might contain
-        } else if (c.findByType) {
-            Ext.each(c.findBy(this.isField), this.form.remove, this.form);
+    processRemove : function(c){
+        // If a single form Field, remove it
+        if(this.isField(c)){
+            this.form.remove(c);
+        // If a Container, its already destroyed by the time it gets here.  Remove any references to destroyed fields.
+        }else if(c.findBy){
+            var isDestroyed = function(o) {
+                return !!o.isDestroyed;
+            }
+            this.form.items.filterBy(isDestroyed, this.form).each(this.form.remove, this.form);
         }
     },
 
@@ -56959,7 +61115,7 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
      * @param {Object} options The options to pass to the action (see {@link Ext.form.BasicForm#doAction} for details)
      */
     load : function(){
-        this.form.load.apply(this.form, arguments);  
+        this.form.load.apply(this.form, arguments);
     },
 
     // private
@@ -57006,7 +61162,6 @@ Ext.FormPanel = Ext.extend(Ext.Panel, {
 Ext.reg('form', Ext.FormPanel);
 
 Ext.form.FormPanel = Ext.FormPanel;
-
 /**\r
  * @class Ext.form.FieldSet\r
  * @extends Ext.Panel\r
@@ -57086,1398 +61241,1463 @@ Ext.form.FieldSet = Ext.extend(Ext.Panel, {
     /**\r
      * @cfg {Boolean} collapsible\r
      * <tt>true</tt> to make the fieldset collapsible and have the expand/collapse toggle button automatically\r
-     * rendered into the legend element, <tt>false</tt> to keep the fieldset statically sized with no collapse\r
-     * button (defaults to <tt>false</tt>). Another option is to configure <tt>{@link #checkboxToggle}</tt>.\r
-     */\r
-    /**\r
-     * @cfg {Number} labelWidth The width of labels. This property cascades to child containers.\r
-     */\r
-    /**\r
-     * @cfg {String} itemCls A css class to apply to the <tt>x-form-item</tt> of fields (see \r
-     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} for details).\r
-     * This property cascades to child containers.\r
-     */\r
-    /**\r
-     * @cfg {String} baseCls The base CSS class applied to the fieldset (defaults to <tt>'x-fieldset'</tt>).\r
-     */\r
-    baseCls : 'x-fieldset',\r
-    /**\r
-     * @cfg {String} layout The {@link Ext.Container#layout} to use inside the fieldset (defaults to <tt>'form'</tt>).\r
-     */\r
-    layout : 'form',\r
-    /**\r
-     * @cfg {Boolean} animCollapse\r
-     * <tt>true</tt> to animate the transition when the panel is collapsed, <tt>false</tt> to skip the\r
-     * animation (defaults to <tt>false</tt>).\r
-     */\r
-    animCollapse : false,\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        if(!this.el){\r
-            this.el = document.createElement('fieldset');\r
-            this.el.id = this.id;\r
-            if (this.title || this.header || this.checkboxToggle) {\r
-                this.el.appendChild(document.createElement('legend')).className = 'x-fieldset-header';\r
-            }\r
-        }\r
-\r
-        Ext.form.FieldSet.superclass.onRender.call(this, ct, position);\r
-\r
-        if(this.checkboxToggle){\r
-            var o = typeof this.checkboxToggle == 'object' ?\r
-                    this.checkboxToggle :\r
-                    {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'};\r
-            this.checkbox = this.header.insertFirst(o);\r
-            this.checkbox.dom.checked = !this.collapsed;\r
-            this.mon(this.checkbox, 'click', this.onCheckClick, this);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onCollapse : function(doAnim, animArg){\r
-        if(this.checkbox){\r
-            this.checkbox.dom.checked = false;\r
-        }\r
-        Ext.form.FieldSet.superclass.onCollapse.call(this, doAnim, animArg);\r
-\r
-    },\r
-\r
-    // private\r
-    onExpand : function(doAnim, animArg){\r
-        if(this.checkbox){\r
-            this.checkbox.dom.checked = true;\r
-        }\r
-        Ext.form.FieldSet.superclass.onExpand.call(this, doAnim, animArg);\r
-    },\r
-\r
-    /**\r
-     * This function is called by the fieldset's checkbox when it is toggled (only applies when\r
-     * checkboxToggle = true).  This method should never be called externally, but can be\r
-     * overridden to provide custom behavior when the checkbox is toggled if needed.\r
-     */\r
-    onCheckClick : function(){\r
-        this[this.checkbox.dom.checked ? 'expand' : 'collapse']();\r
-    }\r
-\r
-    /**\r
-     * @cfg {String/Number} activeItem\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Mixed} applyTo\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} bodyBorder\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} border\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean/Number} bufferResize\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} collapseFirst\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} defaultType\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} disabledClass\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} elements\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} floating\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} footer\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} frame\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} header\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} headerAsText\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} hideCollapseTool\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} iconCls\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean/String} shadow\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Number} shadowOffset\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} shim\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Object/Array} tbar\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} tabTip\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Boolean} titleCollapse\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Array} tools\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {Ext.Template/Ext.XTemplate} toolTemplate\r
-     * @hide\r
-     */\r
-    /**\r
-     * @cfg {String} xtype\r
-     * @hide\r
-     */\r
-    /**\r
-     * @property header\r
-     * @hide\r
-     */\r
-    /**\r
-     * @property footer\r
-     * @hide\r
-     */\r
-    /**\r
-     * @method focus\r
-     * @hide\r
-     */\r
-    /**\r
-     * @method getBottomToolbar\r
-     * @hide\r
-     */\r
-    /**\r
-     * @method getTopToolbar\r
-     * @hide\r
-     */\r
-    /**\r
-     * @method setIconClass\r
-     * @hide\r
-     */\r
-    /**\r
-     * @event activate\r
-     * @hide\r
-     */\r
-    /**\r
-     * @event beforeclose\r
-     * @hide\r
-     */\r
-    /**\r
-     * @event bodyresize\r
-     * @hide\r
-     */\r
-    /**\r
-     * @event close\r
-     * @hide\r
-     */\r
-    /**\r
-     * @event deactivate\r
-     * @hide\r
-     */\r
-});\r
-Ext.reg('fieldset', Ext.form.FieldSet);\r
-/**\r
- * @class Ext.form.HtmlEditor\r
- * @extends Ext.form.Field\r
- * Provides a lightweight HTML Editor component. Some toolbar features are not supported by Safari and will be \r
- * automatically hidden when needed.  These are noted in the config options where appropriate.\r
- * <br><br>The editor's toolbar buttons have tooltips defined in the {@link #buttonTips} property, but they are not \r
- * enabled by default unless the global {@link Ext.QuickTips} singleton is {@link Ext.QuickTips#init initialized}.\r
- * <br><br><b>Note: The focus/blur and validation marking functionality inherited from Ext.form.Field is NOT\r
- * supported by this editor.</b>\r
- * <br><br>An Editor is a sensitive component that can't be used in all spots standard fields can be used. Putting an Editor within\r
- * any element that has display set to 'none' can cause problems in Safari and Firefox due to their default iframe reloading bugs.\r
- * <br><br>Example usage:\r
- * <pre><code>\r
-// Simple example rendered with default options:\r
-Ext.QuickTips.init();  // enable tooltips\r
-new Ext.form.HtmlEditor({\r
-    renderTo: Ext.getBody(),\r
-    width: 800,\r
-    height: 300\r
-});\r
-\r
-// Passed via xtype into a container and with custom options:\r
-Ext.QuickTips.init();  // enable tooltips\r
-new Ext.Panel({\r
-    title: 'HTML Editor',\r
-    renderTo: Ext.getBody(),\r
-    width: 600,\r
-    height: 300,\r
-    frame: true,\r
-    layout: 'fit',\r
-    items: {\r
-        xtype: 'htmleditor',\r
-        enableColors: false,\r
-        enableAlignments: false\r
-    }\r
-});\r
-</code></pre>\r
- * @constructor\r
- * Create a new HtmlEditor\r
- * @param {Object} config\r
- * @xtype htmleditor\r
- */\r
-\r
-Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {\r
-    /**\r
-     * @cfg {Boolean} enableFormat Enable the bold, italic and underline buttons (defaults to true)\r
-     */\r
-    enableFormat : true,\r
-    /**\r
-     * @cfg {Boolean} enableFontSize Enable the increase/decrease font size buttons (defaults to true)\r
-     */\r
-    enableFontSize : true,\r
-    /**\r
-     * @cfg {Boolean} enableColors Enable the fore/highlight color buttons (defaults to true)\r
-     */\r
-    enableColors : true,\r
-    /**\r
-     * @cfg {Boolean} enableAlignments Enable the left, center, right alignment buttons (defaults to true)\r
-     */\r
-    enableAlignments : true,\r
-    /**\r
-     * @cfg {Boolean} enableLists Enable the bullet and numbered list buttons. Not available in Safari. (defaults to true)\r
-     */\r
-    enableLists : true,\r
-    /**\r
-     * @cfg {Boolean} enableSourceEdit Enable the switch to source edit button. Not available in Safari. (defaults to true)\r
-     */\r
-    enableSourceEdit : true,\r
-    /**\r
-     * @cfg {Boolean} enableLinks Enable the create link button. Not available in Safari. (defaults to true)\r
-     */\r
-    enableLinks : true,\r
-    /**\r
-     * @cfg {Boolean} enableFont Enable font selection. Not available in Safari. (defaults to true)\r
-     */\r
-    enableFont : true,\r
-    /**\r
-     * @cfg {String} createLinkText The default text for the create link prompt\r
-     */\r
-    createLinkText : 'Please enter the URL for the link:',\r
-    /**\r
-     * @cfg {String} defaultLinkValue The default value for the create link prompt (defaults to http:/ /)\r
-     */\r
-    defaultLinkValue : 'http:/'+'/',\r
-    /**\r
-     * @cfg {Array} fontFamilies An array of available font families\r
-     */\r
-    fontFamilies : [\r
-        'Arial',\r
-        'Courier New',\r
-        'Tahoma',\r
-        'Times New Roman',\r
-        'Verdana'\r
-    ],\r
-    defaultFont: 'tahoma',\r
-    /**\r
-     * @cfg {String} defaultValue A default value to be put into the editor to resolve focus issues (defaults to &#8203; (Zero-width space), &nbsp; (Non-breaking space) in Opera and IE6).\r
-     */\r
-    defaultValue: (Ext.isOpera || Ext.isIE6) ? '&nbsp;' : '&#8203;',\r
-\r
-    // private properties\r
-    actionMode: 'wrap',\r
-    validationEvent : false,\r
-    deferHeight: true,\r
-    initialized : false,\r
-    activated : false,\r
-    sourceEditMode : false,\r
-    onFocus : Ext.emptyFn,\r
-    iframePad:3,\r
-    hideMode:'offsets',\r
-    defaultAutoCreate : {\r
-        tag: "textarea",\r
-        style:"width:500px;height:300px;",\r
-        autocomplete: "off"\r
-    },\r
-\r
-    // private\r
-    initComponent : function(){\r
-        this.addEvents(\r
-            /**\r
-             * @event initialize\r
-             * Fires when the editor is fully initialized (including the iframe)\r
-             * @param {HtmlEditor} this\r
-             */\r
-            'initialize',\r
-            /**\r
-             * @event activate\r
-             * Fires when the editor is first receives the focus. Any insertion must wait\r
-             * until after this event.\r
-             * @param {HtmlEditor} this\r
-             */\r
-            'activate',\r
-             /**\r
-             * @event beforesync\r
-             * Fires before the textarea is updated with content from the editor iframe. Return false\r
-             * to cancel the sync.\r
-             * @param {HtmlEditor} this\r
-             * @param {String} html\r
-             */\r
-            'beforesync',\r
-             /**\r
-             * @event beforepush\r
-             * Fires before the iframe editor is updated with content from the textarea. Return false\r
-             * to cancel the push.\r
-             * @param {HtmlEditor} this\r
-             * @param {String} html\r
-             */\r
-            'beforepush',\r
-             /**\r
-             * @event sync\r
-             * Fires when the textarea is updated with content from the editor iframe.\r
-             * @param {HtmlEditor} this\r
-             * @param {String} html\r
-             */\r
-            'sync',\r
-             /**\r
-             * @event push\r
-             * Fires when the iframe editor is updated with content from the textarea.\r
-             * @param {HtmlEditor} this\r
-             * @param {String} html\r
-             */\r
-            'push',\r
-             /**\r
-             * @event editmodechange\r
-             * Fires when the editor switches edit modes\r
-             * @param {HtmlEditor} this\r
-             * @param {Boolean} sourceEdit True if source edit, false if standard editing.\r
-             */\r
-            'editmodechange'\r
-        )\r
-    },\r
-\r
-    // private\r
-    createFontOptions : function(){\r
-        var buf = [], fs = this.fontFamilies, ff, lc;\r
-        for(var i = 0, len = fs.length; i< len; i++){\r
-            ff = fs[i];\r
-            lc = ff.toLowerCase();\r
-            buf.push(\r
-                '<option value="',lc,'" style="font-family:',ff,';"',\r
-                    (this.defaultFont == lc ? ' selected="true">' : '>'),\r
-                    ff,\r
-                '</option>'\r
-            );\r
-        }\r
-        return buf.join('');\r
-    },\r
-    \r
-    /*\r
-     * Protected method that will not generally be called directly. It\r
-     * is called when the editor creates its toolbar. Override this method if you need to\r
-     * add custom toolbar buttons.\r
-     * @param {HtmlEditor} editor\r
-     */\r
-    createToolbar : function(editor){\r
-        \r
-        var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();\r
-        \r
-        function btn(id, toggle, handler){\r
-            return {\r
-                itemId : id,\r
-                cls : 'x-btn-icon',\r
-                iconCls: 'x-edit-'+id,\r
-                enableToggle:toggle !== false,\r
-                scope: editor,\r
-                handler:handler||editor.relayBtnCmd,\r
-                clickEvent:'mousedown',\r
-                tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined,\r
-                overflowText: editor.buttonTips[id].title || undefined,\r
-                tabIndex:-1\r
-            };\r
-        }\r
-\r
-        // build the toolbar\r
-        var tb = new Ext.Toolbar({\r
-            renderTo:this.wrap.dom.firstChild\r
-        });\r
-\r
-        // stop form submits\r
-        this.mon(tb.el, 'click', function(e){\r
-            e.preventDefault();\r
-        });\r
-\r
-        if(this.enableFont && !Ext.isSafari2){\r
-            this.fontSelect = tb.el.createChild({\r
-                tag:'select',\r
-                cls:'x-font-select',\r
-                html: this.createFontOptions()\r
-            });\r
-            this.mon(this.fontSelect, 'change', function(){\r
-                var font = this.fontSelect.dom.value;\r
-                this.relayCmd('fontname', font);\r
-                this.deferFocus();\r
-            }, this);\r
-\r
-            tb.add(\r
-                this.fontSelect.dom,\r
-                '-'\r
-            );\r
-        }\r
-\r
-        if(this.enableFormat){\r
-            tb.add(\r
-                btn('bold'),\r
-                btn('italic'),\r
-                btn('underline')\r
-            );\r
-        }\r
-\r
-        if(this.enableFontSize){\r
-            tb.add(\r
-                '-',\r
-                btn('increasefontsize', false, this.adjustFont),\r
-                btn('decreasefontsize', false, this.adjustFont)\r
-            );\r
-        }\r
-\r
-        if(this.enableColors){\r
-            tb.add(\r
-                '-', {\r
-                    itemId:'forecolor',\r
-                    cls:'x-btn-icon',\r
-                    iconCls: 'x-edit-forecolor',\r
-                    clickEvent:'mousedown',\r
-                    tooltip: tipsEnabled ? editor.buttonTips.forecolor || undefined : undefined,\r
-                    tabIndex:-1,\r
-                    menu : new Ext.menu.ColorMenu({\r
-                        allowReselect: true,\r
-                        focus: Ext.emptyFn,\r
-                        value:'000000',\r
-                        plain:true,\r
-                        listeners: {\r
-                            scope: this,\r
-                            select: function(cp, color){\r
-                                this.execCmd('forecolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);\r
-                                this.deferFocus();\r
-                            }\r
-                        },\r
-                        clickEvent:'mousedown'\r
-                    })\r
-                }, {\r
-                    itemId:'backcolor',\r
-                    cls:'x-btn-icon',\r
-                    iconCls: 'x-edit-backcolor',\r
-                    clickEvent:'mousedown',\r
-                    tooltip: tipsEnabled ? editor.buttonTips.backcolor || undefined : undefined,\r
-                    tabIndex:-1,\r
-                    menu : new Ext.menu.ColorMenu({\r
-                        focus: Ext.emptyFn,\r
-                        value:'FFFFFF',\r
-                        plain:true,\r
-                        allowReselect: true,\r
-                        listeners: {\r
-                            scope: this,\r
-                            select: function(cp, color){\r
-                                if(Ext.isGecko){\r
-                                    this.execCmd('useCSS', false);\r
-                                    this.execCmd('hilitecolor', color);\r
-                                    this.execCmd('useCSS', true);\r
-                                    this.deferFocus();\r
-                                }else{\r
-                                    this.execCmd(Ext.isOpera ? 'hilitecolor' : 'backcolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);\r
-                                    this.deferFocus();\r
-                                }\r
-                            }\r
-                        },\r
-                        clickEvent:'mousedown'\r
-                    })\r
-                }\r
-            );\r
-        }\r
-\r
-        if(this.enableAlignments){\r
-            tb.add(\r
-                '-',\r
-                btn('justifyleft'),\r
-                btn('justifycenter'),\r
-                btn('justifyright')\r
-            );\r
-        }\r
-\r
-        if(!Ext.isSafari2){\r
-            if(this.enableLinks){\r
-                tb.add(\r
-                    '-',\r
-                    btn('createlink', false, this.createLink)\r
-                );\r
-            }\r
-\r
-            if(this.enableLists){\r
-                tb.add(\r
-                    '-',\r
-                    btn('insertorderedlist'),\r
-                    btn('insertunorderedlist')\r
-                );\r
-            }\r
-            if(this.enableSourceEdit){\r
-                tb.add(\r
-                    '-',\r
-                    btn('sourceedit', true, function(btn){\r
-                        this.toggleSourceEdit(!this.sourceEditMode);\r
-                    })\r
-                );\r
-            }\r
-        }\r
-\r
-        this.tb = tb;\r
-    },\r
-\r
-    /**\r
-     * Protected method that will not generally be called directly. It\r
-     * is called when the editor initializes the iframe with HTML contents. Override this method if you\r
-     * want to change the initialization markup of the iframe (e.g. to add stylesheets).\r
-     */\r
-    getDocMarkup : function(){\r
-        return '<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>';\r
-    },\r
-\r
-    // private\r
-    getEditorBody : function(){\r
-        return this.doc.body || this.doc.documentElement;\r
-    },\r
-\r
-    // private\r
-    getDoc : function(){\r
-        return Ext.isIE ? this.getWin().document : (this.iframe.contentDocument || this.getWin().document);\r
-    },\r
-\r
-    // private\r
-    getWin : function(){\r
-        return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name];\r
-    },\r
-\r
-    // private\r
-    onRender : function(ct, position){\r
-        Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position);\r
-        this.el.dom.style.border = '0 none';\r
-        this.el.dom.setAttribute('tabIndex', -1);\r
-        this.el.addClass('x-hidden');\r
-        if(Ext.isIE){ // fix IE 1px bogus margin\r
-            this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')\r
-        }\r
-        this.wrap = this.el.wrap({\r
-            cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'}\r
-        });\r
-\r
-        this.createToolbar(this);\r
-\r
-        this.disableItems(true);\r
-        // is this needed?\r
-        // this.tb.doLayout();\r
-\r
-        this.createIFrame();\r
-\r
-        if(!this.width){\r
-            var sz = this.el.getSize();\r
-            this.setSize(sz.width, this.height || sz.height);\r
-        }\r
-    },\r
-\r
-    createIFrame: function(){\r
-        var iframe = document.createElement('iframe');\r
-        iframe.name = Ext.id();\r
-        iframe.frameBorder = '0';\r
-        iframe.src = Ext.isIE ? Ext.SSL_SECURE_URL : "javascript:;";\r
-        this.wrap.dom.appendChild(iframe);\r
-\r
-        this.iframe = iframe;\r
-\r
-        this.monitorTask = Ext.TaskMgr.start({\r
-            run: this.checkDesignMode,\r
-            scope: this,\r
-            interval:100\r
-        });\r
-    },\r
-\r
-    initFrame : function(){\r
-        Ext.TaskMgr.stop(this.monitorTask);\r
-        this.doc = this.getDoc();\r
-        this.win = this.getWin();\r
-\r
-        this.doc.open();\r
-        this.doc.write(this.getDocMarkup());\r
-        this.doc.close();\r
-\r
-        var task = { // must defer to wait for browser to be ready\r
-            run : function(){\r
-                if(this.doc.body || this.doc.readyState == 'complete'){\r
-                    Ext.TaskMgr.stop(task);\r
-                    this.doc.designMode="on";\r
-                    this.initEditor.defer(10, this);\r
-                }\r
-            },\r
-            interval : 10,\r
-            duration:10000,\r
-            scope: this\r
-        };\r
-        Ext.TaskMgr.start(task);\r
-    },\r
-\r
-\r
-    checkDesignMode : function(){\r
-        if(this.wrap && this.wrap.dom.offsetWidth){\r
-            var doc = this.getDoc();\r
-            if(!doc){\r
-                return;\r
-            }\r
-            if(!doc.editorInitialized || String(doc.designMode).toLowerCase() != 'on'){\r
-                this.initFrame();\r
-            }\r
-        }\r
-    },\r
-    \r
-    disableItems: function(disabled){\r
-        if(this.fontSelect){\r
-            this.fontSelect.dom.disabled = disabled;\r
-        }\r
-        this.tb.items.each(function(item){\r
-            if(item.itemId != 'sourceedit'){\r
-                item.setDisabled(disabled);\r
-            }\r
-        });\r
-    },\r
-\r
-    // private\r
-    onResize : function(w, h){\r
-        Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);\r
-        if(this.el && this.iframe){\r
-            if(typeof w == 'number'){\r
-                var aw = w - this.wrap.getFrameWidth('lr');\r
-                this.el.setWidth(this.adjustWidth('textarea', aw));\r
-                this.tb.setWidth(aw);\r
-                this.iframe.style.width = Math.max(aw, 0) + 'px';\r
-            }\r
-            if(typeof h == 'number'){\r
-                var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight();\r
-                this.el.setHeight(this.adjustWidth('textarea', ah));\r
-                this.iframe.style.height = Math.max(ah, 0) + 'px';\r
-                if(this.doc){\r
-                    this.getEditorBody().style.height = Math.max((ah - (this.iframePad*2)), 0) + 'px';\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Toggles the editor between standard and source edit mode.\r
-     * @param {Boolean} sourceEdit (optional) True for source edit, false for standard\r
-     */\r
-    toggleSourceEdit : function(sourceEditMode){\r
-        if(sourceEditMode === undefined){\r
-            sourceEditMode = !this.sourceEditMode;\r
-        }\r
-        this.sourceEditMode = sourceEditMode === true;\r
-        var btn = this.tb.items.get('sourceedit');\r
-        if(btn.pressed !== this.sourceEditMode){\r
-            btn.toggle(this.sourceEditMode);\r
-            if(!btn.xtbHidden){\r
-                return;\r
-            }\r
-        }\r
-        if(this.sourceEditMode){\r
-            this.disableItems(true);\r
-            this.syncValue();\r
-            this.iframe.className = 'x-hidden';\r
-            this.el.removeClass('x-hidden');\r
-            this.el.dom.removeAttribute('tabIndex');\r
-            this.el.focus();\r
-        }else{\r
-            if(this.initialized){\r
-                this.disableItems(false);\r
-            }\r
-            this.pushValue();\r
-            this.iframe.className = '';\r
-            this.el.addClass('x-hidden');\r
-            this.el.dom.setAttribute('tabIndex', -1);\r
-            this.deferFocus();\r
-        }\r
-        var lastSize = this.lastSize;\r
-        if(lastSize){\r
-            delete this.lastSize;\r
-            this.setSize(lastSize);\r
-        }\r
-        this.fireEvent('editmodechange', this, this.sourceEditMode);\r
-    },\r
-\r
-    // private used internally\r
-    createLink : function(){\r
-        var url = prompt(this.createLinkText, this.defaultLinkValue);\r
-        if(url && url != 'http:/'+'/'){\r
-            this.relayCmd('createlink', url);\r
-        }\r
-    },\r
-\r
-    // private (for BoxComponent)\r
-    adjustSize : Ext.BoxComponent.prototype.adjustSize,\r
-\r
-    // private (for BoxComponent)\r
-    getResizeEl : function(){\r
-        return this.wrap;\r
-    },\r
-\r
-    // private (for BoxComponent)\r
-    getPositionEl : function(){\r
-        return this.wrap;\r
-    },\r
-\r
-    // private\r
-    initEvents : function(){\r
-        this.originalValue = this.getValue();\r
-    },\r
-\r
+     * rendered into the legend element, <tt>false</tt> to keep the fieldset statically sized with no collapse\r
+     * button (defaults to <tt>false</tt>). Another option is to configure <tt>{@link #checkboxToggle}</tt>.\r
+     */\r
     /**\r
-     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide\r
-     * @method\r
+     * @cfg {Number} labelWidth The width of labels. This property cascades to child containers.\r
      */\r
-    markInvalid : Ext.emptyFn,\r
-    \r
     /**\r
-     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide\r
-     * @method\r
+     * @cfg {String} itemCls A css class to apply to the <tt>x-form-item</tt> of fields (see \r
+     * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} for details).\r
+     * This property cascades to child containers.\r
      */\r
-    clearInvalid : Ext.emptyFn,\r
-\r
-    // docs inherit from Field\r
-    setValue : function(v){\r
-        Ext.form.HtmlEditor.superclass.setValue.call(this, v);\r
-        this.pushValue();\r
-        return this;\r
-    },\r
-\r
     /**\r
-     * Protected method that will not generally be called directly. If you need/want\r
-     * custom HTML cleanup, this is the method you should override.\r
-     * @param {String} html The HTML to be cleaned\r
-     * @return {String} The cleaned HTML\r
+     * @cfg {String} baseCls The base CSS class applied to the fieldset (defaults to <tt>'x-fieldset'</tt>).\r
      */\r
-    cleanHtml : function(html){\r
-        html = String(html);\r
-        if(html.length > 5){\r
-            if(Ext.isWebKit){ // strip safari nonsense\r
-                html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');\r
-            }\r
-        }\r
-        if(html == this.defaultValue){\r
-            html = '';\r
-        }\r
-        return html;\r
-    },\r
-\r
+    baseCls : 'x-fieldset',\r
     /**\r
-     * Protected method that will not generally be called directly. Syncs the contents\r
-     * of the editor iframe with the textarea.\r
+     * @cfg {String} layout The {@link Ext.Container#layout} to use inside the fieldset (defaults to <tt>'form'</tt>).\r
      */\r
-    syncValue : function(){\r
-        if(this.initialized){\r
-            var bd = this.getEditorBody();\r
-            var html = bd.innerHTML;\r
-            if(Ext.isWebKit){\r
-                var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!\r
-                var m = bs.match(/text-align:(.*?);/i);\r
-                if(m && m[1]){\r
-                    html = '<div style="'+m[0]+'">' + html + '</div>';\r
-                }\r
-            }\r
-            html = this.cleanHtml(html);\r
-            if(this.fireEvent('beforesync', this, html) !== false){\r
-                this.el.dom.value = html;\r
-                this.fireEvent('sync', this, html);\r
-            }\r
-        }\r
-    },\r
-    \r
-    //docs inherit from Field\r
-    getValue : function() {\r
-        this[this.sourceEditMode ? 'pushValue' : 'syncValue']();\r
-        return Ext.form.HtmlEditor.superclass.getValue.call(this);\r
-    },\r
-\r
+    layout : 'form',\r
     /**\r
-     * Protected method that will not generally be called directly. Pushes the value of the textarea\r
-     * into the iframe editor.\r
+     * @cfg {Boolean} animCollapse\r
+     * <tt>true</tt> to animate the transition when the panel is collapsed, <tt>false</tt> to skip the\r
+     * animation (defaults to <tt>false</tt>).\r
      */\r
-    pushValue : function(){\r
-        if(this.initialized){\r
-            var v = this.el.dom.value;\r
-            if(!this.activated && v.length < 1){\r
-                v = this.defaultValue;\r
-            }\r
-            if(this.fireEvent('beforepush', this, v) !== false){\r
-                this.getEditorBody().innerHTML = v;\r
-                if(Ext.isGecko){\r
-                    // Gecko hack, see: https://bugzilla.mozilla.org/show_bug.cgi?id=232791#c8\r
-                    var d = this.doc,\r
-                        mode = d.designMode.toLowerCase();\r
-                    \r
-                    d.designMode = mode.toggle('on', 'off');\r
-                    d.designMode = mode;\r
-                }\r
-                this.fireEvent('push', this, v);\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    deferFocus : function(){\r
-        this.focus.defer(10, this);\r
-    },\r
-\r
-    // docs inherit from Field\r
-    focus : function(){\r
-        if(this.win && !this.sourceEditMode){\r
-            this.win.focus();\r
-        }else{\r
-            this.el.focus();\r
-        }\r
-    },\r
-\r
-    // private\r
-    initEditor : function(){\r
-        //Destroying the component during/before initEditor can cause issues.\r
-        try{\r
-            var dbody = this.getEditorBody();\r
-            var ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat');\r
-            ss['background-attachment'] = 'fixed'; // w3c\r
-            dbody.bgProperties = 'fixed'; // ie\r
-\r
-            Ext.DomHelper.applyStyles(dbody, ss);\r
-\r
-            if(this.doc){\r
-                try{\r
-                    Ext.EventManager.removeAll(this.doc);\r
-                }catch(e){}\r
-            }\r
-\r
-            this.doc = this.getDoc();\r
-\r
-            Ext.EventManager.on(this.doc, {\r
-                'mousedown': this.onEditorEvent,\r
-                'dblclick': this.onEditorEvent,\r
-                'click': this.onEditorEvent,\r
-                'keyup': this.onEditorEvent,\r
-                buffer:100,\r
-                scope: this\r
-            });\r
-\r
-            if(Ext.isGecko){\r
-                Ext.EventManager.on(this.doc, 'keypress', this.applyCommand, this);\r
-            }\r
-            if(Ext.isIE || Ext.isWebKit || Ext.isOpera){\r
-                Ext.EventManager.on(this.doc, 'keydown', this.fixKeys, this);\r
-            }\r
-            this.initialized = true;\r
-            this.fireEvent('initialize', this);\r
-            this.doc.editorInitialized = true;\r
-            this.pushValue();\r
-        }catch(e){}\r
-    },\r
+    animCollapse : false,\r
 \r
     // private\r
-    onDestroy : function(){\r
-        if(this.monitorTask){\r
-            Ext.TaskMgr.stop(this.monitorTask);\r
-        }\r
-        if(this.rendered){\r
-            Ext.destroy(this.tb);\r
-            if(this.wrap){\r
-                this.wrap.dom.innerHTML = '';\r
-                this.wrap.remove();\r
+    onRender : function(ct, position){\r
+        if(!this.el){\r
+            this.el = document.createElement('fieldset');\r
+            this.el.id = this.id;\r
+            if (this.title || this.header || this.checkboxToggle) {\r
+                this.el.appendChild(document.createElement('legend')).className = this.baseCls + '-header';\r
             }\r
         }\r
-        if(this.el){\r
-            this.el.removeAllListeners();\r
-            this.el.remove();\r
-        }\r
\r
-        if(this.doc){\r
-            try{\r
-                Ext.EventManager.removeAll(this.doc);\r
-                for (var prop in this.doc){\r
-                   delete this.doc[prop];\r
-                }\r
-            }catch(e){}\r
-        }\r
-        this.purgeListeners();\r
-    },\r
 \r
-    // private\r
-    onFirstFocus : function(){\r
-        this.activated = true;\r
-        this.disableItems(false);\r
-        if(Ext.isGecko){ // prevent silly gecko errors\r
-            this.win.focus();\r
-            var s = this.win.getSelection();\r
-            if(!s.focusNode || s.focusNode.nodeType != 3){\r
-                var r = s.getRangeAt(0);\r
-                r.selectNodeContents(this.getEditorBody());\r
-                r.collapse(true);\r
-                this.deferFocus();\r
-            }\r
-            try{\r
-                this.execCmd('useCSS', true);\r
-                this.execCmd('styleWithCSS', false);\r
-            }catch(e){}\r
-        }\r
-        this.fireEvent('activate', this);\r
-    },\r
+        Ext.form.FieldSet.superclass.onRender.call(this, ct, position);\r
 \r
-    // private\r
-    adjustFont: function(btn){\r
-        var adjust = btn.itemId == 'increasefontsize' ? 1 : -1;\r
-\r
-        var v = parseInt(this.doc.queryCommandValue('FontSize') || 2, 10);\r
-        if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){\r
-            // Safari 3 values\r
-            // 1 = 10px, 2 = 13px, 3 = 16px, 4 = 18px, 5 = 24px, 6 = 32px\r
-            if(v <= 10){\r
-                v = 1 + adjust;\r
-            }else if(v <= 13){\r
-                v = 2 + adjust;\r
-            }else if(v <= 16){\r
-                v = 3 + adjust;\r
-            }else if(v <= 18){\r
-                v = 4 + adjust;\r
-            }else if(v <= 24){\r
-                v = 5 + adjust;\r
-            }else {\r
-                v = 6 + adjust;\r
-            }\r
-            v = v.constrain(1, 6);\r
-        }else{\r
-            if(Ext.isSafari){ // safari\r
-                adjust *= 2;\r
-            }\r
-            v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0);\r
+        if(this.checkboxToggle){\r
+            var o = typeof this.checkboxToggle == 'object' ?\r
+                    this.checkboxToggle :\r
+                    {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'};\r
+            this.checkbox = this.header.insertFirst(o);\r
+            this.checkbox.dom.checked = !this.collapsed;\r
+            this.mon(this.checkbox, 'click', this.onCheckClick, this);\r
         }\r
-        this.execCmd('FontSize', v);\r
     },\r
 \r
     // private\r
-    onEditorEvent : function(e){\r
-        this.updateToolbar();\r
-    },\r
-\r
-\r
-    /**\r
-     * Protected method that will not generally be called directly. It triggers\r
-     * a toolbar update by reading the markup state of the current selection in the editor.\r
-     */\r
-    updateToolbar: function(){\r
-\r
-        if(!this.activated){\r
-            this.onFirstFocus();\r
-            return;\r
-        }\r
-\r
-        var btns = this.tb.items.map, doc = this.doc;\r
-\r
-        if(this.enableFont && !Ext.isSafari2){\r
-            var name = (this.doc.queryCommandValue('FontName')||this.defaultFont).toLowerCase();\r
-            if(name != this.fontSelect.dom.value){\r
-                this.fontSelect.dom.value = name;\r
-            }\r
-        }\r
-        if(this.enableFormat){\r
-            btns.bold.toggle(doc.queryCommandState('bold'));\r
-            btns.italic.toggle(doc.queryCommandState('italic'));\r
-            btns.underline.toggle(doc.queryCommandState('underline'));\r
-        }\r
-        if(this.enableAlignments){\r
-            btns.justifyleft.toggle(doc.queryCommandState('justifyleft'));\r
-            btns.justifycenter.toggle(doc.queryCommandState('justifycenter'));\r
-            btns.justifyright.toggle(doc.queryCommandState('justifyright'));\r
-        }\r
-        if(!Ext.isSafari2 && this.enableLists){\r
-            btns.insertorderedlist.toggle(doc.queryCommandState('insertorderedlist'));\r
-            btns.insertunorderedlist.toggle(doc.queryCommandState('insertunorderedlist'));\r
+    onCollapse : function(doAnim, animArg){\r
+        if(this.checkbox){\r
+            this.checkbox.dom.checked = false;\r
         }\r
-        \r
-        Ext.menu.MenuMgr.hideAll();\r
-\r
-        this.syncValue();\r
-    },\r
-\r
-    // private\r
-    relayBtnCmd : function(btn){\r
-        this.relayCmd(btn.itemId);\r
-    },\r
-\r
-    /**\r
-     * Executes a Midas editor command on the editor document and performs necessary focus and\r
-     * toolbar updates. <b>This should only be called after the editor is initialized.</b>\r
-     * @param {String} cmd The Midas command\r
-     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)\r
-     */\r
-    relayCmd : function(cmd, value){\r
-        (function(){\r
-            this.focus();\r
-            this.execCmd(cmd, value);\r
-            this.updateToolbar();\r
-        }).defer(10, this);\r
-    },\r
+        Ext.form.FieldSet.superclass.onCollapse.call(this, doAnim, animArg);\r
 \r
-    /**\r
-     * Executes a Midas editor command directly on the editor document.\r
-     * For visual commands, you should use {@link #relayCmd} instead.\r
-     * <b>This should only be called after the editor is initialized.</b>\r
-     * @param {String} cmd The Midas command\r
-     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)\r
-     */\r
-    execCmd : function(cmd, value){\r
-        this.doc.execCommand(cmd, false, value === undefined ? null : value);\r
-        this.syncValue();\r
     },\r
 \r
     // private\r
-    applyCommand : function(e){\r
-        if(e.ctrlKey){\r
-            var c = e.getCharCode(), cmd;\r
-            if(c > 0){\r
-                c = String.fromCharCode(c);\r
-                switch(c){\r
-                    case 'b':\r
-                        cmd = 'bold';\r
-                    break;\r
-                    case 'i':\r
-                        cmd = 'italic';\r
-                    break;\r
-                    case 'u':\r
-                        cmd = 'underline';\r
-                    break;\r
-                }\r
-                if(cmd){\r
-                    this.win.focus();\r
-                    this.execCmd(cmd);\r
-                    this.deferFocus();\r
-                    e.preventDefault();\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Inserts the passed text at the current cursor position. Note: the editor must be initialized and activated\r
-     * to insert text.\r
-     * @param {String} text\r
-     */\r
-    insertAtCursor : function(text){\r
-        if(!this.activated){\r
-            return;\r
-        }\r
-        if(Ext.isIE){\r
-            this.win.focus();\r
-            var r = this.doc.selection.createRange();\r
-            if(r){\r
-                r.collapse(true);\r
-                r.pasteHTML(text);\r
-                this.syncValue();\r
-                this.deferFocus();\r
-            }\r
-        }else if(Ext.isGecko || Ext.isOpera){\r
-            this.win.focus();\r
-            this.execCmd('InsertHTML', text);\r
-            this.deferFocus();\r
-        }else if(Ext.isWebKit){\r
-            this.execCmd('InsertText', text);\r
-            this.deferFocus();\r
+    onExpand : function(doAnim, animArg){\r
+        if(this.checkbox){\r
+            this.checkbox.dom.checked = true;\r
         }\r
+        Ext.form.FieldSet.superclass.onExpand.call(this, doAnim, animArg);\r
     },\r
 \r
-    // private\r
-    fixKeys : function(){ // load time branching for fastest keydown performance\r
-        if(Ext.isIE){\r
-            return function(e){\r
-                var k = e.getKey(), r;\r
-                if(k == e.TAB){\r
-                    e.stopEvent();\r
-                    r = this.doc.selection.createRange();\r
-                    if(r){\r
-                        r.collapse(true);\r
-                        r.pasteHTML('&nbsp;&nbsp;&nbsp;&nbsp;');\r
-                        this.deferFocus();\r
-                    }\r
-                }else if(k == e.ENTER){\r
-                    r = this.doc.selection.createRange();\r
-                    if(r){\r
-                        var target = r.parentElement();\r
-                        if(!target || target.tagName.toLowerCase() != 'li'){\r
-                            e.stopEvent();\r
-                            r.pasteHTML('<br />');\r
-                            r.collapse(false);\r
-                            r.select();\r
-                        }\r
-                    }\r
-                }\r
-            };\r
-        }else if(Ext.isOpera){\r
-            return function(e){\r
-                var k = e.getKey();\r
-                if(k == e.TAB){\r
-                    e.stopEvent();\r
-                    this.win.focus();\r
-                    this.execCmd('InsertHTML','&nbsp;&nbsp;&nbsp;&nbsp;');\r
-                    this.deferFocus();\r
-                }\r
-            };\r
-        }else if(Ext.isWebKit){\r
-            return function(e){\r
-                var k = e.getKey();\r
-                if(k == e.TAB){\r
-                    e.stopEvent();\r
-                    this.execCmd('InsertText','\t');\r
-                    this.deferFocus();\r
-                }\r
-             };\r
-        }\r
-    }(),\r
-\r
     /**\r
-     * Returns the editor's toolbar. <b>This is only available after the editor has been rendered.</b>\r
-     * @return {Ext.Toolbar}\r
+     * This function is called by the fieldset's checkbox when it is toggled (only applies when\r
+     * checkboxToggle = true).  This method should never be called externally, but can be\r
+     * overridden to provide custom behavior when the checkbox is toggled if needed.\r
      */\r
-    getToolbar : function(){\r
-        return this.tb;\r
-    },\r
+    onCheckClick : function(){\r
+        this[this.checkbox.dom.checked ? 'expand' : 'collapse']();\r
+    }\r
 \r
     /**\r
-     * Object collection of toolbar tooltips for the buttons in the editor. The key\r
-     * is the command id associated with that button and the value is a valid QuickTips object.\r
-     * For example:\r
-<pre><code>\r
-{\r
-    bold : {\r
-        title: 'Bold (Ctrl+B)',\r
-        text: 'Make the selected text bold.',\r
-        cls: 'x-html-editor-tip'\r
-    },\r
-    italic : {\r
-        title: 'Italic (Ctrl+I)',\r
-        text: 'Make the selected text italic.',\r
-        cls: 'x-html-editor-tip'\r
-    },\r
-    ...\r
-</code></pre>\r
-    * @type Object\r
+     * @cfg {String/Number} activeItem\r
+     * @hide\r
      */\r
-    buttonTips : {\r
-        bold : {\r
-            title: 'Bold (Ctrl+B)',\r
-            text: 'Make the selected text bold.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        italic : {\r
-            title: 'Italic (Ctrl+I)',\r
-            text: 'Make the selected text italic.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        underline : {\r
-            title: 'Underline (Ctrl+U)',\r
-            text: 'Underline the selected text.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        increasefontsize : {\r
-            title: 'Grow Text',\r
-            text: 'Increase the font size.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        decreasefontsize : {\r
-            title: 'Shrink Text',\r
-            text: 'Decrease the font size.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        backcolor : {\r
-            title: 'Text Highlight Color',\r
-            text: 'Change the background color of the selected text.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        forecolor : {\r
-            title: 'Font Color',\r
-            text: 'Change the color of the selected text.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        justifyleft : {\r
-            title: 'Align Text Left',\r
-            text: 'Align text to the left.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        justifycenter : {\r
-            title: 'Center Text',\r
-            text: 'Center text in the editor.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        justifyright : {\r
-            title: 'Align Text Right',\r
-            text: 'Align text to the right.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        insertunorderedlist : {\r
-            title: 'Bullet List',\r
-            text: 'Start a bulleted list.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        insertorderedlist : {\r
-            title: 'Numbered List',\r
-            text: 'Start a numbered list.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        createlink : {\r
-            title: 'Hyperlink',\r
-            text: 'Make the selected text a hyperlink.',\r
-            cls: 'x-html-editor-tip'\r
-        },\r
-        sourceedit : {\r
-            title: 'Source Edit',\r
-            text: 'Switch to source editing mode.',\r
-            cls: 'x-html-editor-tip'\r
-        }\r
-    }\r
-\r
-    // hide stuff that is not compatible\r
     /**\r
-     * @event blur\r
+     * @cfg {Mixed} applyTo\r
      * @hide\r
      */\r
     /**\r
-     * @event change\r
+     * @cfg {Boolean} bodyBorder\r
      * @hide\r
      */\r
     /**\r
-     * @event focus\r
+     * @cfg {Boolean} border\r
      * @hide\r
      */\r
     /**\r
-     * @event specialkey\r
+     * @cfg {Boolean/Number} bufferResize\r
      * @hide\r
      */\r
     /**\r
-     * @cfg {String} fieldClass @hide\r
+     * @cfg {Boolean} collapseFirst\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} focusClass @hide\r
+     * @cfg {String} defaultType\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} autoCreate @hide\r
+     * @cfg {String} disabledClass\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} inputType @hide\r
+     * @cfg {String} elements\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} invalidClass @hide\r
+     * @cfg {Boolean} floating\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} invalidText @hide\r
+     * @cfg {Boolean} footer\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} msgFx @hide\r
+     * @cfg {Boolean} frame\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} validateOnBlur @hide\r
+     * @cfg {Boolean} header\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {Boolean} allowDomMove  @hide\r
+     * @cfg {Boolean} headerAsText\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} applyTo @hide\r
+     * @cfg {Boolean} hideCollapseTool\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} autoHeight  @hide\r
+     * @cfg {String} iconCls\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} autoWidth  @hide\r
+     * @cfg {Boolean/String} shadow\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} cls  @hide\r
+     * @cfg {Number} shadowOffset\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} disabled  @hide\r
+     * @cfg {Boolean} shim\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} disabledClass  @hide\r
+     * @cfg {Object/Array} tbar\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} msgTarget  @hide\r
+     * @cfg {Array} tools\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} readOnly  @hide\r
+     * @cfg {Ext.Template/Ext.XTemplate} toolTemplate\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} style  @hide\r
+     * @cfg {String} xtype\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} validationDelay  @hide\r
+     * @property header\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} validationEvent  @hide\r
+     * @property footer\r
+     * @hide\r
      */\r
     /**\r
-     * @cfg {String} tabIndex  @hide\r
+     * @method focus\r
+     * @hide\r
      */\r
     /**\r
-     * @property disabled\r
+     * @method getBottomToolbar\r
      * @hide\r
      */\r
     /**\r
-     * @method applyToMarkup\r
+     * @method getTopToolbar\r
      * @hide\r
      */\r
     /**\r
-     * @method disable\r
+     * @method setIconClass\r
      * @hide\r
      */\r
     /**\r
-     * @method enable\r
+     * @event activate\r
      * @hide\r
      */\r
     /**\r
-     * @method validate\r
+     * @event beforeclose\r
      * @hide\r
      */\r
     /**\r
-     * @event valid\r
+     * @event bodyresize\r
      * @hide\r
      */\r
     /**\r
-     * @method setDisabled\r
+     * @event close\r
      * @hide\r
      */\r
     /**\r
-     * @cfg keys\r
+     * @event deactivate\r
      * @hide\r
      */\r
 });\r
+Ext.reg('fieldset', Ext.form.FieldSet);\r
+/**
+ * @class Ext.form.HtmlEditor
+ * @extends Ext.form.Field
+ * Provides a lightweight HTML Editor component. Some toolbar features are not supported by Safari and will be
+ * automatically hidden when needed.  These are noted in the config options where appropriate.
+ * <br><br>The editor's toolbar buttons have tooltips defined in the {@link #buttonTips} property, but they are not
+ * enabled by default unless the global {@link Ext.QuickTips} singleton is {@link Ext.QuickTips#init initialized}.
+ * <br><br><b>Note: The focus/blur and validation marking functionality inherited from Ext.form.Field is NOT
+ * supported by this editor.</b>
+ * <br><br>An Editor is a sensitive component that can't be used in all spots standard fields can be used. Putting an Editor within
+ * any element that has display set to 'none' can cause problems in Safari and Firefox due to their default iframe reloading bugs.
+ * <br><br>Example usage:
+ * <pre><code>
+// Simple example rendered with default options:
+Ext.QuickTips.init();  // enable tooltips
+new Ext.form.HtmlEditor({
+    renderTo: Ext.getBody(),
+    width: 800,
+    height: 300
+});
+
+// Passed via xtype into a container and with custom options:
+Ext.QuickTips.init();  // enable tooltips
+new Ext.Panel({
+    title: 'HTML Editor',
+    renderTo: Ext.getBody(),
+    width: 600,
+    height: 300,
+    frame: true,
+    layout: 'fit',
+    items: {
+        xtype: 'htmleditor',
+        enableColors: false,
+        enableAlignments: false
+    }
+});
+</code></pre>
+ * @constructor
+ * Create a new HtmlEditor
+ * @param {Object} config
+ * @xtype htmleditor
+ */
+
+Ext.form.HtmlEditor = Ext.extend(Ext.form.Field, {
+    /**
+     * @cfg {Boolean} enableFormat Enable the bold, italic and underline buttons (defaults to true)
+     */
+    enableFormat : true,
+    /**
+     * @cfg {Boolean} enableFontSize Enable the increase/decrease font size buttons (defaults to true)
+     */
+    enableFontSize : true,
+    /**
+     * @cfg {Boolean} enableColors Enable the fore/highlight color buttons (defaults to true)
+     */
+    enableColors : true,
+    /**
+     * @cfg {Boolean} enableAlignments Enable the left, center, right alignment buttons (defaults to true)
+     */
+    enableAlignments : true,
+    /**
+     * @cfg {Boolean} enableLists Enable the bullet and numbered list buttons. Not available in Safari. (defaults to true)
+     */
+    enableLists : true,
+    /**
+     * @cfg {Boolean} enableSourceEdit Enable the switch to source edit button. Not available in Safari. (defaults to true)
+     */
+    enableSourceEdit : true,
+    /**
+     * @cfg {Boolean} enableLinks Enable the create link button. Not available in Safari. (defaults to true)
+     */
+    enableLinks : true,
+    /**
+     * @cfg {Boolean} enableFont Enable font selection. Not available in Safari. (defaults to true)
+     */
+    enableFont : true,
+    /**
+     * @cfg {String} createLinkText The default text for the create link prompt
+     */
+    createLinkText : 'Please enter the URL for the link:',
+    /**
+     * @cfg {String} defaultLinkValue The default value for the create link prompt (defaults to http:/ /)
+     */
+    defaultLinkValue : 'http:/'+'/',
+    /**
+     * @cfg {Array} fontFamilies An array of available font families
+     */
+    fontFamilies : [
+        'Arial',
+        'Courier New',
+        'Tahoma',
+        'Times New Roman',
+        'Verdana'
+    ],
+    defaultFont: 'tahoma',
+    /**
+     * @cfg {String} defaultValue A default value to be put into the editor to resolve focus issues (defaults to &#160; (Non-breaking space) in Opera and IE6, &#8203; (Zero-width space) in all other browsers).
+     */
+    defaultValue: (Ext.isOpera || Ext.isIE6) ? '&#160;' : '&#8203;',
+
+    // private properties
+    actionMode: 'wrap',
+    validationEvent : false,
+    deferHeight: true,
+    initialized : false,
+    activated : false,
+    sourceEditMode : false,
+    onFocus : Ext.emptyFn,
+    iframePad:3,
+    hideMode:'offsets',
+    defaultAutoCreate : {
+        tag: "textarea",
+        style:"width:500px;height:300px;",
+        autocomplete: "off"
+    },
+
+    // private
+    initComponent : function(){
+        this.addEvents(
+            /**
+             * @event initialize
+             * Fires when the editor is fully initialized (including the iframe)
+             * @param {HtmlEditor} this
+             */
+            'initialize',
+            /**
+             * @event activate
+             * Fires when the editor is first receives the focus. Any insertion must wait
+             * until after this event.
+             * @param {HtmlEditor} this
+             */
+            'activate',
+             /**
+             * @event beforesync
+             * Fires before the textarea is updated with content from the editor iframe. Return false
+             * to cancel the sync.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            'beforesync',
+             /**
+             * @event beforepush
+             * Fires before the iframe editor is updated with content from the textarea. Return false
+             * to cancel the push.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            'beforepush',
+             /**
+             * @event sync
+             * Fires when the textarea is updated with content from the editor iframe.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            'sync',
+             /**
+             * @event push
+             * Fires when the iframe editor is updated with content from the textarea.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            'push',
+             /**
+             * @event editmodechange
+             * Fires when the editor switches edit modes
+             * @param {HtmlEditor} this
+             * @param {Boolean} sourceEdit True if source edit, false if standard editing.
+             */
+            'editmodechange'
+        )
+    },
+
+    // private
+    createFontOptions : function(){
+        var buf = [], fs = this.fontFamilies, ff, lc;
+        for(var i = 0, len = fs.length; i< len; i++){
+            ff = fs[i];
+            lc = ff.toLowerCase();
+            buf.push(
+                '<option value="',lc,'" style="font-family:',ff,';"',
+                    (this.defaultFont == lc ? ' selected="true">' : '>'),
+                    ff,
+                '</option>'
+            );
+        }
+        return buf.join('');
+    },
+
+    /*
+     * Protected method that will not generally be called directly. It
+     * is called when the editor creates its toolbar. Override this method if you need to
+     * add custom toolbar buttons.
+     * @param {HtmlEditor} editor
+     */
+    createToolbar : function(editor){
+        var items = [];
+        var tipsEnabled = Ext.QuickTips && Ext.QuickTips.isEnabled();\r
+
+
+        function btn(id, toggle, handler){
+            return {
+                itemId : id,
+                cls : 'x-btn-icon',
+                iconCls: 'x-edit-'+id,
+                enableToggle:toggle !== false,
+                scope: editor,
+                handler:handler||editor.relayBtnCmd,
+                clickEvent:'mousedown',
+                tooltip: tipsEnabled ? editor.buttonTips[id] || undefined : undefined,
+                overflowText: editor.buttonTips[id].title || undefined,
+                tabIndex:-1
+            };
+        }
+
+
+        if(this.enableFont && !Ext.isSafari2){\r
+            var fontSelectItem = new Ext.Toolbar.Item({\r
+               autoEl: {\r
+                    tag:'select',\r
+                    cls:'x-font-select',\r
+                    html: this.createFontOptions()\r
+               }\r
+            });
+
+            items.push(
+                fontSelectItem,
+                '-'
+            );
+        }
+
+        if(this.enableFormat){
+            items.push(
+                btn('bold'),
+                btn('italic'),
+                btn('underline')
+            );
+        }
+
+        if(this.enableFontSize){
+            items.push(
+                '-',
+                btn('increasefontsize', false, this.adjustFont),
+                btn('decreasefontsize', false, this.adjustFont)
+            );
+        }
+
+        if(this.enableColors){
+            items.push(
+                '-', {
+                    itemId:'forecolor',
+                    cls:'x-btn-icon',
+                    iconCls: 'x-edit-forecolor',
+                    clickEvent:'mousedown',
+                    tooltip: tipsEnabled ? editor.buttonTips.forecolor || undefined : undefined,
+                    tabIndex:-1,
+                    menu : new Ext.menu.ColorMenu({
+                        allowReselect: true,
+                        focus: Ext.emptyFn,
+                        value:'000000',
+                        plain:true,
+                        listeners: {
+                            scope: this,
+                            select: function(cp, color){
+                                this.execCmd('forecolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);
+                                this.deferFocus();
+                            }
+                        },
+                        clickEvent:'mousedown'
+                    })
+                }, {
+                    itemId:'backcolor',
+                    cls:'x-btn-icon',
+                    iconCls: 'x-edit-backcolor',
+                    clickEvent:'mousedown',
+                    tooltip: tipsEnabled ? editor.buttonTips.backcolor || undefined : undefined,
+                    tabIndex:-1,
+                    menu : new Ext.menu.ColorMenu({
+                        focus: Ext.emptyFn,
+                        value:'FFFFFF',
+                        plain:true,
+                        allowReselect: true,
+                        listeners: {
+                            scope: this,
+                            select: function(cp, color){
+                                if(Ext.isGecko){
+                                    this.execCmd('useCSS', false);
+                                    this.execCmd('hilitecolor', color);
+                                    this.execCmd('useCSS', true);
+                                    this.deferFocus();
+                                }else{
+                                    this.execCmd(Ext.isOpera ? 'hilitecolor' : 'backcolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);
+                                    this.deferFocus();
+                                }
+                            }
+                        },
+                        clickEvent:'mousedown'
+                    })
+                }
+            );
+        }
+
+        if(this.enableAlignments){
+            items.push(
+                '-',
+                btn('justifyleft'),
+                btn('justifycenter'),
+                btn('justifyright')
+            );
+        }
+
+        if(!Ext.isSafari2){
+            if(this.enableLinks){
+                items.push(
+                    '-',
+                    btn('createlink', false, this.createLink)
+                );
+            }
+
+            if(this.enableLists){
+                items.push(
+                    '-',
+                    btn('insertorderedlist'),
+                    btn('insertunorderedlist')
+                );
+            }
+            if(this.enableSourceEdit){
+                items.push(
+                    '-',
+                    btn('sourceedit', true, function(btn){
+                        this.toggleSourceEdit(!this.sourceEditMode);
+                    })
+                );
+            }
+        }\r
+\r
+        // build the toolbar\r
+        var tb = new Ext.Toolbar({\r
+            renderTo: this.wrap.dom.firstChild,\r
+            items: items\r
+        });\r
+\r
+        if (fontSelectItem) {\r
+            this.fontSelect = fontSelectItem.el;\r
+\r
+            this.mon(this.fontSelect, 'change', function(){\r
+                var font = this.fontSelect.dom.value;\r
+                this.relayCmd('fontname', font);\r
+                this.deferFocus();\r
+            }, this);\r
+        }\r
+\r
+\r
+        // stop form submits\r
+        this.mon(tb.el, 'click', function(e){\r
+            e.preventDefault();\r
+        });\r
+
+        this.tb = tb;
+    },
+
+    onDisable: function(){
+        this.wrap.mask();
+        Ext.form.HtmlEditor.superclass.onDisable.call(this);
+    },
+
+    onEnable: function(){
+        this.wrap.unmask();
+        Ext.form.HtmlEditor.superclass.onEnable.call(this);
+    },
+
+    setReadOnly: function(readOnly){
+
+        Ext.form.HtmlEditor.superclass.setReadOnly.call(this, readOnly);
+        if(this.initialized){\r
+            this.setDesignMode(!readOnly);\r
+            var bd = this.getEditorBody();\r
+            if(bd){\r
+                bd.style.cursor = this.readOnly ? 'default' : 'text';\r
+            }\r
+            this.disableItems(readOnly);\r
+        }\r
+    },
+
+    /**
+     * Protected method that will not generally be called directly. It
+     * is called when the editor initializes the iframe with HTML contents. Override this method if you
+     * want to change the initialization markup of the iframe (e.g. to add stylesheets).
+     *\r
+     * Note: IE8-Standards has unwanted scroller behavior, so the default meta tag forces IE7 compatibility\r
+     */
+    getDocMarkup : function(){
+        return '<html><head><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>';
+    },
+
+    // private
+    getEditorBody : function(){
+        var doc = this.getDoc();
+        return doc.body || doc.documentElement;
+    },
+
+    // private
+    getDoc : function(){
+        return Ext.isIE ? this.getWin().document : (this.iframe.contentDocument || this.getWin().document);
+    },
+
+    // private
+    getWin : function(){
+        return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name];
+    },
+
+    // private
+    onRender : function(ct, position){
+        Ext.form.HtmlEditor.superclass.onRender.call(this, ct, position);
+        this.el.dom.style.border = '0 none';
+        this.el.dom.setAttribute('tabIndex', -1);
+        this.el.addClass('x-hidden');
+        if(Ext.isIE){ // fix IE 1px bogus margin
+            this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')
+        }
+        this.wrap = this.el.wrap({
+            cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'}
+        });
+
+        this.createToolbar(this);
+
+        this.disableItems(true);
+
+        this.tb.doLayout();
+
+        this.createIFrame();
+
+        if(!this.width){
+            var sz = this.el.getSize();
+            this.setSize(sz.width, this.height || sz.height);
+        }
+        this.resizeEl = this.positionEl = this.wrap;
+    },
+
+    createIFrame: function(){
+        var iframe = document.createElement('iframe');
+        iframe.name = Ext.id();
+        iframe.frameBorder = '0';
+        iframe.style.overflow = 'auto';\r
+
+        this.wrap.dom.appendChild(iframe);
+        this.iframe = iframe;
+
+        this.monitorTask = Ext.TaskMgr.start({
+            run: this.checkDesignMode,
+            scope: this,
+            interval:100
+        });
+    },
+
+    initFrame : function(){
+        Ext.TaskMgr.stop(this.monitorTask);
+        var doc = this.getDoc();
+        this.win = this.getWin();
+
+        doc.open();
+        doc.write(this.getDocMarkup());
+        doc.close();
+
+        var task = { // must defer to wait for browser to be ready
+            run : function(){
+                var doc = this.getDoc();
+                if(doc.body || doc.readyState == 'complete'){
+                    Ext.TaskMgr.stop(task);
+                    this.setDesignMode(true);
+                    this.initEditor.defer(10, this);
+                }
+            },
+            interval : 10,
+            duration:10000,
+            scope: this
+        };
+        Ext.TaskMgr.start(task);
+    },
+
+
+    checkDesignMode : function(){
+        if(this.wrap && this.wrap.dom.offsetWidth){
+            var doc = this.getDoc();
+            if(!doc){
+                return;
+            }
+            if(!doc.editorInitialized || this.getDesignMode() != 'on'){
+                this.initFrame();
+            }
+        }
+    },
+\r
+    /* private\r
+     * set current design mode. To enable, mode can be true or 'on', off otherwise\r
+     */\r
+    setDesignMode : function(mode){\r
+        var doc ;\r
+        if(doc = this.getDoc()){\r
+            if(this.readOnly){\r
+                mode = false;\r
+            }\r
+            doc.designMode = (/on|true/i).test(String(mode).toLowerCase()) ?'on':'off';\r
+        }\r
+\r
+    },\r
+\r
+    // private\r
+    getDesignMode : function(){
+        var doc = this.getDoc();\r
+        if(!doc){ return ''; }\r
+        return String(doc.designMode).toLowerCase();\r
+\r
+    },\r
+\r
+    disableItems: function(disabled){
+        if(this.fontSelect){
+            this.fontSelect.dom.disabled = disabled;
+        }
+        this.tb.items.each(function(item){
+            if(item.getItemId() != 'sourceedit'){
+                item.setDisabled(disabled);
+            }
+        });
+    },
+
+    // private
+    onResize : function(w, h){
+        Ext.form.HtmlEditor.superclass.onResize.apply(this, arguments);
+        if(this.el && this.iframe){
+            if(Ext.isNumber(w)){
+                var aw = w - this.wrap.getFrameWidth('lr');
+                this.el.setWidth(aw);
+                this.tb.setWidth(aw);
+                this.iframe.style.width = Math.max(aw, 0) + 'px';
+            }
+            if(Ext.isNumber(h)){
+                var ah = h - this.wrap.getFrameWidth('tb') - this.tb.el.getHeight();
+                this.el.setHeight(ah);
+                this.iframe.style.height = Math.max(ah, 0) + 'px';
+                var bd = this.getEditorBody();
+                if(bd){
+                    bd.style.height = Math.max((ah - (this.iframePad*2)), 0) + 'px';
+                }
+            }
+        }
+    },
+
+    /**
+     * Toggles the editor between standard and source edit mode.
+     * @param {Boolean} sourceEdit (optional) True for source edit, false for standard
+     */
+    toggleSourceEdit : function(sourceEditMode){
+        if(sourceEditMode === undefined){
+            sourceEditMode = !this.sourceEditMode;
+        }
+        this.sourceEditMode = sourceEditMode === true;
+        var btn = this.tb.getComponent('sourceedit');
+
+        if(btn.pressed !== this.sourceEditMode){
+            btn.toggle(this.sourceEditMode);
+            if(!btn.xtbHidden){
+                return;
+            }
+        }
+        if(this.sourceEditMode){
+            this.disableItems(true);
+            this.syncValue();
+            this.iframe.className = 'x-hidden';
+            this.el.removeClass('x-hidden');
+            this.el.dom.removeAttribute('tabIndex');
+            this.el.focus();
+        }else{
+            if(this.initialized){
+                this.disableItems(this.readOnly);
+            }
+            this.pushValue();
+            this.iframe.className = '';
+            this.el.addClass('x-hidden');
+            this.el.dom.setAttribute('tabIndex', -1);
+            this.deferFocus();
+        }
+        var lastSize = this.lastSize;
+        if(lastSize){
+            delete this.lastSize;
+            this.setSize(lastSize);
+        }
+        this.fireEvent('editmodechange', this, this.sourceEditMode);
+    },
+
+    // private used internally
+    createLink : function(){
+        var url = prompt(this.createLinkText, this.defaultLinkValue);
+        if(url && url != 'http:/'+'/'){
+            this.relayCmd('createlink', url);
+        }
+    },
+
+    // private
+    initEvents : function(){
+        this.originalValue = this.getValue();
+    },
+
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    markInvalid : Ext.emptyFn,
+
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    clearInvalid : Ext.emptyFn,
+
+    // docs inherit from Field
+    setValue : function(v){
+        Ext.form.HtmlEditor.superclass.setValue.call(this, v);
+        this.pushValue();
+        return this;
+    },
+
+    /**
+     * Protected method that will not generally be called directly. If you need/want
+     * custom HTML cleanup, this is the method you should override.
+     * @param {String} html The HTML to be cleaned
+     * @return {String} The cleaned HTML
+     */
+    cleanHtml: function(html) {
+        html = String(html);
+        if(Ext.isWebKit){ // strip safari nonsense
+            html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');
+        }
+
+        /*
+         * Neat little hack. Strips out all the non-digit characters from the default
+         * value and compares it to the character code of the first character in the string
+         * because it can cause encoding issues when posted to the server.
+         */
+        if(html.charCodeAt(0) == this.defaultValue.replace(/\D/g, '')){
+            html = html.substring(1);
+        }
+        return html;
+    },
+
+    /**
+     * Protected method that will not generally be called directly. Syncs the contents
+     * of the editor iframe with the textarea.
+     */
+    syncValue : function(){
+        if(this.initialized){
+            var bd = this.getEditorBody();
+            var html = bd.innerHTML;
+            if(Ext.isWebKit){
+                var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
+                var m = bs.match(/text-align:(.*?);/i);
+                if(m && m[1]){
+                    html = '<div style="'+m[0]+'">' + html + '</div>';
+                }
+            }
+            html = this.cleanHtml(html);
+            if(this.fireEvent('beforesync', this, html) !== false){
+                this.el.dom.value = html;
+                this.fireEvent('sync', this, html);
+            }
+        }
+    },
+
+    //docs inherit from Field
+    getValue : function() {
+        this[this.sourceEditMode ? 'pushValue' : 'syncValue']();
+        return Ext.form.HtmlEditor.superclass.getValue.call(this);
+    },
+
+    /**
+     * Protected method that will not generally be called directly. Pushes the value of the textarea
+     * into the iframe editor.
+     */
+    pushValue : function(){
+        if(this.initialized){
+            var v = this.el.dom.value;
+            if(!this.activated && v.length < 1){
+                v = this.defaultValue;
+            }
+            if(this.fireEvent('beforepush', this, v) !== false){
+                this.getEditorBody().innerHTML = v;
+                if(Ext.isGecko){
+                    // Gecko hack, see: https://bugzilla.mozilla.org/show_bug.cgi?id=232791#c8
+                    this.setDesignMode(false);  //toggle off first\r
+\r
+                }
+                this.setDesignMode(true);\r
+                this.fireEvent('push', this, v);
+            }
+\r
+        }
+    },
+
+    // private
+    deferFocus : function(){
+        this.focus.defer(10, this);
+    },
+
+    // docs inherit from Field
+    focus : function(){
+        if(this.win && !this.sourceEditMode){
+            this.win.focus();
+        }else{
+            this.el.focus();
+        }
+    },
+
+    // private
+    initEditor : function(){
+        //Destroying the component during/before initEditor can cause issues.
+        try{
+            var dbody = this.getEditorBody(),
+                ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat'),
+                doc,
+                fn;
+
+            ss['background-attachment'] = 'fixed'; // w3c
+            dbody.bgProperties = 'fixed'; // ie
+
+            Ext.DomHelper.applyStyles(dbody, ss);
+
+            doc = this.getDoc();
+
+            if(doc){
+                try{
+                    Ext.EventManager.removeAll(doc);
+                }catch(e){}
+            }
+
+            /*
+             * We need to use createDelegate here, because when using buffer, the delayed task is added
+             * as a property to the function. When the listener is removed, the task is deleted from the function.
+             * Since onEditorEvent is shared on the prototype, if we have multiple html editors, the first time one of the editors
+             * is destroyed, it causes the fn to be deleted from the prototype, which causes errors. Essentially, we're just anonymizing the function.
+             */
+            fn = this.onEditorEvent.createDelegate(this);
+            Ext.EventManager.on(doc, {
+                mousedown: fn,
+                dblclick: fn,
+                click: fn,
+                keyup: fn,
+                buffer:100
+            });
+
+            if(Ext.isGecko){
+                Ext.EventManager.on(doc, 'keypress', this.applyCommand, this);
+            }
+            if(Ext.isIE || Ext.isWebKit || Ext.isOpera){
+                Ext.EventManager.on(doc, 'keydown', this.fixKeys, this);
+            }
+            doc.editorInitialized = true;
+            this.initialized = true;
+            this.pushValue();
+            this.setReadOnly(this.readOnly);
+            this.fireEvent('initialize', this);
+        }catch(e){}
+    },
+
+    // private
+    onDestroy : function(){
+        if(this.monitorTask){
+            Ext.TaskMgr.stop(this.monitorTask);
+        }
+        if(this.rendered){
+            Ext.destroy(this.tb);
+            var doc = this.getDoc();
+            if(doc){
+                try{
+                    Ext.EventManager.removeAll(doc);
+                    for (var prop in doc){
+                        delete doc[prop];
+                    }
+                }catch(e){}
+            }
+            if(this.wrap){
+                this.wrap.dom.innerHTML = '';
+                this.wrap.remove();
+            }
+        }
+
+        if(this.el){
+            this.el.removeAllListeners();
+            this.el.remove();
+        }
+        this.purgeListeners();
+    },
+
+    // private
+    onFirstFocus : function(){
+        this.activated = true;
+        this.disableItems(this.readOnly);
+        if(Ext.isGecko){ // prevent silly gecko errors
+            this.win.focus();
+            var s = this.win.getSelection();
+            if(!s.focusNode || s.focusNode.nodeType != 3){
+                var r = s.getRangeAt(0);
+                r.selectNodeContents(this.getEditorBody());
+                r.collapse(true);
+                this.deferFocus();
+            }
+            try{
+                this.execCmd('useCSS', true);
+                this.execCmd('styleWithCSS', false);
+            }catch(e){}
+        }
+        this.fireEvent('activate', this);
+    },
+
+    // private
+    adjustFont: function(btn){
+        var adjust = btn.getItemId() == 'increasefontsize' ? 1 : -1,
+            doc = this.getDoc(),
+            v = parseInt(doc.queryCommandValue('FontSize') || 2, 10);
+        if((Ext.isSafari && !Ext.isSafari2) || Ext.isChrome || Ext.isAir){
+            // Safari 3 values
+            // 1 = 10px, 2 = 13px, 3 = 16px, 4 = 18px, 5 = 24px, 6 = 32px
+            if(v <= 10){
+                v = 1 + adjust;
+            }else if(v <= 13){
+                v = 2 + adjust;
+            }else if(v <= 16){
+                v = 3 + adjust;
+            }else if(v <= 18){
+                v = 4 + adjust;
+            }else if(v <= 24){
+                v = 5 + adjust;
+            }else {
+                v = 6 + adjust;
+            }
+            v = v.constrain(1, 6);
+        }else{
+            if(Ext.isSafari){ // safari
+                adjust *= 2;
+            }
+            v = Math.max(1, v+adjust) + (Ext.isSafari ? 'px' : 0);
+        }
+        this.execCmd('FontSize', v);
+    },
+
+    // private
+    onEditorEvent : function(e){
+        this.updateToolbar();
+    },
+
+
+    /**
+     * Protected method that will not generally be called directly. It triggers
+     * a toolbar update by reading the markup state of the current selection in the editor.
+     */
+    updateToolbar: function(){
+
+        if(this.readOnly){
+            return;
+        }
+
+        if(!this.activated){
+            this.onFirstFocus();
+            return;
+        }
+
+        var btns = this.tb.items.map,
+            doc = this.getDoc();
+
+        if(this.enableFont && !Ext.isSafari2){
+            var name = (doc.queryCommandValue('FontName')||this.defaultFont).toLowerCase();
+            if(name != this.fontSelect.dom.value){
+                this.fontSelect.dom.value = name;
+            }
+        }
+        if(this.enableFormat){
+            btns.bold.toggle(doc.queryCommandState('bold'));
+            btns.italic.toggle(doc.queryCommandState('italic'));
+            btns.underline.toggle(doc.queryCommandState('underline'));
+        }
+        if(this.enableAlignments){
+            btns.justifyleft.toggle(doc.queryCommandState('justifyleft'));
+            btns.justifycenter.toggle(doc.queryCommandState('justifycenter'));
+            btns.justifyright.toggle(doc.queryCommandState('justifyright'));
+        }
+        if(!Ext.isSafari2 && this.enableLists){
+            btns.insertorderedlist.toggle(doc.queryCommandState('insertorderedlist'));
+            btns.insertunorderedlist.toggle(doc.queryCommandState('insertunorderedlist'));
+        }
+
+        Ext.menu.MenuMgr.hideAll();
+
+        this.syncValue();
+    },
+
+    // private
+    relayBtnCmd : function(btn){
+        this.relayCmd(btn.getItemId());
+    },
+
+    /**
+     * Executes a Midas editor command on the editor document and performs necessary focus and
+     * toolbar updates. <b>This should only be called after the editor is initialized.</b>
+     * @param {String} cmd The Midas command
+     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
+     */
+    relayCmd : function(cmd, value){
+        (function(){
+            this.focus();
+            this.execCmd(cmd, value);
+            this.updateToolbar();
+        }).defer(10, this);
+    },
+
+    /**
+     * Executes a Midas editor command directly on the editor document.
+     * For visual commands, you should use {@link #relayCmd} instead.
+     * <b>This should only be called after the editor is initialized.</b>
+     * @param {String} cmd The Midas command
+     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
+     */
+    execCmd : function(cmd, value){
+        var doc = this.getDoc();
+        doc.execCommand(cmd, false, value === undefined ? null : value);
+        this.syncValue();
+    },
+
+    // private
+    applyCommand : function(e){
+        if(e.ctrlKey){
+            var c = e.getCharCode(), cmd;
+            if(c > 0){
+                c = String.fromCharCode(c);
+                switch(c){
+                    case 'b':
+                        cmd = 'bold';
+                    break;
+                    case 'i':
+                        cmd = 'italic';
+                    break;
+                    case 'u':
+                        cmd = 'underline';
+                    break;
+                }
+                if(cmd){
+                    this.win.focus();
+                    this.execCmd(cmd);
+                    this.deferFocus();
+                    e.preventDefault();
+                }
+            }
+        }
+    },
+
+    /**
+     * Inserts the passed text at the current cursor position. Note: the editor must be initialized and activated
+     * to insert text.
+     * @param {String} text
+     */
+    insertAtCursor : function(text){
+        if(!this.activated){
+            return;
+        }
+        if(Ext.isIE){
+            this.win.focus();
+            var doc = this.getDoc(),
+                r = doc.selection.createRange();
+            if(r){
+                r.pasteHTML(text);
+                this.syncValue();
+                this.deferFocus();
+            }
+        }else{
+            this.win.focus();
+            this.execCmd('InsertHTML', text);
+            this.deferFocus();
+        }
+    },
+
+    // private
+    fixKeys : function(){ // load time branching for fastest keydown performance
+        if(Ext.isIE){
+            return function(e){
+                var k = e.getKey(),
+                    doc = this.getDoc(),
+                        r;
+                if(k == e.TAB){
+                    e.stopEvent();
+                    r = doc.selection.createRange();
+                    if(r){
+                        r.collapse(true);
+                        r.pasteHTML('&nbsp;&nbsp;&nbsp;&nbsp;');
+                        this.deferFocus();
+                    }
+                }else if(k == e.ENTER){
+                    r = doc.selection.createRange();
+                    if(r){
+                        var target = r.parentElement();
+                        if(!target || target.tagName.toLowerCase() != 'li'){
+                            e.stopEvent();
+                            r.pasteHTML('<br />');
+                            r.collapse(false);
+                            r.select();
+                        }
+                    }
+                }
+            };
+        }else if(Ext.isOpera){
+            return function(e){
+                var k = e.getKey();
+                if(k == e.TAB){
+                    e.stopEvent();
+                    this.win.focus();
+                    this.execCmd('InsertHTML','&nbsp;&nbsp;&nbsp;&nbsp;');
+                    this.deferFocus();
+                }
+            };
+        }else if(Ext.isWebKit){
+            return function(e){
+                var k = e.getKey();
+                if(k == e.TAB){
+                    e.stopEvent();
+                    this.execCmd('InsertText','\t');
+                    this.deferFocus();
+                }else if(k == e.ENTER){
+                    e.stopEvent();
+                    this.execCmd('InsertHtml','<br /><br />');
+                    this.deferFocus();
+                }
+             };
+        }
+    }(),
+
+    /**
+     * Returns the editor's toolbar. <b>This is only available after the editor has been rendered.</b>
+     * @return {Ext.Toolbar}
+     */
+    getToolbar : function(){
+        return this.tb;
+    },
+
+    /**
+     * Object collection of toolbar tooltips for the buttons in the editor. The key
+     * is the command id associated with that button and the value is a valid QuickTips object.
+     * For example:
+<pre><code>
+{
+    bold : {
+        title: 'Bold (Ctrl+B)',
+        text: 'Make the selected text bold.',
+        cls: 'x-html-editor-tip'
+    },
+    italic : {
+        title: 'Italic (Ctrl+I)',
+        text: 'Make the selected text italic.',
+        cls: 'x-html-editor-tip'
+    },
+    ...
+</code></pre>
+    * @type Object
+     */
+    buttonTips : {
+        bold : {
+            title: 'Bold (Ctrl+B)',
+            text: 'Make the selected text bold.',
+            cls: 'x-html-editor-tip'
+        },
+        italic : {
+            title: 'Italic (Ctrl+I)',
+            text: 'Make the selected text italic.',
+            cls: 'x-html-editor-tip'
+        },
+        underline : {
+            title: 'Underline (Ctrl+U)',
+            text: 'Underline the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        increasefontsize : {
+            title: 'Grow Text',
+            text: 'Increase the font size.',
+            cls: 'x-html-editor-tip'
+        },
+        decreasefontsize : {
+            title: 'Shrink Text',
+            text: 'Decrease the font size.',
+            cls: 'x-html-editor-tip'
+        },
+        backcolor : {
+            title: 'Text Highlight Color',
+            text: 'Change the background color of the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        forecolor : {
+            title: 'Font Color',
+            text: 'Change the color of the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        justifyleft : {
+            title: 'Align Text Left',
+            text: 'Align text to the left.',
+            cls: 'x-html-editor-tip'
+        },
+        justifycenter : {
+            title: 'Center Text',
+            text: 'Center text in the editor.',
+            cls: 'x-html-editor-tip'
+        },
+        justifyright : {
+            title: 'Align Text Right',
+            text: 'Align text to the right.',
+            cls: 'x-html-editor-tip'
+        },
+        insertunorderedlist : {
+            title: 'Bullet List',
+            text: 'Start a bulleted list.',
+            cls: 'x-html-editor-tip'
+        },
+        insertorderedlist : {
+            title: 'Numbered List',
+            text: 'Start a numbered list.',
+            cls: 'x-html-editor-tip'
+        },
+        createlink : {
+            title: 'Hyperlink',
+            text: 'Make the selected text a hyperlink.',
+            cls: 'x-html-editor-tip'
+        },
+        sourceedit : {
+            title: 'Source Edit',
+            text: 'Switch to source editing mode.',
+            cls: 'x-html-editor-tip'
+        }
+    }
+
+    // hide stuff that is not compatible
+    /**
+     * @event blur
+     * @hide
+     */
+    /**
+     * @event change
+     * @hide
+     */
+    /**
+     * @event focus
+     * @hide
+     */
+    /**
+     * @event specialkey
+     * @hide
+     */
+    /**
+     * @cfg {String} fieldClass @hide
+     */
+    /**
+     * @cfg {String} focusClass @hide
+     */
+    /**
+     * @cfg {String} autoCreate @hide
+     */
+    /**
+     * @cfg {String} inputType @hide
+     */
+    /**
+     * @cfg {String} invalidClass @hide
+     */
+    /**
+     * @cfg {String} invalidText @hide
+     */
+    /**
+     * @cfg {String} msgFx @hide
+     */
+    /**
+     * @cfg {String} validateOnBlur @hide
+     */
+    /**
+     * @cfg {Boolean} allowDomMove  @hide
+     */
+    /**
+     * @cfg {String} applyTo @hide
+     */
+    /**
+     * @cfg {String} autoHeight  @hide
+     */
+    /**
+     * @cfg {String} autoWidth  @hide
+     */
+    /**
+     * @cfg {String} cls  @hide
+     */
+    /**
+     * @cfg {String} disabled  @hide
+     */
+    /**
+     * @cfg {String} disabledClass  @hide
+     */
+    /**
+     * @cfg {String} msgTarget  @hide
+     */
+    /**
+     * @cfg {String} readOnly  @hide
+     */
+    /**
+     * @cfg {String} style  @hide
+     */
+    /**
+     * @cfg {String} validationDelay  @hide
+     */
+    /**
+     * @cfg {String} validationEvent  @hide
+     */
+    /**
+     * @cfg {String} tabIndex  @hide
+     */
+    /**
+     * @property disabled
+     * @hide
+     */
+    /**
+     * @method applyToMarkup
+     * @hide
+     */
+    /**
+     * @method disable
+     * @hide
+     */
+    /**
+     * @method enable
+     * @hide
+     */
+    /**
+     * @method validate
+     * @hide
+     */
+    /**
+     * @event valid
+     * @hide
+     */
+    /**
+     * @method setDisabled
+     * @hide
+     */
+    /**
+     * @cfg keys
+     * @hide
+     */
+});
 Ext.reg('htmleditor', Ext.form.HtmlEditor);/**\r
  * @class Ext.form.TimeField\r
  * @extends Ext.form.ComboBox\r
@@ -58498,15 +62718,15 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
     /**\r
      * @cfg {Date/String} minValue\r
      * The minimum allowed time. Can be either a Javascript date object with a valid time value or a string \r
-     * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to null).\r
+     * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to undefined).\r
      */\r
-    minValue : null,\r
+    minValue : undefined,\r
     /**\r
      * @cfg {Date/String} maxValue\r
      * The maximum allowed time. Can be either a Javascript date object with a valid time value or a string \r
-     * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to null).\r
+     * time in a valid format -- see {@link #format} and {@link #altFormats} (defaults to undefined).\r
      */\r
-    maxValue : null,\r
+    maxValue : undefined,\r
     /**\r
      * @cfg {String} minText\r
      * The error text to display when the date in the cell is before minValue (defaults to\r
@@ -58558,26 +62778,67 @@ Ext.form.TimeField = Ext.extend(Ext.form.ComboBox, {
 \r
     // private\r
     initComponent : function(){\r
-        if(typeof this.minValue == "string"){\r
-            this.minValue = this.parseDate(this.minValue);\r
+        if(Ext.isDefined(this.minValue)){\r
+            this.setMinValue(this.minValue, true);\r
         }\r
-        if(typeof this.maxValue == "string"){\r
-            this.maxValue = this.parseDate(this.maxValue);\r
+        if(Ext.isDefined(this.maxValue)){\r
+            this.setMaxValue(this.maxValue, true);\r
         }\r
-\r
         if(!this.store){\r
-            var min = this.parseDate(this.minValue) || new Date(this.initDate).clearTime();\r
-            var max = this.parseDate(this.maxValue) || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1);\r
-            var times = [];\r
-            while(min <= max){\r
-                times.push(min.dateFormat(this.format));\r
-                min = min.add('mi', this.increment);\r
-            }\r
-            this.store = times;\r
+            this.generateStore(true);\r
         }\r
         Ext.form.TimeField.superclass.initComponent.call(this);\r
     },\r
+    \r
+    /**\r
+     * Replaces any existing {@link #minValue} with the new time and refreshes the store.\r
+     * @param {Date/String} value The minimum time that can be selected\r
+     */\r
+    setMinValue: function(value, /* private */ initial){\r
+        this.setLimit(value, true, initial);\r
+        return this;\r
+    },\r
 \r
+    /**\r
+     * Replaces any existing {@link #maxValue} with the new time and refreshes the store.\r
+     * @param {Date/String} value The maximum time that can be selected\r
+     */\r
+    setMaxValue: function(value, /* private */ initial){\r
+        this.setLimit(value, false, initial);\r
+        return this;\r
+    },\r
+    \r
+    // private\r
+    generateStore: function(initial){\r
+        var min = this.minValue || new Date(this.initDate).clearTime(),\r
+            max = this.maxValue || new Date(this.initDate).clearTime().add('mi', (24 * 60) - 1),\r
+            times = [];\r
+            \r
+        while(min <= max){\r
+            times.push(min.dateFormat(this.format));\r
+            min = min.add('mi', this.increment);\r
+        }\r
+        this.bindStore(times, initial);\r
+    },\r
+\r
+    // private\r
+    setLimit: function(value, isMin, initial){\r
+        var d;\r
+        if(Ext.isString(value)){\r
+            d = this.parseDate(value);\r
+        }else if(Ext.isDate(value)){\r
+            d = value;\r
+        }\r
+        if(d){\r
+            var val = new Date(this.initDate).clearTime();\r
+            val.setHours(d.getHours(), d.getMinutes(), isMin ? 0 : 59, 0);\r
+            this[isMin ? 'minValue' : 'maxValue'] = val;\r
+            if(!initial){\r
+                this.generateStore();\r
+            }\r
+        }\r
+    },\r
+    \r
     // inherited docs\r
     getValue : function(){\r
         var v = Ext.form.TimeField.superclass.getValue.call(this);\r
@@ -59028,8 +63289,8 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
         }
         if(result.errors){
             this.form.markInvalid(result.errors);
-            this.failureType = Ext.form.Action.SERVER_INVALID;
         }
+        this.failureType = Ext.form.Action.SERVER_INVALID;
         this.form.afterAction(this, false);
     },
 
@@ -59092,7 +63353,7 @@ myFormPanel.{@link Ext.form.FormPanel#getForm getForm}().{@link Ext.form.BasicFo
     params: {
         consignmentRef: myConsignmentRef
     },
-    failure: function(form, action() {
+    failure: function(form, action) {
         Ext.Msg.alert("Load failed", action.result.errorMessage);
     }
 });
@@ -59167,62 +63428,90 @@ Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
 /**
  * @class Ext.form.Action.DirectLoad
  * @extends Ext.form.Action.Load
- * Provides Ext.direct support for loading form data. This example illustrates usage
- * of Ext.Direct to load a submit a form through Ext.Direct.
+ * <p>Provides Ext.direct support for loading form data.</p>
+ * <p>This example illustrates usage of Ext.Direct to <b>load</b> a form through Ext.Direct.</p>
  * <pre><code>
 var myFormPanel = new Ext.form.FormPanel({
     // configs for FormPanel
     title: 'Basic Information',
-    border: false,
+    renderTo: document.body,
+    width: 300, height: 160,
     padding: 10,
-    buttons:[{
-        text: 'Submit',
-        handler: function(){
-            basicInfo.getForm().submit({
-                params: {
-                    uid: 5
-                }
-            });
-        }
-    }],
-    
+
     // configs apply to child items
     defaults: {anchor: '100%'},
     defaultType: 'textfield',
-    items: [
-        // form fields go here
-    ],
-    
+    items: [{
+        fieldLabel: 'Name',
+        name: 'name'
+    },{
+        fieldLabel: 'Email',
+        name: 'email'
+    },{
+        fieldLabel: 'Company',
+        name: 'company'
+    }],
+
     // configs for BasicForm
     api: {
+        // The server-side method to call for load() requests
         load: Profile.getBasicInfo,
         // The server-side must mark the submit handler as a 'formHandler'
         submit: Profile.updateBasicInfo
-    },    
-    paramOrder: ['uid']
+    },
+    // specify the order for the passed params
+    paramOrder: ['uid', 'foo']
 });
 
 // load the form
 myFormPanel.getForm().load({
+    // pass 2 arguments to server side getBasicInfo method (len=2)
     params: {
-        uid: 5
+        foo: 'bar',
+        uid: 34
     }
 });
+ * </code></pre>
+ * The data packet sent to the server will resemble something like:
+ * <pre><code>
+[
+    {
+        "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
+        "data":[34,"bar"] // note the order of the params
+    }
+]
+ * </code></pre>
+ * The form will process a data packet returned by the server that is similar
+ * to the following format:
+ * <pre><code>
+[
+    {
+        "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
+        "result":{
+            "success":true,
+            "data":{
+                "name":"Fred Flintstone",
+                "company":"Slate Rock and Gravel",
+                "email":"fred.flintstone@slaterg.com"
+            }
+        }
+    }
+]
  * </code></pre>
  */
 Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
-    constructor: function(form, opts) {        
+    constructor: function(form, opts) {
         Ext.form.Action.DirectLoad.superclass.constructor.call(this, form, opts);
     },
-    type: 'directload',
-    
+    type : 'directload',
+
     run : function(){
         var args = this.getParams();
-        args.push(this.success, this);                
+        args.push(this.success, this);
         this.form.api.load.apply(window, args);
     },
-    
-    getParams: function() {
+
+    getParams : function() {
         var buf = [], o = {};
         var bp = this.form.baseParams;
         var p = this.options.params;
@@ -59240,23 +63529,114 @@ Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
     // Direct actions have already been processed and therefore
     // we can directly set the result; Direct Actions do not have
     // a this.response property.
-    processResponse: function(result) {
+    processResponse : function(result) {
         this.result = result;
-        return result;          
+        return result;
+    },
+    
+    success : function(response, trans){
+        if(trans.type == Ext.Direct.exceptions.SERVER){
+            response = {};
+        }
+        Ext.form.Action.DirectLoad.superclass.success.call(this, response);
     }
 });
 
 /**
  * @class Ext.form.Action.DirectSubmit
  * @extends Ext.form.Action.Submit
- * Provides Ext.direct support for submitting form data.
- * See {@link Ext.form.Action.DirectLoad}.
+ * <p>Provides Ext.direct support for submitting form data.</p>
+ * <p>This example illustrates usage of Ext.Direct to <b>submit</b> a form through Ext.Direct.</p>
+ * <pre><code>
+var myFormPanel = new Ext.form.FormPanel({
+    // configs for FormPanel
+    title: 'Basic Information',
+    renderTo: document.body,
+    width: 300, height: 160,
+    padding: 10,
+    buttons:[{
+        text: 'Submit',
+        handler: function(){
+            myFormPanel.getForm().submit({
+                params: {
+                    foo: 'bar',
+                    uid: 34
+                }
+            });
+        }
+    }],
+
+    // configs apply to child items
+    defaults: {anchor: '100%'},
+    defaultType: 'textfield',
+    items: [{
+        fieldLabel: 'Name',
+        name: 'name'
+    },{
+        fieldLabel: 'Email',
+        name: 'email'
+    },{
+        fieldLabel: 'Company',
+        name: 'company'
+    }],
+
+    // configs for BasicForm
+    api: {
+        // The server-side method to call for load() requests
+        load: Profile.getBasicInfo,
+        // The server-side must mark the submit handler as a 'formHandler'
+        submit: Profile.updateBasicInfo
+    },
+    // specify the order for the passed params
+    paramOrder: ['uid', 'foo']
+});
+ * </code></pre>
+ * The data packet sent to the server will resemble something like:
+ * <pre><code>
+{
+    "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
+    "result":{
+        "success":true,
+        "id":{
+            "extAction":"Profile","extMethod":"updateBasicInfo",
+            "extType":"rpc","extTID":"6","extUpload":"false",
+            "name":"Aaron Conran","email":"aaron@extjs.com","company":"Ext JS, LLC"
+        }
+    }
+}
+ * </code></pre>
+ * The form will process a data packet returned by the server that is similar
+ * to the following:
+ * <pre><code>
+// sample success packet (batched requests)
+[
+    {
+        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3,
+        "result":{
+            "success":true
+        }
+    }
+]
+
+// sample failure packet (one request)
+{
+        "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
+        "result":{
+            "errors":{
+                "email":"already taken"
+            },
+            "success":false,
+            "foo":"bar"
+        }
+}
+ * </code></pre>
+ * Also see the discussion in {@link Ext.form.Action.DirectLoad}.
  */
 Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, {
-    constructor: function(form, opts) {
+    constructor : function(form, opts) {
         Ext.form.Action.DirectSubmit.superclass.constructor.call(this, form, opts);
     },
-    type: 'directsubmit',
+    type : 'directsubmit',
     // override of Submit
     run : function(){
         var o = this.options;
@@ -59270,29 +63650,35 @@ Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, {
             this.form.afterAction(this, false);
         }
     },
-    
-    getParams: function() {
+
+    getParams : function() {
         var o = {};
         var bp = this.form.baseParams;
         var p = this.options.params;
         Ext.apply(o, p, bp);
         return o;
-    },    
+    },
     // Direct actions have already been processed and therefore
     // we can directly set the result; Direct Actions do not have
     // a this.response property.
-    processResponse: function(result) {
+    processResponse : function(result) {
         this.result = result;
-        return result;          
+        return result;
+    },
+    
+    success : function(response, trans){
+        if(trans.type == Ext.Direct.exceptions.SERVER){
+            response = {};
+        }
+        Ext.form.Action.DirectSubmit.superclass.success.call(this, response);
     }
 });
 
-
 Ext.form.Action.ACTION_TYPES = {
     'load' : Ext.form.Action.Load,
     'submit' : Ext.form.Action.Submit,
-    'directload': Ext.form.Action.DirectLoad,
-    'directsubmit': Ext.form.Action.DirectSubmit
+    'directload' : Ext.form.Action.DirectLoad,
+    'directsubmit' : Ext.form.Action.DirectSubmit
 };
 /**
  * @class Ext.form.VTypes
@@ -59330,10 +63716,10 @@ Ext.apply(Ext.form.VTypes, {
  */
 Ext.form.VTypes = function(){
     // closure these in so they are only created once.
-    var alpha = /^[a-zA-Z_]+$/;
-    var alphanum = /^[a-zA-Z0-9_]+$/;
-    var email = /^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,4}$/;
-    var url = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
+    var alpha = /^[a-zA-Z_]+$/,
+        alphanum = /^[a-zA-Z0-9_]+$/,
+        email = /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,
+        url = /(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
 
     // All these messages and functions are configurable
     return {
@@ -59440,19 +63826,28 @@ Ext.form.VTypes = function(){
  * <p>Example usage:</p>\r
  * <pre><code>\r
 var grid = new Ext.grid.GridPanel({\r
-    {@link #store}: new (@link Ext.data.Store}({\r
+    {@link #store}: new {@link Ext.data.Store}({\r
         {@link Ext.data.Store#autoDestroy autoDestroy}: true,\r
         {@link Ext.data.Store#reader reader}: reader,\r
         {@link Ext.data.Store#data data}: xg.dummyData\r
     }),\r
-    {@link #columns}: [\r
-        {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},\r
-        {header: 'Price', width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},\r
-        {header: 'Change', width: 120, sortable: true, dataIndex: 'change'},\r
-        {header: '% Change', width: 120, sortable: true, dataIndex: 'pctChange'},\r
-        // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype\r
-        {header: 'Last Updated', width: 135, sortable: true, dataIndex: 'lastChange', xtype: 'datecolumn', format: 'M d, Y'}\r
-    ],\r
+    {@link #colModel}: new {@link Ext.grid.ColumnModel}({\r
+        {@link Ext.grid.ColumnModel#defaults defaults}: {\r
+            width: 120,\r
+            sortable: true\r
+        },\r
+        {@link Ext.grid.ColumnModel#columns columns}: [\r
+            {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},\r
+            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},\r
+            {header: 'Change', dataIndex: 'change'},\r
+            {header: '% Change', dataIndex: 'pctChange'},\r
+            // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype\r
+            {\r
+                header: 'Last Updated', width: 135, dataIndex: 'lastChange',\r
+                xtype: 'datecolumn', format: 'M d, Y'\r
+            }\r
+        ],\r
+    }),\r
     {@link #viewConfig}: {\r
         {@link Ext.grid.GridView#forceFit forceFit}: true,\r
 \r
@@ -59558,7 +63953,9 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
      * @cfg {Boolean} enableColumnResize <tt>false</tt> to turn off column resizing for the whole grid. Defaults to <tt>true</tt>.\r
      */\r
     /**\r
-     * @cfg {Boolean} enableColumnHide Defaults to <tt>true</tt> to enable hiding of columns with the header context menu.\r
+     * @cfg {Boolean} enableColumnHide\r
+     * Defaults to <tt>true</tt> to enable {@link Ext.grid.Column#hidden hiding of columns}\r
+     * with the {@link #enableHdMenu header menu}.\r
      */\r
     enableColumnHide : true,\r
     /**\r
@@ -59624,19 +64021,28 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
      * @cfg {Array} stateEvents\r
      * An array of events that, when fired, should trigger this component to save its state.\r
      * Defaults to:<pre><code>\r
-     * stateEvents: ['columnmove', 'columnresize', 'sortchange']\r
+     * stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange']\r
      * </code></pre>\r
      * <p>These can be any types of events supported by this component, including browser or\r
      * custom events (e.g., <tt>['click', 'customerchange']</tt>).</p>\r
      * <p>See {@link Ext.Component#stateful} for an explanation of saving and restoring\r
      * Component state.</p>\r
      */\r
-    stateEvents : ['columnmove', 'columnresize', 'sortchange'],\r
+    stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'],\r
     /**\r
      * @cfg {Object} view The {@link Ext.grid.GridView} used by the grid. This can be set\r
      * before a call to {@link Ext.Component#render render()}.\r
      */\r
     view : null,\r
+    \r
+    /**\r
+     * @cfg {Array} bubbleEvents\r
+     * <p>An array of events that, when fired, should be bubbled to any parent container.\r
+     * See {@link Ext.util.Observable#enableBubble}. \r
+     * Defaults to <tt>[]</tt>.\r
+     */\r
+    bubbleEvents: [],\r
+    \r
     /**\r
      * @cfg {Object} viewConfig A config object that will be applied to the grid's UI view.  Any of\r
      * the config options available for {@link Ext.grid.GridView} can be specified here. This option\r
@@ -59763,6 +64169,33 @@ Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
              * @param {Ext.EventObject} e\r
              */\r
             'headermousedown',\r
+            \r
+            /**\r
+             * @event groupmousedown\r
+             * Fires before a group header is clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.\r
+             * @param {Grid} this\r
+             * @param {String} groupField\r
+             * @param {String} groupValue\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'groupmousedown',\r
+            \r
+            /**\r
+             * @event rowbodymousedown\r
+             * Fires before the row body is clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>\r
+             * @param {Grid} this\r
+             * @param {Number} rowIndex\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'rowbodymousedown',\r
+            \r
+            /**\r
+             * @event containermousedown\r
+             * Fires before the container is clicked. The container consists of any part of the grid body that is not covered by a row.\r
+             * @param {Grid} this\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'containermousedown',\r
 \r
             /**\r
              * @event cellclick\r
@@ -59824,6 +64257,56 @@ function(grid, rowIndex, columnIndex, e) {
              * @param {Ext.EventObject} e\r
              */\r
             'headerdblclick',\r
+            /**\r
+             * @event groupclick\r
+             * Fires when group header is clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.\r
+             * @param {Grid} this\r
+             * @param {String} groupField\r
+             * @param {String} groupValue\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'groupclick',\r
+            /**\r
+             * @event groupdblclick\r
+             * Fires when group header is double clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.\r
+             * @param {Grid} this\r
+             * @param {String} groupField\r
+             * @param {String} groupValue\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'groupdblclick',\r
+            /**\r
+             * @event containerclick\r
+             * Fires when the container is clicked. The container consists of any part of the grid body that is not covered by a row.\r
+             * @param {Grid} this\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'containerclick',\r
+            /**\r
+             * @event containerdblclick\r
+             * Fires when the container is double clicked. The container consists of any part of the grid body that is not covered by a row.\r
+             * @param {Grid} this\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'containerdblclick',\r
+            \r
+            /**\r
+             * @event rowbodyclick\r
+             * Fires when the row body is clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>\r
+             * @param {Grid} this\r
+             * @param {Number} rowIndex\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'rowbodyclick',\r
+            /**\r
+             * @event rowbodydblclick\r
+             * Fires when the row body is double clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>\r
+             * @param {Grid} this\r
+             * @param {Number} rowIndex\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'rowbodydblclick',\r
+            \r
             /**\r
              * @event rowcontextmenu\r
              * Fires when a row is right clicked\r
@@ -59849,6 +64332,30 @@ function(grid, rowIndex, columnIndex, e) {
              * @param {Ext.EventObject} e\r
              */\r
             'headercontextmenu',\r
+            /**\r
+             * @event groupcontextmenu\r
+             * Fires when group header is right clicked. <b>Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}</b>.\r
+             * @param {Grid} this\r
+             * @param {String} groupField\r
+             * @param {String} groupValue\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'groupcontextmenu',\r
+            /**\r
+             * @event containercontextmenu\r
+             * Fires when the container is right clicked. The container consists of any part of the grid body that is not covered by a row.\r
+             * @param {Grid} this\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'containercontextmenu',\r
+            /**\r
+             * @event rowbodycontextmenu\r
+             * Fires when the row body is right clicked. <b>Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured.</b>\r
+             * @param {Grid} this\r
+             * @param {Number} rowIndex\r
+             * @param {Ext.EventObject} e\r
+             */\r
+            'rowbodycontextmenu',\r
             /**\r
              * @event bodyscroll\r
              * Fires when the body element is scrolled\r
@@ -59877,6 +64384,13 @@ function(grid, rowIndex, columnIndex, e) {
              * @param {Object} sortInfo An object with the keys field and direction\r
              */\r
             'sortchange',\r
+            /**\r
+             * @event groupchange\r
+             * Fires when the grid's grouping changes (only applies for grids with a {@link Ext.grid.GroupingView GroupingView})\r
+             * @param {Grid} this\r
+             * @param {String} groupField A string with the grouping field, null if the store is not grouped.\r
+             */\r
+            'groupchange',\r
             /**\r
              * @event reconfigure\r
              * Fires when the grid is reconfigured with a new store and/or column model.\r
@@ -59884,7 +64398,13 @@ function(grid, rowIndex, columnIndex, e) {
              * @param {Ext.data.Store} store The new store\r
              * @param {Ext.grid.ColumnModel} colModel The new column model\r
              */\r
-            'reconfigure'\r
+            'reconfigure',\r
+            /**\r
+             * @event viewready\r
+             * Fires when the grid view is available (use this for selecting a default row). \r
+             * @param {Grid} this\r
+             */\r
+            'viewready'\r
         );\r
     },\r
 \r
@@ -59892,26 +64412,24 @@ function(grid, rowIndex, columnIndex, e) {
     onRender : function(ct, position){\r
         Ext.grid.GridPanel.superclass.onRender.apply(this, arguments);\r
 \r
-        var c = this.body;\r
+        var c = this.getGridEl();\r
 \r
         this.el.addClass('x-grid-panel');\r
 \r
-        var view = this.getView();\r
-        view.init(this);\r
-\r
         this.mon(c, {\r
+            scope: this,\r
             mousedown: this.onMouseDown,\r
             click: this.onClick,\r
             dblclick: this.onDblClick,\r
-            contextmenu: this.onContextMenu,\r
-            keydown: this.onKeyDown,\r
-            scope: this\r
+            contextmenu: this.onContextMenu\r
         });\r
 \r
-        this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress']);\r
+        this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']);\r
 \r
+        var view = this.getView();\r
+        view.init(this);\r
+        view.render();\r
         this.getSelectionModel().init(this);\r
-        this.view.render();\r
     },\r
 \r
     // private\r
@@ -59930,32 +64448,54 @@ function(grid, rowIndex, columnIndex, e) {
     },\r
 \r
     applyState : function(state){\r
-        var cm = this.colModel;\r
-        var cs = state.columns;\r
+        var cm = this.colModel,\r
+            cs = state.columns,\r
+            store = this.store,\r
+            s,\r
+            c,\r
+            oldIndex;\r
+            \r
         if(cs){\r
             for(var i = 0, len = cs.length; i < len; i++){\r
-                var s = cs[i];\r
-                var c = cm.getColumnById(s.id);\r
+                s = cs[i];\r
+                c = cm.getColumnById(s.id);\r
                 if(c){\r
                     c.hidden = s.hidden;\r
                     c.width = s.width;\r
-                    var oldIndex = cm.getIndexById(s.id);\r
+                    oldIndex = cm.getIndexById(s.id);\r
                     if(oldIndex != i){\r
                         cm.moveColumn(oldIndex, i);\r
                     }\r
                 }\r
             }\r
         }\r
-        if(state.sort && this.store){\r
-            this.store[this.store.remoteSort ? 'setDefaultSort' : 'sort'](state.sort.field, state.sort.direction);\r
+        if(store){\r
+            s = state.sort;\r
+            if(s){\r
+                store[store.remoteSort ? 'setDefaultSort' : 'sort'](s.field, s.direction);\r
+            }\r
+            s = state.group;\r
+            if(store.groupBy){\r
+                if(s){\r
+                    store.groupBy(s);\r
+                }else{\r
+                    store.clearGrouping();\r
+                }\r
+            }\r
+\r
         }\r
-        delete state.columns;\r
-        delete state.sort;\r
-        Ext.grid.GridPanel.superclass.applyState.call(this, state);\r
+        var o = Ext.apply({}, state);\r
+        delete o.columns;\r
+        delete o.sort;\r
+        Ext.grid.GridPanel.superclass.applyState.call(this, o);\r
     },\r
 \r
     getState : function(){\r
-        var o = {columns: []};\r
+        var o = {columns: []},\r
+            store = this.store,\r
+            ss,\r
+            gs;\r
+            \r
         for(var i = 0, c; (c = this.colModel.config[i]); i++){\r
             o.columns[i] = {\r
                 id: c.id,\r
@@ -59965,11 +64505,17 @@ function(grid, rowIndex, columnIndex, e) {
                 o.columns[i].hidden = true;\r
             }\r
         }\r
-        if(this.store){\r
-            var ss = this.store.getSortState();\r
+        if(store){\r
+            ss = store.getSortState();\r
             if(ss){\r
                 o.sort = ss;\r
             }\r
+            if(store.getGroupState){\r
+                gs = store.getGroupState();\r
+                if(gs){\r
+                    o.group = gs;\r
+                }\r
+            }\r
         }\r
         return o;\r
     },\r
@@ -59977,11 +64523,13 @@ function(grid, rowIndex, columnIndex, e) {
     // private\r
     afterRender : function(){\r
         Ext.grid.GridPanel.superclass.afterRender.call(this);\r
-        this.view.layout();\r
+        var v = this.view;\r
+        this.on('bodyresize', v.layout, v);\r
+        v.layout();\r
         if(this.deferRowRender){\r
-            this.view.afterRender.defer(10, this.view);\r
+            v.afterRender.defer(10, this.view);\r
         }else{\r
-            this.view.afterRender();\r
+            v.afterRender();\r
         }\r
         this.viewReady = true;\r
     },\r
@@ -59999,31 +64547,28 @@ function(grid, rowIndex, columnIndex, e) {
      * @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object\r
      */\r
     reconfigure : function(store, colModel){\r
-        if(this.loadMask){\r
-            this.loadMask.destroy();\r
-            this.loadMask = new Ext.LoadMask(this.bwrap,\r
-                    Ext.apply({}, {store:store}, this.initialConfig.loadMask));\r
+        var rendered = this.rendered;\r
+        if(rendered){\r
+            if(this.loadMask){\r
+                this.loadMask.destroy();\r
+                this.loadMask = new Ext.LoadMask(this.bwrap,\r
+                        Ext.apply({}, {store:store}, this.initialConfig.loadMask));\r
+            }\r
+        }\r
+        if(this.view){\r
+            this.view.initData(store, colModel);\r
         }\r
-        this.view.initData(store, colModel);\r
         this.store = store;\r
         this.colModel = colModel;\r
-        if(this.rendered){\r
+        if(rendered){\r
             this.view.refresh(true);\r
         }\r
         this.fireEvent('reconfigure', this, store, colModel);\r
     },\r
 \r
-    // private\r
-    onKeyDown : function(e){\r
-        this.fireEvent('keydown', e);\r
-    },\r
-\r
     // private\r
     onDestroy : function(){\r
         if(this.rendered){\r
-            var c = this.body;\r
-            c.removeAllListeners();\r
-            c.update('');\r
             Ext.destroy(this.view, this.loadMask);\r
         }else if(this.store && this.store.autoDestroy){\r
             this.store.destroy();\r
@@ -60036,21 +64581,31 @@ function(grid, rowIndex, columnIndex, e) {
     // private\r
     processEvent : function(name, e){\r
         this.fireEvent(name, e);\r
-        var t = e.getTarget();\r
-        var v = this.view;\r
-        var header = v.findHeaderIndex(t);\r
+        var t = e.getTarget(),\r
+            v = this.view,\r
+            header = v.findHeaderIndex(t);\r
+            \r
         if(header !== false){\r
             this.fireEvent('header' + name, this, header, e);\r
         }else{\r
-            var row = v.findRowIndex(t);\r
-            var cell = v.findCellIndex(t);\r
+            var row = v.findRowIndex(t),\r
+                cell,\r
+                body;\r
             if(row !== false){\r
                 this.fireEvent('row' + name, this, row, e);\r
+                cell = v.findCellIndex(t);\r
+                body = v.findRowBody(t);\r
                 if(cell !== false){\r
                     this.fireEvent('cell' + name, this, row, cell, e);\r
                 }\r
+                if(body){\r
+                    this.fireEvent('rowbody' + name, this, row, e);\r
+                }\r
+            }else{\r
+                this.fireEvent('container' + name, this, e);\r
             }\r
         }\r
+        this.view.processEvent(name, e);\r
     },\r
 \r
     // private\r
@@ -60075,8 +64630,11 @@ function(grid, rowIndex, columnIndex, e) {
 \r
     // private\r
     walkCells : function(row, col, step, fn, scope){\r
-        var cm = this.colModel, clen = cm.getColumnCount();\r
-        var ds = this.store, rlen = ds.getCount(), first = true;\r
+        var cm = this.colModel, \r
+            clen = cm.getColumnCount(),\r
+            ds = this.store, \r
+            rlen = ds.getCount(), \r
+            first = true;\r
         if(step < 0){\r
             if(col < 0){\r
                 row--;\r
@@ -60294,7 +64852,7 @@ function(grid, rowIndex, columnIndex, e) {
      * @hide \r
      */\r
     /** \r
-     * @event afterLayout \r
+     * @event afterlayout \r
      * @hide \r
      */\r
     /** \r
@@ -60378,67 +64936,7 @@ Ext.reg('grid', Ext.grid.GridPanel);/**
  * @constructor
  * @param {Object} config
  */
-Ext.grid.GridView = function(config){
-    Ext.apply(this, config);
-    // These events are only used internally by the grid components
-    this.addEvents(
-        /**
-         * @event beforerowremoved
-         * Internal UI Event. Fired before a row is removed.
-         * @param {Ext.grid.GridView} view
-         * @param {Number} rowIndex The index of the row to be removed.
-         * @param {Ext.data.Record} record The Record to be removed
-         */
-        "beforerowremoved",
-        /**
-         * @event beforerowsinserted
-         * Internal UI Event. Fired before rows are inserted.
-         * @param {Ext.grid.GridView} view
-         * @param {Number} firstRow The index of the first row to be inserted.
-         * @param {Number} lastRow The index of the last row to be inserted.
-         */
-        "beforerowsinserted",
-        /**
-         * @event beforerefresh
-         * Internal UI Event. Fired before the view is refreshed.
-         * @param {Ext.grid.GridView} view
-         */
-        "beforerefresh",
-        /**
-         * @event rowremoved
-         * Internal UI Event. Fired after a row is removed.
-         * @param {Ext.grid.GridView} view
-         * @param {Number} rowIndex The index of the row that was removed.
-         * @param {Ext.data.Record} record The Record that was removed
-         */
-        "rowremoved",
-        /**
-         * @event rowsinserted
-         * Internal UI Event. Fired after rows are inserted.
-         * @param {Ext.grid.GridView} view
-         * @param {Number} firstRow The index of the first inserted.
-         * @param {Number} lastRow The index of the last row inserted.
-         */
-        "rowsinserted",
-        /**
-         * @event rowupdated
-         * Internal UI Event. Fired after a row has been updated.
-         * @param {Ext.grid.GridView} view
-         * @param {Number} firstRow The index of the row updated.
-         * @param {Ext.data.record} record The Record backing the row updated.
-         */
-        "rowupdated",
-        /**
-         * @event refresh
-         * Internal UI Event. Fired after the GridView's body has been refreshed.
-         * @param {Ext.grid.GridView} view
-         */
-        "refresh"
-    );
-    Ext.grid.GridView.superclass.constructor.call(this);
-};
-
-Ext.extend(Ext.grid.GridView, Ext.util.Observable, {
+Ext.grid.GridView = Ext.extend(Ext.util.Observable, {
     /**
      * Override this function to apply custom CSS classes to rows during rendering.  You can also supply custom
      * parameters to the row template for the current row to customize how it is rendered using the <b>rowParams</b>
@@ -60516,9 +65014,10 @@ viewConfig: {
     deferEmptyText : true,
     /**
      * @cfg {Number} scrollOffset The amount of space to reserve for the vertical scrollbar
-     * (defaults to <tt>19</tt> pixels).
+     * (defaults to <tt>undefined</tt>). If an explicit value isn't specified, this will be automatically
+     * calculated.
      */
-    scrollOffset : 19,
+    scrollOffset : undefined,
     /**
      * @cfg {Boolean} autoFill
      * Defaults to <tt>false</tt>.  Specify <tt>true</tt> to have the column widths re-proportioned
@@ -60539,24 +65038,24 @@ viewConfig: {
      */
     forceFit : false,
     /**
-     * @cfg {Array} sortClasses The CSS classes applied to a header when it is sorted. (defaults to <tt>["sort-asc", "sort-desc"]</tt>)
+     * @cfg {Array} sortClasses The CSS classes applied to a header when it is sorted. (defaults to <tt>['sort-asc', 'sort-desc']</tt>)
      */
-    sortClasses : ["sort-asc", "sort-desc"],
+    sortClasses : ['sort-asc', 'sort-desc'],
     /**
-     * @cfg {String} sortAscText The text displayed in the "Sort Ascending" menu item (defaults to <tt>"Sort Ascending"</tt>)
+     * @cfg {String} sortAscText The text displayed in the 'Sort Ascending' menu item (defaults to <tt>'Sort Ascending'</tt>)
      */
-    sortAscText : "Sort Ascending",
+    sortAscText : 'Sort Ascending',
     /**
-     * @cfg {String} sortDescText The text displayed in the "Sort Descending" menu item (defaults to <tt>"Sort Descending"</tt>)
+     * @cfg {String} sortDescText The text displayed in the 'Sort Descending' menu item (defaults to <tt>'Sort Descending'</tt>)
      */
-    sortDescText : "Sort Descending",
+    sortDescText : 'Sort Descending',
     /**
-     * @cfg {String} columnsText The text displayed in the "Columns" menu item (defaults to <tt>"Columns"</tt>)
+     * @cfg {String} columnsText The text displayed in the 'Columns' menu item (defaults to <tt>'Columns'</tt>)
      */
-    columnsText : "Columns",
+    columnsText : 'Columns',
 
     /**
-     * @cfg {String} selectedRowClass The CSS class applied to a selected row (defaults to <tt>"x-grid3-row-selected"</tt>). An
+     * @cfg {String} selectedRowClass The CSS class applied to a selected row (defaults to <tt>'x-grid3-row-selected'</tt>). An
      * example overriding the default styling:
     <pre><code>
     .x-grid3-row-selected {background-color: yellow;}
@@ -60570,7 +65069,7 @@ viewConfig: {
     </code></pre>
      * @type String
      */
-    selectedRowClass : "x-grid3-row-selected",
+    selectedRowClass : 'x-grid3-row-selected',
 
     // private
     borderWidth : 2,
@@ -60586,6 +65085,11 @@ viewConfig: {
      * @cfg {Number} rowSelectorDepth The number of levels to search for rows in event delegation (defaults to <tt>10</tt>)
      */
     rowSelectorDepth : 10,
+    
+    /**
+     * @cfg {Number} rowBodySelectorDepth The number of levels to search for row bodies in event delegation (defaults to <tt>10</tt>)
+     */
+    rowBodySelectorDepth : 10,
 
     /**
      * @cfg {String} cellSelector The selector used to find cells internally (defaults to <tt>'td.x-grid3-cell'</tt>)
@@ -60596,10 +65100,75 @@ viewConfig: {
      */
     rowSelector : 'div.x-grid3-row',
     
+    /**
+     * @cfg {String} rowBodySelector The selector used to find row bodies internally (defaults to <tt>'div.x-grid3-row'</tt>)
+     */
+    rowBodySelector : 'div.x-grid3-row-body',
+    
     // private
     firstRowCls: 'x-grid3-row-first',
     lastRowCls: 'x-grid3-row-last',
     rowClsRe: /(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,
+    
+    constructor : function(config){
+        Ext.apply(this, config);
+           // These events are only used internally by the grid components
+           this.addEvents(
+               /**
+                * @event beforerowremoved
+                * Internal UI Event. Fired before a row is removed.
+                * @param {Ext.grid.GridView} view
+                * @param {Number} rowIndex The index of the row to be removed.
+                * @param {Ext.data.Record} record The Record to be removed
+                */
+               'beforerowremoved',
+               /**
+                * @event beforerowsinserted
+                * Internal UI Event. Fired before rows are inserted.
+                * @param {Ext.grid.GridView} view
+                * @param {Number} firstRow The index of the first row to be inserted.
+                * @param {Number} lastRow The index of the last row to be inserted.
+                */
+               'beforerowsinserted',
+               /**
+                * @event beforerefresh
+                * Internal UI Event. Fired before the view is refreshed.
+                * @param {Ext.grid.GridView} view
+                */
+               'beforerefresh',
+               /**
+                * @event rowremoved
+                * Internal UI Event. Fired after a row is removed.
+                * @param {Ext.grid.GridView} view
+                * @param {Number} rowIndex The index of the row that was removed.
+                * @param {Ext.data.Record} record The Record that was removed
+                */
+               'rowremoved',
+               /**
+                * @event rowsinserted
+                * Internal UI Event. Fired after rows are inserted.
+                * @param {Ext.grid.GridView} view
+                * @param {Number} firstRow The index of the first inserted.
+                * @param {Number} lastRow The index of the last row inserted.
+                */
+               'rowsinserted',
+               /**
+                * @event rowupdated
+                * Internal UI Event. Fired after a row has been updated.
+                * @param {Ext.grid.GridView} view
+                * @param {Number} firstRow The index of the row updated.
+                * @param {Ext.data.record} record The Record backing the row updated.
+                */
+               'rowupdated',
+               /**
+                * @event refresh
+                * Internal UI Event. Fired after the GridView's body has been refreshed.
+                * @param {Ext.grid.GridView} view
+                */
+               'refresh'
+           );
+           Ext.grid.GridView.superclass.constructor.call(this);    
+    },
 
     /* -------------------------------- UI Specific ----------------------------- */
 
@@ -60658,14 +65227,14 @@ viewConfig: {
 
         for(var k in ts){
             var t = ts[k];
-            if(t && typeof t.compile == 'function' && !t.compiled){
+            if(t && Ext.isFunction(t.compile) && !t.compiled){
                 t.disableFormats = true;
                 t.compile();
             }
         }
 
         this.templates = ts;
-        this.colRe = new RegExp("x-grid3-td-([^\\s]+)", "");
+        this.colRe = new RegExp('x-grid3-td-([^\\s]+)', '');
     },
 
     // private
@@ -60712,7 +65281,7 @@ viewConfig: {
         this.mainBody = new E(this.scroller.dom.firstChild);
 
         this.focusEl = new E(this.scroller.dom.childNodes[1]);
-        this.focusEl.swallowEvent("click", true);
+        this.focusEl.swallowEvent('click', true);
 
         this.resizeMarker = new E(cs[1]);
         this.resizeProxy = new E(cs[2]);
@@ -60733,12 +65302,12 @@ viewConfig: {
         return this.fly(el).findParent(this.cellSelector, this.cellSelectorDepth);
     },
 
-/**
* <p>Return the index of the grid column which contains the passed element.</p>
- * See also {@link #findRowIndex}
* @param {Element} el The target element
* @return The column index, or <b>false</b> if the target element is not within a row of this GridView.
- */
+    /**
    * <p>Return the index of the grid column which contains the passed HTMLElement.</p>
    * See also {@link #findRowIndex}
    * @param {HTMLElement} el The target element
    * @return {Number} The column index, or <b>false</b> if the target element is not within a row of this GridView.
    */
     findCellIndex : function(el, requiredCls){
         var cell = this.findCell(el);
         if(cell && (!requiredCls || this.fly(cell).hasClass(requiredCls))){
@@ -60769,11 +65338,11 @@ viewConfig: {
         return this.findCellIndex(el, this.hdCls);
     },
 
-/**
- * Return the HtmlElement representing the grid row which contains the passed element.
* @param {Element} el The target element
* @return The row element, or null if the target element is not within a row of this GridView.
- */
+    /**
    * Return the HtmlElement representing the grid row which contains the passed element.
    * @param {HTMLElement} el The target HTMLElement
    * @return {HTMLElement} The row element, or null if the target element is not within a row of this GridView.
    */
     findRow : function(el){
         if(!el){
             return false;
@@ -60781,43 +65350,55 @@ viewConfig: {
         return this.fly(el).findParent(this.rowSelector, this.rowSelectorDepth);
     },
 
-/**
* <p>Return the index of the grid row which contains the passed element.</p>
- * See also {@link #findCellIndex}
* @param {Element} el The target element
* @return The row index, or <b>false</b> if the target element is not within a row of this GridView.
- */
+    /**
    * <p>Return the index of the grid row which contains the passed HTMLElement.</p>
    * See also {@link #findCellIndex}
    * @param {HTMLElement} el The target HTMLElement
    * @return {Number} The row index, or <b>false</b> if the target element is not within a row of this GridView.
    */
     findRowIndex : function(el){
         var r = this.findRow(el);
         return r ? r.rowIndex : false;
     },
+    
+    /**
+     * Return the HtmlElement representing the grid row body which contains the passed element.
+     * @param {HTMLElement} el The target HTMLElement
+     * @return {HTMLElement} The row body element, or null if the target element is not within a row body of this GridView.
+     */
+    findRowBody : function(el){
+        if(!el){
+            return false;
+        }
+        return this.fly(el).findParent(this.rowBodySelector, this.rowBodySelectorDepth);
+    },
 
     // getter methods for fetching elements dynamically in the grid
 
-/**
- * Return the <tt>&lt;div></tt> HtmlElement which represents a Grid row for the specified index.
- * @param {Number} index The row index
- * @return {HtmlElement} The div element.
- */
+    /**
    * Return the <tt>&lt;div></tt> HtmlElement which represents a Grid row for the specified index.
    * @param {Number} index The row index
    * @return {HtmlElement} The div element.
    */
     getRow : function(row){
         return this.getRows()[row];
     },
 
-/**
- * Returns the grid's <tt>&lt;td></tt> HtmlElement at the specified coordinates.
- * @param {Number} row The row index in which to find the cell.
- * @param {Number} col The column index of the cell.
- * @return {HtmlElement} The td at the specified coordinates.
- */
+    /**
    * Returns the grid's <tt>&lt;td></tt> HtmlElement at the specified coordinates.
    * @param {Number} row The row index in which to find the cell.
    * @param {Number} col The column index of the cell.
    * @return {HtmlElement} The td at the specified coordinates.
    */
     getCell : function(row, col){
         return this.getRow(row).getElementsByTagName('td')[col];
     },
 
-/**
- * Return the <tt>&lt;td></tt> HtmlElement which represents the Grid's header cell for the specified column index.
- * @param {Number} index The column index
- * @return {HtmlElement} The td element.
- */
+    /**
    * Return the <tt>&lt;td></tt> HtmlElement which represents the Grid's header cell for the specified column index.
    * @param {Number} index The column index
    * @return {HtmlElement} The td element.
    */
     getHeaderCell : function(index){
       return this.mainHd.dom.getElementsByTagName('td')[index];
     },
@@ -60882,7 +65463,7 @@ viewConfig: {
     syncScroll : function(){
       this.syncHeaderScroll();
       var mb = this.scroller.dom;
-        this.grid.fireEvent("bodyscroll", mb.scrollLeft, mb.scrollTop);
+        this.grid.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop);
     },
 
     // private
@@ -60896,7 +65477,7 @@ viewConfig: {
     updateSortIcon : function(col, dir){
         var sc = this.sortClasses;
         var hds = this.mainHd.select('td').removeClass(sc);
-        hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]);
+        hds.item(col).addClass(sc[dir == 'DESC' ? 1 : 0]);
     },
 
     // private
@@ -60995,33 +65576,33 @@ viewConfig: {
                 c = cs[i];
                 p.id = c.id;
                 p.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
-                p.attr = p.cellAttr = "";
-                p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
+                p.attr = p.cellAttr = '';
+                p.value = c.renderer.call(c.scope, r.data[c.name], p, r, rowIndex, i, ds);
                 p.style = c.style;
                 if(Ext.isEmpty(p.value)){
-                    p.value = "&#160;";
+                    p.value = '&#160;';
                 }
-                if(this.markDirty && r.dirty && typeof r.modified[c.name] !== 'undefined'){
+                if(this.markDirty && r.dirty && Ext.isDefined(r.modified[c.name])){
                     p.css += ' x-grid3-dirty-cell';
                 }
                 cb[cb.length] = ct.apply(p);
             }
             var alt = [];
             if(stripe && ((rowIndex+1) % 2 === 0)){
-                alt[0] = "x-grid3-row-alt";
+                alt[0] = 'x-grid3-row-alt';
             }
             if(r.dirty){
-                alt[1] = " x-grid3-dirty-row";
+                alt[1] = ' x-grid3-dirty-row';
             }
             rp.cols = colCount;
             if(this.getRowClass){
                 alt[2] = this.getRowClass(r, rowIndex, rp, ds);
             }
-            rp.alt = alt.join(" ");
-            rp.cells = cb.join("");
+            rp.alt = alt.join(' ');
+            rp.cells = cb.join('');
             buf[buf.length] =  rt.apply(rp);
         }
-        return buf.join("");
+        return buf.join('');
     },
 
     // private
@@ -61029,16 +65610,24 @@ viewConfig: {
         if(!this.ds || this.ds.getCount() < 1){
             return;
         }
-        var rows = this.getRows();
+        var rows = this.getRows(),
+            len = rows.length,
+            i, r;
+            
         skipStripe = skipStripe || !this.grid.stripeRows;
         startRow = startRow || 0;
-        Ext.each(rows, function(row, idx){
-            row.rowIndex = idx;
-            row.className = row.className.replace(this.rowClsRe, ' ');
-            if (!skipStripe && (idx + 1) % 2 === 0) {
-                row.className += ' x-grid3-row-alt';
-            }
-        });
+        for(i = 0; i<len; i++) {
+            r = rows[i];
+            if(r) {
+                r.rowIndex = i;
+                if(!skipStripe){
+                    r.className = r.className.replace(this.rowClsRe, ' ');
+                    if ((i + 1) % 2 === 0){
+                        r.className += ' x-grid3-row-alt';
+                    }
+                }   
+            }          
+        }
         // add first/last-row classes
         if(startRow === 0){
             Ext.fly(rows[0]).addClass(this.firstRowCls);
@@ -61056,6 +65645,7 @@ viewConfig: {
         if(this.deferEmptyText !== true){
             this.applyEmptyText();
         }
+        this.grid.fireEvent('viewready', this.grid);
     },
 
     // private
@@ -61079,7 +65669,7 @@ viewConfig: {
         this.initElements();
 
         // get mousedowns early
-        Ext.fly(this.innerHd).on("click", this.handleHdDown, this);
+        Ext.fly(this.innerHd).on('click', this.handleHdDown, this);
         this.mainHd.on({
             scope: this,
             mouseover: this.handleHdOver,
@@ -61098,27 +65688,27 @@ viewConfig: {
         }
 
         if(g.enableHdMenu !== false){
-            this.hmenu = new Ext.menu.Menu({id: g.id + "-hctx"});
+            this.hmenu = new Ext.menu.Menu({id: g.id + '-hctx'});
             this.hmenu.add(
-                {itemId:"asc", text: this.sortAscText, cls: "xg-hmenu-sort-asc"},
-                {itemId:"desc", text: this.sortDescText, cls: "xg-hmenu-sort-desc"}
+                {itemId:'asc', text: this.sortAscText, cls: 'xg-hmenu-sort-asc'},
+                {itemId:'desc', text: this.sortDescText, cls: 'xg-hmenu-sort-desc'}
             );
             if(g.enableColumnHide !== false){
-                this.colMenu = new Ext.menu.Menu({id:g.id + "-hcols-menu"});
+                this.colMenu = new Ext.menu.Menu({id:g.id + '-hcols-menu'});
                 this.colMenu.on({
                     scope: this,
                     beforeshow: this.beforeColMenuShow,
                     itemclick: this.handleHdMenuClick
                 });
                 this.hmenu.add('-', {
-                    itemId:"columns",
+                    itemId:'columns',
                     hideOnClick: false,
                     text: this.columnsText,
                     menu: this.colMenu,
                     iconCls: 'x-cols-icon'
                 });
             }
-            this.hmenu.on("itemclick", this.handleHdMenuClick, this);
+            this.hmenu.on('itemclick', this.handleHdMenuClick, this);
         }
 
         if(g.trackMouseOver){
@@ -61138,6 +65728,9 @@ viewConfig: {
         this.updateHeaderSortState();
 
     },
+    
+    // private
+    processEvent: Ext.emptyFn,
 
     // private
     layout : function(){
@@ -61224,7 +65817,11 @@ viewConfig: {
     
     // private 
     getOffsetWidth : function() {
-        return (this.cm.getTotalWidth() + this.scrollOffset) + 'px';
+        return (this.cm.getTotalWidth() + this.getScrollOffset()) + 'px';
+    },
+    
+    getScrollOffset: function(){
+        return Ext.num(this.scrollOffset, Ext.getScrollBarWidth());
     },
 
     // private
@@ -61239,7 +65836,7 @@ viewConfig: {
             
         for(var i = 0; i < len; i++){
             p.id = cm.getColumnId(i);
-            p.value = cm.getColumnHeader(i) || "";
+            p.value = cm.getColumnHeader(i) || '';
             p.style = this.getColumnStyle(i, true);
             p.tooltip = this.getColumnTooltip(i);
             p.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
@@ -61250,7 +65847,7 @@ viewConfig: {
             }
             cb[cb.length] = ct.apply(p);
         }
-        return ts.header.apply({cells: cb.join(""), tstyle:'width:'+this.getTotalWidth()+';'});
+        return ts.header.apply({cells: cb.join(''), tstyle:'width:'+this.getTotalWidth()+';'});
     },
 
     // private
@@ -61263,7 +65860,7 @@ viewConfig: {
                 return 'title="'+tt+'"';
             }
         }
-        return "";
+        return '';
     },
 
     // private
@@ -61301,7 +65898,7 @@ viewConfig: {
     },
 
     resolveCell : function(row, col, hscroll){
-        if(typeof row != "number"){
+        if(!Ext.isNumber(row)){
             row = row.rowIndex;
         }
         if(!this.ds){
@@ -61360,13 +65957,13 @@ viewConfig: {
             ctop += p.offsetTop;
             p = p.offsetParent;
         }
+        
         ctop -= this.mainHd.dom.offsetHeight;
-
+        stop = parseInt(c.scrollTop, 10);
+        
         var cbot = ctop + rowEl.offsetHeight,
             ch = c.clientHeight,
             sbot = stop + ch;
-            
-        stop = parseInt(c.scrollTop, 10);
         
 
         if(ctop < stop){
@@ -61394,10 +65991,12 @@ viewConfig: {
     insertRows : function(dm, firstRow, lastRow, isUpdate){
         var last = dm.getCount() - 1;
         if(!isUpdate && firstRow === 0 && lastRow >= last){
+           this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
             this.refresh();
+           this.fireEvent('rowsinserted', this, firstRow, lastRow);
         }else{
             if(!isUpdate){
-                this.fireEvent("beforerowsinserted", this, firstRow, lastRow);
+                this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
             }
             var html = this.renderRows(firstRow, lastRow),
                 before = this.getRow(firstRow);
@@ -61414,7 +66013,7 @@ viewConfig: {
                 Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
             }
             if(!isUpdate){
-                this.fireEvent("rowsinserted", this, firstRow, lastRow);
+                this.fireEvent('rowsinserted', this, firstRow, lastRow);
                 this.processRows(firstRow);
             }else if(firstRow === 0 || firstRow >= last){
                 //ensure first/last row is kept after an update.
@@ -61429,12 +66028,12 @@ viewConfig: {
         if(dm.getRowCount()<1){
             this.refresh();
         }else{
-            this.fireEvent("beforerowsdeleted", this, firstRow, lastRow);
+            this.fireEvent('beforerowsdeleted', this, firstRow, lastRow);
 
             this.removeRows(firstRow, lastRow);
 
             this.processRows(firstRow);
-            this.fireEvent("rowsdeleted", this, firstRow, lastRow);
+            this.fireEvent('rowsdeleted', this, firstRow, lastRow);
         }
     },
 
@@ -61455,8 +66054,8 @@ viewConfig: {
     // private
     getColumnWidth : function(col){
         var w = this.cm.getColumnWidth(col);
-        if(typeof w == 'number'){
-            return (Ext.isBorderBox ? w : (w-this.borderWidth > 0 ? w-this.borderWidth:0)) + 'px';
+        if(Ext.isNumber(w)){
+            return (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2) ? w : (w - this.borderWidth > 0 ? w - this.borderWidth : 0)) + 'px';
         }
         return w;
     },
@@ -61470,7 +66069,7 @@ viewConfig: {
     fitColumns : function(preventRefresh, onlyExpand, omitColumn){
         var cm = this.cm, i;
         var tw = cm.getTotalWidth(false);
-        var aw = this.grid.getGridEl().getWidth(true)-this.scrollOffset;
+        var aw = this.grid.getGridEl().getWidth(true)-this.getScrollOffset();
 
         if(aw < 20){ // not initialized, so don't screw up the default widths
             return;
@@ -61482,7 +66081,7 @@ viewConfig: {
         }
 
         var vc = cm.getColumnCount(true);
-        var ac = vc-(typeof omitColumn == 'number' ? 1 : 0);
+        var ac = vc-(Ext.isNumber(omitColumn) ? 1 : 0);
         if(ac === 0){
             ac = 1;
             omitColumn = undefined;
@@ -61527,7 +66126,7 @@ viewConfig: {
         var g = this.grid, cm = this.cm;
         if(!this.userResized && g.autoExpandColumn){
             var tw = cm.getTotalWidth(false);
-            var aw = this.grid.getGridEl().getWidth(true)-this.scrollOffset;
+            var aw = this.grid.getGridEl().getWidth(true)-this.getScrollOffset();
             if(tw != aw){
                 var ci = cm.getIndexById(g.autoExpandColumn);
                 var currentWidth = cm.getColumnWidth(ci);
@@ -61549,8 +66148,9 @@ viewConfig: {
         for(var i = 0; i < colCount; i++){
             var name = cm.getDataIndex(i);
             cs[i] = {
-                name : (typeof name == 'undefined' ? this.ds.fields.get(i).name : name),
+                name : (!Ext.isDefined(name) ? this.ds.fields.get(i).name : name),
                 renderer : cm.getRenderer(i),
+                scope: cm.getRendererScope(i),
                 id : cm.getColumnId(i),
                 style : this.getColumnStyle(i)
             };
@@ -61565,13 +66165,13 @@ viewConfig: {
         var colCount = cm.getColumnCount();
 
         if(ds.getCount() < 1){
-            return "";
+            return '';
         }
 
         var cs = this.getColumnData();
 
         startRow = startRow || 0;
-        endRow = typeof endRow == "undefined"? ds.getCount()-1 : endRow;
+        endRow = !Ext.isDefined(endRow) ? ds.getCount()-1 : endRow;
 
         // records to render
         var rs = ds.getRange(startRow, endRow);
@@ -61588,7 +66188,7 @@ viewConfig: {
     // private
     refreshRow : function(record){
         var ds = this.ds, index;
-        if(typeof record == 'number'){
+        if(Ext.isNumber(record)){
             index = record;
             record = ds.getAt(index);
             if(!record){
@@ -61603,7 +66203,7 @@ viewConfig: {
         this.insertRows(ds, index, index, true);
         this.getRow(index).rowIndex = index;
         this.onRemove(ds, record, index+1, true);
-        this.fireEvent("rowupdated", this, index, record);
+        this.fireEvent('rowupdated', this, index, record);
     },
 
     /**
@@ -61611,7 +66211,7 @@ viewConfig: {
      * @param {Boolean} headersToo (optional) True to also refresh the headers
      */
     refresh : function(headersToo){
-        this.fireEvent("beforerefresh", this);
+        this.fireEvent('beforerefresh', this);
         this.grid.stopEditing(true);
 
         var result = this.renderBody();
@@ -61623,7 +66223,7 @@ viewConfig: {
         this.processRows(0, true);
         this.layout();
         this.applyEmptyText();
-        this.fireEvent("refresh", this);
+        this.fireEvent('refresh', this);
     },
 
     // private
@@ -61650,6 +66250,16 @@ viewConfig: {
         }
     },
 
+    // private
+    clearHeaderSortState : function(){
+        if(!this.sortState){
+            return;
+        }
+        this.grid.fireEvent('sortchange', this.grid, null);
+        this.mainHd.select('td').removeClass(this.sortClasses);
+        delete this.sortState;
+    },
+
     // private
     destroy : function(){
         if(this.colMenu){
@@ -61662,41 +66272,75 @@ viewConfig: {
             this.hmenu.destroy();
             delete this.hmenu;
         }
+
+        this.initData(null, null);
+        this.purgeListeners();
+        Ext.fly(this.innerHd).un("click", this.handleHdDown, this);
+
         if(this.grid.enableColumnMove){
-            var dds = Ext.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id];
-            if(dds){
-                for(var dd in dds){
-                    if(!dds[dd].config.isTarget && dds[dd].dragElId){
-                        var elid = dds[dd].dragElId;
-                        dds[dd].unreg();
-                        Ext.get(elid).remove();
-                    } else if(dds[dd].config.isTarget){
-                        dds[dd].proxyTop.remove();
-                        dds[dd].proxyBottom.remove();
-                        dds[dd].unreg();
-                    }
-                    if(Ext.dd.DDM.locationCache[dd]){
-                        delete Ext.dd.DDM.locationCache[dd];
-                    }
-                }
-                delete Ext.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id];
+            Ext.destroy(
+                this.columnDrag.el,
+                this.columnDrag.proxy.ghost,
+                this.columnDrag.proxy.el,
+                this.columnDrop.el,
+                this.columnDrop.proxyTop,
+                this.columnDrop.proxyBottom,
+                this.columnDrag.dragData.ddel,
+                this.columnDrag.dragData.header
+            );
+            if (this.columnDrag.proxy.anim) {
+                Ext.destroy(this.columnDrag.proxy.anim);
             }
+            delete this.columnDrag.proxy.ghost;
+            delete this.columnDrag.dragData.ddel;
+            delete this.columnDrag.dragData.header;
+            this.columnDrag.destroy();
+            delete Ext.dd.DDM.locationCache[this.columnDrag.id];
+            delete this.columnDrag._domRef;
+
+            delete this.columnDrop.proxyTop;
+            delete this.columnDrop.proxyBottom;
+            this.columnDrop.destroy();
+            delete Ext.dd.DDM.locationCache["gridHeader" + this.grid.getGridEl().id];
+            delete this.columnDrop._domRef;
+            delete Ext.dd.DDM.ids[this.columnDrop.ddGroup];
         }
 
-        if(this.dragZone){
-            this.dragZone.unreg();
+        if (this.splitZone){ // enableColumnResize
+            this.splitZone.destroy();
+            delete this.splitZone._domRef;
+            delete Ext.dd.DDM.ids["gridSplitters" + this.grid.getGridEl().id];
         }
-        
+
         Ext.fly(this.innerHd).removeAllListeners();
         Ext.removeNode(this.innerHd);
-        
-        Ext.destroy(this.resizeMarker, this.resizeProxy, this.focusEl, this.mainBody, 
-                    this.scroller, this.mainHd, this.mainWrap, this.dragZone, 
-                    this.splitZone, this.columnDrag, this.columnDrop);
+        delete this.innerHd;
+
+        Ext.destroy(
+            this.el,
+            this.mainWrap,
+            this.mainHd,
+            this.scroller,
+            this.mainBody,
+            this.focusEl,
+            this.resizeMarker,
+            this.resizeProxy,
+            this.activeHdBtn,
+            this.dragZone,
+            this.splitZone,
+            this._flyweight
+        );
+
+        delete this.grid.container;
+
+        if(this.dragZone){
+            this.dragZone.destroy();
+        }
+
+        Ext.dd.DDM.currentTarget = null;
+        delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];
 
-        this.initData(null, null);
         Ext.EventManager.removeResizeListener(this.onWindowResize, this);
-        this.purgeListeners();
     },
 
     // private
@@ -61729,12 +66373,12 @@ viewConfig: {
     // private
     initData : function(ds, cm){
         if(this.ds){
-            this.ds.un("load", this.onLoad, this);
-            this.ds.un("datachanged", this.onDataChange, this);
-            this.ds.un("add", this.onAdd, this);
-            this.ds.un("remove", this.onRemove, this);
-            this.ds.un("update", this.onUpdate, this);
-            this.ds.un("clear", this.onClear, this);
+            this.ds.un('load', this.onLoad, this);
+            this.ds.un('datachanged', this.onDataChange, this);
+            this.ds.un('add', this.onAdd, this);
+            this.ds.un('remove', this.onRemove, this);
+            this.ds.un('update', this.onUpdate, this);
+            this.ds.un('clear', this.onClear, this);
             if(this.ds !== ds && this.ds.autoDestroy){
                 this.ds.destroy();
             }
@@ -61753,11 +66397,11 @@ viewConfig: {
         this.ds = ds;
 
         if(this.cm){
-            this.cm.un("configchange", this.onColConfigChange, this);
-            this.cm.un("widthchange", this.onColWidthChange, this);
-            this.cm.un("headerchange", this.onHeaderChange, this);
-            this.cm.un("hiddenchange", this.onHiddenChange, this);
-            this.cm.un("columnmoved", this.onColumnMove, this);
+            this.cm.un('configchange', this.onColConfigChange, this);
+            this.cm.un('widthchange', this.onColWidthChange, this);
+            this.cm.un('headerchange', this.onHeaderChange, this);
+            this.cm.un('hiddenchange', this.onHiddenChange, this);
+            this.cm.un('columnmoved', this.onColumnMove, this);
         }
         if(cm){
             delete this.lastViewWidth;
@@ -61793,25 +66437,26 @@ viewConfig: {
 
     // private
     onAdd : function(ds, records, index){
+       
         this.insertRows(ds, index, index + (records.length-1));
     },
 
     // private
     onRemove : function(ds, record, index, isUpdate){
         if(isUpdate !== true){
-            this.fireEvent("beforerowremoved", this, index, record);
+            this.fireEvent('beforerowremoved', this, index, record);
         }
         this.removeRow(index);
         if(isUpdate !== true){
             this.processRows(index);
             this.applyEmptyText();
-            this.fireEvent("rowremoved", this, index, record);
+            this.fireEvent('rowremoved', this, index, record);
         }
     },
 
     // private
     onLoad : function(){
-        this.scrollToTop();
+        this.scrollToTop.defer(Ext.isGecko ? 1 : 0, this);
     },
 
     // private
@@ -61849,7 +66494,7 @@ viewConfig: {
     /* -------------------- UI Events and Handlers ------------------------------ */
     // private
     initUI : function(grid){
-        grid.on("headerclick", this.onHeaderClick, this);
+        grid.on('headerclick', this.onHeaderClick, this);
     },
 
     // private
@@ -61869,7 +66514,7 @@ viewConfig: {
     onRowOver : function(e, t){
         var row;
         if((row = this.findRowIndex(t)) !== false){
-            this.addRowClass(row, "x-grid3-row-over");
+            this.addRowClass(row, 'x-grid3-row-over');
         }
     },
 
@@ -61877,7 +66522,7 @@ viewConfig: {
     onRowOut : function(e, t){
         var row;
         if((row = this.findRowIndex(t)) !== false && !e.within(this.getRow(row), true)){
-            this.removeRowClass(row, "x-grid3-row-over");
+            this.removeRowClass(row, 'x-grid3-row-over');
         }
     },
 
@@ -61900,7 +66545,7 @@ viewConfig: {
     onCellSelect : function(row, col){
         var cell = this.getCell(row, col);
         if(cell){
-            this.fly(cell).addClass("x-grid3-cell-selected");
+            this.fly(cell).addClass('x-grid3-cell-selected');
         }
     },
 
@@ -61908,7 +66553,7 @@ viewConfig: {
     onCellDeselect : function(row, col){
         var cell = this.getCell(row, col);
         if(cell){
-            this.fly(cell).removeClass("x-grid3-cell-selected");
+            this.fly(cell).removeClass('x-grid3-cell-selected');
         }
     },
 
@@ -61926,22 +66571,24 @@ viewConfig: {
             this.syncHeaderScroll();
         }
 
-        this.grid.fireEvent("columnresize", i, w);
+        this.grid.fireEvent('columnresize', i, w);
     },
 
     // private
     handleHdMenuClick : function(item){
-        var index = this.hdCtxIndex;
-        var cm = this.cm, ds = this.ds;
-        switch(item.itemId){
-            case "asc":
-                ds.sort(cm.getDataIndex(index), "ASC");
+        var index = this.hdCtxIndex,
+            cm = this.cm, 
+            ds = this.ds,
+            id = item.getItemId();
+        switch(id){
+            case 'asc':
+                ds.sort(cm.getDataIndex(index), 'ASC');
                 break;
-            case "desc":
-                ds.sort(cm.getDataIndex(index), "DESC");
+            case 'desc':
+                ds.sort(cm.getDataIndex(index), 'DESC');
                 break;
             default:
-                index = cm.getIndexById(item.itemId.substr(4));
+                index = cm.getIndexById(id.substr(4));
                 if(index != -1){
                     if(item.checked && cm.getColumnsBy(this.isHideableColumn, this).length <= 1){
                         this.onDenyColumnHide();
@@ -61965,7 +66612,7 @@ viewConfig: {
         for(var i = 0; i < colCount; i++){
             if(cm.config[i].fixed !== true && cm.config[i].hideable !== false){
                 this.colMenu.add(new Ext.menu.CheckItem({
-                    itemId: "col-"+cm.getColumnId(i),
+                    itemId: 'col-'+cm.getColumnId(i),
                     text: cm.getColumnHeader(i),
                     checked: !cm.isHidden(i),
                     hideOnClick:false,
@@ -61984,12 +66631,12 @@ viewConfig: {
             var index = this.getCellIndex(hd);
             this.hdCtxIndex = index;
             var ms = this.hmenu.items, cm = this.cm;
-            ms.get("asc").setDisabled(!cm.isSortable(index));
-            ms.get("desc").setDisabled(!cm.isSortable(index));
-            this.hmenu.on("hide", function(){
+            ms.get('asc').setDisabled(!cm.isSortable(index));
+            ms.get('desc').setDisabled(!cm.isSortable(index));
+            this.hmenu.on('hide', function(){
                 Ext.fly(hd).removeClass('x-grid3-hd-menu-open');
             }, this, {single:true});
-            this.hmenu.show(t, "tl-bl?");
+            this.hmenu.show(t, 'tl-bl?');
         }
     },
 
@@ -61997,12 +66644,12 @@ viewConfig: {
     handleHdOver : function(e, t){
         var hd = this.findHeaderCell(t);
         if(hd && !this.headersDisabled){
-            this.activeHd = hd;
+            this.activeHdRef = t;
             this.activeHdIndex = this.getCellIndex(hd);
             var fly = this.fly(hd);
             this.activeHdRegion = fly.getRegion();
             if(!this.cm.isMenuDisabled(this.activeHdIndex)){
-                fly.addClass("x-grid3-hd-over");
+                fly.addClass('x-grid3-hd-over');
                 this.activeHdBtn = fly.child('.x-grid3-hd-btn');
                 if(this.activeHdBtn){
                     this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px';
@@ -62013,18 +66660,21 @@ viewConfig: {
 
     // private
     handleHdMove : function(e, t){
-        if(this.activeHd && !this.headersDisabled){
-            var hw = this.splitHandleWidth || 5;
-            var r = this.activeHdRegion;
-            var x = e.getPageX();
-            var ss = this.activeHd.style;
-            if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){
-                ss.cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize not always supported
-            }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){
-                ss.cursor = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize';
-            }else{
-                ss.cursor = '';
+        var hd = this.findHeaderCell(this.activeHdRef);
+        if(hd && !this.headersDisabled){
+            var hw = this.splitHandleWidth || 5,
+                r = this.activeHdRegion,
+                x = e.getPageX(),
+                ss = hd.style,
+                cur = '';
+            if(this.grid.enableColumnResize !== false){
+                if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex-1)){
+                    cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize not always supported
+                }else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){
+                    cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize';
+                }
             }
+            ss.cursor = cur;
         }
     },
 
@@ -62032,8 +66682,8 @@ viewConfig: {
     handleHdOut : function(e, t){
         var hd = this.findHeaderCell(t);
         if(hd && (!Ext.isIE || !e.within(hd, true))){
-            this.activeHd = null;
-            this.fly(hd).removeClass("x-grid3-hd-over");
+            this.activeHdRef = null;
+            this.fly(hd).removeClass('x-grid3-hd-over');
             hd.style.cursor = '';
         }
     },
@@ -62059,7 +66709,7 @@ Ext.grid.GridView.SplitDragZone = function(grid, hd){
     this.marker = this.view.resizeMarker;
     this.proxy = this.view.resizeProxy;
     Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd,
-        "gridSplitters" + this.grid.getGridEl().id, {
+        'gridSplitters' + this.grid.getGridEl().id, {
         dragElId : Ext.id(this.proxy.dom), resizeFrame:false
     });
     this.scroll = false;
@@ -62084,11 +66734,15 @@ Ext.extend(Ext.grid.GridView.SplitDragZone, Ext.dd.DDProxy, {
         this.startPos = x;
         Ext.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
     },
+    
+    allowHeaderDrag : function(e){
+        return true;
+    },
 
 
     handleMouseDown : function(e){
         var t = this.view.findHeaderCell(e.getTarget());
-        if(t){
+        if(t && this.allowHeaderDrag(e)){
             var xy = this.view.fly(t).getXY(), x = xy[0], y = xy[1];
             var exy = e.getXY(), ex = exy[0];
             var w = t.offsetWidth, adjust = false;
@@ -62139,19 +66793,21 @@ Ext.extend(Ext.grid.GridView.SplitDragZone, Ext.dd.DDProxy, {
 });
 // private\r
 // This is a support class used internally by the Grid components\r
-Ext.grid.HeaderDragZone = function(grid, hd, hd2){\r
-    this.grid = grid;\r
-    this.view = grid.getView();\r
-    this.ddGroup = "gridHeader" + this.grid.getGridEl().id;\r
-    Ext.grid.HeaderDragZone.superclass.constructor.call(this, hd);\r
-    if(hd2){\r
-        this.setHandleElId(Ext.id(hd));\r
-        this.setOuterHandleElId(Ext.id(hd2));\r
-    }\r
-    this.scroll = false;\r
-};\r
-Ext.extend(Ext.grid.HeaderDragZone, Ext.dd.DragZone, {\r
+Ext.grid.HeaderDragZone = Ext.extend(Ext.dd.DragZone, {\r
     maxDragWidth: 120,\r
+    \r
+    constructor : function(grid, hd, hd2){\r
+        this.grid = grid;\r
+        this.view = grid.getView();\r
+        this.ddGroup = "gridHeader" + this.grid.getGridEl().id;\r
+        Ext.grid.HeaderDragZone.superclass.constructor.call(this, hd);\r
+        if(hd2){\r
+            this.setHandleElId(Ext.id(hd));\r
+            this.setOuterHandleElId(Ext.id(hd2));\r
+        }\r
+        this.scroll = false;\r
+    },\r
+    \r
     getDragData : function(e){\r
         var t = Ext.lib.Event.getTarget(e);\r
         var h = this.view.findHeaderCell(t);\r
@@ -62187,28 +66843,29 @@ Ext.extend(Ext.grid.HeaderDragZone, Ext.dd.DragZone, {
 \r
 // private\r
 // This is a support class used internally by the Grid components\r
-Ext.grid.HeaderDropZone = function(grid, hd, hd2){\r
-    this.grid = grid;\r
-    this.view = grid.getView();\r
-    // split the proxies so they don't interfere with mouse events\r
-    this.proxyTop = Ext.DomHelper.append(document.body, {\r
-        cls:"col-move-top", html:"&#160;"\r
-    }, true);\r
-    this.proxyBottom = Ext.DomHelper.append(document.body, {\r
-        cls:"col-move-bottom", html:"&#160;"\r
-    }, true);\r
-    this.proxyTop.hide = this.proxyBottom.hide = function(){\r
-        this.setLeftTop(-100,-100);\r
-        this.setStyle("visibility", "hidden");\r
-    };\r
-    this.ddGroup = "gridHeader" + this.grid.getGridEl().id;\r
-    // temporarily disabled\r
-    //Ext.dd.ScrollManager.register(this.view.scroller.dom);\r
-    Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom);\r
-};\r
-Ext.extend(Ext.grid.HeaderDropZone, Ext.dd.DropZone, {\r
+Ext.grid.HeaderDropZone = Ext.extend(Ext.dd.DropZone, {\r
     proxyOffsets : [-4, -9],\r
     fly: Ext.Element.fly,\r
+    \r
+    constructor : function(grid, hd, hd2){\r
+        this.grid = grid;\r
+        this.view = grid.getView();\r
+        // split the proxies so they don't interfere with mouse events\r
+        this.proxyTop = Ext.DomHelper.append(document.body, {\r
+            cls:"col-move-top", html:"&#160;"\r
+        }, true);\r
+        this.proxyBottom = Ext.DomHelper.append(document.body, {\r
+            cls:"col-move-bottom", html:"&#160;"\r
+        }, true);\r
+        this.proxyTop.hide = this.proxyBottom.hide = function(){\r
+            this.setLeftTop(-100,-100);\r
+            this.setStyle("visibility", "hidden");\r
+        };\r
+        this.ddGroup = "gridHeader" + this.grid.getGridEl().id;\r
+        // temporarily disabled\r
+        //Ext.dd.ScrollManager.register(this.view.scroller.dom);\r
+        Ext.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom);\r
+    },\r
 \r
     getTargetFromEvent : function(e){\r
         var t = Ext.lib.Event.getTarget(e);\r
@@ -62308,22 +66965,20 @@ Ext.extend(Ext.grid.HeaderDropZone, Ext.dd.DropZone, {
                 newIndex--;\r
             }\r
             cm.moveColumn(oldIndex, newIndex);\r
-            this.grid.fireEvent("columnmove", oldIndex, newIndex);\r
             return true;\r
         }\r
         return false;\r
     }\r
 });\r
 \r
-\r
-Ext.grid.GridView.ColumnDragZone = function(grid, hd){\r
-    Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null);\r
-    this.proxy.el.addClass('x-grid3-col-dd');\r
-};\r
-\r
-Ext.extend(Ext.grid.GridView.ColumnDragZone, Ext.grid.HeaderDragZone, {\r
+Ext.grid.GridView.ColumnDragZone = Ext.extend(Ext.grid.HeaderDragZone, {\r
+    \r
+    constructor : function(grid, hd){\r
+        Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null);\r
+        this.proxy.el.addClass('x-grid3-col-dd');\r
+    },\r
+    \r
     handleMouseDown : function(e){\r
-\r
     },\r
 \r
     callHandleMouseDown : function(e){\r
@@ -62331,20 +66986,21 @@ Ext.extend(Ext.grid.GridView.ColumnDragZone, Ext.grid.HeaderDragZone, {
     }\r
 });// private
 // This is a support class used internally by the Grid components
-Ext.grid.SplitDragZone = function(grid, hd, hd2){
-    this.grid = grid;
-    this.view = grid.getView();
-    this.proxy = this.view.resizeProxy;
-    Ext.grid.SplitDragZone.superclass.constructor.call(this, hd,
-        "gridSplitters" + this.grid.getGridEl().id, {
-        dragElId : Ext.id(this.proxy.dom), resizeFrame:false
-    });
-    this.setHandleElId(Ext.id(hd));
-    this.setOuterHandleElId(Ext.id(hd2));
-    this.scroll = false;
-};
-Ext.extend(Ext.grid.SplitDragZone, Ext.dd.DDProxy, {
+Ext.grid.SplitDragZone = Ext.extend(Ext.dd.DDProxy, {
     fly: Ext.Element.fly,
+    
+    constructor : function(grid, hd, hd2){
+        this.grid = grid;
+        this.view = grid.getView();
+        this.proxy = this.view.resizeProxy;
+        Ext.grid.SplitDragZone.superclass.constructor.call(this, hd,
+            "gridSplitters" + this.grid.getGridEl().id, {
+            dragElId : Ext.id(this.proxy.dom), resizeFrame:false
+        });
+        this.setHandleElId(Ext.id(hd));
+        this.setOuterHandleElId(Ext.id(hd2));
+        this.scroll = false;
+    },
 
     b4StartDrag : function(x, y){
         this.view.headersDisabled = true;
@@ -62504,7 +67160,7 @@ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
  * {@link Ext.grid.Column} column configuration object within the specified Array defines the initial
  * order of the column display.  A Column's display may be initially hidden using the
  * <tt>{@link Ext.grid.Column#hidden hidden}</tt></b> config property (and then shown using the column
- * header menu).  Field's that are not included in the ColumnModel will not be displayable at all.</p>
+ * header menu).  Fields that are not included in the ColumnModel will not be displayable at all.</p>
  * <p>How each column in the grid correlates (maps) to the {@link Ext.data.Record} field in the
  * {@link Ext.data.Store Store} the column draws its data from is configured through the
  * <b><tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt></b>.  If the
@@ -62557,66 +67213,7 @@ Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
  * @param {Mixed} config Specify either an Array of {@link Ext.grid.Column} configuration objects or specify
  * a configuration Object (see introductory section discussion utilizing Initialization Method 2 above).
  */
-Ext.grid.ColumnModel = function(config){
-    /**
-     * An Array of {@link Ext.grid.Column Column definition} objects representing the configuration
-     * of this ColumnModel.  See {@link Ext.grid.Column} for the configuration properties that may
-     * be specified.
-     * @property config
-     * @type Array
-     */
-    if(config.columns){
-        Ext.apply(this, config);
-        this.setConfig(config.columns, true);
-    }else{
-        this.setConfig(config, true);
-    }
-    this.addEvents(
-        /**
-         * @event widthchange
-         * Fires when the width of a column is programmaticially changed using
-         * <code>{@link #setColumnWidth}</code>.
-         * Note internal resizing suppresses the event from firing. See also
-         * {@link Ext.grid.GridPanel}.<code>{@link #columnresize}</code>.
-         * @param {ColumnModel} this
-         * @param {Number} columnIndex The column index
-         * @param {Number} newWidth The new width
-         */
-        "widthchange",
-        /**
-         * @event headerchange
-         * Fires when the text of a header changes.
-         * @param {ColumnModel} this
-         * @param {Number} columnIndex The column index
-         * @param {String} newText The new header text
-         */
-        "headerchange",
-        /**
-         * @event hiddenchange
-         * Fires when a column is hidden or "unhidden".
-         * @param {ColumnModel} this
-         * @param {Number} columnIndex The column index
-         * @param {Boolean} hidden true if hidden, false otherwise
-         */
-        "hiddenchange",
-        /**
-         * @event columnmoved
-         * Fires when a column is moved.
-         * @param {ColumnModel} this
-         * @param {Number} oldIndex
-         * @param {Number} newIndex
-         */
-        "columnmoved",
-        /**
-         * @event configchange
-         * Fires when the configuration is changed
-         * @param {ColumnModel} this
-         */
-        "configchange"
-    );
-    Ext.grid.ColumnModel.superclass.constructor.call(this);
-};
-Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, {
+Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, {
     /**
      * @cfg {Number} defaultWidth (optional) The width of columns which have no <tt>{@link #width}</tt>
      * specified (defaults to <tt>100</tt>).  This property shall preferably be configured through the
@@ -62639,6 +67236,66 @@ Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, {
      * configuration options to all <tt><b>{@link #columns}</b></tt>.  Configuration options specified with
      * individual {@link Ext.grid.Column column} configs will supersede these <tt><b>{@link #defaults}</b></tt>.
      */
+    
+    constructor : function(config){
+        /**
+            * An Array of {@link Ext.grid.Column Column definition} objects representing the configuration
+            * of this ColumnModel.  See {@link Ext.grid.Column} for the configuration properties that may
+            * be specified.
+            * @property config
+            * @type Array
+            */
+           if(config.columns){
+               Ext.apply(this, config);
+               this.setConfig(config.columns, true);
+           }else{
+               this.setConfig(config, true);
+           }
+           this.addEvents(
+               /**
+                * @event widthchange
+                * Fires when the width of a column is programmaticially changed using
+                * <code>{@link #setColumnWidth}</code>.
+                * Note internal resizing suppresses the event from firing. See also
+                * {@link Ext.grid.GridPanel}.<code>{@link #columnresize}</code>.
+                * @param {ColumnModel} this
+                * @param {Number} columnIndex The column index
+                * @param {Number} newWidth The new width
+                */
+               "widthchange",
+               /**
+                * @event headerchange
+                * Fires when the text of a header changes.
+                * @param {ColumnModel} this
+                * @param {Number} columnIndex The column index
+                * @param {String} newText The new header text
+                */
+               "headerchange",
+               /**
+                * @event hiddenchange
+                * Fires when a column is hidden or "unhidden".
+                * @param {ColumnModel} this
+                * @param {Number} columnIndex The column index
+                * @param {Boolean} hidden true if hidden, false otherwise
+                */
+               "hiddenchange",
+               /**
+                * @event columnmoved
+                * Fires when a column is moved.
+                * @param {ColumnModel} this
+                * @param {Number} oldIndex
+                * @param {Number} newIndex
+                */
+               "columnmoved",
+               /**
+                * @event configchange
+                * Fires when the configuration is changed
+                * @param {ColumnModel} this
+                */
+               "configchange"
+           );
+           Ext.grid.ColumnModel.superclass.constructor.call(this);
+    },
 
     /**
      * Returns the id of the column at the specified index.
@@ -62668,10 +67325,7 @@ Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, {
         if(!initial){ // cleanup
             delete this.totalWidth;
             for(i = 0, len = this.config.length; i < len; i++){
-                c = this.config[i];
-                if(c.editor){
-                    c.editor.destroy();
-                }
+                this.config[i].destroy();
             }
         }
 
@@ -62683,12 +67337,16 @@ Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, {
 
         this.config = config;
         this.lookup = {};
-        // if no id, create one
+
         for(i = 0, len = config.length; i < len; i++){
             c = Ext.applyIf(config[i], this.defaults);
+            // if no id, create one using column's ordinal position
+            if(Ext.isEmpty(c.id)){
+                c.id = i;
+            }
             if(!c.isColumn){
-                var cls = Ext.grid.Column.types[c.xtype || 'gridcolumn'];
-                c = new cls(c);
+                var Cls = Ext.grid.Column.types[c.xtype || 'gridcolumn'];
+                c = new Cls(c);
                 config[i] = c;
             }
             this.lookup[c.id] = c;
@@ -62761,8 +67419,10 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){
   return c.hidden;
 });
 </code></pre>
-     * @param {Function} fn
-     * @param {Object} scope (optional)
+     * @param {Function} fn A function which, when passed a {@link Ext.grid.Column Column} object, must
+     * return <code>true</code> if the column is to be included in the returned Array.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function
+     * is executed. Defaults to this ColumnModel.
      * @return {Array} result
      */
     getColumnsBy : function(fn, scope){
@@ -62782,7 +67442,7 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){
      * @return {Boolean}
      */
     isSortable : function(col){
-        return this.config[col].sortable;
+        return !!this.config[col].sortable;
     },
 
     /**
@@ -62805,6 +67465,10 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){
         }
         return this.config[col].renderer;
     },
+    
+    getRendererScope : function(col){
+        return this.config[col].scope;
+    },
 
     /**
      * Sets the rendering (formatting) function for a column.  See {@link Ext.util.Format} for some
@@ -62966,7 +67630,11 @@ var grid = new Ext.grid.GridPanel({
      * @return {Boolean}
      */
     isCellEditable : function(colIndex, rowIndex){
-        return (this.config[colIndex].editable || (typeof this.config[colIndex].editable == "undefined" && this.config[colIndex].editor)) ? true : false;
+        var c = this.config[colIndex],
+            ed = c.editable;
+            
+        //force boolean
+        return !!(ed || (!Ext.isDefined(ed) && c.editor));
     },
 
     /**
@@ -62989,22 +67657,24 @@ var grid = new Ext.grid.GridPanel({
         this.config[col].editable = editable;
     },
 
-
     /**
-     * Returns true if the column is hidden.
+     * Returns <tt>true</tt> if the column is <code>{@link Ext.grid.Column#hidden hidden}</code>,
+     * <tt>false</tt> otherwise.
      * @param {Number} colIndex The column index
      * @return {Boolean}
      */
     isHidden : function(colIndex){
-        return this.config[colIndex].hidden;
+        return !!this.config[colIndex].hidden; // ensure returns boolean
     },
 
-
     /**
-     * Returns true if the column width cannot be changed
+     * Returns <tt>true</tt> if the column is <code>{@link Ext.grid.Column#fixed fixed}</code>,
+     * <tt>false</tt> otherwise.
+     * @param {Number} colIndex The column index
+     * @return {Boolean}
      */
     isFixed : function(colIndex){
-        return this.config[colIndex].fixed;
+        return !!this.config[colIndex].fixed;
     },
 
     /**
@@ -63037,16 +67707,15 @@ myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first colu
      * @param {Object} editor The editor object
      */
     setEditor : function(col, editor){
-        Ext.destroy(this.config[col].editor);
-        this.config[col].editor = editor;
+        this.config[col].setEditor(editor);
     },
 
     /**
      * Destroys this column model by purging any event listeners, and removing any editors.
      */
     destroy : function(){
-        for(var i = 0, c = this.config, len = c.length; i < len; i++){
-            Ext.destroy(c[i].editor);
+        for(var i = 0, len = this.config.length; i < len; i++){
+            this.config[i].destroy();
         }
         this.purgeListeners();
     }
@@ -63065,17 +67734,17 @@ Ext.grid.ColumnModel.defaultRenderer = function(value){
  * implemented by descendant classes.  This class should not be directly instantiated.\r
  * @constructor\r
  */\r
-Ext.grid.AbstractSelectionModel = function(){\r
-    this.locked = false;\r
-    Ext.grid.AbstractSelectionModel.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable,  {\r
+Ext.grid.AbstractSelectionModel = Ext.extend(Ext.util.Observable,  {\r
     /**\r
      * The GridPanel for which this SelectionModel is handling selection. Read-only.\r
      * @type Object\r
      * @property grid\r
      */\r
+    \r
+    constructor : function(){\r
+        this.locked = false;\r
+        Ext.grid.AbstractSelectionModel.superclass.constructor.call(this);\r
+    },\r
 \r
     /** @ignore Called by the grid automatically. Do not call directly. */\r
     init : function(grid){\r
@@ -63118,60 +67787,59 @@ Ext.extend(Ext.grid.AbstractSelectionModel, Ext.util.Observable,  {
  * @constructor
  * @param {Object} config
  */
-Ext.grid.RowSelectionModel = function(config){
-    Ext.apply(this, config);
-    this.selections = new Ext.util.MixedCollection(false, function(o){
-        return o.id;
-    });
-
-    this.last = false;
-    this.lastActive = false;
-
-    this.addEvents(
-        /**
-         * @event selectionchange
-         * Fires when the selection changes
-         * @param {SelectionModel} this
-         */
-        "selectionchange",
-        /**
-         * @event beforerowselect
-         * Fires before a row is selected, return false to cancel the selection.
-         * @param {SelectionModel} this
-         * @param {Number} rowIndex The index to be selected
-         * @param {Boolean} keepExisting False if other selections will be cleared
-         * @param {Record} record The record to be selected
-         */
-        "beforerowselect",
-        /**
-         * @event rowselect
-         * Fires when a row is selected.
-         * @param {SelectionModel} this
-         * @param {Number} rowIndex The selected index
-         * @param {Ext.data.Record} r The selected record
-         */
-        "rowselect",
-        /**
-         * @event rowdeselect
-         * Fires when a row is deselected.  To prevent deselection
-         * {@link Ext.grid.AbstractSelectionModel#lock lock the selections}. 
-         * @param {SelectionModel} this
-         * @param {Number} rowIndex
-         * @param {Record} record
-         */
-        "rowdeselect"
-    );
-
-    Ext.grid.RowSelectionModel.superclass.constructor.call(this);
-};
-
-Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
+Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel,  {
     /**
      * @cfg {Boolean} singleSelect
      * <tt>true</tt> to allow selection of only one row at a time (defaults to <tt>false</tt>
      * allowing multiple selections)
      */
     singleSelect : false,
+    
+    constructor : function(config){
+        Ext.apply(this, config);
+        this.selections = new Ext.util.MixedCollection(false, function(o){
+            return o.id;
+        });
+
+        this.last = false;
+        this.lastActive = false;
+
+        this.addEvents(
+               /**
+                * @event selectionchange
+                * Fires when the selection changes
+                * @param {SelectionModel} this
+                */
+               'selectionchange',
+               /**
+                * @event beforerowselect
+                * Fires before a row is selected, return false to cancel the selection.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The index to be selected
+                * @param {Boolean} keepExisting False if other selections will be cleared
+                * @param {Record} record The record to be selected
+                */
+               'beforerowselect',
+               /**
+                * @event rowselect
+                * Fires when a row is selected.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The selected index
+                * @param {Ext.data.Record} r The selected record
+                */
+               'rowselect',
+               /**
+                * @event rowdeselect
+                * Fires when a row is deselected.  To prevent deselection
+                * {@link Ext.grid.AbstractSelectionModel#lock lock the selections}. 
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex
+                * @param {Record} record
+                */
+               'rowdeselect'
+        );
+        Ext.grid.RowSelectionModel.superclass.constructor.call(this);
+    },
 
     /**
      * @cfg {Boolean} moveEditorOnEnter
@@ -63182,18 +67850,11 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
     initEvents : function(){
 
         if(!this.grid.enableDragDrop && !this.grid.enableDrag){
-            this.grid.on("rowmousedown", this.handleMouseDown, this);
-        }else{ // allow click to work like normal
-            this.grid.on("rowclick", function(grid, rowIndex, e) {
-                if(e.button === 0 && !e.shiftKey && !e.ctrlKey) {
-                    this.selectRow(rowIndex, false);
-                    grid.view.focusRow(rowIndex);
-                }
-            }, this);
+            this.grid.on('rowmousedown', this.handleMouseDown, this);
         }
 
         this.rowNav = new Ext.KeyNav(this.grid.getGridEl(), {
-            "up" : function(e){
+            'up' : function(e){
                 if(!e.shiftKey || this.singleSelect){
                     this.selectPrevious(false);
                 }else if(this.last !== false && this.lastActive !== false){
@@ -63207,7 +67868,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
                     this.selectFirstRow();
                 }
             },
-            "down" : function(e){
+            'down' : function(e){
                 if(!e.shiftKey || this.singleSelect){
                     this.selectNext(false);
                 }else if(this.last !== false && this.lastActive !== false){
@@ -63224,10 +67885,12 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
             scope: this
         });
 
-        var view = this.grid.view;
-        view.on("refresh", this.onRefresh, this);
-        view.on("rowupdated", this.onRowUpdated, this);
-        view.on("rowremoved", this.onRemove, this);
+        this.grid.getView().on({
+            scope: this,
+            refresh: this.onRefresh,
+            rowupdated: this.onRowUpdated,
+            rowremoved: this.onRemove
+        });
     },
 
     // private
@@ -63242,7 +67905,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
             }
         }
         if(s.length != this.selections.getCount()){
-            this.fireEvent("selectionchange", this);
+            this.fireEvent('selectionchange', this);
         }
     },
 
@@ -63363,8 +68026,8 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
      * Calls the passed function with each selection. If the function returns
      * <tt>false</tt>, iteration is stopped and this function returns
      * <tt>false</tt>. Otherwise it returns <tt>true</tt>.
-     * @param {Function} fn
-     * @param {Object} scope (optional)
+     * @param {Function} fn The function to call upon each iteration. It is passed the selected {@link Ext.data.Record Record}.
+     * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to this RowSelectionModel.
      * @return {Boolean} true if all selections were iterated
      */
     each : function(fn, scope){
@@ -63429,7 +68092,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
      * @return {Boolean}
      */
     isSelected : function(index){
-        var r = typeof index == "number" ? this.grid.store.getAt(index) : index;
+        var r = Ext.isNumber(index) ? this.grid.store.getAt(index) : index;
         return (r && this.selections.key(r.id) ? true : false);
     },
 
@@ -63538,7 +68201,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
             return;
         }
         var r = this.grid.store.getAt(index);
-        if(r && this.fireEvent("beforerowselect", this, index, keepExisting, r) !== false){
+        if(r && this.fireEvent('beforerowselect', this, index, keepExisting, r) !== false){
             if(!keepExisting || this.singleSelect){
                 this.clearSelections();
             }
@@ -63547,8 +68210,8 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
             if(!preventViewNotify){
                 this.grid.getView().onRowSelect(index);
             }
-            this.fireEvent("rowselect", this, index, r);
-            this.fireEvent("selectionchange", this);
+            this.fireEvent('rowselect', this, index, r);
+            this.fireEvent('selectionchange', this);
         }
     },
 
@@ -63577,8 +68240,8 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
             if(!preventViewNotify){
                 this.grid.getView().onRowDeselect(index);
             }
-            this.fireEvent("rowdeselect", this, index, r);
-            this.fireEvent("selectionchange", this);
+            this.fireEvent('rowdeselect', this, index, r);
+            this.fireEvent('selectionchange', this);
         }
     },
 
@@ -63596,7 +68259,12 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
 
     // private
     onEditorKey : function(field, e){
-        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+        var k = e.getKey(), 
+            newCell, 
+            g = this.grid, 
+            last = g.lastEdit,
+            ed = g.activeEditor,
+            ae, last, r, c;
         var shift = e.shiftKey;
         if(k == e.TAB){
             e.stopEvent();
@@ -63607,24 +68275,34 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
                 newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
             }
         }else if(k == e.ENTER){
-            e.stopEvent();
-            ed.completeEdit();
             if(this.moveEditorOnEnter !== false){
                 if(shift){
-                    newCell = g.walkCells(ed.row - 1, ed.col, -1, this.acceptsNav, this);
+                    newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this);
                 }else{
-                    newCell = g.walkCells(ed.row + 1, ed.col, 1, this.acceptsNav, this);
+                    newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this);
                 }
             }
-        }else if(k == e.ESC){
-            ed.cancelEdit();
         }
         if(newCell){
-            g.startEditing(newCell[0], newCell[1]);
+            r = newCell[0];
+            c = newCell[1];
+
+            if(last.row != r){
+                this.selectRow(r); // *** highlight newly-selected cell and update selection
+            }
+
+            if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode
+                ae = g.activeEditor;
+                if(ae && ae.field.triggerBlur){
+                    // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
+                    ae.field.triggerBlur();
+                }
+            }
+            g.startEditing(r, c);
         }
     },
     
-    destroy: function(){
+    destroy : function(){
         if(this.rowNav){
             this.rowNav.disable();
             this.rowNav = null;
@@ -63638,28 +68316,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel,  {
  * <p>While subclasses are provided to render data in different ways, this class renders a passed\r
  * data field unchanged and is usually used for textual columns.</p>\r
  */\r
-Ext.grid.Column = function(config){\r
-    Ext.apply(this, config);\r
-\r
-    if(typeof this.renderer == 'string'){\r
-        this.renderer = Ext.util.Format[this.renderer];\r
-    } else if(Ext.isObject(this.renderer)){\r
-        this.scope = this.renderer.scope;\r
-        this.renderer = this.renderer.fn;\r
-    }\r
-    this.renderer = this.renderer.createDelegate(this.scope || config);\r
-\r
-    if(this.id === undefined){\r
-        this.id = ++Ext.grid.Column.AUTO_ID;\r
-    }\r
-    if(this.editor){\r
-        this.editor = Ext.create(this.editor, 'textfield');\r
-    }\r
-};\r
-\r
-Ext.grid.Column.AUTO_ID = 0;\r
-\r
-Ext.grid.Column.prototype = {\r
+Ext.grid.Column = Ext.extend(Object, {\r
     /**\r
      * @cfg {Boolean} editable Optional. Defaults to <tt>true</tt>, enabling the configured\r
      * <tt>{@link #editor}</tt>.  Set to <tt>false</tt> to initially disable editing on this column.\r
@@ -63743,8 +68400,8 @@ Ext.grid.Column.prototype = {
      */\r
     /**\r
      * @cfg {Boolean} sortable Optional. <tt>true</tt> if sorting is to be allowed on this column.\r
-     * Defaults to the value of the {@link #defaultSortable} property.\r
-     * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}.\r
+     * Defaults to the value of the <code>{@link Ext.grid.ColumnModel#defaultSortable}</code> property.\r
+     * Whether local/remote sorting is used is specified in <code>{@link Ext.data.Store#remoteSort}</code>.\r
      */\r
     /**\r
      * @cfg {Boolean} fixed Optional. <tt>true</tt> if the column width cannot be changed.  Defaults to <tt>false</tt>.\r
@@ -63756,7 +68413,10 @@ Ext.grid.Column.prototype = {
      * @cfg {Boolean} menuDisabled Optional. <tt>true</tt> to disable the column menu. Defaults to <tt>false</tt>.\r
      */\r
     /**\r
-     * @cfg {Boolean} hidden Optional. <tt>true</tt> to hide the column. Defaults to <tt>false</tt>.\r
+     * @cfg {Boolean} hidden\r
+     * Optional. <tt>true</tt> to initially hide this column. Defaults to <tt>false</tt>.\r
+     * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}.\r
+     * If a column is never to be shown, simply do not include this column in the Column Model at all. \r
      */\r
     /**\r
      * @cfg {String} tooltip Optional. A text string to use as the column header's tooltip.  If Quicktips\r
@@ -63853,8 +68513,33 @@ var grid = new Ext.grid.GridPanel({
      * if editing is supported by the grid. See <tt>{@link #editable}</tt> also.\r
      */\r
 \r
-    // private. Used by ColumnModel to avoid reprocessing\r
+    /**\r
+     * @private\r
+     * @cfg {Boolean} isColumn\r
+     * Used by ColumnModel setConfig method to avoid reprocessing a Column\r
+     * if <code>isColumn</code> is not set ColumnModel will recreate a new Ext.grid.Column\r
+     * Defaults to true.\r
+     */\r
     isColumn : true,\r
+    \r
+    constructor : function(config){\r
+        Ext.apply(this, config);\r
+        \r
+        if(Ext.isString(this.renderer)){\r
+            this.renderer = Ext.util.Format[this.renderer];\r
+        }else if(Ext.isObject(this.renderer)){\r
+            this.scope = this.renderer.scope;\r
+            this.renderer = this.renderer.fn;\r
+        }\r
+        if(!this.scope){\r
+            this.scope = this;\r
+        }\r
+        \r
+        var ed = this.editor;\r
+        delete this.editor;\r
+        this.setEditor(ed);\r
+    },\r
+\r
     /**\r
      * Optional. A function which returns displayable data when passed the following parameters:\r
      * <div class="mdetail-params"><ul>\r
@@ -63874,7 +68559,7 @@ var grid = new Ext.grid.GridPanel({
      * @type Function\r
      */\r
     renderer : function(value){\r
-        if(typeof value == 'string' && value.length < 1){\r
+        if(Ext.isString(value) && value.length < 1){\r
             return '&#160;';\r
         }\r
         return value;\r
@@ -63884,6 +68569,32 @@ var grid = new Ext.grid.GridPanel({
     getEditor: function(rowIndex){\r
         return this.editable !== false ? this.editor : null;\r
     },\r
+    \r
+    /**\r
+     * Sets a new editor for this column.\r
+     * @param {Ext.Editor/Ext.form.Field} editor The editor to set\r
+     */\r
+    setEditor : function(editor){\r
+        if(this.editor){\r
+            this.editor.destroy();\r
+        }\r
+        this.editor = null;\r
+        if(editor){\r
+            //not an instance, create it\r
+            if(!editor.isXType){\r
+                editor = Ext.create(editor, 'textfield');\r
+            }\r
+            //check if it's wrapped in an editor\r
+            if(!editor.startEdit){\r
+                editor = new Ext.grid.GridEditor(editor);\r
+            }\r
+            this.editor = editor;\r
+        }\r
+    },\r
+    \r
+    destroy : function(){\r
+        this.setEditor(null);\r
+    },\r
 \r
     /**\r
      * Returns the {@link Ext.Editor editor} defined for this column that was created to wrap the {@link Ext.form.Field Field}\r
@@ -63892,26 +68603,15 @@ var grid = new Ext.grid.GridPanel({
      * @return {Ext.Editor}\r
      */\r
     getCellEditor: function(rowIndex){\r
-        var editor = this.getEditor(rowIndex);\r
-        if(editor){\r
-            if(!editor.startEdit){\r
-                if(!editor.gridEditor){\r
-                    editor.gridEditor = new Ext.grid.GridEditor(editor);\r
-                }\r
-                return editor.gridEditor;\r
-            }else if(editor.startEdit){\r
-                return editor;\r
-            }\r
-        }\r
-        return null;\r
+        return this.getEditor(rowIndex);\r
     }\r
-};\r
+});\r
 \r
 /**\r
  * @class Ext.grid.BooleanColumn\r
  * @extends Ext.grid.Column\r
- * <p>A Column definition class which renders boolean data fields.  See the {@link Ext.grid.ColumnModel#xtype xtype}\r
- * config option of {@link Ext.grid.ColumnModel} for more details.</p>\r
+ * <p>A Column definition class which renders boolean data fields.  See the {@link Ext.grid.Column#xtype xtype}\r
+ * config option of {@link Ext.grid.Column} for more details.</p>\r
  */\r
 Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {\r
     /**\r
@@ -63950,7 +68650,7 @@ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
  * @class Ext.grid.NumberColumn\r
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a numeric data field according to a {@link #format} string.  See the\r
- * {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more details.</p>\r
+ * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details.</p>\r
  */\r
 Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {\r
     /**\r
@@ -63969,7 +68669,7 @@ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {
  * @class Ext.grid.DateColumn\r
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a passed date according to the default locale, or a configured\r
- * {@link #format}. See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel}\r
+ * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column}\r
  * for more details.</p>\r
  */\r
 Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {\r
@@ -63990,7 +68690,7 @@ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s\r
  * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}.\r
- * See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more\r
+ * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more\r
  * details.</p>\r
  */\r
 Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {\r
@@ -64001,7 +68701,7 @@ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {
      */\r
     constructor: function(cfg){\r
         Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg);\r
-        var tpl = typeof Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl);\r
+        var tpl = (!Ext.isPrimitive(this.tpl) && this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl);\r
         this.renderer = function(value, p, r){\r
             return tpl.apply(r.data);\r
         };\r
@@ -64047,14 +68747,7 @@ Ext.grid.Column.types = {
  * @constructor
  * @param {Object} config The configuration options
  */
-Ext.grid.RowNumberer = function(config){
-    Ext.apply(this, config);
-    if(this.rowspan){
-        this.renderer = this.renderer.createDelegate(this);
-    }
-};
-
-Ext.grid.RowNumberer.prototype = {
+Ext.grid.RowNumberer = Ext.extend(Object, {
     /**
      * @cfg {String} header Any valid text or HTML fragment to display in the header cell for the row
      * number column (defaults to '').
@@ -64069,6 +68762,13 @@ Ext.grid.RowNumberer.prototype = {
      * @hide
      */
     sortable: false,
+    
+    constructor : function(config){
+        Ext.apply(this, config);
+        if(this.rowspan){
+            this.renderer = this.renderer.createDelegate(this);
+        }
+    },
 
     // private
     fixed:true,
@@ -64084,7 +68784,7 @@ Ext.grid.RowNumberer.prototype = {
         }
         return rowIndex+1;
     }
-};/**\r
+});/**\r
  * @class Ext.grid.CheckboxSelectionModel\r
  * @extends Ext.grid.RowSelectionModel\r
  * A custom selection model that renders a column of checkboxes that can be toggled to select or deselect rows.\r
@@ -64108,24 +68808,24 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
      * <tt>'Select Rows'</tt>), but the automatic check all/none behavior will only work if the\r
      * <tt>'x-grid3-hd-checker'</tt> class is supplied.\r
      */\r
-    header: '<div class="x-grid3-hd-checker">&#160;</div>',\r
+    header : '<div class="x-grid3-hd-checker">&#160;</div>',\r
     /**\r
      * @cfg {Number} width The default width in pixels of the checkbox column (defaults to <tt>20</tt>).\r
      */\r
-    width: 20,\r
+    width : 20,\r
     /**\r
      * @cfg {Boolean} sortable <tt>true</tt> if the checkbox column is sortable (defaults to\r
      * <tt>false</tt>).\r
      */\r
-    sortable: false,\r
+    sortable : false,\r
 \r
     // private\r
-    menuDisabled:true,\r
-    fixed:true,\r
-    dataIndex: '',\r
-    id: 'checker',\r
+    menuDisabled : true,\r
+    fixed : true,\r
+    dataIndex : '',\r
+    id : 'checker',\r
 \r
-    constructor: function(){\r
+    constructor : function(){\r
         Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this, arguments);\r
 \r
         if(this.checkOnly){\r
@@ -64193,58 +68893,60 @@ Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
  * @constructor
  * @param {Object} config The object containing the configuration of this model.
  */
-Ext.grid.CellSelectionModel = function(config){
-    Ext.apply(this, config);
-
-    this.selection = null;
-
-    this.addEvents(
-        /**
-            * @event beforecellselect
-            * Fires before a cell is selected, return false to cancel the selection.
-            * @param {SelectionModel} this
-            * @param {Number} rowIndex The selected row index
-            * @param {Number} colIndex The selected cell index
-            */
-           "beforecellselect",
-        /**
-            * @event cellselect
-            * Fires when a cell is selected.
-            * @param {SelectionModel} this
-            * @param {Number} rowIndex The selected row index
-            * @param {Number} colIndex The selected cell index
-            */
-           "cellselect",
-        /**
-            * @event selectionchange
-            * Fires when the active selection changes.
-            * @param {SelectionModel} this
-            * @param {Object} selection null for no selection or an object with two properties
-         * <div class="mdetail-params"><ul>
-         * <li><b>cell</b> : see {@link #getSelectedCell} 
-         * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
-         * which provides the data for the row containing the selection</p></li>
-         * </ul></div>
-            */
-           "selectionchange"
-    );
-
-    Ext.grid.CellSelectionModel.superclass.constructor.call(this);
-};
+Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel,  {
+    
+    constructor : function(config){
+        Ext.apply(this, config);
 
-Ext.extend(Ext.grid.CellSelectionModel, Ext.grid.AbstractSelectionModel,  {
+           this.selection = null;
+       
+           this.addEvents(
+               /**
+                * @event beforecellselect
+                * Fires before a cell is selected, return false to cancel the selection.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The selected row index
+                * @param {Number} colIndex The selected cell index
+                */
+               "beforecellselect",
+               /**
+                * @event cellselect
+                * Fires when a cell is selected.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The selected row index
+                * @param {Number} colIndex The selected cell index
+                */
+               "cellselect",
+               /**
+                * @event selectionchange
+                * Fires when the active selection changes.
+                * @param {SelectionModel} this
+                * @param {Object} selection null for no selection or an object with two properties
+                * <div class="mdetail-params"><ul>
+                * <li><b>cell</b> : see {@link #getSelectedCell} 
+                * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
+                * which provides the data for the row containing the selection</p></li>
+                * </ul></div>
+                */
+               "selectionchange"
+           );
+       
+           Ext.grid.CellSelectionModel.superclass.constructor.call(this);
+    },
 
     /** @ignore */
     initEvents : function(){
-        this.grid.on("cellmousedown", this.handleMouseDown, this);
-        this.grid.getGridEl().on(Ext.EventManager.useKeydown ? "keydown" : "keypress", this.handleKeyDown, this);
-        var view = this.grid.view;
-        view.on("refresh", this.onViewChange, this);
-        view.on("rowupdated", this.onRowUpdated, this);
-        view.on("beforerowremoved", this.clearSelections, this);
-        view.on("beforerowsinserted", this.clearSelections, this);
+        this.grid.on('cellmousedown', this.handleMouseDown, this);
+        this.grid.on(Ext.EventManager.useKeydown ? 'keydown' : 'keypress', this.handleKeyDown, this);
+        this.grid.getView().on({
+            scope: this,
+            refresh: this.onViewChange,
+            rowupdated: this.onRowUpdated,
+            beforerowremoved: this.clearSelections,
+            beforerowsinserted: this.clearSelections
+        });
         if(this.grid.isEditor){
-            this.grid.on("beforeedit", this.beforeEdit,  this);
+            this.grid.on('beforeedit', this.beforeEdit,  this);
         }
     },
 
@@ -64355,85 +69057,107 @@ var data = record.get(fieldName);
     isSelectable : function(rowIndex, colIndex, cm){
         return !cm.isHidden(colIndex);
     },
+    
+    // private
+    onEditorKey: function(field, e){
+        if(e.getKey() == e.TAB){
+            this.handleKeyDown(e);
+        }
+    },
 
     /** @ignore */
     handleKeyDown : function(e){
         if(!e.isNavKeyPress()){
             return;
         }
-        var g = this.grid, s = this.selection;
+        
+        var k = e.getKey(),
+            g = this.grid,
+            s = this.selection,
+            sm = this,
+            walk = function(row, col, step){
+                return g.walkCells(
+                    row,
+                    col,
+                    step,
+                    g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, // *** handle tabbing while editorgrid is in edit mode
+                    sm
+                );
+            },
+            cell, newCell, r, c, ae;
+
+        switch(k){
+            case e.ESC:
+            case e.PAGE_UP:
+            case e.PAGE_DOWN:
+                // do nothing
+                break;
+            default:
+                // *** call e.stopEvent() only for non ESC, PAGE UP/DOWN KEYS
+                e.stopEvent();
+                break;
+        }
+
         if(!s){
-            e.stopEvent();
-            var cell = g.walkCells(0, 0, 1, this.isSelectable,  this);
+            cell = walk(0, 0, 1); // *** use private walk() function defined above
             if(cell){
                 this.select(cell[0], cell[1]);
             }
             return;
         }
-        var sm = this;
-        var walk = function(row, col, step){
-            return g.walkCells(row, col, step, sm.isSelectable,  sm);
-        };
-        var k = e.getKey(), r = s.cell[0], c = s.cell[1];
-        var newCell;
 
+        cell = s.cell;  // currently selected cell
+        r = cell[0];    // current row
+        c = cell[1];    // current column
+        
         switch(k){
-             case e.TAB:
-                 if(e.shiftKey){
-                     newCell = walk(r, c-1, -1);
-                 }else{
-                     newCell = walk(r, c+1, 1);
-                 }
-             break;
-             case e.DOWN:
-                 newCell = walk(r+1, c, 1);
-             break;
-             case e.UP:
-                 newCell = walk(r-1, c, -1);
-             break;
-             case e.RIGHT:
-                 newCell = walk(r, c+1, 1);
-             break;
-             case e.LEFT:
-                 newCell = walk(r, c-1, -1);
-             break;
-             case e.ENTER:
-                 if(g.isEditor && !g.editing){
+            case e.TAB:
+                if(e.shiftKey){
+                    newCell = walk(r, c - 1, -1);
+                }else{
+                    newCell = walk(r, c + 1, 1);
+                }
+                break;
+            case e.DOWN:
+                newCell = walk(r + 1, c, 1);
+                break;
+            case e.UP:
+                newCell = walk(r - 1, c, -1);
+                break;
+            case e.RIGHT:
+                newCell = walk(r, c + 1, 1);
+                break;
+            case e.LEFT:
+                newCell = walk(r, c - 1, -1);
+                break;
+            case e.ENTER:
+                if (g.isEditor && !g.editing) {
                     g.startEditing(r, c);
-                    e.stopEvent();
                     return;
                 }
-             break;
+                break;
         }
+
         if(newCell){
-            this.select(newCell[0], newCell[1]);
-            e.stopEvent();
+            // *** reassign r & c variables to newly-selected cell's row and column
+            r = newCell[0];
+            c = newCell[1];
+
+            this.select(r, c); // *** highlight newly-selected cell and update selection
+
+            if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode
+                ae = g.activeEditor;
+                if(ae && ae.field.triggerBlur){
+                    // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
+                    ae.field.triggerBlur();
+                }
+                g.startEditing(r, c);
+            }
         }
     },
 
     acceptsNav : function(row, col, cm){
         return !cm.isHidden(col) && cm.isCellEditable(col, row);
-    },
-
-    onEditorKey : function(field, e){
-        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
-        if(k == e.TAB){
-            if(e.shiftKey){
-                newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
-            }else{
-                newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
-            }
-            e.stopEvent();
-        }else if(k == e.ENTER){
-            ed.completeEdit();
-            e.stopEvent();
-        }else if(k == e.ESC){
-               e.stopEvent();
-            ed.cancelEdit();
-        }
-        if(newCell){
-            g.startEditing(newCell[0], newCell[1]);
-        }
     }
 });/**
  * @class Ext.grid.EditorGridPanel
@@ -64466,7 +69190,7 @@ Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
      * editing that cell.</p>
      */
     clicksToEdit: 2,
-    
+
     /**
     * @cfg {Boolean} forceValidation
     * True to force validation even if the value is unmodified (defaults to false)
@@ -64478,15 +69202,15 @@ Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
     // private
     detectEdit: false,
 
-       /**
-        * @cfg {Boolean} autoEncode
-        * True to automatically HTML encode and decode values pre and post edit (defaults to false)
-        */
-       autoEncode : false,
+    /**
+     * @cfg {Boolean} autoEncode
+     * True to automatically HTML encode and decode values pre and post edit (defaults to false)
+     */
+    autoEncode : false,
 
-       /**
-        * @cfg {Boolean} trackMouseOver @hide
-        */
+    /**
+     * @cfg {Boolean} trackMouseOver @hide
+     */
     // private
     trackMouseOver: false, // causes very odd FF errors
 
@@ -64504,7 +69228,7 @@ Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
 
         this.activeEditor = null;
 
-           this.addEvents(
+        this.addEvents(
             /**
              * @event beforeedit
              * Fires before cell editing is triggered. The edit event object has the following properties <br />
@@ -64533,13 +69257,13 @@ Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
              * <li>column - The grid column index</li>
              * </ul>
              *
-             * <pre><code> 
+             * <pre><code>
 grid.on('afteredit', afterEdit, this );
 
 function afterEdit(e) {
     // execute an XHR to send/commit data to the server, in callback do (if successful):
     e.record.commit();
-}; 
+};
              * </code></pre>
              * @param {Object} e An edit event (see above for description)
              */
@@ -64562,10 +69286,10 @@ function afterEdit(e) {
              * records (not all).  By observing the grid's validateedit event, it can be cancelled if
              * the edit occurs on a targeted row (for example) and then setting the field's new value
              * in the Record directly:
-             * <pre><code> 
+             * <pre><code>
 grid.on('validateedit', function(e) {
   var myTargetRow = 6;
+
   if (e.row == myTargetRow) {
     e.cancel = true;
     e.record.data[e.field] = e.value;
@@ -64582,16 +69306,25 @@ grid.on('validateedit', function(e) {
     initEvents : function(){
         Ext.grid.EditorGridPanel.superclass.initEvents.call(this);
 
-        this.on("bodyscroll", this.stopEditing, this, [true]);
-        this.on("columnresize", this.stopEditing, this, [true]);
+        this.getGridEl().on('mousewheel', this.stopEditing.createDelegate(this, [true]), this);
+        this.on('columnresize', this.stopEditing, this, [true]);
 
         if(this.clicksToEdit == 1){
             this.on("cellclick", this.onCellDblClick, this);
         }else {
-            if(this.clicksToEdit == 'auto' && this.view.mainBody){
-                this.view.mainBody.on("mousedown", this.onAutoEditClick, this);
+            var view = this.getView();
+            if(this.clicksToEdit == 'auto' && view.mainBody){
+                view.mainBody.on('mousedown', this.onAutoEditClick, this);
             }
-            this.on("celldblclick", this.onCellDblClick, this);
+            this.on('celldblclick', this.onCellDblClick, this);
+        }
+    },
+
+    onResize : function(){
+        Ext.grid.EditorGridPanel.superclass.onResize.apply(this, arguments);
+        var ae = this.activeEditor;
+        if(this.editing && ae){
+            ae.realign(true);
         }
     },
 
@@ -64605,8 +69338,8 @@ grid.on('validateedit', function(e) {
         if(e.button !== 0){
             return;
         }
-        var row = this.view.findRowIndex(t);
-        var col = this.view.findCellIndex(t);
+        var row = this.view.findRowIndex(t),
+            col = this.view.findCellIndex(t);
         if(row !== false && col !== false){
             this.stopEditing();
             if(this.selModel.getSelectedCell){ // cell sm
@@ -64626,9 +69359,9 @@ grid.on('validateedit', function(e) {
     onEditComplete : function(ed, value, startValue){
         this.editing = false;
         this.activeEditor = null;
-        ed.un("specialkey", this.selModel.onEditorKey, this.selModel);
-               var r = ed.record;
-        var field = this.colModel.getDataIndex(ed.col);
+
+        var r = ed.record,
+            field = this.colModel.getDataIndex(ed.col);
         value = this.postEditValue(value, startValue, r, field);
         if(this.forceValidation === true || String(value) !== String(startValue)){
             var e = {
@@ -64659,17 +69392,17 @@ grid.on('validateedit', function(e) {
         this.stopEditing();
         if(this.colModel.isCellEditable(col, row)){
             this.view.ensureVisible(row, col, true);
-            var r = this.store.getAt(row);
-            var field = this.colModel.getDataIndex(col);
-            var e = {
-                grid: this,
-                record: r,
-                field: field,
-                value: r.data[field],
-                row: row,
-                column: col,
-                cancel:false
-            };
+            var r = this.store.getAt(row),
+                field = this.colModel.getDataIndex(col),
+                e = {
+                    grid: this,
+                    record: r,
+                    field: field,
+                    value: r.data[field],
+                    row: row,
+                    column: col,
+                    cancel:false
+                };
             if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
                 this.editing = true;
                 var ed = this.colModel.getCellEditor(col, row);
@@ -64677,22 +69410,43 @@ grid.on('validateedit', function(e) {
                     return;
                 }
                 if(!ed.rendered){
-                    ed.render(this.view.getEditorParent(ed));
+                    ed.parentEl = this.view.getEditorParent(ed);
+                    ed.on({
+                        scope: this,
+                        render: {
+                            fn: function(c){
+                                c.field.focus(false, true);
+                            },
+                            single: true,
+                            scope: this
+                        },
+                        specialkey: function(field, e){
+                            this.getSelectionModel().onEditorKey(field, e);
+                        },
+                        complete: this.onEditComplete,
+                        canceledit: this.stopEditing.createDelegate(this, [true])
+                    });
                 }
-                (function(){ // complex but required for focus issues in safari, ie and opera
-                    ed.row = row;
-                    ed.col = col;
-                    ed.record = r;
-                    ed.on("complete", this.onEditComplete, this, {single: true});
-                    ed.on("specialkey", this.selModel.onEditorKey, this.selModel);
-                    /**
-                     * The currently active editor or null
-                      * @type Ext.Editor
-                     */
-                    this.activeEditor = ed;
-                    var v = this.preEditValue(r, field);
-                    ed.startEdit(this.view.getCell(row, col).firstChild, v === undefined ? '' : v);
-                }).defer(50, this);
+                Ext.apply(ed, {
+                    row     : row,
+                    col     : col,
+                    record  : r
+                });
+                this.lastEdit = {
+                    row: row,
+                    col: col
+                };
+                this.activeEditor = ed;
+                // Set the selectSameEditor flag if we are reusing the same editor again and
+                // need to prevent the editor from firing onBlur on itself.
+                ed.selectSameEditor = (this.activeEditor == this.lastActiveEditor);
+                var v = this.preEditValue(r, field);
+                ed.startEdit(this.view.getCell(row, col).firstChild, Ext.isDefined(v) ? v : '');
+
+                // Clear the selectSameEditor flag
+                (function(){
+                    delete ed.selectSameEditor;
+                }).defer(50);
             }
         }
     },
@@ -64700,23 +69454,29 @@ grid.on('validateedit', function(e) {
     // private
     preEditValue : function(r, field){
         var value = r.data[field];
-        return this.autoEncode && typeof value == 'string' ? Ext.util.Format.htmlDecode(value) : value;
+        return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlDecode(value) : value;
     },
 
     // private
-       postEditValue : function(value, originalValue, r, field){
-               return this.autoEncode && typeof value == 'string' ? Ext.util.Format.htmlEncode(value) : value;
-       },
+    postEditValue : function(value, originalValue, r, field){
+        return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlEncode(value) : value;
+    },
 
     /**
      * Stops any active editing
      * @param {Boolean} cancel (optional) True to cancel any changes
      */
     stopEditing : function(cancel){
-        if(this.activeEditor){
-            this.activeEditor[cancel === true ? 'cancelEdit' : 'completeEdit']();
+        if(this.editing){
+            // Store the lastActiveEditor to check if it is changing
+            var ae = this.lastActiveEditor = this.activeEditor;
+            if(ae){
+                ae[cancel === true ? 'cancelEdit' : 'completeEdit']();
+                this.view.focusCell(ae.row, ae.col);
+            }
+            this.activeEditor = null;
         }
-        this.activeEditor = null;
+        this.editing = false;
     }
 });
 Ext.reg('editorgrid', Ext.grid.EditorGridPanel);// private
@@ -64767,18 +69527,20 @@ Ext.grid.PropertyRecord = Ext.data.Record.create([
  * @param {Ext.grid.Grid} grid The grid this store will be bound to
  * @param {Object} source The source data config object
  */
-Ext.grid.PropertyStore = function(grid, source){
-    this.grid = grid;
-    this.store = new Ext.data.Store({
-        recordType : Ext.grid.PropertyRecord
-    });
-    this.store.on('update', this.onUpdate,  this);
-    if(source){
-        this.setSource(source);
-    }
-    Ext.grid.PropertyStore.superclass.constructor.call(this);
-};
-Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
+Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, {
+    
+    constructor : function(grid, source){
+        this.grid = grid;
+        this.store = new Ext.data.Store({
+            recordType : Ext.grid.PropertyRecord
+        });
+        this.store.on('update', this.onUpdate,  this);
+        if(source){
+            this.setSource(source);
+        }
+        Ext.grid.PropertyStore.superclass.constructor.call(this);    
+    },
+    
     // protected - should only be called by the grid.  Use grid.setSource instead.
     setSource : function(o){
         this.source = o;
@@ -64814,16 +69576,36 @@ Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
 
     // private
     isEditableValue: function(val){
-        if(Ext.isDate(val)){
-            return true;
-        }
-        return !(Ext.isObject(val) || Ext.isFunction(val));
+        return Ext.isPrimitive(val) || Ext.isDate(val);
     },
 
     // private
-    setValue : function(prop, value){
-        this.source[prop] = value;
-        this.store.getById(prop).set('value', value);
+    setValue : function(prop, value, create){
+        var r = this.getRec(prop);
+        if(r){
+            r.set('value', value);
+            this.source[prop] = value;
+        }else if(create){
+            // only create if specified.
+            this.source[prop] = value;
+            r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop);
+            this.store.add(r);
+
+        }
+    },
+    
+    // private
+    remove : function(prop){
+        var r = this.getRec(prop);
+        if(r){
+            this.store.remove(r);
+            delete this.source[prop];
+        }
+    },
+    
+    // private
+    getRec : function(prop){
+        return this.store.getById(prop);
     },
 
     // protected - should only be called by the grid.  Use grid.getSource instead.
@@ -64840,41 +69622,45 @@ Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
  * @param {Ext.grid.Grid} grid The grid this store will be bound to
  * @param {Object} source The source data config object
  */
-Ext.grid.PropertyColumnModel = function(grid, store){
-    var g = Ext.grid,
-        f = Ext.form;
-        
-    this.grid = grid;
-    g.PropertyColumnModel.superclass.constructor.call(this, [
-        {header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true},
-        {header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true}
-    ]);
-    this.store = store;
-
-    var bfield = new f.Field({
-        autoCreate: {tag: 'select', children: [
-            {tag: 'option', value: 'true', html: 'true'},
-            {tag: 'option', value: 'false', html: 'false'}
-        ]},
-        getValue : function(){
-            return this.el.value == 'true';
-        }
-    });
-    this.editors = {
-        'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})),
-        'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})),
-        'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})),
-        'boolean' : new g.GridEditor(bfield)
-    };
-    this.renderCellDelegate = this.renderCell.createDelegate(this);
-    this.renderPropDelegate = this.renderProp.createDelegate(this);
-};
-
-Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
+Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, {
     // private - strings used for locale support
     nameText : 'Name',
     valueText : 'Value',
     dateFormat : 'm/j/Y',
+    trueText: 'true',
+    falseText: 'false',
+    
+    constructor : function(grid, store){
+        var g = Ext.grid,
+               f = Ext.form;
+               
+           this.grid = grid;
+           g.PropertyColumnModel.superclass.constructor.call(this, [
+               {header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true},
+               {header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true}
+           ]);
+           this.store = store;
+       
+           var bfield = new f.Field({
+               autoCreate: {tag: 'select', children: [
+                   {tag: 'option', value: 'true', html: this.trueText},
+                   {tag: 'option', value: 'false', html: this.falseText}
+               ]},
+               getValue : function(){
+                   return this.el.dom.value == 'true';
+               }
+           });
+           this.editors = {
+               'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})),
+               'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})),
+               'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})),
+               'boolean' : new g.GridEditor(bfield, {
+                   autoSize: 'both'
+               })
+           };
+           this.renderCellDelegate = this.renderCell.createDelegate(this);
+           this.renderPropDelegate = this.renderProp.createDelegate(this);
+    },
 
     // private
     renderDate : function(dateVal){
@@ -64883,7 +69669,7 @@ Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
 
     // private
     renderBool : function(bVal){
-        return bVal ? 'true' : 'false';
+        return this[bVal ? 'trueText' : 'falseText'];
     },
 
     // private
@@ -64903,7 +69689,11 @@ Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
     },
 
     // private
-    renderCell : function(val){
+    renderCell : function(val, meta, rec){
+        var renderer = this.grid.customRenderers[rec.get('name')];
+        if(renderer){
+            return renderer.apply(this, arguments);
+        }
         var rv = val;
         if(Ext.isDate(val)){
             rv = this.renderDate(val);
@@ -64942,7 +69732,7 @@ Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
     destroy : function(){
         Ext.grid.PropertyColumnModel.superclass.destroy.call(this);
         for(var ed in this.editors){
-            Ext.destroy(ed);
+            Ext.destroy(this.editors[ed]);
         }
     }
 });
@@ -64995,6 +69785,33 @@ var grid = new Ext.grid.PropertyGrid({
         'Start Time': '10:00 AM'
     }
 });
+</code></pre>
+    */
+    /**
+    * @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details).
+    */
+    /**
+    * @cfg {Object} customRenderers An object containing name/value pairs of custom renderer type definitions that allow
+    * the grid to support custom rendering of fields.  By default, the grid supports strongly-typed rendering
+    * of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and
+    * associated with the type of the value.  The name of the renderer type should correspond with the name of the property
+    * that it will render.  Example usage:
+    * <pre><code>
+var grid = new Ext.grid.PropertyGrid({
+    ...
+    customRenderers: {
+        Available: function(v){
+            if(v){
+                return '<span style="color: green;">Yes</span>';
+            }else{
+                return '<span style="color: red;">No</span>';
+            }
+        }
+    },
+    source: {
+        Available: true
+    }
+});
 </code></pre>
     */
 
@@ -65010,6 +69827,7 @@ var grid = new Ext.grid.PropertyGrid({
 
     // private
     initComponent : function(){
+        this.customRenderers = this.customRenderers || {};
         this.customEditors = this.customEditors || {};
         this.lastEditRow = null;
         var store = new Ext.grid.PropertyStore(this);
@@ -65094,7 +69912,42 @@ grid.setSource({
      */
     getSource : function(){
         return this.propStore.getSource();
+    },
+    
+    /**
+     * Sets the value of a property.
+     * @param {String} prop The name of the property to set
+     * @param {Mixed} value The value to test
+     * @param {Boolean} create (Optional) True to create the property if it doesn't already exist. Defaults to <tt>false</tt>.
+     */
+    setProperty : function(prop, value, create){
+        this.propStore.setValue(prop, value, create);    
+    },
+    
+    /**
+     * Removes a property from the grid.
+     * @param {String} prop The name of the property to remove
+     */
+    removeProperty : function(prop){
+        this.propStore.remove(prop);
     }
+
+    /**
+     * @cfg store
+     * @hide
+     */
+    /**
+     * @cfg colModel
+     * @hide
+     */
+    /**
+     * @cfg cm
+     * @hide
+     */
+    /**
+     * @cfg columns
+     * @hide
+     */
 });
 Ext.reg("propertygrid", Ext.grid.PropertyGrid);
 /**\r
@@ -65232,6 +70085,13 @@ var grid = new Ext.grid.GridPanel({
      * </code></pre>\r
      */\r
     groupTextTpl : '{text}',\r
+\r
+    /**\r
+     * @cfg {String} groupMode Indicates how to construct the group identifier. <tt>'value'</tt> constructs the id using\r
+     * raw value, <tt>'display'</tt> constructs the id using the rendered value. Defaults to <tt>'value'</tt>.\r
+     */\r
+    groupMode: 'value',\r
+\r
     /**\r
      * @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for\r
      * each column.\r
@@ -65257,6 +70117,10 @@ var grid = new Ext.grid.GridPanel({
             );\r
         }\r
         this.startGroup.compile();\r
+        if(!this.endGroup){\r
+            this.endGroup = '</div></div>';\r
+        }\r
+\r
         this.endGroup = '</div></div>';\r
     },\r
 \r
@@ -65272,11 +70136,11 @@ var grid = new Ext.grid.GridPanel({
 \r
     // private\r
     onAdd : function(){\r
-        if(this.enableGrouping && !this.ignoreAdd){\r
+        if(this.canGroup() && !this.ignoreAdd){\r
             var ss = this.getScrollState();\r
             this.refresh();\r
             this.restoreScroll(ss);\r
-        }else if(!this.enableGrouping){\r
+        }else if(!this.canGroup()){\r
             Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments);\r
         }\r
     },\r
@@ -65310,7 +70174,7 @@ var grid = new Ext.grid.GridPanel({
         }\r
         if((item = items.get('showGroups'))){\r
             item.setDisabled(disabled);\r
-                   item.setChecked(!!this.getGroupField(), true);\r
+            item.setChecked(this.enableGrouping, true);\r
         }\r
     },\r
 \r
@@ -65340,18 +70204,55 @@ var grid = new Ext.grid.GridPanel({
         }\r
     },\r
 \r
+    processEvent: function(name, e){\r
+        var hd = e.getTarget('.x-grid-group-hd', this.mainBody);\r
+        if(hd){\r
+            // group value is at the end of the string\r
+            var field = this.getGroupField(),\r
+                prefix = this.getPrefix(field),\r
+                groupValue = hd.id.substring(prefix.length);\r
+\r
+            // remove trailing '-hd'\r
+            groupValue = groupValue.substr(0, groupValue.length - 3);\r
+            if(groupValue){\r
+                this.grid.fireEvent('group' + name, this.grid, field, groupValue, e);\r
+            }\r
+        }\r
+\r
+    },\r
+\r
     // private\r
     onGroupByClick : function(){\r
+        this.enableGrouping = true;\r
         this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));\r
+        this.grid.fireEvent('groupchange', this, this.grid.store.getGroupState());\r
         this.beforeMenuShow(); // Make sure the checkboxes get properly set when changing groups\r
+        this.refresh();\r
     },\r
 \r
     // private\r
     onShowGroupsClick : function(mi, checked){\r
+    this.enableGrouping = checked;\r
         if(checked){\r
             this.onGroupByClick();\r
         }else{\r
             this.grid.store.clearGrouping();\r
+            this.grid.fireEvent('groupchange', this, null);\r
+        }\r
+    },\r
+\r
+    /**\r
+     * Toggle the group that contains the specific row.\r
+     * @param {Number} rowIndex The row inside the group\r
+     * @param {Boolean} expanded (optional)\r
+     */\r
+    toggleRowIndex : function(rowIndex, expanded){\r
+        if(!this.canGroup()){\r
+            return;\r
+        }\r
+        var row = this.getRow(rowIndex);\r
+        if(row){\r
+            this.toggleGroup(this.findGroup(row), expanded);\r
         }\r
     },\r
 \r
@@ -65361,14 +70262,13 @@ var grid = new Ext.grid.GridPanel({
      * @param {Boolean} expanded (optional)\r
      */\r
     toggleGroup : function(group, expanded){\r
-        this.grid.stopEditing(true);\r
-        group = Ext.getDom(group);\r
-        var gel = Ext.fly(group);\r
-        expanded = expanded !== undefined ?\r
-                expanded : gel.hasClass('x-grid-group-collapsed');\r
-\r
-        this.state[gel.dom.id] = expanded;\r
-        gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');\r
+        var gel = Ext.get(group);\r
+        expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');\r
+        if(this.state[gel.id] !== expanded){\r
+            this.grid.stopEditing(true);\r
+            this.state[gel.id] = expanded;\r
+            gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');\r
+        }\r
     },\r
 \r
     /**\r
@@ -65408,7 +70308,7 @@ var grid = new Ext.grid.GridPanel({
     // private\r
     getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){\r
         var g = groupRenderer ? groupRenderer(v, {}, r, rowIndex, colIndex, ds) : String(v);\r
-        if(g === ''){\r
+        if(g === '' || g === '&#160;'){\r
             g = this.cm.config[colIndex].emptyGroupText || this.emptyGroupText;\r
         }\r
         return g;\r
@@ -65418,9 +70318,12 @@ var grid = new Ext.grid.GridPanel({
     getGroupField : function(){\r
         return this.grid.store.getGroupState();\r
     },\r
-    \r
+\r
     // private\r
     afterRender : function(){\r
+        if(!this.ds || !this.cm){\r
+            return;\r
+        }\r
         Ext.grid.GroupingView.superclass.afterRender.call(this);\r
         if(this.grid.deferRowRender){\r
             this.updateGroupWidths();\r
@@ -65433,15 +70336,16 @@ var grid = new Ext.grid.GridPanel({
         var eg = !!groupField;\r
         // if they turned off grouping and the last grouped field is hidden\r
         if(this.hideGroupedColumn) {\r
-            var colIndex = this.cm.findColumnIndex(groupField);\r
-            if(!eg && this.lastGroupField !== undefined) {\r
+            var colIndex = this.cm.findColumnIndex(groupField),\r
+                hasLastGroupField = Ext.isDefined(this.lastGroupField);\r
+            if(!eg && hasLastGroupField){\r
                 this.mainBody.update('');\r
                 this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField), false);\r
                 delete this.lastGroupField;\r
-            }else if (eg && this.lastGroupField === undefined) {\r
+            }else if (eg && !hasLastGroupField){\r
                 this.lastGroupField = groupField;\r
                 this.cm.setHidden(colIndex, true);\r
-            }else if (eg && this.lastGroupField !== undefined && groupField !== this.lastGroupField) {\r
+            }else if (eg && hasLastGroupField && groupField !== this.lastGroupField) {\r
                 this.mainBody.update('');\r
                 var oldIndex = this.cm.findColumnIndex(this.lastGroupField);\r
                 this.cm.setHidden(oldIndex, false);\r
@@ -65458,37 +70362,33 @@ var grid = new Ext.grid.GridPanel({
         if(rs.length < 1){\r
             return '';\r
         }\r
-        var groupField = this.getGroupField(),\r
-            colIndex = this.cm.findColumnIndex(groupField),\r
-            g;\r
-\r
-        this.enableGrouping = !!groupField;\r
 \r
-        if(!this.enableGrouping || this.isUpdating){\r
+        if(!this.canGroup() || this.isUpdating){\r
             return Ext.grid.GroupingView.superclass.doRender.apply(\r
                     this, arguments);\r
         }\r
-        var gstyle = 'width:'+this.getTotalWidth()+';';\r
 \r
-        var gidPrefix = this.grid.getGridEl().id;\r
-        var cfg = this.cm.config[colIndex];\r
-        var groupRenderer = cfg.groupRenderer || cfg.renderer;\r
-        var prefix = this.showGroupName ?\r
-                     (cfg.groupName || cfg.header)+': ' : '';\r
+        var groupField = this.getGroupField(),\r
+            colIndex = this.cm.findColumnIndex(groupField),\r
+            g,\r
+            gstyle = 'width:' + this.getTotalWidth() + ';',\r
+            cfg = this.cm.config[colIndex],\r
+            groupRenderer = cfg.groupRenderer || cfg.renderer,\r
+            prefix = this.showGroupName ? (cfg.groupName || cfg.header)+': ' : '',\r
+            groups = [],\r
+            curGroup, i, len, gid;\r
 \r
-        var groups = [], curGroup, i, len, gid;\r
         for(i = 0, len = rs.length; i < len; i++){\r
             var rowIndex = startRow + i,\r
                 r = rs[i],\r
                 gvalue = r.data[groupField];\r
-                \r
+\r
                 g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds);\r
             if(!curGroup || curGroup.group != g){\r
-                gid = gidPrefix + '-gp-' + groupField + '-' + Ext.util.Format.htmlEncode(g);\r
-                       // if state is defined use it, however state is in terms of expanded\r
-                               // so negate it, otherwise use the default.\r
-                               var isCollapsed  = typeof this.state[gid] !== 'undefined' ? !this.state[gid] : this.startCollapsed;\r
-                               var gcls = isCollapsed ? 'x-grid-group-collapsed' : ''; \r
+                gid = this.constructId(gvalue, groupField, colIndex);\r
+                // if state is defined use it, however state is in terms of expanded\r
+                // so negate it, otherwise use the default.\r
+                this.state[gid] = !(Ext.isDefined(this.state[gid]) ? !this.state[gid] : this.startCollapsed);\r
                 curGroup = {\r
                     group: g,\r
                     gvalue: gvalue,\r
@@ -65496,7 +70396,7 @@ var grid = new Ext.grid.GridPanel({
                     groupId: gid,\r
                     startRow: rowIndex,\r
                     rs: [r],\r
-                    cls: gcls,\r
+                    cls: this.state[gid] ? '' : 'x-grid-group-collapsed',\r
                     style: gstyle\r
                 };\r
                 groups.push(curGroup);\r
@@ -65524,13 +70424,27 @@ var grid = new Ext.grid.GridPanel({
      * @return {String} The group id\r
      */\r
     getGroupId : function(value){\r
-        var gidPrefix = this.grid.getGridEl().id;\r
-        var groupField = this.getGroupField();\r
-        var colIndex = this.cm.findColumnIndex(groupField);\r
-        var cfg = this.cm.config[colIndex];\r
-        var groupRenderer = cfg.groupRenderer || cfg.renderer;\r
-        var gtext = this.getGroup(value, {data:{}}, groupRenderer, 0, colIndex, this.ds);\r
-        return gidPrefix + '-gp-' + groupField + '-' + Ext.util.Format.htmlEncode(value);\r
+        var field = this.getGroupField();\r
+        return this.constructId(value, field, this.cm.findColumnIndex(field));\r
+    },\r
+\r
+    // private\r
+    constructId : function(value, field, idx){\r
+        var cfg = this.cm.config[idx],\r
+            groupRenderer = cfg.groupRenderer || cfg.renderer,\r
+            val = (this.groupMode == 'value') ? value : this.getGroup(value, {data:{}}, groupRenderer, 0, idx, this.ds);\r
+\r
+        return this.getPrefix(field) + Ext.util.Format.htmlEncode(val);\r
+    },\r
+\r
+    // private\r
+    canGroup  : function(){\r
+        return this.enableGrouping && !!this.getGroupField();\r
+    },\r
+\r
+    // private\r
+    getPrefix: function(field){\r
+        return this.grid.getGridEl().id + '-gp-' + field + '-';\r
     },\r
 \r
     // private\r
@@ -65545,7 +70459,7 @@ var grid = new Ext.grid.GridPanel({
 \r
     // private\r
     getRows : function(){\r
-        if(!this.enableGrouping){\r
+        if(!this.canGroup()){\r
             return Ext.grid.GroupingView.superclass.getRows.call(this);\r
         }\r
         var r = [];\r
@@ -65561,10 +70475,10 @@ var grid = new Ext.grid.GridPanel({
 \r
     // private\r
     updateGroupWidths : function(){\r
-        if(!this.enableGrouping || !this.hasRows()){\r
+        if(!this.canGroup() || !this.hasRows()){\r
             return;\r
         }\r
-        var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.scrollOffset) +'px';\r
+        var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.getScrollOffset()) +'px';\r
         var gs = this.getGroups();\r
         for(var i = 0, len = gs.length; i < len; i++){\r
             gs[i].firstChild.style.width = tw;\r
@@ -65596,14 +70510,7 @@ var grid = new Ext.grid.GridPanel({
 \r
     // private\r
     onBeforeRowSelect : function(sm, rowIndex){\r
-        if(!this.enableGrouping){\r
-            return;\r
-        }\r
-        var row = this.getRow(rowIndex);\r
-        if(row && !row.offsetParent){\r
-            var g = this.findGroup(row);\r
-            this.toggleGroup(g, true);\r
-        }\r
+        this.toggleRowIndex(rowIndex, true);\r
     }\r
 });\r
 // private\r