Roo/Template.js
[roojs1] / roojs-core.js
index 422366c..e23c6c4 100644 (file)
@@ -1,17 +1,18 @@
 window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var B=0;var ua=navigator.userAgent.toLowerCase();var C=document.compatMode=="CSS1Compat",D=ua.indexOf("opera")>-1,E=(/webkit|khtml/).test(ua),F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=!E&&ua.indexOf("gecko")>-1,I=F&&!C,J=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),K=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),L=(ua.indexOf("linux")!=-1),M=window.location.href.toLowerCase().indexOf("https")===0;if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}
-Roo.apply(Roo,{isStrict:C,isSecure:M,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var N={};for(var b in o){var parts=b.split('@');if(parts[1]){var s=parts[0];if(!N[s]){N[s]=Roo.select(s);}
+Roo.apply(Roo,{isStrict:C,isSecure:M,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 N={};for(var b in o){var parts=b.split('@');if(parts[1]){var s=parts[0];if(!N[s]){N[s]=Roo.select(s);}
 N[s].on(parts[1],o[b]);}}
 N=null;},id:function(el,O){O=O||"roo-gen";el=Roo.getDom(el);var id=O+(++B);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,P){if(typeof sp=='object'){P=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;}
 sb.override=function(o){Roo.override(sb,o);};sbp.override=io;Roo.override(sb,P);return sb;};}(),override:function(P,Q){if(Q){var p=P.prototype;for(var method in Q){p[method]=Q[method];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},factory:function(c,ns){if(!c.xtype||(!ns&&!c.xns)||(c.xns===false)){return c;}
-ns=c.xns?c.xns:ns;if(c.constructor==ns[c.xtype]){return c;}if(ns[c.xtype]){if(Roo.debug)console.log("Roo.Factory("+c.xtype+")");var ret=new ns[c.xtype](c);ret.xns=false;return ret;}
-c.xns=false;return c;},urlEncode:function(o){if(!o){return "";}var R=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=='undefined'){R.push(k,"=&");}else if(type!="function"&&type!="object"){R.push(k,"=",encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,len=ov.length;i<len;i++){R.push(k,"=",encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {R.push(k,"=&");}}}
+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 ret=new ns[c.xtype](c);ret.xns=false;return ret;}
+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 R=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=='undefined'){R.push(k,"=&");}else if(type!="function"&&type!="object"){R.push(k,"=",encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,len=ov.length;i<len;i++){R.push(k,"=",encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");}}else {R.push(k,"=&");}}}
 R.pop();return R.join("");},urlDecode:function(S,T){if(!S||!S.length){return {};}var U={};var V=S.split('&');var W,X,Y;for(var i=0,len=V.length;i<len;i++){W=V[i].split('=');X=decodeURIComponent(W[0]);Y=decodeURIComponent(W[1]);if(T!==true){if(typeof U[X]=="undefined"){U[X]=Y;}else if(typeof U[X]=="string"){U[X]=[U[X]];U[X].push(Y);}else {U[X].push(Y);}}else {U[X]=Y;}}return U;},each:function(Z,fn,f){if(typeof Z.length=="undefined"||typeof Z=="string"){Z=[Z];}for(var i=0,len=Z.length;i<len;i++){if(fn.call(f||Z[i],Z[i],i,Z)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else {r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,g,h,n){if(typeof cb=="function"){if(n){cb.defer(n,g,h||[]);}else {cb.apply(g,h||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,q){if(typeof v!='number'){return q;}return v;},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=='function'){as.purgeListeners();}if(typeof as.destroy=='function'){as.destroy();}}}},type:function(o){if(o===undefined||o===null){return false;}if(o.htmlElement){return 'element';}var t=typeof o;if(t=='object'&&o.nodeName){switch(o.nodeType){case 1:return 'element';case 3:return (/\S/).test(o.nodeValue)?'textnode':'whitespace';}}if(t=='object'||t=='function'){switch(o.constructor){case Array:return 'array';case RegExp:return 'regexp';}if(typeof o.length=='number'&&typeof o.item=='function'){return 'nodelist';}}return t;},isEmpty:function(v,u){return v===null||v===undefined||(!u?v==='':false);},isOpera:D,isSafari:E,isIE:F,isIE7:G,isGecko:H,isBorderBox:I,isWindows:J,isLinux:L,isMac:K,useShims:((F&&!G)||(H&&K))});})();Roo.namespace("Roo","Roo.util","Roo.grid","Roo.dd","Roo.tree","Roo.data","Roo.form","Roo.menu","Roo.state","Roo.lib","Roo.layout","Roo.app","Roo.ux");
 (function(){if(Roo.isIE){function A(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",A);}
 window.attachEvent("onunload",A);}})();Roo.apply(Function.prototype,{createCallback:function(){var B=arguments;var C=this;return function(){return C.apply(window,B);};},createDelegate:function(D,E,F){var G=this;return function(){var H=E||arguments;if(F===true){H=Array.prototype.slice.call(arguments,0);H=H.concat(E);}else if(typeof F=="number"){H=Array.prototype.slice.call(arguments,0);var applyArgs=[F,0].concat(E);Array.prototype.splice.apply(H,applyArgs);}return G.apply(D||window,H);};},defer:function(H,I,J,K){var fn=this.createDelegate(I,J,K);if(H){return setTimeout(fn,H);}
 fn();return 0;},createSequence:function(L,M){if(typeof L!="function"){return this;}var N=this;return function(){var O=N.apply(this||window,arguments);L.apply(M||this||window,arguments);return O;};},createInterceptor:function(O,P){if(typeof O!="function"){return this;}var Q=this;return function(){O.target=this;O.method=Q;if(O.apply(P||this||window,arguments)===false){return;}return Q.apply(this||window,arguments);};}});
 Roo.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1");},leftPad:function(B,C,ch){var D=new String(B);if(ch===null||ch===undefined||ch===''){ch=" ";}while(D.length<C){D=ch+D;}return D;},format:function(E){var F=Array.prototype.slice.call(arguments,1);return E.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(F[i]);});}});String.prototype.toggle=function(G,H){return this==G?H:G;};
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
-Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}}});
+Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(B){var C=this.length>>>0;if(typeof B!="function")throw new TypeError();var D=new Array(C);var E=arguments[1];for(var i=0;i<C;i++){if(i in this)D[i]=B.call(E,this[i],i,this);}return D;}});
 Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(B){if(Date.formatFunctions[B]==null){Date.createNewFormat(B);}var C=Date.formatFunctions[B];return this[C]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(D){var E="format"+Date.formatFunctions.count++;Date.formatFunctions[D]=E;var F="Date.prototype."+E+" = function(){return ";var G=false;var ch='';for(var i=0;i<D.length;++i){ch=D.charAt(i);if(!G&&ch=="\\"){G=true;}else if(G){G=false;F+="'"+String.escape(ch)+"' + ";}else {F+=Date.getFormatCode(ch);}}eval(F.substring(0,F.length-3)+";}");};Date.getFormatCode=function(H){switch(H){case "d":return "String.leftPad(this.getDate(), 2, '0') + ";case "D":return "Date.dayNames[this.getDay()].substring(0, 3) + ";case "j":return "this.getDate() + ";case "l":return "Date.dayNames[this.getDay()] + ";case "S":return "this.getSuffix() + ";case "w":return "this.getDay() + ";case "z":return "this.getDayOfYear() + ";case "W":return "this.getWeekOfYear() + ";case "F":return "Date.monthNames[this.getMonth()] + ";case "m":return "String.leftPad(this.getMonth() + 1, 2, '0') + ";case "M":return "Date.monthNames[this.getMonth()].substring(0, 3) + ";case "n":return "(this.getMonth() + 1) + ";case "t":return "this.getDaysInMonth() + ";case "L":return "(this.isLeapYear() ? 1 : 0) + ";case "Y":return "this.getFullYear() + ";case "y":return "('' + this.getFullYear()).substring(2, 4) + ";case "a":return "(this.getHours() < 12 ? 'am' : 'pm') + ";case "A":return "(this.getHours() < 12 ? 'AM' : 'PM') + ";case "g":return "((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";case "G":return "this.getHours() + ";case "h":return "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";case "H":return "String.leftPad(this.getHours(), 2, '0') + ";case "i":return "String.leftPad(this.getMinutes(), 2, '0') + ";case "s":return "String.leftPad(this.getSeconds(), 2, '0') + ";case "O":return "this.getGMTOffset() + ";case "T":return "this.getTimezone() + ";case "Z":return "(this.getTimezoneOffset() * -60) + ";default:return "'"+String.escape(H)+"' + ";}};Date.parseDate=function(I,J){if(Date.parseFunctions[J]==null){Date.createParser(J);}var K=Date.parseFunctions[J];return Date[K](I);};Date.createParser=function(L){var M="parse"+Date.parseFunctions.count++;var N=Date.parseRegexes.length;var O=1;Date.parseFunctions[L]=M;var P="Date."+M+" = function(input){\n"+"var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"+"var d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"var results = input.match(Date.parseRegexes["+N+"]);\n"+"if (results && results.length > 0) {";var Q="";var R=false;var ch='';for(var i=0;i<L.length;++i){ch=L.charAt(i);if(!R&&ch=="\\"){R=true;}else if(R){R=false;Q+=String.escape(ch);}else {var obj=Date.formatCodeToRegex(ch,O);O+=obj.g;Q+=obj.s;if(obj.g&&obj.c){P+=obj.c;}}}
 P+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"+"{v = new Date(y, m, d, h, i, s);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m);}\n"+"else if (y >= 0)\n"+"{v = new Date(y);}\n"+"}return (v && (z || o))?\n"+"    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+"        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";Date.parseRegexes[N]=new RegExp("^"+Q+"$");eval(P);};Date.formatCodeToRegex=function(S,T){switch(S){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "l":return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case "S":return {g:0,c:null,s:"(?:st|nd|rd|th)"};case "w":return {g:0,c:null,s:"\\d"};case "z":return {g:0,c:null,s:"(?:\\d{1,3})"};case "W":return {g:0,c:null,s:"(?:\\d{2})"};case "F":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+T+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+T+"], 10) - 1;\n",s:"(\\d{2})"};case "t":return {g:0,c:null,s:"\\d{1,2}"};case "L":return {g:0,c:null,s:"(?:1|0)"};case "Y":return {g:1,c:"y = parseInt(results["+T+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+T+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case "a":return {g:1,c:"if (results["+T+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case "A":return {g:1,c:"if (results["+T+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case "g":case "G":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+T+"], 10);\n",s:"(\\d{2})"};case "O":return {g:1,c:["o = results[",T,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n","    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+\-]\\d{4})"};case "T":return {g:0,c:null,s:"[A-Z]{1,4}"};case "Z":return {g:1,c:"z = results["+T+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+\-]?\\d{1,5})"};default:return {g:0,c:null,s:String.escape(S)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1");};Date.prototype.getGMTOffset=function(){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+String.leftPad(this.getTimezoneOffset()%60,2,"0");};Date.prototype.getDayOfYear=function(){var U=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i<this.getMonth();++i){U+=Date.daysInMonth[i];}return U+this.getDate()-1;};Date.prototype.getWeekOfYear=function(){var V=this.getDayOfYear()+(4-this.getDay());var W=new Date(this.getFullYear(),0,1);var X=(7-W.getDay()+4);return String.leftPad(((V-X)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var Y=this.getFullYear();return ((Y&3)==0&&(Y%100||(Y%400==0&&Y)));};Date.prototype.getFirstDayOfMonth=function(){var Z=(this.getDay()-(this.getDate()-1))%7;return (Z<0)?(Z+7):Z;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return (a<0)?(a+7):a;};Date.prototype.getFirstDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),1);};Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth());};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()];};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return "st";case 2:case 22:return "nd";case 3:case 23:return "rd";default:return "th";}};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.clearTime=function(b){if(b){return this.clone().clearTime();}
 this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(c){if(c<=-1){var n=Math.ceil(-c);var back_year=Math.ceil(n/12);var month=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-back_year);return Date.brokenSetMonth.call(this,month);}else {return Date.brokenSetMonth.apply(this,arguments);}};}
@@ -91,8 +92,8 @@ P=G(2,ts,O,te);}
 el.insertBefore(P,Q);return P;};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,c){if(c){el=Roo.fly(el);if(typeof c=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var matches;while((matches=re.exec(c))!=null){el.setStyle(matches[1],matches[2]);}}else if(typeof c=="object"){for(var style in c){el.setStyle(style,c[style]);}}else if(typeof c=="function"){Roo.DomHelper.applyStyles(el,c.call());}}},insertHtml:function(d,el,e){d=d.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),d,el,e)){return rs;}}switch(d){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',e);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',e);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',e);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',e);return el.nextSibling;}throw 'Illegal insertion point -> "'+d+'"';}var f=el.ownerDocument.createRange();var g;switch(d){case "beforebegin":f.setStartBefore(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el);return el.previousSibling;case "afterbegin":if(el.firstChild){f.setStartBefore(el.firstChild);g=f.createContextualFragment(e);el.insertBefore(g,el.firstChild);return el.firstChild;}else {el.innerHTML=e;return el.firstChild;}case "beforeend":if(el.lastChild){f.setStartAfter(el.lastChild);g=f.createContextualFragment(e);el.appendChild(g);return el.lastChild;}else {el.innerHTML=e;return el.lastChild;}case "afterend":f.setStartAfter(el);g=f.createContextualFragment(e);el.parentNode.insertBefore(g,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+d+'"';},insertBefore:function(el,o,h){return this.doInsert(el,o,h,"beforeBegin");},insertAfter:function(el,o,j){return this.doInsert(el,o,j,"afterEnd","nextSibling");},insertFirst:function(el,o,k){return this.doInsert(el,o,k,"afterBegin");},doInsert:function(el,o,l,m,n){el=Roo.getDom(el);var p;if(this.useDom||o.ns){p=F(o,null);el.parentNode.insertBefore(p,n?el[n]:el);}else {var e=E(o);p=this.insertHtml(m,el,e);}return l?Roo.get(p,true):p;},append:function(el,o,q){el=Roo.getDom(el);var r;if(this.useDom||o.ns){r=F(o,null);el.appendChild(r);}else {var e=E(o);r=this.insertHtml("beforeEnd",el,e);}return q?Roo.get(r,true):r;},overwrite:function(el,o,t){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}
 F(o,el);}else {el.innerHTML=E(o);}return t?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var u=E(o);return new Roo.Template(u);}};}();
 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}
-this.html=A;};Roo.Template.prototype={applyTemplate:function(values){if(this.compiled){return this.compiled(values);}var B=this.disableFormats!==true;var fm=Roo.util.Format,C=this;var fn=function(m,D,E,F){if(E&&B){if(E.substr(0,5)=="this."){return C.call(E.substr(5),values[D],values);}else {if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,len=F.length;i<len;i++){F[i]=F[i].replace(re,"$1");}
-F=[values[D]].concat(F);}else {F=[values[D]];}return fm[E].apply(fm,F);}}else {return values[D]!==undefined?values[D]:"";}};return this.html.replace(this.re,fn);},set:function(D,E){this.html=D;this.compiled=null;if(E){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var F=this.disableFormats!==true;var G=Roo.isGecko?"+":",";var fn=function(m,I,J,K){if(J&&F){K=K?','+K:"";if(J.substr(0,5)!="this."){J="fm."+J+'(';}else {J='this.call("'+J.substr(5)+'", ';K=", values";}}else {K='';J="(values['"+I+"'] == undefined ? '' : ";}return "'"+G+J+"values['"+I+"']"+K+")"+G+"'";};var H;if(Roo.isGecko){H="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {H=["this.compiled = function(values){ return ['"];H.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));H.push("'].join('');};");H=H.join('');}eval(H);return this;},call:function(I,J,K){return this[I](J,K);},insertFirst:function(el,L,M){return this.doInsert('afterBegin',el,L,M);},insertBefore:function(el,N,O){return this.doInsert('beforeBegin',el,N,O);},insertAfter:function(el,P,Q){return this.doInsert('afterEnd',el,P,Q);},append:function(el,R,S){return this.doInsert('beforeEnd',el,R,S);},doInsert:function(T,el,U,V){el=Roo.getDom(el);var W=Roo.DomHelper.insertHtml(T,el,this.applyTemplate(U));return V?Roo.get(W,true):W;},overwrite:function(el,X,Y){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(X);return Y?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.apply=Roo.Template.prototype.applyTemplate;Roo.DomHelper.Template=Roo.Template;Roo.Template.from=function(el){el=Roo.getDom(el);return new Roo.Template(el.value||el.innerHTML);};
+this.html=A;};Roo.Template.prototype={applyTemplate:function(values){try{if(this.compiled){return this.compiled(values);}var useF=this.disableFormats!==true;var fm=Roo.util.Format,tpl=this;var fn=function(m,E,F,G){if(F&&useF){if(F.substr(0,5)=="this."){return tpl.call(F.substr(5),values[E],values);}else {if(G){var re=/^\s*['"](.*)["']\s*$/;G=G.split(',');for(var i=0,len=G.length;i<len;i++){G[i]=G[i].replace(re,"$1");}
+G=[values[E]].concat(G);}else {G=[values[E]];}return fm[F].apply(fm,G);}}else {return values[E]!==undefined?values[E]:"";}};return this.html.replace(this.re,fn);}catch(e){Roo.log(e);throw e;}},set:function(B,C){this.html=B;this.compiled=null;if(C){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var D=this.disableFormats!==true;var E=Roo.isGecko?"+":",";var fn=function(m,G,H,I){if(H&&D){I=I?','+I:"";if(H.substr(0,5)!="this."){H="fm."+H+'(';}else {H='this.call("'+H.substr(5)+'", ';I=", values";}}else {I='';H="(values['"+G+"'] == undefined ? '' : ";}return "'"+E+H+"values['"+G+"']"+I+")"+E+"'";};var F;if(Roo.isGecko){F="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";}else {F=["this.compiled = function(values){ return ['"];F.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));F.push("'].join('');};");F=F.join('');}eval(F);return this;},call:function(G,H,I){return this[G](H,I);},insertFirst:function(el,J,K){return this.doInsert('afterBegin',el,J,K);},insertBefore:function(el,L,M){return this.doInsert('beforeBegin',el,L,M);},insertAfter:function(el,N,O){return this.doInsert('afterEnd',el,N,O);},append:function(el,P,Q){return this.doInsert('beforeEnd',el,P,Q);},doInsert:function(R,el,S,T){el=Roo.getDom(el);var U=Roo.DomHelper.insertHtml(R,el,this.applyTemplate(S));return T?Roo.get(U,true):U;},overwrite:function(el,V,W){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(V);return W?Roo.get(el.firstChild,true):el.firstChild;}};Roo.Template.prototype.apply=Roo.Template.prototype.applyTemplate;Roo.DomHelper.Template=Roo.Template;Roo.Template.from=function(el){el=Roo.getDom(el);return new Roo.Template(el.value||el.innerHTML);};
 Roo.DomQuery=function(){var A={},simpleCache={},valueCache={};var B=/\S/;var C=/^\s+|\s+$/g;var D=/\{(\d+)\}/g;var E=/^(\s?[\/>+~]\s?|\s|$)/;var F=/^(#)?([\w-\*]+)/;var G=/(\d*)n\+?(\d*)/,H=/\D/;function I(p,T){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==T){return n;}}
 n=n.nextSibling;}return null;};function J(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function K(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function L(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!B.test(n.nodeValue)){d.removeChild(n);}else {n.nodeIndex=++ni;}
 n=nx;}return this;};function byClassName(c,a,v){if(!v){return c;}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((' '+ci.className+' ').indexOf(v)!=-1){r[++ri]=ci;}}return r;};function attrValue(n,T){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];}if(!n){return null;}if(T=="for"){return n.htmlFor;}if(T=="class"||T=="className"){return n.className;}return n.getAttribute(T)||n[T];};function getNodes(ns,T,U){var V=[],ri=-1,cs;if(!ns){return V;}
@@ -132,7 +133,7 @@ this.anim({opacity:{to:(AY?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',fu
 Roo.get(dom).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(Aa){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(Ab){if(typeof Ab=="boolean"){Ab=Ab?this.originalDisplay:"none";}
 this.setStyle("display",Ab);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(Ac){if(Ac instanceof Array){for(var i=0,len=Ac.length;i<len;i++){this.addClass(Ac[i]);}}else {if(Ac&&!this.hasClass(Ac)){this.dom.className=this.dom.className+" "+Ac;}}return this;},radioClass:function(Ad){var Ae=this.dom.parentNode.childNodes;for(var i=0;i<Ae.length;i++){var s=Ae[i];if(s.nodeType==1){Roo.get(s).removeClass(Ad);}}
 this.addClass(Ad);return this;},removeClass:function(Af){if(!Af||!this.dom.className){return this;}if(Af instanceof Array){for(var i=0,len=Af.length;i<len;i++){this.removeClass(Af[i]);}}else {if(this.hasClass(Af)){var re=this.classReCache[Af];if(!re){re=new RegExp('(?:^|\\s+)'+Af+'(?:\\s+|$)',"g");this.classReCache[Af]=re;}
-this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(Ag){if(this.hasClass(Ag)){this.removeClass(Ag);}else {this.addClass(Ag);}return this;},hasClass:function(Ah){return Ah&&(' '+this.dom.className+' ').indexOf(' '+Ah+' ')!=-1;},replaceClass:function(Ai,Aj){this.removeClass(Ai);this.addClass(Aj);return this;},getStyles:function(){var a=arguments,Ak=a.length,r={};for(var i=0;i<Ak;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(Al){var el=this.dom,v,cs,Am;if(Al=='float'){Al="cssFloat";}if(el.style&&(v=el.style[Al])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}return cs[Am];}return null;}:function(Al){var el=this.dom,v,cs,Am;if(Al=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}return 1;}else if(Al=='float'){Al="styleFloat";}if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}if(v=el.style[Am]){return v;}if(cs=el.currentStyle){return cs[Am];}return null;};}(),setStyle:function(Al,Am){if(typeof Al=="string"){var camel;if(!(camel=B[Al])){camel=B[Al]=Al.replace(C,F);}if(camel=='opacity'){this.setOpacity(Am);}else {this.dom.style[camel]=Am;}}else {for(var style in Al){if(typeof Al[style]!="function"){this.setStyle(style,Al[style]);}}}return this;},applyStyles:function(An){Roo.DomHelper.applyStyles(this.dom,An);return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,Ao){if(!Ao||!A){D.setX(this.dom,x);}else {this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,Ap){if(!Ap||!A){D.setY(this.dom,y);}else {this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(Aq){this.setStyle("left",this.addUnits(Aq));return this;},setTop:function(Ar){this.setStyle("top",this.addUnits(Ar));return this;},setRight:function(As){this.setStyle("right",this.addUnits(As));return this;},setBottom:function(At){this.setStyle("bottom",this.addUnits(At));return this;},setXY:function(Au,Av){if(!Av||!A){D.setXY(this.dom,Au);}else {this.anim({points:{to:Au}},this.preanim(arguments,1),'motion');}return this;},setLocation:function(x,y,Aw){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,Ax){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(Ay){var h=this.dom.offsetHeight||0;return Ay!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(Az){var w=this.dom.offsetWidth||0;return Az!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle('height'),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth('tb');}}return h;},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle('width'),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth('lr');}}return w;},getSize:function(A0){return {width:this.getWidth(A0),height:this.getHeight(A0)};},getViewSize:function(){var d=this.dom,A1=document,aw=0,ah=0;if(d==A1||d==A1.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else {return {width:d.clientWidth,height:d.clientHeight};}},getValue:function(A2){return A2?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(A3){if(typeof A3=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A3-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(A3<0){A3=0;}}return A3;},adjustHeight:function(A4){if(typeof A4=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A4-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(A4<0){A4=0;}}return A4;},setWidth:function(A5,A6){A5=this.adjustWidth(A5);if(!A6||!A){this.dom.style.width=this.addUnits(A5);}else {this.anim({width:{to:A5}},this.preanim(arguments,1));}return this;},setHeight:function(A7,A8){A7=this.adjustHeight(A7);if(!A8||!A){this.dom.style.height=this.addUnits(A7);}else {this.anim({height:{to:A7}},this.preanim(arguments,1));}return this;},setSize:function(A9,BA,BB){if(typeof A9=="object"){BA=A9.height;A9=A9.width;}
+this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(Ag){if(this.hasClass(Ag)){this.removeClass(Ag);}else {this.addClass(Ag);}return this;},hasClass:function(Ah){return Ah&&(' '+this.dom.className+' ').indexOf(' '+Ah+' ')!=-1;},replaceClass:function(Ai,Aj){this.removeClass(Ai);this.addClass(Aj);return this;},getStyles:function(){var a=arguments,Ak=a.length,r={};for(var i=0;i<Ak;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(Al){var el=this.dom,v,cs,Am;if(Al=='float'){Al="cssFloat";}if(el.style&&(v=el.style[Al])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}return cs[Am];}return null;}:function(Al){var el=this.dom,v,cs,Am;if(Al=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}return 1;}else if(Al=='float'){Al="styleFloat";}if(!(Am=B[Al])){Am=B[Al]=Al.replace(C,F);}if(v=el.style[Am]){return v;}if(cs=el.currentStyle){return cs[Am];}return null;};}(),setStyle:function(Al,Am){if(typeof Al=="string"){if(Al=='float'){this.setStyle(Roo.isIE?'styleFloat':'cssFloat',Am);return this;}var camel;if(!(camel=B[Al])){camel=B[Al]=Al.replace(C,F);}if(camel=='opacity'){this.setOpacity(Am);}else {this.dom.style[camel]=Am;}}else {for(var style in Al){if(typeof Al[style]!="function"){this.setStyle(style,Al[style]);}}}return this;},applyStyles:function(An){Roo.DomHelper.applyStyles(this.dom,An);return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,Ao){if(!Ao||!A){D.setX(this.dom,x);}else {this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;},setY:function(y,Ap){if(!Ap||!A){D.setY(this.dom,y);}else {this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(Aq){this.setStyle("left",this.addUnits(Aq));return this;},setTop:function(Ar){this.setStyle("top",this.addUnits(Ar));return this;},setRight:function(As){this.setStyle("right",this.addUnits(As));return this;},setBottom:function(At){this.setStyle("bottom",this.addUnits(At));return this;},setXY:function(Au,Av){if(!Av||!A){D.setXY(this.dom,Au);}else {this.anim({points:{to:Au}},this.preanim(arguments,1),'motion');}return this;},setLocation:function(x,y,Aw){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,Ax){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(Ay){var h=this.dom.offsetHeight||0;return Ay!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(Az){var w=this.dom.offsetWidth||0;return Az!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle('height'),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth('tb');}}return h;},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle('width'),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth('lr');}}return w;},getSize:function(A0){return {width:this.getWidth(A0),height:this.getHeight(A0)};},getViewSize:function(){var d=this.dom,A1=document,aw=0,ah=0;if(d==A1||d==A1.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else {return {width:d.clientWidth,height:d.clientHeight};}},getValue:function(A2){return A2?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(A3){if(typeof A3=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A3-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(A3<0){A3=0;}}return A3;},adjustHeight:function(A4){if(typeof A4=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){A4-=(this.getBorderWidth("tb")+this.getPadding("tb"));}if(A4<0){A4=0;}}return A4;},setWidth:function(A5,A6){A5=this.adjustWidth(A5);if(!A6||!A){this.dom.style.width=this.addUnits(A5);}else {this.anim({width:{to:A5}},this.preanim(arguments,1));}return this;},setHeight:function(A7,A8){A7=this.adjustHeight(A7);if(!A8||!A){this.dom.style.height=this.addUnits(A7);}else {this.anim({height:{to:A7}},this.preanim(arguments,1));}return this;},setSize:function(A9,BA,BB){if(typeof A9=="object"){BA=A9.height;A9=A9.width;}
 A9=this.adjustWidth(A9);BA=this.adjustHeight(BA);if(!BB||!A){this.dom.style.width=this.addUnits(A9);this.dom.style.height=this.addUnits(BA);}else {this.anim({width:{to:A9},height:{to:BA}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,BC,BD,BE){if(!BE||!A){this.setSize(BC,BD);this.setLocation(x,y);}else {BC=this.adjustWidth(BC);BD=this.adjustHeight(BD);this.anim({points:{to:[x,y]},width:{to:BC},height:{to:BD}},this.preanim(arguments,4),'motion');}return this;},setRegion:function(BF,BG){this.setBounds(BF.left,BF.top,BF.right-BF.left,BF.bottom-BF.top,this.preanim(arguments,1));return this;},addListener:function(BH,fn,BI,BJ){Roo.EventManager.on(this.dom,BH,fn,BI||this,BJ);},removeListener:function(BK,fn){Roo.EventManager.removeListener(this.dom,BK,fn);return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(BL,BM){this.on(BL,function(e){BM.fireEvent(BL,e);});},setOpacity:function(BN,BO){if(!BO||!A){var s=this.dom.style;if(Roo.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(BN==1?"":"alpha(opacity="+BN*100+")");}else {s.opacity=BN;}}else {this.anim({opacity:{to:BN}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(BP){if(!BP){return this.getX();}else {return parseInt(this.getStyle("left"),10)||0;}},getRight:function(BQ){if(!BQ){return this.getX()+this.getWidth();}else {return (this.getLeft(true)+this.getWidth())||0;}},getTop:function(BR){if(!BR){return this.getY();}else {return parseInt(this.getStyle("top"),10)||0;}},getBottom:function(BS){if(!BS){return this.getY()+this.getHeight();}else {return (this.getTop(true)+this.getHeight())||0;}},position:function(BT,BU,x,y){if(!BT){if(this.getStyle('position')=='static'){this.setStyle('position','relative');}}else {this.setStyle("position",BT);}if(BU){this.setStyle("z-index",BU);}if(x!==undefined&&y!==undefined){this.setXY([x,y]);}else if(x!==undefined){this.setX(x);}else if(y!==undefined){this.setY(y);}},clearPositioning:function(BV){BV=BV||'';this.setStyle({"left":BV,"right":BV,"top":BV,"bottom":BV,"z-index":"","position":"static"});return this;},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return {"position":this.getStyle("position"),"left":l,"right":l?"":this.getStyle("right"),"top":t,"bottom":t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")};},getBorderWidth:function(BW){return this.addStyles(BW,El.borders);},getPadding:function(BX){return this.addStyles(BX,El.paddings);},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right="";}if(pc.bottom=="auto"){this.dom.style.bottom="";}return this;},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block");}}},setLeftTop:function(BY,BZ){this.dom.style.left=this.addUnits(BY);this.dom.style.top=this.addUnits(BZ);return this;},move:function(Ba,Bb,Bc){var xy=this.getXY();Ba=Ba.toLowerCase();switch(Ba){case "l":case "left":this.moveTo(xy[0]-Bb,xy[1],this.preanim(arguments,2));break;case "r":case "right":this.moveTo(xy[0]+Bb,xy[1],this.preanim(arguments,2));break;case "t":case "top":case "up":this.moveTo(xy[0],xy[1]-Bb,this.preanim(arguments,2));break;case "b":case "bottom":case "down":this.moveTo(xy[0],xy[1]+Bb,this.preanim(arguments,2));break;}return this;},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={"o":this.getStyle("overflow"),"x":this.getStyle("overflow-x"),"y":this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden");}return this;},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o);}if(o.x){this.setStyle("overflow-x",o.x);}if(o.y){this.setStyle("overflow-y",o.y);}}return this;},getAnchorXY:function(Bd,Be,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight();}else {w=this.getWidth();h=this.getHeight();}}else {w=s.width;h=s.height;}var x=0,y=0,r=Math.round;switch((Bd||"tl").toLowerCase()){case "c":x=r(w*.5);y=r(h*.5);break;case "t":x=r(w*.5);y=0;break;case "l":x=0;y=r(h*.5);break;case "r":x=w;y=r(h*.5);break;case "b":x=r(w*.5);y=h;break;case "tl":x=0;y=0;break;case "bl":x=0;y=h;break;case "br":x=w;y=h;break;case "tr":x=w;y=0;break;}if(Be===true){return [x,y];}if(vp){var sc=this.getScroll();return [x+sc.left,y+sc.top];}var o=this.getXY();return [x+o[0],y+o[1]];},getAlignToXY:function(el,p,o){el=Roo.get(el);var d=this.dom;if(!el.dom){throw "Element.alignTo with an element that doesn't exist";}var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl";}else if(p=="?"){p="tl-bl?";}else if(p.indexOf("-")==-1){p="tl-"+p;}
 p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw "Element.alignTo with an invalid alignment "+p;}
 p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var A1=document;var scrollX=(A1.documentElement.scrollLeft||A1.body.scrollLeft||0)+5;var scrollY=(A1.documentElement.scrollTop||A1.body.scrollTop||0)+5;if((x+w)>dw+scrollX){x=swapX?r.left-w:dw+scrollX-w;}if(x<scrollX){x=swapX?r.right:scrollX;}if((y+h)>dh+scrollY){y=swapY?r.top-h:dh+scrollY-h;}if(y<scrollY){y=swapY?r.bottom:scrollY;}}return [x,y];},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,Bf,Bg,Bh){el=Roo.get(el);Bg=Bg?Roo.applyIf(Bg,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Roo.lib.Dom.getViewWidth();vh=Roo.lib.Dom.getViewHeight();}else {vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!Bf){var vxy=el.getXY();vx=vxy[0];vy=vxy[1];}}var s=el.getScroll();vx+=Bg.left+s.left;vy+=Bg.top+s.top;vw-=Bg.right;vh-=Bg.bottom;var vr=vx+vw;var vb=vy+vh;var xy=Bh||(!Bf?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var Bi=false;if((x+w)>vr){x=vr-w;Bi=true;}if((y+h)>vb){y=vb-h;Bi=true;}if(x<vx){x=vx;Bi=true;}if(y<vy){y=vy;Bi=true;}return Bi?[x,y]:false;};}(),adjustForConstraints:function(xy,Bf,Bg){return this.getConstrainToXY(Bf||document,false,Bg,xy)||xy;},alignTo:function(Bh,Bi,Bj,Bk){var xy=this.getAlignToXY(Bh,Bi,Bj);this.setXY(xy,this.preanim(arguments,3));return this;},anchorTo:function(el,Bl,Bm,Bn,Bo,Bp){var Bq=function(){this.alignTo(el,Bl,Bm,Bn);Roo.callback(Bp,this);};Roo.EventManager.onWindowResize(Bq,this);var tm=typeof Bo;if(tm!='undefined'){Roo.EventManager.on(window,'scroll',Bq,this,{buffer:tm=='number'?Bo:50});}
@@ -237,117 +238,3 @@ I="o:"+flat.substring(0,flat.length-1);}else {I="s:"+v;}return escape(I);}});
 Roo.state.Manager=function(){var A=new Roo.state.Provider();return {setProvider:function(H){A=H;},get:function(I,J){return A.get(I,J);},set:function(K,L){A.set(K,L);},clear:function(M){A.clear(M);},getProvider:function(){return A;}};}();
 Roo.state.CookieProvider=function(A){Roo.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Roo.apply(this,A);this.state=this.readCookies();};Roo.extend(Roo.state.CookieProvider,Roo.state.Provider,{set:function(B,C){if(typeof C=="undefined"||C===null){this.clear(B);return;}
 this.setCookie(B,C);Roo.state.CookieProvider.superclass.set.call(this,B,C);},clear:function(D){this.clearCookie(D);Roo.state.CookieProvider.superclass.clear.call(this,D);},readCookies:function(){var E={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var F;while((F=re.exec(c))!=null){var D=F[1];var C=F[2];if(D&&D.substring(0,3)=="ys-"){E[D.substr(3)]=this.decodeValue(C);}}return E;},setCookie:function(G,H){document.cookie="ys-"+G+"="+this.encodeValue(H)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"");},clearCookie:function(I){document.cookie="ys-"+I+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"");}});
-(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.dd.DragDrop.prototype={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){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(C,D,E){if(typeof D=="number"){D={left:D,right:D,top:D,bottom:D};}
-D=D||this.defaultPadding;var b=Roo.get(this.getEl()).getBox();var ce=Roo.get(C);var s=ce.getScroll();var c,cd=ce.dom;if(cd==document.body){c={x:s.left,y:s.top,width:Roo.lib.Dom.getViewWidth(),height:Roo.lib.Dom.getViewHeight()};}else {xy=ce.getXY();c={x:xy[0]+s.left,y:xy[1]+s.top,width:cd.clientWidth,height:cd.clientHeight};}var F=b.y-c.y;var G=b.x-c.x;this.resetConstraints();this.setXConstraint(G-(D.left||0),c.width-G-b.width-(D.right||0));this.setYConstraint(F-(D.top||0),c.height-F-b.height-(D.bottom||0));},getEl:function(){if(!this._domRef){this._domRef=Roo.getDom(this.id);}return this._domRef;},getDragEl:function(){return Roo.getDom(this.dragElId);},init:function(id,H,I){this.initTarget(id,H,I);A.on(this.id,"mousedown",this.handleMouseDown,this);},initTarget:function(id,J,K){this.config=K||{};this.DDM=Roo.dd.DDM;this.groups={};if(typeof id!=="string"){id=Roo.id(id);}
-this.id=id;this.addToGroup((J)?J:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(L,M,N,O){if(!M&&0!==M){this.padding=[L,L,L,L];}else if(!N&&0!==N){this.padding=[L,M,L,M];}else {this.padding=[L,M,N,O];}},setInitPosition:function(P,Q){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=P||0;var dy=Q||0;var p=B.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(R){var p=R||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(S){this.groups[S]=true;this.DDM.regDragDrop(this,S);},removeFromGroup:function(T){if(this.groups[T]){delete this.groups[T];}
-this.DDM.removeDDFromGroup(this,T);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
-this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
-A.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){A.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},destroy:function(){this.unreg();},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,U){if(this.primaryButtonOnly&&e.button!=0){return;}if(this.isLocked()){return;}
-this.DDM.refreshCache(this.groups);var pt=new Roo.lib.Point(Roo.lib.Event.getPageX(e),Roo.lib.Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else {if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else {}}},clickValidator:function(e){var V=e.getTarget();return (this.isValidHandleChild(V)&&(this.id==this.handleElId||this.DDM.handleWasClicked(V,this.id)));},addInvalidHandleType:function(W){var X=W.toUpperCase();this.invalidHandleTypes[X]=X;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}
-this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(Y){this.invalidHandleClasses.push(Y);},removeInvalidHandleType:function(Z){var a=Z.toUpperCase();delete this.invalidHandleTypes[a];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(d){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==d){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(f){var g=true;var h;try{h=f.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
-g=g&&!this.invalidHandleTypes[h];g=g&&!this.invalidHandleIds[f.id];for(var i=0,len=this.invalidHandleClasses.length;g&&i<len;++i){g=!B.hasClass(f,this.invalidHandleClasses[i]);}return g;},setXTicks:function(j,k){this.xTicks=[];this.xTickSize=k;var l={};for(var i=this.initPageX;i>=this.minX;i=i-k){if(!l[i]){this.xTicks[this.xTicks.length]=i;l[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+k){if(!l[i]){this.xTicks[this.xTicks.length]=i;l[i]=true;}}
-this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(m,n){this.yTicks=[];this.yTickSize=n;var o={};for(var i=this.initPageY;i>=this.minY;i=i-n){if(!o[i]){this.yTicks[this.yTicks.length]=i;o[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+n){if(!o[i]){this.yTicks[this.yTicks.length]=i;o[i]=true;}}
-this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(q,r,t){this.leftConstraint=q;this.rightConstraint=r;this.minX=this.initPageX-q;this.maxX=this.initPageX+r;if(t){this.setXTicks(this.initPageX,t);}
-this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(u,v,w){this.topConstraint=u;this.bottomConstraint=v;this.minY=this.initPageY-u;this.maxY=this.initPageY+v;if(w){this.setYTicks(this.initPageY,w);}
-this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else {this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(z,AA){if(!AA){return z;}else if(AA[0]>=z){return AA[0];}else {for(var i=0,len=AA.length;i<len;++i){var next=i+1;if(AA[next]&&AA[next]>=z){var diff1=z-AA[i];var diff2=AA[next]-z;return (diff2>diff1)?AA[i]:AA[next];}}return AA[AA.length-1];}},toString:function(){return ("DragDrop "+this.id);}};})();
-if(!Roo.dd.DragDropMgr){Roo.dd.DragDropMgr=function(){var A=Roo.EventManager;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(AG,AH){for(var i in this.ids){for(var j in this.ids[i]){var h=this.ids[i][j];if(!this.isTypeOfDD(h)){continue;}
-h[AG].apply(h,AH);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(AI,AJ){if(!this.initialized){this.init();}if(!this.ids[AJ]){this.ids[AJ]={};}
-this.ids[AJ][AI.id]=AI;},removeDDFromGroup:function(AK,AL){if(!this.ids[AL]){this.ids[AL]={};}var AM=this.ids[AL];if(AM&&AM[AK.id]){delete AM[AK.id];}},_remove:function(AN){for(var g in AN.groups){if(g&&this.ids[g][AN.id]){delete this.ids[g][AN.id];}}delete this.handleIds[AN.id];},regHandle:function(AO,AP){if(!this.handleIds[AO]){this.handleIds[AO]={};}
-this.handleIds[AO][AP]=AP;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(AQ,AR){var AS=[];for(var i in AQ.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!AR||dd.isTarget){AS[AS.length]=dd;}}}return AS;},isLegalTarget:function(AT,AU){var AV=this.getRelated(AT,true);for(var i=0,d=AV.length;i<d;++i){if(AV[i].id==AU.id){return true;}}return false;},isTypeOfDD:function(AW){return (AW&&AW.__ygDragDrop);},isHandle:function(AX,AY){return (this.handleIds[AX]&&this.handleIds[AX][AY]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,AZ){if(Roo.QuickTips){Roo.QuickTips.disable();}
-this.currentTarget=e.getTarget();this.dragCurrent=AZ;var el=AZ.getEl();this.startX=e.getPageX();this.startY=e.getPageY();this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var Aa=Roo.dd.DDM;Aa.startDrag(Aa.startX,Aa.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}
-this.dragThreshMet=true;},handleMouseUp:function(e){if(Roo.QuickTips){Roo.QuickTips.enable();}if(!this.dragCurrent){return;}
-clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else {}
-this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){e.stopPropagation();}if(this.preventDefault){e.preventDefault();}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
-this.dragCurrent.onMouseUp(e);}
-this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(Roo.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var diffX=Math.abs(this.startX-e.getPageX());var diffY=Math.abs(this.startY-e.getPageY());if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);if(!this.dragCurrent.moveOnly){this.fireEvents(e,false);}}
-this.stopEvent(e);return true;},fireEvents:function(e,Aa){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var pt=e.getPoint();var Ab=[];var Ac=[];var Ad=[];var Ae=[];var Af=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){Ac.push(ddo);}
-Ab[i]=true;delete this.dragOvers[i];}for(var AL in dc.groups){if("string"!=typeof AL){continue;}for(i in this.ids[AL]){var AZ=this.ids[AL][i];if(!this.isTypeOfDD(AZ)){continue;}if(AZ.isTarget&&!AZ.isLocked()&&AZ!=dc){if(this.isOverTarget(pt,AZ,this.mode)){if(Aa){Ae.push(AZ);}else {if(!Ab[AZ.id]){Af.push(AZ);}else {Ad.push(AZ);}
-this.dragOvers[AZ.id]=AZ;}}}}}if(this.mode){if(Ac.length){dc.b4DragOut(e,Ac);dc.onDragOut(e,Ac);}if(Af.length){dc.onDragEnter(e,Af);}if(Ad.length){dc.b4DragOver(e,Ad);dc.onDragOver(e,Ad);}if(Ae.length){dc.b4DragDrop(e,Ae);dc.onDragDrop(e,Ae);}}else {var d=0;for(i=0,d=Ac.length;i<d;++i){dc.b4DragOut(e,Ac[i].id);dc.onDragOut(e,Ac[i].id);}for(i=0,d=Af.length;i<d;++i){dc.onDragEnter(e,Af[i].id);}for(i=0,d=Ad.length;i<d;++i){dc.b4DragOver(e,Ad[i].id);dc.onDragOver(e,Ad[i].id);}for(i=0,d=Ae.length;i<d;++i){dc.b4DragDrop(e,Ae[i].id);dc.onDragDrop(e,Ae[i].id);}}if(Aa&&!Ae.length){dc.onInvalidDrop(e);}},getBestMatch:function(Ag){var Ah=null;var Ai=Ag.length;if(Ai==1){Ah=Ag[0];}else {for(var i=0;i<Ai;++i){var dd=Ag[i];if(dd.cursorIsOver){Ah=dd;break;}else {if(!Ah||Ah.overlap.getArea()<dd.overlap.getArea()){Ah=dd;}}}}return Ah;},refreshCache:function(Aj){for(var AL in Aj){if("string"!=typeof AL){continue;}for(var i in this.ids[AL]){var AZ=this.ids[AL][i];if(this.isTypeOfDD(AZ)){var o=this.getLocation(AZ);if(o){this.locationCache[AZ.id]=o;}else {delete this.locationCache[AZ.id];}}}}},verifyEl:function(el){if(el){var parent;if(Roo.isIE){try{parent=el.offsetParent;}catch(e){}}else {parent=el.offsetParent;}if(parent){return true;}}return false;},getLocation:function(Ak){if(!this.isTypeOfDD(Ak)){return null;}var el=Ak.getEl(),Al,x1,x2,y1,y2,t,r,b,l;try{Al=Roo.lib.Dom.getXY(el);}catch(e){}if(!Al){return null;}
-x1=Al[0];x2=x1+el.offsetWidth;y1=Al[1];y2=y1+el.offsetHeight;t=y1-Ak.padding[0];r=x2+Ak.padding[1];b=y2+Ak.padding[2];l=x1-Ak.padding[3];return new Roo.lib.Region(t,r,b,l);},isOverTarget:function(pt,Am,An){var Ao=this.locationCache[Am.id];if(!Ao||!this.useCache){Ao=this.getLocation(Am);this.locationCache[Am.id]=Ao;}if(!Ao){return false;}
-Am.cursorIsOver=Ao.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!An&&!dc.constrainX&&!dc.constrainY)){return Am.cursorIsOver;}
-Am.overlap=null;var Ap=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var Aq=new Roo.lib.Region(Ap.y,Ap.x+el.offsetWidth,Ap.y+el.offsetHeight,Ap.x);var Ar=Aq.intersect(Ao);if(Ar){Am.overlap=Ar;return (An)?true:Am.cursorIsOver;}else {return false;}},_onUnload:function(e,me){Roo.dd.DragDropMgr.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
-this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
-this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var As=this.elementCache[id];if(!As||!As.el){As=this.elementCache[id]=new this.ElementWrapper(Roo.getDom(id));}return As;},getElement:function(id){return Roo.getDom(id);},getCss:function(id){var el=Roo.getDom(id);return (el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return Roo.lib.Dom.getX(el);},getPosY:function(el){return Roo.lib.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else {var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else {n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,At=document.documentElement,db=document.body;if(At&&(At.scrollTop||At.scrollLeft)){t=At.scrollTop;l=At.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else {}return {top:t,left:l};},getStyle:function(el,Au){return Roo.fly(el).getStyle(Au);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(Av,Aw){var Ax=Roo.lib.Dom.getXY(Aw);Roo.lib.Dom.setXY(Av,Ax);},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var Ay=Roo.dd.DDM;if(Roo.lib.Event&&document){Ay._onLoad();}else {if(Ay._timeoutCount>2000){}else {setTimeout(Ay._addListeners,10);if(document&&document.body){Ay._timeoutCount+=1;}}}},handleWasClicked:function(Az,id){if(this.isHandle(id,Az.id)){return true;}else {var p=Az.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else {p=p.parentNode;}}}return false;}};}();Roo.dd.DDM=Roo.dd.DragDropMgr;Roo.dd.DDM._addListeners();}
-Roo.dd.DD=function(id,A,B){if(id){this.init(id,A,B);}};Roo.extend(Roo.dd.DD,Roo.dd.DragDrop,{scroll:true,autoOffset:function(C,D){var x=C-this.startPageX;var y=D-this.startPageY;this.setDelta(x,y);},setDelta:function(E,F){this.deltaX=E;this.deltaY=F;},setDragElPos:function(G,H){var el=this.getDragEl();this.alignElWithMouse(el,G,H);},alignElWithMouse:function(el,I,J){var K=this.getTargetCoord(I,J);var L=el.dom?el:Roo.fly(el);if(!this.deltaSetXY){var aCoord=[K.x,K.y];L.setXY(aCoord);var newLeft=L.getLeft(true);var newTop=L.getTop(true);this.deltaSetXY=[newLeft-K.x,newTop-K.y];}else {L.setLeftTop(K.x+this.deltaSetXY[0],K.y+this.deltaSetXY[1]);}
-this.cachePosition(K.x,K.y);this.autoScroll(K.x,K.y,el.offsetHeight,el.offsetWidth);return K;},cachePosition:function(M,N){if(M){this.lastPageX=M;this.lastPageY=N;}else {var aCoord=Roo.lib.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=Roo.lib.Dom.getViewWidth();var clientW=Roo.lib.Dom.getViewHeight();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(O,P){var x=O-this.deltaX;var y=P-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}
-x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};},applyConfig:function(){Roo.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(e.getPageX(),e.getPageY());},b4Drag:function(e){this.setDragElPos(e.getPageX(),e.getPageY());},toString:function(){return ("DD "+this.id);}});
-Roo.dd.DDProxy=function(id,A,B){if(id){this.init(id,A,B);this.initFrame();}};Roo.dd.DDProxy.dragElId="ygddfdiv";Roo.extend(Roo.dd.DDProxy,Roo.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var C=this;var D=document.body;if(!D||!D.firstChild){setTimeout(function(){C.createFrame();},50);return;}var E=this.getDragEl();if(!E){E=document.createElement("div");E.id=this.dragElId;var s=E.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;D.insertBefore(E,D.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){Roo.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Roo.dd.DDProxy.dragElId);},showFrame:function(F,G){var el=this.getEl();var H=this.getDragEl();var s=H.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
-this.setDragElPos(F,G);Roo.fly(H).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Roo.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight);}},b4MouseDown:function(e){var x=e.getPageX();var y=e.getPageY();this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){Roo.fly(this.getDragEl()).hide();},endDrag:function(e){var I=this.getEl();var J=this.getDragEl();J.style.visibility="";this.beforeMove();I.style.visibility="hidden";Roo.dd.DDM.moveToEl(I,J);J.style.visibility="hidden";I.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){},toString:function(){return ("DDProxy "+this.id);}});
-Roo.dd.DDTarget=function(id,A,B){if(id){this.initTarget(id,A,B);}};Roo.extend(Roo.dd.DDTarget,Roo.dd.DragDrop,{toString:function(){return ("DDTarget "+this.id);}});
-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 dds=Roo.dd.ScrollManager;if(!dds.animate){if(D.el.scroll(D.dir,dds.increment)){F();}}else {D.el.scroll(D.dir,dds.increment,true,dds.animDuration,F);}}};var H=function(){if(D.id){clearInterval(D.id);}
-D.id=0;D.el=null;D.dir="";};var I=function(el,K){H();D.el=el;D.dir=K;D.id=setInterval(G,Roo.dd.ScrollManager.frequency);};var J=function(e,K){if(K||!A.dragCurrent){return;}var L=Roo.dd.ScrollManager;if(!C||C!=A.dragCurrent){C=A.dragCurrent;L.refreshCache();}var xy=Roo.lib.Event.getXY(e);var pt=new Roo.lib.Point(xy[0],xy[1]);for(var id in B){var el=B[id],r=el._region;if(r&&r.contains(pt)&&el.isScrollable()){if(r.bottom-pt.y<=L.thresh){if(D.el!=el){I(el,"down");}return;}else if(r.right-pt.x<=L.thresh){if(D.el!=el){I(el,"left");}return;}else if(pt.y-r.top<=L.thresh){if(D.el!=el){I(el,"up");}return;}else if(pt.x-r.left<=L.thresh){if(D.el!=el){I(el,"right");}return;}}}
-H();};A.fireEvents=A.fireEvents.createSequence(J,A);A.stopDrag=A.stopDrag.createSequence(E,A);return {register:function(el){if(el instanceof Array){for(var i=0,len=el.length;i<len;i++){this.register(el[i]);}}else {el=Roo.get(el);B[el.id]=el;}},unregister:function(el){if(el instanceof Array){for(var i=0,len=el.length;i<len;i++){this.unregister(el[i]);}}else {el=Roo.get(el);delete B[el.id];}},thresh:25,increment:100,frequency:500,animate:true,animDuration:.4,refreshCache:function(){for(var id in B){if(typeof B[id]=='object'){B[id]._region=B[id].getRegion();}}}};}();
-Roo.dd.Registry=function(){var A={};var B={};var C=0;var D=function(el,E){if(typeof el=="string"){return el;}var id=el.id;if(!id&&E!==false){id="roodd-"+(++C);el.id=id;}return id;};return {register:function(el,G){G=G||{};if(typeof el=="string"){el=document.getElementById(el);}
-G.ddel=el;A[D(el)]=G;if(G.isHandle!==false){B[G.ddel.id]=G;}if(G.handles){var hs=G.handles;for(var i=0,len=hs.length;i<len;i++){B[D(hs[i])]=G;}}},unregister:function(el){var id=D(el,false);var H=A[id];if(H){delete A[id];if(H.handles){var hs=H.handles;for(var i=0,len=hs.length;i<len;i++){delete B[D(hs[i],false)];}}}},getHandle:function(id){if(typeof id!="string"){id=id.id;}return B[id];},getHandleFromEvent:function(e){var t=Roo.lib.Event.getTarget(e);return t?B[t.id]:null;},getTarget:function(id){if(typeof id!="string"){id=id.id;}return A[id];},getTargetFromEvent:function(e){var t=Roo.lib.Event.getTarget(e);return t?A[t.id]||B[t.id]:null;}};}();
-Roo.dd.StatusProxy=function(A){Roo.apply(this,A);this.id=this.id||Roo.id();this.el=new Roo.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!A||A.shadow!==false});this.ghost=Roo.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed;};Roo.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(B){B=B||this.dropNotAllowed;if(this.dropStatus!=B){this.el.replaceClass(this.dropStatus,B);this.dropStatus=B;}},reset:function(C){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(C){this.ghost.update("");}},update:function(D){if(typeof D=="string"){this.ghost.update(D);}else {this.ghost.update("");D.style.margin="0";this.ghost.dom.appendChild(D);}var el=this.ghost.dom.firstChild;if(el){Roo.fly(el).setStyle('float','none');}},getEl:function(){return this.el;},getGhost:function(){return this.ghost;},hide:function(E){this.el.hide();if(E){this.reset(true);}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop();}},show:function(){this.el.show();},sync:function(){this.el.sync();},repair:function(xy,F,G){this.callback=F;this.scope=G;if(xy&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||.5,easing:'easeOut',xy:xy,stopFx:true,callback:this.afterRepair,scope:this});}else {this.afterRepair();}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this);}
-this.callback=null;this.scope=null;}};
-Roo.dd.DragSource=function(el,A){this.el=Roo.get(el);this.dragData={};Roo.apply(this,A);if(!this.proxy){this.proxy=new Roo.dd.StatusProxy();}
-Roo.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false;};Roo.extend(Roo.dd.DragSource,Roo.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(e){return this.dragData;},onDragEnter:function(e,id){var B=Roo.dd.DragDropMgr.getDDById(id);this.cachedTarget=B;if(this.beforeDragEnter(B,e,id)!==false){if(B.isNotifyTarget){var status=B.notifyEnter(this,e,this.dragData);this.proxy.setStatus(status);}else {this.proxy.setStatus(this.dropAllowed);}if(this.afterDragEnter){this.afterDragEnter(B,e,id);}}},beforeDragEnter:function(C,e,id){return true;},alignElWithMouse:function(){Roo.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync();},onDragOver:function(e,id){var D=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragOver(D,e,id)!==false){if(D.isNotifyTarget){var status=D.notifyOver(this,e,this.dragData);this.proxy.setStatus(status);}if(this.afterDragOver){this.afterDragOver(D,e,id);}}},beforeDragOver:function(E,e,id){return true;},onDragOut:function(e,id){var F=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragOut(F,e,id)!==false){if(F.isNotifyTarget){F.notifyOut(this,e,this.dragData);}
-this.proxy.reset();if(this.afterDragOut){this.afterDragOut(F,e,id);}}
-this.cachedTarget=null;},beforeDragOut:function(G,e,id){return true;},onDragDrop:function(e,id){var H=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragDrop(H,e,id)!==false){if(H.isNotifyTarget){if(H.notifyDrop(this,e,this.dragData)){this.onValidDrop(H,e,id);}else {this.onInvalidDrop(H,e,id);}}else {this.onValidDrop(H,e,id);}if(this.afterDragDrop){this.afterDragDrop(H,e,id);}}delete this.cachedTarget;},beforeDragDrop:function(I,e,id){return true;},onValidDrop:function(J,e,id){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(J,e,id);}},getRepairXY:function(e,K){return this.el.getXY();},onInvalidDrop:function(L,e,id){this.beforeInvalidDrop(L,e,id);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,e,this.dragData);}
-this.cacheTarget=null;}
-this.proxy.repair(this.getRepairXY(e,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(e,id);}},afterRepair:function(){if(Roo.enableFx){this.el.highlight(this.hlColor||"c3daf9");}
-this.dragging=false;},beforeInvalidDrop:function(M,e,id){return true;},handleMouseDown:function(e){if(this.dragging){return;}var N=this.getDragData(e);if(N&&this.onBeforeDrag(N,e)!==false){this.dragData=N;this.proxy.stop();Roo.dd.DragSource.superclass.handleMouseDown.apply(this,arguments);}},onBeforeDrag:function(O,e){return true;},onStartDrag:Roo.emptyFn,startDrag:function(x,y){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(x,y);this.proxy.show();},onInitDrag:function(x,y){var P=this.el.dom.cloneNode(true);P.id=Roo.id();this.proxy.update(P);this.onStartDrag(x,y);return true;},getProxy:function(){return this.proxy;},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false;},triggerCacheRefresh:function(){Roo.dd.DDM.refreshCache(this.groups);},b4EndDrag:function(e){},endDrag:function(e){this.onEndDrag(this.dragData,e);},onEndDrag:function(Q,e){},autoOffset:function(x,y){this.setDelta(-12,-20);}});
-Roo.dd.DropTarget=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}
-Roo.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true});};Roo.extend(Roo.dd.DropTarget,Roo.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(dd,e,B){if(this.overClass){this.el.addClass(this.overClass);}return this.dropAllowed;},notifyOver:function(dd,e,C){return this.dropAllowed;},notifyOut:function(dd,e,D){if(this.overClass){this.el.removeClass(this.overClass);}},notifyDrop:function(dd,e,E){return false;}});
-Roo.dd.DragZone=function(el,A){Roo.dd.DragZone.superclass.constructor.call(this,el,A);if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}};Roo.extend(Roo.dd.DragZone,Roo.dd.DragSource,{getDragData:function(e){return Roo.dd.Registry.getHandleFromEvent(e);},onInitDrag:function(x,y){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(x,y);return true;},afterRepair:function(){if(Roo.enableFx){Roo.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9");}
-this.dragging=false;},getRepairXY:function(e){return Roo.Element.fly(this.dragData.ddel).getXY();}});
-Roo.dd.DropZone=function(el,A){Roo.dd.DropZone.superclass.constructor.call(this,el,A);};Roo.extend(Roo.dd.DropZone,Roo.dd.DropTarget,{getTargetFromEvent:function(e){return Roo.dd.Registry.getTargetFromEvent(e);},onNodeEnter:function(n,dd,e,B){},onNodeOver:function(n,dd,e,C){return this.dropAllowed;},onNodeOut:function(n,dd,e,D){},onNodeDrop:function(n,dd,e,E){return false;},onContainerOver:function(dd,e,F){return this.dropNotAllowed;},onContainerDrop:function(dd,e,G){return false;},notifyEnter:function(dd,e,H){return this.dropNotAllowed;},notifyOver:function(dd,e,I){var n=this.getTargetFromEvent(e);if(!n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,I);this.lastOverNode=null;}return this.onContainerOver(dd,e,I);}if(this.lastOverNode!=n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,I);}
-this.onNodeEnter(n,dd,e,I);this.lastOverNode=n;}return this.onNodeOver(n,dd,e,I);},notifyOut:function(dd,e,J){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,J);this.lastOverNode=null;}},notifyDrop:function(dd,e,K){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,K);this.lastOverNode=null;}var n=this.getTargetFromEvent(e);return n?this.onNodeDrop(n,dd,e,K):this.onContainerDrop(dd,e,K);},triggerCacheRefresh:function(){Roo.dd.DDM.refreshCache(this.groups);}});
-Roo.data.SortTypes={none:function(s){return s;},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"");},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"");},asUCString:function(s){return String(s).toUpperCase();},asDate:function(s){if(!s){return 0;}if(s instanceof Date){return s.getTime();}return Date.parse(String(s));},asFloat:function(s){var A=parseFloat(String(s).replace(/,/g,""));if(isNaN(A))A=0;return A;},asInt:function(s){var B=parseInt(String(s).replace(/,/g,""));if(isNaN(B))B=0;return B;}};
-Roo.data.Record=function(A,id){this.id=(id||id===0)?id:++Roo.data.Record.AUTO_ID;this.data=A;};Roo.data.Record.create=function(o){var f=function(){f.superclass.constructor.apply(this,arguments);};Roo.extend(f,Roo.data.Record);var p=f.prototype;p.fields=new Roo.util.MixedCollection(false,function(B){return B.name;});for(var i=0,len=o.length;i<len;i++){p.fields.add(new Roo.data.Field(o[i]));}
-f.getField=function(B){return p.fields.get(B);};return f;};Roo.data.Record.AUTO_ID=1000;Roo.data.Record.EDIT='edit';Roo.data.Record.REJECT='reject';Roo.data.Record.COMMIT='commit';Roo.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(B){this.store=B;},set:function(C,D){if(this.data[C]==D){return;}
-this.dirty=true;if(!this.modified){this.modified={};}if(typeof this.modified[C]=='undefined'){this.modified[C]=this.data[C];}
-this.data[C]=D;if(!this.editing){this.store.afterEdit(this);}},get:function(E){return this.data[E];},beginEdit:function(){this.editing=true;this.modified={};},cancelEdit:function(){this.editing=false;delete this.modified;},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this);}},reject:function(){var m=this.modified;for(var n in m){if(typeof m[n]!="function"){this.data[n]=m[n];}}
-this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterReject(this);}},commit:function(){this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterCommit(this);}},hasError:function(){return this.error!=null;},clearError:function(){this.error=null;},copy:function(F){return new this.constructor(Roo.apply({},this.data),F||this.id);}};
-Roo.data.Store=function(A){this.data=new Roo.util.MixedCollection(false);this.data.getKey=function(o){return o.id;};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir"};if(A&&A.data){this.inlineData=A.data;delete A.data;}
-Roo.apply(this,A);if(this.reader){this.reader=Roo.factory(this.reader,Roo.data);this.reader.xmodule=this.xmodule||false;if(!this.recordType){this.recordType=this.reader.recordType;}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this);}}if(this.recordType){this.fields=this.recordType.prototype.fields;}
-this.modified=[];this.addEvents({datachanged:true,metachange:true,add:true,remove:true,update:true,clear:true,beforeload:true,load:true,loadexception:true});if(this.proxy){this.proxy=Roo.factory(this.proxy,Roo.data);this.proxy.xmodule=this.xmodule||false;this.relayEvents(this.proxy,["loadexception"]);}
-this.sortToggle={};Roo.data.Store.superclass.constructor.call(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData;}};Roo.extend(Roo.data.Store,Roo.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,add:function(B){B=[].concat(B);for(var i=0,len=B.length;i<len;i++){B[i].join(this);}var C=this.data.length;this.data.addAll(B);this.fireEvent("add",this,B,C);},remove:function(D){var E=this.data.indexOf(D);this.data.removeAt(E);if(this.pruneModifiedRecords){this.modified.remove(D);}
-this.fireEvent("remove",this,D,E);},removeAll:function(){this.data.clear();if(this.pruneModifiedRecords){this.modified=[];}
-this.fireEvent("clear",this);},insert:function(F,G){G=[].concat(G);for(var i=0,len=G.length;i<len;i++){this.data.insert(F,G[i]);G[i].join(this);}
-this.fireEvent("add",this,G,F);},indexOf:function(H){return this.data.indexOf(H);},indexOfId:function(id){return this.data.indexOfKey(id);},getById:function(id){return this.data.key(id);},getAt:function(I){return this.data.itemAt(I);},getRange:function(J,K){return this.data.getRange(J,K);},storeOptions:function(o){o=Roo.apply({},o);delete o.callback;delete o.scope;this.lastOptions=o;},load:function(L){L=L||{};if(this.fireEvent("beforeload",this,L)!==false){this.storeOptions(L);var p=Roo.apply(L.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn["sort"]]=this.sortInfo.field;p[pn["dir"]]=this.sortInfo.direction;}
-this.proxy.load(p,this.reader,this.loadRecords,this,L);}},reload:function(M){this.load(Roo.applyIf(M||{},this.lastOptions));},loadRecords:function(o,N,O){if(!o||O===false){if(O!==false){this.fireEvent("load",this,[],N);}if(N.callback){N.callback.call(N.scope||this,[],N,false);}return;}if(o.success===false){this.fireEvent("loadexception",this,o,N,this.reader.jsonData);return;}var r=o.records,t=o.totalRecords||r.length;if(!N||N.add!==true){if(this.pruneModifiedRecords){this.modified=[];}for(var i=0,len=r.length;i<len;i++){r[i].join(this);}if(this.snapshot){this.data=this.snapshot;delete this.snapshot;}
-this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this);}else {this.totalLength=Math.max(t,this.data.length+r.length);this.add(r);}
-this.fireEvent("load",this,r,N);if(N.callback){N.callback.call(N.scope||this,r,N,true);}},loadData:function(o,P){var r=this.reader.readRecords(o);this.loadRecords(r,{add:P},true);},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(Q,R){this.sortInfo={field:Q,direction:R?R.toUpperCase():"ASC"};},sort:function(S,T){var f=this.fields.get(S);if(!T){if(this.sortInfo&&this.sortInfo.field==f.name){T=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC");}else {T=f.sortDir;}}
-this.sortToggle[f.name]=T;this.sortInfo={field:f.name,direction:T};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this);}else {this.load(this.lastOptions);}},each:function(fn,U){this.data.each(fn,U);},getModifiedRecords:function(){return this.modified;},createFilterFn:function(V,W,X){if(!W.exec){W=String(W);if(W.length==0){return false;}
-W=new RegExp((X===true?'':'^')+Roo.escapeRe(W),"i");}return function(r){return W.test(r.data[V]);};},sum:function(Y,Z,a){var rs=this.data.items,v=0;Z=Z||0;a=(a||a===0)?a:rs.length-1;for(var i=Z;i<=a;i++){v+=(rs[i].data[Y]||0);}return v;},filter:function(b,c,d){var fn=this.createFilterFn(b,c,d);return fn?this.filterBy(fn):this.clearFilter();},filterBy:function(fn,e){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(fn,e||this);this.fireEvent("datachanged",this);},query:function(g,h,j){var fn=this.createFilterFn(g,h,j);return fn?this.queryBy(fn):this.data.clone();},queryBy:function(fn,k){var l=this.snapshot||this.data;return l.filterBy(fn,k||this);},collect:function(m,n,q){var d=(q===true&&this.snapshot)?this.snapshot.items:this.data.items;var v,sv,r=[],l={};for(var i=0,len=d.length;i<len;i++){v=d[i].data[m];sv=String(v);if((n||!Roo.isEmpty(v))&&!l[sv]){l[sv]=true;r[r.length]=v;}}return r;},clearFilter:function(u){if(this.snapshot&&this.snapshot!=this.data){this.data=this.snapshot;delete this.snapshot;if(u!==true){this.fireEvent("datachanged",this);}}},afterEdit:function(w){if(this.modified.indexOf(w)==-1){this.modified.push(w);}
-this.fireEvent("update",this,w,Roo.data.Record.EDIT);},afterReject:function(x){this.modified.remove(x);this.fireEvent("update",this,x,Roo.data.Record.REJECT);},afterCommit:function(y){this.modified.remove(y);this.fireEvent("update",this,y,Roo.data.Record.COMMIT);},commitChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].commit();}},rejectChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].reject();}},onMetaChange:function(z,AA,o){this.recordType=AA;this.fields=AA.prototype.fields;delete this.snapshot;this.sortInfo=z.sortInfo;this.modified=[];this.fireEvent('metachange',this,this.reader.meta);}});
-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.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=function(A){if(typeof A=="string"){A={name:A};}
-Roo.apply(this,A);if(!this.type){this.type="auto";}var st=Roo.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=st[this.sortType];}if(!this.sortType){switch(this.type){case "string":this.sortType=st.asUCString;break;case "date":this.sortType=st.asDate;break;default:this.sortType=st.none;}}var B=/[\$,%]/g;if(!this.convert){var cv,dateFormat=this.dateFormat;switch(this.type){case "":case "auto":case undefined:cv=function(v){return v;};break;case "string":cv=function(v){return (v===undefined||v===null)?'':String(v);};break;case "int":cv=function(v){return v!==undefined&&v!==null&&v!==''?parseInt(String(v).replace(B,""),10):'';};break;case "float":cv=function(v){return v!==undefined&&v!==null&&v!==''?parseFloat(String(v).replace(B,""),10):'';};break;case "bool":case "boolean":cv=function(v){return v===true||v==="true"||v==1;};break;case "date":cv=function(v){if(!v){return '';}if(v instanceof Date){return v;}if(dateFormat){if(dateFormat=="timestamp"){return new Date(v*1000);}return Date.parseDate(v,dateFormat);}var C=Date.parse(v);return C?new Date(C):null;};break;}
-this.convert=cv;}};Roo.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};
-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;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=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=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(B,C,D,E,F){B=B||{};var G;try{G=C.readRecords(this.data);}catch(e){this.fireEvent("loadexception",this,arg,null,e);callback.call(scope,null,arg,false);return;}
-D.call(E,G,F,true);},update:function(H,I){}});
-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(B,C,D,E,F){if(this.fireEvent("beforeload",this,B)!==false){var o={params:B||{},request:{callback:D,scope:E,arg:F},reader:C,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 {D.call(E||this,null,F,false);}},loadResponse:function(o,G,H){delete this.activeRequest;if(!G){this.fireEvent("loadexception",this,o,H);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}var I;try{I=o.reader.read(H);}catch(e){this.fireEvent("loadexception",this,o,response,e);o.request.callback.call(o.request.scope,null,o.request.arg,false);return;}
-this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,I,o.request.arg,true);},update:function(J){},updateResponse:function(K){}});
-Roo.data.ScriptTagProxy=function(A){Roo.data.ScriptTagProxy.superclass.constructor.call(this);Roo.apply(this,A);this.head=document.getElementsByTagName("head")[0];};Roo.data.ScriptTagProxy.TRANS_ID=1000;Roo.extend(Roo.data.ScriptTagProxy,Roo.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(B,C,D,E,F){if(this.fireEvent("beforeload",this,B)!==false){var p=Roo.urlEncode(Roo.apply(B,this.extraParams));var url=this.url;url+=(url.indexOf("?")!=-1?"&":"?")+p;if(this.nocache){url+="&_dc="+(new Date().getTime());}var transId=++Roo.data.ScriptTagProxy.TRANS_ID;var trans={id:transId,cb:"stcCallback"+transId,scriptId:"stcScript"+transId,params:B,arg:F,url:url,callback:D,scope:E,reader:C};var conn=this;window[trans.cb]=function(o){conn.handleResponse(o,trans);};url+=String.format("&{0}={1}",this.callbackParam,trans.cb);if(this.autoAbort!==false){this.abort();}
-trans.timeoutId=this.handleFailure.defer(this.timeout,this,[trans]);var script=document.createElement("script");script.setAttribute("src",url);script.setAttribute("type","text/javascript");script.setAttribute("id",trans.scriptId);this.head.appendChild(script);this.trans=trans;}else {D.call(E||this,null,F,false);}},isLoading:function(){return this.trans?true:false;},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans);}},destroyTrans:function(G,H){this.head.removeChild(document.getElementById(G.scriptId));clearTimeout(G.timeoutId);if(H){window[G.cb]=undefined;try{delete window[G.cb];}catch(e){}}else {window[G.cb]=function(){window[G.cb]=undefined;try{delete window[G.cb];}catch(e){}};}},handleResponse:function(o,I){this.trans=false;this.destroyTrans(I,true);var J;try{J=I.reader.readRecords(o);}catch(e){this.fireEvent("loadexception",this,o,trans.arg,e);trans.callback.call(trans.scope||window,null,trans.arg,false);return;}
-this.fireEvent("load",this,o,I.arg);I.callback.call(I.scope||window,J,I.arg,true);},handleFailure:function(K){this.trans=false;this.destroyTrans(K,false);this.fireEvent("loadexception",this,null,K.arg);K.callback.call(K.scope||window,null,K.arg,false);}});
-Roo.data.JsonReader=function(meta,recordType){meta=meta||{};Roo.applyIf(meta,{totalProperty:'total',successProperty:'success',root:'data',id:'id'});Roo.data.JsonReader.superclass.constructor.call(this,meta,recordType||meta.fields);};Roo.extend(Roo.data.JsonReader,Roo.data.DataReader,{read:function(response){var json=response.responseText;var o=eval("("+json+")");if(!o){throw {message:"JsonReader.read: Json object not found"};}if(o.metaData){delete this.ef;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(meta,recordType,o){},simpleAccess:function(obj,subsc){return obj[subsc];},getJsonAccessor:function(){var re=/[\[\.]/;return function(expr){try{return (re.test(expr))?new Function("obj","return obj."+expr):function(obj){return obj[expr];};}catch(e){}return Roo.emptyFn;};}(),readRecords:function(o){this.jsonData=o;var s=this.meta,Record=this.recordType,f=Record.prototype.fields,fi=f.items,fl=f.length;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(rec){var r=g(rec);return (r===undefined||r==="")?null:r;};}else {this.getId=function(){return null;};}
-this.ef=[];for(var i=0;i<fl;i++){f=fi[i];var map=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[i]=this.getJsonAccessor(map);}}var root=this.getRoot(o),c=root.length,totalRecords=c,success=true;if(s.totalProperty){var v=parseInt(this.getTotal(o),10);if(!isNaN(v)){totalRecords=v;}}if(s.successProperty){var v=this.getSuccess(o);if(v===false||v==='false'){success=false;}}var records=[];for(var i=0;i<c;i++){var n=root[i];var values={};var id=this.getId(n);for(var j=0;j<fl;j++){f=fi[j];var v=this.ef[j](n);values[f.name]=f.convert((v!==undefined)?v:f.defaultValue);}var record=new Record(values,id);record.json=n;records[i]=record;}return {success:success,records:records,totalRecords:totalRecords};}});
-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(C){var D=C.responseXML;if(!D){throw {message:"XmlReader.read: XML Document not available"};}return this.readRecords(D);},readRecords:function(E){this.xmlData=E;var F=E.documentElement||E;var q=Roo.DomQuery;var G=this.recordType,H=G.prototype.fields;var I=this.meta.id;var J=0,K=true;if(this.meta.totalRecords){J=q.selectNumber(this.meta.totalRecords,F,0);}if(this.meta.success){var sv=q.selectValue(this.meta.success,F,true);K=sv!==false&&sv!=='false';}var L=[];var ns=q.select(this.meta.record,F);for(var i=0,len=ns.length;i<len;i++){var n=ns[i];var values={};var id=I?q.selectValue(I,n):undefined;for(var j=0,jlen=H.length;j<jlen;j++){var f=H.items[j];var v=q.selectValue(f.mapping||f.name,n,f.defaultValue);v=f.convert(v);values[f.name]=v;}var record=new G(values,id);record.node=n;L[L.length]=record;}return {success:K,records:L,totalRecords:J||L.length};}});
-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 C=this.meta?this.meta.id:null;var D=this.recordType,E=D.prototype.fields;var F=[];var G=o;for(var i=0;i<G.length;i++){var n=G[i];var values={};var id=((C||C===0)&&n[C]!==undefined&&n[C]!==""?n[C]:null);for(var j=0,jlen=E.length;j<jlen;j++){var f=E.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);values[f.name]=v;}var record=new D(values,id);record.json=n;F[F.length]=record;}return {records:F,totalRecords:F.length};}});
-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(B){this.root=B;B.ownerTree=this;B.isRoot=true;this.registerNode(B);return B;},getNodeById:function(id){return this.nodeHash[id];},registerNode:function(C){this.nodeHash[C.id]=C;},unregisterNode:function(D){delete this.nodeHash[D.id];},toString:function(){return "[Tree"+(this.id?" "+this.id:"")+"]";}});Roo.data.Node=function(E){this.attributes=E||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Roo.id(null,"ynode-");this.attributes.id=this.id;}
-this.childNodes=[];if(!this.childNodes.indexOf){this.childNodes.indexOf=function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}return -1;};}
-this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({"append":true,"remove":true,"move":true,"insert":true,"beforeappend":true,"beforeremove":true,"beforemove":true,"beforeinsert":true});this.listeners=this.attributes.listeners;Roo.data.Node.superclass.constructor.call(this);};Roo.extend(Roo.data.Node,Roo.util.Observable,{fireEvent:function(F){if(Roo.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false;}var ot=this.getOwnerTree();if(ot){if(ot.proxyNodeEvent.apply(ot,arguments)===false){return false;}}return true;},isLeaf:function(){return this.leaf===true;},setFirstChild:function(G){this.firstChild=G;},setLastChild:function(H){this.lastChild=H;},isLast:function(){return (!this.parentNode?true:this.parentNode.lastChild==this);},isFirst:function(){return (!this.parentNode?true:this.parentNode.firstChild==this);},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0;},appendChild:function(I){var J=false;if(I instanceof Array){J=I;}else if(arguments.length>1){J=arguments;}if(J){for(var i=0,len=J.length;i<len;i++){this.appendChild(J[i]);}}else {if(this.fireEvent("beforeappend",this.ownerTree,this,I)===false){return false;}var index=this.childNodes.length;var oldParent=I.parentNode;if(oldParent){if(I.fireEvent("beforemove",I.getOwnerTree(),I,oldParent,this,index)===false){return false;}
-oldParent.removeChild(I);}
-index=this.childNodes.length;if(index==0){this.setFirstChild(I);}
-this.childNodes.push(I);I.parentNode=this;var ps=this.childNodes[index-1];if(ps){I.previousSibling=ps;ps.nextSibling=I;}else {I.previousSibling=null;}
-I.nextSibling=null;this.setLastChild(I);I.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,I,index);if(oldParent){I.fireEvent("move",this.ownerTree,I,oldParent,this,index);}return I;}},removeChild:function(K){var L=this.childNodes.indexOf(K);if(L==-1){return false;}if(this.fireEvent("beforeremove",this.ownerTree,this,K)===false){return false;}
-this.childNodes.splice(L,1);if(K.previousSibling){K.previousSibling.nextSibling=K.nextSibling;}if(K.nextSibling){K.nextSibling.previousSibling=K.previousSibling;}if(this.firstChild==K){this.setFirstChild(K.nextSibling);}if(this.lastChild==K){this.setLastChild(K.previousSibling);}
-K.setOwnerTree(null);K.parentNode=null;K.previousSibling=null;K.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,K);return K;},insertBefore:function(M,N){if(!N){return this.appendChild(M);}if(M==N){return false;}if(this.fireEvent("beforeinsert",this.ownerTree,this,M,N)===false){return false;}var O=this.childNodes.indexOf(N);var P=M.parentNode;var Q=O;if(P==this&&this.childNodes.indexOf(M)<O){Q--;}if(P){if(M.fireEvent("beforemove",M.getOwnerTree(),M,P,this,O,N)===false){return false;}
-P.removeChild(M);}if(Q==0){this.setFirstChild(M);}
-this.childNodes.splice(Q,0,M);M.parentNode=this;var ps=this.childNodes[Q-1];if(ps){M.previousSibling=ps;ps.nextSibling=M;}else {M.previousSibling=null;}
-M.nextSibling=N;N.previousSibling=M;M.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,M,N);if(P){M.fireEvent("move",this.ownerTree,M,P,this,Q,N);}return M;},item:function(R){return this.childNodes[R];},replaceChild:function(S,T){this.insertBefore(S,T);this.removeChild(T);return T;},indexOf:function(U){return this.childNodes.indexOf(U);},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 V=0;var p=this;while(p.parentNode){++V;p=p.parentNode;}return V;},setOwnerTree:function(W){if(W!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this);}
-this.ownerTree=W;var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].setOwnerTree(W);}if(W){W.registerNode(this);}}},getPath:function(X){X=X||"id";var p=this.parentNode;var b=[this.attributes[X]];while(p){b.unshift(p.attributes[X]);p=p.parentNode;}var Y=this.getOwnerTree().pathSeparator;return Y+b.join(Y);},bubble:function(fn,Z,a){var p=this;while(p){if(fn.call(Z||p,a||p)===false){break;}
-p=p.parentNode;}},cascade:function(fn,c,d){if(fn.call(c||this,d||this)!==false){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].cascade(fn,c,d);}}},eachChild:function(fn,e,f){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(fn.call(e||this,f||cs[i])===false){break;}}},findChild:function(g,h){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(cs[i].attributes[g]==h){return cs[i];}}return null;},findChildBy:function(fn,j){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(fn.call(j||cs[i],cs[i])===true){return cs[i];}}return null;},sort:function(fn,k){var cs=this.childNodes;var l=cs.length;if(l>0){var sortFn=k?function(){fn.apply(k,arguments);}:fn;cs.sort(sortFn);for(var i=0;i<l;i++){var n=cs[i];n.previousSibling=cs[i-1];n.nextSibling=cs[i+1];if(i==0){this.setFirstChild(n);}if(i==l-1){this.setLastChild(n);}}}},contains:function(m){return m.isAncestor(this);},isAncestor:function(o){var p=this.parentNode;while(p){if(p==o){return true;}
-p=p.parentNode;}return false;},toString:function(){return "[Node"+(this.id?" "+this.id:"")+"]";}});