roojs-core.js
[roojs1] / roojs-core.js
index 5523825..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);
@@ -27,27 +28,30 @@ E=E.concat(B);}else if(typeof C=="number"){E=Array.prototype.slice.call(argument
 }var C=this;return function(){A.target=this;A.method=C;if(A.apply(B||this||window,arguments)===false){return;}return C.apply(this||window,arguments);};}});
 // 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;};
+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;});};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;}});
+}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;}});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})"}
@@ -154,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;
@@ -188,75 +210,100 @@ 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={url:false,html:'',applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);
+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");
 }F=[A[D]].concat(F);}else{F=[A[D]];}return fm[E].apply(fm,F);}}else{return A[D]!==undefined?A[D]:"";}};return this.html.replace(this.re,fn);}catch(e){Roo.log(e);throw e;}},loading:false,load:function(){if(this.loading){return;}var _t=this;this.loading=true;
-this.compiled=false;var cx=new Roo.data.Connection();cx.request({url:this.url,method:'GET',success:function(A){_t.loading=false;_t.html=A.responseText;_t.url=false;_t.compile();},failure:function(A){Roo.log("Template failed to load from "+_t.url);_t.loading=false;
-}});},set:function(A,B){this.html=A;this.compiled=null;if(B){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var A=this.disableFormats!==true;var B=Roo.isGecko?"+":",";
-var fn=function(m,D,E,F){if(E&&A){F=F?','+F:"";if(E.substr(0,5)!="this."){E="fm."+E+'(';}else{E='this.call("'+E.substr(5)+'", ';F=", values";}}else{F='';E="(values['"+D+"'] == undefined ? '' : ";}return "'"+B+E+"values['"+D+"']"+F+")"+B+"'";};var C;if(Roo.isGecko){C="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";
-}else{C=["this.compiled = function(values){ return ['"];C.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));C.push("'].join('');};");C=C.join('');}eval(C);return this;},call:function(A,B,C){return this[A](B,C);
-},insertFirst:function(el,A,B){return this.doInsert('afterBegin',el,A,B);},insertBefore:function(el,A,B){return this.doInsert('beforeBegin',el,A,B);},insertAfter:function(el,A,B){return this.doInsert('afterEnd',el,A,B);},append:function(el,A,B){return this.doInsert('beforeEnd',el,A,B);
-},doInsert:function(A,el,B,C){el=Roo.getDom(el);var D=Roo.DomHelper.insertHtml(A,el,this.applyTemplate(B));return C?Roo.get(D,true):D;},overwrite:function(el,A,B){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(A);return B?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);};
+this.compiled=false;var cx=new Roo.data.Connection();cx.request({url:this.url,method:'GET',success:function(A){_t.loading=false;_t.url=false;_t.set(A.responseText,true);_t.loaded=true;if(_t.onLoad){_t.onLoad();}},failure:function(A){Roo.log("Template failed to load from "+_t.url);
+_t.loading=false;}});},set:function(A,B){this.html=A;this.compiled=false;if(B){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var A=this.disableFormats!==true;
+var B=Roo.isGecko?"+":",";var fn=function(m,D,E,F){if(E&&A){F=F?','+F:"";if(E.substr(0,5)!="this."){E="fm."+E+'(';}else{E='this.call("'+E.substr(5)+'", ';F=", values";}}else{F='';E="(values['"+D+"'] == undefined ? '' : ";}return "'"+B+E+"values['"+D+"']"+F+")"+B+"'";
+};var C;if(Roo.isGecko){C="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else{C=["this.compiled = function(values){ return ['"];C.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));
+C.push("'].join('');};");C=C.join('');}eval(C);return this;},call:function(A,B,C){return this[A](B,C);},insertFirst:function(el,A,B){return this.doInsert('afterBegin',el,A,B);},insertBefore:function(el,A,B){return this.doInsert('beforeBegin',el,A,B);},insertAfter:function(el,A,B){return this.doInsert('afterEnd',el,A,B);
+},append:function(el,A,B){return this.doInsert('beforeEnd',el,A,B);},doInsert:function(A,el,B,C){el=Roo.getDom(el);var D=Roo.DomHelper.insertHtml(A,el,this.applyTemplate(B));return C?Roo.get(D,true):D;},overwrite:function(el,A,B){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(A);
+return B?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.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;
@@ -270,7 +317,7 @@ setTimeout(function(){h.apply(D,E);},o.delay||10);};};Roo.util.Event=function(D,
 ;var h=fn;if(o.delay){h=C(h,o,D);}if(o.single){h=B(h,this,fn,D);}if(o.buffer){h=A(h,o,D);}l.fireFn=h;if(!this.firing){this.listeners.push(l);}else{this.listeners=this.listeners.slice(0);this.listeners.push(l);}}},findListener:function(fn,D){D=D||this.obj;
 var ls=this.listeners;for(var i=0,E=ls.length;i<E;i++){var l=ls[i];if(l.fn==fn&&l.scope==D){return i;}}return -1;},isListening:function(fn,D){return this.findListener(fn,D)!=-1;},removeListener:function(fn,D){var E;if((E=this.findListener(fn,D))!=-1){if(!this.firing){this.listeners.splice(E,1);
 }else{this.listeners=this.listeners.slice(0);this.listeners.splice(E,1);}return true;}return false;},clearListeners:function(){this.listeners=[];},fire:function(){var ls=this.listeners,D,E=ls.length;if(E>0){this.firing=true;var F=Array.prototype.slice.call(arguments,0);
-for(var i=0;i<E;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;}};})();
+for(var i=0;i<E;i++){var l=ls[i];if(l.fireFn.apply(l.scope||this.obj||window,F)===false){this.firing=false;return false;}}this.firing=false;}return true;}};})();
 // Roo/Document.js
 Roo.Document=function(A){this.addEvents({'ready':true});Roo.util.Observable.call(this,A);var B=this;Roo.onReady(function(){B.fireEvent('ready');},null,false);};Roo.extend(Roo.Document,Roo.util.Observable,{});
 // Roo/EventManager.js
@@ -303,7 +350,7 @@ return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPag
 },within:function(el,C){var t=this[C?"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/Element.js
 (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;
+this.listeners={};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);return this;};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;
 return this;},enableDisplayMode:function(J){this.setVisibilityMode(El.DISPLAY);if(typeof J!="undefined"){this.originalDisplay=J;}return this;},findParent:function(J,K,L){var p=this.dom,b=document.body,M=0,dq=Roo.DomQuery,N;K=K||50;if(typeof K!="number"){N=Roo.getDom(K);
 K=10;}while(p&&p.nodeType==1&&M<K&&p!=b&&p!=N){if(dq.is(p,J)){return L?Roo.get(p):p;}M++;p=p.parentNode;}return null;},findParentNode:function(J,K,L){var p=Roo.fly(this.dom.parentNode,'_internal');return p?p.findParent(J,K,L):null;},findScrollableParent:function(){var J=/(auto|scroll)/;
 if(this.getStyle('position')==='fixed'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}var K=this.getStyle('position')==="absolute";for(var L=this;(L=Roo.get(L.dom.parentNode));){if(K&&L.getStyle('position')==="static"){continue;
@@ -322,26 +369,30 @@ this.setHeight(1);setTimeout(function(){var O=parseInt(this.dom.scrollHeight,10)
 }else{this.fixDisplay();this.dom.style.visibility=J?"visible":"hidden";}}else{var L=this.dom;var M=this.visibilityMode;if(J){this.setOpacity(.01);this.setVisible(true);}this.anim({opacity:{to:(J?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!J){if(M==El.DISPLAY){L.style.display="none";
 }else{L.style.visibility="hidden";}Roo.get(L).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(J){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(J){if(typeof J=="boolean"){J=J?this.originalDisplay:"none";
 }this.setStyle("display",J);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(J){if(J instanceof Array){for(var i=0,K=J.length;i<K;i++){this.addClass(J[i]);
-}}else{if(J&&!this.hasClass(J)){this.dom.className=this.dom.className+" "+J;}}return this;},radioClass:function(J){var K=this.dom.parentNode.childNodes;for(var i=0;i<K.length;i++){var s=K[i];if(s.nodeType==1){Roo.get(s).removeClass(J);}}this.addClass(J);return this;
-},removeClass:function(J){if(!J||!this.dom.className){return this;}if(J instanceof Array){for(var i=0,K=J.length;i<K;i++){this.removeClass(J[i]);}}else{if(this.hasClass(J)){var re=this.classReCache[J];if(!re){re=new RegExp('(?:^|\\s+)'+J+'(?:\\s+|$)',"g");
-this.classReCache[J]=re;}this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(J){if(this.hasClass(J)){this.removeClass(J);}else{this.addClass(J);}return this;},hasClass:function(J){return J&&(' '+this.dom.className+' ').indexOf(' '+J+' ')!=-1;
-},replaceClass:function(J,K){this.removeClass(J);this.addClass(K);return this;},getStyles:function(){var a=arguments,J=a.length,r={};for(var i=0;i<J;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(J){var el=this.dom,v,cs,K;
-if(J=='float'){J="cssFloat";}if(el.style&&(v=el.style[J])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(K=B[J])){K=B[J]=J.replace(C,F);}return cs[K];}return null;}:function(J){var el=this.dom,v,cs,K;if(J=='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(J=='float'){J="styleFloat";}if(!(K=B[J])){K=B[J]=J.replace(C,F);}if(v=el.style[K]){return v;}if(cs=el.currentStyle){return cs[K];}return null;};}(),setStyle:function(J,K){if(typeof J=="string"){if(J=='float'){this.setStyle(Roo.isIE?'styleFloat':'cssFloat',K);
-return this;}var L;if(!(L=B[J])){L=B[J]=J.replace(C,F);}if(L=='opacity'){this.setOpacity(K);}else{this.dom.style[L]=K;}}else{for(var M in J){if(typeof J[M]!="function"){this.setStyle(M,J[M]);}}}return this;},applyStyles:function(J){Roo.DomHelper.applyStyles(this.dom,J);
-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,J){if(!J||!A){D.setX(this.dom,x);}else{this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;
-},setY:function(y,J){if(!J||!A){D.setY(this.dom,y);}else{this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(J){this.setStyle("left",this.addUnits(J));return this;},setTop:function(J){this.setStyle("top",this.addUnits(J));
-return this;},setRight:function(J){this.setStyle("right",this.addUnits(J));return this;},setBottom:function(J){this.setStyle("bottom",this.addUnits(J));return this;},setXY:function(J,K){if(!K||!A){D.setXY(this.dom,J);}else{this.anim({points:{to:J}},this.preanim(arguments,1),'motion');
-}return this;},setLocation:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(J){var h=this.dom.offsetHeight||0;
-return J!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(J){var w=this.dom.offsetWidth||0;return J!==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(J){return {width:this.getWidth(J),height:this.getHeight(J)};},getViewSize:function(){var d=this.dom,J=document,aw=0,ah=0;if(d==J||d==J.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else{return {width:d.clientWidth,height:d.clientHeight}
-;}},getValue:function(J){return J?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(J<0){J=0;}}return J;},adjustHeight:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("tb")+this.getPadding("tb"));
-}if(J<0){J=0;}}return J;},setWidth:function(J,K){J=this.adjustWidth(J);if(!K||!A){this.dom.style.width=this.addUnits(J);}else{this.anim({width:{to:J}},this.preanim(arguments,1));}return this;},setHeight:function(J,K){J=this.adjustHeight(J);if(!K||!A){this.dom.style.height=this.addUnits(J);
-}else{this.anim({height:{to:J}},this.preanim(arguments,1));}return this;},setSize:function(J,K,L){if(typeof J=="object"){K=J.height;J=J.width;}J=this.adjustWidth(J);K=this.adjustHeight(K);if(!L||!A){this.dom.style.width=this.addUnits(J);this.dom.style.height=this.addUnits(K);
-}else{this.anim({width:{to:J},height:{to:K}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,J,K,L){if(!L||!A){this.setSize(J,K);this.setLocation(x,y);}else{J=this.adjustWidth(J);K=this.adjustHeight(K);this.anim({points:{to:[x,y]},width:{to:J}
-,height:{to:K}},this.preanim(arguments,4),'motion');}return this;},setRegion:function(J,K){this.setBounds(J.left,J.top,J.right-J.left,J.bottom-J.top,this.preanim(arguments,1));return this;},addListener:function(J,fn,K,L){if(this.dom){Roo.EventManager.on(this.dom,J,fn,K||this,L);
-}},removeListener:function(J,fn){Roo.EventManager.removeListener(this.dom,J,fn);return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(J,K){this.on(J,function(e){K.fireEvent(J,e);});},setOpacity:function(J,K){if(!K||!A){var s=this.dom.style;
+}}else{if(J&&!this.hasClass(J)){if(this.dom instanceof SVGElement){this.dom.className.baseVal=this.dom.className.baseVal+" "+J;}else{this.dom.className=this.dom.className+" "+J;}}}return this;},radioClass:function(J){var K=this.dom.parentNode.childNodes;for(var i=0;
+i<K.length;i++){var s=K[i];if(s.nodeType==1){Roo.get(s).removeClass(J);}}this.addClass(J);return this;},removeClass:function(J){var cn=this.dom instanceof SVGElement?this.dom.className.baseVal:this.dom.className;if(!J||!cn){return this;}if(J instanceof Array){for(var i=0,K=J.length;
+i<K;i++){this.removeClass(J[i]);}}else{if(this.hasClass(J)){var re=this.classReCache[J];if(!re){re=new RegExp('(?:^|\\s+)'+J+'(?:\\s+|$)',"g");this.classReCache[J]=re;}if(this.dom instanceof SVGElement){this.dom.className.baseVal=cn.replace(re," ");}else{this.dom.className=cn.replace(re," ");
+}}}return this;},classReCache:{},toggleClass:function(J){if(this.hasClass(J)){this.removeClass(J);}else{this.addClass(J);}return this;},hasClass:function(J){if(this.dom instanceof SVGElement){return J&&(' '+this.dom.className.baseVal+' ').indexOf(' '+J+' ')!=-1;
+}return J&&(' '+this.dom.className+' ').indexOf(' '+J+' ')!=-1;},replaceClass:function(J,K){this.removeClass(J);this.addClass(K);return this;},getStyles:function(){var a=arguments,J=a.length,r={};for(var i=0;i<J;i++){r[a[i]]=this.getStyle(a[i]);}return r;
+},getStyle:function(){return G&&G.getComputedStyle?function(J){var el=this.dom,v,cs,K;if(J=='float'){J="cssFloat";}if(el.style&&(v=el.style[J])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(K=B[J])){K=B[J]=J.replace(C,F);}return cs[K];}return null;}:function(J){var el=this.dom,v,cs,K;
+if(J=='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(J=='float'){J="styleFloat";}if(!(K=B[J])){K=B[J]=J.replace(C,F);
+}if(v=el.style[K]){return v;}if(cs=el.currentStyle){return cs[K];}return null;};}(),setStyle:function(J,K){if(typeof J=="string"){if(J=='float'){this.setStyle(Roo.isIE?'styleFloat':'cssFloat',K);return this;}var L;if(!(L=B[J])){L=B[J]=J.replace(C,F);}if(L=='opacity'){this.setOpacity(K);
+}else{this.dom.style[L]=K;}}else{for(var M in J){if(typeof J[M]!="function"){this.setStyle(M,J[M]);}}}return this;},applyStyles:function(J){Roo.DomHelper.applyStyles(this.dom,J);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,J){if(!J||!A){D.setX(this.dom,x);}else{this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,J){if(!J||!A){D.setY(this.dom,y);}else{this.setXY([this.getX(),y],this.preanim(arguments,1));
+}return this;},setLeft:function(J){this.setStyle("left",this.addUnits(J));return this;},setTop:function(J){this.setStyle("top",this.addUnits(J));return this;},setRight:function(J){this.setStyle("right",this.addUnits(J));return this;},setBottom:function(J){this.setStyle("bottom",this.addUnits(J));
+return this;},setXY:function(J,K){if(!K||!A){D.setXY(this.dom,J);}else{this.anim({points:{to:J}},this.preanim(arguments,1),'motion');}return this;},setLocation:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));
+return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(J){var h=this.dom.offsetHeight||0;return J!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(J){var w=this.dom.offsetWidth||0;return J!==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(J){return {width:this.getWidth(J),height:this.getHeight(J)};},getViewSize:function(){var d=this.dom,J=document,aw=0,ah=0;if(d==J||d==J.body){return {width:D.getViewWidth(),height:D.getViewHeight()}
+;}else{return {width:d.clientWidth,height:d.clientHeight};}},getValue:function(J){return J?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("lr")+this.getPadding("lr"));
+}if(J<0){J=0;}}return J;},adjustHeight:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(J<0){J=0;}}return J;},setWidth:function(J,K){J=this.adjustWidth(J);if(!K||!A){this.dom.style.width=this.addUnits(J);
+}else{this.anim({width:{to:J}},this.preanim(arguments,1));}return this;},setHeight:function(J,K){J=this.adjustHeight(J);if(!K||!A){this.dom.style.height=this.addUnits(J);}else{this.anim({height:{to:J}},this.preanim(arguments,1));}return this;},setSize:function(J,K,L){if(typeof J=="object"){K=J.height;
+J=J.width;}J=this.adjustWidth(J);K=this.adjustHeight(K);if(!L||!A){this.dom.style.width=this.addUnits(J);this.dom.style.height=this.addUnits(K);}else{this.anim({width:{to:J},height:{to:K}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,J,K,L){if(!L||!A){this.setSize(J,K);
+this.setLocation(x,y);}else{J=this.adjustWidth(J);K=this.adjustHeight(K);this.anim({points:{to:[x,y]},width:{to:J},height:{to:K}},this.preanim(arguments,4),'motion');}return this;},setRegion:function(J,K){this.setBounds(J.left,J.top,J.right-J.left,J.bottom-J.top,this.preanim(arguments,1));
+return this;},addListener:function(J,fn,K,L){if(J=='dblclick'){this.addListener('touchstart',this.onTapHandler,this);}if(!this.dom){return;}if(this.dom instanceof SVGElement&&!(this.dom instanceof SVGSVGElement)){if(typeof(this.listeners[J])=='undefined'){this.listeners[J]=new Roo.util.Event(this,J);
+}this.listeners[J].addListener(fn,K,L);return;}Roo.EventManager.on(this.dom,J,fn,K||this,L);},tapedTwice:false,onTapHandler:function(J){if(!this.tapedTwice){this.tapedTwice=true;var s=this;setTimeout(function(){s.tapedTwice=false;},300);return;}J.preventDefault();
+var K=new MouseEvent('dblclick',{view:window,bubbles:true,cancelable:true});this.dom.dispatchEvent(K);},removeListener:function(J,fn,K){Roo.EventManager.removeListener(this.dom,J,fn);if(typeof(this.listeners)=='undefined'||typeof(this.listeners[J])=='undefined'){return this;
+}this.listeners[J].removeListener(fn,K);return this;},removeAllListeners:function(){E.purgeElement(this.dom);this.listeners={};return this;},relayEvent:function(J,K){this.on(J,function(e){K.fireEvent(J,e);});},setOpacity:function(J,K){if(!K||!A){var s=this.dom.style;
 if(Roo.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(J==1?"":"alpha(opacity="+J*100+")");}else{s.opacity=J;}}else{this.anim({opacity:{to:J}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(J){if(!J){return this.getX();
 }else{return parseInt(this.getStyle("left"),10)||0;}},getRight:function(J){if(!J){return this.getX()+this.getWidth();}else{return (this.getLeft(true)+this.getWidth())||0;}},getTop:function(J){if(!J){return this.getY();}else{return parseInt(this.getStyle("top"),10)||0;
 }},getBottom:function(J){if(!J){return this.getY()+this.getHeight();}else{return (this.getTop(true)+this.getHeight())||0;}},position:function(J,K,x,y){if(!J){if(this.getStyle('position')=='static'){this.setStyle('position','relative');}}else{this.setStyle("position",J);
@@ -381,36 +432,37 @@ h-=(this.getBorderWidth("tb")+this.getPadding("tb"));}this.setBounds(J.x,J.y,w,h
 }},addStyles:function(J,K){var L=0,v,w;for(var i=0,M=J.length;i<M;i++){v=this.getStyle(K[J.charAt(i)]);if(v){w=parseInt(v,10);if(w){L+=w;}}}return L;},createProxy:function(J,K,L){if(K){K=Roo.getDom(K);}else{K=document.body;}J=typeof J=="object"?J:{tag:"div",cls:J}
 ;var M=Roo.DomHelper.append(K,J,true);if(L){M.setBox(this.getBox());}return M;},mask:function(J,K){if(this.getStyle("position")=="static"&&this.dom.tagName!=='BODY'){this.setStyle("position","relative");}if(!this._mask){this._mask=Roo.DomHelper.append(this.dom,{cls:"roo-el-mask"}
 ,true);}this.addClass("x-masked");this._mask.setDisplayed(true);var z=0;var L=this.dom;while(L&&L.style){if(!isNaN(parseInt(L.style.zIndex))){z=Math.max(z,parseInt(L.style.zIndex));}L=L.parentNode;}if(this.dom==document.body){z=1000000;this._mask.setWidth(Roo.lib.Dom.getDocumentWidth());
-this._mask.setHeight(Roo.lib.Dom.getDocumentHeight());}if(typeof J=='string'){if(!this._maskMsg){this._maskMsg=Roo.DomHelper.append(this.dom,{cls:"roo-el-mask-msg",cn:{tag:'div'}},true);}var mm=this._maskMsg;mm.dom.className=K?"roo-el-mask-msg "+K:"roo-el-mask-msg";
-if(mm.dom.firstChild){mm.dom.firstChild.innerHTML=J;}mm.setDisplayed(true);mm.center(this);mm.setStyle('z-index',z+102);}if(Roo.isIE&&!(Roo.isIE7&&Roo.isStrict)&&this.getStyle('height')=='auto'){this._mask.setHeight(this.getHeight());}this._mask.setStyle('z-index',z+100);
+this._mask.setHeight(Roo.lib.Dom.getDocumentHeight());}if(typeof J=='string'){if(!this._maskMsg){this._maskMsg=Roo.DomHelper.append(this.dom,{cls:"roo-el-mask-msg",cn:[{tag:'i',cls:'fa fa-spinner fa-spin'},{tag:'div'}]},true);}var mm=this._maskMsg;mm.dom.className=K?"roo-el-mask-msg "+K:"roo-el-mask-msg";
+if(mm.dom.lastChild){mm.dom.lastChild.innerHTML=J;}mm.setDisplayed(true);mm.center(this);mm.setStyle('z-index',z+102);}if(Roo.isIE&&!(Roo.isIE7&&Roo.isStrict)&&this.getStyle('height')=='auto'){this._mask.setHeight(this.getHeight());}this._mask.setStyle('z-index',z+100);
 return this._mask;},unmask:function(J){if(this._mask){if(J===true){this._mask.remove();delete this._mask;if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg;}}else{this._mask.setDisplayed(false);if(this._maskMsg){this._maskMsg.setDisplayed(false);
 }}}this.removeClass("x-masked");},isMasked:function(){return this._mask&&this._mask.isVisible();},createShim:function(){var el=document.createElement('iframe');el.frameBorder='no';el.className='roo-shim';if(Roo.isIE&&Roo.isSecure){el.src=Roo.SSL_SECURE_URL;
 }var J=Roo.get(this.dom.parentNode.insertBefore(el,this.dom));J.autoBoxAdjust=false;return J;},remove:function(){if(this.dom.parentNode){this.dom.parentNode.removeChild(this.dom);}delete El.cache[this.dom.id];},addClassOnOver:function(J,K){this.on("mouseover",function(){Roo.fly(this,'_internal').addClass(J);
 },this.dom);var L=function(e){if(K!==true||!e.within(this,true)){Roo.fly(this,'_internal').removeClass(J);}};this.on("mouseout",L,this.dom);return this;},addClassOnFocus:function(J){this.on("focus",function(){Roo.fly(this,'_internal').addClass(J);},this.dom);
 this.on("blur",function(){Roo.fly(this,'_internal').removeClass(J);},this.dom);return this;},addClassOnClick:function(J){var K=this.dom;this.on("mousedown",function(){Roo.fly(K,'_internal').addClass(J);var d=Roo.get(document);var fn=function(){Roo.fly(K,'_internal').removeClass(J);
 d.removeListener("mouseup",fn);};d.on("mouseup",fn);});return this;},swallowEvent:function(J,K){var fn=function(e){e.stopPropagation();if(K){e.preventDefault();}};if(J instanceof Array){for(var i=0,L=J.length;i<L;i++){this.on(J[i],fn);}return this;}this.on(J,fn);
-return this;},fitToParentDelegate:Roo.emptyFn,fitToParent:function(J,K){Roo.EventManager.removeResizeListener(this.fitToParentDelegate);this.fitToParentDelegate=Roo.emptyFn;if(J===true&&!this.dom.parentNode){return;}var p=Roo.get(K||this.dom.parentNode);this.setSize(p.getComputedWidth()-p.getFrameWidth('lr'),p.getComputedHeight()-p.getFrameWidth('tb'));
-if(J===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true,K]);Roo.EventManager.onWindowResize(this.fitToParentDelegate);}return this;},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling;}return n;
-},getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling;}return n;},appendChild:function(el){el=Roo.get(el);el.appendTo(this);return this;},createChild:function(J,K,L){J=J||{tag:'div'};if(K){return Roo.DomHelper.insertBefore(K,J,L!==true);
-}return Roo.DomHelper[!this.dom.firstChild?'overwrite':'append'](this.dom,J,L!==true);},appendTo:function(el){el=Roo.getDom(el);el.appendChild(this.dom);return this;},insertBefore:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el);return this;
-},insertAfter:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this;},insertFirst:function(el,J){el=el||{};if(typeof el=='object'&&!el.nodeType){return this.createChild(el,this.dom.firstChild,J);}else{el=Roo.getDom(el);
-this.dom.insertBefore(el,this.dom.firstChild);return !J?Roo.get(el):el;}},insertSibling:function(el,J,K){J=J?J.toLowerCase():'before';el=el||{};var rt,L=J=='before'?this.dom:this.dom.nextSibling;if(typeof el=='object'&&!el.nodeType){if(J=='after'&&!this.dom.nextSibling){rt=Roo.DomHelper.append(this.dom.parentNode,el,!K);
-}else{rt=Roo.DomHelper[J=='after'?'insertAfter':'insertBefore'](this.dom,el,!K);}}else{rt=this.dom.parentNode.insertBefore(Roo.getDom(el),J=='before'?this.dom:this.dom.nextSibling);if(!K){rt=Roo.get(rt);}}return rt;},wrap:function(J,K){if(!J){J={tag:"div"}
-;}var L=Roo.DomHelper.insertBefore(this.dom,J,!K);L.dom?L.dom.appendChild(this.dom):L.appendChild(this.dom);return L;},replace:function(el){el=Roo.get(el);this.insertBefore(el);el.remove();return this;},insertHtml:function(J,K,L){var el=Roo.DomHelper.insertHtml(J,this.dom,K);
-return L?Roo.get(el):el;},set:function(o,J){var el=this.dom;J=typeof J=='undefined'?(el.setAttribute?true:false):J;for(var K in o){if(K=="style"||typeof o[K]=="function"){continue;}if(K=="cls"){el.className=o["cls"];}else{if(J){el.setAttribute(K,o[K]);}else{el[K]=o[K];
-}}}if(o.style){Roo.DomHelper.applyStyles(el,o.style);}return this;},addKeyListener:function(J,fn,K){var L;if(typeof J!="object"||J instanceof Array){L={key:J,fn:fn,scope:K};}else{L={key:J.key,shift:J.shift,ctrl:J.ctrl,alt:J.alt,fn:fn,scope:K};}return new Roo.KeyMap(this,L);
-},addKeyMap:function(J){return new Roo.KeyMap(this,J);},isScrollable:function(){var J=this.dom;return J.scrollHeight>J.clientHeight||J.scrollWidth>J.clientWidth;},scrollTo:function(J,K,L){var M=J.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!L||!A){this.dom[M]=K;
-}else{var to=M=="scrollLeft"?[K,this.dom.scrollTop]:[this.dom.scrollLeft,K];this.anim({scroll:{"to":to}},this.preanim(arguments,2),'scroll');}return this;},scroll:function(J,K,L){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;
-var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;J=J.toLowerCase();var M=false;var a=this.preanim(arguments,2);switch(J){case "l":case "left":if(w-l>cw){var v=Math.min(l+K,w-cw);this.scrollTo("left",v,a);M=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-K,0);
-this.scrollTo("left",v,a);M=true;}break;case "t":case "top":case "up":if(t>0){var v=Math.max(t-K,0);this.scrollTo("top",v,a);M=true;}break;case "b":case "bottom":case "down":if(h-t>ch){var v=Math.min(t+K,h-ch);this.scrollTo("top",v,a);M=true;}break;}return M;
-},translatePoints:function(x,y){if(typeof x=='object'||x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle('position');var o=this.getXY();var l=parseInt(this.getStyle('left'),10);var t=parseInt(this.getStyle('top'),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;
-}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return {left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,J=document;if(d==J||d==J.body){var l=window.pageXOffset||J.documentElement.scrollLeft||J.body.scrollLeft||0;var t=window.pageYOffset||J.documentElement.scrollTop||J.body.scrollTop||0;
-return {left:l,top:t};}else{return {left:d.scrollLeft,top:d.scrollTop};}},getColor:function(J,K,L){var v=this.getStyle(J);if(!v||v=="transparent"||v=="inherit"){return K;}var M=typeof L=="undefined"?"#":L;if(v.substr(0,4)=="rgb("){var N=v.slice(4,v.length-1).split(",");
-for(var i=0;i<3;i++){var h=parseInt(N[i]).toString(16);if(h<16){h="0"+h;}M+=h;}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);M+=c+c;}}else if(v.length==7){M+=v.substr(1);}}}return (M.length>5?M.toLowerCase():K);},boxWrap:function(J){J=J||'x-box';
-var el=Roo.get(this.insertHtml('beforeBegin',String.format('<div class="{0}">'+El.boxMarkup+'</div>',J)));el.child('.'+J+'-mc').dom.appendChild(this.dom);return el;},getAttributeNS:Roo.isIE?function(ns,J){var d=this.dom;var K=typeof d[ns+":"+J];if(K!='undefined'&&K!='unknown'){return d[ns+":"+J];
-}return d[J];}:function(ns,J){var d=this.dom;return d.getAttributeNS(ns,J)||d.getAttribute(ns+":"+J)||d.getAttribute(J)||d[J];},attr:function(J){if(arguments.length>1){this.dom.setAttribute(J,arguments[1]);return arguments[1];}if(typeof(J)=='object'){for(var i in J){this.attr(i,J[i]);
-}return J;}if(!this.dom.hasAttribute(J)){return undefined;}return this.dom.getAttribute(J);}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;
-El.addUnits=function(v,J){if(v===""||v=="auto"){return v;}if(v===undefined){return '';}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(J||'px');}return v;};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
+return this;},fitToParentDelegate:Roo.emptyFn,fitToParent:function(J,K){Roo.EventManager.removeResizeListener(this.fitToParentDelegate);this.fitToParentDelegate=Roo.emptyFn;if(J===true&&!this.dom.parentNode){return this;}var p=Roo.get(K||this.dom.parentNode);
+this.setSize(p.getComputedWidth()-p.getFrameWidth('lr'),p.getComputedHeight()-p.getFrameWidth('tb'));if(J===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true,K]);Roo.EventManager.onWindowResize(this.fitToParentDelegate);}return this;
+},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling;}return n;},getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling;}return n;},appendChild:function(el){el=Roo.get(el);
+el.appendTo(this);return this;},createChild:function(J,K,L){J=J||{tag:'div'};if(K){return Roo.DomHelper.insertBefore(K,J,L!==true);}return Roo.DomHelper[!this.dom.firstChild?'overwrite':'append'](this.dom,J,L!==true);},appendTo:function(el){el=Roo.getDom(el);
+el.appendChild(this.dom);return this;},insertBefore:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el);return this;},insertAfter:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this;},insertFirst:function(el,J){el=el||{}
+;if(typeof el=='object'&&!el.nodeType){return this.createChild(el,this.dom.firstChild,J);}else{el=Roo.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return !J?Roo.get(el):el;}},insertSibling:function(el,J,K){J=J?J.toLowerCase():'before';el=el||{}
+;var rt,L=J=='before'?this.dom:this.dom.nextSibling;if(typeof el=='object'&&!el.nodeType){if(J=='after'&&!this.dom.nextSibling){rt=Roo.DomHelper.append(this.dom.parentNode,el,!K);}else{rt=Roo.DomHelper[J=='after'?'insertAfter':'insertBefore'](this.dom,el,!K);
+}}else{rt=this.dom.parentNode.insertBefore(Roo.getDom(el),J=='before'?this.dom:this.dom.nextSibling);if(!K){rt=Roo.get(rt);}}return rt;},wrap:function(J,K){if(!J){J={tag:"div"};}var L=Roo.DomHelper.insertBefore(this.dom,J,!K);L.dom?L.dom.appendChild(this.dom):L.appendChild(this.dom);
+return L;},replace:function(el){el=Roo.get(el);this.insertBefore(el);el.remove();return this;},insertHtml:function(J,K,L){var el=Roo.DomHelper.insertHtml(J,this.dom,K);return L?Roo.get(el):el;},set:function(o,J){var el=this.dom;J=typeof J=='undefined'?(el.setAttribute?true:false):J;
+for(var K in o){if(K=="style"||typeof o[K]=="function"){continue;}if(K=="cls"){el.className=o["cls"];}else{if(J){el.setAttribute(K,o[K]);}else{el[K]=o[K];}}}if(o.style){Roo.DomHelper.applyStyles(el,o.style);}return this;},addKeyListener:function(J,fn,K){var L;
+if(typeof J!="object"||J instanceof Array){L={key:J,fn:fn,scope:K};}else{L={key:J.key,shift:J.shift,ctrl:J.ctrl,alt:J.alt,fn:fn,scope:K};}return new Roo.KeyMap(this,L);},addKeyMap:function(J){return new Roo.KeyMap(this,J);},isScrollable:function(){var J=this.dom;
+return J.scrollHeight>J.clientHeight||J.scrollWidth>J.clientWidth;},scrollTo:function(J,K,L){var M=J.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!L||!A){this.dom[M]=K;}else{var to=M=="scrollLeft"?[K,this.dom.scrollTop]:[this.dom.scrollLeft,K];this.anim({scroll:{"to":to}
+},this.preanim(arguments,2),'scroll');}return this;},scroll:function(J,K,L){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;J=J.toLowerCase();
+var M=false;var a=this.preanim(arguments,2);switch(J){case "l":case "left":if(w-l>cw){var v=Math.min(l+K,w-cw);this.scrollTo("left",v,a);M=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-K,0);this.scrollTo("left",v,a);M=true;}break;case "t":case "top":case "up":if(t>0){var v=Math.max(t-K,0);
+this.scrollTo("top",v,a);M=true;}break;case "b":case "bottom":case "down":if(h-t>ch){var v=Math.min(t+K,h-ch);this.scrollTo("top",v,a);M=true;}break;}return M;},translatePoints:function(x,y){if(typeof x=='object'||x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle('position');
+var o=this.getXY();var l=parseInt(this.getStyle('left'),10);var t=parseInt(this.getStyle('top'),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return {left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,J=document;
+if(d==J||d==J.body){var l=window.pageXOffset||J.documentElement.scrollLeft||J.body.scrollLeft||0;var t=window.pageYOffset||J.documentElement.scrollTop||J.body.scrollTop||0;return {left:l,top:t};}else{return {left:d.scrollLeft,top:d.scrollTop};}},getColor:function(J,K,L){var v=this.getStyle(J);
+if(!v||v=="transparent"||v=="inherit"){return K;}var M=typeof L=="undefined"?"#":L;if(v.substr(0,4)=="rgb("){var N=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(N[i]).toString(16);if(h<16){h="0"+h;}M+=h;}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;
+i<4;i++){var c=v.charAt(i);M+=c+c;}}else if(v.length==7){M+=v.substr(1);}}}return (M.length>5?M.toLowerCase():K);},boxWrap:function(J){J=J||'x-box';var el=Roo.get(this.insertHtml('beforeBegin',String.format('<div class="{0}">'+El.boxMarkup+'</div>',J)));el.child('.'+J+'-mc').dom.appendChild(this.dom);
+return el;},getAttributeNS:Roo.isIE?function(ns,J){var d=this.dom;var K=typeof d[ns+":"+J];if(K!='undefined'&&K!='unknown'){return d[ns+":"+J];}return d[J];}:function(ns,J){var d=this.dom;return d.getAttributeNS(ns,J)||d.getAttribute(ns+":"+J)||d.getAttribute(J)||d[J];
+},attr:function(J){if(arguments.length>1){this.dom.setAttribute(J,arguments[1]);return arguments[1];}if(typeof(J)=='object'){for(var i in J){this.attr(i,J[i]);}return J;}if(!this.dom.hasAttribute(J)){return undefined;}return this.dom.getAttribute(J);}};var ep=El.prototype;
+ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,J){if(v===""||v=="auto"){return v;}if(v===undefined){return '';}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(J||'px');
+}return v;};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
 El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"}
 ;El.cache={};var H;El.get=function(el){var ex,J,id;if(!el){return null;}if(typeof el=="string"){if(!(J=document.getElementById(el))){return null;}if(ex=El.cache[el]){ex.dom=J;}else{ex=El.cache[el]=new El(J);}return ex;}else if(el.tagName){if(!(id=el.id)){id=Roo.id(el);
 }if(ex=El.cache[id]){ex.dom=el;}else{ex=El.cache[id]=new El(el);}return ex;}else if(el instanceof El){if(el!=H){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el;}return el;}else if(el.isComposite){return el;}else if(el instanceof Array){return El.select(el);
@@ -473,16 +525,20 @@ if(C!==-1){A=Roo.getDom(A);if(B){var d=this.elements[C];d.parentNode.insertBefor
 // Roo/data/Connection.js
 Roo.data.Connection=function(A){Roo.apply(this,A);this.addEvents({"beforerequest":true,"requestcomplete":true,"requestexception":true});Roo.data.Connection.superclass.constructor.call(this);};Roo.extend(Roo.data.Connection,Roo.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,request:function(o){if(this.fireEvent("beforerequest",this,o)!==false){var p=o.params;
 if(typeof p=="function"){p=p.call(o.scope||window,o);}if(typeof p=="object"){p=Roo.urlEncode(o.params);}if(this.extraParams){var A=Roo.urlEncode(this.extraParams);p=p?(p+'&'+A):A;}var B=o.url||this.url;if(typeof B=='function'){B=B.call(o.scope||window,o);
-}if(o.form){var C=Roo.getDom(o.form);B=B||C.action;var D=C.getAttribute("enctype");if(o.isUpload||(D&&D.toLowerCase()=='multipart/form-data')){return this.doFormUpload(o,p,B);}var f=Roo.lib.Ajax.serializeForm(C);p=p?(p+'&'+f):f;}var hs=o.headers;if(this.defaultHeaders){hs=Roo.apply(hs||{}
-,this.defaultHeaders);if(!o.headers){o.headers=hs;}}var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:o.timeout||this.timeout};var E=o.method||this.method||(p?"POST":"GET");if(E=='GET'&&(this.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){B+=(B.indexOf('?')!=-1?'&':'?')+'_dc='+(new Date().getTime());
-}if(typeof o.autoAbort=='boolean'){if(o.autoAbort){this.abort();}}else if(this.autoAbort!==false){this.abort();}if((E=='GET'&&p)||o.xmlData){B+=(B.indexOf('?')!=-1?'&':'?')+p;p='';}this.transId=Roo.lib.Ajax.request(E,B,cb,p,o);return this.transId;}else{Roo.callback(o.callback,o.scope,[o,null,null]);
-return null;}},isLoading:function(A){if(A){return Roo.lib.Ajax.isCallInProgress(A);}else{return this.transId?true:false;}},abort:function(A){if(A||this.isLoading()){Roo.lib.Ajax.abort(A||this.transId);}},handleResponse:function(A){this.transId=false;var B=A.argument.options;
-A.argument=B?B.argument:null;this.fireEvent("requestcomplete",this,A,B);Roo.callback(B.success,B.scope,[A,B]);Roo.callback(B.callback,B.scope,[B,true,A]);},handleFailure:function(A,e){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;
-this.fireEvent("requestexception",this,A,B,e);Roo.callback(B.failure,B.scope,[A,B]);Roo.callback(B.callback,B.scope,[B,false,A]);},doFormUpload:function(o,ps,A){var id=Roo.id();var B=document.createElement('iframe');B.id=id;B.name=id;B.className='x-hidden';
-if(Roo.isIE){B.src=Roo.SSL_SECURE_URL;}document.body.appendChild(B);if(Roo.isIE){document.frames[id].name=id;}var C=Roo.getDom(o.form);C.target=id;C.method='POST';C.enctype=C.encoding='multipart/form-data';if(A){C.action=A;}var D,hd;if(ps){D=[];ps=Roo.urlDecode(ps,false);
-for(var k in ps){if(ps.hasOwnProperty(k)){hd=document.createElement('input');hd.type='hidden';hd.name=k;hd.value=ps[k];C.appendChild(hd);D.push(hd);}}}function cb(){var r={responseText:'',responseXML:null};r.argument=o?o.argument:null;try{var F;if(Roo.isIE){F=B.contentWindow.document;
-}else{F=(B.contentDocument||window.frames[id].document);}if(F&&F.body){r.responseText=F.body.innerHTML;}if(F&&F.XMLDocument){r.responseXML=F.XMLDocument;}else{r.responseXML=F;}}catch(e){}Roo.EventManager.removeListener(B,'load',cb,this);this.fireEvent("requestcomplete",this,r,o);
-Roo.callback(o.success,o.scope,[r,o]);Roo.callback(o.callback,o.scope,[o,true,r]);setTimeout(function(){document.body.removeChild(B);},100);}Roo.EventManager.on(B,'load',cb,this);C.submit();if(D){for(var i=0,E=D.length;i<E;i++){C.removeChild(D[i]);}}}});
+}if(o.form){var C=Roo.getDom(o.form);B=B||C.action;var D=C.getAttribute("enctype");if(o.formData){return this.doFormDataUpload(o,B);}if(o.isUpload||(D&&D.toLowerCase()=='multipart/form-data')){return this.doFormUpload(o,p,B);}var f=Roo.lib.Ajax.serializeForm(C);
+p=p?(p+'&'+f):f;}if(!o.form&&o.formData){o.formData=o.formData===true?new FormData():o.formData;for(var k in o.params){o.formData.append(k,o.params[k]);}return this.doFormDataUpload(o,B);}var hs=o.headers;if(this.defaultHeaders){hs=Roo.apply(hs||{},this.defaultHeaders);
+if(!o.headers){o.headers=hs;}}var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:o.timeout||this.timeout};var E=o.method||this.method||(p?"POST":"GET");if(E=='GET'&&(this.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){B+=(B.indexOf('?')!=-1?'&':'?')+'_dc='+(new Date().getTime());
+}if(typeof o.autoAbort=='boolean'){if(o.autoAbort){this.abort();}}else if(this.autoAbort!==false){this.abort();}if((E=='GET'&&p)||o.xmlData){B+=(B.indexOf('?')!=-1?'&':'?')+p;p='';}Roo.lib.Ajax.useDefaultHeader=typeof(o.headers)=='undefined'||typeof(o.headers['Content-Type'])=='undefined';
+this.transId=Roo.lib.Ajax.request(E,B,cb,p,o);Roo.lib.Ajax.useDefaultHeader==true;return this.transId;}else{Roo.callback(o.callback,o.scope,[o,null,null]);return null;}},isLoading:function(A){if(A){return Roo.lib.Ajax.isCallInProgress(A);}else{return this.transId?true:false;
+}},abort:function(A){if(A||this.isLoading()){Roo.lib.Ajax.abort(A||this.transId);}},handleResponse:function(A){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestcomplete",this,A,B);Roo.callback(B.success,B.scope,[A,B]);
+Roo.callback(B.callback,B.scope,[B,true,A]);},handleFailure:function(A,e){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestexception",this,A,B,e);Roo.callback(B.failure,B.scope,[A,B]);Roo.callback(B.callback,B.scope,[B,false,A]);
+},doFormUpload:function(o,ps,A){var id=Roo.id();var B=document.createElement('iframe');B.id=id;B.name=id;B.className='x-hidden';if(Roo.isIE){B.src=Roo.SSL_SECURE_URL;}document.body.appendChild(B);if(Roo.isIE){document.frames[id].name=id;}var C=Roo.getDom(o.form);
+C.target=id;C.method='POST';C.enctype=C.encoding='multipart/form-data';if(A){C.action=A;}var D,hd;if(ps){D=[];ps=Roo.urlDecode(ps,false);for(var k in ps){if(ps.hasOwnProperty(k)){hd=document.createElement('input');hd.type='hidden';hd.name=k;hd.value=ps[k];
+C.appendChild(hd);D.push(hd);}}}function cb(){var r={responseText:'',responseXML:null};r.argument=o?o.argument:null;try{var F;if(Roo.isIE){F=B.contentWindow.document;}else{F=(B.contentDocument||window.frames[id].document);}if(F&&F.body){r.responseText=F.body.innerHTML;
+}if(F&&F.XMLDocument){r.responseXML=F.XMLDocument;}else{r.responseXML=F;}}catch(e){}Roo.EventManager.removeListener(B,'load',cb,this);this.fireEvent("requestcomplete",this,r,o);Roo.callback(o.success,o.scope,[r,o]);Roo.callback(o.callback,o.scope,[o,true,r]);
+setTimeout(function(){document.body.removeChild(B);},100);}Roo.EventManager.on(B,'load',cb,this);C.submit();if(D){for(var i=0,E=D.length;i<E;i++){C.removeChild(D[i]);}}},doFormDataUpload:function(o,A){var B;if(o.form){var C=Roo.getDom(o.form);C.enctype=C.encoding='multipart/form-data';
+B=o.formData===true?new FormData(C):o.formData;}else{B=o.formData===true?new FormData():o.formData;}var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:o.timeout||this.timeout};if(typeof o.autoAbort=='boolean'){if(o.autoAbort){this.abort();
+}}else if(this.autoAbort!==false){this.abort();}Roo.lib.Ajax.useDefaultHeader=false;this.transId=Roo.lib.Ajax.request("POST",A,cb,B,o);Roo.lib.Ajax.useDefaultHeader=true;}});
 // Roo/Ajax.js
 Roo.Ajax=new Roo.data.Connection({autoAbort:false,serializeForm:function(A){return Roo.lib.Ajax.serializeForm(A);}});
 // Roo/UpdateManager.js
@@ -541,14 +597,14 @@ for(var i=0,C=B.length;i<C;i++){this.add(B[i]);}}else{for(var D in A){if(this.al
 },insert:function(A,B,o){if(arguments.length==2){o=arguments[1];B=this.getKey(o);}if(A>=this.length){return this.add(B,o);}this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;}this.keys.splice(A,0,B);this.fireEvent("add",A,o,B);
 return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var o=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B];}this.keys.splice(A,1);
 this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i<A;i++){if(this.items[i]==o){return i;}}
-return -1;}else{return this.items.indexOf(o);}},indexOfKey:function(A){if(!this.keys.indexOf){for(var i=0,B=this.keys.length;i<B;i++){if(this.keys[i]==A){return i;}}return -1;}else{return this.keys.indexOf(A);}},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];
-return typeof B!='function'||this.allowFunctions?B:null;},itemAt:function(A){return this.items[A];},key:function(A){return this.map[A];},contains:function(o){return this.indexOf(o)!=-1;},containsKey:function(A){return typeof this.map[A]!="undefined";},clear:function(){this.length=0;
-this.items=[];this.keys=[];this.map={};this.fireEvent("clear");},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},_sort:function(A,B,fn){var C=String(B).toUpperCase()=="DESC"?-1:1;fn=fn||function(a,b){return a-b;}
-;var c=[],k=this.keys,D=this.items;for(var i=0,E=D.length;i<E;i++){c[c.length]={key:k[i],value:D[i],index:i};}c.sort(function(a,b){var v=fn(a[A],b[A])*C;if(v==0){v=(a.index<b.index?-1:1);}return v;});for(var i=0,E=c.length;i<E;i++){D[i]=c[i].value;k[i]=c[i].key;
-}this.fireEvent("sort",this);},sort:function(A,fn){this._sort("value",A,fn);},keySort:function(A,fn){this._sort("key",A,fn||function(a,b){return String(a).toUpperCase()-String(b).toUpperCase();});},getRange:function(A,B){var C=this.items;if(C.length<1){return [];
-}A=A||0;B=Math.min(typeof B=="undefined"?this.length-1:B,this.length-1);var r=[];if(A<=B){for(var i=A;i<=B;i++){r[r.length]=C[i];}}else{for(var i=A;i>=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);if(B.length==0){return this.clone();
-}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length;i<B;i++){if(fn.call(A||this,it[i],k[i])){r.add(k[i],it[i]);
-}}return r;},clone:function(){var r=new Roo.util.MixedCollection();var k=this.keys,it=this.items;for(var i=0,A=it.length;i<A;i++){r.add(k[i],it[i]);}r.getKey=this.getKey;return r;}});Roo.util.MixedCollection.prototype.get=Roo.util.MixedCollection.prototype.item;
+return -1;}else{return this.items.indexOf(o);}},indexOfKey:function(A){if(!this.keys.indexOf){for(var i=0,B=this.keys.length;i<B;i++){if(this.keys[i]==A){return i;}}return -1;}else{return this.keys.indexOf(A);}},item:function(A){if(A==='length'){return null;
+}var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];return typeof B!='function'||this.allowFunctions?B:null;},itemAt:function(A){return this.items[A];},key:function(A){return this.map[A];},contains:function(o){return this.indexOf(o)!=-1;},containsKey:function(A){return typeof this.map[A]!="undefined";
+},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear");},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},_sort:function(A,B,fn){var C=String(B).toUpperCase()=="DESC"?-1:1;
+fn=fn||function(a,b){return a-b;};var c=[],k=this.keys,D=this.items;for(var i=0,E=D.length;i<E;i++){c[c.length]={key:k[i],value:D[i],index:i};}c.sort(function(a,b){var v=fn(a[A],b[A])*C;if(v==0){v=(a.index<b.index?-1:1);}return v;});for(var i=0,E=c.length;
+i<E;i++){D[i]=c[i].value;k[i]=c[i].key;}this.fireEvent("sort",this);},sort:function(A,fn){this._sort("value",A,fn);},keySort:function(A,fn){this._sort("key",A,fn||function(a,b){return String(a).toUpperCase()-String(b).toUpperCase();});},getRange:function(A,B){var C=this.items;
+if(C.length<1){return [];}A=A||0;B=Math.min(typeof B=="undefined"?this.length-1:B,this.length-1);var r=[];if(A<=B){for(var i=A;i<=B;i++){r[r.length]=C[i];}}else{for(var i=A;i>=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);
+if(B.length==0){return this.clone();}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length;
+i<B;i++){if(fn.call(A||this,it[i],k[i])){r.add(k[i],it[i]);}}return r;},clone:function(){var r=new Roo.util.MixedCollection();var k=this.keys,it=this.items;for(var i=0,A=it.length;i<A;i++){r.add(k[i],it[i]);}r.getKey=this.getKey;return r;}});Roo.util.MixedCollection.prototype.get=Roo.util.MixedCollection.prototype.item;
 
 // Roo/util/JSON.js
 Roo.util.JSON=new (function(){var A={}.hasOwnProperty?true:false;var B=function(n){return n<10?"0"+n:n;};var m={"\b":'\\b',"\t":'\\t',"\n":'\\n',"\f":'\\f',"\r":'\\r','"':'\\"',"\\":'\\\\'};var C=function(s){if(/["\\\x00-\x1f]/.test(s)){return '"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];
@@ -563,10 +619,10 @@ Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if(
 },htmlDecode:function(B){return !B?B:String(B).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"');},trim:function(B){return String(B).replace(A,"");},substr:function(B,C,D){return String(B).substr(C,D);},lowercase:function(B){return String(B).toLowerCase();
 },uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var B=Array.prototype.slice.call(arguments,2);B.unshift(value);
 return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFixed:function(v,n){if(!n){return Math.round(v-0);}var B=Math.pow(10,n+1);v=(Math.round((v-0)*B))/B;var z=(''+B).substring(2);if(v==Math.floor(v)){return Math.floor(v)+'.'+z;}var ps=String(v).split('.');
-var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B){B=typeof(B)=='undefined'?2:B;
-var C=Math.pow(10,B);var D=String(C).substring(1);v=(Math.round((v-0)*C))/C;v=String(v);var ps=v.split('.');var E=ps[0];var r=/(\d+)(\d{3})/;while(r.test(E)){E=E.replace(r,'$1'+','+'$2');}var F=ps[1]?(B?('.'+ps[1]+D.substring(ps[1].length)):''):(B?('.'+D):'');
-return E+F;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");
-}};}();Roo.util.Format.defaults={date:'d/M/Y'};
+var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B,C){B=typeof(B)=='undefined'?2:B;
+C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):'');
+return F+G;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");
+},size:function(B,C){var D=['b','k','M','G','T'];if(B==0){return 0;}var i=parseInt(Math.floor(Math.log(B)/Math.log(1024)));return Roo.util.Format.number(B/Math.pow(1024,i),C)+D[i];}};}();Roo.util.Format.defaults={date:'d/M/Y'};
 // Roo/MasterTemplate.js
 Roo.MasterTemplate=function(){Roo.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var st={};var m,re=this.subTemplateRe;re.lastIndex=0;var A=0;while(m=re.exec(this.html)){var B=m[1],C=m[2];st[A]={name:B,index:A,buffer:[],tpl:new Roo.Template(C)}
 ;if(B){st[B]=st[A];}st[A].tpl.compile();st[A].tpl.call=this.call.createDelegate(this);A++;}this.subCount=A;this.subs=st;};Roo.extend(Roo.MasterTemplate,Roo.Template,{subTemplateRe:/<tpl(?:\sname="([\w-]+)")?>((?:.|\n)*?)<\/tpl>/gi,add:function(A,B){if(arguments.length==1){B=arguments[0];
@@ -591,6 +647,9 @@ if(A<500){return 400;}else if(A<1700){return 320;}else if(A<2600){return 250;}el
 if(this.pressClass){this.el.removeClass(this.pressClass);}this.el.on("mouseover",this.handleMouseReturn,this);},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn);if(this.pressClass){this.el.addClass(this.pressClass);}this.click();
 },handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn);this.el.un("mouseout",this.handleMouseOut);Roo.get(document).un("mouseup",this.handleMouseUp);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this);
 }});
+// Roo/util/Clipboard.js
+Roo.util.Clipboard={write:function(A){if(navigator.clipboard&&window.isSecureContext){navigator.clipboard.writeText(A);return;}var ta=document.createElement("textarea");ta.value=A;ta.style.position="fixed";ta.style.left="-999999px";ta.style.top="-999999px";
+document.body.appendChild(ta);ta.focus();ta.select();document.execCommand('copy');(function(){ta.remove();}).defer(100);}};
 // Roo/KeyNav.js
 Roo.KeyNav=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(!this.disabled){this.disabled=true;this.enable();}};Roo.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(e){var k=e.getKey();var h=this.keyToHandler[k];
 if(Roo.isSafari&&h&&k>=37&&k<=40){e.stopEvent();}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]();}}},doRelay:function(e,h,A){return h.call(this.scope||this,e);
@@ -628,18 +687,18 @@ A.un("add",fn,B);}});}};}();
 // Roo/Component.js
 Roo.Component=function(A){A=A||{};if(A.tagName||A.dom||typeof A=="string"){A={el:A,id:A.id||A};}this.initialConfig=A;Roo.apply(this,A);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true}
 );if(!this.id){this.id="roo-comp-"+(++Roo.Component.AUTO_ID);}Roo.ComponentMgr.register(this);Roo.Component.superclass.constructor.call(this);this.initComponent();if(this.renderTo){this.render(this.renderTo);delete this.renderTo;}};Roo.Component.AUTO_ID=1000;
-Roo.extend(Roo.Component,Roo.util.Observable,{hidden:false,disabled:false,rendered:false,disabledClass:"x-item-disabled",allowDomMove:true,hideMode:'display',ctype:"Roo.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode];},initComponent:Roo.emptyFn,render:function(A,B){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!A&&this.el){this.el=Roo.get(this.el);
-A=this.el.dom.parentNode;this.allowDomMove=false;}this.container=Roo.get(A);this.rendered=true;if(B!==undefined){if(typeof B=='number'){B=this.container.dom.childNodes[B];}else{B=Roo.getDom(B);}}this.onRender(this.container,B||null);if(this.cls){this.el.addClass(this.cls);
-delete this.cls;}if(this.style){this.el.applyStyles(this.style);delete this.style;}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide();}if(this.disabled){this.disable();}}return this;},onRender:function(ct,A){if(this.el){this.el=Roo.get(this.el);
-if(this.allowDomMove!==false){ct.dom.insertBefore(this.el.dom,A);}}},getAutoCreate:function(){var A=typeof this.autoCreate=="object"?this.autoCreate:Roo.apply({},this.defaultAutoCreate);if(this.id&&!A.id){A.id=this.id;}return A;},afterRender:Roo.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.purgeListeners();
-this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove();}}this.onDestroy();Roo.ComponentMgr.unregister(this);this.fireEvent("destroy",this);}},beforeDestroy:function(){}
-,onDestroy:function(){},getEl:function(){return this.el;},getId:function(){return this.id;},focus:function(A){if(this.rendered){this.el.focus();if(A===true){this.el.dom.select();}}return this;},blur:function(){if(this.rendered){this.el.blur();}return this;
-},disable:function(){if(this.rendered){this.onDisable();}this.disabled=true;this.fireEvent("disable",this);return this;},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true;},enable:function(){if(this.rendered){this.onEnable();
-}this.disabled=false;this.fireEvent("enable",this);return this;},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false;},setDisabled:function(A){this[A?"disable":"enable"]();},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;
-if(this.rendered){this.onShow();}this.fireEvent("show",this);}return this;},onShow:function(){var ae=this.getActionEl();if(this.hideMode=='visibility'){ae.dom.style.visibility="visible";}else if(this.hideMode=='offsets'){ae.removeClass('x-hidden');}else{ae.dom.style.display="";
-}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide();}this.fireEvent("hide",this);}return this;},onHide:function(){var ae=this.getActionEl();if(this.hideMode=='visibility'){ae.dom.style.visibility="hidden";
-}else if(this.hideMode=='offsets'){ae.addClass('x-hidden');}else{ae.dom.style.display="none";}},setVisible:function(A){if(A){this.show();}else{this.hide();}return this;},isVisible:function(){return this.getActionEl().isVisible();},cloneConfig:function(A){A=A||{}
-;var id=A.id||Roo.id();var B=Roo.applyIf(A,this.initialConfig);B.id=id;return new this.constructor(B);}});
+Roo.extend(Roo.Component,Roo.util.Observable,{hidden:false,disabled:false,rendered:false,disabledClass:"x-item-disabled",allowDomMove:true,hideMode:'display',ctype:"Roo.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode];},initComponent:Roo.emptyFn,render:function(A,B){if(this.rendered){return this;
+}if(this.fireEvent("beforerender",this)===false){return false;}if(!A&&this.el){this.el=Roo.get(this.el);A=this.el.dom.parentNode;this.allowDomMove=false;}this.container=Roo.get(A);this.rendered=true;if(B!==undefined){if(typeof B=='number'){B=this.container.dom.childNodes[B];
+}else{B=Roo.getDom(B);}}this.onRender(this.container,B||null);if(this.cls){this.el.addClass(this.cls);delete this.cls;}if(this.style){this.el.applyStyles(this.style);delete this.style;}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide();
+}if(this.disabled){this.disable();}return this;},onRender:function(ct,A){if(this.el){this.el=Roo.get(this.el);if(this.allowDomMove!==false){ct.dom.insertBefore(this.el.dom,A);}}},getAutoCreate:function(){var A=typeof this.autoCreate=="object"?this.autoCreate:Roo.apply({}
+,this.defaultAutoCreate);if(this.id&&!A.id){A.id=this.id;}return A;},afterRender:Roo.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.purgeListeners();this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();
+if(this.actionMode=="container"){this.container.remove();}}this.onDestroy();Roo.ComponentMgr.unregister(this);this.fireEvent("destroy",this);}},beforeDestroy:function(){},onDestroy:function(){},getEl:function(){return this.el;},getId:function(){return this.id;
+},focus:function(A){if(this.rendered){this.el.focus();if(A===true){this.el.dom.select();}}return this;},blur:function(){if(this.rendered){this.el.blur();}return this;},disable:function(){if(this.rendered){this.onDisable();}this.disabled=true;this.fireEvent("disable",this);
+return this;},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true;},enable:function(){if(this.rendered){this.onEnable();}this.disabled=false;this.fireEvent("enable",this);return this;},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);
+this.el.dom.disabled=false;},setDisabled:function(A){this[A?"disable":"enable"]();},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.rendered){this.onShow();}this.fireEvent("show",this);}return this;},onShow:function(){var ae=this.getActionEl();
+if(this.hideMode=='visibility'){ae.dom.style.visibility="visible";}else if(this.hideMode=='offsets'){ae.removeClass('x-hidden');}else{ae.dom.style.display="";}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide();
+}this.fireEvent("hide",this);}return this;},onHide:function(){var ae=this.getActionEl();if(this.hideMode=='visibility'){ae.dom.style.visibility="hidden";}else if(this.hideMode=='offsets'){ae.addClass('x-hidden');}else{ae.dom.style.display="none";}},setVisible:function(A){if(A){this.show();
+}else{this.hide();}return this;},isVisible:function(){return this.getActionEl().isVisible();},cloneConfig:function(A){A=A||{};var id=A.id||Roo.id();var B=Roo.applyIf(A,this.initialConfig);B.id=id;return new this.constructor(B);}});
 // Roo/BoxComponent.js
 Roo.BoxComponent=function(A){Roo.Component.call(this,A);this.addEvents({resize:true,move:true});};Roo.extend(Roo.BoxComponent,Roo.Component,{boxReady:false,deferHeight:false,setSize:function(w,h){if(typeof w=='object'){h=w.height;w=w.width;}if(!this.boxReady){this.width=w;
 this.height=h;return this;}if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return this;}this.lastSize={width:w,height:h};var A=this.adjustSize(w,h);var aw=A.width,ah=A.height;if(aw!==undefined||ah!==undefined){var rz=this.getResizeEl();
@@ -651,6 +710,28 @@ this.y=y;if(!this.boxReady){return this;}var A=this.adjustPosition(x,y);var ax=A
 return this;},onRender:function(ct,A){Roo.BoxComponent.superclass.onRender.call(this,ct,A);if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl);}if(this.positionEl){this.positionEl=Roo.get(this.positionEl);}},afterRender:function(){Roo.BoxComponent.superclass.afterRender.call(this);
 this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y);}if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY);}},syncSize:function(){delete this.lastSize;this.setSize(this.el.getWidth(),this.el.getHeight());
 return this;},onResize:function(A,B,C,D){},onPosition:function(x,y){},adjustSize:function(w,h){if(this.autoWidth){w='auto';}if(this.autoHeight){h='auto';}return {width:w,height:h};},adjustPosition:function(x,y){return {x:x,y:y};}});
+// Roo/Layer.js
+(function(){Roo.Layer=function(C,D){C=C||{};var dh=Roo.DomHelper;var cp=C.parentEl,E=cp?Roo.getDom(cp):document.body;if(D){this.dom=Roo.getDom(D);}if(!this.dom){var o=C.dh||{tag:"div",cls:"x-layer"};this.dom=dh.append(E,o);}if(C.cls){this.addClass(C.cls);}
+this.constrain=C.constrain!==false;this.visibilityMode=Roo.Element.VISIBILITY;if(C.id){this.id=this.dom.id=C.id;}else{this.id=Roo.id(this.dom);}this.zindex=C.zindex||this.getZIndex();this.position("absolute",this.zindex);if(C.shadow){this.shadowOffset=C.shadowOffset||4;
+this.shadow=new Roo.Shadow({offset:this.shadowOffset,mode:C.shadow});}else{this.shadowOffset=0;}this.useShim=C.shim!==false&&Roo.useShims;this.useDisplay=C.useDisplay;this.hide();};var A=Roo.Element.prototype;var B=[];Roo.extend(Roo.Layer,Roo.Element,{getZIndex:function(){return this.zindex||parseInt(this.getStyle("z-index"),10)||11000;
+},getShim:function(){if(!this.useShim){return null;}if(this.shim){return this.shim;}var C=B.shift();if(!C){C=this.createShim();C.enableDisplayMode('block');C.dom.style.display='none';C.dom.style.visibility='visible';}var pn=this.dom.parentNode;if(C.dom.parentNode!=pn){pn.insertBefore(C.dom,this.dom);
+}C.setStyle('z-index',this.getZIndex()-2);this.shim=C;return C;},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);B.push(this.shim);delete this.shim;}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;
+this.shadowOffset=0;}},enableShadow:function(C){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(C){this.sync(true);}}},sync:function(C){var sw=this.shadow;if(!this.updating&&this.isVisible()&&(sw||this.useShim)){var sh=this.getShim();
+var w=this.getWidth(),h=this.getHeight();var l=this.getLeft(true),t=this.getTop(true);if(sw&&!this.shadowDisabled){if(C&&!sw.isVisible()){sw.show(this);}else{sw.realign(l,t,w,h);}if(sh){if(C){sh.show();}var a=sw.adjusts,s=sh.dom.style;s.left=(Math.min(l,l+a.l))+"px";
+s.top=(Math.min(t,t+a.t))+"px";s.width=(w+a.w)+"px";s.height=(h+a.h)+"px";}}else if(sh){if(C){sh.show();}sh.setSize(w,h);sh.setLeftTop(l,t);}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide();}this.removeAllListeners();var pn=this.dom.parentNode;
+if(pn){pn.removeChild(this.dom);}Roo.Element.uncache(this.id);},remove:function(){this.destroy();},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.sync(true);},hideUnders:function(C){if(this.shadow){this.shadow.hide();
+}this.hideShim();},constrainXY:function(){if(this.constrain){var vw=Roo.lib.Dom.getViewWidth(),vh=Roo.lib.Dom.getViewHeight();var s=Roo.get(document).getScroll();var xy=this.getXY();var x=xy[0],y=xy[1];var w=this.dom.offsetWidth+this.shadowOffset,h=this.dom.offsetHeight+this.shadowOffset;
+var C=false;if((x+w)>vw+s.left){x=vw-w-this.shadowOffset;C=true;}if((y+h)>vh+s.top){y=vh-h-this.shadowOffset;C=true;}if(x<s.left){x=s.left;C=true;}if(y<s.top){y=s.top;C=true;}if(C){if(this.avoidY){var ay=this.avoidY;if(y<=ay&&(y+h)>=ay){y=ay-h-5;}}xy=[x,y];
+this.storeXY(xy);A.setXY.call(this,xy);this.sync();}}},isVisible:function(){return this.visible;},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("");}else if(this.lastXY){A.setXY.call(this,this.lastXY);}else if(this.lastLT){A.setLeftTop.call(this,this.lastLT[0],this.lastLT[1]);
+}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false);}else{this.setLeftTop(-10000,-10000);}},setVisible:function(v,a,d,c,e){if(v){this.showAction();}if(a&&v){var cb=function(){this.sync(true);if(c){c();}}.createDelegate(this);
+A.setVisible.call(this,true,true,d,cb,e);}else{if(!v){this.hideUnders(true);}var cb=c;if(a){cb=function(){this.hideAction();if(c){c();}}.createDelegate(this);}A.setVisible.call(this,v,a,d,cb,e);if(v){this.sync(true);}else if(!a){this.hideAction();}}},storeXY:function(xy){delete this.lastLT;
+this.lastXY=xy;},storeLeftTop:function(C,D){delete this.lastXY;this.lastLT=[C,D];},beforeFx:function(){this.beforeAction();return Roo.Layer.superclass.beforeFx.apply(this,arguments);},afterFx:function(){Roo.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible());
+},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide();}},setLeft:function(C){this.storeLeftTop(C,this.getTop(true));A.setLeft.apply(this,arguments);this.sync();},setTop:function(C){this.storeLeftTop(this.getLeft(true),C);A.setTop.apply(this,arguments);
+this.sync();},setLeftTop:function(C,D){this.storeLeftTop(C,D);A.setLeftTop.apply(this,arguments);this.sync();},setXY:function(xy,a,d,c,e){this.fixDisplay();this.beforeAction();this.storeXY(xy);var cb=this.createCB(c);A.setXY.call(this,xy,a,d,cb,e);if(!a){cb();
+}},createCB:function(c){var el=this;return function(){el.constrainXY();el.sync(true);if(c){c();}};},setX:function(x,a,d,c,e){this.setXY([x,this.getY()],a,d,c,e);},setY:function(y,a,d,c,e){this.setXY([this.getX(),y],a,d,c,e);},setSize:function(w,h,a,d,c,e){this.beforeAction();
+var cb=this.createCB(c);A.setSize.call(this,w,h,a,d,cb,e);if(!a){cb();}},setWidth:function(w,a,d,c,e){this.beforeAction();var cb=this.createCB(c);A.setWidth.call(this,w,a,d,cb,e);if(!a){cb();}},setHeight:function(h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);
+A.setHeight.call(this,h,a,d,cb,e);if(!a){cb();}},setBounds:function(x,y,w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);if(!a){this.storeXY([x,y]);A.setXY.call(this,[x,y]);A.setSize.call(this,w,h,a,d,cb,e);cb();}else{A.setBounds.call(this,x,y,w,h,a,d,cb,e);
+}return this;},setZIndex:function(C){this.zindex=C;this.setStyle("z-index",C+2);if(this.shadow){this.shadow.setZIndex(C+1);}if(this.shim){this.shim.setStyle("z-index",C);}}});})();
 // Roo/XComponent.js
 Roo.XComponent=function(A){Roo.apply(this,A);this.addEvents({'built':true});this.region=this.region||'center';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,region:'center',items:false,_tree:false,render:function(el){el=el||false;
 var hp=this.parent?1:0;Roo.debug&&Roo.log(this);var A=this._tree?this._tree():this.tree();if(!el&&typeof(this.parent)=='string'&&this.parent.substring(0,1)=='#'){var B=this.parent.substr(1);this.parent=false;Roo.debug&&Roo.log(B);switch(B){case 'bootstrap-body':if(typeof(A.el)!='undefined'&&A.el==document.body){this.parent={el:true}
@@ -661,78 +742,79 @@ if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("
 })};}else{this.parent={el:new Roo.BorderLayout(el||document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:el&&hp?false:true,hideTabs:el||!hp?true:false,minTabWidth:140}})};}}if(!this.parent.el){return;}A.region=A.region||this.region;
 var D=false;if(this.parent.el===true){if(el){A.el=el;}this.parent.el=Roo.factory(A);D=true;}this.el=this.parent.el.addxtype(A,undefined,D);this.fireEvent('built',this);this.panel=this.el;this.layout=this.panel.layout;this.parentLayout=this.parent.layout||false;
 }});Roo.apply(Roo.XComponent,{hideProgress:false,buildCompleted:false,topModule:false,modules:[],elmodules:[],is_alt:false,build_from_html:false,register:function(A){Roo.XComponent.event.fireEvent('register',A);switch(typeof(A.disabled)){case 'undefined':break;
-case 'function':if(A.disabled()){return;}break;default:if(A.disabled){return;}break;}this.modules.push(A);},toObject:function(str){if(!str||typeof(str)=='object'){return str;}if(str.substring(0,1)=='#'){return str;}var ar=str.split('.');var rt,o;rt=ar.shift();
-try{eval('if (typeof '+rt+' == "undefined"){ o = false;} o = '+rt+';');}catch(e){throw "Module not found : "+str;}if(o===false){throw "Module not found : "+str;}Roo.each(ar,function(e){if(typeof(o[e])=='undefined'){throw "Module not found : "+str;}o=o[e];
-});return o;},preBuild:function(){var _t=this;Roo.each(this.modules,function(A){Roo.XComponent.event.fireEvent('beforebuild',A);var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.debug&&Roo.log("parent:toObject failed: "+e.toString());return;}if(!A.parent){Roo.debug&&Roo.log("GOT top level module");
-Roo.debug&&Roo.log(A);A.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(A.parent.constructor!=Roo.XComponent){Roo.debug&&Roo.log("Warning : Object Parent is not instance of XComponent:"+A.name)}
+case 'function':if(A.disabled()){return;}break;default:if(A.disabled||A.region=='#disabled'){return;}break;}this.modules.push(A);},toObject:function(str){if(!str||typeof(str)=='object'){return str;}if(str.substring(0,1)=='#'){return str;}var ar=str.split('.');
+var rt,o;rt=ar.shift();try{eval('if (typeof '+rt+' == "undefined"){ o = false;} o = '+rt+';');}catch(e){throw "Module not found : "+str;}if(o===false){throw "Module not found : "+str;}Roo.each(ar,function(e){if(typeof(o[e])=='undefined'){throw "Module not found : "+str;
+}o=o[e];});return o;},preBuild:function(){var _t=this;Roo.each(this.modules,function(A){Roo.XComponent.event.fireEvent('beforebuild',A);var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.debug&&Roo.log("parent:toObject failed: "+e.toString());return;
+}if(!A.parent){Roo.debug&&Roo.log("GOT top level module");Roo.debug&&Roo.log(A);A.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(A.parent.constructor!=Roo.XComponent){Roo.debug&&Roo.log("Warning : Object Parent is not instance of XComponent:"+A.name)}
 if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});}if(A.parent.disabled){A.disabled=true;}A.parent.modules.add(A);},this);},buildOrder:function(){var A=this;var B=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;
 };if((!this.topModule||!this.topModule.modules)&&!this.elmodules.length){throw "No top level modules to build";}var C=this.topModule?[this.topModule]:[];Roo.each(this.elmodules,function(e){C.push(e);if(!this.topModule&&typeof(e.parent)=='string'&&e.parent.substring(0,1)=='#'&&Roo.get(e.parent.substr(1))){A.topModule=e;
 }});var D=function(m){Roo.debug&&Roo.log("build Order: add: "+m.name);C.push(m);if(m.modules&&!m.disabled){Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules");m.modules.keySort('ASC',B);Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules (after sort)");
 m.modules.each(D);}else{Roo.debug&&Roo.log("build Order: no child modules");}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}};if(this.topModule&&this.topModule.modules){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);
 }return C;},build:function(A){if(typeof(A)!='undefined'){Roo.apply(this,A);}this.preBuild();var B=this.buildOrder();if(!B.length){throw "NO modules!!!";}var C="Building Interface...";if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.show({title:'loading'}
-);Roo.MessageBox.show({title:"Please wait...",msg:C,width:450,progress:true,closable:false,modal:false});}var D=B.length;var E=this;var F=function(){if(!B.length){Roo.debug&&Roo.log('hide?');if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.hide();}Roo.XComponent.build_from_html=false;
-Roo.XComponent.event.fireEvent('buildcomplete',E.topModule);return false;}var m=B.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return F.defer(10,E);}C="Building Interface "+(D-B.length)+" of "+D+(m.name?(' - '+m.name):'');Roo.debug&&Roo.log(C);
-if(!E.hideProgress&&Roo.MessageBox){Roo.MessageBox.updateProgress((D-B.length)/D,C);}var G=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(G){return F();}m.render();return F.defer(10,E);};F.defer(1,E);},overlayStrings:function(A,B){if(typeof(A['_named_strings'])==undefined){throw "ERROR: component does not have _named_strings";
-}for(var k in B){var md=typeof(A['_named_strings'][k])=='undefined'?false:A['_named_strings'][k];if(md!==false){A['strings'][md]=B[k];}else{Roo.log('could not find named string: '+k+' in');Roo.log(A);}}},event:false,on:false});Roo.XComponent.event=new Roo.util.Observable({events:{'register':true,'beforebuild':true,'buildcomplete':true}
-});Roo.XComponent.on=Roo.XComponent.event.on.createDelegate(Roo.XComponent.event);
+);Roo.MessageBox.show({title:"Please wait...",msg:C,width:450,progress:true,buttons:false,closable:false,modal:false});}var D=B.length;var E=this;var F=function(){if(!B.length){Roo.debug&&Roo.log('hide?');if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.hide();
+}Roo.XComponent.build_from_html=false;Roo.XComponent.event.fireEvent('buildcomplete',E.topModule);return false;}var m=B.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return F.defer(10,E);}C="Building Interface "+(D-B.length)+" of "+D+(m.name?(' - '+m.name):'');
+Roo.debug&&Roo.log(C);if(!E.hideProgress&&Roo.MessageBox){Roo.MessageBox.updateProgress((D-B.length)/D,C);}var G=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(G){return F();}m.render();return F.defer(10,E);};F.defer(1,E);
+},overlayStrings:function(A,B){if(typeof(A['_named_strings'])=='undefined'){throw "ERROR: component does not have _named_strings";}for(var k in B){var md=typeof(A['_named_strings'][k])=='undefined'?false:A['_named_strings'][k];if(md!==false){A['_strings'][md]=B[k];
+}else{Roo.log('could not find named string: '+k+' in');Roo.log(A);}}},event:false,on:false});Roo.XComponent.event=new Roo.util.Observable({events:{'register':true,'beforebuild':true,'buildcomplete':true}});Roo.XComponent.on=Roo.XComponent.event.on.createDelegate(Roo.XComponent.event);
+
 // Roo/Markdown.js
 Roo.Markdown={};Roo.Markdown.toHtml=function(A){var c=new Roo.Markdown.marked.setOptions({renderer:new Roo.Markdown.marked.Renderer(),gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:true,smartypants:false});A=A.replace(/\\\n/g,' ');
-return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/}
-;A.bullet=/(?:[*+-]|\d+\.)/;A.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;A.item=replace(A.item,'gm')(/bull/g,A.bullet)();A.list=replace(A.list)(/bull/g,A.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+A.def.source+')')();A.blockquote=replace(A.blockquote)('def',A.def)();
-A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,A._tag)();
-A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
-);A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
-);function Lexer(C){this.tokens=[];this.tokens.links={};this.options=C||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(C,D){var E=new Lexer(D);
-return E.lex(C);};Lexer.prototype.lex=function(C){C=C.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(C,true);};Lexer.prototype.token=function(C,D,bq){var C=C.replace(/^ +$/gm,''),E,F,G,H,b,I,J,i,l;
-while(C){if(G=this.rules.newline.exec(C)){C=C.substring(G[0].length);if(G[0].length>1){this.tokens.push({type:'space'});}}if(G=this.rules.code.exec(C)){C=C.substring(G[0].length);G=G[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?G.replace(/\n+$/,''):G}
-);continue;}if(G=this.rules.fences.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'code',lang:G[2],text:G[3]||''});continue;}if(G=this.rules.heading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[1].length,text:G[2]}
-);continue;}if(D&&(G=this.rules.nptable.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/\n$/,'').split('\n')};for(i=0;i<I.align.length;
-i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].split(/ *\| */);
-}this.tokens.push(I);continue;}if(G=this.rules.lheading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[2]==='='?1:2,text:G[1]});continue;}if(G=this.rules.hr.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'hr'});continue;
-}if(G=this.rules.blockquote.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'blockquote_start'});G=G[0].replace(/^ *> ?/gm,'');this.token(G,D,true);this.tokens.push({type:'blockquote_end'});continue;}if(G=this.rules.list.exec(C)){C=C.substring(G[0].length);
-H=G[2];this.tokens.push({type:'list_start',ordered:H.length>1});G=G[0].match(this.rules.item);E=false;l=G.length;i=0;for(;i<l;i++){I=G[i];J=I.length;I=I.replace(/^ *([*+-]|\d+\.) +/,'');if(~I.indexOf('\n ')){J-=I.length;I=!this.options.pedantic?I.replace(new RegExp('^ {1,'+J+'}','gm'),''):I.replace(/^ {1,4}/gm,'');
-}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(G[i+1])[0];if(H!==b&&!(H.length>1&&b.length>1)){C=G.slice(i+1).join('\n')+C;i=l-1;}}F=E||/\n\n(?!\s*$)/.test(I);if(i!==l-1){E=I.charAt(I.length-1)==='\n';if(!F){F=E;}}this.tokens.push({type:F?'loose_item_start':'list_item_start'}
-);this.token(I,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});continue;}if(G=this.rules.html.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(G[1]==='pre'||G[1]==='script'||G[1]==='style'),text:G[0]}
-);continue;}if((!bq&&D)&&(G=this.rules.def.exec(C))){C=C.substring(G[0].length);this.tokens.links[G[1].toLowerCase()]={href:G[2],title:G[3]};continue;}if(D&&(G=this.rules.table.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<I.align.length;i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(I);continue;}if(D&&(G=this.rules.paragraph.exec(C))){C=C.substring(G[0].length);this.tokens.push({type:'paragraph',text:G[1].charAt(G[1].length-1)==='\n'?G[1].slice(0,-1):G[1]});continue;}if(G=this.rules.text.exec(C)){C=C.substring(G[0].length);
-this.tokens.push({type:'text',text:G[0]});continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return this.tokens;};var B={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
-;B._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;B._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;B.link=replace(B.link)('inside',B._inside)('href',B._href)();B.reflink=replace(B.reflink)('inside',B._inside)();B.normal=merge({},B);B.pedantic=merge({}
-,B.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});B.gfm=merge({},B.normal,{escape:replace(B.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(B.text)(']|','~]|')('|','|https?://|')()}
-);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});function InlineLexer(C,D){this.options=D||marked.defaults;this.links=C;this.rules=B.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;
-if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}}InlineLexer.rules=B;InlineLexer.output=function(C,D,E){var F=new InlineLexer(D,E);
-return F.output(C);};InlineLexer.prototype.output=function(C){var D='',E,F,G,H;while(C){if(H=this.rules.escape.exec(C)){C=C.substring(H[0].length);D+=H[1];continue;}if(H=this.rules.autolink.exec(C)){C=C.substring(H[0].length);if(H[2]==='@'){F=H[1].charAt(6)===':'?this.mangle(H[1].substring(7)):this.mangle(H[1]);
-G=this.mangle('mailto:')+F;}else{F=escape(H[1]);G=F;}D+=this.renderer.link(G,null,F);continue;}if(!this.inLink&&(H=this.rules.url.exec(C))){C=C.substring(H[0].length);F=escape(H[1]);G=F;D+=this.renderer.link(G,null,F);continue;}if(H=this.rules.tag.exec(C)){if(!this.inLink&&/^<a /i.test(H[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(H[0])){this.inLink=false;}C=C.substring(H[0].length);D+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):escape(H[0]):H[0];continue;}if(H=this.rules.link.exec(C)){C=C.substring(H[0].length);this.inLink=true;
-D+=this.outputLink(H,{href:H[2],title:H[3]});this.inLink=false;continue;}if((H=this.rules.reflink.exec(C))||(H=this.rules.nolink.exec(C))){C=C.substring(H[0].length);E=(H[2]||H[1]).replace(/\s+/g,' ');E=this.links[E.toLowerCase()];if(!E||!E.href){D+=H[0].charAt(0);
-C=H[0].substring(1)+C;continue;}this.inLink=true;D+=this.outputLink(H,E);this.inLink=false;continue;}if(H=this.rules.strong.exec(C)){C=C.substring(H[0].length);D+=this.renderer.strong(this.output(H[2]||H[1]));continue;}if(H=this.rules.em.exec(C)){C=C.substring(H[0].length);
-D+=this.renderer.em(this.output(H[2]||H[1]));continue;}if(H=this.rules.code.exec(C)){C=C.substring(H[0].length);D+=this.renderer.codespan(escape(H[2],true));continue;}if(H=this.rules.br.exec(C)){C=C.substring(H[0].length);D+=this.renderer.br();continue;}if(H=this.rules.del.exec(C)){C=C.substring(H[0].length);
-D+=this.renderer.del(this.output(H[1]));continue;}if(H=this.rules.text.exec(C)){C=C.substring(H[0].length);D+=this.renderer.text(escape(this.smartypants(H[0])));continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return D;};InlineLexer.prototype.outputLink=function(C,D){var E=escape(D.href),F=D.title?escape(D.title):null;
-return C[0].charAt(0)!=='!'?this.renderer.link(E,F,this.output(C[1])):this.renderer.image(E,F,escape(C[1]));};InlineLexer.prototype.smartypants=function(C){if(!this.options.smartypants){return C;}return C.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
-};InlineLexer.prototype.mangle=function(C){if(!this.options.mangle){return C;}var D='',l=C.length,i=0,ch;for(;i<l;i++){ch=C.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}D+='&#'+ch+';';}return D;};function Renderer(C){this.options=C||{};}Renderer.prototype.code=function(C,D,E){if(this.options.highlight){var F=this.options.highlight(C,D);
-if(F!=null&&F!==C){E=true;C=F;}}else{E=true;}if(!D){return '<pre><code>'+(E?C:escape(C,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(D,true)+'">'+(E?C:escape(C,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(C){return '<blockquote>\n'+C+'</blockquote>\n';
-};Renderer.prototype.html=function(C){return C;};Renderer.prototype.heading=function(C,D,E){return '<h'+D+' id="'+this.options.headerPrefix+E.toLowerCase().replace(/[^\w]+/g,'-')+'">'+C+'</h'+D+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};Renderer.prototype.list=function(C,D){var E=D?'ol':'ul';return '<'+E+'>\n'+C+'</'+E+'>\n';};Renderer.prototype.listitem=function(C){return '<li>'+C+'</li>\n';};Renderer.prototype.paragraph=function(C){return '<p>'+C+'</p>\n';};Renderer.prototype.table=function(C,D){return '<table class="table table-striped">\n'+'<thead>\n'+C+'</thead>\n'+'<tbody>\n'+D+'</tbody>\n'+'</table>\n';
-};Renderer.prototype.tablerow=function(C){return '<tr>\n'+C+'</tr>\n';};Renderer.prototype.tablecell=function(C,D){var E=D.header?'th':'td';var F=D.align?'<'+E+' style="text-align:'+D.align+'">':'<'+E+'>';return F+C+'</'+E+'>\n';};Renderer.prototype.strong=function(C){return '<strong>'+C+'</strong>';
-};Renderer.prototype.em=function(C){return '<em>'+C+'</em>';};Renderer.prototype.codespan=function(C){return '<code>'+C+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(C){return '<del>'+C+'</del>';
-};Renderer.prototype.link=function(C,D,E){if(this.options.sanitize){try{var F=decodeURIComponent(unescape(C)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(F.indexOf('javascript:')===0||F.indexOf('vbscript:')===0){return '';}}var G='<a href="'+C+'"';
-if(D){G+=' title="'+D+'"';}G+='>'+E+'</a>';return G;};Renderer.prototype.image=function(C,D,E){var F='<img src="'+C+'" alt="'+E+'"';if(D){F+=' title="'+D+'"';}F+=this.options.xhtml?'/>':'>';return F;};Renderer.prototype.text=function(C){return C;};function Parser(C){this.tokens=[];
-this.token=null;this.options=C||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(C,D,E){var F=new Parser(D,E);return F.parse(C);};Parser.prototype.parse=function(C){this.inline=new InlineLexer(C.links,this.options,this.renderer);
-this.tokens=C.reverse();var D='';while(this.next()){D+=this.tok();}return D;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var C=this.token.text;
-while(this.peek().type==='text'){C+='\n'+this.next().text;}return this.inline.output(C);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);
-}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var C='',D='',i,E,F,G,j;F='';for(i=0;i<this.token.header.length;i++){G={header:true,align:this.token.align[i]};F+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
-);}C+=this.renderer.tablerow(F);for(i=0;i<this.token.cells.length;i++){E=this.token.cells[i];F='';for(j=0;j<E.length;j++){F+=this.renderer.tablecell(this.inline.output(E[j]),{header:false,align:this.token.align[j]});}D+=this.renderer.tablerow(F);}return this.renderer.table(C,D);
-}case 'blockquote_start':{var D='';while(this.next().type!=='blockquote_end'){D+=this.tok();}return this.renderer.blockquote(D);}case 'list_start':{var D='',H=this.token.ordered;while(this.next().type!=='list_end'){D+=this.tok();}return this.renderer.list(D,H);
-}case 'list_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(D);}case 'loose_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.tok();
-}return this.renderer.listitem(D);}case 'html':{var I=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(I);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
-}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(C,D){return C.replace(!D?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(C){return C.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
-if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(C,D){C=C.source;D=D||'';return function E(F,G){if(!F){return new RegExp(C,D);
-}G=G.source||G;G=G.replace(/(^|[^\[])\^/g,'$1');C=C.replace(F,G);return E;};}function noop(){}noop.exec=noop;function merge(C){var i=1,D,E;for(;i<arguments.length;i++){D=arguments[i];for(E in D){if(Object.prototype.hasOwnProperty.call(D,E)){C[E]=D[E];}}}return C;
-}function marked(C,D,E){if(E||typeof D==='function'){if(!E){E=D;D=null;}D=merge({},marked.defaults,D||{});var F=D.highlight,G,H,i=0;try{G=Lexer.lex(C,D)}catch(e){return E(e);}H=G.length;var I=function(J){if(J){D.highlight=F;return E(J);}var K;try{K=Parser.parse(G,D);
-}catch(e){J=e;}D.highlight=F;return J?E(J):E(null,K);};if(!F||F.length<3){return I();}delete D.highlight;if(!H){return I();}for(;i<G.length;i++){(function(J){if(J.type!=='code'){return --H||I();}return F(J.text,J.lang,function(K,L){if(K){return I(K);}if(L==null||L===J.text){return --H||I();
-}J.text=L;J.escaped=true;--H||I();});})(G[i]);}return;}try{if(D){D=merge({},marked.defaults,D);}return Parser.parse(Lexer.lex(C,D),D);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((D||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
-}throw e;}}marked.options=marked.setOptions=function(C){merge(marked.defaults,C);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false}
-;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+return Roo.Markdown.marked(A);};(function(){var A=function(I,J){return I.replace(!J?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');};var unescape=function(I){return I.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
+if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});};var replace=function(I,J){I=I.source;J=J||'';return function K(L,M){if(!L){return new RegExp(I,J);
+}M=M.source||M;M=M.replace(/(^|[^\[])\^/g,'$1');I=I.replace(L,M);return K;};};var noop=function(){};noop.exec=noop;var B=function(I){var i=1,J,K;for(;i<arguments.length;i++){J=arguments[i];for(K in J){if(Object.prototype.hasOwnProperty.call(J,K)){I[K]=J[K];
+}}}return I;};var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/}
+;block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,'gm')(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+block.def.source+')')();
+block.blockquote=replace(block.blockquote)('def',block.def)();block._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';block.html=replace(block.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();
+block.paragraph=replace(block.paragraph)('hr',block.hr)('heading',block.heading)('lheading',block.lheading)('blockquote',block.blockquote)('tag','<'+block._tag)('def',block.def)();block.normal=B({},block);block.gfm=B({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
+);block.gfm.paragraph=replace(block.paragraph)('(?!','(?!'+block.gfm.fences.source.replace('\\1','\\2')+'|'+block.list.source.replace('\\1','\\3')+'|')();block.tables=B({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
+);var C=function(I){this.tokens=[];this.tokens.links={};this.options=I||H.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables;}else{this.rules=block.gfm;}}};C.rules=block;C.lex=function(I,J){var K=new C(J);
+return K.lex(I);};C.prototype.lex=function(I){I=I.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(I,true);};C.prototype.token=function(I,J,bq){var I=I.replace(/^ +$/gm,''),K,L,M,N,b,O,P,i,l;while(I){if(M=this.rules.newline.exec(I)){I=I.substring(M[0].length);
+if(M[0].length>1){this.tokens.push({type:'space'});}}if(M=this.rules.code.exec(I)){I=I.substring(M[0].length);M=M[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?M.replace(/\n+$/,''):M});continue;}if(M=this.rules.fences.exec(I)){I=I.substring(M[0].length);
+this.tokens.push({type:'code',lang:M[2],text:M[3]||''});continue;}if(M=this.rules.heading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[1].length,text:M[2]});continue;}if(J&&(M=this.rules.nptable.exec(I))){I=I.substring(M[0].length);
+O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/\n$/,'').split('\n')};for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';
+}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].split(/ *\| */);}this.tokens.push(O);continue;}if(M=this.rules.lheading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[2]==='='?1:2,text:M[1]}
+);continue;}if(M=this.rules.hr.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'hr'});continue;}if(M=this.rules.blockquote.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'blockquote_start'});M=M[0].replace(/^ *> ?/gm,'');this.token(M,J,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(M=this.rules.list.exec(I)){I=I.substring(M[0].length);N=M[2];this.tokens.push({type:'list_start',ordered:N.length>1});M=M[0].match(this.rules.item);K=false;l=M.length;i=0;for(;i<l;i++){O=M[i];P=O.length;
+O=O.replace(/^ *([*+-]|\d+\.) +/,'');if(~O.indexOf('\n ')){P-=O.length;O=!this.options.pedantic?O.replace(new RegExp('^ {1,'+P+'}','gm'),''):O.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(M[i+1])[0];if(N!==b&&!(N.length>1&&b.length>1)){I=M.slice(i+1).join('\n')+I;
+i=l-1;}}L=K||/\n\n(?!\s*$)/.test(O);if(i!==l-1){K=O.charAt(O.length-1)==='\n';if(!L){L=K;}}this.tokens.push({type:L?'loose_item_start':'list_item_start'});this.token(O,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(M=this.rules.html.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(M[1]==='pre'||M[1]==='script'||M[1]==='style'),text:M[0]});continue;}if((!bq&&J)&&(M=this.rules.def.exec(I))){I=I.substring(M[0].length);
+this.tokens.links[M[1].toLowerCase()]={href:M[2],title:M[3]};continue;}if(J&&(M=this.rules.table.exec(I))){I=I.substring(M[0].length);O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(O);continue;}if(J&&(M=this.rules.paragraph.exec(I))){I=I.substring(M[0].length);this.tokens.push({type:'paragraph',text:M[1].charAt(M[1].length-1)==='\n'?M[1].slice(0,-1):M[1]});continue;}if(M=this.rules.text.exec(I)){I=I.substring(M[0].length);
+this.tokens.push({type:'text',text:M[0]});continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return this.tokens;};var D={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+;D._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;D._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;D.link=replace(D.link)('inside',D._inside)('href',D._href)();D.reflink=replace(D.reflink)('inside',D._inside)();D.normal=B({},D);D.pedantic=B({},D.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}
+);D.gfm=B({},D.normal,{escape:replace(D.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(D.text)(']|','~]|')('|','|https?://|')()});D.breaks=B({},D.gfm,{br:replace(D.br)('{2,}','*')(),text:replace(D.gfm.text)('{2,}','*')()}
+);var E=function(I,J){this.options=J||H.defaults;this.links=I;this.rules=D.normal;this.renderer=this.options.renderer||new F;this.renderer.options=this.options;if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=D.breaks;
+}else{this.rules=D.gfm;}}else if(this.options.pedantic){this.rules=D.pedantic;}};E.rules=D;E.output=function(I,J,K){var L=new E(J,K);return L.output(I);};E.prototype.output=function(I){var J='',K,L,M,N;while(I){if(N=this.rules.escape.exec(I)){I=I.substring(N[0].length);
+J+=N[1];continue;}if(N=this.rules.autolink.exec(I)){I=I.substring(N[0].length);if(N[2]==='@'){L=N[1].charAt(6)===':'?this.mangle(N[1].substring(7)):this.mangle(N[1]);M=this.mangle('mailto:')+L;}else{L=A(N[1]);M=L;}J+=this.renderer.link(M,null,L);continue;
+}if(!this.inLink&&(N=this.rules.url.exec(I))){I=I.substring(N[0].length);L=A(N[1]);M=L;J+=this.renderer.link(M,null,L);continue;}if(N=this.rules.tag.exec(I)){if(!this.inLink&&/^<a /i.test(N[0])){this.inLink=true;}else if(this.inLink&&/^<\/a>/i.test(N[0])){this.inLink=false;
+}I=I.substring(N[0].length);J+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):A(N[0]):N[0];continue;}if(N=this.rules.link.exec(I)){I=I.substring(N[0].length);this.inLink=true;J+=this.outputLink(N,{href:N[2],title:N[3]});this.inLink=false;
+continue;}if((N=this.rules.reflink.exec(I))||(N=this.rules.nolink.exec(I))){I=I.substring(N[0].length);K=(N[2]||N[1]).replace(/\s+/g,' ');K=this.links[K.toLowerCase()];if(!K||!K.href){J+=N[0].charAt(0);I=N[0].substring(1)+I;continue;}this.inLink=true;J+=this.outputLink(N,K);
+this.inLink=false;continue;}if(N=this.rules.strong.exec(I)){I=I.substring(N[0].length);J+=this.renderer.strong(this.output(N[2]||N[1]));continue;}if(N=this.rules.em.exec(I)){I=I.substring(N[0].length);J+=this.renderer.em(this.output(N[2]||N[1]));continue;
+}if(N=this.rules.code.exec(I)){I=I.substring(N[0].length);J+=this.renderer.codespan(A(N[2],true));continue;}if(N=this.rules.br.exec(I)){I=I.substring(N[0].length);J+=this.renderer.br();continue;}if(N=this.rules.del.exec(I)){I=I.substring(N[0].length);J+=this.renderer.del(this.output(N[1]));
+continue;}if(N=this.rules.text.exec(I)){I=I.substring(N[0].length);J+=this.renderer.text(A(this.smartypants(N[0])));continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return J;};E.prototype.outputLink=function(I,J){var K=A(J.href),L=J.title?A(J.title):null;
+return I[0].charAt(0)!=='!'?this.renderer.link(K,L,this.output(I[1])):this.renderer.image(K,L,A(I[1]));};E.prototype.smartypants=function(I){if(!this.options.smartypants){return I;}return I.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
+};E.prototype.mangle=function(I){if(!this.options.mangle){return I;}var J='',l=I.length,i=0,ch;for(;i<l;i++){ch=I.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}J+='&#'+ch+';';}return J;};var F=function(I){this.options=I||{};};F.prototype.code=function(I,J,K){if(this.options.highlight){var L=this.options.highlight(I,J);
+if(L!=null&&L!==I){K=true;I=L;}}else{K=true;}if(!J){return '<pre><code>'+(K?I:A(I,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+A(J,true)+'">'+(K?I:A(I,true))+'\n</code></pre>\n';};F.prototype.blockquote=function(I){return '<blockquote>\n'+I+'</blockquote>\n';
+};F.prototype.html=function(I){return I;};F.prototype.heading=function(I,J,K){return '<h'+J+' id="'+this.options.headerPrefix+K.toLowerCase().replace(/[^\w]+/g,'-')+'">'+I+'</h'+J+'>\n';};F.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};F.prototype.list=function(I,J){var K=J?'ol':'ul';return '<'+K+'>\n'+I+'</'+K+'>\n';};F.prototype.listitem=function(I){return '<li>'+I+'</li>\n';};F.prototype.paragraph=function(I){return '<p>'+I+'</p>\n';};F.prototype.table=function(I,J){return '<table class="table table-striped">\n'+'<thead>\n'+I+'</thead>\n'+'<tbody>\n'+J+'</tbody>\n'+'</table>\n';
+};F.prototype.tablerow=function(I){return '<tr>\n'+I+'</tr>\n';};F.prototype.tablecell=function(I,J){var K=J.header?'th':'td';var L=J.align?'<'+K+' style="text-align:'+J.align+'">':'<'+K+'>';return L+I+'</'+K+'>\n';};F.prototype.strong=function(I){return '<strong>'+I+'</strong>';
+};F.prototype.em=function(I){return '<em>'+I+'</em>';};F.prototype.codespan=function(I){return '<code>'+I+'</code>';};F.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};F.prototype.del=function(I){return '<del>'+I+'</del>';};F.prototype.link=function(I,J,K){if(this.options.sanitize){try{var L=decodeURIComponent(unescape(I)).replace(/[^\w:]/g,'').toLowerCase();
+}catch(e){return '';}if(L.indexOf('javascript:')===0||L.indexOf('vbscript:')===0){return '';}}var M='<a href="'+I+'"';if(J){M+=' title="'+J+'"';}M+='>'+K+'</a>';return M;};F.prototype.image=function(I,J,K){var L='<img src="'+I+'" alt="'+K+'"';if(J){L+=' title="'+J+'"';
+}L+=this.options.xhtml?'/>':'>';return L;};F.prototype.text=function(I){return I;};var G=function(I){this.tokens=[];this.token=null;this.options=I||H.defaults;this.options.renderer=this.options.renderer||new F;this.renderer=this.options.renderer;this.renderer.options=this.options;
+};G.parse=function(I,J,K){var L=new G(J,K);return L.parse(I);};G.prototype.parse=function(I){this.inline=new E(I.links,this.options,this.renderer);this.tokens=I.reverse();var J='';while(this.next()){J+=this.tok();}return J;};G.prototype.next=function(){return this.token=this.tokens.pop();
+};G.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};G.prototype.parseText=function(){var I=this.token.text;while(this.peek().type==='text'){I+='\n'+this.next().text;}return this.inline.output(I);};G.prototype.tok=function(){switch(this.token.type){case 'space':{return '';
+}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var I='',J='',i,K,L,M,j;
+L='';for(i=0;i<this.token.header.length;i++){M={header:true,align:this.token.align[i]};L+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}I+=this.renderer.tablerow(L);for(i=0;i<this.token.cells.length;
+i++){K=this.token.cells[i];L='';for(j=0;j<K.length;j++){L+=this.renderer.tablecell(this.inline.output(K[j]),{header:false,align:this.token.align[j]});}J+=this.renderer.tablerow(L);}return this.renderer.table(I,J);}case 'blockquote_start':{var J='';while(this.next().type!=='blockquote_end'){J+=this.tok();
+}return this.renderer.blockquote(J);}case 'list_start':{var J='',N=this.token.ordered;while(this.next().type!=='list_end'){J+=this.tok();}return this.renderer.list(J,N);}case 'list_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.token.type==='text'?this.parseText():this.tok();
+}return this.renderer.listitem(J);}case 'loose_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.tok();}return this.renderer.listitem(J);}case 'html':{var O=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
+return this.renderer.html(O);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var H=function(I,J,K){if(K||typeof J==='function'){if(!K){K=J;J=null;}J=B({}
+,H.defaults,J||{});var L=J.highlight,M,N,i=0;try{M=C.lex(I,J)}catch(e){return K(e);}N=M.length;var O=function(P){if(P){J.highlight=L;return K(P);}var Q;try{Q=G.parse(M,J);}catch(e){P=e;}J.highlight=L;return P?K(P):K(null,Q);};if(!L||L.length<3){return O();
+}delete J.highlight;if(!N){return O();}for(;i<M.length;i++){(function(P){if(P.type!=='code'){return --N||O();}return L(P.text,P.lang,function(Q,R){if(Q){return O(Q);}if(R==null||R===P.text){return --N||O();}P.text=R;P.escaped=true;--N||O();});})(M[i]);}return;
+}try{if(J){J=B({},H.defaults,J);}return G.parse(C.lex(I,J),J);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((J||H.defaults).silent){return '<p>An error occured:</p><pre>'+A(e.message+'',true)+'</pre>';}throw e;}};H.options=H.setOptions=function(I){B(H.defaults,I);
+return H;};H.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new F,xhtml:false};H.Parser=G;H.parser=G.parse;
+H.Renderer=F;H.Lexer=C;H.lexer=C.lex;H.InlineLexer=E;H.inlineLexer=E.output;H.parse=H;Roo.Markdown.marked=H;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
@@ -810,7 +892,7 @@ Roo.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown
 },endDrag:function(e){var A=this.getEl();var B=this.getDragEl();B.style.visibility="";this.beforeMove();A.style.visibility="hidden";Roo.dd.DDM.moveToEl(A,B);B.style.visibility="hidden";A.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){}
 ,toString:function(){return ("DDProxy "+this.id);}});
 // Roo/dd/DDTarget.js
-Roo.dd.DDTarget=function(id,A,B){if(id){this.initTarget(id,A,B);}if(B.listeners||B.events){Roo.dd.DragDrop.superclass.constructor.call(this,{listeners:B.listeners||{},events:B.events||{}});}};Roo.extend(Roo.dd.DDTarget,Roo.dd.DragDrop,{toString:function(){return ("DDTarget "+this.id);
+Roo.dd.DDTarget=function(id,A,B){if(id){this.initTarget(id,A,B);}if(B&&(B.listeners||B.events)){Roo.dd.DragDrop.superclass.constructor.call(this,{listeners:B.listeners||{},events:B.events||{}});}};Roo.extend(Roo.dd.DDTarget,Roo.dd.DragDrop,{toString:function(){return ("DDTarget "+this.id);
 }});
 // Roo/dd/ScrollManager.js
 Roo.dd.ScrollManager=function(){var A=Roo.dd.DragDropMgr;var B={};var C=null;var D={};var E=function(e){C=null;H();};var F=function(){if(A.dragCurrent){A.refreshCache(A.dragCurrent.groups);}};var G=function(){if(A.dragCurrent){var K=Roo.dd.ScrollManager;if(!K.animate){if(D.el.scroll(D.dir,K.increment)){F();