roojs-core.js
[roojs1] / roojs-core.js
index 2408f3a..5b5b74e 100644 (file)
@@ -18,7 +18,8 @@ i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==un
 },destroy:function(){for(var i=0,a=arguments,S=a.length;i<S;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,S){return v===null||v===undefined||(!S?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isIE11:H,isEdge:I,isGecko:J,isBorderBox:K,isWindows:L,isLinux:N,isMac:M,isIOS:P,isAndroid:Q,isTouch:R,useShims:((F&&!G)||(J&&M)),selectNode:function(S,T){var U=Roo.DomQuery.selectNode(S,T);
-return U?Roo.get(U):new Roo.Element(false);}});})();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","Roo.bootstrap","Roo.bootstrap.dash");
+return U?Roo.get(U):new Roo.Element(false);},getGridSize:function(){var w=Roo.lib.Dom.getViewWidth();switch(true){case w>1200:return 'xl';case w>992:return 'lg';case w>768:return 'md';case w>576:return 'sm';default:return 'xs'}}});})();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.js
 (function(){if(Roo.isIE){function fnCleanUp(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",fnCleanUp);}window.attachEvent("onunload",fnCleanUp);
 }})();Roo.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A);};},createDelegate:function(A,B,C){var D=this;return function(){var E=B||arguments;if(C===true){E=Array.prototype.slice.call(arguments,0);
@@ -28,28 +29,29 @@ E=E.concat(B);}else if(typeof C=="number"){E=Array.prototype.slice.call(argument
 // String.js
 Roo.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1");},leftPad:function(A,B,ch){var C=new String(A);if(ch===null||ch===undefined||ch===''){ch=" ";}while(C.length<B){C=ch+C;}return C;},format:function(A){var B=Array.prototype.slice.call(arguments,1);
 return A.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(B[i]);});}});String.prototype.toggle=function(A,B){return this==A?B:A;};String.prototype.unicodeClean=function(){return this.replace(/[\s\S]/g,function(A){if(A.charCodeAt()<256){return A;
-}try{encodeURIComponent(A);}catch(e){return '';}return A;});};
+}try{encodeURIComponent(A);}catch(e){return '';}return A;});};String.prototype.toUpperCaseFirst=function(){return this.charAt(0).toUpperCase()+this.slice(1);};
 // Number.js
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
 // Array.js
 Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;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(A){var B=this.length>>>0;if(typeof A!="function"){throw new TypeError();
 }var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;},equals:function(b){if(this===b){return true;}if(b==null){return false;}if(this.length!==b.length){return false;}for(var i=0;i<this.length;
-++i){if(this[i]!==b[i]){return false;}}return true;}});
+++i){if(this[i]!==b[i]){return false;}}return true;}});Roo.applyIf(Array,{from:function(o){var A=[];for(var i=0;i<o.length;i++){A[i]=o[i];}return A;}});
 // Date.js
-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(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);
-}var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;
-var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!D&&ch=="\\"){D=true;}else if(D){D=false;C+="'"+String.escape(ch)+"' + ";}else{C+=Date.getFormatCode(ch);}}eval(C.substring(0,C.length-3)+";}");};Date.getFormatCode=function(A){switch(A){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 "P":return "this.getGMTColonOffset() + ";case "T":return "this.getTimezone() + ";case "Z":return "(this.getTimezoneOffset() * -60) + ";
-default:return "'"+String.escape(A)+"' + ";}};Date.parseDate=function(A,B){if(Date.parseFunctions[B]==null){Date.createParser(B);}var C=Date.parseFunctions[B];return Date[C](A);};Date.createParser=function(A){var B="parse"+Date.parseFunctions.count++;var C=Date.parseRegexes.length;
-var D=1;Date.parseFunctions[A]=B;var E="Date."+B+" = 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"+"if (typeof(input) !== 'string') { input = input.toString(); }\n"+"var results = input.match(Date.parseRegexes["+C+"]);\n"+"if (results && results.length > 0) {";
-var F="";var G=false;var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!G&&ch=="\\"){G=true;}else if(G){G=false;F+=String.escape(ch);}else{var H=Date.formatCodeToRegex(ch,D);D+=H.g;F+=H.s;if(H.g&&H.c){E+=H.c;}}}E+="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.prototype.getElapsed=function(A,B){A=A||new Date();var C=Math.abs(A.getTime()-this.getTime());switch(B){case Date.SECOND:return Math.floor(C/(1000));case Date.MINUTE:return Math.floor(C/(1000*60));case Date.HOUR:return Math.floor(C/(1000*60*60));case Date.DAY:return Math.floor(C/(1000*60*60*24));
+case Date.MONTH:return ((A.format("Y")-this.format("Y"))*12)+(A.format("m")-this.format("m"));case Date.YEAR:return (A.format("Y")-this.format("Y"));case Date.MILLI:default:return C;}};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0}
+;Date.prototype.dateFormat=function(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);}var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;
+Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!D&&ch=="\\"){D=true;}else if(D){D=false;C+="'"+String.escape(ch)+"' + ";}else{C+=Date.getFormatCode(ch);}}eval(C.substring(0,C.length-3)+";}");
+};Date.getFormatCode=function(A){switch(A){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 "P":return "this.getGMTColonOffset() + ";
+case "T":return "this.getTimezone() + ";case "Z":return "(this.getTimezoneOffset() * -60) + ";default:return "'"+String.escape(A)+"' + ";}};Date.parseDate=function(A,B){if(Date.parseFunctions[B]==null){Date.createParser(B);}var C=Date.parseFunctions[B];return Date[C](A);
+};Date.createParser=function(A){var B="parse"+Date.parseFunctions.count++;var C=Date.parseRegexes.length;var D=1;Date.parseFunctions[A]=B;var E="Date."+B+" = 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"+"if (typeof(input) !== 'string') { input = input.toString(); }\n"+"var results = input.match(Date.parseRegexes["+C+"]);\n"+"if (results && results.length > 0) {";
+var F="";var G=false;var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!G&&ch=="\\"){G=true;}else if(G){G=false;F+=String.escape(ch);}else{var H=Date.formatCodeToRegex(ch,D);D+=H.g;F+=H.s;if(H.g&&H.c){E+=H.c;}}}E+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"+"{v = new Date(y, m, d, h, i, s); v.setFullYear(y);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i); v.setFullYear(y);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h); v.setFullYear(y);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d); v.setFullYear(y);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m); v.setFullYear(y);}\n"+"else if (y >= 0)\n"+"{v = new Date(y); v.setFullYear(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[C]=new RegExp("^"+F+"$");eval(E);};Date.formatCodeToRegex=function(A,B){switch(A){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+B+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+B+"], 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["+B+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"}
-;case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{2})"}
+;case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = Math.max(0,parseInt(results["+B+"], 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["+B+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+B+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"}
 ;case "a":return {g:1,c:"if (results["+B+"] == '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["+B+"] == '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["+B+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"}
@@ -156,6 +158,24 @@ i<G;++i){if(B[i]==F){return i;}}return -1;};var E=function(F){var G=F.totalFrame
 // Roo/lib/Beizer.js
 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]];};};
+// Roo/lib/Color.js
+Roo.lib.Color=function(){};Roo.apply(Roo.lib.Color.prototype,{rgb:null,hsv:null,hsl:null,getIntegerRGB:function(){var A=this.getRGB();return {'r':Math.round(A.r),'g':Math.round(A.g),'b':Math.round(A.b),'a':A.a};},getPercentageRGB:function(){var A=this.getRGB();
+return {'r':100*A.r/255,'g':100*A.g/255,'b':100*A.b/255,'a':A.a};},getCSSHexadecimalRGB:function(){var A=this.getIntegerRGB();var B=A.r.toString(16);var C=A.g.toString(16);var D=A.b.toString(16);return '#'+(B.length==2?B:'0'+B)+(C.length==2?C:'0'+C)+(D.length==2?D:'0'+D);
+},getCSSIntegerRGB:function(){var A=this.getIntegerRGB();return 'rgb('+A.r+','+A.g+','+A.b+')';},getCSSIntegerRGBA:function(){var A=this.getIntegerRGB();return 'rgb('+A.r+','+A.g+','+A.b+','+A.a+')';},getCSSPercentageRGB:function(){var A=this.getPercentageRGB();
+return 'rgb('+A.r+'%,'+A.g+'%,'+A.b+'%)';},getCSSPercentageRGBA:function(){var A=this.getPercentageRGB();return 'rgb('+A.r+'%,'+A.g+'%,'+A.b+'%,'+A.a+')';},getCSSHSL:function(){var A=this.getHSL();return 'hsl('+A.h+','+A.s+'%,'+A.l+'%)';},getCSSHSLA:function(){var A=this.getHSL();
+return 'hsl('+A.h+','+A.s+'%,'+A.l+'%,'+A.a+')';},setNodeColor:function(A){A.style.color=this.getCSSHexadecimalRGB();},setNodeBackgroundColor:function(A){A.style.backgroundColor=this.getCSSHexadecimalRGB();},toRGB:function(){var r=this.getIntegerRGB();return new Roo.lib.RGBColor(r.r,r.g,r.b,r.a);
+},toHSL:function(){var A=this.getHSL();return new Roo.lib.HSLColor(A.h,A.s,A.l,A.a);},toHSV:function(){var A=this.toRGB();var B=A.getHSV();return new Roo.lib.HSVColor(B.h,B.s,B.v,B.a);},saturate:function(v){var A=this.toRGB();var B=A.getHSV();return new Roo.lib.HSVColor(B.h,B.s*v,B.v,B.a);
+},getRGB:function(){return {'r':this.rgb.r,'g':this.rgb.g,'b':this.rgb.b,'a':this.alpha};},getHSV:function(){if(this.hsv==null){this.calculateHSV();}return {'h':this.hsv.h,'s':this.hsv.s,'v':this.hsv.v,'a':this.alpha};},getHSL:function(){if(this.hsl==null){this.calculateHSL();
+}return {'h':this.hsl.h,'s':this.hsl.s,'l':this.hsl.l,'a':this.alpha};}});Roo.lib.RGBColor=function(r,g,b,a){this.alpha=(a===undefined?1:Math.max(0,Math.min(1,a)));this.rgb={'r':Math.max(0,Math.min(255,r)),'g':Math.max(0,Math.min(255,g)),'b':Math.max(0,Math.min(255,b))}
+;};Roo.extend(Roo.lib.RGBColor,Roo.lib.Color,{getHue:function(A,B){var C=this.rgb;if(B==0){var D=0;}else{switch(A){case C.r:var D=(C.g-C.b)/B*60;if(D<0){D+=360;}break;case C.g:var D=(C.b-C.r)/B*60+120;break;case C.b:var D=(C.r-C.g)/B*60+240;break;}}return D;
+},calculateHSV:function(){var A=this.rgb;var B=Math.max(A.r,A.g,A.b);var C=B-Math.min(A.r,A.g,A.b);this.hsv={'h':this.getHue(B,C),'s':(B==0?0:100*C/B),'v':B/2.55};},calculateHSL:function(){var A=this.rgb;var B=Math.max(A.r,A.g,A.b);var C=B-Math.min(A.r,A.g,A.b);
+var l=B/255-C/510;this.hsl={'h':this.getHue(B,C),'s':(C==0?0:C/2.55/(l<0.5?l*2:2-l*2)),'l':100*l};}});Roo.lib.HSVColor=function(h,s,v,a){this.alpha=(a===undefined?1:Math.max(0,Math.min(1,a)));this.hsv={'h':(h%360+360)%360,'s':Math.max(0,Math.min(100,s)),'v':Math.max(0,Math.min(100,v))}
+;this.rgb=null;this.hsl=null;};Roo.extend(Roo.lib.HSVColor,Roo.lib.Color,{calculateRGB:function(){var A=this.hsv;if(A.s==0){var r=A.v;var g=A.v;var b=A.v;}else{var f=A.h/60-Math.floor(A.h/60);var p=A.v*(1-A.s/100);var q=A.v*(1-A.s/100*f);var t=A.v*(1-A.s/100*(1-f));
+switch(Math.floor(A.h/60)){case 0:var r=A.v;var g=t;var b=p;break;case 1:var r=q;var g=A.v;var b=p;break;case 2:var r=p;var g=A.v;var b=t;break;case 3:var r=p;var g=q;var b=A.v;break;case 4:var r=t;var g=p;var b=A.v;break;case 5:var r=A.v;var g=p;var b=q;
+break;}}this.rgb={'r':r*2.55,'g':g*2.55,'b':b*2.55};},calculateHSL:function(){var A=this.hsv;var l=(2-A.s/100)*A.v/2;this.hsl={'h':A.h,'s':A.s*A.v/(l<50?l*2:200-l*2),'l':l};if(isNaN(hsl.s)){hsl.s=0;}}});Roo.lib.HSLColor=function(h,s,l,a){this.alpha=(a===undefined?1:Math.max(0,Math.min(1,a)));
+this.hsl={'h':(h%360+360)%360,'s':Math.max(0,Math.min(100,s)),'l':Math.max(0,Math.min(100,l))};};Roo.extend(Roo.lib.HSLColor,Roo.lib.Color,{calculateRGB:function(){if(this.hsl.s==0){this.rgb={'r':this.hsl.l*2.55,'g':this.hsl.l*2.55,'b':this.hsl.l*2.55};}else{var p=this.hsl.l<50?this.hsl.l*(1+hsl.s/100):this.hsl.l+hsl.s-hsl.l*hsl.s/100;
+var q=2*hsl.l-p;this.rgb={'r':(h+120)/60%6,'g':h/60,'b':(h+240)/60%6};for(var A in this.rgb){if(this.rgb.hasOwnProperty(A)){if(this.rgb[A]<1){this.rgb[A]=q+(p-q)*this.rgb[A];}else if(this.rgb[A]<3){this.rgb[A]=p;}else if(this.rgb[A]<4){this.rgb[A]=q+(p-q)*(4-this.rgb[A]);
+}else{this.rgb[A]=q;}this.rgb[A]*=2.55;}}}},calculateHSV:function(){var t=this.hsl.s*(this.hsl.l<50?this.hsl.l:100-this.hsl.l)/100;this.hsv={'h':this.hsl.h,'s':200*t/(this.hsl.l+t),'v':t+this.hsl.l};if(isNaN(this.hsv.s)){this.hsv.s=0;}}});
 // Roo/lib/ColorAnim.js
 (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;
@@ -190,28 +210,52 @@ i<J;++i){H[i]=[G[0]+H[i][0],G[1]+H[i][1]];}}this.runtimeAttributes[E]=[G];if(H.l
 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/lib/UndoManager.js
+Roo.lib.UndoManager=function(A,B){this.stack=[];this.limit=A;this.scope=B;this.fireEvent=typeof CustomEvent!='undefined'&&B&&B.dispatchEvent;if(this.fireEvent){this.bindEvents();}this.reset();};Roo.lib.UndoManager.prototype={limit:false,stack:false,scope:false,fireEvent:false,position:0,length:0,transact:function(A,B){if(arguments.length<2){throw new TypeError('Not enough arguments to UndoManager.transact.');
+}A.execute();this.stack.splice(0,this.position);if(B&&this.length){this.stack[0].push(A);}else{this.stack.unshift([A]);}this.position=0;if(this.limit&&this.stack.length>this.limit){this.length=this.stack.length=this.limit;}else{this.length=this.stack.length;
+}if(this.fireEvent){this.scope.dispatchEvent(new CustomEvent('DOMTransaction',{detail:{transactions:this.stack[0].slice()},bubbles:true,cancelable:false}));}},undo:function(){if(this.position<this.length){for(var i=this.stack[this.position].length-1;i>=0;
+i--){this.stack[this.position][i].undo();}this.position++;if(this.fireEvent){this.scope.dispatchEvent(new CustomEvent('undo',{detail:{transactions:this.stack[this.position-1].slice()},bubbles:true,cancelable:false}));}}},redo:function(){if(this.position>0){for(var i=0,n=this.stack[this.position-1].length;
+i<n;i++){this.stack[this.position-1][i].redo();}this.position--;if(this.fireEvent){this.scope.dispatchEvent(new CustomEvent('redo',{detail:{transactions:this.stack[this.position].slice()},bubbles:true,cancelable:false}));}}},item:function(A){if(A>=0&&A<this.length){return this.stack[A].slice();
+}return null;},clearUndo:function(){this.stack.length=this.length=this.position;},clearRedo:function(){this.stack.splice(0,this.position);this.position=0;this.length=this.stack.length;},reset:function(){this.stack=[];this.position=0;this.length=0;this.current_html=this.scope.innerHTML;
+if(this.timer!==false){clearTimeout(this.timer);}this.timer=false;this.merge=false;this.addEvent();},current_html:'',timer:false,merge:false,bindEvents:function(){var el=this.scope;el.undoManager=this;this.scope.addEventListener('keydown',function(e){if((e.ctrlKey||e.metaKey)&&e.keyCode===90){if(e.shiftKey){el.undoManager.redo();
+}else{el.undoManager.undo();}e.preventDefault();}});this.scope.addEventListener('keyup',function(e){if((e.ctrlKey||e.metaKey)&&e.keyCode===90){e.preventDefault();}});var t=this;el.addEventListener('input',function(e){if(el.innerHTML==t.current_html){return;
+}if(t.timer!==false){clearTimeout(t.timer);t.timer=false;}t.timer=setTimeout(function(){t.merge=false;},1000);t.addEvent(t.merge);t.merge=true;});},addEvent:function(A){A=typeof(A)=='undefined'?false:A;this.scope.undoManager.transact({scope:this.scope,oldHTML:this.current_html,newHTML:this.scope.innerHTML,execute:function(){}
+,undo:function(){this.scope.innerHTML=this.current_html=this.oldHTML;},redo:function(){this.scope.innerHTML=this.current_html=this.newHTML;}},false);this.merge=A;this.current_html=this.scope.innerHTML;}};
+// Roo/lib/Range.js
+Roo.lib.Range=function(){};Roo.lib.Range.wrap=function(r){return Roo.apply(r,Roo.lib.Range.prototype);};Roo.apply(Roo.lib.Range.prototype,{closest:function(A){if(typeof(A)!='string'){for(var i=0;i<A.length;i++){var r=this.closest(A[i]);if(r!==false){return r;
+}}return false;}A=A.toLowerCase();var n=this.commonAncestorContainer;while(n.nodeType!=1){n=n.parentNode;}if(n.nodeName.toLowerCase()==A){return n;}if(n.nodeName.toLowerCase()=='body'){return false;}return n.closest(A)||false;},cloneRange:function(){return Roo.lib.Range.wrap(Range.prototype.cloneRange.call(this));
+}});
+// Roo/lib/Selection.js
+Roo.lib.Selection=function(){};Roo.lib.Selection.wrap=function(r,A){Roo.apply(r,Roo.lib.Selection.prototype);r.ownerDocument=A;return r;};Roo.apply(Roo.lib.Selection.prototype,{ownerDocument:false,getRangeAt:function(n){return Roo.lib.Range.wrap(Selection.prototype.getRangeAt.call(this,n));
+},insertNode:function(A,B){if(typeof(A)=='string'){A=this.ownerDocument.createElement(A);if(B=='in'){A.innerHTML='&nbsp;';}}var C=this.getRangeAt(0);if(this.type!='Caret'){C.deleteContents();}var sn=A.childNodes[0];C.insertNode(A);if(B=='after'){A.insertAdjacentHTML('afterend','&nbsp;');
+sn=A.nextSibling;}if(B=='none'){return;}this.cursorText(sn);},cursorText:function(n){range=Roo.lib.Range.wrap(new Range());var ix=Array.from(n.parentNode.childNodes).indexOf(n);range.setStart(n.parentNode,ix);range.setEnd(n.parentNode,ix+1);this.removeAllRanges();
+this.addRange(range);Roo.log([n,range,this,this.baseOffset,this.extentOffset,this.type]);},cursorAfter:function(n){if(!n.nextSibling||n.nextSibling.nodeValue!='&nbsp;'){n.insertAdjacentHTML('afterend','&nbsp;');}this.cursorText(n.nextSibling);}});
 // Roo/DomHelper.js
 if(typeof Range!="undefined"&&typeof Range.prototype.createContextualFragment=="undefined"){Range.prototype.createContextualFragment=function(A){var B=window.document;var C=B.createElement("div");C.innerHTML=A;var D=B.createDocumentFragment(),n;while((n=C.firstChild)){D.appendChild(n);
 }return D;};}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 M in o){if(M=="tag"||M=="children"||M=="cn"||M=="html"||typeof o[M]=="function"){continue;}if(M=="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 N in s){if(typeof s[N]!="function"){b+=N+":"+s[N]+";";
-}}b+='"';}}else{if(M=="cls"){b+=' class="'+o["cls"]+'"';}else if(M=="htmlFor"){b+=' for="'+o["htmlFor"]+'"';}else{b+=" "+M+'="'+o[M]+'"';}}}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,O=cn.length;
-i<O;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 O in o){if(O=="tag"||O=="ns"||O=="xmlns"||O=="children"||O=="cn"||O=="html"||O=="style"||typeof o[O]=="function"){continue;}if(O=="cls"&&Roo.isIE){el.className=o["cls"];}else{if(N){el.setAttribute(O=="cls"?'class':O,o[O]);}else{el[O]=o[O];}}}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,P=cn.length;i<P;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,M){if(M){el=Roo.fly(el);if(typeof M=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var N;
-while((N=re.exec(M))!=null){el.setStyle(N[1],N[2]);}}else if(typeof M=="object"){for(var O in M){el.setStyle(O,M[O]);}}else if(typeof M=="function"){Roo.DomHelper.applyStyles(el,M.call());}}},insertHtml:function(M,el,N){M=M.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;
-if(rs=L(el.tagName.toLowerCase(),M,el,N)){return rs;}}switch(M){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',N);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',N);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',N);
-return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',N);return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';}var O=el.ownerDocument.createRange();var P;switch(M){case "beforebegin":O.setStartBefore(el);P=O.createContextualFragment(N);
-el.parentNode.insertBefore(P,el);return el.previousSibling;case "afterbegin":if(el.firstChild){O.setStartBefore(el.firstChild);P=O.createContextualFragment(N);el.insertBefore(P,el.firstChild);return el.firstChild;}else{el.innerHTML=N;return el.firstChild;
-}case "beforeend":if(el.lastChild){O.setStartAfter(el.lastChild);P=O.createContextualFragment(N);el.appendChild(P);return el.lastChild;}else{el.innerHTML=N;return el.lastChild;}case "afterend":O.setStartAfter(el);P=O.createContextualFragment(N);el.parentNode.insertBefore(P,el.nextSibling);
-return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';},insertBefore:function(el,o,M){return this.doInsert(el,o,M,"beforeBegin");},insertAfter:function(el,o,M){return this.doInsert(el,o,M,"afterEnd","nextSibling");},insertFirst:function(el,o,M){return this.doInsert(el,o,M,"afterBegin");
-},doInsert:function(el,o,M,N,O){el=Roo.getDom(el);var P;if(this.useDom||o.ns){P=F(o,null);el.parentNode.insertBefore(P,O?el[O]:el);}else{var Q=E(o);P=this.insertHtml(N,el,Q);}return M?Roo.get(P,true):P;},append:function(el,o,M){el=Roo.getDom(el);var N;if(this.useDom||o.ns){N=F(o,null);
-el.appendChild(N);}else{var O=E(o);N=this.insertHtml("beforeEnd",el,O);}return M?Roo.get(N,true):N;},overwrite:function(el,o,M){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}F(o,el);}else{el.innerHTML=E(o);}return M?Roo.get(el.firstChild,true):el.firstChild;
-},createTemplate:function(o){var M=E(o);return new Roo.Template(M);}};}();
+for(var N in o){if(N=="tag"||N=="children"||N=="cn"||N=="html"||typeof o[N]=="function"){continue;}if(N=="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 O in s){if(typeof s[O]!="function"){b+=O+":"+s[O]+";";
+}}b+='"';}}else{if(N=="cls"){b+=' class="'+o["cls"]+'"';}else if(N=="htmlFor"){b+=' for="'+o["htmlFor"]+'"';}else{b+=" "+N+'="'+o[N]+'"';}}}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,P=cn.length;
+i<P;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,N){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 N.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 O=el.setAttribute?true:false;
+for(var P in o){if(P=="tag"||P=="ns"||P=="xmlns"||P=="children"||P=="cn"||P=="html"||P=="style"||typeof o[P]=="function"){continue;}if(P=="cls"&&Roo.isIE){el.className=o["cls"];}else{if(O){el.setAttribute(P=="cls"?'class':P,o[P]);}else{el[P]=o[P];}}}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,Q=cn.length;i<Q;i++){F(cn[i],el);}}else{F(cn,el);}}if(o.html){el.innerHTML=o.html;}if(N){N.appendChild(el);}return el;};var G=function(N,s,h,e){A.innerHTML=[s,h,e].join('');
+var i=-1,el=A;while(++i<N&&el.firstChild){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(N,O,el,P){if(!A){A=document.createElement('div');}var Q;var R=null;if(N=='td'){if(O=='afterbegin'||O=='beforeend'){return;
+}if(O=='beforebegin'){R=el;el=el.parentNode;}else{R=el.nextSibling;el=el.parentNode;}Q=G(4,J,P,K);}else if(N=='tr'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(3,H,P,I);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(3,H,P,I);}else{if(O=='afterbegin'){R=el.firstChild;
+}Q=G(4,J,P,K);}}else if(N=='tbody'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(2,ts,P,te);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(2,ts,P,te);}else{if(O=='afterbegin'){R=el.firstChild;}Q=G(3,H,P,I);}}else{if(O=='beforebegin'||O=='afterend'){return;
+}if(O=='afterbegin'){R=el.firstChild;}Q=G(2,ts,P,te);}el.insertBefore(Q,R);return Q;};var M=function(N,to){Roo.log(["UpdateNode",N,to]);if(N.nodeType!=to.nodeType){Roo.log(["ReplaceChild - mismatch notType",to,N]);N.parentNode.replaceChild(to,N);}if(N.nodeType==3){if(N.data==to.data){return;
+}N.data=to.data;return;}if(!N.parentNode){return;}if(N.nodeType!=1||N.tagName!=to.tagName){Roo.log(["ReplaceChild",N,to]);N.parentNode.replaceChild(to,N);return;}var ar=Array.from(N.attributes);for(var i=0;i<ar.length;i++){if(to.hasAttribute(ar[i].name)){continue;
+}if(ar[i].name=='id'){continue;}Roo.log("removeAttribute"+ar[i].name);N.removeAttribute(ar[i].name);}ar=to.attributes;for(var i=0;i<ar.length;i++){if(N.getAttribute(ar[i].name)==to.getAttribute(ar[i].name)){Roo.log("skipAttribute "+ar[i].name+'='+to.getAttribute(ar[i].name));
+continue;}Roo.log("updateAttribute "+ar[i].name+'=>'+to.getAttribute(ar[i].name));N.setAttribute(ar[i].name,to.getAttribute(ar[i].name));}var O=Array.from(N.childNodes);var P=Array.from(to.childNodes);for(var i=0;i<Math.max(P.length,O.length);i++){if(i>=O.length){N.appendChild(P[i]);
+Roo.log(["add",P[i]]);}else if(i>=P.length){N.removeChild(O[i]);Roo.log(["remove",O[i]]);}else{M(O[i],P[i]);}}};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,N){if(N){el=Roo.fly(el);if(typeof N=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;
+var O;while((O=re.exec(N))!=null){el.setStyle(O[1],O[2]);}}else if(typeof N=="object"){for(var P in N){el.setStyle(P,N[P]);}}else if(typeof N=="function"){Roo.DomHelper.applyStyles(el,N.call());}}},insertHtml:function(N,el,O){N=N.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;
+if(rs=L(el.tagName.toLowerCase(),N,el,O)){return rs;}}switch(N){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',O);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',O);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',O);
+return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',O);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';}var P=el.ownerDocument.createRange();var Q;switch(N){case "beforebegin":P.setStartBefore(el);Q=P.createContextualFragment(O);
+el.parentNode.insertBefore(Q,el);return el.previousSibling;case "afterbegin":if(el.firstChild){P.setStartBefore(el.firstChild);Q=P.createContextualFragment(O);el.insertBefore(Q,el.firstChild);return el.firstChild;}else{el.innerHTML=O;return el.firstChild;
+}case "beforeend":if(el.lastChild){P.setStartAfter(el.lastChild);Q=P.createContextualFragment(O);el.appendChild(Q);return el.lastChild;}else{el.innerHTML=O;return el.lastChild;}case "afterend":P.setStartAfter(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el.nextSibling);
+return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';},insertBefore:function(el,o,N){return this.doInsert(el,o,N,"beforeBegin");},insertAfter:function(el,o,N){return this.doInsert(el,o,N,"afterEnd","nextSibling");},insertFirst:function(el,o,N){return this.doInsert(el,o,N,"afterBegin");
+},doInsert:function(el,o,N,O,P){el=Roo.getDom(el);var Q;if(this.useDom||o.ns){Q=F(o,null);el.parentNode.insertBefore(Q,P?el[P]:el);}else{var R=E(o);Q=this.insertHtml(O,el,R);}return N?Roo.get(Q,true):Q;},append:function(el,o,N){el=Roo.getDom(el);var O;if(this.useDom||o.ns){O=F(o,null);
+el.appendChild(O);}else{var P=E(o);O=this.insertHtml("beforeEnd",el,P);}return N?Roo.get(O,true):O;},overwrite:function(el,o,N){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}F(o,el);}else{el.innerHTML=E(o);}return N?Roo.get(el.firstChild,true):el.firstChild;
+},createTemplate:function(o){var N=E(o);return new Roo.Template(N);},update:function(el,o){M(Roo.getDom(el),F(o));}};}();
 // Roo/Template.js
 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else{this.html=A;}if(this.url){this.load();}};Roo.Template.prototype={onLoad:false,url:false,html:'',compiled:false,loaded:false,applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);
 }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),A[D],A);}else{if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,G=F.length;i<G;i++){F[i]=F[i].replace(re,"$1");
@@ -227,39 +271,39 @@ return B?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.app
 // Roo/DomQuery.js
 Roo.DomQuery=function(){var A={},B={},C={};var D=/\S/;var E=/^\s+|\s+$/g;var F=/\{(\d+)\}/g;var G=/^(\s?[\/>+~]\s?|\s|$)/;var H=/^(#)?([\w-\*]+)/;var I=/(\d*)n\+?(\d*)/,J=/\D/;function child(p,M){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==M){return n;
 }}n=n.nextSibling;}return null;};function next(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function prev(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!D.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,M){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];
-}if(!n){return null;}if(M=="for"){return n.htmlFor;}if(M=="class"||M=="className"){return n.className;}return n.getAttribute(M)||n[M];};function getNodes(ns,M,N){var O=[],ri=-1,cs;if(!ns){return O;}N=N||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];
+}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 instanceof SVGElement)?ci.className.baseVal:ci.className)+' ').indexOf(v)!=-1){r[++ri]=ci;}}return r;};function attrValue(n,M){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];
+}if(!n){return null;}if(M=="for"){return n.htmlFor;}if(M=="class"||M=="className"){return (n instanceof SVGElement)?n.className.baseVal:n.className;}return n.getAttribute(M)||n[M];};function getNodes(ns,M,N){var O=[],ri=-1,cs;if(!ns){return O;}N=N||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];
 }if(!M){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(N);for(var j=0,ci;ci=cs[j];j++){O[++ri]=ci;}}}else if(M=="/"||M==">"){var P=N.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==P||cj.nodeName==N||N=='*'){O[++ri]=cj;
 }}}}else if(M=="+"){var P=N.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(n&&(n.nodeName==P||n.nodeName==N||N=='*')){O[++ri]=n;}}}else if(M=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(N=='*'||n.tagName.toLowerCase()!=N)));
 if(n){O[++ri]=n;}}}return O;};function concat(a,b){if(b.slice){return a.concat(b);}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i];}return a;}function byTag(cs,M){if(cs.tagName||cs==document){cs=[cs];}if(!M){return cs;}var r=[],ri=-1;M=M.toLowerCase();for(var i=0,ci;
 ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==M){r[++ri]=ci;}}return r;};function byId(cs,M,id){if(cs.tagName||cs==document){cs=[cs];}if(!id){return cs;}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r;}}return r;
-};function byAttribute(cs,M,N,op,O){var r=[],ri=-1,st=O=="{";var f=Roo.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Roo.DomQuery.getStyle(ci,M);}else if(M=="class"||M=="className"){a=ci.className;}else if(M=="for"){a=ci.htmlFor;}else if(M=="href"){a=ci.getAttribute("href",2);
-}else{a=ci.getAttribute(M);}if((f&&f(a,N))||(!f&&a)){r[++ri]=ci;}}return r;};function byPseudo(cs,M,N){return Roo.DomQuery.pseudos[M](cs,N);};var K=window.ActiveXObject?true:false;var batch=30803;var L=30803;function nodupIEXml(cs){var d=++L;cs[0].setAttribute("_nodup",d);
-var r=[cs[0]];for(var i=1,M=cs.length;i<M;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c;}}for(var i=0,M=cs.length;i<M;i++){cs[i].removeAttribute("_nodup");}return r;}function nodup(cs){if(!cs){return [];}var M=cs.length,c,i,r=cs,cj,ri=-1;
-if(!M||typeof cs.nodeType!="undefined"||M==1){return cs;}if(K&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs);}var d=++L;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d;}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j];}for(j=i+1;
-cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj;}}return r;}}return r;}function quickDiffIEXml(c1,c2){var d=++L;for(var i=0,M=c1.length;i<M;i++){c1[i].setAttribute("_qdiff",d);}var r=[];for(var i=0,M=c2.length;i<M;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i];
-}}for(var i=0,M=c1.length;i<M;i++){c1[i].removeAttribute("_qdiff");}return r;}function quickDiff(c1,c2){var M=c1.length;if(!M){return c2;}if(K&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2);}var d=++L;for(var i=0;i<M;i++){c1[i]._qdiff=d;}var r=[];for(var i=0,N=c2.length;
-i<N;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i];}}return r;}function quickId(ns,M,N,id){if(ns==N){var d=N.ownerDocument||N;return d.getElementById(id);}ns=getNodes(ns,M,"*");return byId(ns,null,id);}return {getStyle:function(el,M){return Roo.fly(el).getStyle(M);
-},compile:function(M,N){N=N||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=M,mode,lq;var tk=Roo.DomQuery.matchers;var O=tk.length;var mm;var P=q.match(G);if(P&&P[1]){fn[fn.length]='mode="'+P[1].replace(E,"")+'";';
-q=q.replace(P[1],"");}while(M.substr(0,1)=="/"){M=M.substr(1);}while(q&&lq!=q){lq=q;var tm=q.match(H);if(N=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");';}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");';
-}q=q.replace(tm[0],"");}else if(q.substr(0,1)!='@'){fn[fn.length]='n = getNodes(n, mode, "*");';}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");';}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");';}q=q.replace(tm[0],"");}}while(!(mm=q.match(G))){var Q=false;
-for(var j=0;j<O;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(F,function(x,i){return m[i];});q=q.replace(m[0],"");Q=true;break;}}if(!Q){throw 'Error parsing selector, parsing failed at "'+q+'"';}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(E,"")+'";';
-q=q.replace(mm[1],"");}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f;},select:function(M,N,O){if(!N||N==document){N=document;}if(typeof N=="string"){N=document.getElementById(N);}var P=M.split(",");var Q=[];for(var i=0,R=P.length;i<R;i++){var p=P[i].replace(E,"");
-if(!A[p]){A[p]=Roo.DomQuery.compile(p);if(!A[p]){throw p+" is not a valid selector";}}var S=A[p](N);if(S&&S!=document){Q=Q.concat(S);}}if(P.length>1){return nodup(Q);}return Q;},selectNode:function(M,N){return Roo.DomQuery.select(M,N)[0];},selectValue:function(M,N,O){M=M.replace(E,"");
-if(!C[M]){C[M]=Roo.DomQuery.compile(M,"select");}var n=C[M](N);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?O:v);},selectNumber:function(M,N,O){var v=Roo.DomQuery.selectValue(M,N,O||0);return parseFloat(v);
-},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var M=(el instanceof Array);var N=Roo.DomQuery.filter(M?el:[el],ss);return M?(N.length==el.length):(N.length>0);},filter:function(M,ss,N){ss=ss.replace(E,"");if(!B[ss]){B[ss]=Roo.DomQuery.compile(ss,"simple");
-}var O=B[ss](M);return N?quickDiff(O,M):O;},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=I.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!J.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(!prev(ci)&&!next(ci)){r[++ri]=ci;
-}}return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var M=ci.childNodes,j=0,cn,N=true;while(cn=M[j]){++j;if(cn.nodeType==1||cn.nodeType==3){N=false;break;}}if(N){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=next(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=prev(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;}}};}();Roo.query=Roo.DomQuery.select;
-
+};function byAttribute(cs,M,N,op,O){var r=[],ri=-1,st=O=="{";var f=Roo.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Roo.DomQuery.getStyle(ci,M);}else if(M=="class"||M=="className"){a=(ci instanceof SVGElement)?ci.className.baseVal:ci.className;
+}else if(M=="for"){a=ci.htmlFor;}else if(M=="href"){a=ci.getAttribute("href",2);}else{a=ci.getAttribute(M);}if((f&&f(a,N))||(!f&&a)){r[++ri]=ci;}}return r;};function byPseudo(cs,M,N){return Roo.DomQuery.pseudos[M](cs,N);};var K=window.ActiveXObject?true:false;
+var batch=30803;var L=30803;function nodupIEXml(cs){var d=++L;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,M=cs.length;i<M;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c;}}for(var i=0,M=cs.length;i<M;
+i++){cs[i].removeAttribute("_nodup");}return r;}function nodup(cs){if(!cs){return [];}var M=cs.length,c,i,r=cs,cj,ri=-1;if(!M||typeof cs.nodeType!="undefined"||M==1){return cs;}if(K&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs);}var d=++L;
+cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d;}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j];}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj;}}return r;}}return r;}function quickDiffIEXml(c1,c2){var d=++L;for(var i=0,M=c1.length;
+i<M;i++){c1[i].setAttribute("_qdiff",d);}var r=[];for(var i=0,M=c2.length;i<M;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i];}}for(var i=0,M=c1.length;i<M;i++){c1[i].removeAttribute("_qdiff");}return r;}function quickDiff(c1,c2){var M=c1.length;
+if(!M){return c2;}if(K&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2);}var d=++L;for(var i=0;i<M;i++){c1[i]._qdiff=d;}var r=[];for(var i=0,N=c2.length;i<N;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i];}}return r;}function quickId(ns,M,N,id){if(ns==N){var d=N.ownerDocument||N;
+return d.getElementById(id);}ns=getNodes(ns,M,"*");return byId(ns,null,id);}return {getStyle:function(el,M){return Roo.fly(el).getStyle(M);},compile:function(M,N){N=N||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];
+var q=M,mode,lq;var tk=Roo.DomQuery.matchers;var O=tk.length;var mm;var P=q.match(G);if(P&&P[1]){fn[fn.length]='mode="'+P[1].replace(E,"")+'";';q=q.replace(P[1],"");}while(M.substr(0,1)=="/"){M=M.substr(1);}while(q&&lq!=q){lq=q;var tm=q.match(H);if(N=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");';
+}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");';}q=q.replace(tm[0],"");}else if(q.substr(0,1)!='@'){fn[fn.length]='n = getNodes(n, mode, "*");';}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");';}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");';
+}q=q.replace(tm[0],"");}}while(!(mm=q.match(G))){var Q=false;for(var j=0;j<O;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(F,function(x,i){return m[i];});q=q.replace(m[0],"");Q=true;break;}}if(!Q){throw 'Error parsing selector, parsing failed at "'+q+'"';
+}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(E,"")+'";';q=q.replace(mm[1],"");}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f;},select:function(M,N,O){if(!N||N==document){N=document;}if(typeof N=="string"){N=document.getElementById(N);
+}var P=M.split(",");var Q=[];for(var i=0,R=P.length;i<R;i++){var p=P[i].replace(E,"");if(!A[p]){A[p]=Roo.DomQuery.compile(p);if(!A[p]){throw p+" is not a valid selector";}}var S=A[p](N);if(S&&S!=document){Q=Q.concat(S);}}if(P.length>1){return nodup(Q);}return Q;
+},selectNode:function(M,N){return Roo.DomQuery.select(M,N)[0];},selectValue:function(M,N,O){M=M.replace(E,"");if(!C[M]){C[M]=Roo.DomQuery.compile(M,"select");}var n=C[M](N);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?O:v);
+},selectNumber:function(M,N,O){var v=Roo.DomQuery.selectValue(M,N,O||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var M=(el instanceof Array);var N=Roo.DomQuery.filter(M?el:[el],ss);return M?(N.length==el.length):(N.length>0);
+},filter:function(M,ss,N){ss=ss.replace(E,"");if(!B[ss]){B[ss]=Roo.DomQuery.compile(ss,"simple");}var O=B[ss](M);return N?quickDiff(O,M):O;},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=I.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!J.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(!prev(ci)&&!next(ci)){r[++ri]=ci;}}return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var M=ci.childNodes,j=0,cn,N=true;while(cn=M[j]){++j;if(cn.nodeType==1||cn.nodeType==3){N=false;
+break;}}if(N){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=next(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=prev(ci);if(n&&is(n,ss)){r[++ri]=ci;
+}}return r;}}};}();Roo.query=Roo.DomQuery.select;
 // Roo/util/Observable.js
 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(A,fn,B,o){if(typeof A=="object"){o=A;for(var e in o){if(this.filterOptRe.test(e)){continue;