compile for changes to combboxarray
[roojs1] / roojs-all.js
index 3b13595..6ad2202 100644 (file)
@@ -1,24 +1,24 @@
 // Roo.js
-window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=!D&&ua.indexOf("gecko")>-1,J=F&&!B,K=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),L=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),M=(ua.indexOf("linux")!=-1),N=window.location.href.toLowerCase().indexOf("https")===0,O=/iphone|ipad/.test(ua),P=(function(){try{document.createEvent("TouchEvent");
-return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:N,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){}
-,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var Q={};for(var b in o){var R=b.split('@');if(R[1]){var s=R[0];
-if(!Q[s]){Q[s]=Roo.select(s);}Q[s].on(R[1],o[b]);}}Q=null;},id:function(el,Q){Q=Q||"roo-gen";el=Roo.getDom(el);var id=Q+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,Q){if(typeof sp=='object'){Q=sp;
-sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},R,S=sp.prototype;F.prototype=S;R=sb.prototype=new F();R.constructor=sb;sb.superclass=S;if(S.constructor==Object.prototype.constructor){S.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
-};R.override=io;Roo.override(sb,Q);return sb;};}(),override:function(Q,R){if(R){var p=Q.prototype;for(var S in R){p[S]=R[S];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');
+window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=ua.indexOf("edge")>-1,J=!D&&ua.indexOf("gecko")>-1,K=F&&!B,L=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),M=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),N=(ua.indexOf("linux")!=-1),O=window.location.href.toLowerCase().indexOf("https")===0,P=/iphone|ipad/.test(ua),Q=/android/.test(ua),R=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true;
+window.removeEventListener('touchstart',__set_has_touch__);});return false;}document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:O,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){}
+,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var S={};for(var b in o){var T=b.split('@');if(T[1]){var s=T[0];
+if(!S[s]){S[s]=Roo.select(s);}S[s].on(T[1],o[b]);}}S=null;},id:function(el,S){S=S||"roo-gen";el=Roo.getDom(el);var id=S+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,S){if(typeof sp=='object'){S=sp;
+sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},T,U=sp.prototype;F.prototype=U;T=sb.prototype=new F();T.constructor=sb;sb.superclass=U;if(U.constructor==Object.prototype.constructor){U.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
+};T.override=io;Roo.override(sb,S);return sb;};}(),override:function(S,T){if(T){var p=S.prototype;for(var U in T){p[U]=T[U];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');
 for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},factory:function(c,ns){if(!c.xtype||(!ns&&!c.xns)||(c.xns===false)){return c;}ns=c.xns?c.xns:ns;if(c.constructor==ns[c.xtype]){return c;}if(ns[c.xtype]){if(Roo.debug){Roo.log("Roo.Factory("+c.xtype+")");
-}var Q=new ns[c.xtype](c);Q.xns=false;return Q;}c.xns=false;return c;},log:function(s){if((typeof(console)=='undefined')||(typeof(console.log)=='undefined')){return;}console.log(s);},urlEncode:function(o){if(!o){return "";}var Q=[];for(var R in o){var ov=o[R],k=Roo.encodeURIComponent(R);
-var S=typeof ov;if(S=='undefined'){Q.push(k,"=&");}else if(S!="function"&&S!="object"){Q.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,T=ov.length;i<T;i++){Q.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
-}}else{Q.push(k,"=&");}}}Q.pop();return Q.join("");},encodeURIComponent:function(Q){try{return encodeURIComponent(Q);}catch(e){}if(Q==''||Q==null){return '';}function nibble_to_hex(T){var U='0123456789ABCDEF';return U.charAt(T);}Q=Q.toString();var R='';for(var i=0;
-i<Q.length;i++){var c=Q.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);
-}else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3F);}else{bs[0]=c;}for(var j=0;j<bs.length;j++){var b=bs[j];var S=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);R+='%'+S;}}return R;},urlDecode:function(Q,R){if(!Q||!Q.length){return {};}var S={}
-;var T=Q.split('&');var U,V,W;for(var i=0,X=T.length;i<X;i++){U=T[i].split('=');V=decodeURIComponent(U[0]);W=decodeURIComponent(U[1]);if(R!==true){if(typeof S[V]=="undefined"){S[V]=W;}else if(typeof S[V]=="string"){S[V]=[S[V]];S[V].push(W);}else{S[V].push(W);
-}}else{S[V]=W;}}return S;},each:function(Q,fn,R){if(typeof Q.length=="undefined"||typeof Q=="string"){Q=[Q];}for(var i=0,S=Q.length;i<S;i++){if(fn.call(R||Q[i],Q[i],i,Q)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;
-i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,Q,R,S){if(typeof cb=="function"){if(S){cb.defer(S,Q,R||[]);
-}else{cb.apply(Q,R||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,Q){if(typeof v!='number'){return Q;}return v;
-},destroy:function(){for(var i=0,a=arguments,Q=a.length;i<Q;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;
+}var S=new ns[c.xtype](c);S.xns=false;return S;}c.xns=false;return c;},log:function(s){if((typeof(console)=='undefined')||(typeof(console.log)=='undefined')){return;}console.log(s);},urlEncode:function(o){if(!o){return "";}var S=[];for(var T in o){var ov=o[T],k=Roo.encodeURIComponent(T);
+var U=typeof ov;if(U=='undefined'){S.push(k,"=&");}else if(U!="function"&&U!="object"){S.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,V=ov.length;i<V;i++){S.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
+}}else{S.push(k,"=&");}}}S.pop();return S.join("");},encodeURIComponent:function(S){try{return encodeURIComponent(S);}catch(e){}if(S==''||S==null){return '';}function nibble_to_hex(V){var W='0123456789ABCDEF';return W.charAt(V);}S=S.toString();var T='';for(var i=0;
+i<S.length;i++){var c=S.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);
+}else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3F);}else{bs[0]=c;}for(var j=0;j<bs.length;j++){var b=bs[j];var U=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);T+='%'+U;}}return T;},urlDecode:function(S,T){if(!S||!S.length){return {};}var U={}
+;var V=S.split('&');var W,X,Y;for(var i=0,Z=V.length;i<Z;i++){W=V[i].split('=');X=decodeURIComponent(W[0]);Y=decodeURIComponent(W[1]);if(T!==true){if(typeof U[X]=="undefined"){U[X]=Y;}else if(typeof U[X]=="string"){U[X]=[U[X]];U[X].push(Y);}else{U[X].push(Y);
+}}else{U[X]=Y;}}return U;},each:function(S,fn,T){if(typeof S.length=="undefined"||typeof S=="string"){S=[S];}for(var i=0,U=S.length;i<U;i++){if(fn.call(T||S[i],S[i],i,S)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;
+i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,S,T,U){if(typeof cb=="function"){if(U){cb.defer(U,S,T||[]);
+}else{cb.apply(S,T||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,S){if(typeof v!='number'){return S;}return v;
+},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,Q){return v===null||v===undefined||(!Q?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isIE11:H,isGecko:I,isBorderBox:J,isWindows:K,isLinux:M,isMac:L,isIOS:O,isTouch:P,useShims:((F&&!G)||(I&&L)),selectNode:function(Q,R){var S=Roo.DomQuery.selectNode(Q,R);
-return S?Roo.get(S):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");
+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");
 // 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,7 +27,8 @@ 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;});};
 // Number.js
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
 // Array.js
@@ -61,11 +62,11 @@ return (A<0)?(A+7):A;};Date.prototype.getLastDayOfMonth=function(){var A=(this.g
 };Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth());};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return "st";
 case 2:case 22:return "nd";case 3:case 23:return "rd";default:return "th";}};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
 Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.prototype.clone=function(){return new Date(this.getTime());
-};Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime();}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(A){if(A<=-1){var n=Math.ceil(-A);
-var B=Math.ceil(n/12);var C=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-B);return Date.brokenSetMonth.call(this,C);}else{return Date.brokenSetMonth.apply(this,arguments);}};}Date.MILLI="ms";Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";
-Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(A,B){var d=this.clone();if(!A||B===0){return d;}switch(A.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+B);break;case Date.SECOND:d.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+B);
-break;case Date.HOUR:d.setHours(this.getHours()+B);break;case Date.DAY:d.setDate(this.getDate()+B);break;case Date.MONTH:var C=this.getDate();if(C>28){C=Math.min(C,this.getFirstDateOfMonth().add('mo',B).getLastDateOfMonth().getDate());}d.setDate(C);d.setMonth(this.getMonth()+B);
-break;case Date.YEAR:d.setFullYear(this.getFullYear()+B);break;}return d;};
+};Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime();}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari&&typeof(Date.brokenSetMonth)=='undefined'){Date.brokenSetMonth=Date.prototype.setMonth;
+Date.prototype.setMonth=function(A){if(A<=-1){var n=Math.ceil(-A);var B=Math.ceil(n/12);var C=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-B);return Date.brokenSetMonth.call(this,C);}else{return Date.brokenSetMonth.apply(this,arguments);}};}Date.MILLI="ms";
+Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(A,B){var d=this.clone();if(!A||B===0){return d;}switch(A.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+B);break;
+case Date.SECOND:d.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+B);break;case Date.HOUR:d.setHours(this.getHours()+B);break;case Date.DAY:d.setDate(this.getDate()+B);break;case Date.MONTH:var C=this.getDate();if(C>28){C=Math.min(C,this.getFirstDateOfMonth().add('mo',B).getLastDateOfMonth().getDate());
+}d.setDate(C);d.setMonth(this.getMonth()+B);break;case Date.YEAR:d.setFullYear(this.getFullYear()+B);break;}return d;};
 // Roo/lib/Dom.js
 Roo.lib.Dom={getViewWidth:function(A){return A?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(A){return A?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;
 return Math.max(A,this.getViewportHeight());},getDocumentWidth:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(A,this.getViewportWidth());},getViewportHeight:function(){var A=self.innerHeight;
@@ -211,11 +212,11 @@ return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';},insertBefore
 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);}};}();
 // 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);
-}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?"+":",";
+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){Roo.log(["applyTemplate",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);
@@ -270,7 +271,9 @@ 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
 Roo.EventManager=function(){var A,B,C=false;var F,G,H,I;var E=Roo.lib.Event;var D=Roo.lib.Dom;var J=function(){if(!C){C=true;Roo.isReady=true;if(B){clearInterval(B);}if(Roo.isGecko||Roo.isOpera){document.removeEventListener("DOMContentLoaded",J,false);}if(Roo.isIE){var T=document.getElementById("ie-deferred-loader");
 if(T){T.onreadystatechange=null;T.parentNode.removeChild(T);}}if(A){A.fire();A.clearListeners();}}};var K=function(){A=new Roo.util.Event();if(Roo.isGecko||Roo.isOpera){document.addEventListener("DOMContentLoaded",J,false);}else if(Roo.isIE){document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
@@ -288,9 +291,9 @@ A.fire();A.clearListeners();return;}if(!A){K();}A.addListener(fn,T,U);},onWindow
 }else{F.fire(D.getViewWidth(),D.getViewHeight());}});}F.addListener(fn,T,U);},onTextResize:function(fn,T,U){if(!H){H=new Roo.util.Event();var V=new Roo.Element(document.createElement('div'));V.dom.className='x-text-resize';V.dom.innerHTML='X';V.appendTo(document.body);
 I=V.dom.offsetHeight;setInterval(function(){if(V.dom.offsetHeight!=I){H.fire(I,I=V.dom.offsetHeight);}},this.textResizeInterval);}H.addListener(fn,T,U);},removeResizeListener:function(fn,T){if(F){F.removeListener(fn,T);}},fireResize:function(){if(F){F.fire(D.getViewWidth(),D.getViewHeight());
 }},ieDeferSrc:false,textResizeInterval:50};S.on=S.addListener;S.un=S.removeListener;S.stoppedMouseDownEvent=new Roo.util.Event();return S;}();Roo.onReady=Roo.EventManager.onDocumentReady;Roo.onReady(function(){var bd=Roo.get(document.body);if(!bd){return;
-}var A=[Roo.isIE?"roo-ie":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){A.push("roo-mac");}if(Roo.isLinux){A.push("roo-linux");}if(Roo.isIOS){A.push("roo-ios");}if(Roo.isTouch){A.push("roo-touch");}if(Roo.isBorderBox){A.push('roo-border-box');
-}if(Roo.isStrict){var p=bd.dom.parentNode;if(p){p.className+=' roo-strict';}}bd.addClass(A.join(' '));});Roo.EventObject=function(){var E=Roo.lib.Event;var A={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var B=Roo.isIE?{1:0,4:1,2:2}
-:(Roo.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Roo.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Roo.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;
+}var A=[Roo.isIE?"roo-ie":Roo.isIE11?"roo-ie11":Roo.isEdge?"roo-edge":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){A.push("roo-mac");}if(Roo.isLinux){A.push("roo-linux");}if(Roo.isIOS){A.push("roo-ios");}if(Roo.isTouch){A.push("roo-touch");
+}if(Roo.isBorderBox){A.push('roo-border-box');}if(Roo.isStrict){var p=bd.dom.parentNode;if(p){p.className+=' roo-strict';}}bd.addClass(A.join(' '));});Roo.EventObject=function(){var E=Roo.lib.Event;var A={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35}
+;var B=Roo.isIE?{1:0,4:1,2:2}:(Roo.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Roo.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Roo.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;
 }this.browserEvent=e;if(e){this.button=e.button?B[e.button]:(e.which?e.which-1:-1);if(e.type=='click'&&this.button==-1){this.button=0;}this.type=e.type;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;
 this.charCode=(e.type=='keyup'||e.type=='keydown')?0:e.charCode;this.target=E.getTarget(e);this.xy=E.getXY(e);}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0];}return this;
 },stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);}E.stopEvent(this.browserEvent);}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent);}
@@ -303,8 +306,10 @@ return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPag
 (function(){var D=Roo.lib.Dom;var E=Roo.lib.Event;var A=Roo.lib.Anim;var B={};var C=/(-[a-z])/gi;var F=function(m,a){return a.charAt(1).toUpperCase();};var G=document.defaultView;Roo.Element=function(J,K){var L=typeof J=="string"?document.getElementById(J):J;
 if(!L){return null;}var id=L.id;if(K!==true&&id&&Roo.Element.cache[id]){return Roo.Element.cache[id];}this.dom=L;this.id=id||Roo.id(L);};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;
 return this;},enableDisplayMode:function(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;},up:function(J,K){return this.findParentNode(J,K,true);
-},is:function(J){return Roo.DomQuery.is(this.dom,J);},animate:function(J,K,L,M,N){this.anim(J,{duration:K,callback:L,easing:M},N);return this;},anim:function(J,K,L,M,N,cb){L=L||'run';K=K||{};var O=Roo.lib.Anim[L](this.dom,J,(K.duration||M)||.35,(K.easing||N)||'easeOut',function(){Roo.callback(cb,this);
+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;
+}if(J.test(L.getStyle('overflow')+L.getStyle('overflow-x')+L.getStyle('overflow-y'))){return L;}if(L.dom.nodeName.toLowerCase()=='body'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}}return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);
+},up:function(J,K){return this.findParentNode(J,K,true);},is:function(J){return Roo.DomQuery.is(this.dom,J);},animate:function(J,K,L,M,N){this.anim(J,{duration:K,callback:L,easing:M},N);return this;},anim:function(J,K,L,M,N,cb){L=L||'run';K=K||{};var O=Roo.lib.Anim[L](this.dom,J,(K.duration||M)||.35,(K.easing||N)||'easeOut',function(){Roo.callback(cb,this);
 Roo.callback(K.callback,K.scope||this,[this,K]);},this);K.anim=O;return O;},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});},clean:function(J){if(this.isCleaned&&J!==true){return this;
 }var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;}n=nx;}this.isCleaned=true;return this;},calcOffsetsTo:function(el){el=Roo.get(el);var d=el.dom;
 var J=false;if(el.getStyle('position')=='static'){el.position('relative');J=true;}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!='HTML'){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent;}if(J){el.position('static');}return [x,y];},scrollIntoView:function(J,K){var c=Roo.getDom(J)||document.body;
@@ -377,8 +382,8 @@ 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);
@@ -469,16 +474,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,p,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;}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,ps,A){var B=Roo.getDom(o.form);B.enctype=B.encoding='multipart/form-data';var C=o.formData===true?new FormData(B):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,o.formData,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
@@ -537,14 +546,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];
@@ -559,9 +568,9 @@ 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,"");
+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,"");
 }};}();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)}
@@ -624,18 +633,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();
@@ -649,25 +658,87 @@ this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.
 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/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);if(!el&&typeof(this.parent)=='string'&&this.parent.substring(0,1)=='#'){var A=this.parent.substr(1);this.parent=false;Roo.debug&&Roo.log(A);switch(A){case 'bootstrap-body':if(typeof(Roo.bootstrap.Body)!='undefined'){this.parent={el:new Roo.bootstrap.Body()}
-;Roo.debug&&Roo.log("setting el to doc body");}else{throw "Container is bootstrap body, but Roo.bootstrap.Body is not defined";}break;case 'bootstrap':this.parent={el:true};default:el=Roo.get(A);break;}if(!el&&!this.parent){Roo.debug&&Roo.log("Warning - element can not be found :#"+A);
-return;}}Roo.debug&&Roo.log("EL:");Roo.debug&&Roo.log(el);Roo.debug&&Roo.log("this.parent.el:");Roo.debug&&Roo.log(this.parent.el);var B=this._tree?this._tree():this.tree();var C=(typeof(Roo.bootstrap)!='undefined'&&B.xns==Roo.bootstrap)||(typeof(Roo.mailer)!='undefined'&&B.xns==Roo.mailer);
-if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("no parent - creating one");el=el?Roo.get(el):false;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;}B.region=B.region||this.region;if(this.parent.el===true){this.parent.el=Roo.factory(B);}this.el=this.parent.el.addxtype(B);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:[],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)}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(!this.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);},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);
+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}
+;break;}if(["Nest","Content","Grid","Tree"].indexOf(A.xtype)>-1){this.parent={el:new Roo.bootstrap.layout.Border({el:document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,hideTabs:false}})};break;}if(typeof(Roo.bootstrap.Body)!='undefined'){this.parent={el:new Roo.bootstrap.Body()}
+;Roo.debug&&Roo.log("setting el to doc body");}else{throw "Container is bootstrap body, but Roo.bootstrap.Body is not defined";}break;case 'bootstrap':this.parent={el:true};default:el=Roo.get(B);if(typeof(Roo.bootstrap)!='undefined'&&A['|xns']=='Roo.bootstrap'){this.parent={el:true}
+;}break;}if(!el&&!this.parent){Roo.debug&&Roo.log("Warning - element can not be found :#"+B);return;}}Roo.debug&&Roo.log("EL:");Roo.debug&&Roo.log(el);Roo.debug&&Roo.log("this.parent.el:");Roo.debug&&Roo.log(this.parent.el);var C=Roo.XComponent.is_alt||(typeof(A.el)!='undefined'&&A.el==document.body)||(typeof(Roo.bootstrap)!='undefined'&&A.xns==Roo.bootstrap)||(typeof(Roo.mailer)!='undefined'&&A.xns==Roo.mailer);
+if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("no parent - creating one");el=el?Roo.get(el):false;if(typeof(Roo.BorderLayout)=='undefined'){this.parent={el:new Roo.bootstrap.layout.Border({el:el||document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:false,hideTabs:true,minTabWidth:140,overflow:'visible'}
+})};}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||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,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=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){}
@@ -745,7 +816,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();
@@ -821,8 +892,9 @@ for(var i=0,B=A.length;i<B;i++){A[i].join(this);}var C=this.data.length;this.dat
 }if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn["sort"]]=this.sortInfo.field;p[pn["dir"]]=this.sortInfo.direction;}if(this.multiSort){var pn=this.paramNames;p[pn["multisort"]]=Roo.encode({sort:this.sortToggle,order:this.sortOrder});}this.proxy.load(p,this.reader,this.loadRecords,this,A);
 }},reload:function(A){this.load(Roo.applyIf(A||{},this.lastOptions));},loadRecords:function(o,A,B){if(!o||B===false){if(B!==false){this.fireEvent("load",this,[],A,o);}if(A.callback){A.callback.call(A.scope||this,[],A,false);}return;}if(o.success===false){if(!this.hasListener('loadexception')&&typeof(o.raw.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",o.raw.errorMsg);
 }this.fireEvent("loadexception",this,o,A,o.raw.errorMsg);return;}var r=o.records,t=o.totalRecords||r.length;this.fireEvent("beforeloadadd",this,r,A,o);if(!A||A.add!==true){if(this.pruneModifiedRecords){this.modified=[];}for(var i=0,C=r.length;i<C;i++){r[i].join(this);
-}if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else{this.totalLength=Math.max(t,this.data.length+r.length);this.add(r);}this.fireEvent("load",this,r,A,o);
-if(A.callback){A.callback.call(A.scope||this,r,A,true);}},loadData:function(o,A){var r=this.reader.readRecords(o);this.loadRecords(r,{add:A},true);},getCount:function(){return this.data.length||0;},getTotalCount:function(){return this.totalLength||0;},getSortState:function(){return this.sortInfo;
+}if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else{this.totalLength=Math.max(t,this.data.length+r.length);this.add(r);}if(this.parent&&!Roo.isIOS&&!this.useNativeIOS&&this.parent.emptyTitle.length){var e=new Roo.data.Record({}
+);e.set(this.parent.displayField,this.parent.emptyTitle);e.set(this.parent.valueField,'');this.insert(0,e);}this.fireEvent("load",this,r,A,o);if(A.callback){A.callback.call(A.scope||this,r,A,true);}},loadData:function(o,A){var r=this.reader.readRecords(o);
+this.loadRecords(r,{add:A},true);},loadDataFromChildren:function(A){this.loadData(this.reader.toLoadData(A));},getCount:function(){return this.data.length||0;},getTotalCount:function(){return this.totalLength||0;},getSortState:function(){return this.sortInfo;
 },applySort:function(){if(this.sortInfo&&!this.remoteSort){var s=this.sortInfo,f=s.field;var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0);};this.data.sort(s.direction,fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(s.direction,fn);
 }}},setDefaultSort:function(A,B){this.sortInfo={field:A,direction:B?B.toUpperCase():"ASC"};},sort:function(A,B){var f=this.fields.get(A);if(!B){this.sortToggle[f.name]=this.sortToggle[f.name]||f.sortDir;if(this.multiSort||(this.sortInfo&&this.sortInfo.field==f.name)){B=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC");
 }else{B=f.sortDir;}}this.sortToggle[f.name]=B;this.sortInfo={field:f.name,direction:B};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this);}else{this.load(this.lastOptions);}},each:function(fn,A){this.data.each(fn,A);},getModifiedRecords:function(){return this.modified;
@@ -835,8 +907,8 @@ if(A!==true){this.fireEvent("datachanged",this);}}},afterEdit:function(A){if(thi
 this.modified=[];for(var i=0,A=m.length;i<A;i++){m[i].reject();}},onMetaChange:function(A,B,o){this.recordType=B;this.fields=B.prototype.fields;delete this.snapshot;this.sortInfo=A.sortInfo||this.sortInfo;this.modified=[];this.fireEvent('metachange',this,this.reader.meta);
 },moveIndex:function(A,B){var C=this.indexOf(A);var D=C+B;this.remove(A);this.insert(D,A);}});
 // Roo/data/SimpleStore.js
-Roo.data.SimpleStore=function(A){Roo.data.SimpleStore.superclass.constructor.call(this,{isLocal:true,reader:new Roo.data.ArrayReader({id:A.id},Roo.data.Record.create(A.fields)),proxy:new Roo.data.MemoryProxy(A.data)});this.load();};Roo.extend(Roo.data.SimpleStore,Roo.data.Store);
-
+Roo.data.SimpleStore=function(A){Roo.data.SimpleStore.superclass.constructor.call(this,{isLocal:true,reader:typeof(A.reader)!='undefined'?A.reader:new Roo.data.ArrayReader({id:A.id},Roo.data.Record.create(A.fields)),proxy:new Roo.data.MemoryProxy(A.data)});
+this.load();};Roo.extend(Roo.data.SimpleStore,Roo.data.Store);
 // Roo/data/JsonStore.js
 Roo.data.JsonStore=function(c){Roo.data.JsonStore.superclass.constructor.call(this,Roo.apply(c,{proxy:!c.data?new Roo.data.HttpProxy({url:c.url}):undefined,reader:new Roo.data.JsonReader(c,c.fields)}));};Roo.extend(Roo.data.JsonStore,Roo.data.Store);
 // Roo/data/Field.js
@@ -846,13 +918,13 @@ break;case "date":this.sortType=st.asDate;break;default:this.sortType=st.none;}}
 };break;case "date":cv=function(v){if(!v){return '';}if(v instanceof Date){return v;}if(C){if(C=="timestamp"){return new Date(v*1000);}return Date.parseDate(v,C);}var D=Date.parse(v);return D?new Date(D):null;};break;}this.convert=cv;}};Roo.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"}
 ;
 // Roo/data/DataReader.js
-Roo.data.DataReader=function(A,B){this.meta=A;this.recordType=B instanceof Array?Roo.data.Record.create(B):B;};Roo.data.DataReader.prototype={newRow:function(d){var da={};this.recordType.prototype.fields.each(function(c){switch(c.type){case 'int':da[c.name]=0;
+Roo.data.DataReader=function(A,B){this.meta=A;this.recordType=B instanceof Array?Roo.data.Record.create(B):B;};Roo.data.DataReader.prototype={readerType:'Data',newRow:function(d){var da={};this.recordType.prototype.fields.each(function(c){switch(c.type){case 'int':da[c.name]=0;
 break;case 'date':da[c.name]=new Date();break;case 'float':da[c.name]=0.0;break;case 'boolean':da[c.name]=false;break;default:da[c.name]="";break;}});return new this.recordType(Roo.apply(da,d));}};
 // Roo/data/DataProxy.js
 Roo.data.DataProxy=function(){this.addEvents({beforeload:true,load:true,loadexception:true});Roo.data.DataProxy.superclass.constructor.call(this);};Roo.extend(Roo.data.DataProxy,Roo.util.Observable);
 // Roo/data/MemoryProxy.js
-Roo.data.MemoryProxy=function(A){if(A.data){A=A.data;}Roo.data.MemoryProxy.superclass.constructor.call(this);this.data=A;};Roo.extend(Roo.data.MemoryProxy,Roo.data.DataProxy,{load:function(A,B,C,D,E){A=A||{};var F;try{F=B.readRecords(this.data);}catch(e){this.fireEvent("loadexception",this,E,null,e);
-C.call(D,null,E,false);return;}C.call(D,F,E,true);},update:function(A,B){}});
+Roo.data.MemoryProxy=function(A){if(A.data){A=A.data;}Roo.data.MemoryProxy.superclass.constructor.call(this);this.data=A;};Roo.extend(Roo.data.MemoryProxy,Roo.data.DataProxy,{load:function(A,B,C,D,E){A=A||{};var F;try{F=B.readRecords(A.data?A.data:this.data);
+}catch(e){this.fireEvent("loadexception",this,E,null,e);C.call(D,null,E,false);return;}C.call(D,F,E,true);},update:function(A,B){}});
 // Roo/data/HttpProxy.js
 Roo.data.HttpProxy=function(A){Roo.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events;};Roo.extend(Roo.data.HttpProxy,Roo.data.DataProxy,{getConnection:function(){return this.useAjax?Roo.Ajax:this.conn;},load:function(A,B,C,D,E){if(this.fireEvent("beforeload",this,A)!==false){var o={params:A||{}
 ,request:{callback:C,scope:D,arg:E},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Roo.applyIf(o,this.conn);if(this.activeRequest){Roo.Ajax.abort(this.activeRequest);}this.activeRequest=Roo.Ajax.request(o);}else{this.conn.request(o);}}else{C.call(D||this,null,E,false);
@@ -867,23 +939,23 @@ J.setAttribute("type","text/javascript");J.setAttribute("id",H.scriptId);this.he
 }catch(e){}};}},handleResponse:function(o,A){this.trans=false;this.destroyTrans(A,true);var B;try{B=A.reader.readRecords(o);}catch(e){this.fireEvent("loadexception",this,o,A.arg,e);A.callback.call(A.scope||window,null,A.arg,false);return;}this.fireEvent("load",this,o,A.arg);
 A.callback.call(A.scope||window,B,A.arg,true);},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false);}});
 // Roo/data/JsonReader.js
-Roo.data.JsonReader=function(A,B){A=A||{};Roo.applyIf(A,{totalProperty:'total',successProperty:'success',root:'data',id:'id'});Roo.data.JsonReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.JsonReader,Roo.data.DataReader,{metaFromRemote:false,read:function(A){var B=A.responseText;
+Roo.data.JsonReader=function(A,B){A=A||{};Roo.applyIf(A,{totalProperty:'total',successProperty:'success',root:'data',id:'id'});Roo.data.JsonReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.JsonReader,Roo.data.DataReader,{readerType:'Json',metaFromRemote:false,read:function(A){var B=A.responseText;
 var o=eval("("+B+")");if(!o){throw {message:"JsonReader.read: Json object not found"};}if(o.metaData){delete this.ef;this.metaFromRemote=true;this.meta=o.metaData;this.recordType=Roo.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o);
 }return this.readRecords(o);},onMetaChange:function(A,B,o){},simpleAccess:function(A,B){return A[B];},getJsonAccessor:function(){var re=/[\[\.]/;return function(A){try{return (re.test(A))?new Function("obj","return obj."+A):function(B){return B[A];};}catch(e){}
 return Roo.emptyFn;};}(),readRecords:function(o){this.o=o;var s=this.meta,A=this.recordType,f=A?A.prototype.fields:null,fi=f?f.items:[],fl=f?f.length:0;if(!this.ef){if(s.totalProperty){this.getTotal=this.getJsonAccessor(s.totalProperty);}if(s.successProperty){this.getSuccess=this.getJsonAccessor(s.successProperty);
 }this.getRoot=s.root?this.getJsonAccessor(s.root):function(p){return p;};if(s.id){var g=this.getJsonAccessor(s.id);this.getId=function(I){var r=g(I);return (r===undefined||r==="")?null:r;};}else{this.getId=function(){return null;};}this.ef=[];for(var jj=0;
 jj<fl;jj++){f=fi[jj];var B=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[jj]=this.getJsonAccessor(B);}}var C=this.getRoot(o),c=C.length,D=c,E=true;if(s.totalProperty){var vt=parseInt(this.getTotal(o),10);if(!isNaN(vt)){D=vt;}}if(s.successProperty){var vs=this.getSuccess(o);
 if(vs===false||vs==='false'){E=false;}}var F=[];for(var i=0;i<c;i++){var n=C[i];var G={};var id=this.getId(n);for(var j=0;j<fl;j++){f=fi[j];var v=this.ef[j](n);if(!f.convert){Roo.log('missing convert for '+f.name);Roo.log(f);continue;}G[f.name]=f.convert((v!==undefined)?v:f.defaultValue);
-}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};}});
+}var H=new A(G,id);H.json=n;F[i]=H;}return {raw:o,success:E,records:F,totalRecords:D};},toLoadData:function(A){var B=typeof(A.data.cn)=='undefined'?[]:A.data.cn;return {data:B,total:B.length};}});
 // Roo/data/XmlReader.js
-Roo.data.XmlReader=function(A,B){A=A||{};Roo.data.XmlReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.XmlReader,Roo.data.DataReader,{read:function(A){var B=A.responseXML;if(!B){throw {message:"XmlReader.read: XML Document not available"}
+Roo.data.XmlReader=function(A,B){A=A||{};Roo.data.XmlReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.XmlReader,Roo.data.DataReader,{readerType:'Xml',read:function(A){var B=A.responseXML;if(!B){throw {message:"XmlReader.read: XML Document not available"}
 ;}return this.readRecords(B);},readRecords:function(A){this.xmlData=A;var B=A.documentElement||A;var q=Roo.DomQuery;var C=this.recordType,D=C.prototype.fields;var E=this.meta.id;var F=0,G=true;if(this.meta.totalRecords){F=q.selectNumber(this.meta.totalRecords,B,0);
 }if(this.meta.success){var sv=q.selectValue(this.meta.success,B,true);G=sv!==false&&sv!=='false';}var H=[];var ns=q.select(this.meta.record,B);for(var i=0,I=ns.length;i<I;i++){var n=ns[i];var J={};var id=E?q.selectValue(E,n):undefined;for(var j=0,K=D.length;
 j<K;j++){var f=D.items[j];var v=q.selectValue(f.mapping||f.name,n,f.defaultValue);v=f.convert(v);J[f.name]=v;}var L=new C(J,id);L.node=n;H[H.length]=L;}return {success:G,records:H,totalRecords:F||H.length};}});
 // Roo/data/ArrayReader.js
-Roo.data.ArrayReader=function(A,B){Roo.data.ArrayReader.superclass.constructor.call(this,A,B);};Roo.extend(Roo.data.ArrayReader,Roo.data.JsonReader,{readRecords:function(o){var A=this.meta?this.meta.id:null;var B=this.recordType,C=B.prototype.fields;var D=[];
-var E=o;for(var i=0;i<E.length;i++){var n=E[i];var F={};var id=((A||A===0)&&n[A]!==undefined&&n[A]!==""?n[A]:null);for(var j=0,G=C.length;j<G;j++){var f=C.items[j];var k=f.mapping!==undefined&&f.mapping!==null?f.mapping:j;var v=n[k]!==undefined?n[k]:f.defaultValue;
-v=f.convert(v);F[f.name]=v;}var H=new B(F,id);H.json=n;D[D.length]=H;}return {records:D,totalRecords:D.length};}});
+Roo.data.ArrayReader=function(A,B){Roo.data.ArrayReader.superclass.constructor.call(this,A,B||A.fields);};Roo.extend(Roo.data.ArrayReader,Roo.data.JsonReader,{readRecords:function(o){var A=this.meta?this.meta.id:null;var B=this.recordType,C=B.prototype.fields;
+var D=[];var E=o;for(var i=0;i<E.length;i++){var n=E[i];var F={};var id=((A||A===0)&&n[A]!==undefined&&n[A]!==""?n[A]:null);for(var j=0,G=C.length;j<G;j++){var f=C.items[j];var k=f.mapping!==undefined&&f.mapping!==null?f.mapping:j;var v=n[k]!==undefined?n[k]:f.defaultValue;
+v=f.convert(v);F[f.name]=v;}var H=new B(F,id);H.json=n;D[D.length]=H;}return {records:D,totalRecords:D.length};},toLoadData:function(A){return typeof(A.data.cn)=='undefined'?[]:A.data.cn;}});
 // Roo/data/Tree.js
 Roo.data.Tree=function(A){this.nodeHash={};this.root=null;if(A){this.setRootNode(A);}this.addEvents({"append":true,"remove":true,"move":true,"insert":true,"beforeappend":true,"beforeremove":true,"beforemove":true,"beforeinsert":true});Roo.data.Tree.superclass.constructor.call(this);
 };Roo.extend(Roo.data.Tree,Roo.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments);},getRootNode:function(){return this.root;},setRootNode:function(A){this.root=A;A.ownerTree=this;A.isRoot=true;this.registerNode(A);
@@ -895,14 +967,15 @@ if(ot){if(ot.proxyNodeEvent.apply(ot,arguments)===false){return false;}}return t
 },isFirst:function(){return (!this.parentNode?true:this.parentNode.firstChild==this);},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0;},appendChild:function(A){var B=false;if(A instanceof Array){B=A;}else if(arguments.length>1){B=arguments;
 }if(B){for(var i=0,C=B.length;i<C;i++){this.appendChild(B[i]);}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,A)===false){return false;}var D=this.childNodes.length;var E=A.parentNode;if(E){if(A.fireEvent("beforemove",A.getOwnerTree(),A,E,this,D)===false){return false;
 }E.removeChild(A);}D=this.childNodes.length;if(D==0){this.setFirstChild(A);}this.childNodes.push(A);A.parentNode=this;var ps=this.childNodes[D-1];if(ps){A.previousSibling=ps;ps.nextSibling=A;}else{A.previousSibling=null;}A.nextSibling=null;this.setLastChild(A);
-A.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,A,D);if(E){A.fireEvent("move",this.ownerTree,A,E,this,D);}return A;}},removeChild:function(A){var B=this.childNodes.indexOf(A);if(B==-1){return false;}if(this.fireEvent("beforeremove",this.ownerTree,this,A)===false){return false;
-}this.childNodes.splice(B,1);if(A.previousSibling){A.previousSibling.nextSibling=A.nextSibling;}if(A.nextSibling){A.nextSibling.previousSibling=A.previousSibling;}if(this.firstChild==A){this.setFirstChild(A.nextSibling);}if(this.lastChild==A){this.setLastChild(A.previousSibling);
-}A.setOwnerTree(null);A.parentNode=null;A.previousSibling=null;A.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,A);return A;},insertBefore:function(A,B){if(!B){return this.appendChild(A);}if(A==B){return false;}if(this.fireEvent("beforeinsert",this.ownerTree,this,A,B)===false){return false;
-}var C=this.childNodes.indexOf(B);var D=A.parentNode;var E=C;if(D==this&&this.childNodes.indexOf(A)<C){E--;}if(D){if(A.fireEvent("beforemove",A.getOwnerTree(),A,D,this,C,B)===false){return false;}D.removeChild(A);}if(E==0){this.setFirstChild(A);}this.childNodes.splice(E,0,A);
-A.parentNode=this;var ps=this.childNodes[E-1];if(ps){A.previousSibling=ps;ps.nextSibling=A;}else{A.previousSibling=null;}A.nextSibling=B;B.previousSibling=A;A.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,A,B);if(D){A.fireEvent("move",this.ownerTree,A,D,this,E,B);
-}return A;},item:function(A){return this.childNodes[A];},replaceChild:function(A,B){this.insertBefore(A,B);this.removeChild(B);return B;},indexOf:function(A){return this.childNodes.indexOf(A);},getOwnerTree:function(){if(!this.ownerTree){var p=this;while(p){if(p.ownerTree){this.ownerTree=p.ownerTree;
-break;}p=p.parentNode;}}return this.ownerTree;},getDepth:function(){var A=0;var p=this;while(p.parentNode){++A;p=p.parentNode;}return A;},setOwnerTree:function(A){if(A!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this);}this.ownerTree=A;
-var cs=this.childNodes;for(var i=0,B=cs.length;i<B;i++){cs[i].setOwnerTree(A);}if(A){A.registerNode(this);}}},getPath:function(A){A=A||"id";var p=this.parentNode;var b=[this.attributes[A]];while(p){b.unshift(p.attributes[A]);p=p.parentNode;}var B=this.getOwnerTree().pathSeparator;
+A.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,A,D);if(this.ownerTree){this.ownerTree.fireEvent("appendnode",this,A,D);}if(E){A.fireEvent("move",this.ownerTree,A,E,this,D);}return A;}},removeChild:function(A){var B=this.childNodes.indexOf(A);
+if(B==-1){return false;}if(this.fireEvent("beforeremove",this.ownerTree,this,A)===false){return false;}this.childNodes.splice(B,1);if(A.previousSibling){A.previousSibling.nextSibling=A.nextSibling;}if(A.nextSibling){A.nextSibling.previousSibling=A.previousSibling;
+}if(this.firstChild==A){this.setFirstChild(A.nextSibling);}if(this.lastChild==A){this.setLastChild(A.previousSibling);}A.setOwnerTree(null);A.parentNode=null;A.previousSibling=null;A.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,A);return A;
+},insertBefore:function(A,B){if(!B){return this.appendChild(A);}if(A==B){return false;}if(this.fireEvent("beforeinsert",this.ownerTree,this,A,B)===false){return false;}var C=this.childNodes.indexOf(B);var D=A.parentNode;var E=C;if(D==this&&this.childNodes.indexOf(A)<C){E--;
+}if(D){if(A.fireEvent("beforemove",A.getOwnerTree(),A,D,this,C,B)===false){return false;}D.removeChild(A);}if(E==0){this.setFirstChild(A);}this.childNodes.splice(E,0,A);A.parentNode=this;var ps=this.childNodes[E-1];if(ps){A.previousSibling=ps;ps.nextSibling=A;
+}else{A.previousSibling=null;}A.nextSibling=B;B.previousSibling=A;A.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,A,B);if(D){A.fireEvent("move",this.ownerTree,A,D,this,E,B);}return A;},item:function(A){return this.childNodes[A];
+},replaceChild:function(A,B){this.insertBefore(A,B);this.removeChild(B);return B;},indexOf:function(A){return this.childNodes.indexOf(A);},getOwnerTree:function(){if(!this.ownerTree){var p=this;while(p){if(p.ownerTree){this.ownerTree=p.ownerTree;break;}p=p.parentNode;
+}}return this.ownerTree;},getDepth:function(){var A=0;var p=this;while(p.parentNode){++A;p=p.parentNode;}return A;},setOwnerTree:function(A){if(A!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this);}this.ownerTree=A;var cs=this.childNodes;
+for(var i=0,B=cs.length;i<B;i++){cs[i].setOwnerTree(A);}if(A){A.registerNode(this);}}},getPath:function(A){A=A||"id";var p=this.parentNode;var b=[this.attributes[A]];while(p){b.unshift(p.attributes[A]);p=p.parentNode;}var B=this.getOwnerTree().pathSeparator;
 return B+b.join(B);},bubble:function(fn,A,B){var p=this;while(p){if(fn.call(A||p,B||p)===false){break;}p=p.parentNode;}},cascade:function(fn,A,B){if(fn.call(A||this,B||this)!==false){var cs=this.childNodes;for(var i=0,C=cs.length;i<C;i++){cs[i].cascade(fn,A,B);
 }}},eachChild:function(fn,A,B){var cs=this.childNodes;for(var i=0,C=cs.length;i<C;i++){if(fn.call(A||this,B||cs[i])===false){break;}}},findChild:function(A,B){var cs=this.childNodes;for(var i=0,C=cs.length;i<C;i++){if(cs[i].attributes[A]==B){return cs[i];
 }}return null;},findChildBy:function(fn,A){var cs=this.childNodes;for(var i=0,B=cs.length;i<B;i++){if(fn.call(A||cs[i],cs[i])===true){return cs[i];}}return null;},sort:function(fn,A){var cs=this.childNodes;var B=cs.length;if(B>0){var C=A?function(){fn.apply(A,arguments);
@@ -988,7 +1061,7 @@ this.selections.push(E);if(!C){this.fireEvent("selectionchange",this,this.select
 Roo.JsonView=function(A,B,C){Roo.JsonView.superclass.constructor.call(this,A,B,C);var um=this.el.getUpdateManager();um.setRenderer(this);um.on("update",this.onLoad,this);um.on("failure",this.onLoadException,this);this.addEvents({'beforerender':true,'load':true,'loadexception':true}
 );};Roo.extend(Roo.JsonView,Roo.View,{jsonRoot:"",refresh:function(){this.clearSelections();this.el.update("");var A=[];var o=this.jsonData;if(o&&o.length>0){for(var i=0,B=o.length;i<B;i++){var C=this.prepareData(o[i],i,o);A[A.length]=this.tpl.apply(C);}}
 else{A.push(this.emptyText);}this.el.update(A.join(""));this.nodes=this.el.dom.childNodes;this.updateIndexes(0);},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);},render:function(el,A){this.clearSelections();this.el.update("");
-var o;try{o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
+var o;try{if(A!=''){o=Roo.util.JSON.decode(A.responseText);if(this.jsonRoot){o=o[this.jsonRoot];}}}catch(e){}this.jsonData=o;this.beforeRender();this.refresh();},getCount:function(){return this.jsonData?this.jsonData.length:0;},getNodeData:function(A){if(A instanceof Array){var B=[];
 for(var i=0,C=A.length;i<C;i++){B.push(this.getNodeData(A[i]));}return B;}return this.jsonData[this.indexOf(A)]||null;},beforeRender:function(){this.snapshot=this.jsonData;if(this.sortInfo){this.sort.apply(this,this.sortInfo);}this.fireEvent("beforerender",this,this.jsonData);
 },onLoad:function(el,o){this.fireEvent("load",this,this.jsonData,o);},onLoadException:function(el,o){this.fireEvent("loadexception",this,o);},filter:function(A,B){if(this.jsonData){var C=[];var ss=this.snapshot;if(typeof B=="string"){var D=B.length;if(D==0){this.clearFilter();
 return;}B=B.toLowerCase();for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(o[A].substr(0,D).toLowerCase()==B){C.push(o);}}}else if(B.exec){for(var i=0,E=ss.length;i<E;i++){var o=ss[i];if(B.test(o[A])){C.push(o);}}}else{return;}this.jsonData=C;this.refresh();
@@ -1270,9 +1343,9 @@ d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el
 Roo.Msg=Roo.MessageBox;
 // Roo/QuickTips.js
 Roo.QuickTips=function(){var el,A,B,C,tm,D,E,F={},G,H=null,I,J;var ce,bd,xy,dd;var K=false,L=true,M=false;var N=1,O=1,P=1,Q=[];var R=function(e){if(L){return;}var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return;}if(ce&&t==ce.el){clearTimeout(O);
-return;}if(t&&F[t.id]){F[t.id].el=t;N=W.defer(tm.showDelay,tm,[F[t.id]]);return;}var a,et=Roo.fly(t);var ns=D.namespace;if(tm.interceptTitles&&t.title){a=t.title;t.qtip=a;t.removeAttribute("title");e.preventDefault();}else{a=t.qtip||et.getAttributeNS(ns,D.attribute);
-}if(a){N=W.defer(tm.showDelay,tm,[{el:t,text:a,width:et.getAttributeNS(ns,D.width),autoHide:et.getAttributeNS(ns,D.hide)!="user",title:et.getAttributeNS(ns,D.title),cls:et.getAttributeNS(ns,D.cls)}]);}};var S=function(e){clearTimeout(N);var t=e.getTarget();
-if(t&&ce&&ce.el==t&&(tm.autoHide&&ce.autoHide!==false)){O=setTimeout(Y,tm.hideDelay);}};var T=function(e){if(L){return;}xy=e.getXY();xy[1]+=18;if(tm.trackMouse&&ce){el.setXY(xy);}};var U=function(e){clearTimeout(N);clearTimeout(O);if(!e.within(el)){if(tm.hideOnClick){Y();
+return;}if(t&&F[t.id]){F[t.id].el=t;N=W.defer(tm.showDelay,tm,[F[t.id]]);return;}var a,et=Roo.fly(t);var ns=D.namespace;if(tm.interceptTitles&&t.title){a=t.title;t.qtip=a;t.removeAttribute("title");e.preventDefault();}else{a=t.qtip||et.getAttributeNS(ns,D.attribute)||et.getAttributeNS(D.alt_namespace,D.attribute);
+}if(a){N=W.defer(tm.showDelay,tm,[{el:t,text:a.replace(/\\n/g,'<br/>'),width:et.getAttributeNS(ns,D.width),autoHide:et.getAttributeNS(ns,D.hide)!="user",title:et.getAttributeNS(ns,D.title),cls:et.getAttributeNS(ns,D.cls)}]);}};var S=function(e){clearTimeout(N);
+var t=e.getTarget();if(t&&ce&&ce.el==t&&(tm.autoHide&&ce.autoHide!==false)){O=setTimeout(Y,tm.hideDelay);}};var T=function(e){if(L){return;}xy=e.getXY();xy[1]+=18;if(tm.trackMouse&&ce){el.setXY(xy);}};var U=function(e){clearTimeout(N);clearTimeout(O);if(!e.within(el)){if(tm.hideOnClick){Y();
 tm.disable();tm.enable.defer(100,tm);}}};var V=function(){return 2;};var W=function(o){if(L){return;}clearTimeout(P);ce=o;if(H){el.removeClass(H);H=null;}if(ce.cls){el.addClass(ce.cls);H=ce.cls;}if(ce.title){C.update(ce.title);C.show();}else{C.update('');
 C.hide();}el.dom.style.width=tm.maxWidth+'px';B.update(o.text);var p=V(),w=ce.width;if(!w){var td=B.dom;var aw=Math.max(td.offsetWidth,td.clientWidth,td.scrollWidth);if(aw>tm.maxWidth){w=tm.maxWidth;}else if(aw<tm.minWidth){w=tm.minWidth;}else{w=aw;}}el.setWidth(parseInt(w,10)+p);
 if(ce.autoHide===false){E.setDisplayed(true);if(dd){dd.unlock();}}else{E.setDisplayed(false);if(dd){dd.lock();}}if(xy){el.avoidY=xy[1]-18;el.setXY(xy);}if(tm.animate){el.setOpacity(.1);el.setStyle("visibility","visible");el.fadeIn({callback:X});}else{X();
@@ -1282,11 +1355,11 @@ D=tm.tagConfig;if(!M){if(!Roo.isReady){Roo.onReady(Roo.QuickTips.init,Roo.QuickT
 C=el.child('h3');C.enableDisplayMode("block");A=el.child('div.x-tip-bd');B=el.child('div.x-tip-bd-inner');E=el.child('div.x-tip-close');E.enableDisplayMode("block");E.on("click",Y);var d=Roo.get(document);d.on("mousedown",U);d.on("mouseover",R);d.on("mouseout",S);
 d.on("mousemove",T);G=d.addKeyListener(27,Y);G.disable();if(Roo.dd.DD){dd=el.initDD("default",null,{onDrag:function(){el.sync();}});dd.setHandleElId(C.id);dd.lock();}M=true;}this.enable();},register:function(a){var cs=a instanceof Array?a:arguments;for(var i=0,b=cs.length;
 i<b;i++){var c=cs[i];var d=c.target;if(d){if(d instanceof Array){for(var j=0,e=d.length;j<e;j++){F[d[j]]=c;}}else{F[typeof d=='string'?d:Roo.id(d)]=c;}}}},unregister:function(el){delete F[Roo.id(el)];},enable:function(){if(M&&L){Q.pop();if(Q.length<1){L=false;
-}}},disable:function(){L=true;clearTimeout(N);clearTimeout(O);clearTimeout(P);if(ce){Y(true);}Q.push(1);},isEnabled:function(){return !L;},tagConfig:{namespace:"ext",attribute:"qtip",width:"width",target:"target",title:"qtitle",hide:"hide",cls:"qclass"}};
-}();Roo.QuickTips.tips=Roo.QuickTips.register;
+}}},disable:function(){L=true;clearTimeout(N);clearTimeout(O);clearTimeout(P);if(ce){Y(true);}Q.push(1);},isEnabled:function(){return !L;},tagConfig:{namespace:"roo",alt_namespace:"ext",attribute:"qtip",width:"width",target:"target",title:"qtitle",hide:"hide",cls:"qclass"}
+};}();Roo.QuickTips.tips=Roo.QuickTips.register;
 // Roo/tree/TreePanel.js
 Roo.tree.TreePanel=function(el,A){var B=false;var C=false;if(A.root){B=A.root;delete A.root;}if(A.loader){C=A.loader;delete A.loader;}Roo.apply(this,A);Roo.tree.TreePanel.superclass.constructor.call(this);this.el=Roo.get(el);this.el.addClass('x-tree');if(B){this.setRootNode(Roo.factory(B,Roo.tree));
-}if(C){this.loader=Roo.factory(C,Roo.tree);}this.id=this.el.id;this.addEvents({"beforeload":true,"load":true,"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true,"startdrag":true,"enddrag":true,"dragdrop":true,"beforenodedrop":true,"nodedrop":true,"nodedragover":true}
+}if(C){this.loader=Roo.factory(C,Roo.tree);}this.id=this.el.id;this.addEvents({"beforeload":true,"load":true,"textchange":true,"beforeexpand":true,"beforecollapse":true,"expand":true,"disabledchange":true,"collapse":true,"beforeclick":true,"checkchange":true,"click":true,"dblclick":true,"contextmenu":true,"beforechildrenrendered":true,"startdrag":true,"enddrag":true,"dragdrop":true,"beforenodedrop":true,"nodedrop":true,"nodedragover":true,"appendnode":true}
 );if(this.singleExpand){this.on("beforeexpand",this.restrictExpand,this);}if(this.editor){this.editor.tree=this;this.editor=Roo.factory(this.editor,Roo.tree);}if(this.selModel){this.selModel=Roo.factory(this.selModel,Roo.tree);}};Roo.extend(Roo.tree.TreePanel,Roo.data.Tree,{rootVisible:true,animate:Roo.enableFx,lines:true,enableDD:false,hlDrop:Roo.enableFx,renderer:false,rendererTip:false,restrictExpand:function(A){var p=A.parentNode;
 if(p){if(p.expandedChild&&p.expandedChild.parentNode==p){p.expandedChild.collapse();}p.expandedChild=A;}},setRootNode:function(A){Roo.tree.TreePanel.superclass.setRootNode.call(this,A);if(!this.rootVisible){A.ui=new Roo.tree.RootTreeNodeUI(A);}return A;},getEl:function(){return this.el;
 },getLoader:function(){return this.loader;},expandAll:function(){this.root.expand(true);},collapseAll:function(){this.root.collapse(true);},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.tree.DefaultSelectionModel();}return this.selModel;
@@ -1321,8 +1394,8 @@ this.allowChildren=A.allowChildren!==false&&A.allowDrop!==false;this.text=A.text
 if(this.childrenRendered){A.ui.remove();}if(this.childNodes.length<1){this.collapse(false,false);}else{this.ui.updateExpandIcon();}if(!this.firstChild){this.childrenRendered=false;}return A;},insertBefore:function(A,B){var C=Roo.tree.TreeNode.superclass.insertBefore.apply(this,arguments);
 if(C&&B&&this.childrenRendered){A.render();}this.ui.updateExpandIcon();return C;},setText:function(A){var B=this.text;this.text=A;this.attributes.text=A;if(this.rendered){this.ui.onTextChange(this,A,B);}this.fireEvent("textchange",this,A,B);},select:function(){this.getOwnerTree().getSelectionModel().select(this);
 },unselect:function(){this.getOwnerTree().getSelectionModel().unselect(this);},isSelected:function(){return this.getOwnerTree().getSelectionModel().isSelected(this);},expand:function(A,B,C){if(!this.expanded){if(this.fireEvent("beforeexpand",this,A,B)===false){return;
-}if(!this.childrenRendered){this.renderChildren();}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&B!==false)||B){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof C=="function"){C(this);}if(A===true){this.expandChildNodes(true);
-}}.createDelegate(this));return;}else{this.ui.expand();this.fireEvent("expand",this);if(typeof C=="function"){C(this);}}}else{if(typeof C=="function"){C(this);}}if(A===true){this.expandChildNodes(true);}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible;
+}if(!this.childrenRendered){this.renderChildren();}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree()&&this.getOwnerTree().animate&&B!==false)||B){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof C=="function"){C(this);}
+if(A===true){this.expandChildNodes(true);}}.createDelegate(this));return;}else{this.ui.expand();this.fireEvent("expand",this);if(typeof C=="function"){C(this);}}}else{if(typeof C=="function"){C(this);}}if(A===true){this.expandChildNodes(true);}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible;
 },collapse:function(A,B){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,A,B)===false){return;}this.expanded=false;if((this.getOwnerTree().animate&&B!==false)||B){this.ui.animCollapse(function(){this.fireEvent("collapse",this);
 if(A===true){this.collapseChildNodes(true);}}.createDelegate(this));return;}else{this.ui.collapse();this.fireEvent("collapse",this);}}if(A===true){var cs=this.childNodes;for(var i=0,C=cs.length;i<C;i++){cs[i].collapse(true,false);}}},delayedExpand:function(A){if(!this.expandProcId){this.expandProcId=this.expand.defer(A,this);
 }},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);}this.expandProcId=false;},toggle:function(){if(this.expanded){this.collapse();}else{this.expand();}},ensureVisible:function(A){var B=this.getOwnerTree();B.expandPath(this.parentNode.getPath(),false,function(){B.getTreeEl().scrollChildIntoView(this.ui.anchor);
@@ -1345,7 +1418,7 @@ this.holder.appendChild(this.wrap);return;}var H=F?F.ui.getEl():null;if(H){G.ins
 }},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments);},initEvents:function(){this.node.on("move",this.onMove,this);
 var E=Roo.EventManager;var a=this.anchor;var el=Roo.fly(a,'_treeui');if(Roo.isOpera){el.setStyle("text-decoration","none");}el.on("click",this.onClick,this);el.on("dblclick",this.onDblClick,this);if(this.checkbox){Roo.EventManager.on(this.checkbox,Roo.isIE?'click':'change',this.onCheckChange,this);
 }el.on("contextmenu",this.onContextMenu,this);var A=Roo.fly(this.iconNode);A.on("click",this.onClick,this);A.on("dblclick",this.onDblClick,this);A.on("contextmenu",this.onContextMenu,this);E.on(this.ecNode,"click",this.ecClick,this,true);if(this.node.disabled){this.addClass("x-tree-node-disabled");
-}if(this.node.hidden){this.addClass("x-tree-node-disabled");}var ot=this.node.getOwnerTree();var dd=ot.enableDD||ot.enableDrag||ot.enableDrop;if(dd&&(!this.node.isRoot||ot.rootVisible)){Roo.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false}
+}if(this.node.hidden){this.addClass("x-tree-node-disabled");}var ot=this.node.getOwnerTree();var dd=ot?(ot.enableDD||ot.enableDrag||ot.enableDrop):false;if(dd&&(!this.node.isRoot||ot.rootVisible)){Roo.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false}
 );}},getDDHandles:function(){return [this.iconNode,this.textNode];},hide:function(){if(this.rendered){this.wrap.style.display="none";}},show:function(){if(this.rendered){this.wrap.style.display="";}},onContextMenu:function(e){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){e.preventDefault();
 this.focus();this.fireEvent("contextmenu",this.node,e);}},onClick:function(e){if(this.dropping){e.stopEvent();return;}if(this.fireEvent("beforeclick",this.node,e)!==false){if(!this.disabled&&this.node.attributes.href){this.fireEvent("click",this.node,e);return;
 }e.preventDefault();if(this.disabled){return;}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.hasChildNodes()){this.node.toggle();}this.fireEvent("click",this.node,e);}else{e.stopEvent();}},onDblClick:function(e){e.preventDefault();if(this.disabled){return;
@@ -1359,7 +1432,7 @@ Roo.callback(A);},scope:this,duration:this.node.ownerTree.duration||.25});},getC
 },onRender:function(){this.render();},render:function(A){var n=this.node,a=n.attributes;var B=n.parentNode?n.parentNode.ui.getContainer():n.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(n,a,B,A);if(a.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",a.qtip);
 if(a.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",a.qtipTitle);}}else{this.textNode.setAttribute("ext:qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttribute("ext:qtitle",a.qtipTitle);}}}else if(a.qtipCfg){a.qtipCfg.target=Roo.id(this.textNode);
 Roo.QuickTips.register(a.qtipCfg);}this.initEvents();if(!this.node.expanded){this.updateExpandIcon();}}else{if(A===true){B.appendChild(this.wrap);}}},renderElements:function(n,a,A,B){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var t=n.getOwnerTree();
-var C=t.renderer?t.renderer(n.attributes):Roo.util.Format.htmlEncode(n.text);if(typeof(n.attributes.html)!='undefined'){C=n.attributes.html;}var D=t.rendererTip?t.rendererTip(n.attributes):C;var cb=typeof a.checked=='boolean';var E=a.href?a.href:Roo.isGecko?"":"#";
+var C=t&&t.renderer?t.renderer(n.attributes):Roo.util.Format.htmlEncode(n.text);if(typeof(n.attributes.html)!='undefined'){C=n.attributes.html;}var D=t&&t.rendererTip?t.rendererTip(n.attributes):C;var cb=typeof a.checked=='boolean';var E=a.href?a.href:Roo.isGecko?"":"#";
 var F=['<li class="x-tree-node"><div class="x-tree-node-el ',a.cls,'">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon" />','<img src="',a.icon||this.emptyIcon,'" class="x-tree-node-icon',(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),'" unselectable="on" />',cb?('<input class="x-tree-node-cb" type="checkbox" '+(a.checked?'checked="checked" />':' />')):'','<a hidefocus="on" href="',E,'" tabIndex="1" ',a.hrefTarget?' target="'+a.hrefTarget+'"':"",'><span unselectable="on" qtip="',D,'">',C,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"];
 if(B!==true&&n.nextSibling&&n.nextSibling.ui.getEl()){this.wrap=Roo.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),F.join(""));}else{this.wrap=Roo.DomHelper.insertHtml("beforeEnd",A,F.join(""));}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];
 var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var G=3;if(cb){this.checkbox=cs[3];G++;}this.anchor=cs[G];this.textNode=cs[G].firstChild;},getAnchor:function(){return this.anchor;},getTextEl:function(){return this.textNode;
@@ -1436,8 +1509,8 @@ this.el.addClass('x-column-tree');this.headers=this.el.createChild({cls:'x-tree-
 this.innerCt.setHeight(this.height-20);var A=this.columns,c;var B=0;var C=false;var D=A.length;for(var i=0;i<D;i++){c=A[i];if(this.autoExpandColumn!==false&&c.dataIndex==this.autoExpandColumn){C=this.headEls[i];continue;}B+=c.width;}if(C){C.setWidth(((w-B)-this.borderWidth-20));
 }this.headers.setWidth(w-20);}});
 // Roo/menu/Menu.js
-Roo.menu.Menu=function(A){Roo.apply(this,A);this.id=this.id||Roo.id();this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true});if(this.registerMenu){Roo.menu.MenuMgr.register(this);}var B=this.items;
-this.items=new Roo.util.MixedCollection();if(B){this.add.apply(this,B);}};Roo.extend(Roo.menu.Menu,Roo.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,registerMenu:true,hidden:true,render:function(){if(this.el){return;
+Roo.menu.Menu=function(A){Roo.menu.Menu.superclass.constructor.call(this,A);this.id=this.id||Roo.id();this.addEvents({beforeshow:true,beforehide:true,show:true,hide:true,click:true,mouseover:true,mouseout:true,itemclick:true});if(this.registerMenu){Roo.menu.MenuMgr.register(this);
+}var B=this.items;this.items=new Roo.util.MixedCollection();if(B){this.add.apply(this,B);}};Roo.extend(Roo.menu.Menu,Roo.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,registerMenu:true,hidden:true,render:function(){if(this.el){return;
 }var el=this.el=new Roo.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body,zindex:15000});this.keyNav=new Roo.menu.MenuNav(this);if(this.plain){el.addClass("x-menu-plain");}if(this.cls){el.addClass(this.cls);}this.focusEl=el.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"}
 );var ul=el.createChild({tag:"ul",cls:"x-menu-list"});ul.on('click',this.onClick,this);ul.on("mouseover",this.onMouseOver,this);ul.on("mouseout",this.onMouseOut,this);this.items.each(function(A){if(A.hidden){return;}var li=document.createElement("li");li.className="x-menu-list-item";
 ul.dom.appendChild(li);A.render(li,this);},this);this.ul=ul;this.autoWidth();},autoWidth:function(){var el=this.el,ul=this.ul;if(!el){return;}var w=this.width;if(w){el.setWidth(w);}else if(Roo.isIE){el.setWidth(this.minWidth);var t=el.dom.offsetWidth;el.setWidth(ul.getWidth()+el.getFrameWidth("lr"));
@@ -1508,17 +1581,22 @@ Roo.menu.DateMenu=function(A){Roo.menu.DateMenu.superclass.constructor.call(this
 }},this);};Roo.extend(Roo.menu.DateMenu,Roo.menu.Menu,{cls:'x-date-menu'});
 // Roo/menu/ColorMenu.js
 Roo.menu.ColorMenu=function(A){Roo.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var ci=new Roo.menu.ColorItem(A);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"]);};Roo.extend(Roo.menu.ColorMenu,Roo.menu.Menu);
+// Roo/form/TextItem.js
+Roo.form.TextItem=function(A){Roo.form.TextItem.superclass.constructor.call(this,A);};Roo.extend(Roo.form.TextItem,Roo.BoxComponent,{tag:'div',html:'',getAutoCreate:function(){var A={id:this.id,tag:this.tag,html:this.html,cls:'x-form-item'};return A;},onRender:function(ct,A){Roo.form.TextItem.superclass.onRender.call(this,ct,A);
+if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}this.el=ct.createChild(B,A);}}});
 // Roo/form/Field.js
 Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"new-password"}
-,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true}
-);},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;
-}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);
-}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);
-}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);
-}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();
-this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();
-if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
-}this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();
+,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,loadedValue:false,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);
+this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
+if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';
+}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;
+this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;
+}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled||this.readOnly){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue;
+},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.resetValue);this.originalValue=this.getValue();
+this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();this.resetValue=this.getValue();
+},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);
+}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);
+},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();
 return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;}var B=(typeof(this.combo)!='undefined')?this.combo:this;B.el.addClass(this.invalidClass);
 A=A||this.invalidText;switch(this.msgTarget){case 'qtip':B.el.dom.qtip=A;B.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;break;case 'under':if(!this.errorEl){var C=this.el.findParent('.x-form-element',5,true);
 this.errorEl=C.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(C.getWidth(true)-20);}this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var C=this.el.findParent('.x-form-element',5,true);
@@ -1531,19 +1609,20 @@ s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:fun
 }}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true}
 );},hide:function(A,f){A.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(A,f){A.fixDisplay();A.alignTo(f.el,'tl-tr');A.slideIn('l',{stopFx:true});},hide:function(A,f){A.slideOut('l',{stopFx:true,useDisplay:true});}}};
 // Roo/form/TextField.js
-Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,initEvents:function(){if(this.emptyText){this.el.attr('placeholder',this.emptyText);
+Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,allowLeadingSpace:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,initEvents:function(){if(this.emptyText){this.el.attr('placeholder',this.emptyText);
 }Roo.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this);this.el.on('keyup',this.filterValidation,this);}else if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay}
-);}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50}
-);this.el.on("click",this.autoSize,this);}if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}},processValue:function(A){if(this.stripCharsRe){var B=A.replace(this.stripCharsRe,'');if(B!==A){this.setRawValue(B);
-return B;}}return A;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},reset:function(){Roo.form.TextField.superclass.reset.call(this);},preFocus:function(){if(this.selectOnFocus){this.el.dom.select();
-}},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();
-}},setValue:function(v){Roo.form.TextField.superclass.setValue.apply(this,arguments);this.autoSize();},validateValue:function(A){if(A.length<1){if(this.allowBlank){this.clearInvalid();return true;}else{this.markInvalid(this.blankText);return false;}}if(A.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));
-return false;}if(A.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;
-}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){this.markInvalid(B);return false;}}if(this.regex&&!this.regex.test(A)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(A,B){var v=this.getRawValue();
-if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);C.moveEnd("character",v.length-B);C.select();
-}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;
-d=null;v+="&#160;";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);},SafariOnKeyDown:function(A){var B=false;if(this.el.dom.selectionEnd>0){B=(this.el.dom.selectionEnd-this.el.dom.selectionStart-this.getValue().length==0)?true:false;
-}if(((A.getKey()==8||A.getKey()==46)&&this.getValue().length==1)){A.preventDefault();this.setValue('');return;}if(B&&A.getCharCode()>31){A.preventDefault();var cc=String.fromCharCode(A.getCharCode());this.setValue(A.shiftKey?cc:cc.toLowerCase());}}});
+);}if(this.selectOnFocus){this.on("focus",this.preFocus,this);}if(!this.allowLeadingSpace){this.on('blur',this.cleanLeadingSpace,this);}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Roo.form.VTypes[this.vtype+'Mask']))){this.el.on("keypress",this.filterKeys,this);
+}if(this.grow){this.el.on("keyup",this.onKeyUp,this,{buffer:50});this.el.on("click",this.autoSize,this);}if(this.el.is('input[type=password]')&&Roo.isSafari){this.el.on('keydown',this.SafariOnKeyDown,this);}},processValue:function(A){if(this.stripCharsRe){var B=A.replace(this.stripCharsRe,'');
+if(B!==A){this.setRawValue(B);return B;}}return A;},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay);}},onKeyUp:function(e){if(!e.isNavKeyPress()){this.autoSize();}},cleanLeadingSpace:function(e){if(this.inputType=='file'){return;
+}this.setValue((this.getValue()+'').replace(/^\s+/,''));},reset:function(){Roo.form.TextField.superclass.reset.call(this);},preFocus:function(){if(this.selectOnFocus){this.el.dom.select();}},filterKeys:function(e){var k=e.getKey();if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;
+}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},setValue:function(v){Roo.form.TextField.superclass.setValue.apply(this,arguments);this.autoSize();},validateValue:function(A){if(A.length<1){if(this.allowBlank){this.clearInvalid();
+return true;}else{this.markInvalid(this.blankText);return false;}}if(A.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false;}if(A.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));
+return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){this.markInvalid(this.vtypeText||vt[this.vtype+'Text']);return false;}}if(typeof this.validator=="function"){var B=this.validator(A);if(B!==true){this.markInvalid(B);return false;
+}}if(this.regex&&!this.regex.test(A)){this.markInvalid(this.regexText);return false;}return true;},selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(A,B);
+}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A);C.moveEnd("character",v.length-B);C.select();}}},autoSize:function(){if(!this.grow||!this.rendered){return;}if(!this.metrics){this.metrics=Roo.util.TextMetrics.createInstance(this.el);
+}var el=this.el;var v=el.dom.value;var d=document.createElement('div');d.appendChild(document.createTextNode(v));v=d.innerHTML;d=null;v+="&#160;";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w);
+},SafariOnKeyDown:function(A){var B=false;if(this.el.dom.selectionEnd>0){B=(this.el.dom.selectionEnd-this.el.dom.selectionStart-this.getValue().length==0)?true:false;}if(((A.getKey()==8||A.getKey()==46)&&this.getValue().length==1)){A.preventDefault();this.setValue('');
+return;}if(B&&A.getCharCode()>31){A.preventDefault();var cc=String.fromCharCode(A.getCharCode());this.setValue(A.shiftKey?cc:cc.toLowerCase());}}});
 // Roo/form/Hidden.js
 Roo.form.Hidden=function(A){Roo.form.Hidden.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Hidden,Roo.form.TextField,{fieldLabel:'',inputType:'hidden',width:50,allowBlank:true,labelSeparator:'',hidden:true,itemCls:'x-form-item-display-none'});
 // Roo/form/TriggerField.js
@@ -1589,7 +1668,7 @@ return false;}}}var E=this.formatDate(A);if(this.ddMatch&&this.ddMatch.test(E)){
 },menuListeners:{select:function(m,d){this.setValue(d);this.fireEvent('select',this,d);},show:function(){this.onFocus();},hide:function(){this.focus.defer(10,this);var ml=this.menuListeners;this.menu.un("select",ml.select,this);this.menu.un("show",ml.show,this);
 this.menu.un("hide",ml.hide,this);}},onTriggerClick:function(){if(this.disabled){return;}if(this.menu==null){this.menu=new Roo.menu.DateMenu();}Roo.apply(this.menu.picker,{showClear:this.allowBlank,minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.ddMatch,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.useIso?'Y-m-d':this.format,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))}
 );this.menu.on(Roo.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");},beforeBlur:function(){var v=this.parseDate(this.getRawValue());if(v){this.setValue(v);}},isDirty:function(){if(this.disabled){return false;
-}if(typeof(this.startValue)==='undefined'){return false;}return String(this.getValue())!==String(this.startValue);}});
+}if(typeof(this.startValue)==='undefined'){return false;}return String(this.getValue())!==String(this.startValue);},cleanLeadingSpace:function(e){return;}});
 // Roo/form/MonthField.js
 Roo.form.MonthField=function(A){Roo.form.MonthField.superclass.constructor.call(this,A);this.addEvents({'select':true});if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue);}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue);
 }this.ddMatch=null;if(this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;i<dd.length;i++){re+=dd[i];if(i!=dd.length-1){re+="|";}}this.ddMatch=new RegExp(re+")");}};Roo.extend(Roo.form.MonthField,Roo.form.TriggerField,{format:"M Y",altFormats:"M Y|m/Y|m-y|m-Y|my|mY",disabledDays:[0,1,2,3,4,5,6],disabledDaysText:"Disabled",disabledDates:null,disabledDatesText:"Disabled",minValue:null,maxValue:null,minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:'x-form-date-trigger',useIso:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"new-password"}
@@ -1638,14 +1717,15 @@ var B=A.length;var C=this.getRawValue().length;if(C!=B){this.setRawValue(A);this
 this.lastSelectionText='';},setValue:function(v){var A=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){A=r.data[this.displayField];}else if(this.valueNotFoundText!==undefined){A=this.valueNotFoundText;}}this.lastSelectionText=A;if(this.hiddenField){this.hiddenField.value=v;
 }Roo.form.ComboBox.superclass.setValue.call(this,A);this.value=v;},lastData:false,setFromData:function(o){var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else{Roo.log('no  displayField value set for '+(this.name?this.name:this.id));
 }if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField];}if(this.hiddenField){this.hiddenField.value=vv;this.lastSelectionText=dv;Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return;}this.lastSelectionText=dv;
-Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.resetValue);this.clearInvalid();this.lastData=false;if(this.view){this.view.clearSelections();}},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;
-return false;}return true;});}return C;},getName:function(){if(!this.rendered){return ''};return !this.hiddenName&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onViewMove:function(e,t){this.inKeyMode=false;},onViewOver:function(e,t){if(this.inKeyMode){return;
-}var A=this.view.findItemFromChild(t);if(A){var B=this.view.indexOf(A);this.select(B,false);}},onViewClick:function(A){var B=this.view.getSelectedIndexes()[0];var r=this.store.getAt(B);if(r){this.onSelect(r,B);}if(A!==false&&!this.blockFocus){this.el.focus();
-}},restrictHeight:function(){this.innerList.dom.style.height='';var A=this.innerList.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight);this.innerList.setHeight(h<this.maxHeight?'auto':this.maxHeight);this.list.beginUpdate();this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);
-this.list.alignTo(this.el,this.listAlign);this.list.endUpdate();},onEmptyResults:function(){this.collapse();},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,A){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);
-if(r){this.select(this.store.indexOf(r),A);return true;}}return false;},select:function(A,B){this.selectedIndex=A;this.view.select(A);if(B!==false){var el=this.view.getNode(A);if(el){this.innerList.scrollChildIntoView(el,false);}}},selectNext:function(){var ct=this.store.getCount();
-if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);
-}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;
+Roo.form.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){this.setValue(this.resetValue);this.originalValue=this.getValue();this.clearInvalid();this.lastData=false;if(this.view){this.view.clearSelections();}},findRecord:function(A,B){var C;
+if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}return true;});}return C;},getName:function(){if(!this.rendered){return ''};return !this.hiddenName&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onViewMove:function(e,t){this.inKeyMode=false;
+},onViewOver:function(e,t){if(this.inKeyMode){return;}var A=this.view.findItemFromChild(t);if(A){var B=this.view.indexOf(A);this.select(B,false);}},onViewClick:function(A){var B=this.view.getSelectedIndexes()[0];var r=this.store.getAt(B);if(r){this.onSelect(r,B);
+}if(A!==false&&!this.blockFocus){this.el.focus();}},restrictHeight:function(){this.innerList.dom.style.height='';var A=this.innerList.dom;var h=Math.max(A.clientHeight,A.offsetHeight,A.scrollHeight);this.innerList.setHeight(h<this.maxHeight?'auto':this.maxHeight);
+this.list.beginUpdate();this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);this.list.alignTo(this.el,this.listAlign);this.list.endUpdate();},onEmptyResults:function(){this.collapse();
+},isExpanded:function(){return this.list.isVisible();},selectByValue:function(v,A){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);if(r){this.select(this.store.indexOf(r),A);return true;}}return false;},select:function(A,B){this.selectedIndex=A;
+this.view.select(A);if(B!==false){var el=this.view.getNode(A);if(el){this.innerList.scrollChildIntoView(el,false);}}},selectNext:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1);
+}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1);}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();
+this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){this.doQuery(this.getRawValue());},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;
 }},doQuery:function(q,A){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:A,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){if(this.lastQuery!=q||this.alwaysQuery){this.lastQuery=q;
 if(this.mode=='local'){this.selectedIndex=-1;if(A){this.store.clearFilter();}else{this.store.filter(this.displayField,q);}this.onLoad();}else{this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand();}}else{this.selectedIndex=-1;
 this.onLoad();}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize;}return p;},collapse:function(){if(!this.isExpanded()){return;}this.list.hide();Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);
@@ -1656,7 +1736,7 @@ if(!this.editable){Roo.get(document).un('keydown',this.listKeyPress,this);}this.
 C=this.store.getAt(ix);if(!C.get(this.displayField)||C.get(this.displayField).substring(0,1).toUpperCase()!=k){C=false;}}this.store.each(function(v){if(C){if(C.id==v.id){C=false;}return;}if(v.get(this.displayField)&&v.get(this.displayField).substring(0,1).toUpperCase()==k){A=this.store.indexOf(v);
 return false;}},this);if(A===false){return true;}this.view.select(A);var sn=Roo.get(this.view.getSelectedNodes()[0]);sn.scrollIntoView(sn.dom.parentNode,false);}});
 // Roo/form/ComboBoxArray.js
-Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
+Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,seperator:',',items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
 this.combo.name=this.name?(this.name+'-subcombo'):this.name;this.combo=Roo.factory(this.combo,Roo.form);this.combo.onRender(ct,A);if(typeof(this.combo.width)!='undefined'){this.combo.onResize(this.combo.width,0);}this.combo.initEvents();this.store=this.combo.store;
 this.valueField=this.combo.valueField;this.displayField=this.combo.displayField;this.combo.wrap.addClass('x-cbarray-grp');var B=this.combo.wrap.createChild({tag:'div',cls:'x-cbarray-cb'},this.combo.el.dom);this.hiddenEl=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.hiddenName,value:''}
 );this.el=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.name,value:''});this.outerWrap=this.combo.wrap;this.wrap=B;this.outerWrap.setWidth(this.width);this.outerWrap.dom.removeChild(this.el.dom);this.wrap.dom.appendChild(this.el.dom);this.outerWrap.dom.removeChild(this.combo.trigger.dom);
@@ -1665,17 +1745,41 @@ this.combo.wrap.dom.appendChild(this.combo.trigger.dom);this.combo.trigger.setSt
 },onResize:function(w,h){return;if(typeof w!='number'){return;}var tw=this.combo.trigger.getWidth();tw+=this.addicon?this.addicon.getWidth():0;tw+=this.editicon?this.editicon.getWidth():0;var x=w-tw;this.combo.el.setWidth(this.combo.adjustWidth('input',x));
 this.combo.trigger.setStyle('left','0px');if(this.list&&this.listWidth===undefined){var lw=Math.max(x+this.combo.trigger.getWidth(),this.combo.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},addItem:function(A){var B=this.combo.valueField;
 var C=this.combo.displayField;if(this.items.indexOfKey(A[B])>-1){return;}var x=new Roo.form.ComboBoxArray.Item({data:A,displayField:C,tipField:C,cb:this});this.items.add(A[B],x);this.updateHiddenEl();x.render(this.outerWrap,this.wrap.dom);},updateHiddenEl:function(){this.validate();
-if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(',');this.validate();},reset:function(){this.items.each(function(f){f.remove();});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';
-}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];Roo.each(v.split(','),function(k){Roo.log("CHECK "+this.valueField+','+k);
-var li=this.store.query(this.valueField,k);if(!li.length){return;}var B={};B[this.valueField]=k;B[this.displayField]=li.item(0).data[this.displayField];this.addItem(B);},this)}if(typeof(v)=='object'){Roo.each(v,function(l){this.addItem(l);},this);}},setFromData:function(v){this.reset();
-this.el.dom.value=v[this.displayField];this.hiddenEl.dom.value=v[this.valueField];if(typeof(v[this.valueField])!='string'||!v[this.valueField].length){return;}var kv=v[this.valueField];var dv=v[this.displayField];kv=typeof(kv)!='string'?'':kv;dv=typeof(dv)!='string'?'':dv;
-var A=kv.split(',');var B=dv.split(',');for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();
-return true;}return false;},validateValue:function(A){return Roo.form.ComboBoxArray.superclass.validateValue.call(this,this.getValue());},isDirty:function(){if(this.disabled){return false;}try{var d=Roo.decode(String(this.originalValue));}catch(e){return String(this.getValue())!==String(this.originalValue);
-}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(','));}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{}
-,cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'},{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
-if(!this.el){var B=this.getAutoCreate();this.el=ct.createChild(B,A);}this.el.child('img').dom.setAttribute('src',Roo.BLANK_IMAGE_URL);this.el.child('div').dom.innerHTML=this.cb.renderer?this.cb.renderer(this.data):String.format('{0}',this.data[this.displayField]);
-this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this.tipField]));this.el.child('img').on('click',this.remove,this);},remove:function(){if(this.cb.disabled){return;}if(false!==this.cb.fireEvent('beforeremove',this.cb,this)){this.cb.items.remove(this);
-this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);}}});
+if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(this.seperator);this.validate();},reset:function(){this.items.clear();Roo.each(this.outerWrap.select('.x-cbarray-item',true).elements,function(el){el.remove();
+});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];Roo.each(v.split(this.seperator),function(k){Roo.log("CHECK "+this.valueField+','+k);
+var li=this.store.query(this.valueField,k);if(!li.length){return;}var B={};B[this.valueField]=k;B[this.displayField]=li.item(0).data[this.displayField];this.addItem(B);},this)}if(typeof(v)=='object'){Roo.each(v,function(l){var B=l;if(typeof(l)=='string'){B={}
+;B[this.valueField]=k;B[this.displayField]=k}this.addItem(B);},this);}},setFromData:function(v){this.reset();this.el.dom.value=v[this.displayField];this.hiddenEl.dom.value=v[this.valueField];if(typeof(v[this.valueField])!='string'||!v[this.valueField].length){return;
+}var kv=v[this.valueField];var dv=v[this.displayField];kv=typeof(kv)!='string'?'':kv;dv=typeof(dv)!='string'?'':dv;var A=kv.split(this.seperator);var B=dv.split(this.seperator);for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];
+this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();return true;}return false;},validateValue:function(A){return Roo.form.ComboBoxArray.superclass.validateValue.call(this,this.getValue());
+},isDirty:function(){if(this.disabled){return false;}try{var d=Roo.decode(String(this.originalValue));}catch(e){return String(this.getValue())!==String(this.originalValue);}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(this.seperator));
+}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{},cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'}
+,{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var B=this.getAutoCreate();this.el=ct.createChild(B,A);}this.el.child('img').dom.setAttribute('src',Roo.BLANK_IMAGE_URL);
+this.el.child('div').dom.innerHTML=this.cb.renderer?this.cb.renderer(this.data):String.format('{0}',this.data[this.displayField]);this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this.tipField]));this.el.child('img').on('click',this.remove,this);
+},remove:function(){if(this.cb.disabled){return;}if(false!==this.cb.fireEvent('beforeremove',this.cb,this)){this.cb.items.remove(this);this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);
+}}});
+// Roo/form/ComboNested.js
+Roo.form.ComboNested=function(A){Roo.form.ComboCheck.superclass.constructor.call(this,A);var B=['hiddenName','displayField','valueField'];var _t=this;Roo.each(B,function(e){if((typeof(_t[e])=='undefined')||!_t[e].length){throw "Roo.form.ComboNested : missing value for: "+e;
+}});};Roo.extend(Roo.form.ComboNested,Roo.form.ComboBox,{maxColumns:3,list:null,innerLists:null,views:null,stores:null,loadingChildren:false,onRender:function(ct,A){Roo.form.ComboBox.superclass.onRender.call(this,ct,A);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)}
+,'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');}if(Roo.isGecko){this.el.dom.setAttribute('autocomplete','off');}var B='x-combo-list';this.list=new Roo.Layer({shadow:this.shadow,cls:[B,this.listClass].join(' '),constrain:false}
+);var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:B+'-hd',html:this.title});this.assetHeight+=this.header.getHeight();
+}this.innerLists=[];this.views=[];this.stores=[];for(var i=0;i<this.maxColumns;i++){this.onRenderList(B,i);}this.footer=this.list.createChild({cls:B+'-ft'});this.pageTb=new Roo.Toolbar(this.footer);var C=this;this.pageTb.add({text:'Done',handler:function(){C.collapse();
+}});if(this.allowBlank&&!this.disableClear){this.pageTb.add(new Roo.Toolbar.Fill(),{cls:'x-btn-icon x-btn-clear',text:'&#160;',handler:function(){C.collapse();C.clearValue();C.onSelect(false,-1);}});}if(this.footer){this.assetHeight+=this.footer.getHeight();
+}},onRenderList:function(A,i){var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);this.list.setWidth(lw);var il=this.innerLists[i]=this.list.createChild({cls:A+'-inner'}
+);il.setWidth(lw);il.setStyle({'overflow-x':'hidden'});if(!this.tpl){this.tpl=new Roo.Template({html:'<div class="'+A+'-item '+A+'-item-{cn:this.isEmpty}">{'+this.displayField+'}</div>',isEmpty:function(D,E){var dl=typeof(D.data)!='undefined'?D.data.length:D.length;
+return dl?'has-children':'no-children'}});}var B=this.store;if(i>0){B=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});}this.stores[i]=B;var C=this.views[i]=new Roo.View(il,this.tpl,{singleSelect:true,store:B,selectedClass:this.selectedClass});
+C.getEl().setWidth(lw);C.getEl().setStyle({position:i<1?'relative':'absolute',top:0,left:(i*lw)+'px',display:i>0?'none':'block'});C.on('selectionchange',this.onSelectChange.createDelegate(this,{list:i},true));C.on('dblclick',this.onDoubleClick.createDelegate(this,{list:i}
+,true));B.on('beforeload',this.onBeforeLoad,this);B.on('load',this.onLoad,this,{list:i});B.on('loadexception',this.onLoadException,this);},restrictHeight:function(){var mh=0;Roo.each(this.innerLists,function(il,i){var el=this.views[i].getEl();el.dom.style.height='';
+var A=el.dom;var h=Math.max(il.clientHeight,il.offsetHeight,il.scrollHeight);mh=Math.max(h,mh);if(i<1){el.setHeight(h<this.maxHeight?'auto':this.maxHeight);il.setHeight(h<this.maxHeight?'auto':this.maxHeight);}},this);this.list.beginUpdate();this.list.setHeight(mh+this.list.getFrameWidth('tb')+this.assetHeight);
+this.list.alignTo(this.el,this.listAlign);this.list.endUpdate();},onBeforeLoad:function(){if(!this.hasFocus){return;}this.innerLists[0].update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+'</div>':'');this.restrictHeight();this.selectedIndex=-1;
+},onLoad:function(a,b,c,d){if(!this.loadingChildren){for(var i=1;i<this.views.length;i++){this.views[i].getEl().setStyle({display:'none'});}var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);
+this.list.setWidth(lw);}if(!this.hasFocus){return;}if(this.store.getCount()>0){this.expand();this.restrictHeight();}else{this.onEmptyResults();}if(!this.loadingChildren){this.selectActive();}},onLoadException:function(){this.collapse();Roo.log(this.store.reader.jsonData);
+if(this.store&&typeof(this.store.reader.jsonData.errorMsg)!='undefined'){Roo.MessageBox.alert("Error loading",this.store.reader.jsonData.errorMsg);}},cleanLeadingSpace:function(e){},onSelectChange:function(A,B,C){var ix=A.getSelectedIndexes();if(C.list>this.maxColumns-2){if(A.store.getCount()<1){this.views[C.list].getEl().setStyle({display:'none'}
+);}else{if(ix.length){this.setFromData(A.store.getAt(ix[0]).data);}}return;}if(!ix.length){var D=this.stores[C.list+1];D.data.clear();return;}var E=A.store.getAt(ix[0]);this.setFromData(E.data);this.fireEvent('select',this,E,ix[0]);var lw=Math.floor(((this.listWidth*this.maxColumns||Math.max(this.wrap.getWidth(),this.minListWidth))-this.list.getFrameWidth('lr'))/this.maxColumns);
+this.loadingChildren=true;this.stores[C.list+1].loadDataFromChildren(E);this.loadingChildren=false;var dl=this.stores[C.list+1].getTotalCount();this.views[C.list+1].getEl().setHeight(this.innerLists[0].getHeight());this.views[C.list+1].getEl().setStyle({display:dl?'block':'none'}
+);for(var i=C.list+2;i<this.views.length;i++){this.views[i].getEl().setStyle({display:'none'});}this.innerLists[C.list+1].setHeight(this.innerLists[0].getHeight());this.list.setWidth(lw*(C.list+(dl?2:1)));if(this.isLoading){}},onDoubleClick:function(){this.collapse();
+},recordToStack:function(A,B,C,D){var E=new Roo.data.SimpleStore({reader:this.store.reader,data:[]});var F=this;var G=false;var H=false;if(A.getCount()<1){return false;}A.each(function(r){if(r.data[B]==C){G=r;H=r;return false;}if(r.data.cn&&r.data.cn.length){E.loadDataFromChildren(r);
+var I=F.recordToStack(E,B,C,D);if(I!==false){G=I;H=r;return false;}}return true;});if(G==false){return false}D.unshift(H);return G;},selectActive:function(){var A=[];this.recordToStack(this.store,this.valueField,this.getValue(),A);for(var i=0;i<A.length;i++){this.views[i].select(A[i].store.indexOf(A[i]),false,false);
+}}});
 // Roo/form/Checkbox.js
 Roo.form.Checkbox=function(A){Roo.form.Checkbox.superclass.constructor.call(this,A);this.addEvents({check:true});};Roo.extend(Roo.form.Checkbox,Roo.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,defaultAutoCreate:{tag:"input",type:'hidden',autocomplete:"off"}
 ,boxLabel:"",inputValue:'1',valueOff:'0',actionMode:'viewEl',itemCls:'x-menu-check-item x-form-item',groupClass:'x-menu-group-item',inputType:'hidden',inSetChecked:false,inputElement:false,basedOn:false,isFormField:true,onResize:function(){Roo.form.Checkbox.superclass.onResize.apply(this,arguments);
@@ -1684,60 +1788,63 @@ if(!this.boxLabel){this.el.alignTo(this.wrap,'c-c');}},initEvents:function(){Roo
 this.el.on('DOMAttrModified',this.setFromHidden,this);this.el.on('propertychange',this.setFromHidden,this);if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel});}this.setChecked(this.checked);},initValue:Roo.emptyFn,getValue:function(){if(this.el){return String(this.el.dom.value)==String(this.inputValue)?this.inputValue:this.valueOff;
 }return this.valueOff;},onClick:function(){if(this.disabled){return;}this.setChecked(!this.checked);},setValue:function(v,A){this.setChecked(String(v)===String(this.inputValue),A);},setChecked:function(A,B){if(this.inSetChecked){this.checked=A;return;}if(this.wrap){this.wrap[A?'addClass':'removeClass']('x-menu-item-checked');
 }this.checked=A;if(B!==true){this.fireEvent('check',this,A);}this.inSetChecked=true;this.el.dom.value=A?this.inputValue:this.valueOff;this.inSetChecked=false;},setFromHidden:function(){if(!this.el){return;}this.setValue(this.el.dom.value);},onDestroy:function(){if(this.viewEl){Roo.get(this.viewEl).remove();
-}Roo.form.Checkbox.superclass.onDestroy.call(this);}});
+}Roo.form.Checkbox.superclass.onDestroy.call(this);},setBoxLabel:function(A){this.wrap.select('.x-form-cb-label',true).first().dom.innerHTML=A;}});
 // Roo/form/Radio.js
 Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,arguments);};Roo.extend(Roo.form.Radio,Roo.form.Checkbox,{inputType:'radio',getGroupValue:function(){return this.el.up('form').child('input[name='+this.el.dom.name+']:checked',true).value;
 },onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue;}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel}
 );}if(this.checked){this.el.dom.checked='checked';}}});
 // Roo/HtmlEditorCore.js
-Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,getDocMarkup:function(){var st='';
-if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom);});Roo.get(document.head).select('link').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom);
-});}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{}st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';return '<html><head>'+st+' </head><body class="roo-htmleditor-body"></body></html>';
-},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')}
-this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"},this.el);this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';
-this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";}catch(e){return;}Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);
-}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px';}if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';
-}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide']);}else{Roo.get(this.iframe).removeClass(['x-hidden','hide']);this.deferFocus();}},cleanHtml:function(A){A=String(A);if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');
-}}if(A=='&nbsp;'){A='';}return A;},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var A=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){A='<div style="'+m[0]+'">'+A+'</div>';
-}}A=this.cleanHtml(A);A=A.replace(/([\x80-\uffff])/g,function(a,b){var cc=b.charCodeAt();if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return b;}return "&#"+cc+";"});if(this.owner.fireEvent('beforesync',this,A)!==false){this.el.dom.value=A;
-this.owner.fireEvent('sync',this,A);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);d.innerHTML=v;this.cleanUpPaste();this.el.dom.value=d.innerHTML;
-this.owner.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;
-this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();
-this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this}
+Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
+if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);
+});}else if(!this.stylesheets.length){st='<style type="text/css">'+'body{border:0;margin:0;padding:3px;height:98%;cursor:text;}'+'</style>';}else{st='<style type="text/css">'+this.stylesheets+'</style>';}st+='<style type="text/css">'+'IMG { cursor: pointer } '+'</style>';
+var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return '<html><head>'+st+' </head><body class="'+A+'"></body></html>';},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';
+this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')}this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"}
+,this.el);this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on";
+}catch(e){return;}Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px';
+}if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide']);
+}else{Roo.get(this.iframe).removeClass(['x-hidden','hide']);this.deferFocus();}},cleanHtml:function(A){A=String(A);if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A=='&nbsp;'){A='';}return A;
+},syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var A=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){A='<div style="'+m[0]+'">'+A+'</div>';
+}}A=this.cleanHtml(A);A=A.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(B){var cc=B.charCodeAt();if(B.length==2){var C=B.charCodeAt(0)-0xD800;var D=B.charCodeAt(1)-0xDC00;cc=(C*0x400)+D+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return B;
+}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,A)!==false){this.el.dom.value=A;this.owner.fireEvent('sync',this,A);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);
+d.innerHTML=v;this.cleanUpPaste();this.el.dom.value=d.innerHTML;this.owner.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;
+if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);
+}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this}
 );if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;this.owner.fireEvent('initialize',this);this.pushValue();
 },onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.activated=true;if(Roo.isGecko){this.win.focus();var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents((this.doc.body||this.doc.documentElement));
 r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false);}catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10);
 if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];}v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.owner.fireEvent('editorevent',this,e);this.syncValue();
-},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'){range=this.createRange(this.getSelection());var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents());range.insertNode(A);return;}this.execCmd("formatblock",tg);
-},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this);this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);
-this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win;if(D.getSelection&&D.getSelection().getRangeAt){B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;
-B.insertNode(C);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML;D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);}this.syncValue();
-this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase();switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;case 'v':this.cleanUpPaste.defer(100,this);
-return;}if(A){this.win.focus();this.execCmd(A);this.deferFocus();e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('&#160;&#160;&#160;&#160;');
-this.deferFocus();}return;}if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var A=r.parentElement();if(!A||A.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('<br />');r.collapse(false);r.select();}}}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);
-return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','&#160;&#160;&#160;&#160;');this.deferFocus();}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);
-return;}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();return;}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();
-var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection();
-},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);if(C.inRange(A)){break;}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;
-}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i<ar.length;i++){if((ar[i].nodeType==3)&&(!ar[i].data.length)){continue;}if(this.rangeIntersectsNode(A,ar[i])&&this.rangeCompareNode(A,ar[i])==3){D.push(ar[i]);
-continue;}if((ar[i].nodeType==1)&&this.rangeIntersectsNode(A,ar[i])&&(this.rangeCompareNode(A,ar[i])>0)){E.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;
-}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else{return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();
-var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);
-}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1;
+},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'||tg.toLowerCase()=='sup'||tg.toLowerCase()=='sub'){range=this.createRange(this.getSelection());var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents());
+range.insertNode(A);return;}this.execCmd("formatblock",tg);},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this);
+this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win;
+if(D.getSelection&&D.getSelection().getRangeAt){B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;B.insertNode(C);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML;
+D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);}this.syncValue();this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase();
+switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;case 'v':this.cleanUpPaste.defer(100,this);return;}if(A){this.win.focus();this.execCmd(A);this.deferFocus();e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;
+if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('&#160;&#160;&#160;&#160;');this.deferFocus();}return;}if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var A=r.parentElement();if(!A||A.tagName.toLowerCase()!='li'){e.stopEvent();
+r.pasteHTML('<br />');r.collapse(false);r.select();}}}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','&#160;&#160;&#160;&#160;');
+this.deferFocus();}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();return;}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);
+return;}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();
+return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);if(C.inRange(A)){break;
+}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i<ar.length;i++){if((ar[i].nodeType==3)&&(!ar[i].data.length)){continue;
+}if(this.rangeIntersectsNode(A,ar[i])&&this.rangeCompareNode(A,ar[i])==3){D.push(ar[i]);continue;}if((ar[i].nodeType==1)&&this.rangeIntersectsNode(A,ar[i])&&(this.rangeCompareNode(A,ar[i])>0)){E.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;
+}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else{return this.doc.createRange();
+}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();
+try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1;
 },rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C);
 var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2;}return 3;},cleanUpPaste:function(){Roo.log('cleanuppaste');this.cleanUpChildren(this.doc.body);var A=this.cleanWordChars(this.doc.body.innerHTML);if(A!=this.doc.body.innerHTML){this.doc.body.innerHTML=A;
 }},cleanWordChars:function(A){var he=Roo.HtmlEditorCore;var B=A;Roo.each(he.swapCodes,function(sw){var C=new RegExp("\\u"+sw[0].toString(16),"g");B=B.replace(C,sw[1]);});return B;},cleanUpChildren:function(n){if(!n.childNodes.length){return;}for(var i=n.childNodes.length-1;
 i>-1;i--){this.cleanUpChild(n.childNodes[i]);}},cleanUpChild:function(A){var ed=this;if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}var B=A.tagName.toLowerCase();if(this.black.indexOf(B)>-1&&this.clearUp){A.parentNode.removeChild(A);
-return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);}A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A);
-return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)){return;}if(v.match(/^#/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n);
-return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');if(!p.length){return true;}var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(D.length&&E.indexOf(l)>-1){return true;
-}if(D.length&&D.indexOf(l)<0){return true;}G.push(p);return true;});if(G.length){A.setAttribute(n,G.join(';'));}else{A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);
-continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);
-continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.className='';}if(a.value.match(/body/)){A.className='';}continue;}}this.cleanUpChildren(A);},cleanWord:function(A){if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);
-return;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);
-A.parentNode.insertBefore(cn,A);}A.parentNode.removeChild(A);this.iterateChildren(A,this.cleanWord);return;}if(A.className.length){var cn=A.className.split(/\W+/);var B=[];Roo.each(cn,function(E){if(E.match(/Mso[a-zA-Z]+/)){return;}B.push(E);});A.className=B.length?B.join(' '):'';
-if(!B.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var C=A.getAttribute("style").split(";");var D=[];Roo.each(C,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;
-}D.push(s);});A.setAttribute("style",D.length?D.join(';'):'');if(!D.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanWord);},iterateChildren:function(A,fn){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){fn.call(this,A.childNodes[i])}
+return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if((!A.attributes||!A.attributes.length)&&B=='span'){C=true;}if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);
+}A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A);return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)){return;
+}if(v.match(/^#/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');
+if(!p.length){return true;}var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(D.length&&E.indexOf(l)>-1){return true;}if(D.length&&D.indexOf(l)<0){return true;}G.push(p);return true;});if(G.length){A.setAttribute(n,G.join(';'));
+}else{A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);
+continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.removeAttribute('class');}if(a.value.match(/^body$/)){A.removeAttribute('class');
+}continue;}}this.cleanUpChildren(A);},cleanWord:function(A){if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);
+}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;
+}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);
+A.parentNode.insertBefore(cn,A);this.cleanWord(cn);}A.parentNode.removeChild(A);return;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):'';
+if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;
+}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanWord);},iterateChildren:function(A,fn){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){fn.call(this,A.childNodes[i])}
 },cleanTableWidths:function(A){if(!A){this.cleanTableWidths(this.doc.body);return;}if(A.nodeName=="#text"||A.nodeName=="#comment"){return;}Roo.log(A.tagName);if(!A.tagName.toLowerCase().match(/^(table|td|tr)$/)){this.iterateChildren(A,this.cleanTableWidths);
 return;}if(A.hasAttribute('width')){A.removeAttribute('width');}if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;
 }C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');if(!C.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanTableWidths);},domToHTML:function(A,B,C){B=B||0;C=C||false;if(!A){return this.domToHTML(this.doc.body);}var j;var D=false;
@@ -1751,7 +1858,7 @@ i++;J=A.childNodes.item(i);lastNode='';continue;}D=false;K+=L?'':"\n"+(new Array
 Roo.each(Roo.HtmlEditorCore.cwhite,function(A){if(b.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(w,function(A){if(b.indexOf(A)>-1){return;}if(this.cwhite.indexOf(A)>-1){return;}this.cwhite.push(A);},this);Roo.each(Roo.HtmlEditorCore.cblack,function(A){if(w.indexOf(A)>-1){return;
 }this.cblack.push(A);},this);Roo.each(b,function(A){if(w.indexOf(A)>-1){return;}if(this.cblack.indexOf(A)>-1){return;}this.cblack.push(A);},this);},setStylesheets:function(A){if(typeof(A)=='string'){Roo.get(this.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:A}
 );return;}var B=this;Roo.each(A,function(s){if(!s.length){return;}Roo.get(B.iframe.contentDocument.head).createChild({tag:'link',rel:'stylesheet',type:'text/css',href:s});});},removeStylesheets:function(){var A=this;Roo.each(Roo.get(A.iframe.contentDocument.head).select('link[rel=stylesheet]',true).elements,function(s){s.remove();
-});}});Roo.HtmlEditorCore.white=['area','br','img','input','hr','wbr','address','blockquote','center','dd','dir','div','dl','dt','h1','h2','h3','h4','h5','h6','hr','isindex','listing','marquee','menu','multicol','ol','p','plaintext','pre','table','ul','xmp','caption','col','colgroup','tbody','td','tfoot','th','thead','tr','dir','menu','ol','ul','dl','embed','object'];
+});},setStyle:function(A){Roo.get(this.iframe.contentDocument.head).createChild({tag:'style',type:'text/css',html:A});return;}});Roo.HtmlEditorCore.white=['area','br','img','input','hr','wbr','address','blockquote','center','dd','dir','div','dl','dt','h1','h2','h3','h4','h5','h6','hr','isindex','listing','marquee','menu','multicol','ol','p','plaintext','pre','table','ul','xmp','caption','col','colgroup','tbody','td','tfoot','th','thead','tr','dir','menu','ol','ul','dl','embed','object'];
 Roo.HtmlEditorCore.black=['applet','base','basefont','bgsound','blink','body','frame','frameset','head','html','ilayer','iframe','layer','link','meta','object','script','style','title','xml'];Roo.HtmlEditorCore.clean=['script','style','title','xml'];Roo.HtmlEditorCore.remove=['font'];
 Roo.HtmlEditorCore.ablack=['on'];Roo.HtmlEditorCore.aclean=['action','background','codebase','dynsrc','href','lowsrc'];Roo.HtmlEditorCore.pwhite=['http','https','mailto'];Roo.HtmlEditorCore.cwhite=[];Roo.HtmlEditorCore.cblack=[];Roo.HtmlEditorCore.swapCodes=[[8211,"--"],[8212,"--"],[8216,"'"],[8217,"'"],[8220,'"'],[8221,'"'],[8226,"*"],[8230,"..."]];
 
@@ -1778,7 +1885,7 @@ for(var i=0;i<this.toolbars.length;i++){this.toolbars[i].onFirstFocus();}},syncV
 }});
 // Roo/form/HtmlEditor/ToolbarStandard.js
 Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);this.disable=this.disable||{};Roo.applyIf(this.disable,{fontSize:true,colors:true,specialElements:true});};Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,editorcore:false,disable:false,createLinkText:'Please enter the URL for the link:',defaultLinkValue:'http:/'+'/',fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["&#169;","&#174;","&#8482;","&#163;","&#8230;","&#247;","&#8364;","&#176;"],specialElements:[{text:"Insert Table",xtype:'MenuItem',xns:Roo.Menu,ihtml:'<table><tr><td>Cell</td></tr></table>'}
-,{text:"Insert Image",xtype:'MenuItem',xns:Roo.Menu,ihtml:'<img src="about:blank"/>'}],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"],['div'],['span']],cleanStyles:["font-size"],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;
+,{text:"Insert Image",xtype:'MenuItem',xns:Roo.Menu,ihtml:'<img src="about:blank"/>'}],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"],['div'],['span'],['sup'],['sub']],cleanStyles:["font-size"],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;
 this.editorcore=A.editorcore?A.editorcore:A;var B=this.editorcore;var _t=this;var C=B.frameId;var D=this;function btn(id,H,I){var J=C+'-'+id;return {id:J,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:H!==false,scope:_t,handler:I||_t.relayBtnCmd,clickEvent:'mousedown',tooltip:D.buttonTips[id]||undefined,tabIndex:-1}
 ;}var tb=new Roo.Toolbar(A.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}
 ),blockFocus:true,name:'',displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){B.insertTag(r.get('tag'));A.focus();}}});tb.addField(this.formatCombo);
@@ -1790,24 +1897,25 @@ B.execCmd('hilitecolor',H);B.execCmd('useCSS',true);A.deferFocus();}else{B.execC
 },tabIndex:-1});}tb.add(E);}var F={};if(!this.disable.cleanStyles){F={cls:'x-btn-icon x-btn-clear',menu:{items:[]}};for(var i=0;i<this.cleanStyles.length;i++){F.menu.items.push({actiontype:this.cleanStyles[i],html:'Remove '+this.cleanStyles[i],handler:function(a,b){var c=Roo.get(B.doc.body);
 c.select('[style]').each(function(s){s.dom.style.removeProperty(a.actiontype);});B.syncValue();},tabIndex:-1});}F.menu.items.push({actiontype:'tablewidths',html:'Remove Table Widths',handler:function(a,b){B.cleanTableWidths();B.syncValue();},tabIndex:-1});
 F.menu.items.push({actiontype:'word',html:'Remove MS Word Formating',handler:function(a,b){B.cleanWord();B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All Styles',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[style]').each(function(s){s.dom.removeAttribute('style');
-});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.className='';});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();
-B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);
-}},this.specialElements[i]));}tb.add(G);}if(this.btns){for(var i=0;i<this.btns.length;i++){var b=Roo.factory(this.btns[i],Roo.form);b.cls='x-edit-none';if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';
-}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);
-},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;
-}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.frameId;if(!this.disable.font&&!Roo.isSafari){}if(!this.disable.format){A[C+'-bold'].toggle(B.queryCommandState('bold'));A[C+'-italic'].toggle(B.queryCommandState('italic'));A[C+'-underline'].toggle(B.queryCommandState('underline'));
-A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}if(!this.disable.alignments){A[C+'-justifyleft'].toggle(B.queryCommandState('justifyleft'));A[C+'-justifycenter'].toggle(B.queryCommandState('justifycenter'));A[C+'-justifyright'].toggle(B.queryCommandState('justifyright'));
-}if(!Roo.isSafari&&!this.disable.lists){A[C+'-insertorderedlist'].toggle(B.queryCommandState('insertorderedlist'));A[C+'-insertunorderedlist'].toggle(B.queryCommandState('insertunorderedlist'));}var D=this.editorcore.getAllAncestors();if(this.formatCombo){var E=this.formatCombo.store;
-this.formatCombo.setValue("");for(var i=0;i<D.length;i++){if(D[i]&&E.query('tag',D[i].tagName.toLowerCase(),false).length){this.formatCombo.setValue(D[i].tagName.toLowerCase());break;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;
-for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");
-if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();
-}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'}
-,italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'}
-,increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'}
-,forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'}
-,justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'}
-,createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();
-if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});}});
+});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.removeAttribute('class');});B.cleanWord();B.syncValue();},tabIndex:-1}
+);F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;
+i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);}},this.specialElements[i]));}tb.add(G);}if(this.btns){for(var i=0;i<this.btns.length;i++){var b=Roo.factory(this.btns[i],Roo.form);b.cls='x-edit-none';
+if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();
+}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);
+}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.frameId;if(!this.disable.font&&!Roo.isSafari){}if(!this.disable.format){A[C+'-bold'].toggle(B.queryCommandState('bold'));
+A[C+'-italic'].toggle(B.queryCommandState('italic'));A[C+'-underline'].toggle(B.queryCommandState('underline'));A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}if(!this.disable.alignments){A[C+'-justifyleft'].toggle(B.queryCommandState('justifyleft'));
+A[C+'-justifycenter'].toggle(B.queryCommandState('justifycenter'));A[C+'-justifyright'].toggle(B.queryCommandState('justifyright'));}if(!Roo.isSafari&&!this.disable.lists){A[C+'-insertorderedlist'].toggle(B.queryCommandState('insertorderedlist'));A[C+'-insertunorderedlist'].toggle(B.queryCommandState('insertunorderedlist'));
+}var D=this.editorcore.getAllAncestors();if(this.formatCombo){var E=this.formatCombo.store;this.formatCombo.setValue("");for(var i=0;i<D.length;i++){if(D[i]&&E.query('tag',D[i].tagName.toLowerCase(),false).length){this.formatCombo.setValue(D[i].tagName.toLowerCase());
+break;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');
+}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);
+return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();
+});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'}
+,underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'}
+,decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'}
+,justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'}
+,insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'}
+,sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();
+});}});
 // Roo/form/HtmlEditor/ToolbarContext.js
 Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);this.styles=this.styles||{};};Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80}
 ,border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},target:{title:"Target",width:120},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}
@@ -1831,7 +1939,7 @@ var tb=new Roo.Toolbar(D);tb.add(nm+":&nbsp;");var E=[];for(var i in this.styles
 C.syncValue();}}}));}var F=Roo.form.HtmlEditor.ToolbarContext;var G=F.options;for(var i in A){var H=A[i];tb.add(H.title+":&nbsp;");var I=H.opts?H.opts:false;if(H.optname){I=G[H.optname];}if(I){tb.addField(new Roo.form.ComboBox({store:typeof(F.stores[i])!='undefined'?Roo.factory(F.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:I}
 ),name:'-roo-edit-'+i,attrname:i,stylename:H.style?H.style:false,displayField:H.displayField?H.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(F.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:H.width?H.width:130,listeners:{'select':function(c,r,i){if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');
 return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:H.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.attrname,nv);
-}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode;
+C.syncValue();}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode;
 var pn=sn.parentNode;var K=sn.childNodes[0];var en=sn.childNodes[sn.childNodes.length-1];while(sn.childNodes.length){var L=sn.childNodes[0];sn.removeChild(L);pn.insertBefore(L,sn);}pn.removeChild(sn);var M=C.createRange();M.setStart(K,0);M.setEnd(en,0);var N=C.getSelection();
 N.removeAllRanges();N.addRange(M);J.updateToolbar(null,null,null);J.footDisp.dom.innerHTML='';}}});tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;},buildFooter:function(){var A=this.editor.wrap.createChild();
 this.footer=new Roo.Toolbar(A);var B=new Roo.Toolbar.Fill();var _t=this;this.footer.add({text:'&lt;',xtype:'Button',handler:function(){_t.footDisp.scrollTo('left',0,true)}});this.footer.add(B);this.footer.add({text:'&gt;',xtype:'Button',handler:function(){_t.footDisp.select('span').last().scrollIntoView(_t.footDisp,true);
@@ -1840,27 +1948,40 @@ if(!cn.match(/x-ed-loc-/)){return;}var n=cn.split('-').pop();var B=this.footerEl
 }});
 // Roo/form/BasicForm.js
 Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);
-}Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:false,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();
-this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=true;this.items.each(function(f){if(!f.validate()){A=false;}});return A;},isDirty:function(){var A=false;this.items.each(function(f){if(f.isDirty()){A=true;
-return false;}});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);
-return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);
-return this;},beforeAction:function(A){var o=A.options;if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');
-}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();
-}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
+}Roo.form.BasicForm.superclass.constructor.call(this);Roo.form.BasicForm.popover.apply();};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:false,disableMask:false,errorMask:false,maskOffset:100,initEl:function(el){this.el=Roo.get(el);
+this.id=this.el.id||Roo.id();this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=true;var B=false;this.items.each(function(f){if(f.validate()){return;}A=false;if(!B&&f.el.isVisible(true)){B=f;
+}});if(this.errorMask&&!A){Roo.form.BasicForm.popover.mask(this,B);}return A;},isDirty:function(){var A=false;this.items.each(function(f){if(f.isDirty()){A=true;return false;}});return A;},hasChanged:function(){var A=false;this.items.each(function(f){if(f.hasChanged()){A=true;
+return false;}});return A;},resetHasChanged:function(){this.items.each(function(f){f.resetHasChanged();});},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);
+A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());
+}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);return this;},beforeAction:function(A){var o=A.options;if(!this.disableMask){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);
+this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(!this.disableMask){if(this.waitMsgTarget===true){this.el.unmask();
+}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
 Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function(r){if(r!='yes'){return;}_t.doAction('submit',{params:{_submit_confirmed:1}});});return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.MessageBox.alert("Error",(typeof(A.result)!='undefined'&&typeof(A.result.errorMsg)!='undefined')?A.result.errorMsg:"Saving Failed, please check your entries or try again");
 }this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.items.get(id);if(!A){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){A=f;return false;}});}return A||null;},addForm:function(A){if(this.childForms.indexOf(A)>-1){return;
 }this.childForms.push(A);var n='';Roo.each(A.allItems,function(fe){n=typeof(fe.getName)=='undefined'?fe.name:fe.getName();if(this.findField(n)){return;}var B=new Roo.form.Hidden({name:n});B.render(this.el);this.add(B);},this);},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;
 i<B;i++){var C=A[i];var f=this.findField(C.id);if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}Roo.each(this.childForms||[],function(f){f.markInvalid(A);});return this;}
 ,setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var v=A[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={}
-;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}Roo.each(this.childForms||[],function(f){f.setValues(A);
-});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());
+;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}this.resetHasChanged();
+Roo.each(this.childForms||[],function(f){f.setValues(A);f.resetHasChanged();});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}if(typeof(FormData)!='undefined'&&A!==true){try{var fd=(new FormData(this.el.dom)).entries();
+var B={};var C=fd.next();while(!C.done){B[C.value[0]]=C.value[1];C=fd.next();};return B;}catch(e){}}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());
 },this);}var B={};this.items.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(B[f.getName()])=='undefined'){B[f.getName()]='';}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();
 }if(f.name!=f.getName()){B[f.name]=f.getRawValue();}B[f.getName()]=v;});return B;},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();
-});Roo.each(this.childForms||[],function(f){f.reset();});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
-}});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;
+});Roo.each(this.childForms||[],function(f){f.reset();});this.resetHasChanged();return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
+}});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;Roo.apply(Roo.form.BasicForm,{popover:{padding:5,isApplied:false,isMasked:false,form:false,target:false,intervalID:false,maskEl:false,apply:function(){if(this.isApplied){return;
+}this.maskEl={top:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-top-mask"},true),left:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-left-mask"},true),bottom:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-bottom-mask"}
+,true),right:Roo.DomHelper.append(Roo.get(document.body),{tag:"div",cls:"x-dlg-mask roo-form-right-mask"},true)};this.maskEl.top.enableDisplayMode("block");this.maskEl.left.enableDisplayMode("block");this.maskEl.bottom.enableDisplayMode("block");this.maskEl.right.enableDisplayMode("block");
+Roo.get(document.body).on('click',function(){this.unmask();},this);Roo.get(document.body).on('touchstart',function(){this.unmask();},this);this.isApplied=true},mask:function(A,B){this.form=A;this.target=B;if(!this.form.errorMask||!B.el){return;}var C=this.target.el.findScrollableParent()||this.target.el.findParent('div.x-layout-active-content',100,true)||Roo.get(document.body);
+var ot=this.target.el.calcOffsetsTo(C);var D=ot[1]-this.form.maskOffset;D=Math.min(D,C.dom.scrollHeight);C.scrollTo('top',D);var el=this.target.wrap||this.target.el;var E=el.getBox();this.maskEl.top.setStyle('position','absolute');this.maskEl.top.setStyle('z-index',10000);
+this.maskEl.top.setSize(Roo.lib.Dom.getDocumentWidth(),E.y-this.padding);this.maskEl.top.setLeft(0);this.maskEl.top.setTop(0);this.maskEl.top.show();this.maskEl.left.setStyle('position','absolute');this.maskEl.left.setStyle('z-index',10000);this.maskEl.left.setSize(E.x-this.padding,E.height+this.padding*2);
+this.maskEl.left.setLeft(0);this.maskEl.left.setTop(E.y-this.padding);this.maskEl.left.show();this.maskEl.bottom.setStyle('position','absolute');this.maskEl.bottom.setStyle('z-index',10000);this.maskEl.bottom.setSize(Roo.lib.Dom.getDocumentWidth(),Roo.lib.Dom.getDocumentHeight()-E.bottom-this.padding);
+this.maskEl.bottom.setLeft(0);this.maskEl.bottom.setTop(E.bottom+this.padding);this.maskEl.bottom.show();this.maskEl.right.setStyle('position','absolute');this.maskEl.right.setStyle('z-index',10000);this.maskEl.right.setSize(Roo.lib.Dom.getDocumentWidth()-E.right-this.padding,E.height+this.padding*2);
+this.maskEl.right.setLeft(E.right+this.padding);this.maskEl.right.setTop(E.y-this.padding);this.maskEl.right.show();this.intervalID=window.setInterval(function(){Roo.form.BasicForm.popover.unmask();},10000);window.onwheel=function(){return false;};(function(){this.isMasked=true;
+}).defer(500,this);},unmask:function(){if(!this.isApplied||!this.isMasked||!this.form||!this.target||!this.form.errorMask){return;}this.maskEl.top.setStyle('position','absolute');this.maskEl.top.setSize(0,0).setXY([0,0]);this.maskEl.top.hide();this.maskEl.left.setStyle('position','absolute');
+this.maskEl.left.setSize(0,0).setXY([0,0]);this.maskEl.left.hide();this.maskEl.bottom.setStyle('position','absolute');this.maskEl.bottom.setSize(0,0).setXY([0,0]);this.maskEl.bottom.hide();this.maskEl.right.setStyle('position','absolute');this.maskEl.right.setSize(0,0).setXY([0,0]);
+this.maskEl.right.hide();window.onwheel=function(){return true;};if(this.intervalID){window.clearInterval(this.intervalID);this.intervalID=false;}this.isMasked=false;}}});
 // Roo/form/Form.js
 Roo.form.Form=function(A){var B=[];if(A.items){B=A.items;delete A.items;}Roo.form.Form.superclass.constructor.call(this,null,A);this.url=this.url||this.action;if(!this.root){this.root=new Roo.form.Layout(Roo.applyIf({id:Roo.id()},A));}this.active=this.root;
-this.buttons=[];this.allItems=[];this.addEvents({clientvalidation:true,rendered:true});if(this.progressUrl){this.addxtype({xns:Roo.form,xtype:'Hidden',name:'UPLOAD_IDENTIFIER'});}Roo.each(B,this.addxtype,this);};Roo.extend(Roo.form.Form,Roo.form.BasicForm,{buttonAlign:'center',minButtonWidth:75,labelAlign:'left',monitorValid:false,monitorPoll:200,progressUrl:false,column:function(c){var A=new Roo.form.Column(c);
+this.buttons=[];this.allItems=[];this.addEvents({clientvalidation:true,rendered:true});if(this.progressUrl){this.addxtype({xns:Roo.form,xtype:'Hidden',name:'UPLOAD_IDENTIFIER'});}Roo.each(B,this.addxtype,this);};Roo.extend(Roo.form.Form,Roo.form.BasicForm,{buttonAlign:'center',minButtonWidth:75,labelAlign:'left',monitorValid:false,monitorPoll:200,progressUrl:false,formData:false,column:function(c){var A=new Roo.form.Column(c);
 this.start(A);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return A;},fieldset:function(c){var fs=new Roo.form.FieldSet(c);this.start(fs);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));
 this.end();}return fs;},container:function(c){var l=new Roo.form.Layout(c);this.start(l);if(arguments.length>1){this.add.apply(this,Array.prototype.slice.call(arguments,1));this.end();}return l;},start:function(c){Roo.applyIf(c,{'labelAlign':this.active.labelAlign,'labelWidth':this.active.labelWidth,'itemCls':this.active.itemCls}
 );this.active.stack.push(c);c.ownerCt=this.active;this.active=c;return this;},end:function(){if(this.active==this.root){return this;}this.active=this.active.ownerCt;return this;},add:function(){this.active.stack.push.apply(this.active.stack,arguments);this.allItems.push.apply(this.allItems,arguments);
@@ -1883,7 +2004,7 @@ return this.result;},getUrl:function(A){var B=this.options.url||this.form.url||t
 ,method:'GET',success:function(B){var C=false;var D;try{C=Roo.decode(B.responseText)}catch(e){Roo.log("Invalid data from server..");Roo.log(D);return;}if(!C||!C.success){Roo.log(C);Roo.MessageBox.alert(Roo.encode(C));return;}var E=C.data;if(this.uploadComplete){Roo.MessageBox.hide();
 return;}if(E){Roo.MessageBox.updateProgress(E.bytes_uploaded/E.bytes_total,Math.floor((E.bytes_total-E.bytes_uploaded)/1000)+'k remaining');}this.uploadProgress.defer(2000,this);},failure:function(B){Roo.log('progress url failed ');Roo.log(B);},scope:this}
 );},run:function(){this.form.getValues();var o=this.options;var A=this.getMethod();var B=A=='POST';if(o.clientValidation===false||this.form.isValid()){if(this.form.progressUrl){this.form.findField('UPLOAD_IDENTIFIER').setValue((new Date()*1)+''+Math.random());
-}Roo.Ajax.request(Roo.apply(this.createCallback(),{form:this.form.el.dom,url:this.getUrl(!B),method:A,params:B?this.getParams():null,isUpload:this.form.fileUpload}));this.uploadProgress();}else if(o.clientValidation!==false){this.failureType=Roo.form.Action.CLIENT_INVALID;
+}Roo.Ajax.request(Roo.apply(this.createCallback(),{form:this.form.el.dom,url:this.getUrl(!B),method:A,params:B?this.getParams():null,isUpload:this.form.fileUpload,formData:this.form.formData}));this.uploadProgress();}else if(o.clientValidation!==false){this.failureType=Roo.form.Action.CLIENT_INVALID;
 this.form.afterAction(this,false);}},success:function(A){this.uploadComplete=true;if(this.haveProgress){Roo.MessageBox.hide();}var B=this.processResponse(A);if(B===true||B.success){this.form.afterAction(this,true);return;}if(B.errors){this.form.markInvalid(B.errors);
 this.failureType=Roo.form.Action.SERVER_INVALID;}this.form.afterAction(this,false);},failure:function(A){this.uploadComplete=true;if(this.haveProgress){Roo.MessageBox.hide();}this.response=A;this.failureType=Roo.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false);
 },handleResponse:function(A){if(this.form.errorReader){var rs=this.form.errorReader.read(A);var B=[];if(rs.records){for(var i=0,C=rs.records.length;i<C;i++){var r=rs.records[i];B[i]=r.data;}}if(B.length<1){B=null;}return {success:rs.success,errors:B};}var D=false;
@@ -2043,7 +2164,7 @@ C.beginUpdate();var D=Roo.BorderLayout.RegionFactory.validRegions;for(var j=0,E=
 if(C.lightweight||C.basic){return new Roo.BasicLayoutRegion(B,C,A);}switch(A){case "north":return new Roo.NorthLayoutRegion(B,C);case "south":return new Roo.SouthLayoutRegion(B,C);case "east":return new Roo.EastLayoutRegion(B,C);case "west":return new Roo.WestLayoutRegion(B,C);
 case "center":return new Roo.CenterLayoutRegion(B,C);}throw 'Layout region "'+A+'" not supported.';}};
 // Roo/BasicLayoutRegion.js
-Roo.BasicLayoutRegion=function(A,B,C,D){this.mgr=A;this.position=C;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true}
+Roo.BasicLayoutRegion=function(A,B,C,D){this.mgr=A;this.position=C;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"beforecollapse":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true}
 ;this.panels=new Roo.util.MixedCollection();this.panels.getKey=this.getPanelId.createDelegate(this);this.box=null;this.activePanel=null;if(B.listeners||B.events){Roo.BasicLayoutRegion.superclass.constructor.call(this,{listeners:B.listeners||{},events:B.events||{}
 });}if(D!==true){this.applyConfig(B);}};Roo.extend(Roo.BasicLayoutRegion,Roo.util.Observable,{getPanelId:function(p){return p.getId();},applyConfig:function(A){this.margins=A.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.config=A;},resizeTo:function(A){var el=this.el?this.el:(this.activePanel?this.activePanel.getEl():null);
 if(el){switch(this.position){case "east":case "west":el.setWidth(A);this.fireEvent("resized",this,A);break;case "north":case "south":el.setHeight(A);this.fireEvent("resized",this,A);break;}}},getBox:function(){return this.activePanel?this.activePanel.getEl().getBox(false,true):null;
@@ -2073,10 +2194,10 @@ this.collapsedEl.dom.style.top=A.y+"px";this.collapsedEl.setSize(A.width,A.heigh
 }}if(this.panelSize){w=w!==null?w:this.panelSize.width;h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl();w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);
 }if(Roo.isIE&&this.tabs){this.tabs.el.repaint();}},getEl:function(){return this.el;},hide:function(){if(!this.collapsed){this.el.dom.style.left="-2000px";this.el.hide();}else{this.collapsedEl.dom.style.left="-2000px";this.collapsedEl.hide();}this.visible=false;
 this.fireEvent("visibilitychange",this,false);},show:function(){if(!this.collapsed){this.el.show();}else{this.collapsedEl.show();}this.visible=true;this.fireEvent("visibilitychange",this,true);},closeClicked:function(){if(this.activePanel){this.remove(this.activePanel);
-}},collapseClick:function(e){if(this.isSlid){e.stopPropagation();this.slideIn();}else{e.stopPropagation();this.slideOut();}},collapse:function(A){if(this.collapsed){return;}this.collapsed=true;if(this.split){this.split.el.hide();}if(this.config.animate&&A!==true){this.fireEvent("invalidated",this);
-this.animateCollapse();}else{this.el.setLocation(-20000,-20000);this.el.hide();this.collapsedEl.show();this.fireEvent("collapsed",this);this.fireEvent("invalidated",this);}},animateCollapse:function(){},expand:function(e,A){if(e){e.stopPropagation();}if(!this.collapsed||this.el.hasActiveFx()){return;
-}if(this.isSlid){this.afterSlideIn();A=true;}this.collapsed=false;if(this.config.animate&&A!==true){this.animateExpand();}else{this.el.show();if(this.split){this.split.el.show();}this.collapsedEl.setLocation(-2000,-2000);this.collapsedEl.hide();this.fireEvent("invalidated",this);
-this.fireEvent("expanded",this);}},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");var ts=new Roo.TabPanel(this.bodyEl.dom,{tabPosition:this.bottomTabs?'bottom':'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar}
+}},collapseClick:function(e){if(this.isSlid){e.stopPropagation();this.slideIn();}else{e.stopPropagation();this.slideOut();}},collapse:function(A,B){if(this.collapsed){return;}if(B||this.fireEvent("beforecollapse",this)!=false){this.collapsed=true;if(this.split){this.split.el.hide();
+}if(this.config.animate&&A!==true){this.fireEvent("invalidated",this);this.animateCollapse();}else{this.el.setLocation(-20000,-20000);this.el.hide();this.collapsedEl.show();this.fireEvent("collapsed",this);this.fireEvent("invalidated",this);}}},animateCollapse:function(){}
+,expand:function(e,A){if(e){e.stopPropagation();}if(!this.collapsed||this.el.hasActiveFx()){return;}if(this.isSlid){this.afterSlideIn();A=true;}this.collapsed=false;if(this.config.animate&&A!==true){this.animateExpand();}else{this.el.show();if(this.split){this.split.el.show();
+}this.collapsedEl.setLocation(-2000,-2000);this.collapsedEl.hide();this.fireEvent("invalidated",this);this.fireEvent("expanded",this);}},animateExpand:function(){},initTabs:function(){this.bodyEl.setStyle("overflow","hidden");var ts=new Roo.TabPanel(this.bodyEl.dom,{tabPosition:this.bottomTabs?'bottom':'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar}
 );if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150;
 ts.monitorResize=false;ts.bodyEl.setStyle("overflow",this.config.autoScroll?"auto":"hidden");ts.bodyEl.addClass('x-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable());
 if(A.tabTip!==undefined){ti.setTooltip(A.tabTip);}ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B);
@@ -2145,9 +2266,9 @@ this.view=Roo.factory(this.view);this.view.render&&this.view.render(false,'');}t
 },ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();
 um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);
 return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;
-},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();B-=te.getHeight();te.setWidth(A);}if(this.footer){var te=this.footer.getEl();Roo.log("footer:"+te.getHeight());
-B-=te.getHeight();te.setWidth(A);}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);
-}var C=this.adjustForComponents(A,B);this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){return this.title;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);
+},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl();B-=te.getHeight();te.setWidth(A);}if(this.footer){var te=this.footer.getEl();B-=te.getHeight();
+te.setWidth(A);}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B);}var C=this.adjustForComponents(A,B);
+this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){return this.title;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A);
 }},isClosable:function(){return this.closable;},beforeSlide:function(){this.el.clip();this.resizeEl.clip();},afterSlide:function(){this.el.unclip();this.resizeEl.unclip();},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();
 }},destroy:function(){this.el.removeAllListeners();var A=document.createElement("span");A.appendChild(this.el.dom);A.innerHTML="";this.el.remove();this.el=null;},form:false,view:false,addxtype:function(A){if(A.xtype.match(/^Form$/)){var el;el=this.el.createChild();
 this.form=new Roo.form.Form(A);if(this.form.allItems.length){this.form.render(el.dom);}return this.form;}if(['View','JsonView','DatePicker'].indexOf(A.xtype)>-1){A.el=this.el.appendChild(document.createElement("div"));var B=new Roo.factory(A);B.render&&B.render(false,'');
@@ -2182,16 +2303,17 @@ if((!c.dom.offsetHeight||c.dom.offsetHeight<20)||c.getStyle("height")=="auto"){t
 if(Roo.isTouch){c.on("touchstart",this.onTouchStart,this);}this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);A.render();if(this.loadMask){this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:this.dataSource}
 ,this.loadMask));}if(this.toolbar&&this.toolbar.xtype){this.toolbar.container=this.getView().getHeaderPanel(true);this.toolbar=new Roo.Toolbar(this.toolbar);}if(this.footer&&this.footer.xtype){this.footer.dataSource=this.getDataSource();this.footer.container=this.getView().getFooterPanel(true);
 this.footer=Roo.factory(this.footer,Roo);}if(this.dropTarget&&this.dropTarget.xtype){delete this.dropTarget.xtype;this.dropTarget=new Roo.dd.DropTarget(this.getView().mainBody,this.dropTarget);}this.rendered=true;this.fireEvent('render',this);return this;
-},reconfigure:function(A,B){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:A},this.loadMask));}this.view.bind(A,B);this.dataSource=A;this.colModel=B;this.view.refresh(true);},onKeyDown:function(e){this.fireEvent("keydown",e);
-},destroy:function(A,B){if(this.loadMask){this.loadMask.destroy();}var c=this.container;c.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();if(!B){this.purgeListeners();}c.update("");if(A===true){c.remove();}},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);
-}var t=e.getTarget();var v=this.view;var B=v.findHeaderIndex(t);if(B!==false){var C=A=='touchstart'?'click':A;this.fireEvent("header"+C,this,B,e);}else{var D=v.findRowIndex(t);var E=v.findCellIndex(t);if(A=='touchstart'){A=false;if(typeof(this.selModel.getSelectedCell)!='undefined'){var cs=this.selModel.getSelectedCell();
-if(D==cs[0]&&E==cs[1]){A='dblclick';}}if(typeof(this.selModel.getSelections)!='undefined'){var cs=this.selModel.getSelections();var ds=this.dataSource;if(cs.length==1&&ds.getAt(D)==cs[0]){A='dblclick';}}if(!A){return;}}if(D!==false){this.fireEvent("row"+A,this,D,e);
-if(E!==false){this.fireEvent("cell"+A,this,D,E,e);}}}},onClick:function(e){this.processEvent("click",e);},onTouchStart:function(e){this.processEvent("touchstart",e);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},onDblClick:function(e){this.processEvent("dblclick",e);
-},walkCells:function(A,B,C,fn,D){var cm=this.colModel,E=cm.getColumnCount();var ds=this.dataSource,F=ds.getCount(),G=true;if(C<0){if(B<0){A--;G=false;}while(A>=0){if(!G){B=E-1;}G=false;while(B>=0){if(fn.call(D||this,A,B,cm)===true){return [A,B];}B--;}A--;
-}}else{if(B>=E){A++;G=false;}while(A<F){if(!G){B=0;}G=false;while(B<E){if(fn.call(D||this,A,B,cm)===true){return [A,B];}B++;}A++;}}return null;},getSelections:function(){return this.selModel.getSelections();},autoSize:function(){if(this.rendered){this.view.layout();
-if(this.view.adjustForScroll){this.view.adjustForScroll();}}},getGridEl:function(){return this.container;},stopEditing:function(){},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.grid.RowSelectionModel();}return this.selModel;},getDataSource:function(){return this.dataSource;
-},getColumnModel:function(){return this.colModel;},getView:function(){if(!this.view){this.view=new Roo.grid.GridView(this.viewConfig);}return this.view;},getDragDropText:function(){var A=this.selModel.getCount();return String.format(this.ddText,A,A==1?'':'s');
-}});Roo.grid.Grid.prototype.ddText="{0} selected row{1}";
+},reconfigure:function(A,B){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Roo.LoadMask(this.container,Roo.apply({store:A},this.loadMask));}this.view.bind(A,B);this.dataSource=A;this.colModel=B;this.view.refresh(true);},addColumns:function(A,ar){for(var i=0;
+i<ar.length;i++){var B=ar[i];B.id=typeof(B.id)=='undefined'?Roo.id():B.id;this.cm.lookup[B.id]=B;}if(typeof(A)=='undefined'||A>=this.cm.config.length){A=this.cm.config.length;}A=Math.max(0,A);ar.unshift(0);ar.unshift(A);this.cm.config.splice.apply(this.cm.config,ar);
+this.view.generateRules(this.cm);this.view.refresh(true);},onKeyDown:function(e){this.fireEvent("keydown",e);},destroy:function(A,B){if(this.loadMask){this.loadMask.destroy();}var c=this.container;c.removeAllListeners();this.view.destroy();this.colModel.purgeListeners();
+if(!B){this.purgeListeners();}c.update("");if(A===true){c.remove();}},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var v=this.view;var B=v.findHeaderIndex(t);if(B!==false){var C=A=='touchstart'?'click':A;this.fireEvent("header"+C,this,B,e);
+}else{var D=v.findRowIndex(t);var E=v.findCellIndex(t);if(A=='touchstart'){A=false;if(typeof(this.selModel.getSelectedCell)!='undefined'){var cs=this.selModel.getSelectedCell();if(D==cs[0]&&E==cs[1]){A='dblclick';}}if(typeof(this.selModel.getSelections)!='undefined'){var cs=this.selModel.getSelections();
+var ds=this.dataSource;if(cs.length==1&&ds.getAt(D)==cs[0]){A='dblclick';}}if(!A){return;}}if(D!==false){this.fireEvent("row"+A,this,D,e);if(E!==false){this.fireEvent("cell"+A,this,D,E,e);}}}},onClick:function(e){this.processEvent("click",e);},onTouchStart:function(e){this.processEvent("touchstart",e);
+},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},onDblClick:function(e){this.processEvent("dblclick",e);},walkCells:function(A,B,C,fn,D){var cm=this.colModel,E=cm.getColumnCount();var ds=this.dataSource,F=ds.getCount(),G=true;if(C<0){if(B<0){A--;
+G=false;}while(A>=0){if(!G){B=E-1;}G=false;while(B>=0){if(fn.call(D||this,A,B,cm)===true){return [A,B];}B--;}A--;}}else{if(B>=E){A++;G=false;}while(A<F){if(!G){B=0;}G=false;while(B<E){if(fn.call(D||this,A,B,cm)===true){return [A,B];}B++;}A++;}}return null;
+},getSelections:function(){return this.selModel.getSelections();},autoSize:function(){if(this.rendered){this.view.layout();if(this.view.adjustForScroll){this.view.adjustForScroll();}}},getGridEl:function(){return this.container;},stopEditing:function(){},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.grid.RowSelectionModel();
+}return this.selModel;},getDataSource:function(){return this.dataSource;},getColumnModel:function(){return this.colModel;},getView:function(){if(!this.view){this.view=new Roo.grid.GridView(this.viewConfig);}return this.view;},getDragDropText:function(){var A=this.selModel.getCount();
+return String.format(this.ddText,A,A==1?'':'s');}});Roo.grid.Grid.prototype.ddText="{0} selected row{1}";
 // Roo/grid/AbstractGridView.js
 Roo.grid.AbstractGridView=function(){this.grid=null;this.events={"beforerowremoved":true,"beforerowsinserted":true,"beforerefresh":true,"rowremoved":true,"rowsinserted":true,"rowupdated":true,"refresh":true};Roo.grid.AbstractGridView.superclass.constructor.call(this);
 };Roo.extend(Roo.grid.AbstractGridView,Roo.util.Observable,{rowClass:"x-grid-row",cellClass:"x-grid-cell",tdClass:"x-grid-td",hdClass:"x-grid-hd",splitClass:"x-grid-hd-split",init:function(A){this.grid=A;var B=this.grid.getGridEl().id;this.colSelector="#"+B+" ."+this.cellClass+"-";
@@ -2245,28 +2367,28 @@ if(id){return parseInt(id[1],10);}return 0;},findHeaderIndex:function(n){var r=R
 }return false;},getColumnId:function(A){return this.cm.getColumnId(A);},getSplitters:function(){if(this.splitterSelector){return Roo.DomQuery.select(this.splitterSelector);}else{return null;}},getSplitter:function(A){return this.getSplitters()[A];},onRowOver:function(e,t){var A;
 if((A=this.findRowIndex(t))!==false){this.getRowComposite(A).addClass("x-grid-row-over");}},onRowOut:function(e,t){var A;if((A=this.findRowIndex(t))!==false&&A!==this.findRowIndex(e.getRelatedTarget())){this.getRowComposite(A).removeClass("x-grid-row-over");
 }},renderHeaders:function(){var cm=this.cm;var ct=this.templates.hcell,ht=this.templates.header,st=this.templates.hsplit;var cb=[],lb=[],sb=[],A=[],p={};for(var i=0,B=cm.getColumnCount();i<B;i++){p.cellId="x-grid-hd-0-"+i;p.splitId="x-grid-csplit-0-"+i;p.id=cm.getColumnId(i);
-p.title=cm.getColumnTooltip(i)||"";p.value=cm.getColumnHeader(i)||"";p.style=(this.grid.enableColumnResize===false||!cm.isResizable(i)||cm.isFixed(i))?'cursor:default':'';if(!cm.isLocked(i)){cb[cb.length]=ct.apply(p);sb[sb.length]=st.apply(p);}else{lb[lb.length]=ct.apply(p);
-A[A.length]=st.apply(p);}}return [ht.apply({cells:lb.join(""),splits:A.join("")}),ht.apply({cells:cb.join(""),splits:sb.join("")})];},updateHeaders:function(){var A=this.renderHeaders();this.lockedHd.update(A[0]);this.mainHd.update(A[1]);},focusRow:function(A){var x=this.scroller.dom.scrollLeft;
-this.focusCell(A,0,false);this.scroller.dom.scrollLeft=x;},focusCell:function(A,B,C){var el=this.ensureVisible(A,B,C);this.focusEl.alignTo(el,"tl-tl");if(Roo.isGecko){this.focusEl.focus();}else{this.focusEl.focus.defer(1,this.focusEl);}},ensureVisible:function(A,B,C){if(typeof A!="number"){A=A.rowIndex;
-}if(A<0&&A>=this.ds.getCount()){return null;}B=(B!==undefined?B:0);var cm=this.grid.colModel;while(cm.isHidden(B)){B++;}var el=this.getCell(A,B);if(!el){return null;}var c=this.scroller.dom;var D=parseInt(el.offsetTop,10);var E=parseInt(el.offsetLeft,10);
-var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;if(D<H){c.scrollTop=D;}else if(F>J){c.scrollTop=F-ch;}if(C!==false){if(E<I){c.scrollLeft=E;
-}else if(G>K){c.scrollLeft=G-c.clientWidth;}}return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,A=this.getColumnIds();var B=0;for(var i=0,C=cm.getColumnCount();i<C;i++){var w=cm.getColumnWidth(i);this.css.updateRule(this.colSelector+this.idToCssName(A[i]),"width",(w-this.borderWidth)+"px");
-this.css.updateRule(this.hdSelector+this.idToCssName(A[i]),"width",(w-this.borderWidth)+"px");}this.updateSplitters();},generateRules:function(cm){var A=[],B=this.idToCssName(this.grid.id)+'-cssrules';Roo.util.CSS.removeStyleSheet(B);for(var i=0,C=cm.getColumnCount();
-i<C;i++){var D=cm.getColumnId(i);var E='';if(cm.config[i].align){E='text-align:'+cm.config[i].align+';';}var F='';if(cm.isHidden(i)){F='display:none;';}var G="width:"+(cm.getColumnWidth(i)-this.borderWidth)+"px;";A.push(this.colSelector,D," {\n",cm.config[i].css,E,G,"\n}\n",this.hdSelector,D," {\n",E,G,"}\n",this.tdSelector,D," {\n",F,"\n}\n",this.splitSelector,D," {\n",F,"\n}\n");
-}return Roo.util.CSS.createStyleSheet(A.join(""),B);},updateSplitters:function(){var cm=this.cm,s=this.getSplitters();if(s){var A=0,B=true;for(var i=0,C=cm.getColumnCount();i<C;i++){if(cm.isHidden(i)){continue;}var w=cm.getColumnWidth(i);if(!cm.isLocked(i)&&B){A=0;
-B=false;}A+=w;s[i].style.left=(A-this.splitOffset)+"px";}}},handleHiddenChange:function(A,B,C){if(C){this.hideColumn(B);}else{this.unhideColumn(B);}},hideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+this.idToCssName(B),"display","none");
-this.css.updateRule(this.splitSelector+this.idToCssName(B),"display","none");if(Roo.isSafari){this.updateHeaders();}this.updateSplitters();this.layout();},unhideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+this.idToCssName(B),"display","");
-this.css.updateRule(this.splitSelector+this.idToCssName(B),"display","");if(Roo.isSafari){this.updateHeaders();}this.updateSplitters();this.layout();},insertRows:function(dm,A,B,C){if(A==0&&B==dm.getCount()-1){this.refresh();}else{if(!C){this.fireEvent("beforerowsinserted",this,A,B);
-}var s=this.getScrollState();var D=this.renderRows(A,B);this.bufferRows(D[0],this.getLockedTable(),A);this.bufferRows(D[1],this.getBodyTable(),A);this.restoreScroll(s);if(!C){this.fireEvent("rowsinserted",this,A,B);this.syncRowHeights(A,B);this.stripeRows(A);
-this.layout();}}},bufferRows:function(A,B,C){var D=null,E=B.rows,F=B.tBodies[0];if(C<E.length){D=E[C];}var b=document.createElement("div");b.innerHTML="<table><tbody>"+A+"</tbody></table>";var G=b.firstChild.rows;for(var i=0,H=G.length;i<H;i++){if(D){F.insertBefore(G[0],D);
-}else{F.appendChild(G[0]);}}b.innerHTML="";b=null;},deleteRows:function(dm,A,B){if(dm.getRowCount()<1){this.fireEvent("beforerefresh",this);this.mainBody.update("");this.lockedBody.update("");this.fireEvent("refresh",this);}else{this.fireEvent("beforerowsdeleted",this,A,B);
-var bt=this.getBodyTable();var C=bt.firstChild;var D=bt.rows;for(var E=A;E<=B;E++){C.removeChild(D[A]);}this.stripeRows(A);this.fireEvent("rowsdeleted",this,A,B);}},updateRows:function(A,B,C){var s=this.getScrollState();this.refresh();this.restoreScroll(s);
-},handleSort:function(A,B,C,D){if(!D){this.refresh();}this.updateHeaderSortState();},getScrollState:function(){var sb=this.scroller.dom;return {left:sb.scrollLeft,top:sb.scrollTop};},stripeRows:function(A){if(!this.grid.stripeRows||this.ds.getCount()<1){return;
-}A=A||0;var B=this.getBodyTable().rows;var C=this.getLockedTable().rows;var D=' x-grid-row-alt ';for(var i=A,E=B.length;i<E;i++){var F=B[i],G=C[i];var H=((i+1)%2==0);var I=(' '+F.className+' ').indexOf(D)!=-1;if(H==I){continue;}if(H){F.className+=" x-grid-row-alt";
-}else{F.className=F.className.replace("x-grid-row-alt","");}if(G){G.className=F.className;}}},restoreScroll:function(A){var sb=this.scroller.dom;sb.scrollLeft=A.left;sb.scrollTop=A.top;this.syncScroll();},syncScroll:function(){var sb=this.scroller.dom;var sh=this.mainHd.dom;
-var bs=this.mainBody.dom;var lv=this.lockedBody.dom;sh.scrollLeft=bs.scrollLeft=sb.scrollLeft;lv.scrollTop=bs.scrollTop=sb.scrollTop;},handleScroll:function(e){this.syncScroll();var sb=this.scroller.dom;this.grid.fireEvent("bodyscroll",sb.scrollLeft,sb.scrollTop);
-e.stopEvent();},handleWheel:function(e){var d=e.getWheelDelta();this.scroller.dom.scrollTop-=d*22;this.lockedBody.dom.scrollTop=this.mainBody.dom.scrollTop=this.scroller.dom.scrollTop;e.stopEvent();},renderRows:function(A,B){var g=this.grid,cm=g.colModel,ds=g.dataSource,C=g.stripeRows;
-var D=cm.getColumnCount();if(ds.getCount()<1){return ["",""];}var cs=[];for(var i=0;i<D;i++){var E=cm.getDataIndex(i);cs[i]={name:typeof E=='undefined'?ds.fields.get(i).name:E,renderer:cm.getRenderer(i),id:cm.getColumnId(i),locked:cm.isLocked(i),has_editor:cm.isCellEditable(i)}
+p.value=cm.getColumnHeader(i)||"";p.title=cm.getColumnTooltip(i)||(''+p.value).match(/\</)?'':p.value||"";p.style=(this.grid.enableColumnResize===false||!cm.isResizable(i)||cm.isFixed(i))?'cursor:default':'';if(!cm.isLocked(i)){cb[cb.length]=ct.apply(p);sb[sb.length]=st.apply(p);
+}else{lb[lb.length]=ct.apply(p);A[A.length]=st.apply(p);}}return [ht.apply({cells:lb.join(""),splits:A.join("")}),ht.apply({cells:cb.join(""),splits:sb.join("")})];},updateHeaders:function(){var A=this.renderHeaders();this.lockedHd.update(A[0]);this.mainHd.update(A[1]);
+},focusRow:function(A){var x=this.scroller.dom.scrollLeft;this.focusCell(A,0,false);this.scroller.dom.scrollLeft=x;},focusCell:function(A,B,C){var el=this.ensureVisible(A,B,C);this.focusEl.alignTo(el,"tl-tl");if(Roo.isGecko){this.focusEl.focus();}else{this.focusEl.focus.defer(1,this.focusEl);
+}},ensureVisible:function(A,B,C){if(typeof A!="number"){A=A.rowIndex;}if(A<0&&A>=this.ds.getCount()){return null;}B=(B!==undefined?B:0);var cm=this.grid.colModel;while(cm.isHidden(B)){B++;}var el=this.getCell(A,B);if(!el){return null;}var c=this.scroller.dom;
+var D=parseInt(el.offsetTop,10);var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;var ch=c.clientHeight-this.mainHd.dom.offsetHeight;var H=parseInt(c.scrollTop,10);var I=parseInt(c.scrollLeft,10);var J=H+ch;var K=I+c.clientWidth;
+if(D<H){c.scrollTop=D;}else if(F>J){c.scrollTop=F-ch;}if(C!==false){if(E<I){c.scrollLeft=E;}else if(G>K){c.scrollLeft=G-c.clientWidth;}}return el;},updateColumns:function(){this.grid.stopEditing();var cm=this.grid.colModel,A=this.getColumnIds();var B=0;for(var i=0,C=cm.getColumnCount();
+i<C;i++){var w=cm.getColumnWidth(i);this.css.updateRule(this.colSelector+this.idToCssName(A[i]),"width",(w-this.borderWidth)+"px");this.css.updateRule(this.hdSelector+this.idToCssName(A[i]),"width",(w-this.borderWidth)+"px");}this.updateSplitters();},generateRules:function(cm){var A=[],B=this.idToCssName(this.grid.id)+'-cssrules';
+Roo.util.CSS.removeStyleSheet(B);for(var i=0,C=cm.getColumnCount();i<C;i++){var D=cm.getColumnId(i);var E='';if(cm.config[i].align){E='text-align:'+cm.config[i].align+';';}var F='';if(cm.isHidden(i)){F='display:none;';}var G="width:"+(cm.getColumnWidth(i)-this.borderWidth)+"px;";
+A.push(this.colSelector,D," {\n",cm.config[i].css,E,G,"\n}\n",this.hdSelector,D," {\n",E,G,"}\n",this.tdSelector,D," {\n",F,"\n}\n",this.splitSelector,D," {\n",F,"\n}\n");}return Roo.util.CSS.createStyleSheet(A.join(""),B);},updateSplitters:function(){var cm=this.cm,s=this.getSplitters();
+if(s){var A=0,B=true;for(var i=0,C=cm.getColumnCount();i<C;i++){if(cm.isHidden(i)){continue;}var w=cm.getColumnWidth(i);if(!cm.isLocked(i)&&B){A=0;B=false;}A+=w;s[i].style.left=(A-this.splitOffset)+"px";}}},handleHiddenChange:function(A,B,C){if(C){this.hideColumn(B);
+}else{this.unhideColumn(B);}},hideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+this.idToCssName(B),"display","none");this.css.updateRule(this.splitSelector+this.idToCssName(B),"display","none");if(Roo.isSafari){this.updateHeaders();
+}this.updateSplitters();this.layout();},unhideColumn:function(A){var B=this.getColumnId(A);this.css.updateRule(this.tdSelector+this.idToCssName(B),"display","");this.css.updateRule(this.splitSelector+this.idToCssName(B),"display","");if(Roo.isSafari){this.updateHeaders();
+}this.updateSplitters();this.layout();},insertRows:function(dm,A,B,C){if(A==0&&B==dm.getCount()-1){this.refresh();}else{if(!C){this.fireEvent("beforerowsinserted",this,A,B);}var s=this.getScrollState();var D=this.renderRows(A,B);this.bufferRows(D[0],this.getLockedTable(),A);
+this.bufferRows(D[1],this.getBodyTable(),A);this.restoreScroll(s);if(!C){this.fireEvent("rowsinserted",this,A,B);this.syncRowHeights(A,B);this.stripeRows(A);this.layout();}}},bufferRows:function(A,B,C){var D=null,E=B.rows,F=B.tBodies[0];if(C<E.length){D=E[C];
+}var b=document.createElement("div");b.innerHTML="<table><tbody>"+A+"</tbody></table>";var G=b.firstChild.rows;for(var i=0,H=G.length;i<H;i++){if(D){F.insertBefore(G[0],D);}else{F.appendChild(G[0]);}}b.innerHTML="";b=null;},deleteRows:function(dm,A,B){if(dm.getRowCount()<1){this.fireEvent("beforerefresh",this);
+this.mainBody.update("");this.lockedBody.update("");this.fireEvent("refresh",this);}else{this.fireEvent("beforerowsdeleted",this,A,B);var bt=this.getBodyTable();var C=bt.firstChild;var D=bt.rows;for(var E=A;E<=B;E++){C.removeChild(D[A]);}this.stripeRows(A);
+this.fireEvent("rowsdeleted",this,A,B);}},updateRows:function(A,B,C){var s=this.getScrollState();this.refresh();this.restoreScroll(s);},handleSort:function(A,B,C,D){if(!D){this.refresh();}this.updateHeaderSortState();},getScrollState:function(){var sb=this.scroller.dom;
+return {left:sb.scrollLeft,top:sb.scrollTop};},stripeRows:function(A){if(!this.grid.stripeRows||this.ds.getCount()<1){return;}A=A||0;var B=this.getBodyTable().rows;var C=this.getLockedTable().rows;var D=' x-grid-row-alt ';for(var i=A,E=B.length;i<E;i++){var F=B[i],G=C[i];
+var H=((i+1)%2==0);var I=(' '+F.className+' ').indexOf(D)!=-1;if(H==I){continue;}if(H){F.className+=" x-grid-row-alt";}else{F.className=F.className.replace("x-grid-row-alt","");}if(G){G.className=F.className;}}},restoreScroll:function(A){var sb=this.scroller.dom;
+sb.scrollLeft=A.left;sb.scrollTop=A.top;this.syncScroll();},syncScroll:function(){var sb=this.scroller.dom;var sh=this.mainHd.dom;var bs=this.mainBody.dom;var lv=this.lockedBody.dom;sh.scrollLeft=bs.scrollLeft=sb.scrollLeft;lv.scrollTop=bs.scrollTop=sb.scrollTop;
+},handleScroll:function(e){this.syncScroll();var sb=this.scroller.dom;this.grid.fireEvent("bodyscroll",sb.scrollLeft,sb.scrollTop);e.stopEvent();},handleWheel:function(e){var d=e.getWheelDelta();this.scroller.dom.scrollTop-=d*22;this.lockedBody.dom.scrollTop=this.mainBody.dom.scrollTop=this.scroller.dom.scrollTop;
+e.stopEvent();},renderRows:function(A,B){var g=this.grid,cm=g.colModel,ds=g.dataSource,C=g.stripeRows;var D=cm.getColumnCount();if(ds.getCount()<1){return ["",""];}var cs=[];for(var i=0;i<D;i++){var E=cm.getDataIndex(i);cs[i]={name:typeof E=='undefined'?ds.fields.get(i).name:E,renderer:cm.getRenderer(i),id:cm.getColumnId(i),locked:cm.isLocked(i),has_editor:cm.isCellEditable(i)}
 ;}A=A||0;B=typeof B=="undefined"?ds.getCount()-1:B;var rs=ds.getRange(A,B);return this.doRender(cs,rs,ds,A,D,C);},doRender:Roo.isGecko?function(cs,rs,ds,A,B,C){var ts=this.templates,ct=ts.cell,rt=ts.row;var D="",E="",cb,F,c,p={},rp={},r,G;var H=this.grid.hasListener('rowclass');
 var I={};for(var j=0,J=rs.length;j<J;j++){r=rs[j];cb="";F="";G=(j+A);for(var i=0;i<B;i++){c=cs[i];p.cellId="x-grid-cell-"+G+"-"+i;p.id=c.id;p.css=p.attr="";p.value=c.renderer(r.data[c.name],p,r,G,i,ds);if(p.value==undefined||p.value===""){p.value="&#160;";
 }if(c.has_editor){p.css+=' x-grid-editable-cell';}if(c.dirty&&typeof r.modified[c.name]!=='undefined'){p.css+=' x-grid-dirty-cell';}var K=ct.apply(p);if(!c.locked){cb+=K;}else{F+=K;}}var L=[];if(C&&((G+1)%2==0)){L.push("x-grid-row-alt")}if(r.dirty){L.push(" x-grid-dirty-row");
@@ -2315,11 +2437,11 @@ this.updateSplitters();this.layout();this.grid.fireEvent("columnresize",i,w);},s
 B=Math.min(B||E,E);for(var i=A;i<=B;i++){var m=C[i],l=D[i];var h=Math.max(m.offsetHeight,l.offsetHeight);m.style.height=l.style.height=h+"px";}}},layout:function(A,B){var g=this.grid;var C=g.autoHeight;var D=16;var c=g.getGridEl(),cm=this.cm,E=g.autoExpandColumn,gv=this;
 if(!c.dom.offsetWidth){if(A){this.lockedWrap.show();this.mainWrap.show();}return;}var F=this.cm.isLocked(0);var G=this.headerPanel.getHeight();var H=this.footerPanel.getHeight();if(C){var ch=this.getBodyTable().offsetHeight+G+H+this.mainHd.getHeight();var I=ch+c.getBorderWidth("tb");
 if(g.maxHeight){I=Math.min(g.maxHeight,I);}c.setHeight(I);}if(g.autoWidth){c.setWidth(cm.getTotalWidth()+c.getBorderWidth('lr'));}var s=this.scroller;var J=c.getSize(true);this.el.setSize(J.width,J.height);this.headerPanel.setWidth(J.width);this.footerPanel.setWidth(J.width);
-var K=this.mainHd.getHeight();var vw=J.width;var vh=J.height-(G+H);s.setSize(vw,vh);var bt=this.getBodyTable();var L=F?Math.max(this.getLockedTable().offsetWidth,this.lockedHd.dom.firstChild.offsetWidth):0;var M=bt.offsetHeight;var N=L+bt.offsetWidth;var O=false,P=false;
-this.scrollSizer.setSize(N,M+K);var lw=this.lockedWrap,mw=this.mainWrap;var lb=this.lockedBody,mb=this.mainBody;setTimeout(function(){var t=s.dom.offsetTop;var w=s.dom.clientWidth,h=s.dom.clientHeight;lw.setTop(t);lw.setSize(L,h);mw.setLeftTop(L,t);mw.setSize(w-L,h);
-lb.setHeight(h-K);mb.setHeight(h-K);if(B!==true&&!gv.userResized&&E){var ci=cm.getIndexById(E);if(ci<0){ci=cm.findColumnIndex(E);}ci=Math.max(0,ci);var Q=cm.getColumnId(ci);var tw=cm.getTotalWidth(false);var R=cm.getColumnWidth(ci);var cw=Math.min(Math.max(((w-tw)+R-2)-(w<=s.dom.offsetWidth?0:18),g.autoExpandMin),g.autoExpandMax);
-if(R!=cw){cm.setColumnWidth(ci,cw,true);gv.css.updateRule(gv.colSelector+gv.idToCssName(Q),"width",(cw-gv.borderWidth)+"px");gv.css.updateRule(gv.hdSelector+gv.idToCssName(Q),"width",(cw-gv.borderWidth)+"px");gv.updateSplitters();gv.layout(false,true);}}if(A){lw.show();
-mw.show();}},10);},onWindowResize:function(){if(!this.grid.monitorWindowResize||this.grid.autoHeight){return;}this.layout();},appendFooter:function(A){return null;},sortAscText:"Sort Ascending",sortDescText:"Sort Descending",lockText:"Lock Column",unlockText:"Unlock Column",columnsText:"Columns",columnsWiderText:"Wider",columnsNarrowText:"Thinner"}
+var K=this.mainHd.getHeight();var vw=J.width;var vh=J.height-(G+H);s.setSize(vw,vh);var bt=this.getBodyTable();if(cm.getLockedCount()==cm.config.length){bt=this.getLockedTable();}var L=F?Math.max(this.getLockedTable().offsetWidth,this.lockedHd.dom.firstChild.offsetWidth):0;
+var M=bt.offsetHeight;var N=L+bt.offsetWidth;var O=false,P=false;this.scrollSizer.setSize(N,M+K);var lw=this.lockedWrap,mw=this.mainWrap;var lb=this.lockedBody,mb=this.mainBody;setTimeout(function(){var t=s.dom.offsetTop;var w=s.dom.clientWidth,h=s.dom.clientHeight;
+lw.setTop(t);lw.setSize(L,h);mw.setLeftTop(L,t);mw.setSize(w-L,h);lb.setHeight(h-K);mb.setHeight(h-K);if(B!==true&&!gv.userResized&&E){var ci=cm.getIndexById(E);if(ci<0){ci=cm.findColumnIndex(E);}ci=Math.max(0,ci);var Q=cm.getColumnId(ci);var tw=cm.getTotalWidth(false);
+var R=cm.getColumnWidth(ci);var cw=Math.min(Math.max(((w-tw)+R-2)-(w<=s.dom.offsetWidth?0:18),g.autoExpandMin),g.autoExpandMax);if(R!=cw){cm.setColumnWidth(ci,cw,true);gv.css.updateRule(gv.colSelector+gv.idToCssName(Q),"width",(cw-gv.borderWidth)+"px");gv.css.updateRule(gv.hdSelector+gv.idToCssName(Q),"width",(cw-gv.borderWidth)+"px");
+gv.updateSplitters();gv.layout(false,true);}}if(A){lw.show();mw.show();}},10);},onWindowResize:function(){if(!this.grid.monitorWindowResize||this.grid.autoHeight){return;}this.layout();},appendFooter:function(A){return null;},sortAscText:"Sort Ascending",sortDescText:"Sort Descending",lockText:"Lock Column",unlockText:"Unlock Column",columnsText:"Columns",columnsWiderText:"Wider",columnsNarrowText:"Thinner"}
 );Roo.grid.GridView.ColumnDragZone=function(A,hd){Roo.grid.GridView.ColumnDragZone.superclass.constructor.call(this,A,hd,null);this.proxy.el.addClass('x-grid3-col-dd');};Roo.extend(Roo.grid.GridView.ColumnDragZone,Roo.grid.HeaderDragZone,{handleMouseDown:function(e){}
 ,callHandleMouseDown:function(e){Roo.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,e);}});
 // Roo/grid/SplitDragZone.js
@@ -2342,15 +2464,15 @@ Roo.grid.ColumnModel=function(A){this.config=A;this.lookup={};for(var i=0,B=A.le
 return B>-1?this.config[B]:false;},getIndexById:function(id){for(var i=0,A=this.config.length;i<A;i++){if(this.config[i].id==id){return i;}}return -1;},findColumnIndex:function(A){for(var i=0,B=this.config.length;i<B;i++){if(this.config[i].dataIndex==A){return i;
 }}return -1;},moveColumn:function(A,B){var c=this.config[A];this.config.splice(A,1);this.config.splice(B,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,A,B);},isLocked:function(A){return this.config[A].locked===true;},setLocked:function(A,B,C){if(this.isLocked(A)==B){return;
 }this.config[A].locked=B;if(!C){this.fireEvent("columnlockchange",this,A,B);}},getTotalLockedWidth:function(){var A=0;for(var i=0;i<this.config.length;i++){if(this.isLocked(i)&&!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}return A;},getLockedCount:function(){for(var i=0,A=this.config.length;
-i<A;i++){if(!this.isLocked(i)){return i;}}},getColumnCount:function(A){if(A===true){var c=0;for(var i=0,B=this.config.length;i<B;i++){if(!this.isHidden(i)){c++;}}return c;}return this.config.length;},getColumnsBy:function(fn,A){var r=[];for(var i=0,B=this.config.length;
-i<B;i++){var c=this.config[i];if(fn.call(A||this,c,i)===true){r[r.length]=c;}}return r;},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable;}return this.config[A].sortable;},getRenderer:function(A){if(!this.config[A].renderer){return Roo.grid.ColumnModel.defaultRenderer;
+i<A;i++){if(!this.isLocked(i)){return i;}}return this.config.length;},getColumnCount:function(A){if(A===true){var c=0;for(var i=0,B=this.config.length;i<B;i++){if(!this.isHidden(i)){c++;}}return c;}return this.config.length;},getColumnsBy:function(fn,A){var r=[];
+for(var i=0,B=this.config.length;i<B;i++){var c=this.config[i];if(fn.call(A||this,c,i)===true){r[r.length]=c;}}return r;},isSortable:function(A){if(typeof this.config[A].sortable=="undefined"){return this.defaultSortable;}return this.config[A].sortable;},getRenderer:function(A){if(!this.config[A].renderer){return Roo.grid.ColumnModel.defaultRenderer;
 }return this.config[A].renderer;},setRenderer:function(A,fn){this.config[A].renderer=fn;},getColumnWidth:function(A){return this.config[A].width*1||this.defaultWidth;},setColumnWidth:function(A,B,C){this.config[A].width=B;this.totalWidth=null;if(!C){this.fireEvent("widthchange",this,A,B);
 }},getTotalWidth:function(A){if(!this.totalWidth){this.totalWidth=0;for(var i=0,B=this.config.length;i<B;i++){if(A||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i);}}}return this.totalWidth;},getColumnHeader:function(A){return this.config[A].header;
 },setColumnHeader:function(A,B){this.config[A].header=B;this.fireEvent("headerchange",this,A,B);},getColumnTooltip:function(A){return this.config[A].tooltip;},setColumnTooltip:function(A,B){this.config[A].tooltip=B;},getDataIndex:function(A){return this.config[A].dataIndex;
 },setDataIndex:function(A,B){this.config[A].dataIndex=B;},isCellEditable:function(A,B){return (this.config[A].editable||(typeof this.config[A].editable=="undefined"&&this.config[A].editor))?true:false;},getCellEditor:function(A,B){return this.config[A].editor;
 },setEditable:function(A,B){this.config[A].editable=B;},isHidden:function(A){return this.config[A].hidden;},isFixed:function(A){return this.config[A].fixed;},isResizable:function(A){return A>=0&&this.config[A].resizable!==false&&this.config[A].fixed!==true;
-},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="string"&&A.length<1){return "&#160;";
-}return A;};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
+},setHidden:function(A,B){this.config[A].hidden=B;this.totalWidth=null;this.fireEvent("hiddenchange",this,A,B);},setEditor:function(A,B){this.config[A].editor=B;}});Roo.grid.ColumnModel.defaultRenderer=function(A){if(typeof A=="object"){return A;}if(typeof A=="string"&&A.length<1){return "&#160;";
+}return String.format("{0}",A);};Roo.grid.DefaultColumnModel=Roo.grid.ColumnModel;
 // Roo/grid/AbstractSelectionModel.js
 Roo.grid.AbstractSelectionModel=function(){this.locked=false;Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.AbstractSelectionModel,Roo.util.Observable,{init:function(A){this.grid=A;this.initEvents();},lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isLocked:function(){return this.locked;}});
@@ -2454,9 +2576,9 @@ Roo.log(d);return;}A.start_dt=typeof(A.start_dt)=='string'?Date.parseDate(A.star
 // Roo/LoadMask.js
 Roo.LoadMask=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.store){this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);this.removeMask=false;}else{var um=this.el.getUpdateManager();
 um.showLoadIndicator=false;um.on('beforeupdate',this.onBeforeLoad,this);um.on('update',this.onLoad,this);um.on('failure',this.onLoad,this);this.removeMask=true;}};Roo.LoadMask.prototype={msg:'Loading...',msgCls:'x-mask-loading',disabled:false,disable:function(){this.disabled=true;
-},enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}this.el.unmask(this.removeMask);},onLoad:function(){this.el.unmask(this.removeMask);
-},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);
-}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
+},enable:function(){this.disabled=false;},onLoadException:function(){Roo.log(arguments);if(typeof(arguments[3])!='undefined'){Roo.MessageBox.alert("Error loading",arguments[3]);}(function(){this.el.unmask(this.removeMask);}).defer(50,this);},onLoad:function(){(function(){this.el.unmask(this.removeMask);
+}).defer(50,this);},onBeforeLoad:function(){if(!this.disabled){(function(){this.el.mask(this.msg,this.msgCls);}).defer(50,this);}},destroy:function(){if(this.store){this.store.un('beforeload',this.onBeforeLoad,this);this.store.un('load',this.onLoad,this);
+this.store.un('loadexception',this.onLoadException,this);}else{var um=this.el.getUpdateManager();um.un('beforeupdate',this.onBeforeLoad,this);um.un('update',this.onLoad,this);um.un('failure',this.onLoad,this);}}};
 // Roo/XTemplate.js
 Roo.XTemplate=function(){Roo.XTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.XTemplate,Roo.Template,{tpls:false,re:/\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var s=this.html;s=['<tpl>',s,'</tpl>'].join('');
 var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,A=/^<tpl\b[^>]*?for="(.*?)"/,B=/^<tpl\b[^>]*?if="(.*?)"/,C=/^<tpl\b[^>]*?exec="(.*?)"/,D=/^<tpl\b[^>]*?name="(\w+)"/,m,id=0,E=[];while(true==!!(m=s.match(re))){var F=m[0].match(A),G=m[0].match(B),H=m[0].match(C),I=m[0].match(D),J=null,fn=null,K=null,L=F&&F[1]?F[1]:'';