Roo/Template.js
[roojs1] / roojs-all.js
index d482f1a..a17bc08 100644 (file)
-
-
-
-
-
-
-
-window["undefined"] = window["undefined"];
-
-
-
-var  Roo = {}; 
-
-
-
-Roo.apply = function(o, c, A){
-    if(A){
-        
-        Roo.apply(o, A);
-    }
-    if(o && c && typeof  c == 'object'){
-        for(var  p  in  c){
-            o[p] = c[p];
-        }
-    }
-    return  o;
-};
-
-
-(function(){
-    var  B = 0;
-    var  ua = navigator.userAgent.toLowerCase();
-
-    var  C = document.compatMode == "CSS1Compat",
-        D = ua.indexOf("opera") > -1,
-        E = (/webkit|khtml/).test(ua),
-        F = ua.indexOf("msie") > -1,
-        G = ua.indexOf("msie 7") > -1,
-        H = !E && ua.indexOf("gecko") > -1,
-        I = F && !C,
-        J = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),
-        K = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),
-        L = (ua.indexOf("linux") != -1),
-        M = window.location.href.toLowerCase().indexOf("https") === 0;
-
-    
-       if(F && !G){
-        try{
-            document.execCommand("BackgroundImageCache", false, true);
-        }catch(e){}
-    }
-
-
-    Roo.apply(Roo, {
-        
-
-        isStrict : C,
-        
-
-        isSecure : M,
-        
-
-        isReady : false,
-
-        
-
-        enableGarbageCollector : true,
-
-        
-
-        enableListenerCollection:false,
-
-        
-
-        SSL_SECURE_URL : "javascript:false",
-
-        
-
-        BLANK_IMAGE_URL : "http:/"+"/localhost/s.gif",
-
-        emptyFn : function(){},
-
-        
-
-        applyIf : function(o, c){
-            if(o && c){
-                for(var  p  in  c){
-                    if(typeof  o[p] == "undefined"){ o[p] = c[p]; }
-                }
-            }
-            return  o;
-        },
-
-        
-
-        addBehaviors : function(o){
-            if(!Roo.isReady){
-                Roo.onReady(function(){
-                    Roo.addBehaviors(o);
-                });
-                return;
-            }
-            var  N = {}; 
-            for(var  b  in  o){
-                var  parts = b.split('@');
-                if(parts[1]){ 
-                    var  s = parts[0];
-                    if(!N[s]){
-                        N[s] = Roo.select(s);
-                    }
-
-                    N[s].on(parts[1], o[b]);
-                }
-            }
-
-            N = null;
-        },
-
-        
-
-        id : function(el, O){
-            O = O || "roo-gen";
-            el = Roo.getDom(el);
-            var  id = O + (++B);
-            return  el ? (el.id ? el.id : (el.id = id)) : id;
-        },
-         
-       
-        
-
-        extend : function(){
-            
-            var  io = function(o){
-                for(var  m  in  o){
-                    this[m] = o[m];
-                }
-            };
-            return  function(sb, sp, P){
-                if(typeof  sp == 'object'){ 
-                    P = sp;
-                    sp = sb;
-                    sb = function(){sp.apply(this, arguments);};
-                }
-                var  F = function(){}, sbp, spp = sp.prototype;
-                F.prototype = spp;
-                sbp = sb.prototype = new  F();
-                sbp.constructor=sb;
-                sb.superclass=spp;
-                
-                if(spp.constructor == Object.prototype.constructor){
-                    spp.constructor=sp;
-                   
-                }
-
-                
-                sb.override = function(o){
-                    Roo.override(sb, o);
-                };
-                sbp.override = io;
-                Roo.override(sb, P);
-                return  sb;
-            };
-        }(),
-
-        
-
-        override : function(P, Q){
-            if(Q){
-                var  p = P.prototype;
-                for(var  method  in  Q){
-                    p[method] = Q[method];
-                }
-            }
-        },
-        
-
-        namespace : function(){
-            var  a=arguments, o=null, i, j, d, rt;
-            for (i=0; i<a.length; ++i) {
-                d=a[i].split(".");
-                rt = d[0];
-                
-
-                eval('if (typeof ' + rt + ' == "undefined"){' + rt + ' = {};} o = ' + rt + ';');
-                for (j=1; j<d.length; ++j) {
-                    o[d[j]]=o[d[j]] || {};
-                    o=o[d[j]];
-                }
-            }
-        },
-        
-
-         
-        factory : function(c, ns)
-        {
-            
-            if (!c.xtype   || (!ns && !c.xns) ||  (c.xns === false)) { 
-                return  c;
-            }
-
-            ns = c.xns ? c.xns : ns; 
-            if (c.constructor == ns[c.xtype]) {
-                return  c;
-            }
-            if (ns[c.xtype]) {
-                console.log("Roo.Factory(" + c.xtype + ")");
-                var  ret = new  ns[c.xtype](c);
-                ret.xns = false;
-                return  ret;
-            }
-
-            c.xns = false; 
-            return  c;
-        },
-         
-        
-
-        urlEncode : function(o){
-            if(!o){
-                return  "";
-            }
-            var  R = [];
-            for(var  key  in  o){
-                var  ov = o[key], k = encodeURIComponent(key);
-                var  type = typeof  ov;
-                if(type == 'undefined'){
-                    R.push(k, "=&");
-                }else  if(type != "function" && type != "object"){
-                    R.push(k, "=", encodeURIComponent(ov), "&");
-                }else  if(ov  instanceof  Array){
-                    if (ov.length) {
-                           for(var  i = 0, len = ov.length; i < len; i++) {
-                               R.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
-                           }
-                       } else  {
-                           R.push(k, "=&");
-                       }
-                }
-            }
-
-            R.pop();
-            return  R.join("");
-        },
-
-        
-
-        urlDecode : function(S, T){
-            if(!S || !S.length){
-                return  {};
-            }
-            var  U = {};
-            var  V = S.split('&');
-            var  W, X, Y;
-            for(var  i = 0, len = V.length; i < len; i++){
-                W = V[i].split('=');
-                X = decodeURIComponent(W[0]);
-                Y = decodeURIComponent(W[1]);
-                if(T !== true){
-                    if(typeof  U[X] == "undefined"){
-                        U[X] = Y;
-                    }else  if(typeof  U[X] == "string"){
-                        U[X] = [U[X]];
-                        U[X].push(Y);
-                    }else {
-                        U[X].push(Y);
-                    }
-                }else {
-                    U[X] = Y;
-                }
-            }
-            return  U;
-        },
-
-        
-
-        each : function(Z, fn, f){
-            if(typeof  Z.length == "undefined" || typeof  Z == "string"){
-                Z = [Z];
-            }
-            for(var  i = 0, len = Z.length; i < len; i++){
-                if(fn.call(f || Z[i], Z[i], i, Z) === false){ return  i; };
-            }
-        },
-
-        
-        combine : function(){
-            var  as = arguments, l = as.length, r = [];
-            for(var  i = 0; i < l; i++){
-                var  a = as[i];
-                if(a  instanceof  Array){
-                    r = r.concat(a);
-                }else  if(a.length !== undefined && !a.substr){
-                    r = r.concat(Array.prototype.slice.call(a, 0));
-                }else {
-                    r.push(a);
-                }
-            }
-            return  r;
-        },
-
-        
-
-        escapeRe : function(s) {
-            return  s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
-        },
-
-        
-        callback : function(cb, g, h, n){
-            if(typeof  cb == "function"){
-                if(n){
-                    cb.defer(n, g, h || []);
-                }else {
-                    cb.apply(g, h || []);
-                }
-            }
-        },
-
-        
-
-        getDom : function(el){
-            if(!el){
-                return  null;
-            }
-            return  el.dom ? el.dom : (typeof  el == 'string' ? document.getElementById(el) : el);
-        },
-
-        
-
-        getCmp : function(id){
-            return  Roo.ComponentMgr.get(id);
-        },
-         
-        num : function(v, q){
-            if(typeof  v != 'number'){
-                return  q;
-            }
-            return  v;
-        },
-
-        destroy : function(){
-            for(var  i = 0, a = arguments, len = a.length; i < len; i++) {
-                var  as = a[i];
-                if(as){
-                    if(as.dom){
-                        as.removeAllListeners();
-                        as.remove();
-                        continue;
-                    }
-                    if(typeof  as.purgeListeners == 'function'){
-                        as.purgeListeners();
-                    }
-                    if(typeof  as.destroy == 'function'){
-                        as.destroy();
-                    }
-                }
-            }
-        },
-
-        
-        
-
-        type : function(o){
-            if(o === undefined || o === null){
-                return  false;
-            }
-            if(o.htmlElement){
-                return  'element';
-            }
-            var  t = typeof  o;
-            if(t == 'object' && o.nodeName) {
-                switch(o.nodeType) {
-                    case  1: return  'element';
-                    case  3: return  (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
-                }
-            }
-            if(t == 'object' || t == 'function') {
-                switch(o.constructor) {
-                    case  Array: return  'array';
-                    case  RegExp: return  'regexp';
-                }
-                if(typeof  o.length == 'number' && typeof  o.item == 'function') {
-                    return  'nodelist';
-                }
-            }
-            return  t;
-        },
-
-        
-
-        isEmpty : function(v, u){
-            return  v === null || v === undefined || (!u ? v === '' : false);
-        },
-        
-        
-
-        isOpera : D,
-        
-
-        isSafari : E,
-        
-
-        isIE : F,
-        
-
-        isIE7 : G,
-        
-
-        isGecko : H,
-        
-
-        isBorderBox : I,
-        
-
-        isWindows : J,
-        
-
-        isLinux : L,
-        
-
-        isMac : K,
-
-        
-
-        useShims : ((F && !G) || (H && K))
-    });
-
-
-})();
-
-Roo.namespace("Roo", "Roo.util", "Roo.grid", "Roo.dd", "Roo.tree", "Roo.data",
-                "Roo.form", "Roo.menu", "Roo.state", "Roo.lib", "Roo.layout", "Roo.app", "Roo.ux");
-
-
-
-
-(function() {    
-    
-    if(Roo.isIE) {
-        function  A() {
-            var  p = Function.prototype;
-            delete  p.createSequence;
-            delete  p.defer;
-            delete  p.createDelegate;
-            delete  p.createCallback;
-            delete  p.createInterceptor;
-
-            window.detachEvent("onunload", A);
-        }
-
-        window.attachEvent("onunload", A);
-    }
-})();
-
-
-
-
-Roo.apply(Function.prototype, {
-     
-
-    createCallback : function(
-){
-        
-        var  B = arguments;
-        var  C = this;
-        return  function() {
-            return  C.apply(window, B);
-        };
-    },
-
-    
-
-    createDelegate : function(D, E, F){
-        var  G = this;
-        return  function() {
-            var  H = E || arguments;
-            if(F === true){
-                H = Array.prototype.slice.call(arguments, 0);
-                H = H.concat(E);
-            }else  if(typeof  F == "number"){
-                H = Array.prototype.slice.call(arguments, 0); 
-                var  applyArgs = [F, 0].concat(E); 
-                Array.prototype.splice.apply(H, applyArgs); 
-            }
-            return  G.apply(D || window, H);
-        };
-    },
-
-    
-
-    defer : function(H, I, J, K){
-        var  fn = this.createDelegate(I, J, K);
-        if(H){
-            return  setTimeout(fn, H);
-        }
-
-        fn();
-        return  0;
-    },
-    
-
-    createSequence : function(L, M){
-        if(typeof  L != "function"){
-            return  this;
-        }
-        var  N = this;
-        return  function() {
-            var  O = N.apply(this || window, arguments);
-            L.apply(M || this || window, arguments);
-            return  O;
-        };
-    },
-
-    
-
-    createInterceptor : function(O, P){
-        if(typeof  O != "function"){
-            return  this;
-        }
-        var  Q = this;
-        return  function() {
-            O.target = this;
-            O.method = Q;
-            if(O.apply(P || this || window, arguments) === false){
-                return;
-            }
-            return  Q.apply(this || window, arguments);
-        };
-    }
-});
-
-
-
-
-Roo.applyIf(String, {
-    
-    
-
-    
-    
-
-    escape : function(A) {
-        return  A.replace(/('|\\)/g, "\\$1");
-    },
-
-    
-
-    leftPad : function (B, C, ch) {
-        var  D = new  String(B);
-        if(ch === null || ch === undefined || ch === '') {
-            ch = " ";
-        }
-        while (D.length < C) {
-            D = ch + D;
-        }
-        return  D;
-    },
-
-    
-
-    format : function(E){
-        var  F = Array.prototype.slice.call(arguments, 1);
-        return  E.replace(/\{(\d+)\}/g, function(m, i){
-            return  Roo.util.Format.htmlEncode(F[i]);
-        });
-    }
-});
-
-
-
-String.prototype.toggle = function(G, H){
-    return  this == G ? H : G;
-};
-
-
-
-
-Roo.applyIf(Number.prototype, {
-    
-
-    constrain : function(A, B){
-        return  Math.min(Math.max(this, A), B);
-    }
-});
-
-
-
-Roo.applyIf(Array.prototype, {
-    
-
-    indexOf : function(o){
-       for (var  i = 0, len = this.length; i < len; i++){
-             if(this[i] == o) return  i;
-       }
-          return  -1;
-    },
-
-    
-
-    remove : function(o){
-       var  A = this.indexOf(o);
-       if(A != -1){
-           this.splice(A, 1);
-       }
-    }
-});
-
-
-
-
-
-
-
-
-
-
-Date.prototype.getElapsed = function(A) {
-       return  Math.abs((A || new  Date()).getTime()-this.getTime());
-};
-
-
-
-
-Date.parseFunctions = {count:0};
-
-Date.parseRegexes = [];
-
-Date.formatFunctions = {count:0};
-
-
-Date.prototype.dateFormat = function(B) {
-    if (Date.formatFunctions[B] == null) {
-        Date.createNewFormat(B);
-    }
-    var  C = Date.formatFunctions[B];
-    return  this[C]();
-};
-
-
-
-
-Date.prototype.format = Date.prototype.dateFormat;
-
-
-Date.createNewFormat = function(D) {
-    var  E = "format" + Date.formatFunctions.count++;
-    Date.formatFunctions[D] = E;
-    var  F = "Date.prototype." + E + " = function(){return ";
-    var  G = false;
-    var  ch = '';
-    for (var  i = 0; i < D.length; ++i) {
-        ch = D.charAt(i);
-        if (!G && ch == "\\") {
-            G = true;
-        }
-        else  if (G) {
-            G = false;
-            F += "'" + String.escape(ch) + "' + ";
-        }
-        else  {
-            F += Date.getFormatCode(ch);
-        }
-    }
-
-    
-
-    eval(F.substring(0, F.length - 3) + ";}");
-};
-
-
-Date.getFormatCode = function(H) {
-    switch (H) {
-    case  "d":
-        return  "String.leftPad(this.getDate(), 2, '0') + ";
-    case  "D":
-        return  "Date.dayNames[this.getDay()].substring(0, 3) + ";
-    case  "j":
-        return  "this.getDate() + ";
-    case  "l":
-        return  "Date.dayNames[this.getDay()] + ";
-    case  "S":
-        return  "this.getSuffix() + ";
-    case  "w":
-        return  "this.getDay() + ";
-    case  "z":
-        return  "this.getDayOfYear() + ";
-    case  "W":
-        return  "this.getWeekOfYear() + ";
-    case  "F":
-        return  "Date.monthNames[this.getMonth()] + ";
-    case  "m":
-        return  "String.leftPad(this.getMonth() + 1, 2, '0') + ";
-    case  "M":
-        return  "Date.monthNames[this.getMonth()].substring(0, 3) + ";
-    case  "n":
-        return  "(this.getMonth() + 1) + ";
-    case  "t":
-        return  "this.getDaysInMonth() + ";
-    case  "L":
-        return  "(this.isLeapYear() ? 1 : 0) + ";
-    case  "Y":
-        return  "this.getFullYear() + ";
-    case  "y":
-        return  "('' + this.getFullYear()).substring(2, 4) + ";
-    case  "a":
-        return  "(this.getHours() < 12 ? 'am' : 'pm') + ";
-    case  "A":
-        return  "(this.getHours() < 12 ? 'AM' : 'PM') + ";
-    case  "g":
-        return  "((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";
-    case  "G":
-        return  "this.getHours() + ";
-    case  "h":
-        return  "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";
-    case  "H":
-        return  "String.leftPad(this.getHours(), 2, '0') + ";
-    case  "i":
-        return  "String.leftPad(this.getMinutes(), 2, '0') + ";
-    case  "s":
-        return  "String.leftPad(this.getSeconds(), 2, '0') + ";
-    case  "O":
-        return  "this.getGMTOffset() + ";
-    case  "T":
-        return  "this.getTimezone() + ";
-    case  "Z":
-        return  "(this.getTimezoneOffset() * -60) + ";
-    default:
-        return  "'" + String.escape(H) + "' + ";
-    }
-};
-
-
-
-Date.parseDate = function(I, J) {
-    if (Date.parseFunctions[J] == null) {
-        Date.createParser(J);
-    }
-    var  K = Date.parseFunctions[J];
-    return  Date[K](I);
-};
-
-
-Date.createParser = function(L) {
-    var  M = "parse" + Date.parseFunctions.count++;
-    var  N = Date.parseRegexes.length;
-    var  O = 1;
-    Date.parseFunctions[L] = M;
-
-    var  P = "Date." + M + " = function(input){\n"
-        + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"
-        + "var d = new Date();\n"
-        + "y = d.getFullYear();\n"
-        + "m = d.getMonth();\n"
-        + "d = d.getDate();\n"
-        + "var results = input.match(Date.parseRegexes[" + N + "]);\n"
-        + "if (results && results.length > 0) {";
-    var  Q = "";
-
-    var  R = false;
-    var  ch = '';
-    for (var  i = 0; i < L.length; ++i) {
-        ch = L.charAt(i);
-        if (!R && ch == "\\") {
-            R = true;
-        }
-        else  if (R) {
-            R = false;
-            Q += String.escape(ch);
-        }
-        else  {
-            var  obj = Date.formatCodeToRegex(ch, O);
-            O += obj.g;
-            Q += obj.s;
-            if (obj.g && obj.c) {
-                P += obj.c;
-            }
-        }
-    }
-
-
-    P += "if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
-        + "{v = new Date(y, m, d, h, i, s);}\n"
-        + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
-        + "{v = new Date(y, m, d, h, i);}\n"
-        + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"
-        + "{v = new Date(y, m, d, h);}\n"
-        + "else if (y >= 0 && m >= 0 && d > 0)\n"
-        + "{v = new Date(y, m, d);}\n"
-        + "else if (y >= 0 && m >= 0)\n"
-        + "{v = new Date(y, m);}\n"
-        + "else if (y >= 0)\n"
-        + "{v = new Date(y);}\n"
-        + "}return (v && (z || o))?\n" 
-        + "    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n" 
-        + "        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n" 
-        + ";}";
-
-    Date.parseRegexes[N] = new  RegExp("^" + Q + "$");
-     
-
-    eval(P);
-};
-
-
-Date.formatCodeToRegex = function(S, T) {
-    switch (S) {
-    case  "D":
-        return  {g:0,
-        c:null,
-        s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
-    case  "j":
-        return  {g:1,
-            c:"d = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{1,2})"}; 
-    case  "d":
-        return  {g:1,
-            c:"d = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{2})"}; 
-    case  "l":
-        return  {g:0,
-            c:null,
-            s:"(?:" + Date.dayNames.join("|") + ")"};
-    case  "S":
-        return  {g:0,
-            c:null,
-            s:"(?:st|nd|rd|th)"};
-    case  "w":
-        return  {g:0,
-            c:null,
-            s:"\\d"};
-    case  "z":
-        return  {g:0,
-            c:null,
-            s:"(?:\\d{1,3})"};
-    case  "W":
-        return  {g:0,
-            c:null,
-            s:"(?:\\d{2})"};
-    case  "F":
-        return  {g:1,
-            c:"m = parseInt(Date.monthNumbers[results[" + T + "].substring(0, 3)], 10);\n",
-            s:"(" + Date.monthNames.join("|") + ")"};
-    case  "M":
-        return  {g:1,
-            c:"m = parseInt(Date.monthNumbers[results[" + T + "]], 10);\n",
-            s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
-    case  "n":
-        return  {g:1,
-            c:"m = parseInt(results[" + T + "], 10) - 1;\n",
-            s:"(\\d{1,2})"}; 
-    case  "m":
-        return  {g:1,
-            c:"m = parseInt(results[" + T + "], 10) - 1;\n",
-            s:"(\\d{2})"}; 
-    case  "t":
-        return  {g:0,
-            c:null,
-            s:"\\d{1,2}"};
-    case  "L":
-        return  {g:0,
-            c:null,
-            s:"(?:1|0)"};
-    case  "Y":
-        return  {g:1,
-            c:"y = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{4})"};
-    case  "y":
-        return  {g:1,
-            c:"var ty = parseInt(results[" + T + "], 10);\n"
-                + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
-            s:"(\\d{1,2})"};
-    case  "a":
-        return  {g:1,
-            c:"if (results[" + T + "] == 'am') {\n"
-                + "if (h == 12) { h = 0; }\n"
-                + "} else { if (h < 12) { h += 12; }}",
-            s:"(am|pm)"};
-    case  "A":
-        return  {g:1,
-            c:"if (results[" + T + "] == 'AM') {\n"
-                + "if (h == 12) { h = 0; }\n"
-                + "} else { if (h < 12) { h += 12; }}",
-            s:"(AM|PM)"};
-    case  "g":
-    case  "G":
-        return  {g:1,
-            c:"h = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{1,2})"}; 
-    case  "h":
-    case  "H":
-        return  {g:1,
-            c:"h = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{2})"}; 
-    case  "i":
-        return  {g:1,
-            c:"i = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{2})"};
-    case  "s":
-        return  {g:1,
-            c:"s = parseInt(results[" + T + "], 10);\n",
-            s:"(\\d{2})"};
-    case  "O":
-        return  {g:1,
-            c:[
-                "o = results[", T, "];\n",
-                "var sn = o.substring(0,1);\n", 
-                "var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n", 
-                "var mn = o.substring(3,5) % 60;\n", 
-                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n", 
-                "    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"
-            ].join(""),
-            s:"([+\-]\\d{4})"};
-    case  "T":
-        return  {g:0,
-            c:null,
-            s:"[A-Z]{1,4}"}; 
-    case  "Z":
-        return  {g:1,
-            c:"z = results[" + T + "];\n" 
-                  + "z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",
-            s:"([+\-]?\\d{1,5})"}; 
-    default:
-        return  {g:0,
-            c:null,
-            s:String.escape(S)};
-    }
-};
-
-
-
-Date.prototype.getTimezone = function() {
-    return  this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/, "$1");
-};
-
-
-
-Date.prototype.getGMTOffset = function() {
-    return  (this.getTimezoneOffset() > 0 ? "-" : "+")
-        + String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset() / 60)), 2, "0")
-        + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
-};
-
-
-
-Date.prototype.getDayOfYear = function() {
-    var  U = 0;
-    Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
-    for (var  i = 0; i < this.getMonth(); ++i) {
-        U += Date.daysInMonth[i];
-    }
-    return  U + this.getDate() - 1;
-};
-
-
-
-Date.prototype.getWeekOfYear = function() {
-    
-    var  V = this.getDayOfYear() + (4 - this.getDay());
-    
-    var  W = new  Date(this.getFullYear(), 0, 1);
-    var  X = (7 - W.getDay() + 4);
-    return  String.leftPad(((V - X) / 7) + 1, 2, "0");
-};
-
-
-
-Date.prototype.isLeapYear = function() {
-    var  Y = this.getFullYear();
-    return  ((Y & 3) == 0 && (Y % 100 || (Y % 400 == 0 && Y)));
-};
-
-
-
-Date.prototype.getFirstDayOfMonth = function() {
-    var  Z = (this.getDay() - (this.getDate() - 1)) % 7;
-    return  (Z < 0) ? (Z + 7) : Z;
-};
-
-
-
-Date.prototype.getLastDayOfMonth = function() {
-    var  a = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
-    return  (a < 0) ? (a + 7) : a;
-};
-
-
-
-
-Date.prototype.getFirstDateOfMonth = function() {
-    return  new  Date(this.getFullYear(), this.getMonth(), 1);
-};
-
-
-
-Date.prototype.getLastDateOfMonth = function() {
-    return  new  Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth());
-};
-
-
-Date.prototype.getDaysInMonth = function() {
-    Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
-    return  Date.daysInMonth[this.getMonth()];
-};
-
-
-
-Date.prototype.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";
-    }
-};
-
-
-Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
-
-
-
-Date.monthNames =
-   ["January",
-    "February",
-    "March",
-    "April",
-    "May",
-    "June",
-    "July",
-    "August",
-    "September",
-    "October",
-    "November",
-    "December"];
-
-
-
-Date.dayNames =
-   ["Sunday",
-    "Monday",
-    "Tuesday",
-    "Wednesday",
-    "Thursday",
-    "Friday",
-    "Saturday"];
-
-
-Date.y2kYear = 50;
-
-Date.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};
-
-
-
-Date.prototype.clone = function() {
-       return  new  Date(this.getTime());
-};
-
-
-
-Date.prototype.clearTime = function(b){
-    if(b){
-        return  this.clone().clearTime();
-    }
-
-    this.setHours(0);
-    this.setMinutes(0);
-    this.setSeconds(0);
-    this.setMilliseconds(0);
-    return  this;
-};
-
-
-
-if(Roo.isSafari){
-    Date.brokenSetMonth = Date.prototype.setMonth;
-       Date.prototype.setMonth = function(c){
-               if(c <= -1){
-                       var  n = Math.ceil(-c);
-                       var  back_year = Math.ceil(n/12);
-                       var  month = (n % 12) ? 12 - n % 12 : 0 ;
-                       this.setFullYear(this.getFullYear() - back_year);
-                       return  Date.brokenSetMonth.call(this, month);
-               } else  {
-                       return  Date.brokenSetMonth.apply(this, arguments);
-               }
-       };
-}
-
-
-
-
-Date.MILLI = "ms";
-
-
-Date.SECOND = "s";
-
-
-Date.MINUTE = "mi";
-
-
-Date.HOUR = "h";
-
-
-Date.DAY = "d";
-
-
-Date.MONTH = "mo";
-
-
-Date.YEAR = "y";
-
-
-
-Date.prototype.add = function(e, f){
-  var  d = this.clone();
-  if (!e || f === 0) return  d;
-  switch(e.toLowerCase()){
-    case  Date.MILLI:
-      d.setMilliseconds(this.getMilliseconds() + f);
-      break;
-    case  Date.SECOND:
-      d.setSeconds(this.getSeconds() + f);
-      break;
-    case  Date.MINUTE:
-      d.setMinutes(this.getMinutes() + f);
-      break;
-    case  Date.HOUR:
-      d.setHours(this.getHours() + f);
-      break;
-    case  Date.DAY:
-      d.setDate(this.getDate() + f);
-      break;
-    case  Date.MONTH:
-      var  a = this.getDate();
-      if(a > 28){
-          a = Math.min(a, this.getFirstDateOfMonth().add('mo', f).getLastDateOfMonth().getDate());
-      }
-
-      d.setDate(a);
-      d.setMonth(this.getMonth() + f);
-      break;
-    case  Date.YEAR:
-      d.setFullYear(this.getFullYear() + f);
-      break;
-  }
-  return  d;
-};
-
-
-
-Roo.lib.Dom = {
-    getViewWidth : function(A) {
-        return  A ? this.getDocumentWidth() : this.getViewportWidth();
-    },
-
-    getViewHeight : function(B) {
-        return  B ? this.getDocumentHeight() : this.getViewportHeight();
-    },
-
-    getDocumentHeight: function() {
-        var  C = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
-        return  Math.max(C, this.getViewportHeight());
-    },
-
-    getDocumentWidth: function() {
-        var  D = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
-        return  Math.max(D, this.getViewportWidth());
-    },
-
-    getViewportHeight: function() {
-        var  E = self.innerHeight;
-        var  F = document.compatMode;
-
-        if ((F || Roo.isIE) && !Roo.isOpera) {
-            E = (F == "CSS1Compat") ?
-                     document.documentElement.clientHeight :
-                     document.body.clientHeight;
-        }
-
-        return  E;
-    },
-
-    getViewportWidth: function() {
-        var  G = self.innerWidth;
-        var  H = document.compatMode;
-
-        if (H || Roo.isIE) {
-            G = (H == "CSS1Compat") ?
-                    document.documentElement.clientWidth :
-                    document.body.clientWidth;
-        }
-        return  G;
-    },
-
-    isAncestor : function(p, c) {
-        p = Roo.getDom(p);
-        c = Roo.getDom(c);
-        if (!p || !c) {
-            return  false;
-        }
-
-        if (p.contains && !Roo.isSafari) {
-            return  p.contains(c);
-        } else  if (p.compareDocumentPosition) {
-            return  !!(p.compareDocumentPosition(c) & 16);
-        } else  {
-            var  parent = c.parentNode;
-            while (parent) {
-                if (parent == p) {
-                    return  true;
-                }
-                else  if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
-                    return  false;
-                }
-
-                parent = parent.parentNode;
-            }
-            return  false;
-        }
-    },
-
-    getRegion : function(el) {
-        return  Roo.lib.Region.getRegion(el);
-    },
-
-    getY : function(el) {
-        return  this.getXY(el)[1];
-    },
-
-    getX : function(el) {
-        return  this.getXY(el)[0];
-    },
-
-    getXY : function(el) {
-        var  p, pe, b, I, bd = document.body;
-        el = Roo.getDom(el);
-        var  J = Roo.lib.AnimBase.fly;
-        if (el.getBoundingClientRect) {
-            b = el.getBoundingClientRect();
-            I = J(document).getScroll();
-            return  [b.left + I.left, b.top + I.top];
-        }
-        var  x = 0, y = 0;
-
-        p = el;
-
-        var  K = J(el).getStyle("position") == "absolute";
-
-        while (p) {
-
-            x += p.offsetLeft;
-            y += p.offsetTop;
-
-            if (!K && J(p).getStyle("position") == "absolute") {
-                K = true;
-            }
-
-            if (Roo.isGecko) {
-                pe = J(p);
-
-                var  bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
-                var  bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
-
-
-                x += bl;
-                y += bt;
-
-
-                if (p != el && pe.getStyle('overflow') != 'visible') {
-                    x += bl;
-                    y += bt;
-                }
-            }
-
-            p = p.offsetParent;
-        }
-
-        if (Roo.isSafari && K) {
-            x -= bd.offsetLeft;
-            y -= bd.offsetTop;
-        }
-
-        if (Roo.isGecko && !K) {
-            var  dbd = J(bd);
-            x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
-            y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
-        }
-
-
-        p = el.parentNode;
-        while (p && p != bd) {
-            if (!Roo.isOpera || (p.tagName != 'TR' && J(p).getStyle("display") != "inline")) {
-                x -= p.scrollLeft;
-                y -= p.scrollTop;
-            }
-
-            p = p.parentNode;
-        }
-        return  [x, y];
-    },
-  
-
-
-    setXY : function(el, xy) {
-        el = Roo.fly(el, '_setXY');
-        el.position();
-        var  L = el.translatePoints(xy);
-        if (xy[0] !== false) {
-            el.dom.style.left = L.left + "px";
-        }
-        if (xy[1] !== false) {
-            el.dom.style.top = L.top + "px";
-        }
-    },
-
-    setX : function(el, x) {
-        this.setXY(el, [x, false]);
-    },
-
-    setY : function(el, y) {
-        this.setXY(el, [false, y]);
-    }
-};
-
-
-
-
-Roo.lib.Event = function() {
-    var  A = false;
-    var  B = [];
-    var  C = [];
-    var  D = 0;
-    var  E = [];
-    var  F = 0;
-    var  G = null;
-
-    return  {
-        POLL_RETRYS: 200,
-        POLL_INTERVAL: 20,
-        EL: 0,
-        TYPE: 1,
-        FN: 2,
-        WFN: 3,
-        OBJ: 3,
-        ADJ_SCOPE: 4,
-        _interval: null,
-
-        startInterval: function() {
-            if (!this._interval) {
-                var  self = this;
-                var  callback = function() {
-                    self._tryPreloadAttach();
-                };
-                this._interval = setInterval(callback, this.POLL_INTERVAL);
-
-            }
-        },
-
-        onAvailable: function(h, k, m, n) {
-            E.push({ id:         h,
-                fn:         k,
-                obj:        m,
-                override:   n,
-                checkReady: false    });
-
-            D = this.POLL_RETRYS;
-            this.startInterval();
-        },
-
-
-        addListener: function(el, o, fn) {
-            el = Roo.getDom(el);
-            if (!el || !fn) {
-                return  false;
-            }
-
-            if ("unload" == o) {
-                C[C.length] =
-                [el, o, fn];
-                return  true;
-            }
-
-            var  p = function(e) {
-                return  fn(Roo.lib.Event.getEvent(e));
-            };
-
-            var  li = [el, o, fn, p];
-
-            var  q = B.length;
-            B[q] = li;
-
-            this.doAdd(el, o, p, false);
-            return  true;
-
-        },
-
-
-        removeListener: function(el, r, fn) {
-            var  i, s;
-
-            el = Roo.getDom(el);
-
-            if(!fn) {
-                return  this.purgeElement(el, false, r);
-            }
-
-
-            if ("unload" == r) {
-
-                for (i = 0,s = C.length; i < s; i++) {
-                    var  li = C[i];
-                    if (li &&
-                        li[0] == el &&
-                        li[1] == r &&
-                        li[2] == fn) {
-                        C.splice(i, 1);
-                        return  true;
-                    }
-                }
-
-                return  false;
-            }
-
-            var  u = null;
-
-
-            var  v = arguments[3];
-
-            if ("undefined" == typeof  v) {
-                v = this._getCacheIndex(el, r, fn);
-            }
-
-            if (v >= 0) {
-                u = B[v];
-            }
-
-            if (!el || !u) {
-                return  false;
-            }
-
-
-            this.doRemove(el, r, u[this.WFN], false);
-
-            delete  B[v][this.WFN];
-            delete  B[v][this.FN];
-            B.splice(v, 1);
-
-            return  true;
-
-        },
-
-
-        getTarget: function(ev, w) {
-            ev = ev.browserEvent || ev;
-            var  t = ev.target || ev.srcElement;
-            return  this.resolveTextNode(t);
-        },
-
-
-        resolveTextNode: function(z) {
-            if (Roo.isSafari && z && 3 == z.nodeType) {
-                return  z.parentNode;
-            } else  {
-                return  z;
-            }
-        },
-
-
-        getPageX: function(ev) {
-            ev = ev.browserEvent || ev;
-            var  x = ev.pageX;
-            if (!x && 0 !== x) {
-                x = ev.clientX || 0;
-
-                if (Roo.isIE) {
-                    x += this.getScroll()[1];
-                }
-            }
-
-            return  x;
-        },
-
-
-        getPageY: function(ev) {
-            ev = ev.browserEvent || ev;
-            var  y = ev.pageY;
-            if (!y && 0 !== y) {
-                y = ev.clientY || 0;
-
-                if (Roo.isIE) {
-                    y += this.getScroll()[0];
-                }
-            }
-
-
-            return  y;
-        },
-
-
-        getXY: function(ev) {
-            ev = ev.browserEvent || ev;
-            return  [this.getPageX(ev), this.getPageY(ev)];
-        },
-
-
-        getRelatedTarget: function(ev) {
-            ev = ev.browserEvent || ev;
-            var  t = ev.relatedTarget;
-            if (!t) {
-                if (ev.type == "mouseout") {
-                    t = ev.toElement;
-                } else  if (ev.type == "mouseover") {
-                    t = ev.fromElement;
-                }
-            }
-
-            return  this.resolveTextNode(t);
-        },
-
-
-        getTime: function(ev) {
-            ev = ev.browserEvent || ev;
-            if (!ev.time) {
-                var  t = new  Date().getTime();
-                try {
-                    ev.time = t;
-                } catch(ex) {
-                    this.lastError = ex;
-                    return  t;
-                }
-            }
-
-            return  ev.time;
-        },
-
-
-        stopEvent: function(ev) {
-            this.stopPropagation(ev);
-            this.preventDefault(ev);
-        },
-
-
-        stopPropagation: function(ev) {
-            ev = ev.browserEvent || ev;
-            if (ev.stopPropagation) {
-                ev.stopPropagation();
-            } else  {
-                ev.cancelBubble = true;
-            }
-        },
-
-
-        preventDefault: function(ev) {
-            ev = ev.browserEvent || ev;
-            if(ev.preventDefault) {
-                ev.preventDefault();
-            } else  {
-                ev.returnValue = false;
-            }
-        },
-
-
-        getEvent: function(e) {
-            var  ev = e || window.event;
-            if (!ev) {
-                var  c = this.getEvent.caller;
-                while (c) {
-                    ev = c.arguments[0];
-                    if (ev && Event == ev.constructor) {
-                        break;
-                    }
-
-                    c = c.caller;
-                }
-            }
-            return  ev;
-        },
-
-
-        getCharCode: function(ev) {
-            ev = ev.browserEvent || ev;
-            return  ev.charCode || ev.keyCode || 0;
-        },
-
-
-        _getCacheIndex: function(el, AA, fn) {
-            for (var  i = 0,s = B.length; i < s; ++i) {
-                var  li = B[i];
-                if (li &&
-                    li[this.FN] == fn &&
-                    li[this.EL] == el &&
-                    li[this.TYPE] == AA) {
-                    return  i;
-                }
-            }
-
-            return  -1;
-        },
-
-
-        elCache: {},
-
-
-        getEl: function(id) {
-            return  document.getElementById(id);
-        },
-
-
-        clearCache: function() {
-        },
-
-
-        _load: function(e) {
-            A = true;
-            var  EU = Roo.lib.Event;
-
-
-            if (Roo.isIE) {
-                EU.doRemove(window, "load", EU._load);
-            }
-        },
-
-
-        _tryPreloadAttach: function() {
-
-            if (this.locked) {
-                return  false;
-            }
-
-
-            this.locked = true;
-
-
-            var  AB = !A;
-            if (!AB) {
-                AB = (D > 0);
-            }
-
-
-            var  AC = [];
-            for (var  i = 0,s = E.length; i < s; ++i) {
-                var  item = E[i];
-                if (item) {
-                    var  el = this.getEl(item.id);
-
-                    if (el) {
-                        if (!item.checkReady ||
-                            A ||
-                            el.nextSibling ||
-                            (document && document.body)) {
-
-                            var  scope = el;
-                            if (item.override) {
-                                if (item.override === true) {
-                                    scope = item.obj;
-                                } else  {
-                                    scope = item.override;
-                                }
-                            }
-
-                            item.fn.call(scope, item.obj);
-                            E[i] = null;
-                        }
-                    } else  {
-                        AC.push(item);
-                    }
-                }
-            }
-
-
-            D = (AC.length === 0) ? 0 : D - 1;
-
-            if (AB) {
-
-                this.startInterval();
-            } else  {
-                clearInterval(this._interval);
-                this._interval = null;
-            }
-
-
-            this.locked = false;
-
-            return  true;
-
-        },
-
-
-        purgeElement: function(el, AD, AE) {
-            var  AF = this.getListeners(el, AE);
-            if (AF) {
-                for (var  i = 0,s = AF.length; i < s; ++i) {
-                    var  l = AF[i];
-                    this.removeListener(el, l.type, l.fn);
-                }
-            }
-
-            if (AD && el && el.childNodes) {
-                for (i = 0,s = el.childNodes.length; i < s; ++i) {
-                    this.purgeElement(el.childNodes[i], AD, AE);
-                }
-            }
-        },
-
-
-        getListeners: function(el, AG) {
-            var  AH = [], AI;
-            if (!AG) {
-                AI = [B, C];
-            } else  if (AG == "unload") {
-                AI = [C];
-            } else  {
-                AI = [B];
-            }
-
-            for (var  j = 0; j < AI.length; ++j) {
-                var  searchList = AI[j];
-                if (searchList && searchList.length > 0) {
-                    for (var  i = 0,s = searchList.length; i < s; ++i) {
-                        var  l = searchList[i];
-                        if (l && l[this.EL] === el &&
-                            (!AG || AG === l[this.TYPE])) {
-                            AH.push({
-                                type:   l[this.TYPE],
-                                fn:     l[this.FN],
-                                obj:    l[this.OBJ],
-                                adjust: l[this.ADJ_SCOPE],
-                                index:  i
-                            });
-                        }
-                    }
-                }
-            }
-
-            return  (AH.length) ? AH : null;
-        },
-
-
-        _unload: function(e) {
-
-            var  EU = Roo.lib.Event, i, j, l, AJ, AK;
-
-            for (i = 0,AJ = C.length; i < AJ; ++i) {
-                l = C[i];
-                if (l) {
-                    var  scope = window;
-                    if (l[EU.ADJ_SCOPE]) {
-                        if (l[EU.ADJ_SCOPE] === true) {
-                            scope = l[EU.OBJ];
-                        } else  {
-                            scope = l[EU.ADJ_SCOPE];
-                        }
-                    }
-
-                    l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);
-                    C[i] = null;
-                    l = null;
-                    scope = null;
-                }
-            }
-
-
-            C = null;
-
-            if (B && B.length > 0) {
-                j = B.length;
-                while (j) {
-                    AK = j - 1;
-                    l = B[AK];
-                    if (l) {
-                        EU.removeListener(l[EU.EL], l[EU.TYPE],
-                                l[EU.FN], AK);
-                    }
-
-                    j = j - 1;
-                }
-
-                l = null;
-
-                EU.clearCache();
-            }
-
-
-            EU.doRemove(window, "unload", EU._unload);
-
-        },
-
-
-        getScroll: function() {
-            var  dd = document.documentElement, db = document.body;
-            if (dd && (dd.scrollTop || dd.scrollLeft)) {
-                return  [dd.scrollTop, dd.scrollLeft];
-            } else  if (db) {
-                return  [db.scrollTop, db.scrollLeft];
-            } else  {
-                return  [0, 0];
-            }
-        },
-
-
-        doAdd: function () {
-            if (window.addEventListener) {
-                return  function(el, AL, fn, AM) {
-                    el.addEventListener(AL, fn, (AM));
-                };
-            } else  if (window.attachEvent) {
-                return  function(el, AL, fn, AM) {
-                    el.attachEvent("on" + AL, fn);
-                };
-            } else  {
-                return  function() {
-                };
-            }
-        }(),
-
-
-        doRemove: function() {
-            if (window.removeEventListener) {
-                return  function (el, AL, fn, AM) {
-                    el.removeEventListener(AL, fn, (AM));
-                };
-            } else  if (window.detachEvent) {
-                return  function (el, AL, fn) {
-                    el.detachEvent("on" + AL, fn);
-                };
-            } else  {
-                return  function() {
-                };
-            }
-        }()
-    };
-    
-}();
-(function() {     
-   
-    var  E = Roo.lib.Event;
-    E.on = E.addListener;
-    E.un = E.removeListener;
-
-    if (document && document.body) {
-        E._load();
-    } else  {
-        E.doAdd(window, "load", E._load);
-    }
-
-    E.doAdd(window, "unload", E._unload);
-    E._tryPreloadAttach();
-})();
-
-
-
-
-
-(function() {
-    
-    Roo.lib.Ajax = {
-        request : function(A, B, cb, C, D) {
-            if(D){
-                var  hs = D.headers;
-                if(hs){
-                    for(var  h  in  hs){
-                        if(hs.hasOwnProperty(h)){
-                            this.initHeader(h, hs[h], false);
-                        }
-                    }
-                }
-                if(D.xmlData){
-                    this.initHeader('Content-Type', 'text/xml', false);
-                    A = 'POST';
-                    C = D.xmlData;
-                }
-            }
-
-            return  this.asyncRequest(A, B, cb, C);
-        },
-
-        serializeForm : function(E) {
-            if(typeof  E == 'string') {
-                E = (document.getElementById(E) || document.forms[E]);
-            }
-
-            var  el, F, G, H, I = '', J = false;
-            for (var  i = 0; i < E.elements.length; i++) {
-                el = E.elements[i];
-                H = E.elements[i].disabled;
-                F = E.elements[i].name;
-                G = E.elements[i].value;
-
-                if (!H && F){
-                    switch (el.type)
-                            {
-                        case  'select-one':
-                        case  'select-multiple':
-                            for (var  j = 0; j < el.options.length; j++) {
-                                if (el.options[j].selected) {
-                                    if (Roo.isIE) {
-                                        I += encodeURIComponent(F) + '=' + encodeURIComponent(el.options[j].attributes['value'].specified ? el.options[j].value : el.options[j].text) + '&';
-                                    }
-                                    else  {
-                                        I += encodeURIComponent(F) + '=' + encodeURIComponent(el.options[j].hasAttribute('value') ? el.options[j].value : el.options[j].text) + '&';
-                                    }
-                                }
-                            }
-                            break;
-                        case  'radio':
-                        case  'checkbox':
-                            if (el.checked) {
-                                I += encodeURIComponent(F) + '=' + encodeURIComponent(G) + '&';
-                            }
-                            break;
-                        case  'file':
-
-                        case  undefined:
-
-                        case  'reset':
-
-                        case  'button':
-
-                            break;
-                        case  'submit':
-                            if(J == false) {
-                                I += encodeURIComponent(F) + '=' + encodeURIComponent(G) + '&';
-                                J = true;
-                            }
-                            break;
-                        default:
-                            I += encodeURIComponent(F) + '=' + encodeURIComponent(G) + '&';
-                            break;
-                    }
-                }
-            }
-
-            I = I.substr(0, I.length - 1);
-            return  I;
-        },
-
-        headers:{},
-
-        hasHeaders:false,
-
-        useDefaultHeader:true,
-
-        defaultPostHeader:'application/x-www-form-urlencoded',
-
-        useDefaultXhrHeader:true,
-
-        defaultXhrHeader:'XMLHttpRequest',
-
-        hasDefaultHeaders:true,
-
-        defaultHeaders:{},
-
-        poll:{},
-
-        timeout:{},
-
-        pollInterval:50,
-
-        transactionId:0,
-
-        setProgId:function(id)
-        {
-            this.activeX.unshift(id);
-        },
-
-        setDefaultPostHeader:function(b)
-        {
-            this.useDefaultHeader = b;
-        },
-
-        setDefaultXhrHeader:function(b)
-        {
-            this.useDefaultXhrHeader = b;
-        },
-
-        setPollingInterval:function(i)
-        {
-            if (typeof  i == 'number' && isFinite(i)) {
-                this.pollInterval = i;
-            }
-        },
-
-        createXhrObject:function(K)
-        {
-            var  L,M;
-            try
-            {
-
-                M = new  XMLHttpRequest();
-
-                L = { conn:M, tId:K };
-            }
-            catch(e)
-            {
-                for (var  i = 0; i < this.activeX.length; ++i) {
-                    try
-                    {
-
-                        http = new  ActiveXObject(this.activeX[i]);
-
-                        obj = { conn:http, tId:transactionId };
-                        break;
-                    }
-                    catch(e) {
-                    }
-                }
-            }
-            finally
-            {
-                return  L;
-            }
-        },
-
-        getConnectionObject:function()
-        {
-            var  o;
-            var  N = this.transactionId;
-
-            try
-            {
-                o = this.createXhrObject(N);
-                if (o) {
-                    this.transactionId++;
-                }
-            }
-            catch(e) {
-            }
-            finally
-            {
-                return  o;
-            }
-        },
-
-        asyncRequest:function(O, P, Q, R)
-        {
-            var  o = this.getConnectionObject();
-
-            if (!o) {
-                return  null;
-            }
-            else  {
-                o.conn.open(O, P, true);
-
-                if (this.useDefaultXhrHeader) {
-                    if (!this.defaultHeaders['X-Requested-With']) {
-                        this.initHeader('X-Requested-With', this.defaultXhrHeader, true);
-                    }
-                }
-
-                if(R && this.useDefaultHeader){
-                    this.initHeader('Content-Type', this.defaultPostHeader);
-                }
-
-                 if (this.hasDefaultHeaders || this.hasHeaders) {
-                    this.setHeader(o);
-                }
-
-
-                this.handleReadyState(o, Q);
-                o.conn.send(R || null);
-
-                return  o;
-            }
-        },
-
-        handleReadyState:function(o, S)
-        {
-            var  T = this;
-
-            if (S && S.timeout) {
-                this.timeout[o.tId] = window.setTimeout(function() {
-                    T.abort(o, S, true);
-                }, S.timeout);
-            }
-
-
-            this.poll[o.tId] = window.setInterval(
-                    function() {
-                        if (o.conn && o.conn.readyState == 4) {
-                            window.clearInterval(T.poll[o.tId]);
-                            delete  T.poll[o.tId];
-
-                            if(S && S.timeout) {
-                                window.clearTimeout(T.timeout[o.tId]);
-                                delete  T.timeout[o.tId];
-                            }
-
-
-                            T.handleTransactionResponse(o, S);
-                        }
-                    }
-                    , this.pollInterval);
-        },
-
-        handleTransactionResponse:function(o, U, V)
-        {
-
-            if (!U) {
-                this.releaseObject(o);
-                return;
-            }
-
-            var  W, X;
-
-            try
-            {
-                if (o.conn.status !== undefined && o.conn.status != 0) {
-                    W = o.conn.status;
-                }
-                else  {
-                    W = 13030;
-                }
-            }
-            catch(e) {
-
-
-                httpStatus = 13030;
-            }
-
-            if (W >= 200 && W < 300) {
-                X = this.createResponseObject(o, U.argument);
-                if (U.success) {
-                    if (!U.scope) {
-                        U.success(X);
-                    }
-                    else  {
-
-
-                        U.success.apply(U.scope, [X]);
-                    }
-                }
-            }
-            else  {
-                switch (W) {
-
-                    case  12002:
-                    case  12029:
-                    case  12030:
-                    case  12031:
-                    case  12152:
-                    case  13030:
-                        X = this.createExceptionObject(o.tId, U.argument, (V ? V : false));
-                        if (U.failure) {
-                            if (!U.scope) {
-                                U.failure(X);
-                            }
-                            else  {
-                                U.failure.apply(U.scope, [X]);
-                            }
-                        }
-                        break;
-                    default:
-                        X = this.createResponseObject(o, U.argument);
-                        if (U.failure) {
-                            if (!U.scope) {
-                                U.failure(X);
-                            }
-                            else  {
-                                U.failure.apply(U.scope, [X]);
-                            }
-                        }
-                }
-            }
-
-
-            this.releaseObject(o);
-            X = null;
-        },
-
-        createResponseObject:function(o, Y)
-        {
-            var  Z = {};
-            var  a = {};
-
-            try
-            {
-                var  headerStr = o.conn.getAllResponseHeaders();
-                var  header = headerStr.split('\n');
-                for (var  i = 0; i < header.length; i++) {
-                    var  delimitPos = header[i].indexOf(':');
-                    if (delimitPos != -1) {
-                        a[header[i].substring(0, delimitPos)] = header[i].substring(delimitPos + 2);
-                    }
-                }
-            }
-            catch(e) {
-            }
-
-
-            Z.tId = o.tId;
-            Z.status = o.conn.status;
-            Z.statusText = o.conn.statusText;
-            Z.getResponseHeader = a;
-            Z.getAllResponseHeaders = headerStr;
-            Z.responseText = o.conn.responseText;
-            Z.responseXML = o.conn.responseXML;
-
-            if (typeof  Y !== undefined) {
-                Z.argument = Y;
-            }
-
-            return  Z;
-        },
-
-        createExceptionObject:function(c, d, f)
-        {
-            var  g = 0;
-            var  k = 'communication failure';
-            var  l = -1;
-            var  m = 'transaction aborted';
-
-            var  n = {};
-
-            n.tId = c;
-            if (f) {
-                n.status = l;
-                n.statusText = m;
-            }
-            else  {
-                n.status = g;
-                n.statusText = k;
-            }
-
-            if (d) {
-                n.argument = d;
-            }
-
-            return  n;
-        },
-
-        initHeader:function(p, q, r)
-        {
-            var  s = (r) ? this.defaultHeaders : this.headers;
-
-            if (s[p] === undefined) {
-                s[p] = q;
-            }
-            else  {
-
-
-                s[p] = q + "," + s[p];
-            }
-
-            if (r) {
-                this.hasDefaultHeaders = true;
-            }
-            else  {
-                this.hasHeaders = true;
-            }
-        },
-
-
-        setHeader:function(o)
-        {
-            if (this.hasDefaultHeaders) {
-                for (var  prop  in  this.defaultHeaders) {
-                    if (this.defaultHeaders.hasOwnProperty(prop)) {
-                        o.conn.setRequestHeader(prop, this.defaultHeaders[prop]);
-                    }
-                }
-            }
-
-            if (this.hasHeaders) {
-                for (var  prop  in  this.headers) {
-                    if (this.headers.hasOwnProperty(prop)) {
-                        o.conn.setRequestHeader(prop, this.headers[prop]);
-                    }
-                }
-
-                this.headers = {};
-                this.hasHeaders = false;
-            }
-        },
-
-        resetDefaultHeaders:function() {
-            delete  this.defaultHeaders;
-            this.defaultHeaders = {};
-            this.hasDefaultHeaders = false;
-        },
-
-        abort:function(o, t, u)
-        {
-            if(this.isCallInProgress(o)) {
-                o.conn.abort();
-                window.clearInterval(this.poll[o.tId]);
-                delete  this.poll[o.tId];
-                if (u) {
-                    delete  this.timeout[o.tId];
-                }
-
-
-                this.handleTransactionResponse(o, t, true);
-
-                return  true;
-            }
-            else  {
-                return  false;
-            }
-        },
-
-
-        isCallInProgress:function(o)
-        {
-            if (o && o.conn) {
-                return  o.conn.readyState != 4 && o.conn.readyState != 0;
-            }
-            else  {
-
-                return  false;
-            }
-        },
-
-
-        releaseObject:function(o)
-        {
-
-            o.conn = null;
-
-            o = null;
-        },
-
-        activeX:[
-        'MSXML2.XMLHTTP.3.0',
-        'MSXML2.XMLHTTP',
-        'Microsoft.XMLHTTP'
-        ]
-
-
-    };
-})();
-
-
-
-Roo.lib.Region = function(t, r, b, l) {
-    this.top = t;
-    this[1] = t;
-    this.right = r;
-    this.bottom = b;
-    this.left = l;
-    this[0] = l;
-};
-
-
-Roo.lib.Region.prototype = {
-    contains : function(A) {
-        return  ( A.left >= this.left &&
-                 A.right <= this.right &&
-                 A.top >= this.top &&
-                 A.bottom <= this.bottom    );
-
-    },
-
-    getArea : function() {
-        return  ( (this.bottom - this.top) * (this.right - this.left) );
-    },
-
-    intersect : function(B) {
-        var  t = Math.max(this.top, B.top);
-        var  r = Math.min(this.right, B.right);
-        var  b = Math.min(this.bottom, B.bottom);
-        var  l = Math.max(this.left, B.left);
-
-        if (b >= t && r >= l) {
-            return  new  Roo.lib.Region(t, r, b, l);
-        } else  {
-            return  null;
-        }
-    },
-    union : function(C) {
-        var  t = Math.min(this.top, C.top);
-        var  r = Math.max(this.right, C.right);
-        var  b = Math.max(this.bottom, C.bottom);
-        var  l = Math.min(this.left, C.left);
-
-        return  new  Roo.lib.Region(t, r, b, l);
-    },
-
-    adjust : function(t, l, b, r) {
-        this.top += t;
-        this.left += l;
-        this.right += r;
-        this.bottom += b;
-        return  this;
-    }
-};
-
-Roo.lib.Region.getRegion = function(el) {
-    var  p = Roo.lib.Dom.getXY(el);
-
-    var  t = p[1];
-    var  r = p[0] + el.offsetWidth;
-    var  b = p[1] + el.offsetHeight;
-    var  l = p[0];
-
-    return  new  Roo.lib.Region(t, r, b, l);
-};
-
-
-
-
-
-
-Roo.lib.Point = function(x, y) {
-    if (x  instanceof  Array) {
-        y = x[1];
-        x = x[0];
-    }
-
-    this.x = this.right = this.left = this[0] = x;
-    this.y = this.top = this.bottom = this[1] = y;
-};
-
-Roo.lib.Point.prototype = new  Roo.lib.Region();
-
-
-
-(function() {   
-
-    Roo.lib.Anim = {
-        scroll : function(el, A, B, C, cb, D) {
-            this.run(el, A, B, C, cb, D, Roo.lib.Scroll);
-        },
-
-        motion : function(el, E, F, G, cb, H) {
-            this.run(el, E, F, G, cb, H, Roo.lib.Motion);
-        },
-
-        color : function(el, I, J, K, cb, L) {
-            this.run(el, I, J, K, cb, L, Roo.lib.ColorAnim);
-        },
-
-        run : function(el, M, N, O, cb, P, Q) {
-            Q = Q || Roo.lib.AnimBase;
-            if (typeof  O == "string") {
-                O = Roo.lib.Easing[O];
-            }
-            var  R = new  Q(el, M, N, O);
-            R.animateX(function() {
-                Roo.callback(cb, P);
-            });
-            return  R;
-        }
-    };
-})();
-
-
-
-(function() {    
-    var  A;
-    
-    function  B(el) {
-        if (!A) {
-            A = new  Roo.Element.Flyweight();
-        }
-
-        A.dom = el;
-        return  A;
-    }
-
-
-    
-    
-   
-    
-    Roo.lib.AnimBase = function(el, C, D, E) {
-        if (el) {
-            this.init(el, C, D, E);
-        }
-    };
-
-    Roo.lib.AnimBase.fly = B;
-    
-    
-    
-    Roo.lib.AnimBase.prototype = {
-
-        toString: function() {
-            var  el = this.getEl();
-            var  id = el.id || el.tagName;
-            return  ("Anim " + id);
-        },
-
-        patterns: {
-            noNegatives:        /width|height|opacity|padding/i,
-            offsetAttribute:  /^((width|height)|(top|left))$/,
-            defaultUnit:        /width|height|top$|bottom$|left$|right$/i,
-            offsetUnit:         /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i
-        },
-
-
-        doMethod: function(C, D, E) {
-            return  this.method(this.currentFrame, D, E - D, this.totalFrames);
-        },
-
-
-        setAttribute: function(F, G, H) {
-            if (this.patterns.noNegatives.test(F)) {
-                G = (G > 0) ? G : 0;
-            }
-
-
-            Roo.fly(this.getEl(), '_anim').setStyle(F, G + H);
-        },
-
-
-        getAttribute: function(I) {
-            var  el = this.getEl();
-            var  J = B(el).getStyle(I);
-
-            if (J !== 'auto' && !this.patterns.offsetUnit.test(J)) {
-                return  parseFloat(J);
-            }
-
-            var  a = this.patterns.offsetAttribute.exec(I) || [];
-            var  K = !!( a[3] );
-            var  L = !!( a[2] );
-
-
-            if (L || (B(el).getStyle('position') == 'absolute' && K)) {
-                J = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
-            } else  {
-                J = 0;
-            }
-
-            return  J;
-        },
-
-
-        getDefaultUnit: function(M) {
-            if (this.patterns.defaultUnit.test(M)) {
-                return  'px';
-            }
-
-            return  '';
-        },
-
-        animateX : function(N, O) {
-            var  f = function() {
-                this.onComplete.removeListener(f);
-                if (typeof  N == "function") {
-                    N.call(O || this, this);
-                }
-            };
-            this.onComplete.addListener(f, this);
-            this.animate();
-        },
-
-
-        setRuntimeAttribute: function(P) {
-            var  Q;
-            var  R;
-            var  S = this.attributes;
-
-            this.runtimeAttributes[P] = {};
-
-            var  T = function(U) {
-                return  (typeof  U !== 'undefined');
-            };
-
-            if (!T(S[P]['to']) && !T(S[P]['by'])) {
-                return  false;
-            }
-
-
-            Q = ( T(S[P]['from']) ) ? S[P]['from'] : this.getAttribute(P);
-
-
-            if (T(S[P]['to'])) {
-                R = S[P]['to'];
-            } else  if (T(S[P]['by'])) {
-                if (Q.constructor == Array) {
-                    R = [];
-                    for (var  i = 0, len = Q.length; i < len; ++i) {
-                        R[i] = Q[i] + S[P]['by'][i];
-                    }
-                } else  {
-                    R = Q + S[P]['by'];
-                }
-            }
-
-
-            this.runtimeAttributes[P].start = Q;
-            this.runtimeAttributes[P].end = R;
-
-
-            this.runtimeAttributes[P].unit = ( T(S[P].unit) ) ? S[P]['unit'] : this.getDefaultUnit(P);
-        },
-
-
-        init: function(el, U, V, W) {
-
-            var  X = false;
-
-
-            var  Y = null;
-
-
-            var  Z = 0;
-
-
-            el = Roo.getDom(el);
-
-
-            this.attributes = U || {};
-
-
-            this.duration = V || 1;
-
-
-            this.method = W || Roo.lib.Easing.easeNone;
-
-
-            this.useSeconds = true;
-
-
-            this.currentFrame = 0;
-
-
-            this.totalFrames = Roo.lib.AnimMgr.fps;
-
-
-            this.getEl = function() {
-                return  el;
-            };
-
-
-            this.isAnimated = function() {
-                return  X;
-            };
-
-
-            this.getStartTime = function() {
-                return  Y;
-            };
-
-            this.runtimeAttributes = {};
-
-
-            this.animate = function() {
-                if (this.isAnimated()) {
-                    return  false;
-                }
-
-
-                this.currentFrame = 0;
-
-                this.totalFrames = ( this.useSeconds ) ? Math.ceil(Roo.lib.AnimMgr.fps * this.duration) : this.duration;
-
-                Roo.lib.AnimMgr.registerElement(this);
-            };
-
-
-            this.stop = function(e) {
-                if (e) {
-                    this.currentFrame = this.totalFrames;
-                    this._onTween.fire();
-                }
-
-                Roo.lib.AnimMgr.stop(this);
-            };
-
-            var  b = function() {
-                this.onStart.fire();
-
-                this.runtimeAttributes = {};
-                for (var  P  in  this.attributes) {
-                    this.setRuntimeAttribute(P);
-                }
-
-
-                X = true;
-                Z = 0;
-                Y = new  Date();
-            };
-
-
-            var  c = function() {
-                var  e = {
-                    duration: new  Date() - this.getStartTime(),
-                    currentFrame: this.currentFrame
-                };
-
-                e.toString = function() {
-                    return  (
-                            'duration: ' + e.duration +
-                            ', currentFrame: ' + e.currentFrame
-                            );
-                };
-
-                this.onTween.fire(e);
-
-                var  g = this.runtimeAttributes;
-
-                for (var  P  in  g) {
-                    this.setAttribute(P, this.doMethod(P, g[P].start, g[P].end), g[P].unit);
-                }
-
-
-                Z += 1;
-            };
-
-            var  d = function() {
-                var  e = (new  Date() - Y) / 1000 ;
-
-                var  g = {
-                    duration: e,
-                    frames: Z,
-                    fps: Z / e
-                };
-
-                g.toString = function() {
-                    return  (
-                            'duration: ' + g.duration +
-                            ', frames: ' + g.frames +
-                            ', fps: ' + g.fps
-                            );
-                };
-
-                X = false;
-                Z = 0;
-                this.onComplete.fire(g);
-            };
-
-
-            this._onStart = new  Roo.util.Event(this);
-            this.onStart = new  Roo.util.Event(this);
-            this.onTween = new  Roo.util.Event(this);
-            this._onTween = new  Roo.util.Event(this);
-            this.onComplete = new  Roo.util.Event(this);
-            this._onComplete = new  Roo.util.Event(this);
-            this._onStart.addListener(b);
-            this._onTween.addListener(c);
-            this._onComplete.addListener(d);
-        }
-    };
-})();
-
-
-
-
-Roo.lib.AnimMgr = new  function() {
-
-        var  A = null;
-
-
-        var  B = [];
-
-
-        var  C = 0;
-
-
-        this.fps = 1000;
-
-
-        this.delay = 1;
-
-
-        this.registerElement = function(F) {
-            B[B.length] = F;
-            C += 1;
-            F._onStart.fire();
-            this.start();
-        };
-
-
-        this.unRegister = function(F, G) {
-            F._onComplete.fire();
-            G = G || D(F);
-            if (G != -1) {
-                B.splice(G, 1);
-            }
-
-
-            C -= 1;
-            if (C <= 0) {
-                this.stop();
-            }
-        };
-
-
-        this.start = function() {
-            if (A === null) {
-                A = setInterval(this.run, this.delay);
-            }
-        };
-
-
-        this.stop = function(F) {
-            if (!F) {
-                clearInterval(A);
-
-                for (var  i = 0, len = B.length; i < len; ++i) {
-                    if (B[0].isAnimated()) {
-                        this.unRegister(B[0], 0);
-                    }
-                }
-
-
-                B = [];
-                A = null;
-                C = 0;
-            }
-            else  {
-                this.unRegister(F);
-            }
-        };
-
-
-        this.run = function() {
-            for (var  i = 0, len = B.length; i < len; ++i) {
-                var  tween = B[i];
-                if (!tween || !tween.isAnimated()) {
-                    continue;
-                }
-
-                if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null)
-                {
-                    tween.currentFrame += 1;
-
-                    if (tween.useSeconds) {
-                        E(tween);
-                    }
-
-                    tween._onTween.fire();
-                }
-                else  {
-                    Roo.lib.AnimMgr.stop(tween, i);
-                }
-            }
-        };
-
-        var  D = function(F) {
-            for (var  i = 0, len = B.length; i < len; ++i) {
-                if (B[i] == F) {
-                    return  i;
-                }
-            }
-            return  -1;
-        };
-
-
-        var  E = function(F) {
-            var  G = F.totalFrames;
-            var  H = F.currentFrame;
-            var  I = (F.currentFrame * F.duration * 1000 / F.totalFrames);
-            var  J = (new  Date() - F.getStartTime());
-            var  K = 0;
-
-            if (J < F.duration * 1000) {
-                K = Math.round((J / I - 1) * F.currentFrame);
-            } else  {
-                K = G - (H + 1);
-            }
-            if (K > 0 && isFinite(K)) {
-                if (F.currentFrame + K >= G) {
-                    K = G - (H + 1);
-                }
-
-
-                F.currentFrame += K;
-            }
-        };
-    };
-
-
-Roo.lib.Bezier = new  function() {
-
-        this.getPosition = function(A, t) {
-            var  n = A.length;
-            var  B = [];
-
-            for (var  i = 0; i < n; ++i) {
-                B[i] = [A[i][0], A[i][1]];
-            }
-
-            for (var  j = 1; j < n; ++j) {
-                for (i = 0; i < n - j; ++i) {
-                    B[i][0] = (1 - t) * B[i][0] + t * B[parseInt(i + 1, 10)][0];
-                    B[i][1] = (1 - t) * B[i][1] + t * B[parseInt(i + 1, 10)][1];
-                }
-            }
-
-            return  [ B[0][0], B[0][1] ];
-
-        };
-    };
-
-
-(function() {
-
-    Roo.lib.ColorAnim = function(el, D, E, F) {
-        Roo.lib.ColorAnim.superclass.constructor.call(this, el, D, E, F);
-    };
-
-    Roo.extend(Roo.lib.ColorAnim, Roo.lib.AnimBase);
-
-    var  A = Roo.lib.AnimBase.fly;
-    var  Y = Roo.lib;
-    var  B = Y.ColorAnim.superclass;
-    var  C = Y.ColorAnim.prototype;
-
-    C.toString = function() {
-        var  el = this.getEl();
-        var  id = el.id || el.tagName;
-        return  ("ColorAnim " + id);
-    };
-
-    C.patterns.color = /color$/i;
-    C.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
-    C.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
-    C.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
-    C.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
-
-
-    C.parseColor = function(s) {
-        if (s.length == 3) {
-            return  s;
-        }
-
-        var  c = this.patterns.hex.exec(s);
-        if (c && c.length == 4) {
-            return  [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ];
-        }
-
-
-        c = this.patterns.rgb.exec(s);
-        if (c && c.length == 4) {
-            return  [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ];
-        }
-
-
-        c = this.patterns.hex3.exec(s);
-        if (c && c.length == 4) {
-            return  [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ];
-        }
-
-        return  null;
-    };
-    
-    C.getAttribute = function(D) {
-        var  el = this.getEl();
-        if (this.patterns.color.test(D)) {
-            var  val = A(el).getStyle(D);
-
-            if (this.patterns.transparent.test(val)) {
-                var  parent = el.parentNode;
-                val = A(parent).getStyle(D);
-
-                while (parent && this.patterns.transparent.test(val)) {
-                    parent = parent.parentNode;
-                    val = A(parent).getStyle(D);
-                    if (parent.tagName.toUpperCase() == 'HTML') {
-                        val = '#fff';
-                    }
-                }
-            }
-        } else  {
-            val = B.getAttribute.call(this, D);
-        }
-
-        return  val;
-    };
-    C.getAttribute = function(D) {
-        var  el = this.getEl();
-        if (this.patterns.color.test(D)) {
-            var  val = A(el).getStyle(D);
-
-            if (this.patterns.transparent.test(val)) {
-                var  parent = el.parentNode;
-                val = A(parent).getStyle(D);
-
-                while (parent && this.patterns.transparent.test(val)) {
-                    parent = parent.parentNode;
-                    val = A(parent).getStyle(D);
-                    if (parent.tagName.toUpperCase() == 'HTML') {
-                        val = '#fff';
-                    }
-                }
-            }
-        } else  {
-            val = B.getAttribute.call(this, D);
-        }
-
-        return  val;
-    };
-
-    C.doMethod = function(D, E, F) {
-        var  G;
-
-        if (this.patterns.color.test(D)) {
-            G = [];
-            for (var  i = 0, len = E.length; i < len; ++i) {
-                G[i] = B.doMethod.call(this, D, E[i], F[i]);
-            }
-
-
-            G = 'rgb(' + Math.floor(G[0]) + ',' + Math.floor(G[1]) + ',' + Math.floor(G[2]) + ')';
-        }
-        else  {
-            G = B.doMethod.call(this, D, E, F);
-        }
-
-        return  G;
-    };
-
-    C.setRuntimeAttribute = function(D) {
-        B.setRuntimeAttribute.call(this, D);
-
-        if (this.patterns.color.test(D)) {
-            var  attributes = this.attributes;
-            var  start = this.parseColor(this.runtimeAttributes[D].start);
-            var  end = this.parseColor(this.runtimeAttributes[D].end);
-
-            if (typeof  attributes[D]['to'] === 'undefined' && typeof  attributes[D]['by'] !== 'undefined') {
-                end = this.parseColor(attributes[D].by);
-
-                for (var  i = 0, len = start.length; i < len; ++i) {
-                    end[i] = start[i] + end[i];
-                }
-            }
-
-
-            this.runtimeAttributes[D].start = start;
-            this.runtimeAttributes[D].end = end;
-        }
-    };
-})();
-
-
-
-
-Roo.lib.Easing = {
-
-
-    easeNone: function (t, b, c, d) {
-        return  c * t / d + b;
-    },
-
-
-    easeIn: function (t, b, c, d) {
-        return  c * (t /= d) * t + b;
-    },
-
-
-    easeOut: function (t, b, c, d) {
-        return  -c * (t /= d) * (t - 2) + b;
-    },
-
-
-    easeBoth: function (t, b, c, d) {
-        if ((t /= d / 2) < 1) {
-            return  c / 2 * t * t + b;
-        }
-
-        return  -c / 2 * ((--t) * (t - 2) - 1) + b;
-    },
-
-
-    easeInStrong: function (t, b, c, d) {
-        return  c * (t /= d) * t * t * t + b;
-    },
-
-
-    easeOutStrong: function (t, b, c, d) {
-        return  -c * ((t = t / d - 1) * t * t * t - 1) + b;
-    },
-
-
-    easeBothStrong: function (t, b, c, d) {
-        if ((t /= d / 2) < 1) {
-            return  c / 2 * t * t * t * t + b;
-        }
-
-        return  -c / 2 * ((t -= 2) * t * t * t - 2) + b;
-    },
-
-
-
-    elasticIn: function (t, b, c, d, a, p) {
-        if (t == 0) {
-            return  b;
-        }
-        if ((t /= d) == 1) {
-            return  b + c;
-        }
-        if (!p) {
-            p = d * .3;
-        }
-
-        if (!a || a < Math.abs(c)) {
-            a = c;
-            var  s = p / 4;
-        }
-        else  {
-            var  s = p / (2 * Math.PI) * Math.asin(c / a);
-        }
-
-        return  -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
-    },
-
-
-    elasticOut: function (t, b, c, d, a, p) {
-        if (t == 0) {
-            return  b;
-        }
-        if ((t /= d) == 1) {
-            return  b + c;
-        }
-        if (!p) {
-            p = d * .3;
-        }
-
-        if (!a || a < Math.abs(c)) {
-            a = c;
-            var  s = p / 4;
-        }
-        else  {
-            var  s = p / (2 * Math.PI) * Math.asin(c / a);
-        }
-
-        return  a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
-    },
-
-
-    elasticBoth: function (t, b, c, d, a, p) {
-        if (t == 0) {
-            return  b;
-        }
-
-        if ((t /= d / 2) == 2) {
-            return  b + c;
-        }
-
-        if (!p) {
-            p = d * (.3 * 1.5);
-        }
-
-        if (!a || a < Math.abs(c)) {
-            a = c;
-            var  s = p / 4;
-        }
-        else  {
-            var  s = p / (2 * Math.PI) * Math.asin(c / a);
-        }
-
-        if (t < 1) {
-            return  -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
-                          Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
-        }
-        return  a * Math.pow(2, -10 * (t -= 1)) *
-               Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
-    },
-
-
-
-    backIn: function (t, b, c, d, s) {
-        if (typeof  s == 'undefined') {
-            s = 1.70158;
-        }
-        return  c * (t /= d) * t * ((s + 1) * t - s) + b;
-    },
-
-
-    backOut: function (t, b, c, d, s) {
-        if (typeof  s == 'undefined') {
-            s = 1.70158;
-        }
-        return  c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
-    },
-
-
-    backBoth: function (t, b, c, d, s) {
-        if (typeof  s == 'undefined') {
-            s = 1.70158;
-        }
-
-        if ((t /= d / 2 ) < 1) {
-            return  c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
-        }
-        return  c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
-    },
-
-
-    bounceIn: function (t, b, c, d) {
-        return  c - Roo.lib.Easing.bounceOut(d - t, 0, c, d) + b;
-    },
-
-
-    bounceOut: function (t, b, c, d) {
-        if ((t /= d) < (1 / 2.75)) {
-            return  c * (7.5625 * t * t) + b;
-        } else  if (t < (2 / 2.75)) {
-            return  c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
-        } else  if (t < (2.5 / 2.75)) {
-            return  c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
-        }
-        return  c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
-    },
-
-
-    bounceBoth: function (t, b, c, d) {
-        if (t < d / 2) {
-            return  Roo.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
-        }
-        return  Roo.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
-    }
-};
-
-
-    (function() {
-        Roo.lib.Motion = function(el, E, F, G) {
-            if (el) {
-                Roo.lib.Motion.superclass.constructor.call(this, el, E, F, G);
-            }
-        };
-
-        Roo.extend(Roo.lib.Motion, Roo.lib.ColorAnim);
-
-
-        var  Y = Roo.lib;
-        var  A = Y.Motion.superclass;
-        var  B = Y.Motion.prototype;
-
-        B.toString = function() {
-            var  el = this.getEl();
-            var  id = el.id || el.tagName;
-            return  ("Motion " + id);
-        };
-
-        B.patterns.points = /^points$/i;
-
-        B.setAttribute = function(E, F, G) {
-            if (this.patterns.points.test(E)) {
-                G = G || 'px';
-                A.setAttribute.call(this, 'left', F[0], G);
-                A.setAttribute.call(this, 'top', F[1], G);
-            } else  {
-                A.setAttribute.call(this, E, F, G);
-            }
-        };
-
-        B.getAttribute = function(E) {
-            if (this.patterns.points.test(E)) {
-                var  val = [
-                        A.getAttribute.call(this, 'left'),
-                        A.getAttribute.call(this, 'top')
-                        ];
-            } else  {
-                val = A.getAttribute.call(this, E);
-            }
-
-            return  val;
-        };
-
-        B.doMethod = function(E, F, G) {
-            var  H = null;
-
-            if (this.patterns.points.test(E)) {
-                var  t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100;
-                H = Y.Bezier.getPosition(this.runtimeAttributes[E], t);
-            } else  {
-                H = A.doMethod.call(this, E, F, G);
-            }
-            return  H;
-        };
-
-        B.setRuntimeAttribute = function(E) {
-            if (this.patterns.points.test(E)) {
-                var  el = this.getEl();
-                var  attributes = this.attributes;
-                var  start;
-                var  control = attributes['points']['control'] || [];
-                var  end;
-                var  i, len;
-
-                if (control.length > 0 && !(control[0]  instanceof  Array)) {
-                    control = [control];
-                } else  {
-                    var  tmp = [];
-                    for (i = 0,len = control.length; i < len; ++i) {
-                        tmp[i] = control[i];
-                    }
-
-                    control = tmp;
-                }
-
-
-                Roo.fly(el).position();
-
-                if (D(attributes['points']['from'])) {
-                    Roo.lib.Dom.setXY(el, attributes['points']['from']);
-                }
-                else  {
-                    Roo.lib.Dom.setXY(el, Roo.lib.Dom.getXY(el));
-                }
-
-
-                start = this.getAttribute('points');
-
-
-                if (D(attributes['points']['to'])) {
-                    end = C.call(this, attributes['points']['to'], start);
-
-                    var  pageXY = Roo.lib.Dom.getXY(this.getEl());
-                    for (i = 0,len = control.length; i < len; ++i) {
-                        control[i] = C.call(this, control[i], start);
-                    }
-
-
-                } else  if (D(attributes['points']['by'])) {
-                    end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ];
-
-                    for (i = 0,len = control.length; i < len; ++i) {
-                        control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
-                    }
-                }
-
-
-                this.runtimeAttributes[E] = [start];
-
-                if (control.length > 0) {
-                    this.runtimeAttributes[E] = this.runtimeAttributes[E].concat(control);
-                }
-
-
-                this.runtimeAttributes[E][this.runtimeAttributes[E].length] = end;
-            }
-            else  {
-                A.setRuntimeAttribute.call(this, E);
-            }
-        };
-
-        var  C = function(E, F) {
-            var  G = Roo.lib.Dom.getXY(this.getEl());
-            E = [ E[0] - G[0] + F[0], E[1] - G[1] + F[1] ];
-
-            return  E;
-        };
-
-        var  D = function(E) {
-            return  (typeof  E !== 'undefined');
-        };
-    })();
-
-
-
-    (function() {
-        Roo.lib.Scroll = function(el, C, D, E) {
-            if (el) {
-                Roo.lib.Scroll.superclass.constructor.call(this, el, C, D, E);
-            }
-        };
-
-        Roo.extend(Roo.lib.Scroll, Roo.lib.ColorAnim);
-
-
-        var  Y = Roo.lib;
-        var  A = Y.Scroll.superclass;
-        var  B = Y.Scroll.prototype;
-
-        B.toString = function() {
-            var  el = this.getEl();
-            var  id = el.id || el.tagName;
-            return  ("Scroll " + id);
-        };
-
-        B.doMethod = function(C, D, E) {
-            var  F = null;
-
-            if (C == 'scroll') {
-                F = [
-                        this.method(this.currentFrame, D[0], E[0] - D[0], this.totalFrames),
-                        this.method(this.currentFrame, D[1], E[1] - D[1], this.totalFrames)
-                        ];
-
-            } else  {
-                F = A.doMethod.call(this, C, D, E);
-            }
-            return  F;
-        };
-
-        B.getAttribute = function(C) {
-            var  D = null;
-            var  el = this.getEl();
-
-            if (C == 'scroll') {
-                D = [ el.scrollLeft, el.scrollTop ];
-            } else  {
-                D = A.getAttribute.call(this, C);
-            }
-
-            return  D;
-        };
-
-        B.setAttribute = function(C, D, E) {
-            var  el = this.getEl();
-
-            if (C == 'scroll') {
-                el.scrollLeft = D[0];
-                el.scrollTop = D[1];
-            } else  {
-                A.setAttribute.call(this, C, D, E);
-            }
-        };
-    })();
-
-
-
-
-
-
-Roo.DomHelper = function(){
-    var  A = null;
-    var  B = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;
-    var  C = /^table|tbody|tr|td$/i;
-    var  D = {};
-    
-    
-
-    var  E = function(o){
-        if(typeof  o == 'string'){
-            return  o;
-        }
-        var  b = "";
-        if(!o.tag){
-            o.tag = "div";
-        }
-
-        b += "<" + o.tag;
-        for(var  attr  in  o){
-            if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof  o[attr] == "function") continue;
-            if(attr == "style"){
-                var  s = o["style"];
-                if(typeof  s == "function"){
-                    s = s.call();
-                }
-                if(typeof  s == "string"){
-                    b += ' style="' + s + '"';
-                }else  if(typeof  s == "object"){
-                    b += ' style="';
-                    for(var  key  in  s){
-                        if(typeof  s[key] != "function"){
-                            b += key + ":" + s[key] + ";";
-                        }
-                    }
-
-                    b += '"';
-                }
-            }else {
-                if(attr == "cls"){
-                    b += ' class="' + o["cls"] + '"';
-                }else  if(attr == "htmlFor"){
-                    b += ' for="' + o["htmlFor"] + '"';
-                }else {
-                    b += " " + attr + '="' + o[attr] + '"';
-                }
-            }
-        }
-        if(B.test(o.tag)){
-            b += "/>";
-        }else {
-            b += ">";
-            var  cn = o.children || o.cn;
-            if(cn){
-                
-                if((cn  instanceof  Array) || (Roo.isSafari && typeof(cn.join) == "function")){
-                    for(var  i = 0, len = cn.length; i < len; i++) {
-                        b += E(cn[i], b);
-                    }
-                }else {
-                    b += E(cn, b);
-                }
-            }
-            if(o.html){
-                b += o.html;
-            }
-
-            b += "</" + o.tag + ">";
-        }
-        return  b;
-    };
-
-    
-    
-
-    var  F = function(o, M){
-         
-        
-        var  ns = false;
-        if (o.ns && o.ns != 'html') {
-               
-            if (o.xmlns && typeof(D[o.ns]) == 'undefined') {
-                D[o.ns] = o.xmlns;
-                ns = o.xmlns;
-            }
-            if (typeof(D[o.ns]) == 'undefined') {
-                console.log("Trying to create namespace element " + o.ns + ", however no xmlns was sent to builder previously");
-            }
-
-            ns = D[o.ns];
-        }
-        
-        
-        if (typeof(o) == 'string') {
-            return  M.appendChild(document.createTextNode(o));
-        }
-
-        o.tag = o.tag || div;
-        if (o.ns && Roo.isIE) {
-            ns = false;
-            o.tag = o.ns + ':' + o.tag;
-            
-        }
-        var  el = ns ? document.createElementNS( ns, o.tag||'div') :  document.createElement(o.tag||'div');
-        var  N = el.setAttribute ? true : false; 
-        for(var  attr  in  o){
-            
-            if(attr == "tag" || attr == "ns" ||attr == "xmlns" ||attr == "children" || attr == "cn" || attr == "html" || 
-                    attr == "style" || typeof  o[attr] == "function") continue;
-                    
-            if(attr=="cls" && Roo.isIE){
-                el.className = o["cls"];
-            }else {
-                if(N) el.setAttribute(attr=="cls" ? 'class' : attr, o[attr]);
-                else  el[attr] = o[attr];
-            }
-        }
-
-        Roo.DomHelper.applyStyles(el, o.style);
-        var  cn = o.children || o.cn;
-        if(cn){
-            
-             if((cn  instanceof  Array) || (Roo.isSafari && typeof(cn.join) == "function")){
-                for(var  i = 0, len = cn.length; i < len; i++) {
-                    F(cn[i], el);
-                }
-            }else {
-                F(cn, el);
-            }
-        }
-        if(o.html){
-            el.innerHTML = o.html;
-        }
-        if(M){
-           M.appendChild(el);
-        }
-        return  el;
-    };
-
-    var  G = function(M, s, h, e){
-        A.innerHTML = [s, h, e].join('');
-        var  i = -1, el = A;
-        while(++i < M){
-            el = el.firstChild;
-        }
-        return  el;
-    };
-
-    
-    var  ts = '<table>',
-        te = '</table>',
-        H = ts+'<tbody>',
-        I = '</tbody>'+te,
-        J = H + '<tr>',
-        K = '</tr>'+I;
-
-    
-
-    var  L = function(M, N, el, O){
-        if(!A){
-            A = document.createElement('div');
-        }
-        var  P;
-        var  Q = null;
-        if(M == 'td'){
-            if(N == 'afterbegin' || N == 'beforeend'){ 
-                return;
-            }
-            if(N == 'beforebegin'){
-                Q = el;
-                el = el.parentNode;
-            } else {
-                Q = el.nextSibling;
-                el = el.parentNode;
-            }
-
-            P = G(4, J, O, K);
-        }
-        else  if(M == 'tr'){
-            if(N == 'beforebegin'){
-                Q = el;
-                el = el.parentNode;
-                P = G(3, H, O, I);
-            } else  if(N == 'afterend'){
-                Q = el.nextSibling;
-                el = el.parentNode;
-                P = G(3, H, O, I);
-            } else { 
-                if(N == 'afterbegin'){
-                    Q = el.firstChild;
-                }
-
-                P = G(4, J, O, K);
-            }
-        } else  if(M == 'tbody'){
-            if(N == 'beforebegin'){
-                Q = el;
-                el = el.parentNode;
-                P = G(2, ts, O, te);
-            } else  if(N == 'afterend'){
-                Q = el.nextSibling;
-                el = el.parentNode;
-                P = G(2, ts, O, te);
-            } else {
-                if(N == 'afterbegin'){
-                    Q = el.firstChild;
-                }
-
-                P = G(3, H, O, I);
-            }
-        } else { 
-            if(N == 'beforebegin' || N == 'afterend'){ 
-                return;
-            }
-            if(N == 'afterbegin'){
-                Q = el.firstChild;
-            }
-
-            P = G(2, ts, O, te);
-        }
-
-        el.insertBefore(P, Q);
-        return  P;
-    };
-
-    return  {
-    
-
-    useDom : false,
-
-    
-
-    markup : function(o){
-        return  E(o);
-    },
-
-    
-
-    applyStyles : function(el, c){
-        if(c){
-           el = Roo.fly(el);
-           if(typeof  c == "string"){
-               var  re = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
-               var  matches;
-               while ((matches = re.exec(c)) != null){
-                   el.setStyle(matches[1], matches[2]);
-               }
-           }else  if (typeof  c == "object"){
-               for (var  style  in  c){
-                  el.setStyle(style, c[style]);
-               }
-           }else  if (typeof  c == "function"){
-                Roo.DomHelper.applyStyles(el, c.call());
-           }
-        }
-    },
-
-    
-
-    insertHtml : function(d, el, e){
-        d = d.toLowerCase();
-        if(el.insertAdjacentHTML){
-            if(C.test(el.tagName)){
-                var  rs;
-                if(rs = L(el.tagName.toLowerCase(), d, el, e)){
-                    return  rs;
-                }
-            }
-            switch(d){
-                case  "beforebegin":
-                    el.insertAdjacentHTML('BeforeBegin', e);
-                    return  el.previousSibling;
-                case  "afterbegin":
-                    el.insertAdjacentHTML('AfterBegin', e);
-                    return  el.firstChild;
-                case  "beforeend":
-                    el.insertAdjacentHTML('BeforeEnd', e);
-                    return  el.lastChild;
-                case  "afterend":
-                    el.insertAdjacentHTML('AfterEnd', e);
-                    return  el.nextSibling;
-            }
-            throw  'Illegal insertion point -> "' + d + '"';
-        }
-        var  f = el.ownerDocument.createRange();
-        var  g;
-        switch(d){
-             case  "beforebegin":
-                f.setStartBefore(el);
-                g = f.createContextualFragment(e);
-                el.parentNode.insertBefore(g, el);
-                return  el.previousSibling;
-             case  "afterbegin":
-                if(el.firstChild){
-                    f.setStartBefore(el.firstChild);
-                    g = f.createContextualFragment(e);
-                    el.insertBefore(g, el.firstChild);
-                    return  el.firstChild;
-                }else {
-                    el.innerHTML = e;
-                    return  el.firstChild;
-                }
-            case  "beforeend":
-                if(el.lastChild){
-                    f.setStartAfter(el.lastChild);
-                    g = f.createContextualFragment(e);
-                    el.appendChild(g);
-                    return  el.lastChild;
-                }else {
-                    el.innerHTML = e;
-                    return  el.lastChild;
-                }
-            case  "afterend":
-                f.setStartAfter(el);
-                g = f.createContextualFragment(e);
-                el.parentNode.insertBefore(g, el.nextSibling);
-                return  el.nextSibling;
-            }
-            throw  'Illegal insertion point -> "' + d + '"';
-    },
-
-    
-
-    insertBefore : function(el, o, h){
-        return  this.doInsert(el, o, h, "beforeBegin");
-    },
-
-    
-
-    insertAfter : function(el, o, j){
-        return  this.doInsert(el, o, j, "afterEnd", "nextSibling");
-    },
-
-    
-
-    insertFirst : function(el, o, k){
-        return  this.doInsert(el, o, k, "afterBegin");
-    },
-
-    
-    doInsert : function(el, o, l, m, n){
-        el = Roo.getDom(el);
-        var  p;
-        if(this.useDom || o.ns){
-            p = F(o, null);
-            el.parentNode.insertBefore(p, n ? el[n] : el);
-        }else {
-            var  e = E(o);
-            p = this.insertHtml(m, el, e);
-        }
-        return  l ? Roo.get(p, true) : p;
-    },
-
-    
-
-    append : function(el, o, q){
-        el = Roo.getDom(el);
-        var  r;
-        if(this.useDom || o.ns){
-            r = F(o, null);
-            el.appendChild(r);
-        }else {
-            var  e = E(o);
-            r = this.insertHtml("beforeEnd", el, e);
-        }
-        return  q ? Roo.get(r, true) : r;
-    },
-
-    
-
-    overwrite : function(el, o, t){
-        el = Roo.getDom(el);
-        if (o.ns) {
-          
-            while (el.childNodes.length) {
-                el.removeChild(el.firstChild);
-            }
-
-            F(o, el);
-        } else  {
-            el.innerHTML = E(o);   
-        }
-        
-        return  t ? Roo.get(el.firstChild, true) : el.firstChild;
-    },
-
-    
-
-    createTemplate : function(o){
-        var  u = E(o);
-        return  new  Roo.Template(u);
-    }
-    };
-}();
-
-
-
-
-
-Roo.Template = function(A){
-    if(A  instanceof  Array){
-        A = A.join("");
-    }else  if(arguments.length > 1){
-        A = Array.prototype.join.call(arguments, "");
-    }
-
-    
-
-    this.html = A;
-    
-};
-Roo.Template.prototype = {
-    
-
-    applyTemplate : function(B){
-        if(this.compiled){
-            return  this.compiled(B);
-        }
-        var  C = this.disableFormats !== true;
-        var  fm = Roo.util.Format, D = this;
-        var  fn = function(m, E, F, G){
-            if(F && C){
-                if(F.substr(0, 5) == "this."){
-                    return  D.call(F.substr(5), B[E], B);
-                }else {
-                    if(G){
-                        
-                        
-                        
-                        var  re = /^\s*['"](.*)["']\s*$/;
-                        G = G.split(',');
-                        for(var  i = 0, len = G.length; i < len; i++){
-                            G[i] = G[i].replace(re, "$1");
-                        }
-
-                        G = [B[E]].concat(G);
-                    }else {
-                        G = [B[E]];
-                    }
-                    return  fm[F].apply(fm, G);
-                }
-            }else {
-                return  B[E] !== undefined ? B[E] : "";
-            }
-        };
-        return  this.html.replace(this.re, fn);
-    },
-    
-    
-
-    set : function(E, F){
-        this.html = E;
-        this.compiled = null;
-        if(F){
-            this.compile();
-        }
-        return  this;
-    },
-    
-    
-
-    disableFormats : false,
-    
-    
-
-    re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
-    
-    
-
-    compile : function(){
-        var  fm = Roo.util.Format;
-        var  G = this.disableFormats !== true;
-        var  H = Roo.isGecko ? "+" : ",";
-        var  fn = function(m, J, K, L){
-            if(K && G){
-                L = L ? ',' + L : "";
-                if(K.substr(0, 5) != "this."){
-                    K = "fm." + K + '(';
-                }else {
-                    K = 'this.call("'+ K.substr(5) + '", ';
-                    L = ", values";
-                }
-            }else {
-                L= ''; K = "(values['" + J + "'] == undefined ? '' : ";
-            }
-            return  "'"+ H + K + "values['" + J + "']" + L + ")"+H+"'";
-        };
-        var  I;
-        
-        if(Roo.isGecko){
-            I = "this.compiled = function(values){ return '" +
-                   this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) +
-                    "';};";
-        }else {
-            I = ["this.compiled = function(values){ return ['"];
-            I.push(this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn));
-            I.push("'].join('');};");
-            I = I.join('');
-        }
-
-        
-
-        eval(I);
-        return  this;
-    },
-    
-    
-    call : function(J, K, L){
-        return  this[J](K, L);
-    },
-    
-    
-
-    insertFirst: function(el, M, N){
-        return  this.doInsert('afterBegin', el, M, N);
-    },
-
-    
-
-    insertBefore: function(el, O, P){
-        return  this.doInsert('beforeBegin', el, O, P);
-    },
-
-    
-
-    insertAfter : function(el, Q, R){
-        return  this.doInsert('afterEnd', el, Q, R);
-    },
-    
-    
-
-    append : function(el, S, T){
-        return  this.doInsert('beforeEnd', el, S, T);
-    },
-
-    doInsert : function(U, el, V, W){
-        el = Roo.getDom(el);
-        var  X = Roo.DomHelper.insertHtml(U, el, this.applyTemplate(V));
-        return  W ? Roo.get(X, true) : X;
-    },
-
-    
-
-    overwrite : function(el, Y, Z){
-        el = Roo.getDom(el);
-        el.innerHTML = this.applyTemplate(Y);
-        return  Z ? Roo.get(el.firstChild, true) : el.firstChild;
-    }
-};
-
-
-Roo.Template.prototype.apply = Roo.Template.prototype.applyTemplate;
-
-
-Roo.DomHelper.Template = Roo.Template;
-
-
-
-Roo.Template.from = function(el){
-    el = Roo.getDom(el);
-    return  new  Roo.Template(el.value || el.innerHTML);
-};
+window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var B=0;var ua=navigator.userAgent.toLowerCase();var C=document.compatMode=="CSS1Compat",D=ua.indexOf("opera")>-1,E=(/webkit|khtml/).test(ua),F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=!E&&ua.indexOf("gecko")>-1,I=F&&!C,J=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),K=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),L=(ua.indexOf("linux")!=-1),M=window.location.href.toLowerCase().indexOf("https")===0;if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}
+Roo.apply(Roo,{isStrict:C,isSecure:M,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var N={};for(var b in o){var parts=b.split('@');if(parts[1]){var s=parts[0];if(!N[s]){N[s]=Roo.select(s);}
+N[s].on(parts[1],o[b]);}}
+N=null;},id:function(el,O){O=O||"roo-gen";el=Roo.getDom(el);var id=O+(++B);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,P){if(typeof sp=='object'){P=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;}
+sb.override=function(o){Roo.override(sb,o);};sbp.override=io;Roo.override(sb,P);return sb;};}(),override:function(P,Q){if(Q){var p=P.prototype;for(var method in Q){p[method]=Q[method];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},factory:function(c,ns){if(!c.xtype||(!ns&&!c.xns)||(c.xns===false)){return c;}
+ns=c.xns?c.xns:ns;if(c.constructor==ns[c.xtype]){return c;}if(ns[c.xtype]){if(Roo.debug)console.log("Roo.Factory("+c.xtype+")");var ret=new ns[c.xtype](c);ret.xns=false;return ret;}
+c.xns=false;return c;},urlEncode:function(o){if(!o){return "";}var R=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=='undefined'){R.push(k,"=&");}else if(type!="function"&&type!="object"){R.push(k,"=",encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,len=ov.length;i<len;i++){R.push(k,"=",encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {R.push(k,"=&");}}}
+R.pop();return R.join("");},urlDecode:function(S,T){if(!S||!S.length){return {};}var U={};var V=S.split('&');var W,X,Y;for(var i=0,len=V.length;i<len;i++){W=V[i].split('=');X=decodeURIComponent(W[0]);Y=decodeURIComponent(W[1]);if(T!==true){if(typeof U[X]=="undefined"){U[X]=Y;}else if(typeof U[X]=="string"){U[X]=[U[X]];U[X].push(Y);}else {U[X].push(Y);}}else {U[X]=Y;}}return U;},each:function(Z,fn,f){if(typeof Z.length=="undefined"||typeof Z=="string"){Z=[Z];}for(var i=0,len=Z.length;i<len;i++){if(fn.call(f||Z[i],Z[i],i,Z)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else {r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,g,h,n){if(typeof cb=="function"){if(n){cb.defer(n,g,h||[]);}else {cb.apply(g,h||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,q){if(typeof v!='number'){return q;}return v;},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=='function'){as.purgeListeners();}if(typeof as.destroy=='function'){as.destroy();}}}},type:function(o){if(o===undefined||o===null){return false;}if(o.htmlElement){return 'element';}var t=typeof o;if(t=='object'&&o.nodeName){switch(o.nodeType){case 1:return 'element';case 3:return (/\S/).test(o.nodeValue)?'textnode':'whitespace';}}if(t=='object'||t=='function'){switch(o.constructor){case Array:return 'array';case RegExp:return 'regexp';}if(typeof o.length=='number'&&typeof o.item=='function'){return 'nodelist';}}return t;},isEmpty:function(v,u){return v===null||v===undefined||(!u?v==='':false);},isOpera:D,isSafari:E,isIE:F,isIE7:G,isGecko:H,isBorderBox:I,isWindows:J,isLinux:L,isMac:K,useShims:((F&&!G)||(H&&K))});})();Roo.namespace("Roo","Roo.util","Roo.grid","Roo.dd","Roo.tree","Roo.data","Roo.form","Roo.menu","Roo.state","Roo.lib","Roo.layout","Roo.app","Roo.ux");
+(function(){if(Roo.isIE){function A(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",A);}
+window.attachEvent("onunload",A);}})();Roo.apply(Function.prototype,{createCallback:function(){var B=arguments;var C=this;return function(){return C.apply(window,B);};},createDelegate:function(D,E,F){var G=this;return function(){var H=E||arguments;if(F===true){H=Array.prototype.slice.call(arguments,0);H=H.concat(E);}else if(typeof F=="number"){H=Array.prototype.slice.call(arguments,0);var applyArgs=[F,0].concat(E);Array.prototype.splice.apply(H,applyArgs);}return G.apply(D||window,H);};},defer:function(H,I,J,K){var fn=this.createDelegate(I,J,K);if(H){return setTimeout(fn,H);}
+fn();return 0;},createSequence:function(L,M){if(typeof L!="function"){return this;}var N=this;return function(){var O=N.apply(this||window,arguments);L.apply(M||this||window,arguments);return O;};},createInterceptor:function(O,P){if(typeof O!="function"){return this;}var Q=this;return function(){O.target=this;O.method=Q;if(O.apply(P||this||window,arguments)===false){return;}return Q.apply(this||window,arguments);};}});
+Roo.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1");},leftPad:function(B,C,ch){var D=new String(B);if(ch===null||ch===undefined||ch===''){ch=" ";}while(D.length<C){D=ch+D;}return D;},format:function(E){var F=Array.prototype.slice.call(arguments,1);return E.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(F[i]);});}});String.prototype.toggle=function(G,H){return this==G?H:G;};
+Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
+Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(B){var C=this.length>>>0;if(typeof B!="function")throw new TypeError();var D=new Array(C);var E=arguments[1];for(var i=0;i<C;i++){if(i in this)D[i]=B.call(E,this[i],i,this);}return D;}});
+Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(B){if(Date.formatFunctions[B]==null){Date.createNewFormat(B);}var C=Date.formatFunctions[B];return this[C]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(D){var E="format"+Date.formatFunctions.count++;Date.formatFunctions[D]=E;var F="Date.prototype."+E+" = function(){return ";var G=false;var ch='';for(var i=0;i<D.length;++i){ch=D.charAt(i);if(!G&&ch=="\\"){G=true;}else if(G){G=false;F+="'"+String.escape(ch)+"' + ";}else {F+=Date.getFormatCode(ch);}}eval(F.substring(0,F.length-3)+";}");};Date.getFormatCode=function(H){switch(H){case "d":return "String.leftPad(this.getDate(), 2, '0') + ";case "D":return "Date.dayNames[this.getDay()].substring(0, 3) + ";case "j":return "this.getDate() + ";case "l":return "Date.dayNames[this.getDay()] + ";case "S":return "this.getSuffix() + ";case "w":return "this.getDay() + ";case "z":return "this.getDayOfYear() + ";case "W":return "this.getWeekOfYear() + ";case "F":return "Date.monthNames[this.getMonth()] + ";case "m":return "String.leftPad(this.getMonth() + 1, 2, '0') + ";case "M":return "Date.monthNames[this.getMonth()].substring(0, 3) + ";case "n":return "(this.getMonth() + 1) + ";case "t":return "this.getDaysInMonth() + ";case "L":return "(this.isLeapYear() ? 1 : 0) + ";case "Y":return "this.getFullYear() + ";case "y":return "('' + this.getFullYear()).substring(2, 4) + ";case "a":return "(this.getHours() < 12 ? 'am' : 'pm') + ";case "A":return "(this.getHours() < 12 ? 'AM' : 'PM') + ";case "g":return "((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";case "G":return "this.getHours() + ";case "h":return "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";case "H":return "String.leftPad(this.getHours(), 2, '0') + ";case "i":return "String.leftPad(this.getMinutes(), 2, '0') + ";case "s":return "String.leftPad(this.getSeconds(), 2, '0') + ";case "O":return "this.getGMTOffset() + ";case "T":return "this.getTimezone() + ";case "Z":return "(this.getTimezoneOffset() * -60) + ";default:return "'"+String.escape(H)+"' + ";}};Date.parseDate=function(I,J){if(Date.parseFunctions[J]==null){Date.createParser(J);}var K=Date.parseFunctions[J];return Date[K](I);};Date.createParser=function(L){var M="parse"+Date.parseFunctions.count++;var N=Date.parseRegexes.length;var O=1;Date.parseFunctions[L]=M;var P="Date."+M+" = function(input){\n"+"var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"+"var d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"var results = input.match(Date.parseRegexes["+N+"]);\n"+"if (results && results.length > 0) {";var Q="";var R=false;var ch='';for(var i=0;i<L.length;++i){ch=L.charAt(i);if(!R&&ch=="\\"){R=true;}else if(R){R=false;Q+=String.escape(ch);}else {var obj=Date.formatCodeToRegex(ch,O);O+=obj.g;Q+=obj.s;if(obj.g&&obj.c){P+=obj.c;}}}
+P+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"+"{v = new Date(y, m, d, h, i, s);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m);}\n"+"else if (y >= 0)\n"+"{v = new Date(y);}\n"+"}return (v && (z || o))?\n"+"    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+"        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";Date.parseRegexes[N]=new RegExp("^"+Q+"$");eval(P);};Date.formatCodeToRegex=function(S,T){switch(S){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "l":return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case "S":return {g:0,c:null,s:"(?:st|nd|rd|th)"};case "w":return {g:0,c:null,s:"\\d"};case "z":return {g:0,c:null,s:"(?:\\d{1,3})"};case "W":return {g:0,c:null,s:"(?:\\d{2})"};case "F":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{2})"};case "t":return {g:0,c:null,s:"\\d{1,2}"};case "L":return {g:0,c:null,s:"(?:1|0)"};case "Y":return {g:1,c:"y = parseInt(results["+T+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+T+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case "a":return {g:1,c:"if (results["+T+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case "A":return {g:1,c:"if (results["+T+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case "g":case "G":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "O":return {g:1,c:["o = results[",T,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n","    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+\-]\\d{4})"};case "T":return {g:0,c:null,s:"[A-Z]{1,4}"};case "Z":return {g:1,c:"z = results["+T+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+\-]?\\d{1,5})"};default:return {g:0,c:null,s:String.escape(S)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1");};Date.prototype.getGMTOffset=function(){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+String.leftPad(this.getTimezoneOffset()%60,2,"0");};Date.prototype.getDayOfYear=function(){var U=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i<this.getMonth();++i){U+=Date.daysInMonth[i];}return U+this.getDate()-1;};Date.prototype.getWeekOfYear=function(){var V=this.getDayOfYear()+(4-this.getDay());var W=new Date(this.getFullYear(),0,1);var X=(7-W.getDay()+4);return String.leftPad(((V-X)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var Y=this.getFullYear();return ((Y&3)==0&&(Y%100||(Y%400==0&&Y)));};Date.prototype.getFirstDayOfMonth=function(){var Z=(this.getDay()-(this.getDate()-1))%7;return (Z<0)?(Z+7):Z;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return (a<0)?(a+7):a;};Date.prototype.getFirstDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),1);};Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth());};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.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";}};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.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};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.clearTime=function(b){if(b){return this.clone().clearTime();}
+this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(c){if(c<=-1){var n=Math.ceil(-c);var back_year=Math.ceil(n/12);var month=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-back_year);return Date.brokenSetMonth.call(this,month);}else {return Date.brokenSetMonth.apply(this,arguments);}};}
+Date.MILLI="ms";Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(e,f){var d=this.clone();if(!e||f===0)return d;switch(e.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+f);break;case Date.SECOND:d.setSeconds(this.getSeconds()+f);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+f);break;case Date.HOUR:d.setHours(this.getHours()+f);break;case Date.DAY:d.setDate(this.getDate()+f);break;case Date.MONTH:var a=this.getDate();if(a>28){a=Math.min(a,this.getFirstDateOfMonth().add('mo',f).getLastDateOfMonth().getDate());}
+d.setDate(a);d.setMonth(this.getMonth()+f);break;case Date.YEAR:d.setFullYear(this.getFullYear()+f);break;}return d;};
+Roo.lib.Dom={getViewWidth:function(A){return A?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(B){return B?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var C=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(C,this.getViewportHeight());},getDocumentWidth:function(){var D=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(D,this.getViewportWidth());},getViewportHeight:function(){var E=self.innerHeight;var F=document.compatMode;if((F||Roo.isIE)&&!Roo.isOpera){E=(F=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return E;},getViewportWidth:function(){var G=self.innerWidth;var H=document.compatMode;if(H||Roo.isIE){G=(H=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return G;},isAncestor:function(p,c){p=Roo.getDom(p);c=Roo.getDom(c);if(!p||!c){return false;}if(p.contains&&!Roo.isSafari){return p.contains(c);}else if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16);}else {var parent=c.parentNode;while(parent){if(parent==p){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=="HTML"){return false;}
+parent=parent.parentNode;}return false;}},getRegion:function(el){return Roo.lib.Region.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,I,bd=document.body;el=Roo.getDom(el);var J=Roo.lib.AnimBase.fly;if(el.getBoundingClientRect){b=el.getBoundingClientRect();I=J(document).getScroll();return [b.left+I.left,b.top+I.top];}var x=0,y=0;p=el;var K=J(el).getStyle("position")=="absolute";while(p){x+=p.offsetLeft;y+=p.offsetTop;if(!K&&J(p).getStyle("position")=="absolute"){K=true;}if(Roo.isGecko){pe=J(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle('overflow')!='visible'){x+=bl;y+=bt;}}
+p=p.offsetParent;}if(Roo.isSafari&&K){x-=bd.offsetLeft;y-=bd.offsetTop;}if(Roo.isGecko&&!K){var dbd=J(bd);x+=parseInt(dbd.getStyle("borderLeftWidth"),10)||0;y+=parseInt(dbd.getStyle("borderTopWidth"),10)||0;}
+p=el.parentNode;while(p&&p!=bd){if(!Roo.isOpera||(p.tagName!='TR'&&J(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop;}
+p=p.parentNode;}return [x,y];},setXY:function(el,xy){el=Roo.fly(el,'_setXY');el.position();var L=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=L.left+"px";}if(xy[1]!==false){el.dom.style.top=L.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}};
+Roo.lib.Event=function(){var A=false;var B=[];var C=[];var D=0;var E=[];var F=0;var G=null;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(h,k,m,n){E.push({id:h,fn:k,obj:m,override:n,checkReady:false});D=this.POLL_RETRYS;this.startInterval();},addListener:function(el,o,fn){el=Roo.getDom(el);if(!el||!fn){return false;}if("unload"==o){C[C.length]=[el,o,fn];return true;}var p=function(e){return fn(Roo.lib.Event.getEvent(e));};var li=[el,o,fn,p];var q=B.length;B[q]=li;this.doAdd(el,o,p,false);return true;},removeListener:function(el,r,fn){var i,s;el=Roo.getDom(el);if(!fn){return this.purgeElement(el,false,r);}if("unload"==r){for(i=0,s=C.length;i<s;i++){var li=C[i];if(li&&li[0]==el&&li[1]==r&&li[2]==fn){C.splice(i,1);return true;}}return false;}var u=null;var v=arguments[3];if("undefined"==typeof v){v=this._getCacheIndex(el,r,fn);}if(v>=0){u=B[v];}if(!el||!u){return false;}
+this.doRemove(el,r,u[this.WFN],false);delete B[v][this.WFN];delete B[v][this.FN];B.splice(v,1);return true;},getTarget:function(ev,w){ev=ev.browserEvent||ev;var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(z){if(Roo.isSafari&&z&&3==z.nodeType){return z.parentNode;}else {return z;}},getPageX:function(ev){ev=ev.browserEvent||ev;var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(Roo.isIE){x+=this.getScroll()[1];}}return x;},getPageY:function(ev){ev=ev.browserEvent||ev;var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(Roo.isIE){y+=this.getScroll()[0];}}return y;},getXY:function(ev){ev=ev.browserEvent||ev;return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}return this.resolveTextNode(t);},getTime:function(ev){ev=ev.browserEvent||ev;if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){ev=ev.browserEvent||ev;if(ev.stopPropagation){ev.stopPropagation();}else {ev.cancelBubble=true;}},preventDefault:function(ev){ev=ev.browserEvent||ev;if(ev.preventDefault){ev.preventDefault();}else {ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
+c=c.caller;}}return ev;},getCharCode:function(ev){ev=ev.browserEvent||ev;return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,AA,fn){for(var i=0,s=B.length;i<s;++i){var li=B[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==AA){return i;}}return -1;},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){A=true;var EU=Roo.lib.Event;if(Roo.isIE){EU.doRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+this.locked=true;var AB=!A;if(!AB){AB=(D>0);}var AC=[];for(var i=0,s=E.length;i<s;++i){var item=E[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||A||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else {scope=item.override;}}
+item.fn.call(scope,item.obj);E[i]=null;}}else {AC.push(item);}}}
+D=(AC.length===0)?0:D-1;if(AB){this.startInterval();}else {clearInterval(this._interval);this._interval=null;}
+this.locked=false;return true;},purgeElement:function(el,AD,AE){var AF=this.getListeners(el,AE);if(AF){for(var i=0,s=AF.length;i<s;++i){var l=AF[i];this.removeListener(el,l.type,l.fn);}}if(AD&&el&&el.childNodes){for(i=0,s=el.childNodes.length;i<s;++i){this.purgeElement(el.childNodes[i],AD,AE);}}},getListeners:function(el,AG){var AH=[],AI;if(!AG){AI=[B,C];}else if(AG=="unload"){AI=[C];}else {AI=[B];}for(var j=0;j<AI.length;++j){var searchList=AI[j];if(searchList&&searchList.length>0){for(var i=0,s=searchList.length;i<s;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!AG||AG===l[this.TYPE])){AH.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}return (AH.length)?AH:null;},_unload:function(e){var EU=Roo.lib.Event,i,j,l,AJ,AK;for(i=0,AJ=C.length;i<AJ;++i){l=C[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else {scope=l[EU.ADJ_SCOPE];}}
+l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);C[i]=null;l=null;scope=null;}}
+C=null;if(B&&B.length>0){j=B.length;while(j){AK=j-1;l=B[AK];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],AK);}
+j=j-1;}
+l=null;EU.clearCache();}
+EU.doRemove(window,"unload",EU._unload);},getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else if(db){return [db.scrollTop,db.scrollLeft];}else {return [0,0];}},doAdd:function(){if(window.addEventListener){return function(el,AL,fn,AM){el.addEventListener(AL,fn,(AM));};}else if(window.attachEvent){return function(el,AL,fn,AM){el.attachEvent("on"+AL,fn);};}else {return function(){};}}(),doRemove:function(){if(window.removeEventListener){return function(el,AL,fn,AM){el.removeEventListener(AL,fn,(AM));};}else if(window.detachEvent){return function(el,AL,fn){el.detachEvent("on"+AL,fn);};}else {return function(){};}}()};}();(function(){var E=Roo.lib.Event;E.on=E.addListener;E.un=E.removeListener;if(document&&document.body){E._load();}else {E.doAdd(window,"load",E._load);}
+E.doAdd(window,"unload",E._unload);E._tryPreloadAttach();})();
+(function(){Roo.lib.Ajax={request:function(A,B,cb,C,D){if(D){var hs=D.headers;if(hs){for(var h in hs){if(hs.hasOwnProperty(h)){this.initHeader(h,hs[h],false);}}}if(D.xmlData){this.initHeader('Content-Type','text/xml',false);A='POST';C=D.xmlData;}}return this.asyncRequest(A,B,cb,C);},serializeForm:function(E){if(typeof E=='string'){E=(document.getElementById(E)||document.forms[E]);}var el,F,G,H,I='',J=false;for(var i=0;i<E.elements.length;i++){el=E.elements[i];H=E.elements[i].disabled;F=E.elements[i].name;G=E.elements[i].value;if(!H&&F){switch(el.type){case 'select-one':case 'select-multiple':for(var j=0;j<el.options.length;j++){if(el.options[j].selected){if(Roo.isIE){I+=encodeURIComponent(F)+'='+encodeURIComponent(el.options[j].attributes['value'].specified?el.options[j].value:el.options[j].text)+'&';}else {I+=encodeURIComponent(F)+'='+encodeURIComponent(el.options[j].hasAttribute('value')?el.options[j].value:el.options[j].text)+'&';}}}break;case 'radio':case 'checkbox':if(el.checked){I+=encodeURIComponent(F)+'='+encodeURIComponent(G)+'&';}break;case 'file':case undefined:case 'reset':case 'button':break;case 'submit':if(J==false){I+=encodeURIComponent(F)+'='+encodeURIComponent(G)+'&';J=true;}break;default:I+=encodeURIComponent(F)+'='+encodeURIComponent(G)+'&';break;}}}
+I=I.substr(0,I.length-1);return I;},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:'application/x-www-form-urlencoded',useDefaultXhrHeader:true,defaultXhrHeader:'XMLHttpRequest',hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(id){this.activeX.unshift(id);},setDefaultPostHeader:function(b){this.useDefaultHeader=b;},setDefaultXhrHeader:function(b){this.useDefaultXhrHeader=b;},setPollingInterval:function(i){if(typeof i=='number'&&isFinite(i)){this.pollInterval=i;}},createXhrObject:function(K){var L,M;try{M=new XMLHttpRequest();L={conn:M,tId:K};}catch(e){for(var i=0;i<this.activeX.length;++i){try{http=new ActiveXObject(this.activeX[i]);obj={conn:http,tId:transactionId};break;}catch(e){}}}finally{return L;}},getConnectionObject:function(){var o;var N=this.transactionId;try{o=this.createXhrObject(N);if(o){this.transactionId++;}}catch(e){}finally{return o;}},asyncRequest:function(O,P,Q,R){var o=this.getConnectionObject();if(!o){return null;}else {o.conn.open(O,P,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders['X-Requested-With']){this.initHeader('X-Requested-With',this.defaultXhrHeader,true);}}if(R&&this.useDefaultHeader){this.initHeader('Content-Type',this.defaultPostHeader);}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(o);}
+this.handleReadyState(o,Q);o.conn.send(R||null);return o;}},handleReadyState:function(o,S){var T=this;if(S&&S.timeout){this.timeout[o.tId]=window.setTimeout(function(){T.abort(o,S,true);},S.timeout);}
+this.poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(T.poll[o.tId]);delete T.poll[o.tId];if(S&&S.timeout){window.clearTimeout(T.timeout[o.tId]);delete T.timeout[o.tId];}
+T.handleTransactionResponse(o,S);}},this.pollInterval);},handleTransactionResponse:function(o,U,V){if(!U){this.releaseObject(o);return;}var W,X;try{if(o.conn.status!==undefined&&o.conn.status!=0){W=o.conn.status;}else {W=13030;}}catch(e){httpStatus=13030;}if(W>=200&&W<300){X=this.createResponseObject(o,U.argument);if(U.success){if(!U.scope){U.success(X);}else {U.success.apply(U.scope,[X]);}}}else {switch(W){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:X=this.createExceptionObject(o.tId,U.argument,(V?V:false));if(U.failure){if(!U.scope){U.failure(X);}else {U.failure.apply(U.scope,[X]);}}break;default:X=this.createResponseObject(o,U.argument);if(U.failure){if(!U.scope){U.failure(X);}else {U.failure.apply(U.scope,[X]);}}}}
+this.releaseObject(o);X=null;},createResponseObject:function(o,Y){var Z={};var a={};try{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){a[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}catch(e){}
+Z.tId=o.tId;Z.status=o.conn.status;Z.statusText=o.conn.statusText;Z.getResponseHeader=a;Z.getAllResponseHeaders=headerStr;Z.responseText=o.conn.responseText;Z.responseXML=o.conn.responseXML;if(typeof Y!==undefined){Z.argument=Y;}return Z;},createExceptionObject:function(c,d,f){var g=0;var k='communication failure';var l=-1;var m='transaction aborted';var n={};n.tId=c;if(f){n.status=l;n.statusText=m;}else {n.status=g;n.statusText=k;}if(d){n.argument=d;}return n;},initHeader:function(p,q,r){var s=(r)?this.defaultHeaders:this.headers;if(s[p]===undefined){s[p]=q;}else {s[p]=q+","+s[p];}if(r){this.hasDefaultHeaders=true;}else {this.hasHeaders=true;}},setHeader:function(o){if(this.hasDefaultHeaders){for(var prop in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this.defaultHeaders[prop]);}}}if(this.hasHeaders){for(var prop in this.headers){if(this.headers.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this.headers[prop]);}}
+this.headers={};this.hasHeaders=false;}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false;},abort:function(o,t,u){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this.poll[o.tId]);delete this.poll[o.tId];if(u){delete this.timeout[o.tId];}
+this.handleTransactionResponse(o,t,true);return true;}else {return false;}},isCallInProgress:function(o){if(o&&o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}else {return false;}},releaseObject:function(o){o.conn=null;o=null;},activeX:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP']};})();
+Roo.lib.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};Roo.lib.Region.prototype={contains:function(A){return (A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);},getArea:function(){return ((this.bottom-this.top)*(this.right-this.left));},intersect:function(B){var t=Math.max(this.top,B.top);var r=Math.min(this.right,B.right);var b=Math.min(this.bottom,B.bottom);var l=Math.max(this.left,B.left);if(b>=t&&r>=l){return new Roo.lib.Region(t,r,b,l);}else {return null;}},union:function(C){var t=Math.min(this.top,C.top);var r=Math.max(this.right,C.right);var b=Math.max(this.bottom,C.bottom);var l=Math.min(this.left,C.left);return new Roo.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Roo.lib.Region.getRegion=function(el){var p=Roo.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Roo.lib.Region(t,r,b,l);};
+Roo.lib.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}
+this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};Roo.lib.Point.prototype=new Roo.lib.Region();
+(function(){Roo.lib.Anim={scroll:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Scroll);},motion:function(el,E,F,G,cb,H){this.run(el,E,F,G,cb,H,Roo.lib.Motion);},color:function(el,I,J,K,cb,L){this.run(el,I,J,K,cb,L,Roo.lib.ColorAnim);},run:function(el,M,N,O,cb,P,Q){Q=Q||Roo.lib.AnimBase;if(typeof O=="string"){O=Roo.lib.Easing[O];}var R=new Q(el,M,N,O);R.animateX(function(){Roo.callback(cb,P);});return R;}};})();
+(function(){var A;function B(el){if(!A){A=new Roo.Element.Flyweight();}
+A.dom=el;return A;}
+Roo.lib.AnimBase=function(el,C,D,E){if(el){this.init(el,C,D,E);}};Roo.lib.AnimBase.fly=B;Roo.lib.AnimBase.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return ("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,D,E){return this.method(this.currentFrame,D,E-D,this.totalFrames);},setAttribute:function(F,G,H){if(this.patterns.noNegatives.test(F)){G=(G>0)?G:0;}
+Roo.fly(this.getEl(),'_anim').setStyle(F,G+H);},getAttribute:function(I){var el=this.getEl();var J=B(el).getStyle(I);if(J!=='auto'&&!this.patterns.offsetUnit.test(J)){return parseFloat(J);}var a=this.patterns.offsetAttribute.exec(I)||[];var K=!!(a[3]);var L=!!(a[2]);if(L||(B(el).getStyle('position')=='absolute'&&K)){J=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else {J=0;}return J;},getDefaultUnit:function(M){if(this.patterns.defaultUnit.test(M)){return 'px';}return '';},animateX:function(N,O){var f=function(){this.onComplete.removeListener(f);if(typeof N=="function"){N.call(O||this,this);}};this.onComplete.addListener(f,this);this.animate();},setRuntimeAttribute:function(P){var Q;var R;var S=this.attributes;this.runtimeAttributes[P]={};var T=function(U){return (typeof U!=='undefined');};if(!T(S[P]['to'])&&!T(S[P]['by'])){return false;}
+Q=(T(S[P]['from']))?S[P]['from']:this.getAttribute(P);if(T(S[P]['to'])){R=S[P]['to'];}else if(T(S[P]['by'])){if(Q.constructor==Array){R=[];for(var i=0,len=Q.length;i<len;++i){R[i]=Q[i]+S[P]['by'][i];}}else {R=Q+S[P]['by'];}}
+this.runtimeAttributes[P].start=Q;this.runtimeAttributes[P].end=R;this.runtimeAttributes[P].unit=(T(S[P].unit))?S[P]['unit']:this.getDefaultUnit(P);},init:function(el,U,V,W){var X=false;var Y=null;var Z=0;el=Roo.getDom(el);this.attributes=U||{};this.duration=V||1;this.method=W||Roo.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Roo.lib.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return X;};this.getStartTime=function(){return Y;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
+this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Roo.lib.AnimMgr.fps*this.duration):this.duration;Roo.lib.AnimMgr.registerElement(this);};this.stop=function(e){if(e){this.currentFrame=this.totalFrames;this._onTween.fire();}
+Roo.lib.AnimMgr.stop(this);};var b=function(){this.onStart.fire();this.runtimeAttributes={};for(var P in this.attributes){this.setRuntimeAttribute(P);}
+X=true;Z=0;Y=new Date();};var c=function(){var e={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};e.toString=function(){return ('duration: '+e.duration+', currentFrame: '+e.currentFrame);};this.onTween.fire(e);var g=this.runtimeAttributes;for(var P in g){this.setAttribute(P,this.doMethod(P,g[P].start,g[P].end),g[P].unit);}
+Z+=1;};var d=function(){var e=(new Date()-Y)/1000;var g={duration:e,frames:Z,fps:Z/e};g.toString=function(){return ('duration: '+g.duration+', frames: '+g.frames+', fps: '+g.fps);};X=false;Z=0;this.onComplete.fire(g);};this._onStart=new Roo.util.Event(this);this.onStart=new Roo.util.Event(this);this.onTween=new Roo.util.Event(this);this._onTween=new Roo.util.Event(this);this.onComplete=new Roo.util.Event(this);this._onComplete=new Roo.util.Event(this);this._onStart.addListener(b);this._onTween.addListener(c);this._onComplete.addListener(d);}};})();
+Roo.lib.AnimMgr=new function(){var A=null;var B=[];var C=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;C+=1;F._onStart.fire();this.start();};this.unRegister=function(F,G){F._onComplete.fire();G=G||D(F);if(G!=-1){B.splice(G,1);}
+C-=1;if(C<=0){this.stop();}};this.start=function(){if(A===null){A=setInterval(this.run,this.delay);}};this.stop=function(F){if(!F){clearInterval(A);for(var i=0,len=B.length;i<len;++i){if(B[0].isAnimated()){this.unRegister(B[0],0);}}
+B=[];A=null;C=0;}else {this.unRegister(F);}};this.run=function(){for(var i=0,len=B.length;i<len;++i){var tween=B[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){E(tween);}
+tween._onTween.fire();}else {Roo.lib.AnimMgr.stop(tween,i);}}};var D=function(F){for(var i=0,len=B.length;i<len;++i){if(B[i]==F){return i;}}return -1;};var E=function(F){var G=F.totalFrames;var H=F.currentFrame;var I=(F.currentFrame*F.duration*1000/F.totalFrames);var J=(new Date()-F.getStartTime());var K=0;if(J<F.duration*1000){K=Math.round((J/I-1)*F.currentFrame);}else {K=G-(H+1);}if(K>0&&isFinite(K)){if(F.currentFrame+K>=G){K=G-(H+1);}
+F.currentFrame+=K;}};};
+Roo.lib.Bezier=new function(){this.getPosition=function(A,t){var n=A.length;var B=[];for(var i=0;i<n;++i){B[i]=[A[i][0],A[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){B[i][0]=(1-t)*B[i][0]+t*B[parseInt(i+1,10)][0];B[i][1]=(1-t)*B[i][1]+t*B[parseInt(i+1,10)][1];}}return [B[0][0],B[0][1]];};};
+(function(){Roo.lib.ColorAnim=function(el,D,E,F){Roo.lib.ColorAnim.superclass.constructor.call(this,el,D,E,F);};Roo.extend(Roo.lib.ColorAnim,Roo.lib.AnimBase);var A=Roo.lib.AnimBase.fly;var Y=Roo.lib;var B=Y.ColorAnim.superclass;var C=Y.ColorAnim.prototype;C.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return ("ColorAnim "+id);};C.patterns.color=/color$/i;C.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;C.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;C.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;C.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;C.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return [parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
+c=this.patterns.rgb.exec(s);if(c&&c.length==4){return [parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
+c=this.patterns.hex3.exec(s);if(c&&c.length==4){return [parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};C.getAttribute=function(D){var el=this.getEl();if(this.patterns.color.test(D)){var val=A(el).getStyle(D);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=A(parent).getStyle(D);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=A(parent).getStyle(D);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else {val=B.getAttribute.call(this,D);}return val;};C.getAttribute=function(D){var el=this.getEl();if(this.patterns.color.test(D)){var val=A(el).getStyle(D);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=A(parent).getStyle(D);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=A(parent).getStyle(D);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else {val=B.getAttribute.call(this,D);}return val;};C.doMethod=function(D,E,F){var G;if(this.patterns.color.test(D)){G=[];for(var i=0,len=E.length;i<len;++i){G[i]=B.doMethod.call(this,D,E[i],F[i]);}
+G='rgb('+Math.floor(G[0])+','+Math.floor(G[1])+','+Math.floor(G[2])+')';}else {G=B.doMethod.call(this,D,E,F);}return G;};C.setRuntimeAttribute=function(D){B.setRuntimeAttribute.call(this,D);if(this.patterns.color.test(D)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[D].start);var end=this.parseColor(this.runtimeAttributes[D].end);if(typeof attributes[D]['to']==='undefined'&&typeof attributes[D]['by']!=='undefined'){end=this.parseColor(attributes[D].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
+this.runtimeAttributes[D].start=start;this.runtimeAttributes[D].end=end;}};})();
+Roo.lib.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else {var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else {var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else {var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-Roo.lib.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return Roo.lib.Easing.bounceIn(t*2,0,c,d)*.5+b;}return Roo.lib.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};
+(function(){Roo.lib.Motion=function(el,E,F,G){if(el){Roo.lib.Motion.superclass.constructor.call(this,el,E,F,G);}};Roo.extend(Roo.lib.Motion,Roo.lib.ColorAnim);var Y=Roo.lib;var A=Y.Motion.superclass;var B=Y.Motion.prototype;B.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return ("Motion "+id);};B.patterns.points=/^points$/i;B.setAttribute=function(E,F,G){if(this.patterns.points.test(E)){G=G||'px';A.setAttribute.call(this,'left',F[0],G);A.setAttribute.call(this,'top',F[1],G);}else {A.setAttribute.call(this,E,F,G);}};B.getAttribute=function(E){if(this.patterns.points.test(E)){var val=[A.getAttribute.call(this,'left'),A.getAttribute.call(this,'top')];}else {val=A.getAttribute.call(this,E);}return val;};B.doMethod=function(E,F,G){var H=null;if(this.patterns.points.test(E)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;H=Y.Bezier.getPosition(this.runtimeAttributes[E],t);}else {H=A.doMethod.call(this,E,F,G);}return H;};B.setRuntimeAttribute=function(E){if(this.patterns.points.test(E)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0] instanceof Array)){control=[control];}else {var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
+control=tmp;}
+Roo.fly(el).position();if(D(attributes['points']['from'])){Roo.lib.Dom.setXY(el,attributes['points']['from']);}else {Roo.lib.Dom.setXY(el,Roo.lib.Dom.getXY(el));}
+start=this.getAttribute('points');if(D(attributes['points']['to'])){end=C.call(this,attributes['points']['to'],start);var pageXY=Roo.lib.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=C.call(this,control[i],start);}}else if(D(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
+this.runtimeAttributes[E]=[start];if(control.length>0){this.runtimeAttributes[E]=this.runtimeAttributes[E].concat(control);}
+this.runtimeAttributes[E][this.runtimeAttributes[E].length]=end;}else {A.setRuntimeAttribute.call(this,E);}};var C=function(E,F){var G=Roo.lib.Dom.getXY(this.getEl());E=[E[0]-G[0]+F[0],E[1]-G[1]+F[1]];return E;};var D=function(E){return (typeof E!=='undefined');};})();
+(function(){Roo.lib.Scroll=function(el,C,D,E){if(el){Roo.lib.Scroll.superclass.constructor.call(this,el,C,D,E);}};Roo.extend(Roo.lib.Scroll,Roo.lib.ColorAnim);var Y=Roo.lib;var A=Y.Scroll.superclass;var B=Y.Scroll.prototype;B.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return ("Scroll "+id);};B.doMethod=function(C,D,E){var F=null;if(C=='scroll'){F=[this.method(this.currentFrame,D[0],E[0]-D[0],this.totalFrames),this.method(this.currentFrame,D[1],E[1]-D[1],this.totalFrames)];}else {F=A.doMethod.call(this,C,D,E);}return F;};B.getAttribute=function(C){var D=null;var el=this.getEl();if(C=='scroll'){D=[el.scrollLeft,el.scrollTop];}else {D=A.getAttribute.call(this,C);}return D;};B.setAttribute=function(C,D,E){var el=this.getEl();if(C=='scroll'){el.scrollLeft=D[0];el.scrollTop=D[1];}else {A.setAttribute.call(this,C,D,E);}};})();
+Roo.DomHelper=function(){var A=null;var B=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var C=/^table|tbody|tr|td$/i;var D={};var E=function(o){if(typeof o=='string'){return o;}var b="";if(!o.tag){o.tag="div";}
+b+="<"+o.tag;for(var attr in o){if(attr=="tag"||attr=="children"||attr=="cn"||attr=="html"||typeof o[attr]=="function")continue;if(attr=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=' style="'+s+'"';}else if(typeof s=="object"){b+=' style="';for(var key in s){if(typeof s[key]!="function"){b+=key+":"+s[key]+";";}}
+b+='"';}}else {if(attr=="cls"){b+=' class="'+o["cls"]+'"';}else if(attr=="htmlFor"){b+=' for="'+o["htmlFor"]+'"';}else {b+=" "+attr+'="'+o[attr]+'"';}}}if(B.test(o.tag)){b+="/>";}else {b+=">";var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,len=cn.length;i<len;i++){b+=E(cn[i],b);}}else {b+=E(cn,b);}}if(o.html){b+=o.html;}
+b+="</"+o.tag+">";}return b;};var F=function(o,M){var ns=false;if(o.ns&&o.ns!='html'){if(o.xmlns&&typeof(D[o.ns])=='undefined'){D[o.ns]=o.xmlns;ns=o.xmlns;}if(typeof(D[o.ns])=='undefined'){console.log("Trying to create namespace element "+o.ns+", however no xmlns was sent to builder previously");}
+ns=D[o.ns];}if(typeof(o)=='string'){return M.appendChild(document.createTextNode(o));}
+o.tag=o.tag||div;if(o.ns&&Roo.isIE){ns=false;o.tag=o.ns+':'+o.tag;}var el=ns?document.createElementNS(ns,o.tag||'div'):document.createElement(o.tag||'div');var N=el.setAttribute?true:false;for(var attr in o){if(attr=="tag"||attr=="ns"||attr=="xmlns"||attr=="children"||attr=="cn"||attr=="html"||attr=="style"||typeof o[attr]=="function")continue;if(attr=="cls"&&Roo.isIE){el.className=o["cls"];}else {if(N)el.setAttribute(attr=="cls"?'class':attr,o[attr]);else el[attr]=o[attr];}}
+Roo.DomHelper.applyStyles(el,o.style);var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,len=cn.length;i<len;i++){F(cn[i],el);}}else {F(cn,el);}}if(o.html){el.innerHTML=o.html;}if(M){M.appendChild(el);}return el;};var G=function(M,s,h,e){A.innerHTML=[s,h,e].join('');var i=-1,el=A;while(++i<M){el=el.firstChild;}return el;};var ts='<table>',te='</table>',H=ts+'<tbody>',I='</tbody>'+te,J=H+'<tr>',K='</tr>'+I;var L=function(M,N,el,O){if(!A){A=document.createElement('div');}var P;var Q=null;if(M=='td'){if(N=='afterbegin'||N=='beforeend'){return;}if(N=='beforebegin'){Q=el;el=el.parentNode;}else {Q=el.nextSibling;el=el.parentNode;}
+P=G(4,J,O,K);}else if(M=='tr'){if(N=='beforebegin'){Q=el;el=el.parentNode;P=G(3,H,O,I);}else if(N=='afterend'){Q=el.nextSibling;el=el.parentNode;P=G(3,H,O,I);}else {if(N=='afterbegin'){Q=el.firstChild;}
+P=G(4,J,O,K);}}else if(M=='tbody'){if(N=='beforebegin'){Q=el;el=el.parentNode;P=G(2,ts,O,te);}else if(N=='afterend'){Q=el.nextSibling;el=el.parentNode;P=G(2,ts,O,te);}else {if(N=='afterbegin'){Q=el.firstChild;}
+P=G(3,H,O,I);}}else {if(N=='beforebegin'||N=='afterend'){return;}if(N=='afterbegin'){Q=el.firstChild;}
+P=G(2,ts,O,te);}
+el.insertBefore(P,Q);return P;};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,c){if(c){el=Roo.fly(el);if(typeof c=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var matches;while((matches=re.exec(c))!=null){el.setStyle(matches[1],matches[2]);}}else if(typeof c=="object"){for(var style in c){el.setStyle(style,c[style]);}}else if(typeof c=="function"){Roo.DomHelper.applyStyles(el,c.call());}}},insertHtml:function(d,el,e){d=d.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),d,el,e)){return rs;}}switch(d){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',e);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',e);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',e);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',e);return el.nextSibling;}throw 'Illegal insertion point -> "'+d+'"';}var f=el.ownerDocument.createRange();var g;switch(d){case "beforebegin":f.setStartBefore(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el);return el.previousSibling;case "afterbegin":if(el.firstChild){f.setStartBefore(el.firstChild);g=f.createContextualFragment(e);el.insertBefore(g,el.firstChild);return el.firstChild;}else {el.innerHTML=e;return el.firstChild;}case "beforeend":if(el.lastChild){f.setStartAfter(el.lastChild);g=f.createContextualFragment(e);el.appendChild(g);return el.lastChild;}else {el.innerHTML=e;return el.lastChild;}case "afterend":f.setStartAfter(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+d+'"';},insertBefore:function(el,o,h){return this.doInsert(el,o,h,"beforeBegin");},insertAfter:function(el,o,j){return this.doInsert(el,o,j,"afterEnd","nextSibling");},insertFirst:function(el,o,k){return this.doInsert(el,o,k,"afterBegin");},doInsert:function(el,o,l,m,n){el=Roo.getDom(el);var p;if(this.useDom||o.ns){p=F(o,null);el.parentNode.insertBefore(p,n?el[n]:el);}else {var e=E(o);p=this.insertHtml(m,el,e);}return l?Roo.get(p,true):p;},append:function(el,o,q){el=Roo.getDom(el);var r;if(this.useDom||o.ns){r=F(o,null);el.appendChild(r);}else {var e=E(o);r=this.insertHtml("beforeEnd",el,e);}return q?Roo.get(r,true):r;},overwrite:function(el,o,t){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}
+F(o,el);}else {el.innerHTML=E(o);}return t?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var u=E(o);return new Roo.Template(u);}};}();
+Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}
+this.html=A;};Roo.Template.prototype={applyTemplate:function(values){if(this.compiled){return this.compiled(values);}var B=this.disableFormats!==true;var fm=Roo.util.Format,C=this;var fn=function(m,D,E,F){if(E&&B){if(E.substr(0,5)=="this."){return C.call(E.substr(5),values[D],values);}else {if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,len=F.length;i<len;i++){F[i]=F[i].replace(re,"$1");}
+F=[values[D]].concat(F);}else {F=[values[D]];}return fm[E].apply(fm,F);}}else {return values[D]!==undefined?values[D]:"";}};return this.html.replace(this.re,fn);},set:function(D,E){this.html=D;this.compiled=null;if(E){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var F=this.disableFormats!==true;var G=Roo.isGecko?"+":",";var fn=function(m,I,J,K){if(J&&F){K=K?','+K:"";if(J.substr(0,5)!="this."){J="fm."+J+'(';}else {J='this.call("'+J.substr(5)+'", ';K=", values";}}else {K='';J="(values['"+I+"'] == undefined ? '' : ";}return "'"+G+J+"values['"+I+"']"+K+")"+G+"'";};var H;if(Roo.isGecko){H="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {H=["this.compiled = function(values){ return ['"];H.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));H.push("'].join('');};");H=H.join('');}eval(H);return this;},call:function(I,J,K){return this[I](J,K);},insertFirst:function(el,L,M){return this.doInsert('afterBegin',el,L,M);},insertBefore:function(el,N,O){return this.doInsert('beforeBegin',el,N,O);},insertAfter:function(el,P,Q){return this.doInsert('afterEnd',el,P,Q);},append:function(el,R,S){return this.doInsert('beforeEnd',el,R,S);},doInsert:function(T,el,U,V){el=Roo.getDom(el);var W=Roo.DomHelper.insertHtml(T,el,this.applyTemplate(U));return V?Roo.get(W,true):W;},overwrite:function(el,X,Y){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(X);return Y?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.apply=Roo.Template.prototype.applyTemplate;Roo.DomHelper.Template=Roo.Template;Roo.Template.from=function(el){el=Roo.getDom(el);return new Roo.Template(el.value||el.innerHTML);};
 Roo.DomQuery=function(){var A={},simpleCache={},valueCache={};var B=/\S/;var C=/^\s+|\s+$/g;var D=/\{(\d+)\}/g;var E=/^(\s?[\/>+~]\s?|\s|$)/;var F=/^(#)?([\w-\*]+)/;var G=/(\d*)n\+?(\d*)/,H=/\D/;function I(p,T){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==T){return n;}}
 n=n.nextSibling;}return null;};function J(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function K(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function L(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!B.test(n.nodeValue)){d.removeChild(n);}else {n.nodeIndex=++ni;}
 n=nx;}return this;};function byClassName(c,a,v){if(!v){return c;}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((' '+ci.className+' ').indexOf(v)!=-1){r[++ri]=ci;}}return r;};function attrValue(n,T){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];}if(!n){return null;}if(T=="for"){return n.htmlFor;}if(T=="class"||T=="className"){return n.className;}return n.getAttribute(T)||n[T];};function getNodes(ns,T,U){var V=[],ri=-1,cs;if(!ns){return V;}
@@ -4009,883 +102,26 @@ q=q.replace(tm[0],"");}else if(q.substr(0,1)!='@'){fn[fn.length]='n = getNodes(n
 q=q.replace(tm[0],"");}}while(!(mm=q.match(E))){var matched=false;for(var j=0;j<AD;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(D,function(x,i){return m[i];});q=q.replace(m[0],"");matched=true;break;}}if(!matched){throw 'Error parsing selector, parsing failed at "'+q+'"';}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(C,"")+'";';q=q.replace(mm[1],"");}}
 fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f;},select:function(AF,AG,AH){if(!AG||AG==document){AG=document;}if(typeof AG=="string"){AG=document.getElementById(AG);}var AI=AF.split(",");var AJ=[];for(var i=0,len=AI.length;i<len;i++){var p=AI[i].replace(C,"");if(!A[p]){A[p]=Roo.DomQuery.compile(p);if(!A[p]){throw p+" is not a valid selector";}}var z=A[p](AG);if(z&&z!=document){AJ=AJ.concat(z);}}if(AI.length>1){return nodup(AJ);}return AJ;},selectNode:function(AK,AL){return Roo.DomQuery.select(AK,AL)[0];},selectValue:function(AM,AN,AO){AM=AM.replace(C,"");if(!valueCache[AM]){valueCache[AM]=Roo.DomQuery.compile(AM,"select");}var n=valueCache[AM](AN);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?AO:v);},selectNumber:function(AP,AQ,AR){var v=Roo.DomQuery.selectValue(AP,AQ,AR||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var AS=(el instanceof Array);var AT=Roo.DomQuery.filter(AS?el:[el],ss);return AS?(AT.length==el.length):(AT.length>0);},filter:function(AU,ss,AV){ss=ss.replace(C,"");if(!simpleCache[ss]){simpleCache[ss]=Roo.DomQuery.compile(ss,"simple");}var AW=simpleCache[ss](AU);return AV?S(AW,AU):AW;},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v;},"!=":function(a,v){return a!=v;},"^=":function(a,v){return a&&a.substr(0,v.length)==v;},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v;},"*=":function(a,v){return a&&a.indexOf(v)!==-1;},"%=":function(a,v){return (a%v)==0;},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+'-');},"~=":function(a,v){return a&&(' '+a+' ').indexOf(' '+v+' ')!=-1;}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1);if(!n){r[++ri]=ci;}}return r;},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(!n){r[++ri]=ci;}}return r;},"nth-child":function(c,a){var r=[],ri=-1;var m=G.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!H.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j;}}
 pn._batch=batch;}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n;}}else if((n.nodeIndex+l)%f==0){r[++ri]=n;}}return r;},"only-child":function(c){var r=[],ri=-1;;for(var i=0,ci;ci=c[i];i++){if(!K(ci)&&!J(ci)){r[++ri]=ci;}}return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break;}}if(empty){r[++ri]=ci;}}return r;},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||'').indexOf(v)!=-1){r[++ri]=ci;}}return r;},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci;}}return r;},"checked":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci;}}return r;},"not":function(c,ss){return Roo.DomQuery.filter(c,ss,true);},"odd":function(c){return this["nth-child"](c,"odd");},"even":function(c){return this["nth-child"](c,"even");},"nth":function(c,a){return c[a-1]||[];},"first":function(c){return c[0]||[];},"last":function(c){return c[c.length-1]||[];},"has":function(c,ss){var s=Roo.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci;}}return r;},"next":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=J(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;},"prev":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=K(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;}}};}();Roo.query=Roo.DomQuery.select;
-
-
-
-
-
-
-Roo.util.Observable = function(A){
-    
-    A = A|| {};
-    this.addEvents(A.events || {});
-    if (A.events) {
-        delete  A.events; 
-    }
-
-     
-    Roo.apply(this, A);
-    
-    if(this.listeners){
-        this.on(this.listeners);
-        delete  this.listeners;
-    }
-};
-Roo.util.Observable.prototype = {
-    
-
-    
-    
-    
-
-    fireEvent : function(){
-        var  ce = this.events[arguments[0].toLowerCase()];
-        if(typeof  ce == "object"){
-            return  ce.fire.apply(ce, Array.prototype.slice.call(arguments, 1));
-        }else {
-            return  true;
-        }
-    },
-
-    
-    filterOptRe : /^(?:scope|delay|buffer|single)$/,
-
-    
-
-    addListener : function(B, fn, C, o){
-        if(typeof  B == "object"){
-            o = B;
-            for(var  e  in  o){
-                if(this.filterOptRe.test(e)){
-                    continue;
-                }
-                if(typeof  o[e] == "function"){
-                    
-                    this.addListener(e, o[e], o.scope,  o);
-                }else {
-                    
-                    this.addListener(e, o[e].fn, o[e].scope, o[e]);
-                }
-            }
-            return;
-        }
-
-        o = (!o || typeof  o == "boolean") ? {} : o;
-        B = B.toLowerCase();
-        var  ce = this.events[B] || true;
-        if(typeof  ce == "boolean"){
-            ce = new  Roo.util.Event(this, B);
-            this.events[B] = ce;
-        }
-
-        ce.addListener(fn, C, o);
-    },
-
-    
-
-    removeListener : function(D, fn, E){
-        var  ce = this.events[D.toLowerCase()];
-        if(typeof  ce == "object"){
-            ce.removeListener(fn, E);
-        }
-    },
-
-    
-
-    purgeListeners : function(){
-        for(var  evt  in  this.events){
-            if(typeof  this.events[evt] == "object"){
-                 this.events[evt].clearListeners();
-            }
-        }
-    },
-
-    relayEvents : function(o, F){
-        var  G = function(H){
-            return  function(){
-                return  this.fireEvent.apply(this, Roo.combine(H, Array.prototype.slice.call(arguments, 0)));
-            };
-        };
-        for(var  i = 0, len = F.length; i < len; i++){
-            var  ename = F[i];
-            if(!this.events[ename]){ this.events[ename] = true; };
-            o.on(ename, G(ename), this);
-        }
-    },
-
-    
-
-    addEvents : function(o){
-        if(!this.events){
-            this.events = {};
-        }
-
-        Roo.applyIf(this.events, o);
-    },
-
-    
-
-    hasListener : function(H){
-        var  e = this.events[H];
-        return  typeof  e == "object" && e.listeners.length > 0;
-    }
-};
-
-
-Roo.util.Observable.prototype.on = Roo.util.Observable.prototype.addListener;
-
-
-Roo.util.Observable.prototype.un = Roo.util.Observable.prototype.removeListener;
-
-
-
-Roo.util.Observable.capture = function(o, fn, I){
-    o.fireEvent = o.fireEvent.createInterceptor(fn, I);
-};
-
-
-
-Roo.util.Observable.releaseCapture = function(o){
-    o.fireEvent = Roo.util.Observable.prototype.fireEvent;
-};
-
-(function(){
-
-    var  J = function(h, o, M){
-        var  N = new  Roo.util.DelayedTask();
-        return  function(){
-            N.delay(o.buffer, h, M, Array.prototype.slice.call(arguments, 0));
-        };
-    };
-
-    var  K = function(h, e, fn, M){
-        return  function(){
-            e.removeListener(fn, M);
-            return  h.apply(M, arguments);
-        };
-    };
-
-    var  L = function(h, o, M){
-        return  function(){
-            var  N = Array.prototype.slice.call(arguments, 0);
-            setTimeout(function(){
-                h.apply(M, N);
-            }, o.delay || 10);
-        };
-    };
-
-    Roo.util.Event = function(M, N){
-        this.name = N;
-        this.obj = M;
-        this.listeners = [];
-    };
-
-    Roo.util.Event.prototype = {
-        addListener : function(fn, M, N){
-            var  o = N || {};
-            M = M || this.obj;
-            if(!this.isListening(fn, M)){
-                var  l = {fn: fn, scope: M, options: o};
-                var  h = fn;
-                if(o.delay){
-                    h = L(h, o, M);
-                }
-                if(o.single){
-                    h = K(h, this, fn, M);
-                }
-                if(o.buffer){
-                    h = J(h, o, M);
-                }
-
-                l.fireFn = h;
-                if(!this.firing){ 
-                    this.listeners.push(l);
-                }else {
-                    this.listeners = this.listeners.slice(0);
-                    this.listeners.push(l);
-                }
-            }
-        },
-
-        findListener : function(fn, O){
-            O = O || this.obj;
-            var  ls = this.listeners;
-            for(var  i = 0, len = ls.length; i < len; i++){
-                var  l = ls[i];
-                if(l.fn == fn && l.scope == O){
-                    return  i;
-                }
-            }
-            return  -1;
-        },
-
-        isListening : function(fn, P){
-            return  this.findListener(fn, P) != -1;
-        },
-
-        removeListener : function(fn, Q){
-            var  R;
-            if((R = this.findListener(fn, Q)) != -1){
-                if(!this.firing){
-                    this.listeners.splice(R, 1);
-                }else {
-                    this.listeners = this.listeners.slice(0);
-                    this.listeners.splice(R, 1);
-                }
-                return  true;
-            }
-            return  false;
-        },
-
-        clearListeners : function(){
-            this.listeners = [];
-        },
-
-        fire : function(){
-            var  ls = this.listeners, S, T = ls.length;
-            if(T > 0){
-                this.firing = true;
-                var  args = Array.prototype.slice.call(arguments, 0);
-                for(var  i = 0; i < T; i++){
-                    var  l = ls[i];
-                    if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){
-                        this.firing = false;
-                        return  false;
-                    }
-                }
-
-                this.firing = false;
-            }
-            return  true;
-        }
-    };
-})();
-
-
-
-
-
-Roo.EventManager = function(){
-    var  A, B, C = false;
-    var  F, G, H, I;
-    var  E = Roo.lib.Event;
-    var  D = Roo.lib.Dom;
-
-
-    var  J = function(){
-        if(!C){
-            C = true;
-            Roo.isReady = true;
-            if(B){
-                clearInterval(B);
-            }
-            if(Roo.isGecko || Roo.isOpera) {
-                document.removeEventListener("DOMContentLoaded", J, false);
-            }
-            if(Roo.isIE){
-                var  defer = document.getElementById("ie-deferred-loader");
-                if(defer){
-                    defer.onreadystatechange = null;
-                    defer.parentNode.removeChild(defer);
-                }
-            }
-            if(A){
-                A.fire();
-                A.clearListeners();
-            }
-        }
-    };
-    
-    var  K = function(){
-        A = new  Roo.util.Event();
-        if(Roo.isGecko || Roo.isOpera) {
-            document.addEventListener("DOMContentLoaded", J, false);
-        }else  if(Roo.isIE){
-            document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
-            var  defer = document.getElementById("ie-deferred-loader");
-            defer.onreadystatechange = function(){
-                if(this.readyState == "complete"){
-                    J();
-                }
-            };
-        }else  if(Roo.isSafari){ 
-            B = setInterval(function(){
-                var  rs = document.readyState;
-                if(rs == "complete") {
-                    J();     
-                 }
-            }, 10);
-        }
-
-        
-        E.on(window, "load", J);
-    };
-
-    var  L = function(h, o){
-        var  S = new  Roo.util.DelayedTask(h);
-        return  function(e){
-            
-            e = new  Roo.EventObjectImpl(e);
-            S.delay(o.buffer, h, null, [e]);
-        };
-    };
-
-    var  M = function(h, el, S, fn){
-        return  function(e){
-            Roo.EventManager.removeListener(el, S, fn);
-            h(e);
-        };
-    };
-
-    var  N = function(h, o){
-        return  function(e){
-            
-            e = new  Roo.EventObjectImpl(e);
-            setTimeout(function(){
-                h(e);
-            }, o.delay || 10);
-        };
-    };
-
-    var  O = function(S, T, U, fn, V){
-        var  o = (!U || typeof  U == "boolean") ? {} : U;
-        fn = fn || o.fn; V = V || o.scope;
-        var  el = Roo.getDom(S);
-        if(!el){
-            throw  "Error listening for \"" + T + '\". Element "' + S + '" doesn\'t exist.';
-        }
-        var  h = function(e){
-            e = Roo.EventObject.setEvent(e);
-            var  t;
-            if(o.delegate){
-                t = e.getTarget(o.delegate, el);
-                if(!t){
-                    return;
-                }
-            }else {
-                t = e.target;
-            }
-            if(o.stopEvent === true){
-                e.stopEvent();
-            }
-            if(o.preventDefault === true){
-               e.preventDefault();
-            }
-            if(o.stopPropagation === true){
-                e.stopPropagation();
-            }
-
-            if(o.normalized === false){
-                e = e.browserEvent;
-            }
-
-
-            fn.call(V || el, e, t, o);
-        };
-        if(o.delay){
-            h = N(h, o);
-        }
-        if(o.single){
-            h = M(h, el, T, fn);
-        }
-        if(o.buffer){
-            h = L(h, o);
-        }
-
-        fn._handlers = fn._handlers || [];
-        fn._handlers.push([Roo.id(el), T, h]);
-
-        E.on(el, T, h);
-        if(T == "mousewheel" && el.addEventListener){ 
-            el.addEventListener("DOMMouseScroll", h, false);
-            E.on(window, 'unload', function(){
-                el.removeEventListener("DOMMouseScroll", h, false);
-            });
-        }
-        if(T == "mousedown" && el == document){ 
-            Roo.EventManager.stoppedMouseDownEvent.addListener(h);
-        }
-        return  h;
-    };
-
-    var  P = function(el, S, fn){
-        var  id = Roo.id(el), T = fn._handlers, hd = fn;
-        if(T){
-            for(var  i = 0, len = T.length; i < len; i++){
-                var  h = T[i];
-                if(h[0] == id && h[1] == S){
-                    hd = h[2];
-                    T.splice(i, 1);
-                    break;
-                }
-            }
-        }
-
-        E.un(el, S, hd);
-        el = Roo.getDom(el);
-        if(S == "mousewheel" && el.addEventListener){
-            el.removeEventListener("DOMMouseScroll", hd, false);
-        }
-        if(S == "mousedown" && el == document){ 
-            Roo.EventManager.stoppedMouseDownEvent.removeListener(hd);
-        }
-    };
-
-    var  Q = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
-    
-    var  R = {
-        
-        
-        
-
-        
-        
-        
-
-        wrap : function(fn, S, T){
-            return  function(e){
-                Roo.EventObject.setEvent(e);
-                fn.call(T ? S || window : window, Roo.EventObject, S);
-            };
-        },
-        
-        
-
-        addListener : function(U, V, fn, W, X){
-            if(typeof  V == "object"){
-                var  o = V;
-                for(var  e  in  o){
-                    if(Q.test(e)){
-                        continue;
-                    }
-                    if(typeof  o[e] == "function"){
-                        
-                        O(U, e, o, o[e], o.scope);
-                    }else {
-                        
-                        O(U, e, o[e]);
-                    }
-                }
-                return;
-            }
-            return  O(U, V, X, fn, W);
-        },
-        
-        
-
-        removeListener : function(Y, Z, fn){
-            return  P(Y, Z, fn);
-        },
-        
-        
-
-        onDocumentReady : function(fn, a, b){
-            if(C){ 
-                A.addListener(fn, a, b);
-                A.fire();
-                A.clearListeners();
-                return;
-            }
-            if(!A){
-                K();
-            }
-
-            A.addListener(fn, a, b);
-        },
-        
-        
-
-        onWindowResize : function(fn, c, d){
-            if(!F){
-                F = new  Roo.util.Event();
-                G = new  Roo.util.DelayedTask(function(){
-                    F.fire(D.getViewWidth(), D.getViewHeight());
-                });
-                E.on(window, "resize", function(){
-                    if(Roo.isIE){
-                        G.delay(50);
-                    }else {
-                        F.fire(D.getViewWidth(), D.getViewHeight());
-                    }
-                });
-            }
-
-            F.addListener(fn, c, d);
-        },
-
-        
-
-        onTextResize : function(fn, f, g){
-            if(!H){
-                H = new  Roo.util.Event();
-                var  textEl = new  Roo.Element(document.createElement('div'));
-                textEl.dom.className = 'x-text-resize';
-                textEl.dom.innerHTML = 'X';
-                textEl.appendTo(document.body);
-                I = textEl.dom.offsetHeight;
-                setInterval(function(){
-                    if(textEl.dom.offsetHeight != I){
-                        H.fire(I, I = textEl.dom.offsetHeight);
-                    }
-                }, this.textResizeInterval);
-            }
-
-            H.addListener(fn, f, g);
-        },
-
-        
-
-        removeResizeListener : function(fn, j){
-            if(F){
-                F.removeListener(fn, j);
-            }
-        },
-
-        
-        fireResize : function(){
-            if(F){
-                F.fire(D.getViewWidth(), D.getViewHeight());
-            }   
-        },
-        
-
-        ieDeferSrc : false,
-        
-
-        textResizeInterval : 50
-    };
-    
-    
-
-    
-     
-
-    R.on = R.addListener;
-    R.un = R.removeListener;
-
-    R.stoppedMouseDownEvent = new  Roo.util.Event();
-    return  R;
-}();
-
-
-Roo.onReady = Roo.EventManager.onDocumentReady;
-
-Roo.onReady(function(){
-    var  bd = Roo.get(document.body);
-    if(!bd){ return; }
-
-    var  S = [
-            Roo.isIE ? "roo-ie"
-            : Roo.isGecko ? "roo-gecko"
-            : Roo.isOpera ? "roo-opera"
-            : Roo.isSafari ? "roo-safari" : ""];
-
-    if(Roo.isMac){
-        S.push("roo-mac");
-    }
-    if(Roo.isLinux){
-        S.push("roo-linux");
-    }
-    if(Roo.isBorderBox){
-        S.push('roo-border-box');
-    }
-    if(Roo.isStrict){ 
-        var  p = bd.dom.parentNode;
-        if(p){
-            p.className += ' roo-strict';
-        }
-    }
-
-    bd.addClass(S.join(' '));
-});
-
-
-
-Roo.EventObject = function(){
-    
-    var  E = Roo.lib.Event;
-    
-    
-    var  T = {
-        63234 : 37, 
-        63235 : 39, 
-        63232 : 38, 
-        63233 : 40, 
-        63276 : 33, 
-        63277 : 34, 
-        63272 : 46, 
-        63273 : 36, 
-        63275 : 35  
-    };
-
-    
-    var  U = Roo.isIE ? {1:0,4:1,2:2} :
-                (Roo.isSafari ? {1:0,2:1,3:2} : {0:0,1:1,2:2});
-
-    Roo.EventObjectImpl = function(e){
-        if(e){
-            this.setEvent(e.browserEvent || e);
-        }
-    };
-    Roo.EventObjectImpl.prototype = {
-        
-
-            
-
-        
-        
-        
-
-        browserEvent : null,
-        
-
-        button : -1,
-        
-
-        shiftKey : false,
-        
-
-        ctrlKey : false,
-        
-
-        altKey : false,
-
-        
-
-        BACKSPACE : 8,
-        
-
-        TAB : 9,
-        
-
-        RETURN  : 13,
-        
-
-        ENTER : 13,
-        
-
-        SHIFT : 16,
-        
-
-        CONTROL : 17,
-        
-
-        ESC : 27,
-        
-
-        SPACE : 32,
-        
-
-        PAGEUP : 33,
-        
-
-        PAGEDOWN : 34,
-        
-
-        END : 35,
-        
-
-        HOME : 36,
-        
-
-        LEFT : 37,
-        
-
-        UP : 38,
-        
-
-        RIGHT : 39,
-        
-
-        DOWN : 40,
-        
-
-        DELETE  : 46,
-        
-
-        F5 : 116,
-
-           
-
-        setEvent : function(e){
-            if(e == this || (e && e.browserEvent)){ 
-                return  e;
-            }
-
-            this.browserEvent = e;
-            if(e){
-                
-                this.button = e.button ? U[e.button] : (e.which ? e.which-1 : -1);
-                if(e.type == 'click' && this.button == -1){
-                    this.button = 0;
-                }
-
-                this.type = e.type;
-                this.shiftKey = e.shiftKey;
-                
-                this.ctrlKey = e.ctrlKey || e.metaKey;
-                this.altKey = e.altKey;
-                
-                this.keyCode = e.keyCode;
-                
-                this.charCode = (e.type == 'keyup' || e.type == 'keydown') ? 0 : e.charCode;
-                
-                this.target = E.getTarget(e);
-                
-                this.xy = E.getXY(e);
-            }else {
-                this.button = -1;
-                this.shiftKey = false;
-                this.ctrlKey = false;
-                this.altKey = false;
-                this.keyCode = 0;
-                this.charCode =0;
-                this.target = null;
-                this.xy = [0, 0];
-            }
-            return  this;
-        },
-
-        
-
-        stopEvent : function(){
-            if(this.browserEvent){
-                if(this.browserEvent.type == 'mousedown'){
-                    Roo.EventManager.stoppedMouseDownEvent.fire(this);
-                }
-
-                E.stopEvent(this.browserEvent);
-            }
-        },
-
-        
-
-        preventDefault : function(){
-            if(this.browserEvent){
-                E.preventDefault(this.browserEvent);
-            }
-        },
-
-        
-
-        isNavKeyPress : function(){
-            var  k = this.keyCode;
-            k = Roo.isSafari ? (T[k] || k) : k;
-            return  (k >= 33 && k <= 40) || k == this.RETURN  || k == this.TAB || k == this.ESC;
-        },
-
-        isSpecialKey : function(){
-            var  k = this.keyCode;
-            return  (this.type == 'keypress' && this.ctrlKey) || k == 9 || k == 13  || k == 40 || k == 27 ||
-            (k == 16) || (k == 17) ||
-            (k >= 18 && k <= 20) ||
-            (k >= 33 && k <= 35) ||
-            (k >= 36 && k <= 39) ||
-            (k >= 44 && k <= 45);
-        },
-        
-
-        stopPropagation : function(){
-            if(this.browserEvent){
-                if(this.type == 'mousedown'){
-                    Roo.EventManager.stoppedMouseDownEvent.fire(this);
-                }
-
-                E.stopPropagation(this.browserEvent);
-            }
-        },
-
-        
-
-        getCharCode : function(){
-            return  this.charCode || this.keyCode;
-        },
-
-        
-
-        getKey : function(){
-            var  k = this.keyCode || this.charCode;
-            return  Roo.isSafari ? (T[k] || k) : k;
-        },
-
-        
-
-        getPageX : function(){
-            return  this.xy[0];
-        },
-
-        
-
-        getPageY : function(){
-            return  this.xy[1];
-        },
-
-        
-
-        getTime : function(){
-            if(this.browserEvent){
-                return  E.getTime(this.browserEvent);
-            }
-            return  null;
-        },
-
-        
-
-        getXY : function(){
-            return  this.xy;
-        },
-
-        
-
-        getTarget : function(V, W, X){
-            return  V ? Roo.fly(this.target).findParent(V, W, X) : this.target;
-        },
-        
-
-        getRelatedTarget : function(){
-            if(this.browserEvent){
-                return  E.getRelatedTarget(this.browserEvent);
-            }
-            return  null;
-        },
-
-        
-
-        getWheelDelta : function(){
-            var  e = this.browserEvent;
-            var  Y = 0;
-            if(e.wheelDelta){ 
-
-                Y = e.wheelDelta/120;
-            }else  if(e.detail){ 
-
-                Y = -e.detail/3;
-            }
-            return  Y;
-        },
-
-        
-
-        hasModifier : function(){
-            return  !!((this.ctrlKey || this.altKey) || this.shiftKey);
-        },
-
-        
-
-        within : function(el, Z){
-            var  t = this[Z ? "getRelatedTarget" : "getTarget"]();
-            return  t && Roo.fly(el).contains(t);
-        },
-
-        getPoint : function(){
-            return  new  Roo.lib.Point(this.xy[0], this.xy[1]);
-        }
-    };
-
-    return  new  Roo.EventObjectImpl();
-}();
-            
-    
+Roo.util.Observable=function(A){A=A||{};this.addEvents(A.events||{});if(A.events){delete A.events;}
+Roo.apply(this,A);if(this.listeners){this.on(this.listeners);delete this.listeners;}};Roo.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()];if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1));}else {return true;}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(B,fn,C,o){if(typeof B=="object"){o=B;for(var e in o){if(this.filterOptRe.test(e)){continue;}if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o);}else {this.addListener(e,o[e].fn,o[e].scope,o[e]);}}return;}
+o=(!o||typeof o=="boolean")?{}:o;B=B.toLowerCase();var ce=this.events[B]||true;if(typeof ce=="boolean"){ce=new Roo.util.Event(this,B);this.events[B]=ce;}
+ce.addListener(fn,C,o);},removeListener:function(D,fn,E){var ce=this.events[D.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,E);}},purgeListeners:function(){for(var evt in this.events){if(typeof this.events[evt]=="object"){this.events[evt].clearListeners();}}},relayEvents:function(o,F){var G=function(H){return function(){return this.fireEvent.apply(this,Roo.combine(H,Array.prototype.slice.call(arguments,0)));};};for(var i=0,len=F.length;i<len;i++){var ename=F[i];if(!this.events[ename]){this.events[ename]=true;};o.on(ename,G(ename),this);}},addEvents:function(o){if(!this.events){this.events={};}
+Roo.applyIf(this.events,o);},hasListener:function(H){var e=this.events[H];return typeof e=="object"&&e.listeners.length>0;}};Roo.util.Observable.prototype.on=Roo.util.Observable.prototype.addListener;Roo.util.Observable.prototype.un=Roo.util.Observable.prototype.removeListener;Roo.util.Observable.capture=function(o,fn,I){o.fireEvent=o.fireEvent.createInterceptor(fn,I);};Roo.util.Observable.releaseCapture=function(o){o.fireEvent=Roo.util.Observable.prototype.fireEvent;};(function(){var J=function(h,o,M){var N=new Roo.util.DelayedTask();return function(){N.delay(o.buffer,h,M,Array.prototype.slice.call(arguments,0));};};var K=function(h,e,fn,M){return function(){e.removeListener(fn,M);return h.apply(M,arguments);};};var L=function(h,o,M){return function(){var N=Array.prototype.slice.call(arguments,0);setTimeout(function(){h.apply(M,N);},o.delay||10);};};Roo.util.Event=function(M,N){this.name=N;this.obj=M;this.listeners=[];};Roo.util.Event.prototype={addListener:function(fn,M,N){var o=N||{};M=M||this.obj;if(!this.isListening(fn,M)){var l={fn:fn,scope:M,options:o};var h=fn;if(o.delay){h=L(h,o,M);}if(o.single){h=K(h,this,fn,M);}if(o.buffer){h=J(h,o,M);}
+l.fireFn=h;if(!this.firing){this.listeners.push(l);}else {this.listeners=this.listeners.slice(0);this.listeners.push(l);}}},findListener:function(fn,O){O=O||this.obj;var ls=this.listeners;for(var i=0,len=ls.length;i<len;i++){var l=ls[i];if(l.fn==fn&&l.scope==O){return i;}}return -1;},isListening:function(fn,P){return this.findListener(fn,P)!=-1;},removeListener:function(fn,Q){var R;if((R=this.findListener(fn,Q))!=-1){if(!this.firing){this.listeners.splice(R,1);}else {this.listeners=this.listeners.slice(0);this.listeners.splice(R,1);}return true;}return false;},clearListeners:function(){this.listeners=[];},fire:function(){var ls=this.listeners,S,T=ls.length;if(T>0){this.firing=true;var args=Array.prototype.slice.call(arguments,0);for(var i=0;i<T;i++){var l=ls[i];if(l.fireFn.apply(l.scope||this.obj||window,arguments)===false){this.firing=false;return false;}}
+this.firing=false;}return true;}};})();
+Roo.EventManager=function(){var A,B,C=false;var F,G,H,I;var E=Roo.lib.Event;var D=Roo.lib.Dom;var J=function(){if(!C){C=true;Roo.isReady=true;if(B){clearInterval(B);}if(Roo.isGecko||Roo.isOpera){document.removeEventListener("DOMContentLoaded",J,false);}if(Roo.isIE){var defer=document.getElementById("ie-deferred-loader");if(defer){defer.onreadystatechange=null;defer.parentNode.removeChild(defer);}}if(A){A.fire();A.clearListeners();}}};var K=function(){A=new Roo.util.Event();if(Roo.isGecko||Roo.isOpera){document.addEventListener("DOMContentLoaded",J,false);}else if(Roo.isIE){document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");var defer=document.getElementById("ie-deferred-loader");defer.onreadystatechange=function(){if(this.readyState=="complete"){J();}};}else if(Roo.isSafari){B=setInterval(function(){var rs=document.readyState;if(rs=="complete"){J();}},10);}
+E.on(window,"load",J);};var L=function(h,o){var S=new Roo.util.DelayedTask(h);return function(e){e=new Roo.EventObjectImpl(e);S.delay(o.buffer,h,null,[e]);};};var M=function(h,el,S,fn){return function(e){Roo.EventManager.removeListener(el,S,fn);h(e);};};var N=function(h,o){return function(e){e=new Roo.EventObjectImpl(e);setTimeout(function(){h(e);},o.delay||10);};};var O=function(S,T,U,fn,V){var o=(!U||typeof U=="boolean")?{}:U;fn=fn||o.fn;V=V||o.scope;var el=Roo.getDom(S);if(!el){throw "Error listening for \""+T+'\". Element "'+S+'" doesn\'t exist.';}var h=function(e){e=Roo.EventObject.setEvent(e);var t;if(o.delegate){t=e.getTarget(o.delegate,el);if(!t){return;}}else {t=e.target;}if(o.stopEvent===true){e.stopEvent();}if(o.preventDefault===true){e.preventDefault();}if(o.stopPropagation===true){e.stopPropagation();}if(o.normalized===false){e=e.browserEvent;}
+fn.call(V||el,e,t,o);};if(o.delay){h=N(h,o);}if(o.single){h=M(h,el,T,fn);}if(o.buffer){h=L(h,o);}
+fn._handlers=fn._handlers||[];fn._handlers.push([Roo.id(el),T,h]);E.on(el,T,h);if(T=="mousewheel"&&el.addEventListener){el.addEventListener("DOMMouseScroll",h,false);E.on(window,'unload',function(){el.removeEventListener("DOMMouseScroll",h,false);});}if(T=="mousedown"&&el==document){Roo.EventManager.stoppedMouseDownEvent.addListener(h);}return h;};var P=function(el,S,fn){var id=Roo.id(el),T=fn._handlers,hd=fn;if(T){for(var i=0,len=T.length;i<len;i++){var h=T[i];if(h[0]==id&&h[1]==S){hd=h[2];T.splice(i,1);break;}}}
+E.un(el,S,hd);el=Roo.getDom(el);if(S=="mousewheel"&&el.addEventListener){el.removeEventListener("DOMMouseScroll",hd,false);}if(S=="mousedown"&&el==document){Roo.EventManager.stoppedMouseDownEvent.removeListener(hd);}};var Q=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var R={wrap:function(fn,S,T){return function(e){Roo.EventObject.setEvent(e);fn.call(T?S||window:window,Roo.EventObject,S);};},addListener:function(U,V,fn,W,X){if(typeof V=="object"){var o=V;for(var e in o){if(Q.test(e)){continue;}if(typeof o[e]=="function"){O(U,e,o,o[e],o.scope);}else {O(U,e,o[e]);}}return;}return O(U,V,X,fn,W);},removeListener:function(Y,Z,fn){return P(Y,Z,fn);},onDocumentReady:function(fn,a,b){if(C){A.addListener(fn,a,b);A.fire();A.clearListeners();return;}if(!A){K();}
+A.addListener(fn,a,b);},onWindowResize:function(fn,c,d){if(!F){F=new Roo.util.Event();G=new Roo.util.DelayedTask(function(){F.fire(D.getViewWidth(),D.getViewHeight());});E.on(window,"resize",function(){if(Roo.isIE){G.delay(50);}else {F.fire(D.getViewWidth(),D.getViewHeight());}});}
+F.addListener(fn,c,d);},onTextResize:function(fn,f,g){if(!H){H=new Roo.util.Event();var textEl=new Roo.Element(document.createElement('div'));textEl.dom.className='x-text-resize';textEl.dom.innerHTML='X';textEl.appendTo(document.body);I=textEl.dom.offsetHeight;setInterval(function(){if(textEl.dom.offsetHeight!=I){H.fire(I,I=textEl.dom.offsetHeight);}},this.textResizeInterval);}
+H.addListener(fn,f,g);},removeResizeListener:function(fn,j){if(F){F.removeListener(fn,j);}},fireResize:function(){if(F){F.fire(D.getViewWidth(),D.getViewHeight());}},ieDeferSrc:false,textResizeInterval:50};R.on=R.addListener;R.un=R.removeListener;R.stoppedMouseDownEvent=new Roo.util.Event();return R;}();Roo.onReady=Roo.EventManager.onDocumentReady;Roo.onReady(function(){var bd=Roo.get(document.body);if(!bd){return;}var S=[Roo.isIE?"roo-ie":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){S.push("roo-mac");}if(Roo.isLinux){S.push("roo-linux");}if(Roo.isBorderBox){S.push('roo-border-box');}if(Roo.isStrict){var p=bd.dom.parentNode;if(p){p.className+=' roo-strict';}}
+bd.addClass(S.join(' '));});Roo.EventObject=function(){var E=Roo.lib.Event;var T={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var U=Roo.isIE?{1:0,4:1,2:2}:(Roo.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Roo.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Roo.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN :13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE :46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;}
+this.browserEvent=e;if(e){this.button=e.button?U[e.button]:(e.which?e.which-1:-1);if(e.type=='click'&&this.button==-1){this.button=0;}
+this.type=e.type;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;this.charCode=(e.type=='keyup'||e.type=='keydown')?0:e.charCode;this.target=E.getTarget(e);this.xy=E.getXY(e);}else {this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0];}return this;},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);}
+E.stopEvent(this.browserEvent);}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent);}},isNavKeyPress:function(){var k=this.keyCode;k=Roo.isSafari?(T[k]||k):k;return (k>=33&&k<=40)||k==this.RETURN ||k==this.TAB||k==this.ESC;},isSpecialKey:function(){var k=this.keyCode;return (this.type=='keypress'&&this.ctrlKey)||k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45);},stopPropagation:function(){if(this.browserEvent){if(this.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);}
+E.stopPropagation(this.browserEvent);}},getCharCode:function(){return this.charCode||this.keyCode;},getKey:function(){var k=this.keyCode||this.charCode;return Roo.isSafari?(T[k]||k):k;},getPageX:function(){return this.xy[0];},getPageY:function(){return this.xy[1];},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent);}return null;},getXY:function(){return this.xy;},getTarget:function(V,W,X){return V?Roo.fly(this.target).findParent(V,W,X):this.target;},getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent);}return null;},getWheelDelta:function(){var e=this.browserEvent;var Y=0;if(e.wheelDelta){Y=e.wheelDelta/120;}else if(e.detail){Y=-e.detail/3;}return Y;},hasModifier:function(){return !!((this.ctrlKey||this.altKey)||this.shiftKey);},within:function(el,Z){var t=this[Z?"getRelatedTarget":"getTarget"]();return t&&Roo.fly(el).contains(t);},getPoint:function(){return new Roo.lib.Point(this.xy[0],this.xy[1]);}};return new Roo.EventObjectImpl();}();
 (function(){var D=Roo.lib.Dom;var E=Roo.lib.Event;var A=Roo.lib.Anim;var B={};var C=/(-[a-z])/gi;var F=function(m,a){return a.charAt(1).toUpperCase();};var G=document.defaultView;Roo.Element=function(J,K){var L=typeof J=="string"?document.getElementById(J):J;if(!L){return null;}var id=L.id;if(K!==true&&id&&Roo.Element.cache[id]){return Roo.Element.cache[id];}
 this.dom=L;this.id=id||Roo.id(L);};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;return this;},enableDisplayMode:function(K){this.setVisibilityMode(El.DISPLAY);if(typeof K!="undefined")this.originalDisplay=K;return this;},findParent:function(L,M,N){var p=this.dom,b=document.body,O=0,dq=Roo.DomQuery,P;M=M||50;if(typeof M!="number"){P=Roo.getDom(M);M=10;}while(p&&p.nodeType==1&&O<M&&p!=b&&p!=P){if(dq.is(p,L)){return N?Roo.get(p):p;}
 O++;p=p.parentNode;}return null;},findParentNode:function(Q,R,S){var p=Roo.fly(this.dom.parentNode,'_internal');return p?p.findParent(Q,R,S):null;},up:function(T,U){return this.findParentNode(T,U,true);},is:function(V){return Roo.DomQuery.is(this.dom,V);},animate:function(W,X,Y,Z,c){this.anim(W,{duration:X,callback:Y,easing:Z},c);return this;},anim:function(e,g,h,j,k,cb){h=h||'run';g=g||{};var l=Roo.lib.Anim[h](this.dom,e,(g.duration||j)||.35,(g.easing||k)||'easeOut',function(){Roo.callback(cb,this);Roo.callback(g.callback,g.scope||this,[this,g]);},this);g.anim=l;return l;},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});},clean:function(o){if(this.isCleaned&&o!==true){return this;}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n);}else {n.nodeIndex=++ni;}
@@ -4896,7 +132,7 @@ this.anim({opacity:{to:(AY?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',fu
 Roo.get(dom).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(Aa){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(Ab){if(typeof Ab=="boolean"){Ab=Ab?this.originalDisplay:"none";}
 this.setStyle("display",Ab);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(Ac){if(Ac instanceof Array){for(var i=0,len=Ac.length;i<len;i++){this.addClass(Ac[i]);}}else {if(Ac&&!this.hasClass(Ac)){this.dom.className=this.dom.className+" "+Ac;}}return this;},radioClass:function(Ad){var Ae=this.dom.parentNode.childNodes;for(var i=0;i<Ae.length;i++){var s=Ae[i];if(s.nodeType==1){Roo.get(s).removeClass(Ad);}}
 this.addClass(Ad);return this;},removeClass:function(Af){if(!Af||!this.dom.className){return this;}if(Af instanceof Array){for(var i=0,len=Af.length;i<len;i++){this.removeClass(Af[i]);}}else {if(this.hasClass(Af)){var re=this.classReCache[Af];if(!re){re=new RegExp('(?:^|\\s+)'+Af+'(?:\\s+|$)',"g");this.classReCache[Af]=re;}
-this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(Ag){if(this.hasClass(Ag)){this.removeClass(Ag);}else {this.addClass(Ag);}return this;},hasClass:function(Ah){return Ah&&(' '+this.dom.className+' ').indexOf(' '+Ah+' ')!=-1;},replaceClass:function(Ai,Aj){this.removeClass(Ai);this.addClass(Aj);return this;},getStyles:function(){var a=arguments,Ak=a.length,r={};for(var i=0;i<Ak;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(Al){var el=this.dom,v,cs,Am;if(Al=='float'){Al="cssFloat";}if(el.style&&(v=el.style[Al])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}return cs[Am];}return null;}:function(Al){var el=this.dom,v,cs,Am;if(Al=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}return 1;}else if(Al=='float'){Al="styleFloat";}if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}if(v=el.style[Am]){return v;}if(cs=el.currentStyle){return cs[Am];}return null;};}(),setStyle:function(Al,Am){if(typeof Al=="string"){var camel;if(!(camel=B[Al])){camel=B[Al]=Al.replace(C,F);}if(camel=='opacity'){this.setOpacity(Am);}else {this.dom.style[camel]=Am;}}else {for(var style in Al){if(typeof Al[style]!="function"){this.setStyle(style,Al[style]);}}}return this;},applyStyles:function(An){Roo.DomHelper.applyStyles(this.dom,An);return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,Ao){if(!Ao||!A){D.setX(this.dom,x);}else {this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,Ap){if(!Ap||!A){D.setY(this.dom,y);}else {this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(Aq){this.setStyle("left",this.addUnits(Aq));return this;},setTop:function(Ar){this.setStyle("top",this.addUnits(Ar));return this;},setRight:function(As){this.setStyle("right",this.addUnits(As));return this;},setBottom:function(At){this.setStyle("bottom",this.addUnits(At));return this;},setXY:function(Au,Av){if(!Av||!A){D.setXY(this.dom,Au);}else {this.anim({points:{to:Au}},this.preanim(arguments,1),'motion');}return this;},setLocation:function(x,y,Aw){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,Ax){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(Ay){var h=this.dom.offsetHeight||0;return Ay!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(Az){var w=this.dom.offsetWidth||0;return Az!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle('height'),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth('tb');}}return h;},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle('width'),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth('lr');}}return w;},getSize:function(A0){return {width:this.getWidth(A0),height:this.getHeight(A0)};},getViewSize:function(){var d=this.dom,A1=document,aw=0,ah=0;if(d==A1||d==A1.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else {return {width:d.clientWidth,height:d.clientHeight};}},getValue:function(A2){return A2?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(A3){if(typeof A3=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A3-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(A3<0){A3=0;}}return A3;},adjustHeight:function(A4){if(typeof A4=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A4-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(A4<0){A4=0;}}return A4;},setWidth:function(A5,A6){A5=this.adjustWidth(A5);if(!A6||!A){this.dom.style.width=this.addUnits(A5);}else {this.anim({width:{to:A5}},this.preanim(arguments,1));}return this;},setHeight:function(A7,A8){A7=this.adjustHeight(A7);if(!A8||!A){this.dom.style.height=this.addUnits(A7);}else {this.anim({height:{to:A7}},this.preanim(arguments,1));}return this;},setSize:function(A9,BA,BB){if(typeof A9=="object"){BA=A9.height;A9=A9.width;}
+this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(Ag){if(this.hasClass(Ag)){this.removeClass(Ag);}else {this.addClass(Ag);}return this;},hasClass:function(Ah){return Ah&&(' '+this.dom.className+' ').indexOf(' '+Ah+' ')!=-1;},replaceClass:function(Ai,Aj){this.removeClass(Ai);this.addClass(Aj);return this;},getStyles:function(){var a=arguments,Ak=a.length,r={};for(var i=0;i<Ak;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(Al){var el=this.dom,v,cs,Am;if(Al=='float'){Al="cssFloat";}if(el.style&&(v=el.style[Al])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}return cs[Am];}return null;}:function(Al){var el=this.dom,v,cs,Am;if(Al=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}return 1;}else if(Al=='float'){Al="styleFloat";}if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}if(v=el.style[Am]){return v;}if(cs=el.currentStyle){return cs[Am];}return null;};}(),setStyle:function(Al,Am){if(typeof Al=="string"){if(Al=='float'){this.setStyle(Roo.isIE?'styleFloat':'cssFloat',Am);return this;}var camel;if(!(camel=B[Al])){camel=B[Al]=Al.replace(C,F);}if(camel=='opacity'){this.setOpacity(Am);}else {this.dom.style[camel]=Am;}}else {for(var style in Al){if(typeof Al[style]!="function"){this.setStyle(style,Al[style]);}}}return this;},applyStyles:function(An){Roo.DomHelper.applyStyles(this.dom,An);return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,Ao){if(!Ao||!A){D.setX(this.dom,x);}else {this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,Ap){if(!Ap||!A){D.setY(this.dom,y);}else {this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(Aq){this.setStyle("left",this.addUnits(Aq));return this;},setTop:function(Ar){this.setStyle("top",this.addUnits(Ar));return this;},setRight:function(As){this.setStyle("right",this.addUnits(As));return this;},setBottom:function(At){this.setStyle("bottom",this.addUnits(At));return this;},setXY:function(Au,Av){if(!Av||!A){D.setXY(this.dom,Au);}else {this.anim({points:{to:Au}},this.preanim(arguments,1),'motion');}return this;},setLocation:function(x,y,Aw){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,Ax){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(Ay){var h=this.dom.offsetHeight||0;return Ay!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(Az){var w=this.dom.offsetWidth||0;return Az!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle('height'),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth('tb');}}return h;},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle('width'),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth('lr');}}return w;},getSize:function(A0){return {width:this.getWidth(A0),height:this.getHeight(A0)};},getViewSize:function(){var d=this.dom,A1=document,aw=0,ah=0;if(d==A1||d==A1.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else {return {width:d.clientWidth,height:d.clientHeight};}},getValue:function(A2){return A2?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(A3){if(typeof A3=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A3-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(A3<0){A3=0;}}return A3;},adjustHeight:function(A4){if(typeof A4=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A4-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(A4<0){A4=0;}}return A4;},setWidth:function(A5,A6){A5=this.adjustWidth(A5);if(!A6||!A){this.dom.style.width=this.addUnits(A5);}else {this.anim({width:{to:A5}},this.preanim(arguments,1));}return this;},setHeight:function(A7,A8){A7=this.adjustHeight(A7);if(!A8||!A){this.dom.style.height=this.addUnits(A7);}else {this.anim({height:{to:A7}},this.preanim(arguments,1));}return this;},setSize:function(A9,BA,BB){if(typeof A9=="object"){BA=A9.height;A9=A9.width;}
 A9=this.adjustWidth(A9);BA=this.adjustHeight(BA);if(!BB||!A){this.dom.style.width=this.addUnits(A9);this.dom.style.height=this.addUnits(BA);}else {this.anim({width:{to:A9},height:{to:BA}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,BC,BD,BE){if(!BE||!A){this.setSize(BC,BD);this.setLocation(x,y);}else {BC=this.adjustWidth(BC);BD=this.adjustHeight(BD);this.anim({points:{to:[x,y]},width:{to:BC},height:{to:BD}},this.preanim(arguments,4),'motion');}return this;},setRegion:function(BF,BG){this.setBounds(BF.left,BF.top,BF.right-BF.left,BF.bottom-BF.top,this.preanim(arguments,1));return this;},addListener:function(BH,fn,BI,BJ){Roo.EventManager.on(this.dom,BH,fn,BI||this,BJ);},removeListener:function(BK,fn){Roo.EventManager.removeListener(this.dom,BK,fn);return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(BL,BM){this.on(BL,function(e){BM.fireEvent(BL,e);});},setOpacity:function(BN,BO){if(!BO||!A){var s=this.dom.style;if(Roo.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(BN==1?"":"alpha(opacity="+BN*100+")");}else {s.opacity=BN;}}else {this.anim({opacity:{to:BN}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(BP){if(!BP){return this.getX();}else {return parseInt(this.getStyle("left"),10)||0;}},getRight:function(BQ){if(!BQ){return this.getX()+this.getWidth();}else {return (this.getLeft(true)+this.getWidth())||0;}},getTop:function(BR){if(!BR){return this.getY();}else {return parseInt(this.getStyle("top"),10)||0;}},getBottom:function(BS){if(!BS){return this.getY()+this.getHeight();}else {return (this.getTop(true)+this.getHeight())||0;}},position:function(BT,BU,x,y){if(!BT){if(this.getStyle('position')=='static'){this.setStyle('position','relative');}}else {this.setStyle("position",BT);}if(BU){this.setStyle("z-index",BU);}if(x!==undefined&&y!==undefined){this.setXY([x,y]);}else if(x!==undefined){this.setX(x);}else if(y!==undefined){this.setY(y);}},clearPositioning:function(BV){BV=BV||'';this.setStyle({"left":BV,"right":BV,"top":BV,"bottom":BV,"z-index":"","position":"static"});return this;},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return {"position":this.getStyle("position"),"left":l,"right":l?"":this.getStyle("right"),"top":t,"bottom":t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")};},getBorderWidth:function(BW){return this.addStyles(BW,El.borders);},getPadding:function(BX){return this.addStyles(BX,El.paddings);},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right="";}if(pc.bottom=="auto"){this.dom.style.bottom="";}return this;},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block");}}},setLeftTop:function(BY,BZ){this.dom.style.left=this.addUnits(BY);this.dom.style.top=this.addUnits(BZ);return this;},move:function(Ba,Bb,Bc){var xy=this.getXY();Ba=Ba.toLowerCase();switch(Ba){case "l":case "left":this.moveTo(xy[0]-Bb,xy[1],this.preanim(arguments,2));break;case "r":case "right":this.moveTo(xy[0]+Bb,xy[1],this.preanim(arguments,2));break;case "t":case "top":case "up":this.moveTo(xy[0],xy[1]-Bb,this.preanim(arguments,2));break;case "b":case "bottom":case "down":this.moveTo(xy[0],xy[1]+Bb,this.preanim(arguments,2));break;}return this;},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={"o":this.getStyle("overflow"),"x":this.getStyle("overflow-x"),"y":this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden");}return this;},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o);}if(o.x){this.setStyle("overflow-x",o.x);}if(o.y){this.setStyle("overflow-y",o.y);}}return this;},getAnchorXY:function(Bd,Be,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight();}else {w=this.getWidth();h=this.getHeight();}}else {w=s.width;h=s.height;}var x=0,y=0,r=Math.round;switch((Bd||"tl").toLowerCase()){case "c":x=r(w*.5);y=r(h*.5);break;case "t":x=r(w*.5);y=0;break;case "l":x=0;y=r(h*.5);break;case "r":x=w;y=r(h*.5);break;case "b":x=r(w*.5);y=h;break;case "tl":x=0;y=0;break;case "bl":x=0;y=h;break;case "br":x=w;y=h;break;case "tr":x=w;y=0;break;}if(Be===true){return [x,y];}if(vp){var sc=this.getScroll();return [x+sc.left,y+sc.top];}var o=this.getXY();return [x+o[0],y+o[1]];},getAlignToXY:function(el,p,o){el=Roo.get(el);var d=this.dom;if(!el.dom){throw "Element.alignTo with an element that doesn't exist";}var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl";}else if(p=="?"){p="tl-bl?";}else if(p.indexOf("-")==-1){p="tl-"+p;}
 p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw "Element.alignTo with an invalid alignment "+p;}
 p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var A1=document;var scrollX=(A1.documentElement.scrollLeft||A1.body.scrollLeft||0)+5;var scrollY=(A1.documentElement.scrollTop||A1.body.scrollTop||0)+5;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];},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,Bf,Bg,Bh){el=Roo.get(el);Bg=Bg?Roo.applyIf(Bg,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Roo.lib.Dom.getViewWidth();vh=Roo.lib.Dom.getViewHeight();}else {vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!Bf){var vxy=el.getXY();vx=vxy[0];vy=vxy[1];}}var s=el.getScroll();vx+=Bg.left+s.left;vy+=Bg.top+s.top;vw-=Bg.right;vh-=Bg.bottom;var vr=vx+vw;var vb=vy+vh;var xy=Bh||(!Bf?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var Bi=false;if((x+w)>vr){x=vr-w;Bi=true;}if((y+h)>vb){y=vb-h;Bi=true;}if(x<vx){x=vx;Bi=true;}if(y<vy){y=vy;Bi=true;}return Bi?[x,y]:false;};}(),adjustForConstraints:function(xy,Bf,Bg){return this.getConstrainToXY(Bf||document,false,Bg,xy)||xy;},alignTo:function(Bh,Bi,Bj,Bk){var xy=this.getAlignToXY(Bh,Bi,Bj);this.setXY(xy,this.preanim(arguments,3));return this;},anchorTo:function(el,Bl,Bm,Bn,Bo,Bp){var Bq=function(){this.alignTo(el,Bl,Bm,Bn);Roo.callback(Bp,this);};Roo.EventManager.onWindowResize(Bq,this);var tm=typeof Bo;if(tm!='undefined'){Roo.EventManager.on(window,'scroll',Bq,this,{buffer:tm=='number'?Bo:50});}
@@ -5152,9 +388,8 @@ this.overlay.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(tr
 this.dragSpecs.startSize=F;this.dragSpecs.startPoint=[x,y];Roo.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);},onEndProxyDrag:function(e){Roo.get(this.proxy).setDisplayed(false);var G=Roo.lib.Event.getXY(e);if(this.overlay){this.overlay.hide();}var H;if(this.orientation==Roo.SplitBar.HORIZONTAL){H=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.LEFT?G[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-G[0]);}else {H=this.dragSpecs.startSize+(this.placement==Roo.SplitBar.TOP?G[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-G[1]);}
 H=Math.min(Math.max(H,this.activeMinSize),this.activeMaxSize);if(H!=this.dragSpecs.startSize){if(this.fireEvent('beforeapply',this,H)!==false){this.adapter.setElementSize(this,H);this.fireEvent("moved",this,H);this.fireEvent("resize",this,H);}}},getAdapter:function(){return this.adapter;},setAdapter:function(I){this.adapter=I;this.adapter.init(this);},getMinimumSize:function(){return this.minSize;},setMinimumSize:function(J){this.minSize=J;},getMaximumSize:function(){return this.maxSize;},setMaximumSize:function(K){this.maxSize=K;},setCurrentSize:function(L){var M=this.animate;this.animate=false;this.adapter.setElementSize(this,L);this.animate=M;},destroy:function(N){if(this.shim){this.shim.remove();}
 this.dd.unreg();this.proxy.parentNode.removeChild(this.proxy);if(N){this.el.remove();}}});Roo.SplitBar.createProxy=function(O){var P=new Roo.Element(document.createElement("div"));P.unselectable();var Q='x-splitbar-proxy';P.addClass(Q+' '+(O==Roo.SplitBar.HORIZONTAL?Q+'-h':Q+'-v'));document.body.appendChild(P.dom);return P.dom;};Roo.SplitBar.BasicLayoutAdapter=function(){};Roo.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Roo.SplitBar.HORIZONTAL){return s.resizingEl.getWidth();}else {return s.resizingEl.getHeight();}},setElementSize:function(s,R,S){if(s.orientation==Roo.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(R);if(S){S(s,R);}}else {s.resizingEl.setWidth(R,true,.1,S,'easeOut');}}else {if(!s.animate){s.resizingEl.setHeight(R);if(S){S(s,R);}}else {s.resizingEl.setHeight(R,true,.1,S,'easeOut');}}}};Roo.SplitBar.AbsoluteLayoutAdapter=function(T){this.basic=new Roo.SplitBar.BasicLayoutAdapter();this.container=Roo.get(T);};Roo.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s);},getElementSize:function(s){return this.basic.getElementSize(s);},setElementSize:function(s,U,V){this.basic.setElementSize(s,U,this.moveSplitter.createDelegate(this,[s]));},moveSplitter:function(s){var W=Roo.SplitBar;switch(s.placement){case W.LEFT:s.el.setX(s.resizingEl.getRight());break;case W.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case W.TOP:s.el.setY(s.resizingEl.getBottom());break;case W.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break;}}};Roo.SplitBar.VERTICAL=1;Roo.SplitBar.HORIZONTAL=2;Roo.SplitBar.LEFT=1;Roo.SplitBar.RIGHT=2;Roo.SplitBar.TOP=3;Roo.SplitBar.BOTTOM=4;
-Roo.View=function(A,B,C){this.el=Roo.get(A);if(typeof B=="string"){B=new Roo.Template(B);}
-B.compile();this.tpl=B;Roo.apply(this,C);this.addEvents({"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true});this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});this.selections=[];this.nodes=[];this.cmp=new Roo.CompositeElementLite([]);if(this.store){this.store=Roo.factory(this.store,Roo.data);this.setStore(this.store,true);}
-Roo.View.superclass.constructor.call(this);};Roo.extend(Roo.View,Roo.util.Observable,{selectedClass:"x-view-selected",emptyText:"",getEl:function(){return this.el;},refresh:function(){var t=this.tpl;this.clearSelections();this.el.update("");var D=[];var E=this.store.getRange();if(E.length<1){this.el.update(this.emptyText);return;}for(var i=0,len=E.length;i<len;i++){var data=this.prepareData(E[i].data,i,E[i]);D[D.length]=t.apply(data);}
+Roo.View=function(A,B,C){if(typeof(B)=='undefined'){Roo.apply(this,A);this.el=Roo.get(this.el);}else {this.el=Roo.get(A);this.tpl=B;Roo.apply(this,C);}if(typeof(this.tpl)=="string"){this.tpl=new Roo.Template(this.tpl);}this.tpl.compile();this.addEvents({"beforeclick":true,"click":true,"dblclick":true,"contextmenu":true,"selectionchange":true,"beforeselect":true});this.el.on({"click":this.onClick,"dblclick":this.onDblClick,"contextmenu":this.onContextMenu,scope:this});this.selections=[];this.nodes=[];this.cmp=new Roo.CompositeElementLite([]);if(this.store){this.store=Roo.factory(this.store,Roo.data);this.setStore(this.store,true);}
+Roo.View.superclass.constructor.call(this);};Roo.extend(Roo.View,Roo.util.Observable,{store:false,el:'',tpl:false,selectedClass:"x-view-selected",emptyText:"",getEl:function(){return this.el;},refresh:function(){var t=this.tpl;this.clearSelections();this.el.update("");var D=[];var E=this.store.getRange();if(E.length<1){this.el.update(this.emptyText);return;}for(var i=0,len=E.length;i<len;i++){var data=this.prepareData(E[i].data,i,E[i]);D[D.length]=t.apply(data);}
 this.el.update(D.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},prepareData:function(F){return F;},onUpdate:function(ds,G){this.clearSelections();var H=this.store.indexOf(G);var n=this.nodes[H];this.tpl.insertBefore(n,this.prepareData(G.data));n.parentNode.removeChild(n);this.updateIndexes(H,H);},onAdd:function(ds,I,J){this.clearSelections();if(this.nodes.length==0){this.refresh();return;}var n=this.nodes[J];for(var i=0,len=I.length;i<len;i++){var d=this.prepareData(I[i].data);if(n){this.tpl.insertBefore(n,d);}else {this.tpl.append(this.el,d);}}
 this.updateIndexes(J);},onRemove:function(ds,K,L){this.clearSelections();this.el.dom.removeChild(this.nodes[L]);this.updateIndexes(L);},refreshNode:function(M){this.onUpdate(this.store,this.store.getAt(M));},updateIndexes:function(N,O){var ns=this.nodes;N=N||0;O=O||ns.length-1;for(var i=N;i<=O;i++){ns[i].nodeIndex=i;}},setStore:function(P,Q){if(!Q&&this.store){this.store.un("datachanged",this.refresh);this.store.un("add",this.onAdd);this.store.un("remove",this.onRemove);this.store.un("update",this.onUpdate);this.store.un("clear",this.refresh);}if(P){P.on("datachanged",this.refresh,this);P.on("add",this.onAdd,this);P.on("remove",this.onRemove,this);P.on("update",this.onUpdate,this);P.on("clear",this.refresh,this);}if(P){this.refresh();}},findItemFromChild:function(R){var el=this.el.dom;if(!R||R.parentNode==el){return R;}var p=R.parentNode;while(p&&p!=el){if(p.parentNode==el){return p;}
 p=p.parentNode;}return null;},onClick:function(e){var S=this.findItemFromChild(e.getTarget());if(S){var M=this.indexOf(S);if(this.onItemClick(S,M,e)!==false){this.fireEvent("click",this,M,S,e);}}else {this.clearSelections();}},onContextMenu:function(e){var T=this.findItemFromChild(e.getTarget());if(T){this.fireEvent("contextmenu",this,this.indexOf(T),T,e);}},onDblClick:function(e){var U=this.findItemFromChild(e.getTarget());if(U){this.fireEvent("dblclick",this,this.indexOf(U),U,e);}},onItemClick:function(V,W,e){if(this.fireEvent("beforeclick",this,W,V,e)===false){return false;}if(this.multiSelect||this.singleSelect){if(this.multiSelect&&e.shiftKey&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),W),false);}else {this.select(V,this.multiSelect&&e.ctrlKey);this.lastSelection=V;}
@@ -5339,7 +574,7 @@ this.anchor=cs[h];this.textNode=cs[h].firstChild;},getAnchor:function(){return t
 p=p.parentNode;}
 this.childIndent=g.join("");}return this.childIndent;},renderIndent:function(){if(this.rendered){var indent="";var p=this.node.parentNode;if(p){indent=p.ui.getChildIndent();}if(this.indentMarkup!=indent){this.indentNode.innerHTML=indent;this.indentMarkup=indent;}
 this.updateExpandIcon();}}};Roo.tree.RootTreeNodeUI=function(){Roo.tree.RootTreeNodeUI.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.tree.RootTreeNodeUI,Roo.tree.TreeNodeUI,{render:function(){if(!this.rendered){var Z=this.node.ownerTree.innerCt.dom;this.node.expanded=true;Z.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=Z.firstChild;}},collapse:function(){},expand:function(){}});
-Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({"beforeload":true,"load":true,"loadexception":true,"create":true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(B,C){if(this.clearOnLoad){while(B.firstChild){B.removeChild(B.firstChild);}}if(B.attributes.children){var cs=B.attributes.children;for(var i=0,len=cs.length;i<len;i++){B.appendChild(this.createNode(cs[i]));}if(typeof C=="function"){C();}}else if(this.dataUrl){this.requestData(B,C);}},getParams:function(D){var E=[],bp=this.baseParams;for(var key in bp){if(typeof bp[key]!="function"){E.push(encodeURIComponent(key),"=",encodeURIComponent(bp[key]),"&");}}var n=this.queryParam===false?'node':this.queryParam;E.push(n+"=",encodeURIComponent(D.id));return E.join("");},requestData:function(F,G){if(this.fireEvent("beforeload",this,F,G)!==false){this.transId=Roo.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:G,node:F},params:this.getParams(F)});}else {if(typeof G=="function"){G();}}},isLoading:function(){return this.transId?true:false;},abort:function(){if(this.isLoading()){Roo.Ajax.abort(this.transId);}},createNode:function(attr){if(this.baseAttrs){Roo.applyIf(attr,this.baseAttrs);}if(this.applyLoader!==false){attr.loader=this;}if(typeof(attr.uiProvider)=='string'){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider);}if(typeof(this.uiProviders['default'])!='undefined'){attr.uiProvider=this.uiProviders['default'];}
+Roo.tree.TreeLoader=function(A){this.baseParams={};this.requestMethod="POST";Roo.apply(this,A);this.addEvents({beforeload:true,load:true,loadexception:true,create:true});Roo.tree.TreeLoader.superclass.constructor.call(this);};Roo.extend(Roo.tree.TreeLoader,Roo.util.Observable,{uiProviders:{},clearOnLoad:true,root:false,queryParam:false,load:function(B,C){if(this.clearOnLoad){while(B.firstChild){B.removeChild(B.firstChild);}}if(B.attributes.children){var cs=B.attributes.children;for(var i=0,len=cs.length;i<len;i++){B.appendChild(this.createNode(cs[i]));}if(typeof C=="function"){C();}}else if(this.dataUrl){this.requestData(B,C);}},getParams:function(D){var E=[],bp=this.baseParams;for(var key in bp){if(typeof bp[key]!="function"){E.push(encodeURIComponent(key),"=",encodeURIComponent(bp[key]),"&");}}var n=this.queryParam===false?'node':this.queryParam;E.push(n+"=",encodeURIComponent(D.id));return E.join("");},requestData:function(F,G){if(this.fireEvent("beforeload",this,F,G)!==false){this.transId=Roo.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:G,node:F},params:this.getParams(F)});}else {if(typeof G=="function"){G();}}},isLoading:function(){return this.transId?true:false;},abort:function(){if(this.isLoading()){Roo.Ajax.abort(this.transId);}},createNode:function(attr){if(this.baseAttrs){Roo.applyIf(attr,this.baseAttrs);}if(this.applyLoader!==false){attr.loader=this;}if(typeof(attr.uiProvider)=='string'){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider);}if(typeof(this.uiProviders['default'])!='undefined'){attr.uiProvider=this.uiProviders['default'];}
 this.fireEvent('create',this,attr);attr.leaf=typeof(attr.leaf)=='string'?attr.leaf*1:attr.leaf;return (attr.leaf?new Roo.tree.TreeNode(attr):new Roo.tree.AsyncTreeNode(attr));},processResponse:function(H,I,J){var K=H.responseText;try{var o=eval("("+K+")");if(this.root!==false){o=o[this.root];}for(var i=0,len=o.length;i<len;i++){var n=this.createNode(o[i]);if(n){I.appendChild(n);}}if(typeof J=="function"){J(this,I);}}catch(e){this.handleFailure(response);}},handleResponse:function(L){this.transId=false;var a=L.argument;this.processResponse(L,a.node,a.callback);this.fireEvent("load",this,a.node,L);},handleFailure:function(M){this.transId=false;var a=M.argument;this.fireEvent("loadexception",this,a.node,M);if(typeof a.callback=="function"){a.callback(this,a.node);}}});
 Roo.tree.TreeFilter=function(A,B){this.tree=A;this.filtered={};Roo.apply(this,B);};Roo.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(C,D,E){D=D||"text";var f;if(typeof C=="string"){var vlen=C.length;if(vlen==0&&this.clearBlank){this.clear();return;}
 C=C.toLowerCase();f=function(n){return n.attributes[D].substr(0,vlen).toLowerCase()==C;};}else if(C.exec){f=function(n){return C.test(n.attributes[D]);};}else {throw 'Illegal filter type, must be string or regex';}
@@ -5438,7 +673,7 @@ this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.lo
 this.value='';this.setRawValue('');this.lastSelectionText='';this.applyEmptyText();},setValue:function(v){var G=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){G=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){G=this.valueNotFoundText;}}
 this.lastSelectionText=G;if(this.hiddenField){this.hiddenField.value=v;}
 Roo.form.ComboBox.superclass.setValue.call(this,G);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else {console.log('no value field set for '+this.name);}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;}
-this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},findRecord:function(H,I){var J;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[H]==I){J=r;return false;}});}return J;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var K=this.view.findItemFromChild(t);if(K){var F=this.view.indexOf(K);this.select(F,false);}},onViewClick:function(L){var M=this.view.getSelectedIndexes()[0];var r=this.store.getAt(M);if(r){this.onSelect(r,M);}if(L!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var N=this.innerList.dom;var h=Math.max(N.clientHeight,N.offsetHeight,N.scrollHeight);this.innerList.setHeight(h<this.maxHeight?'auto':this.maxHeight);this.list.beginUpdate();this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);this.list.alignTo(this.el,this.listAlign);this.list.endUpdate();},onEmptyResults:function(){this.collapse();},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,O){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);if(r){this.select(this.store.indexOf(r),O);return true;}}return false;},select:function(P,Q){this.selectedIndex=P;this.view.select(P);if(Q!==false){var el=this.view.getNode(P);if(el){this.innerList.scrollChildIntoView(el,false);}}},selectNext:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,R){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:R,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}
+this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.originalValue);this.clearInvalid();this.lastData=false;},findRecord:function(H,I){var J;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[H]==I){J=r;return false;}});}return J;},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;}var K=this.view.findItemFromChild(t);if(K){var F=this.view.indexOf(K);this.select(F,false);}},onViewClick:function(L){var M=this.view.getSelectedIndexes()[0];var r=this.store.getAt(M);if(r){this.onSelect(r,M);}if(L!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var N=this.innerList.dom;var h=Math.max(N.clientHeight,N.offsetHeight,N.scrollHeight);this.innerList.setHeight(h<this.maxHeight?'auto':this.maxHeight);this.list.beginUpdate();this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);this.list.alignTo(this.el,this.listAlign);this.list.endUpdate();},onEmptyResults:function(){this.collapse();},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,O){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);if(r){this.select(this.store.indexOf(r),O);return true;}}return false;},select:function(P,Q){this.selectedIndex=P;this.view.select(P);if(Q!==false){var el=this.view.getNode(P);if(el){this.innerList.scrollChildIntoView(el,false);}}},selectNext:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;this.applyEmptyText();}},doQuery:function(q,R){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:R,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}
 q=qe.query;R=qe.forceAll;if(R===true||(q.length>=this.minChars)){if(this.lastQuery!=q){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1;if(R){this.store.clearFilter();}else {this.store.filter(this.displayField,q);}
 this.onLoad();}else {this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand();}}else {this.selectedIndex=-1;this.onLoad();}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;}return p;},collapse:function(){if(!this.isExpanded()){return;}
 this.list.hide();Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);this.fireEvent('collapse',this);},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse();}},expand:function(){if(this.isExpanded()||!this.hasFocus){return;}
@@ -5477,9 +712,12 @@ this.tb.el.hide();this.tb=this.toolbars[tn];this.tb.el.show();this.tb.fields.eac
 I.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(I){I.enable();});},buildToolbar:function(I,nm){var J=this.editor;var K=J.wrap.createChild({tag:'div'},J.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(K);tb.add(nm+":&nbsp;");for(var i in I){var item=I[i];tb.add(item.title+":&nbsp;");if(item.opts){tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val'],data:item.opts}),name:i,displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:item.width?item.width:130,listeners:{'select':function(c,r,i){tb.selectedNode.setAttribute(c.name,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;}
 tb.addField(new Roo.form.TextField({name:i,width:item.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.name,nv);}}}));}
 tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;}});
-Roo.form.BasicForm=function(el,A){Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);}
-Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,waitMsgTarget:undefined,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var B=true;this.items.each(function(f){if(!f.validate()){B=false;}});return B;},isDirty:function(){var C=false;this.items.each(function(f){if(f.isDirty()){C=true;return false;}});return C;},doAction:function(D,E){if(typeof D=='string'){D=new Roo.form.Action.ACTION_TYPES[D](this,E);}if(this.fireEvent('beforeaction',this,D)!==false){this.beforeAction(D);D.run.defer(100,D);}return this;},submit:function(F){this.doAction('submit',F);return this;},load:function(G){this.doAction('load',G);return this;},updateRecord:function(H){H.beginEdit();var fs=H.fields;fs.each(function(f){var I=this.findField(f.name);if(I){H.set(f.name,I.getValue());}},this);H.endEdit();return this;},loadRecord:function(I){this.setValues(I.data);return this;},beforeAction:function(J){var o=J.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg,'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg,'x-mask-loading');}else {Roo.MessageBox.wait(o.waitMsg,o.waitTitle||this.waitTitle||'Please Wait...');}}},afterAction:function(K,L){this.activeAction=null;var o=K.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else {Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}}if(L){if(o.reset){this.reset();}
-Roo.callback(o.success,o.scope,[this,K]);this.fireEvent('actioncomplete',this,K);}else {Roo.callback(o.failure,o.scope,[this,K]);this.fireEvent('actionfailed',this,K);}},findField:function(id){var M=this.items.get(id);if(!M){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){M=f;return false;}});}return M||null;},markInvalid:function(N){if(N instanceof Array){for(var i=0,len=N.length;i<len;i++){var fieldError=N[i];var f=this.findField(fieldError.id);if(f){f.markInvalid(fieldError.msg);}}}else {var M,id;for(id in N){if(typeof N[id]!='function'&&(M=this.findField(id))){M.markInvalid(N[id]);}}}return this;},setValues:function(O){if(O instanceof Array){for(var i=0,len=O.length;i<len;i++){var v=O[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else {var M,id;for(id in O){if(typeof O[id]!='function'&&(M=this.findField(id))){if(M.setFromData&&M.valueField&&M.displayField&&(M.store&&!M.store.isLocal)){var sd={};sd[M.valueField]=typeof(O[M.hiddenName])=='undefined'?'':O[M.hiddenName];sd[M.displayField]=typeof(O[M.name])=='undefined'?'':O[M.name];M.setFromData(sd);}else {M.setValue(O[id]);}if(this.trackResetOnLoad){M.originalValue=M.getValue();}}}}return this;},getValues:function(P){var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(P===true){return fs;}return Roo.urlDecode(fs);},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(Q){this.items.remove(Q);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);}});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;
+Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);}
+Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:undefined,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var B=true;this.items.each(function(f){if(!f.validate()){B=false;}});return B;},isDirty:function(){var C=false;this.items.each(function(f){if(f.isDirty()){C=true;return false;}});return C;},doAction:function(D,E){if(typeof D=='string'){D=new Roo.form.Action.ACTION_TYPES[D](this,E);}if(this.fireEvent('beforeaction',this,D)!==false){this.beforeAction(D);D.run.defer(100,D);}return this;},submit:function(F){this.doAction('submit',F);return this;},load:function(G){this.doAction('load',G);return this;},updateRecord:function(H){H.beginEdit();var fs=H.fields;fs.each(function(f){var I=this.findField(f.name);if(I){H.set(f.name,I.getValue());}},this);H.endEdit();return this;},loadRecord:function(I){this.setValues(I.data);return this;},beforeAction:function(J){var o=J.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg,'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg,'x-mask-loading');}else {Roo.MessageBox.wait(o.waitMsg,o.waitTitle||this.waitTitle||'Please Wait...');}}},afterAction:function(K,L){this.activeAction=null;var o=K.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else {Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}}if(L){if(o.reset){this.reset();}
+Roo.callback(o.success,o.scope,[this,K]);this.fireEvent('actioncomplete',this,K);}else {Roo.callback(o.failure,o.scope,[this,K]);this.fireEvent('actionfailed',this,K);}},findField:function(id){var M=this.items.get(id);if(!M){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){M=f;return false;}});}return M||null;},addForm:function(N){this.childForms.push(N);Roo.each(N.allItems,function(fe){if(this.findField(fe.name)){return;}
+this.add(new Roo.form.Hidden({name:fe.name}));},this);},markInvalid:function(O){if(O instanceof Array){for(var i=0,len=O.length;i<len;i++){var fieldError=O[i];var f=this.findField(fieldError.id);if(f){f.markInvalid(fieldError.msg);}}}else {var M,id;for(id in O){if(typeof O[id]!='function'&&(M=this.findField(id))){M.markInvalid(O[id]);}}}
+Roo.each(this.childForms||[],function(f){f.markInvalid(O);});return this;},setValues:function(P){if(P instanceof Array){for(var i=0,len=P.length;i<len;i++){var v=P[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else {var M,id;for(id in P){if(typeof P[id]!='function'&&(M=this.findField(id))){if(M.setFromData&&M.valueField&&M.displayField&&(M.store&&!M.store.isLocal)){var sd={};sd[M.valueField]=typeof(P[M.hiddenName])=='undefined'?'':P[M.hiddenName];sd[M.displayField]=typeof(P[M.name])=='undefined'?'':P[M.name];M.setFromData(sd);}else {M.setValue(P[id]);}if(this.trackResetOnLoad){M.originalValue=M.getValue();}}}}
+Roo.each(this.childForms||[],function(f){f.setValues(P);});return this;},getValues:function(Q){if(this.childForms){Roo.each(this.childForms,function(f){if(f.allFields){Roo.each(f.allFields,function(e){if(e.name&&e.getValue&&this.findField(e.name)){this.findField(e.name).setValue(e.getValue());}});}},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(Q===true){return fs;}return Roo.urlDecode(fs);},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(R){this.items.remove(R);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);}});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;
 Roo.form.Form=function(A){var B=[];if(A.items){B=A.items;delete A.items;}
 Roo.form.Form.superclass.constructor.call(this,null,A);this.url=this.url||this.action;if(!this.root){this.root=new Roo.form.Layout(Roo.applyIf({id:Roo.id()},A));}
 this.active=this.root;this.buttons=[];this.allItems=[];this.addEvents({clientvalidation:true,rendered:true});Roo.each(B,this.addxtype,this);};Roo.extend(Roo.form.Form,Roo.form.BasicForm,{buttonAlign:'center',minButtonWidth:75,labelAlign:'left',monitorValid:false,monitorPoll:200,column:function(c){var C=new Roo.form.Column(c);this.start(C);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return C;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls});this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;}
@@ -5578,7 +816,7 @@ this.closable=false;this.loaded=false;this.active=false;if(typeof A=="string"){t
 this.addEvents({"activate":true,"deactivate":true,"resize":true});if(this.autoScroll){this.resizeEl.setStyle("overflow","auto");}
 B=B||this.content;if(B){this.setContent(B);}if(A&&A.url){this.setUrl(this.url,this.params,this.loadOnce);}
 Roo.ContentPanel.superclass.constructor.call(this);};Roo.extend(Roo.ContentPanel,Roo.util.Observable,{tabTip:'',setRegion:function(C){this.region=C;if(C){this.el.replaceClass("x-layout-inactive-content","x-layout-active-content");}else {this.el.replaceClass("x-layout-active-content","x-layout-inactive-content");}},getToolbar:function(){return this.toolbar;},setActiveState:function(D){this.active=D;if(!D){this.fireEvent("deactivate",this);}else {this.fireEvent("activate",this);}},setContent:function(E,F){this.el.update(E,F);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else {this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(G,H,I){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);}
-this.refreshDelegate=this._handleRefresh.createDelegate(this,[G,H,I]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(J,K,L){if(!L||!this.loaded){var updater=this.el.getUpdateManager();updater.update(J,K,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(M,N){if(this.resizeEl!=this.el){M-=this.el.getFrameWidth('lr');N-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();N-=te.getHeight();te.setWidth(M);}if(this.adjustments){M+=this.adjustments[0];N+=this.adjustments[1];}return {"width":M,"height":N};},setSize:function(O,P){if(this.fitToFrame&&!this.ignoreResize(O,P)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(O,P);}var size=this.adjustForComponents(O,P);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(Q){this.title=Q;if(this.region){this.region.updatePanelTitle(this,Q);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var R=document.createElement("span");R.appendChild(this.el.dom);R.innerHTML="";this.el.remove();this.el=null;},addxtype:function(S){if(!S.xtype.match(/^Form$/)){return false;}var el=this.el.createChild();this.form=new Roo.form.Form(S);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}});Roo.GridPanel=function(T,U){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(T.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,U);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);}
+this.refreshDelegate=this._handleRefresh.createDelegate(this,[G,H,I]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(J,K,L){if(!L||!this.loaded){var updater=this.el.getUpdateManager();updater.update(J,K,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(M,N){if(this.resizeEl!=this.el){M-=this.el.getFrameWidth('lr');N-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();N-=te.getHeight();te.setWidth(M);}if(this.adjustments){M+=this.adjustments[0];N+=this.adjustments[1];}return {"width":M,"height":N};},setSize:function(O,P){if(this.fitToFrame&&!this.ignoreResize(O,P)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(O,P);}var size=this.adjustForComponents(O,P);this.resizeEl.setSize(this.autoWidth?"auto":size.width,this.autoHeight?"auto":size.height);this.fireEvent('resize',this,size.width,size.height);}},getTitle:function(){return this.title;},setTitle:function(Q){this.title=Q;if(this.region){this.region.updatePanelTitle(this,Q);}},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},destroy:function(){this.el.removeAllListeners();var R=document.createElement("span");R.appendChild(this.el.dom);R.innerHTML="";this.el.remove();this.el=null;},addxtype:function(S){if(S.xtype.match(/^Form$/)){var el=this.el.createChild();this.form=new Roo.form.Form(S);if(this.form.allItems.length)this.form.render(el.dom);return this.form;}if(['View','JsonView'].indexOf(S.xtype)>-1){S.el=this.el;var ret=new Roo[S.xtype](S);ret.render(false,'');return ret;}return false;}});Roo.GridPanel=function(T,U){this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);this.wrapper.dom.appendChild(T.getGridEl().dom);Roo.GridPanel.superclass.constructor.call(this,this.wrapper,U);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){this.footer.container=this.grid.getView().getFooterPanel(true);this.footer.dataSource=this.grid.dataSource;this.footer=Roo.factory(this.footer,Roo);}
 T.monitorWindowResize=false;T.autoHeight=false;T.autoWidth=false;this.grid=T;this.grid.getGridEl().replaceClass("x-layout-inactive-content","x-layout-component-panel");};Roo.extend(Roo.GridPanel,Roo.ContentPanel,{getId:function(){return this.grid.id;},getGrid:function(){return this.grid;},setSize:function(V,W){if(!this.ignoreResize(V,W)){var T=this.grid;var size=this.adjustForComponents(V,W);T.getGridEl().setSize(size.width,size.height);T.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip();},afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.GridPanel.superclass.destroy.call(this);}});Roo.NestedLayoutPanel=function(X,Y){Roo.NestedLayoutPanel.superclass.constructor.call(this,X.getEl(),Y);X.monitorWindowResize=false;this.layout=X;this.layout.getEl().addClass("x-layout-nested-layout");};Roo.extend(Roo.NestedLayoutPanel,Roo.ContentPanel,{setSize:function(Z,a){if(!this.ignoreResize(Z,a)){var size=this.adjustForComponents(Z,a);var el=this.layout.getEl();el.setSize(size.width,size.height);var touch=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(b){this.active=b;if(!b){this.fireEvent("deactivate",this);return;}
 this.fireEvent("activate",this);if(!this.layout){return;}var c=false;for(var r in this.layout.regions){c=this.layout.getRegion(r);if(c.getActivePanel()){c.setActivePanel(c.getActivePanel());continue;}if(!c.panels.length){continue;}
 c.showPanel(c.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(d){return this.layout.addxtype(d);}});Roo.ScrollPanel=function(el,e,f){e=e||{};e.fitToFrame=true;Roo.ScrollPanel.superclass.constructor.call(this,el,e,f);this.el.dom.style.overflow="hidden";var g=this.el.wrap({cls:"x-scroller x-layout-inactive-content"});this.el.removeClass("x-layout-inactive-content");this.el.on("mousewheel",this.onWheel,this);var up=g.createChild({cls:"x-scroller-up",html:"&#160;"},this.el.dom);var i=g.createChild({cls:"x-scroller-down",html:"&#160;"});up.unselectable();i.unselectable();up.on("click",this.scrollUp,this);i.on("click",this.scrollDown,this);up.addClassOnOver("x-scroller-btn-over");i.addClassOnOver("x-scroller-btn-over");up.addClassOnClick("x-scroller-btn-click");i.addClassOnClick("x-scroller-btn-click");this.adjustments=[0,-(up.getHeight()+i.getHeight())];this.resizeEl=this.el;this.el=g;this.up=up;this.down=i;};Roo.extend(Roo.ScrollPanel,Roo.ContentPanel,{increment:100,wheelIncrement:5,scrollUp:function(){this.resizeEl.scroll("up",this.increment,{callback:this.afterScroll,scope:this});},scrollDown:function(){this.resizeEl.scroll("down",this.increment,{callback:this.afterScroll,scope:this});},afterScroll:function(){var el=this.resizeEl;var t=el.dom.scrollTop,h=el.dom.scrollHeight,ch=el.dom.clientHeight;this.up[t==0?"addClass":"removeClass"]("x-scroller-btn-disabled");this.down[h-t<=ch?"addClass":"removeClass"]("x-scroller-btn-disabled");},setSize:function(){Roo.ScrollPanel.superclass.setSize.apply(this,arguments);this.afterScroll();},onWheel:function(e){var d=e.getWheelDelta();this.resizeEl.dom.scrollTop-=(d*this.wheelIncrement);this.afterScroll();e.stopEvent();},setContent:function(j,k){this.resizeEl.update(j,k);}});Roo.TreePanel=function(l){var el=l.el;var m=l.tree;delete l.tree;delete l.el;Roo.TreePanel.superclass.constructor.call(this,el,l);var n=el.createChild();this.tree=new Roo.tree.TreePanel(n,m);this.on('activate',function(){if(this.tree.rendered){return;}
@@ -5666,7 +904,8 @@ this.fireEvent("cellselect",this,G,H);this.fireEvent("selectionchange",this,this
 e.stopEvent();}else if(k==e.ENTER&&!e.ctrlKey){ed.completeEdit();e.stopEvent();}else if(k==e.ESC){ed.cancelEdit();}if(R){g.startEditing(R[0],R[1]);}}});
 Roo.grid.EditorGrid=function(A,B){Roo.grid.EditorGrid.superclass.constructor.call(this,A,B);this.getGridEl().addClass("xedit-grid");if(!this.selModel){this.selModel=new Roo.grid.CellSelectionModel();}
 this.activeEditor=null;this.addEvents({"beforeedit":true,"afteredit":true,"validateedit":true});this.on("bodyscroll",this.stopEditing,this);this.on(this.clicksToEdit==1?"cellclick":"celldblclick",this.onCellDblClick,this);};Roo.extend(Roo.grid.EditorGrid,Roo.grid.Grid,{clicksToEdit:2,isEditor:true,trackMouseOver:false,onCellDblClick:function(g,C,D){this.startEditing(C,D);},onEditComplete:function(ed,E,F){this.editing=false;this.activeEditor=null;ed.un("specialkey",this.selModel.onEditorKey,this.selModel);var r=ed.record;var G=this.colModel.getDataIndex(ed.col);var e={grid:this,record:r,field:G,originalValue:F,value:E,row:ed.row,column:ed.col,cancel:false,editor:ed};if(String(E)!==String(F)){if(this.fireEvent("validateedit",e)!==false&&!e.cancel){r.set(G,e.value);delete e.cancel;this.fireEvent("afteredit",e);}}else {this.fireEvent("afteredit",e);}
-this.view.focusCell(ed.row,ed.col);},startEditing:function(H,I){this.stopEditing();if(this.colModel.isCellEditable(I,H)){this.view.ensureVisible(H,I,true);var r=this.dataSource.getAt(H);var G=this.colModel.getDataIndex(I);var e={grid:this,record:r,field:G,value:r.data[G],row:H,column:I,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var ed=this.colModel.getCellEditor(I,H);if(!ed){return;}if(!ed.rendered){ed.render(ed.parentEl||document.body);}(function(){ed.row=H;ed.col=I;ed.record=r;ed.on("complete",this.onEditComplete,this,{single:true});ed.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=ed;var v=r.data[G];ed.startEdit(this.view.getCell(H,I),v);}).defer(50,this);}}},stopEditing:function(){if(this.activeEditor){this.activeEditor.completeEdit();}
+this.view.focusCell(ed.row,ed.col);},startEditing:function(H,I){this.stopEditing();if(this.colModel.isCellEditable(I,H)){this.view.ensureVisible(H,I,true);var r=this.dataSource.getAt(H);var G=this.colModel.getDataIndex(I);var e={grid:this,record:r,field:G,value:r.data[G],row:H,column:I,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var ed=this.colModel.getCellEditor(I,H);if(!ed){return;}if(!ed.rendered){ed.render(ed.parentEl||document.body);}
+ed.field.reset();(function(){ed.row=H;ed.col=I;ed.record=r;ed.on("complete",this.onEditComplete,this,{single:true});ed.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=ed;var v=r.data[G];ed.startEdit(this.view.getCell(H,I),v);}).defer(50,this);}}},stopEditing:function(){if(this.activeEditor){this.activeEditor.completeEdit();}
 this.activeEditor=null;}});
 Roo.grid.GridEditor=function(A,B){if(!B&&A.field){B=A;A=Roo.factory(B.field,Roo.form);}
 Roo.grid.GridEditor.superclass.constructor.call(this,A,B);A.monitorTab=false;};Roo.extend(Roo.grid.GridEditor,Roo.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:"frame"});
@@ -5677,3 +916,24 @@ Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store)
 Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);var s=this.html;s=['<tpl>',s,'</tpl>'].join('');var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var A=/^<tpl\b[^>]*?for="(.*?)"/;var B=/^<tpl\b[^>]*?if="(.*?)"/;var C=/^<tpl\b[^>]*?exec="(.*?)"/;var m,id=0;var D=[];while(m=s.match(re)){var m2=m[0].match(A);var m3=m[0].match(B);var m4=m[0].match(C);var exp=null,fn=null,exec=null;var name=m2&&m2[1]?m2[1]:'';if(m3){exp=m3&&m3[1]?m3[1]:null;if(exp){fn=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(exp))+'; }');}}if(m4){exp=m4&&m4[1]?m4[1]:null;if(exp){exec=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(exp))+'; }');}}if(name){switch(name){case '.':name=new Function('values','parent','with(values){ return values; }');break;case '..':name=new Function('values','parent','with(values){ return parent; }');break;default:name=new Function('values','parent','with(values){ return '+name+'; }');}}
 D.push({id:id,target:name,exec:exec,test:fn,body:m[1]||''});s=s.replace(m[0],'{xtpl'+id+'}');++id;}for(var i=D.length-1;i>=0;--i){this.compileTpl(D[i]);}
 this.master=D[D.length-1];this.tpls=D;};Roo.extend(Roo.XTemplate,Roo.Template,{re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,applySubTemplate:function(id,E,F){var t=this.tpls[id];if(t.test&&!t.test.call(this,E,F)){return '';}if(t.exec&&t.exec.call(this,E,F)){return '';}var vs=t.target?t.target.call(this,E,F):E;F=t.target?E:F;if(t.target&&vs instanceof Array){var buf=[];for(var i=0,len=vs.length;i<len;i++){buf[buf.length]=t.compiled.call(this,vs[i],F);}return buf.join('');}return t.compiled.call(this,vs,F);},compileTpl:function(G){var fm=Roo.util.Format;var H=this.disableFormats!==true;var I=Roo.isGecko?"+":",";var fn=function(m,K,L,M){if(K.substr(0,4)=='xtpl'){return "'"+I+'this.applySubTemplate('+K.substr(4)+', values, parent)'+I+"'";}var v;if(K.indexOf('.')!=-1){v=K;}else {v="values['"+K+"']";}if(L&&H){M=M?','+M:"";if(L.substr(0,5)!="this."){L="fm."+L+'(';}else {L='this.call("'+L.substr(5)+'", ';M=", values";}}else {M='';L="("+v+" === undefined ? '' : ";}return "'"+I+L+v+M+")"+I+"'";};var J;if(Roo.isGecko){J="tpl.compiled = function(values, parent){ return '"+G.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {J=["tpl.compiled = function(values, parent){ return ['"];J.push(G.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));J.push("'].join('');};");J=J.join('');}eval(J);return this;},applyTemplate:function(K){return this.master.compiled.call(this,K,{});var s=this.subs;},apply:function(){return this.applyTemplate.apply(this,arguments);},compile:function(){return this;}});Roo.XTemplate.from=function(el){el=Roo.getDom(el);return new Roo.XTemplate(el.value||el.innerHTML);};
+Roo.XComponent=function(A){Roo.apply(this,A);this.addEvents({'built':true,'buildcomplete':true,});Roo.XComponent.register(this);this.modules=false;this.el=false;}
+Roo.extend(Roo.XComponent,Roo.util.Observable,{el:false,panel:false,layout:false,disabled:false,parent:false,order:false,name:false,items:false,});Roo.apply(Roo.XComponent,{buildCompleted:false,topModule:false,modules:[],register:function(B){this.modules.push(B);},toObject:function(C){if(!C||typeof(C)=='object'){return C;}var ar=C.split('.');var rt,o;rt=ar.shift();eval('if (typeof '+rt+' == "undefined"){ o = false;} o = '+rt+';');if(o===false){throw "Module not found : "+C;}
+Roo.each(ar,function(e){if(typeof(o[e])=='undefined'){throw "Module not found : "+C;}
+o=o[e];});return o;},preBuild:function(){Roo.each(this.modules,function(D){D.parent=this.toObject(D.parent);if(!D.parent){this.topModule=D;return;}if(!D.parent.modules){D.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});}
+D.parent.modules.add(D);},this);},buildOrder:function(){var D=this;var E=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;};if(!this.topModule||!this.topModule.modules){throw "No top level modules to build";}var F=[this.topModule];var G=function(m){F.push(m);if(m.modules){m.modules.keySort('ASC',E);m.modules.each(G);}if(m.finalize){m.finalize.name=m.name+" (clean up) ";F.push(m.finalize);}}
+this.topModule.modules.keySort('ASC',E);this.topModule.modules.each(G);return F;},build:function(){this.preBuild();var H=this.buildOrder();if(!H.length){throw "NO modules!!!";}
+Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:"Building Interface...",width:450,progress:true,closable:false,modal:false});var I=H.length;var J=this;var K=function(){if(!H.length){console.log('hide?');Roo.MessageBox.hide();J.topModule.fireEvent('buildcomplete',J.topModule);return;}var m=H.shift();console.log(m);if(typeof(m)=='function'){m.call(this);return K.defer(10,J);}Roo.MessageBox.updateProgress((I-H.length)/I,"Building Interface "+(I-H.length)+" of "+I+(m.name?(' - '+m.name):''));var L=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(L){return K();}if(!m.parent){var layoutbase=new Ext.BorderLayout(document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,minTabWidth:140}});var M=m.tree();M.region='center';m.el=layoutbase.addxtype(M);m.panel=m.el;m.layout=m.panel.layout;return K.defer(10,J);}var M=m.tree();M.region=M.region||m.region;m.el=m.parent.el.addxtype(M);m.fireEvent('built',m);m.panel=m.el;m.layout=m.panel.layout;K.defer(10,J);}
+K.defer(1,J);}});
+Roo.Login=function(A){this.addEvents({'refreshed':true,});Roo.apply(this,A);Roo.onReady(function(){this.onLoad();},this);Roo.Login.superclass.constructor.call(this,this);}
+Roo.extend(Roo.Login,Roo.LayoutDialog,{method:'POST',url:'',user:false,checkFails:0,intervalID:0,onLoad:function(){if(Roo.get('loading')){Roo.get('loading').remove();}
+this.check({success:function(B,C){var D=this.processResponse(B);this.checkFails=0;if(!D.success){this.checkFails=5;return this.failure(B,C);}if(!D.data.id){return this.show();}
+this.fillAuth(D.data);this.checkFails=0;Roo.XComponent.build();},failure:this.show});},check:function(B){if(B.again){this.checkFails++;}else {this.checkFails=0;}var C=this;if(this.sending){if(this.checkFails>4){Roo.MessageBox.alert("Error","Error getting authentication status. - try reloading, or wait a while",function(){C.sending=false;});return;}
+B.again=true;C.check.defer(10000,C,[B]);return;}
+this.sending=true;Roo.Ajax.request({url:this.url,params:{getAuthUser:true},method:this.method,success:B.success||this.success,failure:B.failure||this.failure,scope:this,callCfg:B});},logout:function(){window.onbeforeunload=function(){};this.user=false;var D=this;Roo.Ajax.request({url:this.url,params:{logout:1},method:'GET',failure:function(){Roo.MessageBox.alert("Error","Error logging out. - continuing anyway.",function(){document.location=document.location.toString()+'?ts='+Math.random();});},success:function(){D.user=false;this.checkFails=0;document.location=document.location.toString()+'?ts='+Math.random();}});},processResponse:function(E){var F='';try{F=Roo.decode(E.responseText);if(typeof(F)!='object'){F={success:false,errorMsg:F,errors:true};}if(typeof(F.success)=='undefined'){F.success=false;}}catch(e){res={success:false,errorMsg:response.responseText,errors:true};}return F;},success:function(G,H){this.sending=false;var I=this.processResponse(G);if(!I.success){return this.failure(G,H);}if(!I.data||!I.data.id){return this.failure(G,H);}
+this.fillAuth(I.data);this.checkFails=0;},failure:function(J,K){this.authUser=-1;this.sending=false;var L=this.processResponse(J);if(this.checkFails>2){Roo.MessageBox.alert("Error",L.errorMsg?L.errorMsg:"Error getting authentication status. - try reloading");return;}
+K.callCfg.again=true;this.check.defer(1000,this,[K.callCfg]);return;},fillAuth:function(au){this.startAuthCheck();this.authUserId=au.id;this.authUser=au;this.lastChecked=new Date();this.fireEvent('refreshed',au);au.lang=au.lang||'en';Roo.state.Manager.set(this.realm+'lang',au.lang);this.switchLang(au.lang);if(this.authUserId<0){Roo.MessageBox.alert("Warning","This is an open system - please set up a admin user with a password.");}},startAuthCheck:function(){if(this.intervalID){return false;}var M=this;this.intervalID=window.setInterval(function(){M.check(false);},120000);},switchLang:function(N){_T=typeof(_T)=='undefined'?false:_T;if(!_T||!N.length){return;}if(!_T&&N!='en'){Roo.MessageBox.alert("Sorry","Language not available yet ("+N+')');return;}if(typeof(_T.en)=='undefined'){_T.en={};Roo.apply(_T.en,_T);}if(typeof(_T[N])=='undefined'){Roo.MessageBox.alert("Sorry","Language not available yet ("+N+')');return;}
+Roo.apply(_T,_T[N]);var O=this;},title:"Login",modal:true,width:350,height:180,shadow:true,minWidth:200,minHeight:180,closable:false,draggable:false,collapsible:false,resizable:false,center:{autoScroll:false,titlebar:false,hideTabs:true,closeOnTab:true,alwaysShowTabs:false},listeners:{show:function(P){this.form=this.layout.getRegion('center').activePanel.form;this.form.dialog=P;this.buttons[0].form=this.form;this.buttons[0].dialog=Pthis.buttons[1].form=this.form;this.buttons[1].dialog=P;if(this.disabled){this.hide();return;}if(this.user.id<0){return;}if(this.intervalID){window.clearInterval(this.intervalID);this.intervalID=false;}if(Roo.get('loading')){Roo.get('loading').remove();}if(Roo.get('loading-mask')){Roo.get('loading-mask').hide();}
+this.form.reset();this.el.unmask();this.form.setValues({'username':Roo.state.Manager.get(this.realm+'.username',''),'lang':Roo.state.Manager.get(this.realm+'.lang','en')});this.switchLang(Roo.state.Manager.get(this.realm+'.lang','en'));if(this.form.findField('username').getValue().length>0){this.form.findField('password').focus();}else {this.form.findField('username').focus();}}},items:[{xtype:'ContentPanel',xns:Roo,region:'center',fitToFrame:true,items:[{xtype:'Form',xns:Roo.form,labelWidth:100,style:'margin: 10px;',listeners:{actionfailed:function(f,Q){this.dialog.el.unmask();Roo.MessageBox.alert("Error",Q.result.errorMsg?Q.result.errorMsg:"Login failed - communication error - try again.");},actioncomplete:function(re,R){Roo.state.Manager.set(this.dialog.realm+'.username',this.findField('username').getValue());Roo.state.Manager.set(this.dialog.realm+'.lang',this.findField('lang').getValue());this.dialog.fillAuth(R.result.data);this.dialog.hide();if(Roo.get('loading-mask')){Roo.get('loading-mask').show();}
+Roo.XComponent.build();}},items:[{xtype:'TextField',xns:Roo.form,fieldLabel:"Email Address",name:'username',width:200,autoCreate:{tag:"input",type:"text",size:"20"}},{xtype:'TextField',xns:Roo.form,fieldLabel:"Password",inputType:'password',name:'password',width:200,autoCreate:{tag:"input",type:"text",size:"20"},listeners:{specialkey:function(e,ev){if(ev.keyCode==13){this.form.dialog.el.mask("Logging in");this.form.doAction('submit',{url:this.form.dialog.url,method:this.form.dialog.method,});}}}},{xtype:'ComboBox',xns:Roo.form,fieldLabel:"Language",name:'langdisp',store:{xtype:'SimpleStore',fields:['lang','ldisp'],data:[['en','English'],['zh_HK','\u7E41\u4E2D'],['zh_CN','\u7C21\u4E2D']]},valueField:'lang',hiddenName:'lang',width:200,displayField:'ldisp',typeAhead:false,editable:false,mode:'local',triggerAction:'all',emptyText:'Select a Language...',selectOnFocus:true,listeners:{select:function(cb,S,ix){this.form.switchLang(S.data.lang);}}}]}]}],buttons:[{xtype:'Button',xns:'Roo',text:"Forgot Password",listeners:{click:function(){var n=this.form.findField('username').getValue();if(!n.length){Roo.MessageBox.alert("Error","Fill in your email address");return;}
+Roo.Ajax.request({url:this.dialog.url,params:{passwordRequest:n},method:this.dialog.method,success:function(T,U){var V=this.dialog.processResponse(T);if(!V.success){Roo.MessageBox.alert("Error",V.errorMsg?V.errorMsg:"Problem Requesting Password Reset");return;}
+Roo.MessageBox.alert("Notice","Please check you email for the Password Reset message");},failure:function(){Roo.MessageBox.alert("Error","Problem Requesting Password Reset");}});}}},{xtype:'Button',xns:'Roo',text:"Login",listeners:{click:function(){this.dialog.el.mask("Logging in");this.form.doAction('submit',{url:this.dialog.url,method:this.dialog.method});}}}]})