Fix #6430 - messing arouds with cards BS4
[roojs1] / roojs-core.js
1 // Roo.js
2 window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=ua.indexOf("edge")>-1,J=!D&&ua.indexOf("gecko")>-1,K=F&&!B,L=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),M=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),N=(ua.indexOf("linux")!=-1),O=window.location.href.toLowerCase().indexOf("https")===0,P=/iphone|ipad/.test(ua),Q=/android/.test(ua),R=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true;
3 window.removeEventListener('touchstart',__set_has_touch__);});return false;}document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:O,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){}
4 ,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var S={};for(var b in o){var T=b.split('@');if(T[1]){var s=T[0];
5 if(!S[s]){S[s]=Roo.select(s);}S[s].on(T[1],o[b]);}}S=null;},id:function(el,S){S=S||"roo-gen";el=Roo.getDom(el);var id=S+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,S){if(typeof sp=='object'){S=sp;
6 sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},T,U=sp.prototype;F.prototype=U;T=sb.prototype=new F();T.constructor=sb;sb.superclass=U;if(U.constructor==Object.prototype.constructor){U.constructor=sp;}sb.override=function(o){Roo.override(sb,o);
7 };T.override=io;Roo.override(sb,S);return sb;};}(),override:function(S,T){if(T){var p=S.prototype;for(var U in T){p[U]=T[U];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval('if (typeof '+rt+' == "undefined"){'+rt+' = {};} o = '+rt+';');
8 for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},factory:function(c,ns){if(!c.xtype||(!ns&&!c.xns)||(c.xns===false)){return c;}ns=c.xns?c.xns:ns;if(c.constructor==ns[c.xtype]){return c;}if(ns[c.xtype]){if(Roo.debug){Roo.log("Roo.Factory("+c.xtype+")");
9 }var S=new ns[c.xtype](c);S.xns=false;return S;}c.xns=false;return c;},log:function(s){if((typeof(console)=='undefined')||(typeof(console.log)=='undefined')){return;}console.log(s);},urlEncode:function(o){if(!o){return "";}var S=[];for(var T in o){var ov=o[T],k=Roo.encodeURIComponent(T);
10 var U=typeof ov;if(U=='undefined'){S.push(k,"=&");}else if(U!="function"&&U!="object"){S.push(k,"=",Roo.encodeURIComponent(ov),"&");}else if(ov instanceof Array){if(ov.length){for(var i=0,V=ov.length;i<V;i++){S.push(k,"=",Roo.encodeURIComponent(ov[i]===undefined?'':ov[i]),"&");
11 }}else{S.push(k,"=&");}}}S.pop();return S.join("");},encodeURIComponent:function(S){try{return encodeURIComponent(S);}catch(e){}if(S==''||S==null){return '';}function nibble_to_hex(V){var W='0123456789ABCDEF';return W.charAt(V);}S=S.toString();var T='';for(var i=0;
12 i<S.length;i++){var c=S.charCodeAt(i);var bs=new Array();if(c>0x10000){bs[0]=0xF0|((c&0x1C0000)>>>18);bs[1]=0x80|((c&0x3F000)>>>12);bs[2]=0x80|((c&0xFC0)>>>6);bs[3]=0x80|(c&0x3F);}else if(c>0x800){bs[0]=0xE0|((c&0xF000)>>>12);bs[1]=0x80|((c&0xFC0)>>>6);bs[2]=0x80|(c&0x3F);
13 }else if(c>0x80){bs[0]=0xC0|((c&0x7C0)>>>6);bs[1]=0x80|(c&0x3F);}else{bs[0]=c;}for(var j=0;j<bs.length;j++){var b=bs[j];var U=nibble_to_hex((b&0xF0)>>>4)+nibble_to_hex(b&0x0F);T+='%'+U;}}return T;},urlDecode:function(S,T){if(!S||!S.length){return {};}var U={}
14 ;var V=S.split('&');var W,X,Y;for(var i=0,Z=V.length;i<Z;i++){W=V[i].split('=');X=decodeURIComponent(W[0]);Y=decodeURIComponent(W[1]);if(T!==true){if(typeof U[X]=="undefined"){U[X]=Y;}else if(typeof U[X]=="string"){U[X]=[U[X]];U[X].push(Y);}else{U[X].push(Y);
15 }}else{U[X]=Y;}}return U;},each:function(S,fn,T){if(typeof S.length=="undefined"||typeof S=="string"){S=[S];}for(var i=0,U=S.length;i<U;i++){if(fn.call(T||S[i],S[i],i,S)===false){return i;};}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;
16 i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,S,T,U){if(typeof cb=="function"){if(U){cb.defer(U,S,T||[]);
17 }else{cb.apply(S,T||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=='string'?document.getElementById(el):el);},getCmp:function(id){return Roo.ComponentMgr.get(id);},num:function(v,S){if(typeof v!='number'){return S;}return v;
18 },destroy:function(){for(var i=0,a=arguments,S=a.length;i<S;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=='function'){as.purgeListeners();}if(typeof as.destroy=='function'){as.destroy();}}}},type:function(o){if(o===undefined||o===null){return false;
19 }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';
20 case RegExp:return 'regexp';}if(typeof o.length=='number'&&typeof o.item=='function'){return 'nodelist';}}return t;},isEmpty:function(v,S){return v===null||v===undefined||(!S?v==='':false);},isOpera:C,isSafari:D,isFirefox:E,isIE:F,isIE7:G,isIE11:H,isEdge:I,isGecko:J,isBorderBox:K,isWindows:L,isLinux:N,isMac:M,isIOS:P,isAndroid:Q,isTouch:R,useShims:((F&&!G)||(J&&M)),selectNode:function(S,T){var U=Roo.DomQuery.selectNode(S,T);
21 return U?Roo.get(U):new Roo.Element(false);}});})();Roo.namespace("Roo","Roo.util","Roo.grid","Roo.dd","Roo.tree","Roo.data","Roo.form","Roo.menu","Roo.state","Roo.lib","Roo.layout","Roo.app","Roo.ux","Roo.bootstrap","Roo.bootstrap.dash");
22 // Function.js
23 (function(){if(Roo.isIE){function fnCleanUp(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",fnCleanUp);}window.attachEvent("onunload",fnCleanUp);
24 }})();Roo.apply(Function.prototype,{createCallback:function(){var A=arguments;var B=this;return function(){return B.apply(window,A);};},createDelegate:function(A,B,C){var D=this;return function(){var E=B||arguments;if(C===true){E=Array.prototype.slice.call(arguments,0);
25 E=E.concat(B);}else if(typeof C=="number"){E=Array.prototype.slice.call(arguments,0);var F=[C,0].concat(B);Array.prototype.splice.apply(E,F);}return D.apply(A||window,E);};},defer:function(A,B,C,D){var fn=this.createDelegate(B,C,D);if(A){return setTimeout(fn,A);
26 }fn();return 0;},createSequence:function(A,B){if(typeof A!="function"){return this;}var C=this;return function(){var D=C.apply(this||window,arguments);A.apply(B||this||window,arguments);return D;};},createInterceptor:function(A,B){if(typeof A!="function"){return this;
27 }var C=this;return function(){A.target=this;A.method=C;if(A.apply(B||this||window,arguments)===false){return;}return C.apply(this||window,arguments);};}});
28 // String.js
29 Roo.applyIf(String,{escape:function(A){return A.replace(/('|\\)/g,"\\$1");},leftPad:function(A,B,ch){var C=new String(A);if(ch===null||ch===undefined||ch===''){ch=" ";}while(C.length<B){C=ch+C;}return C;},format:function(A){var B=Array.prototype.slice.call(arguments,1);
30 return A.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(B[i]);});}});String.prototype.toggle=function(A,B){return this==A?B:A;};String.prototype.unicodeClean=function(){return this.replace(/[\s\S]/g,function(A){if(A.charCodeAt()<256){return A;
31 }try{encodeURIComponent(A);}catch(e){return '';}return A;});};
32 // Number.js
33 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
34 // Array.js
35 Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;i++){if(this[i]==o){return i;}}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(A){var B=this.length>>>0;if(typeof A!="function"){throw new TypeError();
36 }var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;}});
37 // Date.js
38 Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);
39 }var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;
40 var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!D&&ch=="\\"){D=true;}else if(D){D=false;C+="'"+String.escape(ch)+"' + ";}else{C+=Date.getFormatCode(ch);}}eval(C.substring(0,C.length-3)+";}");};Date.getFormatCode=function(A){switch(A){case "d":return "String.leftPad(this.getDate(), 2, '0') + ";
41 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() + ";
42 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) + ";
43 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') + ";
44 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') + ";
45 case "i":return "String.leftPad(this.getMinutes(), 2, '0') + ";case "s":return "String.leftPad(this.getSeconds(), 2, '0') + ";case "O":return "this.getGMTOffset() + ";case "P":return "this.getGMTColonOffset() + ";case "T":return "this.getTimezone() + ";case "Z":return "(this.getTimezoneOffset() * -60) + ";
46 default:return "'"+String.escape(A)+"' + ";}};Date.parseDate=function(A,B){if(Date.parseFunctions[B]==null){Date.createParser(B);}var C=Date.parseFunctions[B];return Date[C](A);};Date.createParser=function(A){var B="parse"+Date.parseFunctions.count++;var C=Date.parseRegexes.length;
47 var D=1;Date.parseFunctions[A]=B;var E="Date."+B+" = function(input){\n"+"var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"+"var d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"if (typeof(input) !== 'string') { input = input.toString(); }\n"+"var results = input.match(Date.parseRegexes["+C+"]);\n"+"if (results && results.length > 0) {";
48 var F="";var G=false;var ch='';for(var i=0;i<A.length;++i){ch=A.charAt(i);if(!G&&ch=="\\"){G=true;}else if(G){G=false;F+=String.escape(ch);}else{var H=Date.formatCodeToRegex(ch,D);D+=H.g;F+=H.s;if(H.g&&H.c){E+=H.c;}}}E+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"+"{v = new Date(y, m, d, h, i, s);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"+"{v = new Date(y, m, d, h, i);}\n"+"else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"+"{v = new Date(y, m, d, h);}\n"+"else if (y >= 0 && m >= 0 && d > 0)\n"+"{v = new Date(y, m, d);}\n"+"else if (y >= 0 && m >= 0)\n"+"{v = new Date(y, m);}\n"+"else if (y >= 0)\n"+"{v = new Date(y);}\n"+"}return (v && (z || o))?\n"+"    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+"        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";
49 Date.parseRegexes[C]=new RegExp("^"+F+"$");eval(E);};Date.formatCodeToRegex=function(A,B){switch(A){case "D":return {g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case "j":return {g:1,c:"d = parseInt(results["+B+"], 10);\n",s:"(\\d{1,2})"};case "d":return {g:1,c:"d = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"}
50 ;case "l":return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case "S":return {g:0,c:null,s:"(?:st|nd|rd|th)"};case "w":return {g:0,c:null,s:"\\d"};case "z":return {g:0,c:null,s:"(?:\\d{1,3})"};case "W":return {g:0,c:null,s:"(?:\\d{2})"};case "F":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"}
51 ;case "M":return {g:1,c:"m = parseInt(Date.monthNumbers[results["+B+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case "n":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{1,2})"};case "m":return {g:1,c:"m = parseInt(results["+B+"], 10) - 1;\n",s:"(\\d{2})"}
52 ;case "t":return {g:0,c:null,s:"\\d{1,2}"};case "L":return {g:0,c:null,s:"(?:1|0)"};case "Y":return {g:1,c:"y = parseInt(results["+B+"], 10);\n",s:"(\\d{4})"};case "y":return {g:1,c:"var ty = parseInt(results["+B+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"}
53 ;case "a":return {g:1,c:"if (results["+B+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case "A":return {g:1,c:"if (results["+B+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"}
54 ;case "g":case "G":return {g:1,c:"h = parseInt(results["+B+"], 10);\n",s:"(\\d{1,2})"};case "h":case "H":return {g:1,c:"h = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "i":return {g:1,c:"i = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"};case "s":return {g:1,c:"s = parseInt(results["+B+"], 10);\n",s:"(\\d{2})"}
55 ;case "O":return {g:1,c:["o = results[",B,"];\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{2,4})"}
56 ;case "P":return {g:1,c:["o = results[",B,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);\n","var mn = o.substring(4,6) % 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})"}
57 ;case "T":return {g:0,c:null,s:"[A-Z]{1,4}"};case "Z":return {g:1,c:"z = results["+B+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+\-]?\\d{1,5})"};default:return {g:0,c:null,s:String.escape(A)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1");
58 };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.getGMTColonOffset=function(){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+":"+String.leftPad(this.getTimezoneOffset()%60,2,"0");
59 };Date.prototype.getDayOfYear=function(){var A=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i<this.getMonth();++i){A+=Date.daysInMonth[i];}return A+this.getDate()-1;};Date.prototype.getWeekOfYear=function(){var A=this.getDayOfYear()+(4-this.getDay());
60 var B=new Date(this.getFullYear(),0,1);var C=(7-B.getDay()+4);return String.leftPad(((A-C)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var A=this.getFullYear();return ((A&3)==0&&(A%100||(A%400==0&&A)));};Date.prototype.getFirstDayOfMonth=function(){var A=(this.getDay()-(this.getDate()-1))%7;
61 return (A<0)?(A+7):A;};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);
62 };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";
63 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"];
64 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());
65 };Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime();}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};if(Roo.isSafari&&typeof(Date.brokenSetMonth)=='undefined'){Date.brokenSetMonth=Date.prototype.setMonth;
66 Date.prototype.setMonth=function(A){if(A<=-1){var n=Math.ceil(-A);var B=Math.ceil(n/12);var C=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-B);return Date.brokenSetMonth.call(this,C);}else{return Date.brokenSetMonth.apply(this,arguments);}};}Date.MILLI="ms";
67 Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(A,B){var d=this.clone();if(!A||B===0){return d;}switch(A.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+B);break;
68 case Date.SECOND:d.setSeconds(this.getSeconds()+B);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+B);break;case Date.HOUR:d.setHours(this.getHours()+B);break;case Date.DAY:d.setDate(this.getDate()+B);break;case Date.MONTH:var C=this.getDate();if(C>28){C=Math.min(C,this.getFirstDateOfMonth().add('mo',B).getLastDateOfMonth().getDate());
69 }d.setDate(C);d.setMonth(this.getMonth()+B);break;case Date.YEAR:d.setFullYear(this.getFullYear()+B);break;}return d;};
70 // Roo/lib/Dom.js
71 Roo.lib.Dom={getViewWidth:function(A){return A?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(A){return A?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;
72 return Math.max(A,this.getViewportHeight());},getDocumentWidth:function(){var A=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(A,this.getViewportWidth());},getViewportHeight:function(){var A=self.innerHeight;
73 var B=document.compatMode;if((B||Roo.isIE)&&!Roo.isOpera){A=(B=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return A;},getViewportWidth:function(){var A=self.innerWidth;var B=document.compatMode;if(B||Roo.isIE){A=(B=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;
74 }return A;},isAncestor:function(p,c){p=Roo.getDom(p);c=Roo.getDom(c);if(!p||!c){return false;}if(p.contains&&!Roo.isSafari){return p.contains(c);}else if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16);}else{var A=c.parentNode;while(A){if(A==p){return true;
75 }else if(!A.tagName||A.tagName.toUpperCase()=="HTML"){return false;}A=A.parentNode;}return false;}},getRegion:function(el){return Roo.lib.Region.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,A,bd=document.body;
76 el=Roo.getDom(el);var B=Roo.lib.AnimBase.fly;if(el.getBoundingClientRect){b=el.getBoundingClientRect();A=B(document).getScroll();return [b.left+A.left,b.top+A.top];}var x=0,y=0;p=el;var C=B(el).getStyle("position")=="absolute";while(p){x+=p.offsetLeft;y+=p.offsetTop;
77 if(!C&&B(p).getStyle("position")=="absolute"){C=true;}if(Roo.isGecko){pe=B(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle('overflow')!='visible'){x+=bl;y+=bt;
78 }}p=p.offsetParent;}if(Roo.isSafari&&C){x-=bd.offsetLeft;y-=bd.offsetTop;}if(Roo.isGecko&&!C){var D=B(bd);x+=parseInt(D.getStyle("borderLeftWidth"),10)||0;y+=parseInt(D.getStyle("borderTopWidth"),10)||0;}p=el.parentNode;while(p&&p!=bd){if(!Roo.isOpera||(p.tagName!='TR'&&B(p).getStyle("display")!="inline")){x-=p.scrollLeft;
79 y-=p.scrollTop;}p=p.parentNode;}return [x,y];},setXY:function(el,xy){el=Roo.fly(el,'_setXY');el.position();var A=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=A.left+"px";}if(xy[1]!==false){el.dom.style.top=A.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);
80 },setY:function(el,y){this.setXY(el,[false,y]);}};
81 // Roo/lib/Event.js
82 Roo.lib.Event=function(){var A=false;var B=[];var C=[];var D=0;var E=[];var F=0;var G=null;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var H=this;var I=function(){H._tryPreloadAttach();
83 };this._interval=setInterval(I,this.POLL_INTERVAL);}},onAvailable:function(H,I,J,K){E.push({id:H,fn:I,obj:J,override:K,checkReady:false});D=this.POLL_RETRYS;this.startInterval();},addListener:function(el,H,fn){el=Roo.getDom(el);if(!el||!fn){return false;}
84 if("unload"==H){C[C.length]=[el,H,fn];return true;}var I=function(e){return fn(Roo.lib.Event.getEvent(e));};var li=[el,H,fn,I];var J=B.length;B[J]=li;this.doAdd(el,H,I,false);return true;},removeListener:function(el,H,fn){var i,I;el=Roo.getDom(el);if(!fn){return this.purgeElement(el,false,H);
85 }if("unload"==H){for(i=0,I=C.length;i<I;i++){var li=C[i];if(li&&li[0]==el&&li[1]==H&&li[2]==fn){C.splice(i,1);return true;}}return false;}var J=null;var K=arguments[3];if("undefined"==typeof K){K=this._getCacheIndex(el,H,fn);}if(K>=0){J=B[K];}if(!el||!J){return false;
86 }this.doRemove(el,H,J[this.WFN],false);delete B[K][this.WFN];delete B[K][this.FN];B.splice(K,1);return true;},getTarget:function(ev,H){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;var t=ev.target||ev.srcElement;return this.resolveTextNode(t);
87 },resolveTextNode:function(H){if(Roo.isSafari&&H&&3==H.nodeType){return H.parentNode;}else{return H;}},getPageX:function(ev){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(Roo.isIE){x+=this.getScroll()[1];
88 }}return x;},getPageY:function(ev){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(Roo.isIE){y+=this.getScroll()[0];}}return y;},getXY:function(ev){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;
89 return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;
90 }}return this.resolveTextNode(t);},getTime:function(ev){ev=ev.browserEvent||ev;ev=ev.touches?(ev.touches[0]||ev.changedTouches[0]||ev):ev;if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);
91 this.preventDefault(ev);},stopPropagation:function(ev){ev=ev.browserEvent||ev;if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){ev=ev.browserEvent||ev;if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;
92 }},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){ev=ev.browserEvent||ev;return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,H,fn){for(var i=0,I=B.length;
93 i<I;++i){var li=B[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==H){return i;}}return -1;},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){A=true;var EU=Roo.lib.Event;if(Roo.isIE){EU.doRemove(window,"load",EU._load);
94 }},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var H=!A;if(!H){H=(D>0);}var I=[];for(var i=0,J=E.length;i<J;++i){var K=E[i];if(K){var el=this.getEl(K.id);if(el){if(!K.checkReady||A||el.nextSibling||(document&&document.body)){var L=el;
95 if(K.override){if(K.override===true){L=K.obj;}else{L=K.override;}}K.fn.call(L,K.obj);E[i]=null;}}else{I.push(K);}}}D=(I.length===0)?0:D-1;if(H){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,H,I){var J=this.getListeners(el,I);
96 if(J){for(var i=0,K=J.length;i<K;++i){var l=J[i];this.removeListener(el,l.type,l.fn);}}if(H&&el&&el.childNodes){for(i=0,K=el.childNodes.length;i<K;++i){this.purgeElement(el.childNodes[i],H,I);}}},getListeners:function(el,H){var I=[],J;if(!H){J=[B,C];}else if(H=="unload"){J=[C];
97 }else{J=[B];}for(var j=0;j<J.length;++j){var K=J[j];if(K&&K.length>0){for(var i=0,L=K.length;i<L;++i){var l=K[i];if(l&&l[this.EL]===el&&(!H||H===l[this.TYPE])){I.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
98 return (I.length)?I:null;},_unload:function(e){var EU=Roo.lib.Event,i,j,l,H,I;for(i=0,H=C.length;i<H;++i){l=C[i];if(l){var J=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){J=l[EU.OBJ];}else{J=l[EU.ADJ_SCOPE];}}l[EU.FN].call(J,EU.getEvent(e),l[EU.OBJ]);
99 C[i]=null;l=null;J=null;}}C=null;if(B&&B.length>0){j=B.length;while(j){I=j-1;l=B[I];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],I);}j=j-1;}l=null;EU.clearCache();}EU.doRemove(window,"unload",EU._unload);},getScroll:function(){var dd=document.documentElement,db=document.body;
100 if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}},doAdd:function(){if(window.addEventListener){return function(el,H,fn,I){el.addEventListener(H,fn,(I));};}else if(window.attachEvent){return function(el,H,fn,I){el.attachEvent("on"+H,fn);
101 };}else{return function(){};}}(),doRemove:function(){if(window.removeEventListener){return function(el,H,fn,I){el.removeEventListener(H,fn,(I));};}else if(window.detachEvent){return function(el,H,fn){el.detachEvent("on"+H,fn);};}else{return function(){};}
102 }()};}();(function(){var E=Roo.lib.Event;E.on=E.addListener;E.un=E.removeListener;if(document&&document.body){E._load();}else{E.doAdd(window,"load",E._load);}E.doAdd(window,"unload",E._unload);E._tryPreloadAttach();})();
103 // Roo/lib/Ajax.js
104 (function(){Roo.lib.Ajax={request:function(A,B,cb,C,D){if(D){var hs=D.headers;if(hs){for(var h in hs){if(hs.hasOwnProperty(h)){this.initHeader(h,hs[h],false);}}}if(D.xmlData){this.initHeader('Content-Type','text/xml',false);A='POST';C=D.xmlData;}}return this.asyncRequest(A,B,cb,C);
105 },serializeForm:function(A){if(typeof A=='string'){A=(document.getElementById(A)||document.forms[A]);}var el,B,C,D,E='',F=false;for(var i=0;i<A.elements.length;i++){el=A.elements[i];D=A.elements[i].disabled;B=A.elements[i].name;C=A.elements[i].value;if(!D&&B){switch(el.type){case 'select-one':case 'select-multiple':for(var j=0;
106 j<el.options.length;j++){if(el.options[j].selected){if(Roo.isIE){E+=Roo.encodeURIComponent(B)+'='+Roo.encodeURIComponent(el.options[j].attributes['value'].specified?el.options[j].value:el.options[j].text)+'&';}else{E+=Roo.encodeURIComponent(B)+'='+Roo.encodeURIComponent(el.options[j].hasAttribute('value')?el.options[j].value:el.options[j].text)+'&';
107 }}}break;case 'radio':case 'checkbox':if(el.checked){E+=Roo.encodeURIComponent(B)+'='+Roo.encodeURIComponent(C)+'&';}break;case 'file':case undefined:case 'reset':case 'button':break;case 'submit':if(F==false){E+=Roo.encodeURIComponent(B)+'='+Roo.encodeURIComponent(C)+'&';
108 F=true;}break;default:E+=Roo.encodeURIComponent(B)+'='+Roo.encodeURIComponent(C)+'&';break;}}}E=E.substr(0,E.length-1);return E;},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:'application/x-www-form-urlencoded',useDefaultXhrHeader:true,defaultXhrHeader:'XMLHttpRequest',hasDefaultHeaders:true,defaultHeaders:{}
109 ,poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(id){this.activeX.unshift(id);},setDefaultPostHeader:function(b){this.useDefaultHeader=b;},setDefaultXhrHeader:function(b){this.useDefaultXhrHeader=b;},setPollingInterval:function(i){if(typeof i=='number'&&isFinite(i)){this.pollInterval=i;
110 }},createXhrObject:function(A){var B,C;try{C=new XMLHttpRequest();B={conn:C,tId:A};}catch(e){for(var i=0;i<this.activeX.length;++i){try{C=new ActiveXObject(this.activeX[i]);B={conn:C,tId:A};break;}catch(e){}}}finally{return B;}},getConnectionObject:function(){var o;
111 var A=this.transactionId;try{o=this.createXhrObject(A);if(o){this.transactionId++;}}catch(e){}finally{return o;}},asyncRequest:function(A,B,C,D){var o=this.getConnectionObject();if(!o){return null;}else{o.conn.open(A,B,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders['X-Requested-With']){this.initHeader('X-Requested-With',this.defaultXhrHeader,true);
112 }}if(D&&this.useDefaultHeader){this.initHeader('Content-Type',this.defaultPostHeader);}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(o);}this.handleReadyState(o,C);o.conn.send(D||null);return o;}},handleReadyState:function(o,A){var B=this;if(A&&A.timeout){this.timeout[o.tId]=window.setTimeout(function(){B.abort(o,A,true);
113 },A.timeout);}this.poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(B.poll[o.tId]);delete B.poll[o.tId];if(A&&A.timeout){window.clearTimeout(B.timeout[o.tId]);delete B.timeout[o.tId];}B.handleTransactionResponse(o,A);
114 }},this.pollInterval);},handleTransactionResponse:function(o,A,B){if(!A){this.releaseObject(o);return;}var C,D;try{if(o.conn.status!==undefined&&o.conn.status!=0){C=o.conn.status;}else{C=13030;}}catch(e){C=13030;}if(C>=200&&C<300){D=this.createResponseObject(o,A.argument);
115 if(A.success){if(!A.scope){A.success(D);}else{A.success.apply(A.scope,[D]);}}}else{switch(C){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:D=this.createExceptionObject(o.tId,A.argument,(B?B:false));if(A.failure){if(!A.scope){A.failure(D);
116 }else{A.failure.apply(A.scope,[D]);}}break;default:D=this.createResponseObject(o,A.argument);if(A.failure){if(!A.scope){A.failure(D);}else{A.failure.apply(A.scope,[D]);}}}}this.releaseObject(o);D=null;},createResponseObject:function(o,A){var B={};var C={}
117 ;try{var D=o.conn.getAllResponseHeaders();var E=D.split('\n');for(var i=0;i<E.length;i++){var F=E[i].indexOf(':');if(F!=-1){C[E[i].substring(0,F)]=E[i].substring(F+2);}}}catch(e){}B.tId=o.tId;B.status=o.conn.status;B.statusText=o.conn.statusText;B.getResponseHeader=C;
118 B.getAllResponseHeaders=D;B.responseText=o.conn.responseText;B.responseXML=o.conn.responseXML;if(typeof A!==undefined){B.argument=A;}return B;},createExceptionObject:function(A,B,C){var D=0;var E='communication failure';var F=-1;var G='transaction aborted';
119 var H={};H.tId=A;if(C){H.status=F;H.statusText=G;}else{H.status=D;H.statusText=E;}if(B){H.argument=B;}return H;},initHeader:function(A,B,C){var D=(C)?this.defaultHeaders:this.headers;if(D[A]===undefined){D[A]=B;}else{D[A]=B+","+D[A];}if(C){this.hasDefaultHeaders=true;
120 }else{this.hasHeaders=true;}},setHeader:function(o){if(this.hasDefaultHeaders){for(var A in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(A)){o.conn.setRequestHeader(A,this.defaultHeaders[A]);}}}if(this.hasHeaders){for(var A in this.headers){if(this.headers.hasOwnProperty(A)){o.conn.setRequestHeader(A,this.headers[A]);
121 }}this.headers={};this.hasHeaders=false;}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false;},abort:function(o,A,B){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this.poll[o.tId]);
122 delete this.poll[o.tId];if(B){delete this.timeout[o.tId];}this.handleTransactionResponse(o,A,true);return true;}else{return false;}},isCallInProgress:function(o){if(o&&o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}else{return false;}},releaseObject:function(o){o.conn=null;
123 o=null;},activeX:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP']};})();
124 // Roo/lib/Region.js
125 Roo.lib.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};Roo.lib.Region.prototype={contains:function(A){return (A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);},getArea:function(){return ((this.bottom-this.top)*(this.right-this.left));
126 },intersect:function(A){var t=Math.max(this.top,A.top);var r=Math.min(this.right,A.right);var b=Math.min(this.bottom,A.bottom);var l=Math.max(this.left,A.left);if(b>=t&&r>=l){return new Roo.lib.Region(t,r,b,l);}else{return null;}},union:function(A){var t=Math.min(this.top,A.top);
127 var r=Math.max(this.right,A.right);var b=Math.max(this.bottom,A.bottom);var l=Math.min(this.left,A.left);return new Roo.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Roo.lib.Region.getRegion=function(el){var p=Roo.lib.Dom.getXY(el);
128 var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Roo.lib.Region(t,r,b,l);};
129 // Roo/lib/Point.js
130 Roo.lib.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};Roo.lib.Point.prototype=new Roo.lib.Region();
131 // Roo/lib/Anim.js
132 (function(){Roo.lib.Anim={scroll:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Scroll);},motion:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.Motion);},color:function(el,A,B,C,cb,D){this.run(el,A,B,C,cb,D,Roo.lib.ColorAnim);},run:function(el,A,B,C,cb,D,E){E=E||Roo.lib.AnimBase;
133 if(typeof C=="string"){C=Roo.lib.Easing[C];}var F=new E(el,A,B,C);F.animateX(function(){Roo.callback(cb,D);});return F;}};})();
134 // Roo/lib/AnimBase.js
135 (function(){var A;function fly(el){if(!A){A=new Roo.Element.Flyweight();}A.dom=el;return A;}Roo.lib.AnimBase=function(el,B,C,D){if(el){this.init(el,B,C,D);}};Roo.lib.AnimBase.fly=fly;Roo.lib.AnimBase.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;
136 return ("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(B,C,D){return this.method(this.currentFrame,C,D-C,this.totalFrames);
137 },setAttribute:function(B,C,D){if(this.patterns.noNegatives.test(B)){C=(C>0)?C:0;}Roo.fly(this.getEl(),'_anim').setStyle(B,C+D);},getAttribute:function(B){var el=this.getEl();var C=fly(el).getStyle(B);if(C!=='auto'&&!this.patterns.offsetUnit.test(C)){return parseFloat(C);
138 }var a=this.patterns.offsetAttribute.exec(B)||[];var D=!!(a[3]);var E=!!(a[2]);if(E||(fly(el).getStyle('position')=='absolute'&&D)){C=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{C=0;}return C;},getDefaultUnit:function(B){if(this.patterns.defaultUnit.test(B)){return 'px';
139 }return '';},animateX:function(B,C){var f=function(){this.onComplete.removeListener(f);if(typeof B=="function"){B.call(C||this,this);}};this.onComplete.addListener(f,this);this.animate();},setRuntimeAttribute:function(B){var C;var D;var E=this.attributes;
140 this.runtimeAttributes[B]={};var F=function(H){return (typeof H!=='undefined');};if(!F(E[B]['to'])&&!F(E[B]['by'])){return false;}C=(F(E[B]['from']))?E[B]['from']:this.getAttribute(B);if(F(E[B]['to'])){D=E[B]['to'];}else if(F(E[B]['by'])){if(C.constructor==Array){D=[];
141 for(var i=0,G=C.length;i<G;++i){D[i]=C[i]+E[B]['by'][i];}}else{D=C+E[B]['by'];}}this.runtimeAttributes[B].start=C;this.runtimeAttributes[B].end=D;this.runtimeAttributes[B].unit=(F(E[B].unit))?E[B]['unit']:this.getDefaultUnit(B);},init:function(el,B,C,D){var E=false;
142 var F=null;var G=0;el=Roo.getDom(el);this.attributes=B||{};this.duration=C||1;this.method=D||Roo.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Roo.lib.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return E;
143 };this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Roo.lib.AnimMgr.fps*this.duration):this.duration;Roo.lib.AnimMgr.registerElement(this);
144 };this.stop=function(K){if(K){this.currentFrame=this.totalFrames;this._onTween.fire();}Roo.lib.AnimMgr.stop(this);};var H=function(){this.onStart.fire();this.runtimeAttributes={};for(var K in this.attributes){this.setRuntimeAttribute(K);}E=true;G=0;F=new Date();
145 };var I=function(){var K={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};K.toString=function(){return ('duration: '+K.duration+', currentFrame: '+K.currentFrame);};this.onTween.fire(K);var L=this.runtimeAttributes;for(var M in L){this.setAttribute(M,this.doMethod(M,L[M].start,L[M].end),L[M].unit);
146 }G+=1;};var J=function(){var K=(new Date()-F)/1000;var L={duration:K,frames:G,fps:G/K};L.toString=function(){return ('duration: '+L.duration+', frames: '+L.frames+', fps: '+L.fps);};E=false;G=0;this.onComplete.fire(L);};this._onStart=new Roo.util.Event(this);
147 this.onStart=new Roo.util.Event(this);this.onTween=new Roo.util.Event(this);this._onTween=new Roo.util.Event(this);this.onComplete=new Roo.util.Event(this);this._onComplete=new Roo.util.Event(this);this._onStart.addListener(H);this._onTween.addListener(I);
148 this._onComplete.addListener(J);}};})();
149 // Roo/lib/AnimMgr.js
150 Roo.lib.AnimMgr=new function(){var A=null;var B=[];var C=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;C+=1;F._onStart.fire();this.start();};this.unRegister=function(F,G){F._onComplete.fire();G=G||D(F);if(G!=-1){B.splice(G,1);
151 }C-=1;if(C<=0){this.stop();}};this.start=function(){if(A===null){A=setInterval(this.run,this.delay);}};this.stop=function(F){if(!F){clearInterval(A);for(var i=0,G=B.length;i<G;++i){if(B[0].isAnimated()){this.unRegister(B[0],0);}}B=[];A=null;C=0;}else{this.unRegister(F);
152 }};this.run=function(){for(var i=0,F=B.length;i<F;++i){var G=B[i];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){E(G);}G._onTween.fire();}else{Roo.lib.AnimMgr.stop(G,i);}}};var D=function(F){for(var i=0,G=B.length;
153 i<G;++i){if(B[i]==F){return i;}}return -1;};var E=function(F){var G=F.totalFrames;var H=F.currentFrame;var I=(F.currentFrame*F.duration*1000/F.totalFrames);var J=(new Date()-F.getStartTime());var K=0;if(J<F.duration*1000){K=Math.round((J/I-1)*F.currentFrame);
154 }else{K=G-(H+1);}if(K>0&&isFinite(K)){if(F.currentFrame+K>=G){K=G-(H+1);}F.currentFrame+=K;}};};
155 // Roo/lib/Beizer.js
156 Roo.lib.Bezier=new function(){this.getPosition=function(A,t){var n=A.length;var B=[];for(var i=0;i<n;++i){B[i]=[A[i][0],A[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){B[i][0]=(1-t)*B[i][0]+t*B[parseInt(i+1,10)][0];B[i][1]=(1-t)*B[i][1]+t*B[parseInt(i+1,10)][1];
157 }}return [B[0][0],B[0][1]];};};
158 // Roo/lib/ColorAnim.js
159 (function(){Roo.lib.ColorAnim=function(el,D,E,F){Roo.lib.ColorAnim.superclass.constructor.call(this,el,D,E,F);};Roo.extend(Roo.lib.ColorAnim,Roo.lib.AnimBase);var A=Roo.lib.AnimBase.fly;var Y=Roo.lib;var B=Y.ColorAnim.superclass;var C=Y.ColorAnim.prototype;
160 C.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return ("ColorAnim "+id);};C.patterns.color=/color$/i;C.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;C.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;C.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
161 C.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;C.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return [parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return [parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];
162 }c=this.patterns.hex3.exec(s);if(c&&c.length==4){return [parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};C.getAttribute=function(D){var el=this.getEl();if(this.patterns.color.test(D)){var E=A(el).getStyle(D);if(this.patterns.transparent.test(E)){var F=el.parentNode;
163 E=A(F).getStyle(D);while(F&&this.patterns.transparent.test(E)){F=F.parentNode;E=A(F).getStyle(D);if(F.tagName.toUpperCase()=='HTML'){E='#fff';}}}}else{E=B.getAttribute.call(this,D);}return E;};C.getAttribute=function(D){var el=this.getEl();if(this.patterns.color.test(D)){var E=A(el).getStyle(D);
164 if(this.patterns.transparent.test(E)){var F=el.parentNode;E=A(F).getStyle(D);while(F&&this.patterns.transparent.test(E)){F=F.parentNode;E=A(F).getStyle(D);if(F.tagName.toUpperCase()=='HTML'){E='#fff';}}}}else{E=B.getAttribute.call(this,D);}return E;};C.doMethod=function(D,E,F){var G;
165 if(this.patterns.color.test(D)){G=[];for(var i=0,H=E.length;i<H;++i){G[i]=B.doMethod.call(this,D,E[i],F[i]);}G='rgb('+Math.floor(G[0])+','+Math.floor(G[1])+','+Math.floor(G[2])+')';}else{G=B.doMethod.call(this,D,E,F);}return G;};C.setRuntimeAttribute=function(D){B.setRuntimeAttribute.call(this,D);
166 if(this.patterns.color.test(D)){var E=this.attributes;var F=this.parseColor(this.runtimeAttributes[D].start);var G=this.parseColor(this.runtimeAttributes[D].end);if(typeof E[D]['to']==='undefined'&&typeof E[D]['by']!=='undefined'){G=this.parseColor(E[D].by);
167 for(var i=0,H=F.length;i<H;++i){G[i]=F[i]+G[i];}}this.runtimeAttributes[D].start=F;this.runtimeAttributes[D].end=G;}};})();
168 // Roo/lib/Easing.js
169 Roo.lib.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;
170 },easeOutStrong:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*.3;
171 }if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*.3;}if(!a||a<Math.abs(c)){a=c;
172 var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;
173 }else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;
174 }return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;
175 }return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-Roo.lib.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;
176 }else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return Roo.lib.Easing.bounceIn(t*2,0,c,d)*.5+b;}return Roo.lib.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;
177 }};
178 // Roo/lib/Motion.js
179 (function(){Roo.lib.Motion=function(el,E,F,G){if(el){Roo.lib.Motion.superclass.constructor.call(this,el,E,F,G);}};Roo.extend(Roo.lib.Motion,Roo.lib.ColorAnim);var Y=Roo.lib;var A=Y.Motion.superclass;var B=Y.Motion.prototype;B.toString=function(){var el=this.getEl();
180 var id=el.id||el.tagName;return ("Motion "+id);};B.patterns.points=/^points$/i;B.setAttribute=function(E,F,G){if(this.patterns.points.test(E)){G=G||'px';A.setAttribute.call(this,'left',F[0],G);A.setAttribute.call(this,'top',F[1],G);}else{A.setAttribute.call(this,E,F,G);
181 }};B.getAttribute=function(E){if(this.patterns.points.test(E)){var F=[A.getAttribute.call(this,'left'),A.getAttribute.call(this,'top')];}else{F=A.getAttribute.call(this,E);}return F;};B.doMethod=function(E,F,G){var H=null;if(this.patterns.points.test(E)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;
182 H=Y.Bezier.getPosition(this.runtimeAttributes[E],t);}else{H=A.doMethod.call(this,E,F,G);}return H;};B.setRuntimeAttribute=function(E){if(this.patterns.points.test(E)){var el=this.getEl();var F=this.attributes;var G;var H=F['points']['control']||[];var I;var i,J;
183 if(H.length>0&&!(H[0] instanceof Array)){H=[H];}else{var K=[];for(i=0,J=H.length;i<J;++i){K[i]=H[i];}H=K;}Roo.fly(el).position();if(D(F['points']['from'])){Roo.lib.Dom.setXY(el,F['points']['from']);}else{Roo.lib.Dom.setXY(el,Roo.lib.Dom.getXY(el));}G=this.getAttribute('points');
184 if(D(F['points']['to'])){I=C.call(this,F['points']['to'],G);var L=Roo.lib.Dom.getXY(this.getEl());for(i=0,J=H.length;i<J;++i){H[i]=C.call(this,H[i],G);}}else if(D(F['points']['by'])){I=[G[0]+F['points']['by'][0],G[1]+F['points']['by'][1]];for(i=0,J=H.length;
185 i<J;++i){H[i]=[G[0]+H[i][0],G[1]+H[i][1]];}}this.runtimeAttributes[E]=[G];if(H.length>0){this.runtimeAttributes[E]=this.runtimeAttributes[E].concat(H);}this.runtimeAttributes[E][this.runtimeAttributes[E].length]=I;}else{A.setRuntimeAttribute.call(this,E);
186 }};var C=function(E,F){var G=Roo.lib.Dom.getXY(this.getEl());E=[E[0]-G[0]+F[0],E[1]-G[1]+F[1]];return E;};var D=function(E){return (typeof E!=='undefined');};})();
187 // Roo/lib/Scroll.js
188 (function(){Roo.lib.Scroll=function(el,C,D,E){if(el){Roo.lib.Scroll.superclass.constructor.call(this,el,C,D,E);}};Roo.extend(Roo.lib.Scroll,Roo.lib.ColorAnim);var Y=Roo.lib;var A=Y.Scroll.superclass;var B=Y.Scroll.prototype;B.toString=function(){var el=this.getEl();
189 var id=el.id||el.tagName;return ("Scroll "+id);};B.doMethod=function(C,D,E){var F=null;if(C=='scroll'){F=[this.method(this.currentFrame,D[0],E[0]-D[0],this.totalFrames),this.method(this.currentFrame,D[1],E[1]-D[1],this.totalFrames)];}else{F=A.doMethod.call(this,C,D,E);
190 }return F;};B.getAttribute=function(C){var D=null;var el=this.getEl();if(C=='scroll'){D=[el.scrollLeft,el.scrollTop];}else{D=A.getAttribute.call(this,C);}return D;};B.setAttribute=function(C,D,E){var el=this.getEl();if(C=='scroll'){el.scrollLeft=D[0];el.scrollTop=D[1];
191 }else{A.setAttribute.call(this,C,D,E);}};})();
192 // Roo/DomHelper.js
193 if(typeof Range!="undefined"&&typeof Range.prototype.createContextualFragment=="undefined"){Range.prototype.createContextualFragment=function(A){var B=window.document;var C=B.createElement("div");C.innerHTML=A;var D=B.createDocumentFragment(),n;while((n=C.firstChild)){D.appendChild(n);
194 }return D;};}Roo.DomHelper=function(){var A=null;var B=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var C=/^table|tbody|tr|td$/i;var D={};var E=function(o){if(typeof o=='string'){return o;}var b="";if(!o.tag){o.tag="div";}b+="<"+o.tag;
195 for(var M in o){if(M=="tag"||M=="children"||M=="cn"||M=="html"||typeof o[M]=="function"){continue;}if(M=="style"){var s=o["style"];if(typeof s=="function"){s=s.call();}if(typeof s=="string"){b+=' style="'+s+'"';}else if(typeof s=="object"){b+=' style="';for(var N in s){if(typeof s[N]!="function"){b+=N+":"+s[N]+";";
196 }}b+='"';}}else{if(M=="cls"){b+=' class="'+o["cls"]+'"';}else if(M=="htmlFor"){b+=' for="'+o["htmlFor"]+'"';}else{b+=" "+M+'="'+o[M]+'"';}}}if(B.test(o.tag)){b+="/>";}else{b+=">";var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,O=cn.length;
197 i<O;i++){b+=E(cn[i],b);}}else{b+=E(cn,b);}}if(o.html){b+=o.html;}b+="</"+o.tag+">";}return b;};var F=function(o,M){var ns=false;if(o.ns&&o.ns!='html'){if(o.xmlns&&typeof(D[o.ns])=='undefined'){D[o.ns]=o.xmlns;ns=o.xmlns;}if(typeof(D[o.ns])=='undefined'){console.log("Trying to create namespace element "+o.ns+", however no xmlns was sent to builder previously");
198 }ns=D[o.ns];}if(typeof(o)=='string'){return M.appendChild(document.createTextNode(o));}o.tag=o.tag||div;if(o.ns&&Roo.isIE){ns=false;o.tag=o.ns+':'+o.tag;}var el=ns?document.createElementNS(ns,o.tag||'div'):document.createElement(o.tag||'div');var N=el.setAttribute?true:false;
199 for(var O in o){if(O=="tag"||O=="ns"||O=="xmlns"||O=="children"||O=="cn"||O=="html"||O=="style"||typeof o[O]=="function"){continue;}if(O=="cls"&&Roo.isIE){el.className=o["cls"];}else{if(N){el.setAttribute(O=="cls"?'class':O,o[O]);}else{el[O]=o[O];}}}Roo.DomHelper.applyStyles(el,o.style);
200 var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(cn.join)=="function")){for(var i=0,P=cn.length;i<P;i++){F(cn[i],el);}}else{F(cn,el);}}if(o.html){el.innerHTML=o.html;}if(M){M.appendChild(el);}return el;};var G=function(M,s,h,e){A.innerHTML=[s,h,e].join('');
201 var i=-1,el=A;while(++i<M){el=el.firstChild;}return el;};var ts='<table>',te='</table>',H=ts+'<tbody>',I='</tbody>'+te,J=H+'<tr>',K='</tr>'+I;var L=function(M,N,el,O){if(!A){A=document.createElement('div');}var P;var Q=null;if(M=='td'){if(N=='afterbegin'||N=='beforeend'){return;
202 }if(N=='beforebegin'){Q=el;el=el.parentNode;}else{Q=el.nextSibling;el=el.parentNode;}P=G(4,J,O,K);}else if(M=='tr'){if(N=='beforebegin'){Q=el;el=el.parentNode;P=G(3,H,O,I);}else if(N=='afterend'){Q=el.nextSibling;el=el.parentNode;P=G(3,H,O,I);}else{if(N=='afterbegin'){Q=el.firstChild;
203 }P=G(4,J,O,K);}}else if(M=='tbody'){if(N=='beforebegin'){Q=el;el=el.parentNode;P=G(2,ts,O,te);}else if(N=='afterend'){Q=el.nextSibling;el=el.parentNode;P=G(2,ts,O,te);}else{if(N=='afterbegin'){Q=el.firstChild;}P=G(3,H,O,I);}}else{if(N=='beforebegin'||N=='afterend'){return;
204 }if(N=='afterbegin'){Q=el.firstChild;}P=G(2,ts,O,te);}el.insertBefore(P,Q);return P;};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,M){if(M){el=Roo.fly(el);if(typeof M=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var N;
205 while((N=re.exec(M))!=null){el.setStyle(N[1],N[2]);}}else if(typeof M=="object"){for(var O in M){el.setStyle(O,M[O]);}}else if(typeof M=="function"){Roo.DomHelper.applyStyles(el,M.call());}}},insertHtml:function(M,el,N){M=M.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;
206 if(rs=L(el.tagName.toLowerCase(),M,el,N)){return rs;}}switch(M){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',N);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',N);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',N);
207 return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',N);return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';}var O=el.ownerDocument.createRange();var P;switch(M){case "beforebegin":O.setStartBefore(el);P=O.createContextualFragment(N);
208 el.parentNode.insertBefore(P,el);return el.previousSibling;case "afterbegin":if(el.firstChild){O.setStartBefore(el.firstChild);P=O.createContextualFragment(N);el.insertBefore(P,el.firstChild);return el.firstChild;}else{el.innerHTML=N;return el.firstChild;
209 }case "beforeend":if(el.lastChild){O.setStartAfter(el.lastChild);P=O.createContextualFragment(N);el.appendChild(P);return el.lastChild;}else{el.innerHTML=N;return el.lastChild;}case "afterend":O.setStartAfter(el);P=O.createContextualFragment(N);el.parentNode.insertBefore(P,el.nextSibling);
210 return el.nextSibling;}throw 'Illegal insertion point -> "'+M+'"';},insertBefore:function(el,o,M){return this.doInsert(el,o,M,"beforeBegin");},insertAfter:function(el,o,M){return this.doInsert(el,o,M,"afterEnd","nextSibling");},insertFirst:function(el,o,M){return this.doInsert(el,o,M,"afterBegin");
211 },doInsert:function(el,o,M,N,O){el=Roo.getDom(el);var P;if(this.useDom||o.ns){P=F(o,null);el.parentNode.insertBefore(P,O?el[O]:el);}else{var Q=E(o);P=this.insertHtml(N,el,Q);}return M?Roo.get(P,true):P;},append:function(el,o,M){el=Roo.getDom(el);var N;if(this.useDom||o.ns){N=F(o,null);
212 el.appendChild(N);}else{var O=E(o);N=this.insertHtml("beforeEnd",el,O);}return M?Roo.get(N,true):N;},overwrite:function(el,o,M){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}F(o,el);}else{el.innerHTML=E(o);}return M?Roo.get(el.firstChild,true):el.firstChild;
213 },createTemplate:function(o){var M=E(o);return new Roo.Template(M);}};}();
214 // Roo/Template.js
215 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else{this.html=A;}if(this.url){this.load();}};Roo.Template.prototype={url:false,html:'',applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);
216 }var B=this.disableFormats!==true;var fm=Roo.util.Format,C=this;var fn=function(m,D,E,F){if(E&&B){if(E.substr(0,5)=="this."){return C.call(E.substr(5),A[D],A);}else{if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,G=F.length;i<G;i++){F[i]=F[i].replace(re,"$1");
217 }F=[A[D]].concat(F);}else{F=[A[D]];}return fm[E].apply(fm,F);}}else{return A[D]!==undefined?A[D]:"";}};return this.html.replace(this.re,fn);}catch(e){Roo.log(e);throw e;}},loading:false,load:function(){if(this.loading){return;}var _t=this;this.loading=true;
218 this.compiled=false;var cx=new Roo.data.Connection();cx.request({url:this.url,method:'GET',success:function(A){_t.loading=false;_t.html=A.responseText;_t.url=false;_t.compile();},failure:function(A){Roo.log("Template failed to load from "+_t.url);_t.loading=false;
219 }});},set:function(A,B){this.html=A;this.compiled=null;if(B){this.compile();}return this;},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Roo.util.Format;var A=this.disableFormats!==true;var B=Roo.isGecko?"+":",";
220 var fn=function(m,D,E,F){if(E&&A){F=F?','+F:"";if(E.substr(0,5)!="this."){E="fm."+E+'(';}else{E='this.call("'+E.substr(5)+'", ';F=", values";}}else{F='';E="(values['"+D+"'] == undefined ? '' : ";}return "'"+B+E+"values['"+D+"']"+F+")"+B+"'";};var C;if(Roo.isGecko){C="this.compiled = function(values){ return '"+this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};";
221 }else{C=["this.compiled = function(values){ return ['"];C.push(this.html.replace(/\\/g,'\\\\').replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));C.push("'].join('');};");C=C.join('');}eval(C);return this;},call:function(A,B,C){return this[A](B,C);
222 },insertFirst:function(el,A,B){return this.doInsert('afterBegin',el,A,B);},insertBefore:function(el,A,B){return this.doInsert('beforeBegin',el,A,B);},insertAfter:function(el,A,B){return this.doInsert('afterEnd',el,A,B);},append:function(el,A,B){return this.doInsert('beforeEnd',el,A,B);
223 },doInsert:function(A,el,B,C){el=Roo.getDom(el);var D=Roo.DomHelper.insertHtml(A,el,this.applyTemplate(B));return C?Roo.get(D,true):D;},overwrite:function(el,A,B){el=Roo.getDom(el);el.innerHTML=this.applyTemplate(A);return B?Roo.get(el.firstChild,true):el.firstChild;
224 }};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);};
225 // Roo/DomQuery.js
226 Roo.DomQuery=function(){var A={},B={},C={};var D=/\S/;var E=/^\s+|\s+$/g;var F=/\{(\d+)\}/g;var G=/^(\s?[\/>+~]\s?|\s|$)/;var H=/^(#)?([\w-\*]+)/;var I=/(\d*)n\+?(\d*)/,J=/\D/;function child(p,M){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==M){return n;
227 }}n=n.nextSibling;}return null;};function next(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function prev(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!D.test(n.nodeValue)){d.removeChild(n);
228 }else{n.nodeIndex=++ni;}n=nx;}return this;};function byClassName(c,a,v){if(!v){return c;}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((' '+ci.className+' ').indexOf(v)!=-1){r[++ri]=ci;}}return r;};function attrValue(n,M){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];
229 }if(!n){return null;}if(M=="for"){return n.htmlFor;}if(M=="class"||M=="className"){return n.className;}return n.getAttribute(M)||n[M];};function getNodes(ns,M,N){var O=[],ri=-1,cs;if(!ns){return O;}N=N||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];
230 }if(!M){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(N);for(var j=0,ci;ci=cs[j];j++){O[++ri]=ci;}}}else if(M=="/"||M==">"){var P=N.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==P||cj.nodeName==N||N=='*'){O[++ri]=cj;
231 }}}}else if(M=="+"){var P=N.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(n&&(n.nodeName==P||n.nodeName==N||N=='*')){O[++ri]=n;}}}else if(M=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(N=='*'||n.tagName.toLowerCase()!=N)));
232 if(n){O[++ri]=n;}}}return O;};function concat(a,b){if(b.slice){return a.concat(b);}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i];}return a;}function byTag(cs,M){if(cs.tagName||cs==document){cs=[cs];}if(!M){return cs;}var r=[],ri=-1;M=M.toLowerCase();for(var i=0,ci;
233 ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==M){r[++ri]=ci;}}return r;};function byId(cs,M,id){if(cs.tagName||cs==document){cs=[cs];}if(!id){return cs;}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r;}}return r;
234 };function byAttribute(cs,M,N,op,O){var r=[],ri=-1,st=O=="{";var f=Roo.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Roo.DomQuery.getStyle(ci,M);}else if(M=="class"||M=="className"){a=ci.className;}else if(M=="for"){a=ci.htmlFor;}else if(M=="href"){a=ci.getAttribute("href",2);
235 }else{a=ci.getAttribute(M);}if((f&&f(a,N))||(!f&&a)){r[++ri]=ci;}}return r;};function byPseudo(cs,M,N){return Roo.DomQuery.pseudos[M](cs,N);};var K=window.ActiveXObject?true:false;var batch=30803;var L=30803;function nodupIEXml(cs){var d=++L;cs[0].setAttribute("_nodup",d);
236 var r=[cs[0]];for(var i=1,M=cs.length;i<M;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c;}}for(var i=0,M=cs.length;i<M;i++){cs[i].removeAttribute("_nodup");}return r;}function nodup(cs){if(!cs){return [];}var M=cs.length,c,i,r=cs,cj,ri=-1;
237 if(!M||typeof cs.nodeType!="undefined"||M==1){return cs;}if(K&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs);}var d=++L;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d;}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j];}for(j=i+1;
238 cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj;}}return r;}}return r;}function quickDiffIEXml(c1,c2){var d=++L;for(var i=0,M=c1.length;i<M;i++){c1[i].setAttribute("_qdiff",d);}var r=[];for(var i=0,M=c2.length;i<M;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i];
239 }}for(var i=0,M=c1.length;i<M;i++){c1[i].removeAttribute("_qdiff");}return r;}function quickDiff(c1,c2){var M=c1.length;if(!M){return c2;}if(K&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2);}var d=++L;for(var i=0;i<M;i++){c1[i]._qdiff=d;}var r=[];for(var i=0,N=c2.length;
240 i<N;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i];}}return r;}function quickId(ns,M,N,id){if(ns==N){var d=N.ownerDocument||N;return d.getElementById(id);}ns=getNodes(ns,M,"*");return byId(ns,null,id);}return {getStyle:function(el,M){return Roo.fly(el).getStyle(M);
241 },compile:function(M,N){N=N||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=M,mode,lq;var tk=Roo.DomQuery.matchers;var O=tk.length;var mm;var P=q.match(G);if(P&&P[1]){fn[fn.length]='mode="'+P[1].replace(E,"")+'";';
242 q=q.replace(P[1],"");}while(M.substr(0,1)=="/"){M=M.substr(1);}while(q&&lq!=q){lq=q;var tm=q.match(H);if(N=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");';}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");';
243 }q=q.replace(tm[0],"");}else if(q.substr(0,1)!='@'){fn[fn.length]='n = getNodes(n, mode, "*");';}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");';}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");';}q=q.replace(tm[0],"");}}while(!(mm=q.match(G))){var Q=false;
244 for(var j=0;j<O;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(F,function(x,i){return m[i];});q=q.replace(m[0],"");Q=true;break;}}if(!Q){throw 'Error parsing selector, parsing failed at "'+q+'"';}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(E,"")+'";';
245 q=q.replace(mm[1],"");}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f;},select:function(M,N,O){if(!N||N==document){N=document;}if(typeof N=="string"){N=document.getElementById(N);}var P=M.split(",");var Q=[];for(var i=0,R=P.length;i<R;i++){var p=P[i].replace(E,"");
246 if(!A[p]){A[p]=Roo.DomQuery.compile(p);if(!A[p]){throw p+" is not a valid selector";}}var S=A[p](N);if(S&&S!=document){Q=Q.concat(S);}}if(P.length>1){return nodup(Q);}return Q;},selectNode:function(M,N){return Roo.DomQuery.select(M,N)[0];},selectValue:function(M,N,O){M=M.replace(E,"");
247 if(!C[M]){C[M]=Roo.DomQuery.compile(M,"select");}var n=C[M](N);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return ((v===null||v===undefined||v==='')?O:v);},selectNumber:function(M,N,O){var v=Roo.DomQuery.selectValue(M,N,O||0);return parseFloat(v);
248 },is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);}var M=(el instanceof Array);var N=Roo.DomQuery.filter(M?el:[el],ss);return M?(N.length==el.length):(N.length>0);},filter:function(M,ss,N){ss=ss.replace(E,"");if(!B[ss]){B[ss]=Roo.DomQuery.compile(ss,"simple");
249 }var O=B[ss](M);return N?quickDiff(O,M):O;},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'}
250 ,{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v;},"!=":function(a,v){return a!=v;},"^=":function(a,v){return a&&a.substr(0,v.length)==v;
251 },"$=":function(a,v){return a&&a.substr(a.length-v.length)==v;},"*=":function(a,v){return a&&a.indexOf(v)!==-1;},"%=":function(a,v){return (a%v)==0;},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+'-');},"~=":function(a,v){return a&&(' '+a+' ').indexOf(' '+v+' ')!=-1;
252 }},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1);if(!n){r[++ri]=ci;}}return r;},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);
253 if(!n){r[++ri]=ci;}}return r;},"nth-child":function(c,a){var r=[],ri=-1;var m=I.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!J.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;
254 cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j;}}pn._batch=batch;}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n;}}else if((n.nodeIndex+l)%f==0){r[++ri]=n;}}return r;},"only-child":function(c){var r=[],ri=-1;;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci;
255 }}return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var M=ci.childNodes,j=0,cn,N=true;while(cn=M[j]){++j;if(cn.nodeType==1||cn.nodeType==3){N=false;break;}}if(N){r[++ri]=ci;}}return r;},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;
256 ci=c[i];i++){if((ci.textContent||ci.innerText||'').indexOf(v)!=-1){r[++ri]=ci;}}return r;},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci;}}return r;},"checked":function(c){var r=[],ri=-1;
257 for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci;}}return r;},"not":function(c,ss){return Roo.DomQuery.filter(c,ss,true);},"odd":function(c){return this["nth-child"](c,"odd");},"even":function(c){return this["nth-child"](c,"even");},"nth":function(c,a){return c[a-1]||[];
258 },"first":function(c){return c[0]||[];},"last":function(c){return c[c.length-1]||[];},"has":function(c,ss){var s=Roo.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci;}}return r;},"next":function(c,ss){var is=Roo.DomQuery.is;
259 var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;},"prev":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;}}};}();Roo.query=Roo.DomQuery.select;
260
261 // Roo/util/Observable.js
262 Roo.util.Observable=function(A){A=A||{};this.addEvents(A.events||{});if(A.events){delete A.events;}Roo.apply(this,A);if(this.listeners){this.on(this.listeners);delete this.listeners;}};Roo.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()];
263 if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1));}else{return true;}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(A,fn,B,o){if(typeof A=="object"){o=A;for(var e in o){if(this.filterOptRe.test(e)){continue;
264 }if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o);}else{this.addListener(e,o[e].fn,o[e].scope,o[e]);}}return;}o=(!o||typeof o=="boolean")?{}:o;A=A.toLowerCase();var ce=this.events[A]||true;if(typeof ce=="boolean"){ce=new Roo.util.Event(this,A);
265 this.events[A]=ce;}ce.addListener(fn,B,o);},removeListener:function(A,fn,B){var ce=this.events[A.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,B);}},purgeListeners:function(){for(var A in this.events){if(typeof this.events[A]=="object"){this.events[A].clearListeners();
266 }}},relayEvents:function(o,A){var B=function(E){return function(){return this.fireEvent.apply(this,Roo.combine(E,Array.prototype.slice.call(arguments,0)));};};for(var i=0,C=A.length;i<C;i++){var D=A[i];if(!this.events[D]){this.events[D]=true;};o.on(D,B(D),this);
267 }},addEvents:function(o){if(!this.events){this.events={};}Roo.applyIf(this.events,o);},hasListener:function(A){var e=this.events[A];return typeof e=="object"&&e.listeners.length>0;}};Roo.util.Observable.prototype.on=Roo.util.Observable.prototype.addListener;
268 Roo.util.Observable.prototype.un=Roo.util.Observable.prototype.removeListener;Roo.util.Observable.capture=function(o,fn,A){o.fireEvent=o.fireEvent.createInterceptor(fn,A);};Roo.util.Observable.releaseCapture=function(o){o.fireEvent=Roo.util.Observable.prototype.fireEvent;
269 };(function(){var A=function(h,o,D){var E=new Roo.util.DelayedTask();return function(){E.delay(o.buffer,h,D,Array.prototype.slice.call(arguments,0));};};var B=function(h,e,fn,D){return function(){e.removeListener(fn,D);return h.apply(D,arguments);};};var C=function(h,o,D){return function(){var E=Array.prototype.slice.call(arguments,0);
270 setTimeout(function(){h.apply(D,E);},o.delay||10);};};Roo.util.Event=function(D,E){this.name=E;this.obj=D;this.listeners=[];};Roo.util.Event.prototype={addListener:function(fn,D,E){var o=E||{};D=D||this.obj;if(!this.isListening(fn,D)){var l={fn:fn,scope:D,options:o}
271 ;var h=fn;if(o.delay){h=C(h,o,D);}if(o.single){h=B(h,this,fn,D);}if(o.buffer){h=A(h,o,D);}l.fireFn=h;if(!this.firing){this.listeners.push(l);}else{this.listeners=this.listeners.slice(0);this.listeners.push(l);}}},findListener:function(fn,D){D=D||this.obj;
272 var ls=this.listeners;for(var i=0,E=ls.length;i<E;i++){var l=ls[i];if(l.fn==fn&&l.scope==D){return i;}}return -1;},isListening:function(fn,D){return this.findListener(fn,D)!=-1;},removeListener:function(fn,D){var E;if((E=this.findListener(fn,D))!=-1){if(!this.firing){this.listeners.splice(E,1);
273 }else{this.listeners=this.listeners.slice(0);this.listeners.splice(E,1);}return true;}return false;},clearListeners:function(){this.listeners=[];},fire:function(){var ls=this.listeners,D,E=ls.length;if(E>0){this.firing=true;var F=Array.prototype.slice.call(arguments,0);
274 for(var i=0;i<E;i++){var l=ls[i];if(l.fireFn.apply(l.scope||this.obj||window,F)===false){this.firing=false;return false;}}this.firing=false;}return true;}};})();
275 // Roo/Document.js
276 Roo.Document=function(A){this.addEvents({'ready':true});Roo.util.Observable.call(this,A);var B=this;Roo.onReady(function(){B.fireEvent('ready');},null,false);};Roo.extend(Roo.Document,Roo.util.Observable,{});
277 // Roo/EventManager.js
278 Roo.EventManager=function(){var A,B,C=false;var F,G,H,I;var E=Roo.lib.Event;var D=Roo.lib.Dom;var J=function(){if(!C){C=true;Roo.isReady=true;if(B){clearInterval(B);}if(Roo.isGecko||Roo.isOpera){document.removeEventListener("DOMContentLoaded",J,false);}if(Roo.isIE){var T=document.getElementById("ie-deferred-loader");
279 if(T){T.onreadystatechange=null;T.parentNode.removeChild(T);}}if(A){A.fire();A.clearListeners();}}};var K=function(){A=new Roo.util.Event();if(Roo.isGecko||Roo.isOpera){document.addEventListener("DOMContentLoaded",J,false);}else if(Roo.isIE){document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
280 var T=document.getElementById("ie-deferred-loader");T.onreadystatechange=function(){if(this.readyState=="complete"){J();}};}else if(Roo.isSafari){B=setInterval(function(){var rs=document.readyState;if(rs=="complete"){J();}},10);}E.on(window,"load",J);};var L=function(h,o){var T=new Roo.util.DelayedTask(h);
281 return function(e){e=new Roo.EventObjectImpl(e);T.delay(o.buffer,h,null,[e]);};};var M=function(h,el,T,fn){return function(e){Roo.EventManager.removeListener(el,T,fn);h(e);};};var N=function(h,o){return function(e){e=new Roo.EventObjectImpl(e);setTimeout(function(){h(e);
282 },o.delay||10);};};var O=false;var P=function(){if(O){return O;}var el=document.createElement('div');var T={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'};for(var U in T){if(el.style[U]!==undefined){O=T[U];
283 return O;}}};var listen=function(T,U,V,fn,W){var o=(!V||typeof V=="boolean")?{}:V;fn=fn||o.fn;W=W||o.scope;var el=Roo.getDom(T);if(!el){throw "Error listening for \""+U+'\". Element "'+T+'" doesn\'t exist.';}if(U=='transitionend'){U=P();}var h=function(e){e=Roo.EventObject.setEvent(e);
284 var t;if(o.delegate){t=e.getTarget(o.delegate,el);if(!t){return;}}else{t=e.target;}if(o.stopEvent===true){e.stopEvent();}if(o.preventDefault===true){e.preventDefault();}if(o.stopPropagation===true){e.stopPropagation();}if(o.normalized===false){e=e.browserEvent;
285 }fn.call(W||el,e,t,o);};if(o.delay){h=N(h,o);}if(o.single){h=M(h,el,U,fn);}if(o.buffer){h=L(h,o);}fn._handlers=fn._handlers||[];fn._handlers.push([Roo.id(el),U,h]);E.on(el,U,h);if(U=="mousewheel"&&el.addEventListener){el.addEventListener("DOMMouseScroll",h,false);
286 E.on(window,'unload',function(){el.removeEventListener("DOMMouseScroll",h,false);});}if(U=="mousedown"&&el==document){Roo.EventManager.stoppedMouseDownEvent.addListener(h);}return h;};var Q=function(el,T,fn){var id=Roo.id(el),U=fn._handlers,hd=fn;if(U){for(var i=0,V=U.length;
287 i<V;i++){var h=U[i];if(h[0]==id&&h[1]==T){hd=h[2];U.splice(i,1);break;}}}E.un(el,T,hd);el=Roo.getDom(el);if(T=="mousewheel"&&el.addEventListener){el.removeEventListener("DOMMouseScroll",hd,false);}if(T=="mousedown"&&el==document){Roo.EventManager.stoppedMouseDownEvent.removeListener(hd);
288 }};var R=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var S={wrap:function(fn,T,U){return function(e){Roo.EventObject.setEvent(e);fn.call(U?T||window:window,Roo.EventObject,T);};},addListener:function(T,U,fn,V,W){if(typeof U=="object"){var o=U;
289 for(var e in o){if(R.test(e)){continue;}if(typeof o[e]=="function"){listen(T,e,o,o[e],o.scope);}else{listen(T,e,o[e]);}}return;}return listen(T,U,W,fn,V);},removeListener:function(T,U,fn){return Q(T,U,fn);},onDocumentReady:function(fn,T,U){if(C){A.addListener(fn,T,U);
290 A.fire();A.clearListeners();return;}if(!A){K();}A.addListener(fn,T,U);},onWindowResize:function(fn,T,U){if(!F){F=new Roo.util.Event();G=new Roo.util.DelayedTask(function(){F.fire(D.getViewWidth(),D.getViewHeight());});E.on(window,"resize",function(){if(Roo.isIE){G.delay(50);
291 }else{F.fire(D.getViewWidth(),D.getViewHeight());}});}F.addListener(fn,T,U);},onTextResize:function(fn,T,U){if(!H){H=new Roo.util.Event();var V=new Roo.Element(document.createElement('div'));V.dom.className='x-text-resize';V.dom.innerHTML='X';V.appendTo(document.body);
292 I=V.dom.offsetHeight;setInterval(function(){if(V.dom.offsetHeight!=I){H.fire(I,I=V.dom.offsetHeight);}},this.textResizeInterval);}H.addListener(fn,T,U);},removeResizeListener:function(fn,T){if(F){F.removeListener(fn,T);}},fireResize:function(){if(F){F.fire(D.getViewWidth(),D.getViewHeight());
293 }},ieDeferSrc:false,textResizeInterval:50};S.on=S.addListener;S.un=S.removeListener;S.stoppedMouseDownEvent=new Roo.util.Event();return S;}();Roo.onReady=Roo.EventManager.onDocumentReady;Roo.onReady(function(){var bd=Roo.get(document.body);if(!bd){return;
294 }var A=[Roo.isIE?"roo-ie":Roo.isIE11?"roo-ie11":Roo.isEdge?"roo-edge":Roo.isGecko?"roo-gecko":Roo.isOpera?"roo-opera":Roo.isSafari?"roo-safari":""];if(Roo.isMac){A.push("roo-mac");}if(Roo.isLinux){A.push("roo-linux");}if(Roo.isIOS){A.push("roo-ios");}if(Roo.isTouch){A.push("roo-touch");
295 }if(Roo.isBorderBox){A.push('roo-border-box');}if(Roo.isStrict){var p=bd.dom.parentNode;if(p){p.className+=' roo-strict';}}bd.addClass(A.join(' '));});Roo.EventObject=function(){var E=Roo.lib.Event;var A={63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35}
296 ;var B=Roo.isIE?{1:0,4:1,2:2}:(Roo.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Roo.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e);}};Roo.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e;
297 }this.browserEvent=e;if(e){this.button=e.button?B[e.button]:(e.which?e.which-1:-1);if(e.type=='click'&&this.button==-1){this.button=0;}this.type=e.type;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;
298 this.charCode=(e.type=='keyup'||e.type=='keydown')?0:e.charCode;this.target=E.getTarget(e);this.xy=E.getXY(e);}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0];}return this;
299 },stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);}E.stopEvent(this.browserEvent);}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent);}
300 },isNavKeyPress:function(){var k=this.keyCode;k=Roo.isSafari?(A[k]||k):k;return (k>=33&&k<=40)||k==this.RETURN||k==this.TAB||k==this.ESC;},isSpecialKey:function(){var k=this.keyCode;return (this.type=='keypress'&&this.ctrlKey)||k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45);
301 },stopPropagation:function(){if(this.browserEvent){if(this.type=='mousedown'){Roo.EventManager.stoppedMouseDownEvent.fire(this);}E.stopPropagation(this.browserEvent);}},getCharCode:function(){return this.charCode||this.keyCode;},getKey:function(){var k=this.keyCode||this.charCode;
302 return Roo.isSafari?(A[k]||k):k;},getPageX:function(){return this.xy[0];},getPageY:function(){return this.xy[1];},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent);}return null;},getXY:function(){return this.xy;},getTarget:function(C,D,F){return C?Roo.fly(this.target).findParent(C,D,F):this.target;
303 },getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent);}return null;},getWheelDelta:function(){var e=this.browserEvent;var C=0;if(e.wheelDelta){C=e.wheelDelta/120;}else if(e.detail){C=-e.detail/3;}return C;},hasModifier:function(){return !!((this.ctrlKey||this.altKey)||this.shiftKey);
304 },within:function(el,C){var t=this[C?"getRelatedTarget":"getTarget"]();return t&&Roo.fly(el).contains(t);},getPoint:function(){return new Roo.lib.Point(this.xy[0],this.xy[1]);}};return new Roo.EventObjectImpl();}();
305 // Roo/Element.js
306 (function(){var D=Roo.lib.Dom;var E=Roo.lib.Event;var A=Roo.lib.Anim;var B={};var C=/(-[a-z])/gi;var F=function(m,a){return a.charAt(1).toUpperCase();};var G=document.defaultView;Roo.Element=function(J,K){var L=typeof J=="string"?document.getElementById(J):J;
307 if(!L){return null;}var id=L.id;if(K!==true&&id&&Roo.Element.cache[id]){return Roo.Element.cache[id];}this.dom=L;this.id=id||Roo.id(L);};var El=Roo.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(J){this.visibilityMode=J;
308 return this;},enableDisplayMode:function(J){this.setVisibilityMode(El.DISPLAY);if(typeof J!="undefined"){this.originalDisplay=J;}return this;},findParent:function(J,K,L){var p=this.dom,b=document.body,M=0,dq=Roo.DomQuery,N;K=K||50;if(typeof K!="number"){N=Roo.getDom(K);
309 K=10;}while(p&&p.nodeType==1&&M<K&&p!=b&&p!=N){if(dq.is(p,J)){return L?Roo.get(p):p;}M++;p=p.parentNode;}return null;},findParentNode:function(J,K,L){var p=Roo.fly(this.dom.parentNode,'_internal');return p?p.findParent(J,K,L):null;},findScrollableParent:function(){var J=/(auto|scroll)/;
310 if(this.getStyle('position')==='fixed'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}var K=this.getStyle('position')==="absolute";for(var L=this;(L=Roo.get(L.dom.parentNode));){if(K&&L.getStyle('position')==="static"){continue;
311 }if(J.test(L.getStyle('overflow')+L.getStyle('overflow-x')+L.getStyle('overflow-y'))){return L;}if(L.dom.nodeName.toLowerCase()=='body'){return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);}}return Roo.isAndroid?Roo.get(document.documentElement):Roo.get(document.body);
312 },up:function(J,K){return this.findParentNode(J,K,true);},is:function(J){return Roo.DomQuery.is(this.dom,J);},animate:function(J,K,L,M,N){this.anim(J,{duration:K,callback:L,easing:M},N);return this;},anim:function(J,K,L,M,N,cb){L=L||'run';K=K||{};var O=Roo.lib.Anim[L](this.dom,J,(K.duration||M)||.35,(K.easing||N)||'easeOut',function(){Roo.callback(cb,this);
313 Roo.callback(K.callback,K.scope||this,[this,K]);},this);K.anim=O;return O;},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]});},clean:function(J){if(this.isCleaned&&J!==true){return this;
314 }var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;}n=nx;}this.isCleaned=true;return this;},calcOffsetsTo:function(el){el=Roo.get(el);var d=el.dom;
315 var J=false;if(el.getStyle('position')=='static'){el.position('relative');J=true;}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!='HTML'){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent;}if(J){el.position('static');}return [x,y];},scrollIntoView:function(J,K){var c=Roo.getDom(J)||document.body;
316 var el=this.dom;var o=this.calcOffsetsTo(c),l=o[0],t=o[1],b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(t<ct){c.scrollTop=t;}else if(b>cb){c.scrollTop=b-ch;
317 }if(K!==false){if(l<cl){c.scrollLeft=l;}else if(r>cr){c.scrollLeft=r-c.clientWidth;}}return this;},scrollChildIntoView:function(J,K){Roo.fly(J,'_scrollChildIntoView').scrollIntoView(this,K);},autoHeight:function(J,K,L,M){var N=this.getHeight();this.clip();
318 this.setHeight(1);setTimeout(function(){var O=parseInt(this.dom.scrollHeight,10);if(!J){this.setHeight(O);this.unclip();if(typeof L=="function"){L();}}else{this.setHeight(N);this.setHeight(O,J,K,function(){this.unclip();if(typeof L=="function"){L();}}.createDelegate(this),M);
319 }}.createDelegate(this),0);return this;},contains:function(el){if(!el){return false;}return D.isAncestor(this.dom,el.dom?el.dom:el);},isVisible:function(J){var K=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(J!==true||!K){return K;
320 }var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Roo.fly(p,'_isVisible').isVisible()){return false;}p=p.parentNode;}return true;},select:function(J,K){return El.select(J,K,this.dom);},query:function(J,K){return Roo.DomQuery.select(J,this.dom);
321 },child:function(J,K){var n=Roo.DomQuery.selectNode(J,this.dom);return K?n:Roo.get(n);},down:function(J,K){var n=Roo.DomQuery.selectNode(" > "+J,this.dom);return K?n:Roo.get(n);},initDD:function(J,K,L){var dd=new Roo.dd.DD(Roo.id(this.dom),J,K);return Roo.apply(dd,L);
322 },initDDProxy:function(J,K,L){var dd=new Roo.dd.DDProxy(Roo.id(this.dom),J,K);return Roo.apply(dd,L);},initDDTarget:function(J,K,L){var dd=new Roo.dd.DDTarget(Roo.id(this.dom),J,K);return Roo.apply(dd,L);},setVisible:function(J,K){if(!K||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(J);
323 }else{this.fixDisplay();this.dom.style.visibility=J?"visible":"hidden";}}else{var L=this.dom;var M=this.visibilityMode;if(J){this.setOpacity(.01);this.setVisible(true);}this.anim({opacity:{to:(J?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!J){if(M==El.DISPLAY){L.style.display="none";
324 }else{L.style.visibility="hidden";}Roo.get(L).setOpacity(1);}});}return this;},isDisplayed:function(){return this.getStyle("display")!="none";},toggle:function(J){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this;},setDisplayed:function(J){if(typeof J=="boolean"){J=J?this.originalDisplay:"none";
325 }this.setStyle("display",J);return this;},focus:function(){try{this.dom.focus();}catch(e){}return this;},blur:function(){try{this.dom.blur();}catch(e){}return this;},addClass:function(J){if(J instanceof Array){for(var i=0,K=J.length;i<K;i++){this.addClass(J[i]);
326 }}else{if(J&&!this.hasClass(J)){this.dom.className=this.dom.className+" "+J;}}return this;},radioClass:function(J){var K=this.dom.parentNode.childNodes;for(var i=0;i<K.length;i++){var s=K[i];if(s.nodeType==1){Roo.get(s).removeClass(J);}}this.addClass(J);return this;
327 },removeClass:function(J){if(!J||!this.dom.className){return this;}if(J instanceof Array){for(var i=0,K=J.length;i<K;i++){this.removeClass(J[i]);}}else{if(this.hasClass(J)){var re=this.classReCache[J];if(!re){re=new RegExp('(?:^|\\s+)'+J+'(?:\\s+|$)',"g");
328 this.classReCache[J]=re;}this.dom.className=this.dom.className.replace(re," ");}}return this;},classReCache:{},toggleClass:function(J){if(this.hasClass(J)){this.removeClass(J);}else{this.addClass(J);}return this;},hasClass:function(J){return J&&(' '+this.dom.className+' ').indexOf(' '+J+' ')!=-1;
329 },replaceClass:function(J,K){this.removeClass(J);this.addClass(K);return this;},getStyles:function(){var a=arguments,J=a.length,r={};for(var i=0;i<J;i++){r[a[i]]=this.getStyle(a[i]);}return r;},getStyle:function(){return G&&G.getComputedStyle?function(J){var el=this.dom,v,cs,K;
330 if(J=='float'){J="cssFloat";}if(el.style&&(v=el.style[J])){return v;}if(cs=G.getComputedStyle(el,"")){if(!(K=B[J])){K=B[J]=J.replace(C,F);}return cs[K];}return null;}:function(J){var el=this.dom,v,cs,K;if(J=='opacity'){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);
331 if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}return 1;}else if(J=='float'){J="styleFloat";}if(!(K=B[J])){K=B[J]=J.replace(C,F);}if(v=el.style[K]){return v;}if(cs=el.currentStyle){return cs[K];}return null;};}(),setStyle:function(J,K){if(typeof J=="string"){if(J=='float'){this.setStyle(Roo.isIE?'styleFloat':'cssFloat',K);
332 return this;}var L;if(!(L=B[J])){L=B[J]=J.replace(C,F);}if(L=='opacity'){this.setOpacity(K);}else{this.dom.style[L]=K;}}else{for(var M in J){if(typeof J[M]!="function"){this.setStyle(M,J[M]);}}}return this;},applyStyles:function(J){Roo.DomHelper.applyStyles(this.dom,J);
333 return this;},getX:function(){return D.getX(this.dom);},getY:function(){return D.getY(this.dom);},getXY:function(){return D.getXY(this.dom);},setX:function(x,J){if(!J||!A){D.setX(this.dom,x);}else{this.setXY([x,this.getY()],this.preanim(arguments,1));}return this;
334 },setY:function(y,J){if(!J||!A){D.setY(this.dom,y);}else{this.setXY([this.getX(),y],this.preanim(arguments,1));}return this;},setLeft:function(J){this.setStyle("left",this.addUnits(J));return this;},setTop:function(J){this.setStyle("top",this.addUnits(J));
335 return this;},setRight:function(J){this.setStyle("right",this.addUnits(J));return this;},setBottom:function(J){this.setStyle("bottom",this.addUnits(J));return this;},setXY:function(J,K){if(!K||!A){D.setXY(this.dom,J);}else{this.anim({points:{to:J}},this.preanim(arguments,1),'motion');
336 }return this;},setLocation:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));return this;},moveTo:function(x,y,J){this.setXY([x,y],this.preanim(arguments,2));return this;},getRegion:function(){return D.getRegion(this.dom);},getHeight:function(J){var h=this.dom.offsetHeight||0;
337 return J!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");},getWidth:function(J){var w=this.dom.offsetWidth||0;return J!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);
338 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');
339 }}return w;},getSize:function(J){return {width:this.getWidth(J),height:this.getHeight(J)};},getViewSize:function(){var d=this.dom,J=document,aw=0,ah=0;if(d==J||d==J.body){return {width:D.getViewWidth(),height:D.getViewHeight()};}else{return {width:d.clientWidth,height:d.clientHeight}
340 ;}},getValue:function(J){return J?parseInt(this.dom.value,10):this.dom.value;},adjustWidth:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("lr")+this.getPadding("lr"));}if(J<0){J=0;}}return J;},adjustHeight:function(J){if(typeof J=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){J-=(this.getBorderWidth("tb")+this.getPadding("tb"));
341 }if(J<0){J=0;}}return J;},setWidth:function(J,K){J=this.adjustWidth(J);if(!K||!A){this.dom.style.width=this.addUnits(J);}else{this.anim({width:{to:J}},this.preanim(arguments,1));}return this;},setHeight:function(J,K){J=this.adjustHeight(J);if(!K||!A){this.dom.style.height=this.addUnits(J);
342 }else{this.anim({height:{to:J}},this.preanim(arguments,1));}return this;},setSize:function(J,K,L){if(typeof J=="object"){K=J.height;J=J.width;}J=this.adjustWidth(J);K=this.adjustHeight(K);if(!L||!A){this.dom.style.width=this.addUnits(J);this.dom.style.height=this.addUnits(K);
343 }else{this.anim({width:{to:J},height:{to:K}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,J,K,L){if(!L||!A){this.setSize(J,K);this.setLocation(x,y);}else{J=this.adjustWidth(J);K=this.adjustHeight(K);this.anim({points:{to:[x,y]},width:{to:J}
344 ,height:{to:K}},this.preanim(arguments,4),'motion');}return this;},setRegion:function(J,K){this.setBounds(J.left,J.top,J.right-J.left,J.bottom-J.top,this.preanim(arguments,1));return this;},addListener:function(J,fn,K,L){if(this.dom){Roo.EventManager.on(this.dom,J,fn,K||this,L);
345 }},removeListener:function(J,fn){Roo.EventManager.removeListener(this.dom,J,fn);return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(J,K){this.on(J,function(e){K.fireEvent(J,e);});},setOpacity:function(J,K){if(!K||!A){var s=this.dom.style;
346 if(Roo.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(J==1?"":"alpha(opacity="+J*100+")");}else{s.opacity=J;}}else{this.anim({opacity:{to:J}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(J){if(!J){return this.getX();
347 }else{return parseInt(this.getStyle("left"),10)||0;}},getRight:function(J){if(!J){return this.getX()+this.getWidth();}else{return (this.getLeft(true)+this.getWidth())||0;}},getTop:function(J){if(!J){return this.getY();}else{return parseInt(this.getStyle("top"),10)||0;
348 }},getBottom:function(J){if(!J){return this.getY()+this.getHeight();}else{return (this.getTop(true)+this.getHeight())||0;}},position:function(J,K,x,y){if(!J){if(this.getStyle('position')=='static'){this.setStyle('position','relative');}}else{this.setStyle("position",J);
349 }if(K){this.setStyle("z-index",K);}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(J){J=J||'';this.setStyle({"left":J,"right":J,"top":J,"bottom":J,"z-index":"","position":"static"}
350 );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")}
351 ;},getBorderWidth:function(J){return this.addStyles(J,El.borders);},getPadding:function(J){return this.addStyles(J,El.paddings);},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right="";}if(pc.bottom=="auto"){this.dom.style.bottom="";
352 }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(J,K){this.dom.style.left=this.addUnits(J);
353 this.dom.style.top=this.addUnits(K);return this;},move:function(J,K,L){var xy=this.getXY();J=J.toLowerCase();switch(J){case "l":case "left":this.moveTo(xy[0]-K,xy[1],this.preanim(arguments,2));break;case "r":case "right":this.moveTo(xy[0]+K,xy[1],this.preanim(arguments,2));
354 break;case "t":case "top":case "up":this.moveTo(xy[0],xy[1]-K,this.preanim(arguments,2));break;case "b":case "bottom":case "down":this.moveTo(xy[0],xy[1]+K,this.preanim(arguments,2));break;}return this;},clip:function(){if(!this.isClipped){this.isClipped=true;
355 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;
356 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(J,K,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;
357 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((J||"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);
358 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(K===true){return [x,y];}if(vp){var sc=this.getScroll();return [x+sc.left,y+sc.top];}var o=this.getXY();
359 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;
360 }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];
361 if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var J=p1.charAt(0),K=p1.charAt(p1.length-1);var L=p2.charAt(0),M=p2.charAt(p2.length-1);var N=((J=="t"&&L=="b")||(J=="b"&&L=="t"));var O=((K=="r"&&M=="l")||(K=="l"&&M=="r"));
362 var P=document;var Q=(P.documentElement.scrollLeft||P.body.scrollLeft||0)+5;var R=(P.documentElement.scrollTop||P.body.scrollTop||0)+5;if((x+w)>dw+Q){x=O?r.left-w:dw+Q-w;}if(x<Q){x=O?r.right:Q;}if((y+h)>dh+R){y=N?r.top-h:dh+R-h;}if(y<R){y=N?r.bottom:R;}}return [x,y];
363 },getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,J,K,L){el=Roo.get(el);K=K?Roo.applyIf(K,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();
364 }else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!J){var M=el.getXY();vx=M[0];vy=M[1];}}var s=el.getScroll();vx+=K.left+s.left;vy+=K.top+s.top;vw-=K.right;vh-=K.bottom;var vr=vx+vw;var vb=vy+vh;var xy=L||(!J?this.getXY():[this.getLeft(true),this.getTop(true)]);
365 var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var N=false;if((x+w)>vr){x=vr-w;N=true;}if((y+h)>vb){y=vb-h;N=true;}if(x<vx){x=vx;N=true;}if(y<vy){y=vy;N=true;}return N?[x,y]:false;};}(),adjustForConstraints:function(xy,J,K){return this.getConstrainToXY(J||document,false,K,xy)||xy;
366 },alignTo:function(J,K,L,M){var xy=this.getAlignToXY(J,K,L);this.setXY(xy,this.preanim(arguments,3));return this;},anchorTo:function(el,J,K,L,M,N){var O=function(){this.alignTo(el,J,K,L);Roo.callback(N,this);};Roo.EventManager.onWindowResize(O,this);var tm=typeof M;
367 if(tm!='undefined'){Roo.EventManager.on(window,'scroll',O,this,{buffer:tm=='number'?M:50});}O.call(this);return this;},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=='string'&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter="";
368 }}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]="";}return this;},hide:function(J){this.setVisible(false,this.preanim(arguments,0));return this;},show:function(J){this.setVisible(true,this.preanim(arguments,0));
369 return this;},addUnits:function(J){return Roo.Element.addUnits(J,this.defaultUnit);},beginMeasure:function(){var el=this.dom;if(el.offsetWidth||el.offsetHeight){return this;}var J=[];var p=this.dom,b=document.body;while((!el.offsetWidth&&!el.offsetHeight)&&p&&p.tagName&&p!=b){var pe=Roo.get(p);
370 if(pe.getStyle('display')=='none'){J.push({el:p,visibility:pe.getStyle("visibility")});p.style.visibility="hidden";p.style.display="block";}p=p.parentNode;}this._measureChanged=J;return this;},endMeasure:function(){var J=this._measureChanged;if(J){for(var i=0,K=J.length;
371 i<K;i++){var r=J[i];r.el.style.visibility=r.visibility;r.el.style.display="none";}this._measureChanged=null;}return this;},update:function(J,K,L){if(typeof J=="undefined"){J="";}if(K!==true){this.dom.innerHTML=J;if(typeof L=="function"){L();}return this;}
372 var id=Roo.id();var M=this.dom;J+='<span id="'+id+'"></span>';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var N=/\ssrc=([\'\"])(.*?)\1/i;var O=/\stype=([\'\"])(.*?)\1/i;
373 var P;while(P=re.exec(J)){var Q=P[1];var R=Q?Q.match(N):false;if(R&&R[2]){var s=document.createElement("script");s.src=R[2];var S=Q.match(O);if(S&&S[2]){s.type=S[2];}hd.appendChild(s);}else if(P[2]&&P[2].length>0){if(window.execScript){window.execScript(P[2]);
374 }else{window.eval(P[2]);}}}var el=document.getElementById(id);if(el){el.parentNode.removeChild(el);}if(typeof L=="function"){L();}});M.innerHTML=J.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this;},load:function(){var um=this.getUpdateManager();
375 um.update.apply(um,arguments);return this;},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Roo.UpdateManager(this);}return this.updateManager;},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);
376 this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this;},getCenterXY:function(){return this.getAlignToXY(document,'c-c');},center:function(J){this.alignTo(J||document,'c-c');return this;},isBorderBox:function(){return I[this.dom.tagName.toLowerCase()]||Roo.isBorderBox;
377 },getBox:function(J,K){var xy;if(!K){xy=this.getXY();}else{var L=parseInt(this.getStyle("left"),10)||0;var M=parseInt(this.getStyle("top"),10)||0;xy=[L,M];}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!J){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}
378 ;}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}
379 ;}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx;},getFrameWidth:function(J,K){return K&&Roo.isBorderBox?0:(this.getPadding(J)+this.getBorderWidth(J));},setBox:function(J,K,L){var w=J.width,h=J.height;if((K&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));
380 h-=(this.getBorderWidth("tb")+this.getPadding("tb"));}this.setBounds(J.x,J.y,w,h,this.preanim(arguments,2));return this;},repaint:function(){var J=this.dom;this.addClass("x-repaint");setTimeout(function(){Roo.get(J).removeClass("x-repaint");},1);return this;
381 },getMargins:function(J){if(!J){return {top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0};}else{return this.addStyles(J,El.margins);
382 }},addStyles:function(J,K){var L=0,v,w;for(var i=0,M=J.length;i<M;i++){v=this.getStyle(K[J.charAt(i)]);if(v){w=parseInt(v,10);if(w){L+=w;}}}return L;},createProxy:function(J,K,L){if(K){K=Roo.getDom(K);}else{K=document.body;}J=typeof J=="object"?J:{tag:"div",cls:J}
383 ;var M=Roo.DomHelper.append(K,J,true);if(L){M.setBox(this.getBox());}return M;},mask:function(J,K){if(this.getStyle("position")=="static"&&this.dom.tagName!=='BODY'){this.setStyle("position","relative");}if(!this._mask){this._mask=Roo.DomHelper.append(this.dom,{cls:"roo-el-mask"}
384 ,true);}this.addClass("x-masked");this._mask.setDisplayed(true);var z=0;var L=this.dom;while(L&&L.style){if(!isNaN(parseInt(L.style.zIndex))){z=Math.max(z,parseInt(L.style.zIndex));}L=L.parentNode;}if(this.dom==document.body){z=1000000;this._mask.setWidth(Roo.lib.Dom.getDocumentWidth());
385 this._mask.setHeight(Roo.lib.Dom.getDocumentHeight());}if(typeof J=='string'){if(!this._maskMsg){this._maskMsg=Roo.DomHelper.append(this.dom,{cls:"roo-el-mask-msg",cn:[{tag:'i',cls:'fa fa-spinner fa-spin'},{tag:'div'}]},true);}var mm=this._maskMsg;mm.dom.className=K?"roo-el-mask-msg "+K:"roo-el-mask-msg";
386 if(mm.dom.lastChild){mm.dom.lastChild.innerHTML=J;}mm.setDisplayed(true);mm.center(this);mm.setStyle('z-index',z+102);}if(Roo.isIE&&!(Roo.isIE7&&Roo.isStrict)&&this.getStyle('height')=='auto'){this._mask.setHeight(this.getHeight());}this._mask.setStyle('z-index',z+100);
387 return this._mask;},unmask:function(J){if(this._mask){if(J===true){this._mask.remove();delete this._mask;if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg;}}else{this._mask.setDisplayed(false);if(this._maskMsg){this._maskMsg.setDisplayed(false);
388 }}}this.removeClass("x-masked");},isMasked:function(){return this._mask&&this._mask.isVisible();},createShim:function(){var el=document.createElement('iframe');el.frameBorder='no';el.className='roo-shim';if(Roo.isIE&&Roo.isSecure){el.src=Roo.SSL_SECURE_URL;
389 }var J=Roo.get(this.dom.parentNode.insertBefore(el,this.dom));J.autoBoxAdjust=false;return J;},remove:function(){if(this.dom.parentNode){this.dom.parentNode.removeChild(this.dom);}delete El.cache[this.dom.id];},addClassOnOver:function(J,K){this.on("mouseover",function(){Roo.fly(this,'_internal').addClass(J);
390 },this.dom);var L=function(e){if(K!==true||!e.within(this,true)){Roo.fly(this,'_internal').removeClass(J);}};this.on("mouseout",L,this.dom);return this;},addClassOnFocus:function(J){this.on("focus",function(){Roo.fly(this,'_internal').addClass(J);},this.dom);
391 this.on("blur",function(){Roo.fly(this,'_internal').removeClass(J);},this.dom);return this;},addClassOnClick:function(J){var K=this.dom;this.on("mousedown",function(){Roo.fly(K,'_internal').addClass(J);var d=Roo.get(document);var fn=function(){Roo.fly(K,'_internal').removeClass(J);
392 d.removeListener("mouseup",fn);};d.on("mouseup",fn);});return this;},swallowEvent:function(J,K){var fn=function(e){e.stopPropagation();if(K){e.preventDefault();}};if(J instanceof Array){for(var i=0,L=J.length;i<L;i++){this.on(J[i],fn);}return this;}this.on(J,fn);
393 return this;},fitToParentDelegate:Roo.emptyFn,fitToParent:function(J,K){Roo.EventManager.removeResizeListener(this.fitToParentDelegate);this.fitToParentDelegate=Roo.emptyFn;if(J===true&&!this.dom.parentNode){return;}var p=Roo.get(K||this.dom.parentNode);this.setSize(p.getComputedWidth()-p.getFrameWidth('lr'),p.getComputedHeight()-p.getFrameWidth('tb'));
394 if(J===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true,K]);Roo.EventManager.onWindowResize(this.fitToParentDelegate);}return this;},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling;}return n;
395 },getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling;}return n;},appendChild:function(el){el=Roo.get(el);el.appendTo(this);return this;},createChild:function(J,K,L){J=J||{tag:'div'};if(K){return Roo.DomHelper.insertBefore(K,J,L!==true);
396 }return Roo.DomHelper[!this.dom.firstChild?'overwrite':'append'](this.dom,J,L!==true);},appendTo:function(el){el=Roo.getDom(el);el.appendChild(this.dom);return this;},insertBefore:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el);return this;
397 },insertAfter:function(el){el=Roo.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this;},insertFirst:function(el,J){el=el||{};if(typeof el=='object'&&!el.nodeType){return this.createChild(el,this.dom.firstChild,J);}else{el=Roo.getDom(el);
398 this.dom.insertBefore(el,this.dom.firstChild);return !J?Roo.get(el):el;}},insertSibling:function(el,J,K){J=J?J.toLowerCase():'before';el=el||{};var rt,L=J=='before'?this.dom:this.dom.nextSibling;if(typeof el=='object'&&!el.nodeType){if(J=='after'&&!this.dom.nextSibling){rt=Roo.DomHelper.append(this.dom.parentNode,el,!K);
399 }else{rt=Roo.DomHelper[J=='after'?'insertAfter':'insertBefore'](this.dom,el,!K);}}else{rt=this.dom.parentNode.insertBefore(Roo.getDom(el),J=='before'?this.dom:this.dom.nextSibling);if(!K){rt=Roo.get(rt);}}return rt;},wrap:function(J,K){if(!J){J={tag:"div"}
400 ;}var L=Roo.DomHelper.insertBefore(this.dom,J,!K);L.dom?L.dom.appendChild(this.dom):L.appendChild(this.dom);return L;},replace:function(el){el=Roo.get(el);this.insertBefore(el);el.remove();return this;},insertHtml:function(J,K,L){var el=Roo.DomHelper.insertHtml(J,this.dom,K);
401 return L?Roo.get(el):el;},set:function(o,J){var el=this.dom;J=typeof J=='undefined'?(el.setAttribute?true:false):J;for(var K in o){if(K=="style"||typeof o[K]=="function"){continue;}if(K=="cls"){el.className=o["cls"];}else{if(J){el.setAttribute(K,o[K]);}else{el[K]=o[K];
402 }}}if(o.style){Roo.DomHelper.applyStyles(el,o.style);}return this;},addKeyListener:function(J,fn,K){var L;if(typeof J!="object"||J instanceof Array){L={key:J,fn:fn,scope:K};}else{L={key:J.key,shift:J.shift,ctrl:J.ctrl,alt:J.alt,fn:fn,scope:K};}return new Roo.KeyMap(this,L);
403 },addKeyMap:function(J){return new Roo.KeyMap(this,J);},isScrollable:function(){var J=this.dom;return J.scrollHeight>J.clientHeight||J.scrollWidth>J.clientWidth;},scrollTo:function(J,K,L){var M=J.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!L||!A){this.dom[M]=K;
404 }else{var to=M=="scrollLeft"?[K,this.dom.scrollTop]:[this.dom.scrollLeft,K];this.anim({scroll:{"to":to}},this.preanim(arguments,2),'scroll');}return this;},scroll:function(J,K,L){if(!this.isScrollable()){return;}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;
405 var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;J=J.toLowerCase();var M=false;var a=this.preanim(arguments,2);switch(J){case "l":case "left":if(w-l>cw){var v=Math.min(l+K,w-cw);this.scrollTo("left",v,a);M=true;}break;case "r":case "right":if(l>0){var v=Math.max(l-K,0);
406 this.scrollTo("left",v,a);M=true;}break;case "t":case "top":case "up":if(t>0){var v=Math.max(t-K,0);this.scrollTo("top",v,a);M=true;}break;case "b":case "bottom":case "down":if(h-t>ch){var v=Math.min(t+K,h-ch);this.scrollTo("top",v,a);M=true;}break;}return M;
407 },translatePoints:function(x,y){if(typeof x=='object'||x instanceof Array){y=x[1];x=x[0];}var p=this.getStyle('position');var o=this.getXY();var l=parseInt(this.getStyle('left'),10);var t=parseInt(this.getStyle('top'),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft;
408 }if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop;}return {left:(x-o[0]+l),top:(y-o[1]+t)};},getScroll:function(){var d=this.dom,J=document;if(d==J||d==J.body){var l=window.pageXOffset||J.documentElement.scrollLeft||J.body.scrollLeft||0;var t=window.pageYOffset||J.documentElement.scrollTop||J.body.scrollTop||0;
409 return {left:l,top:t};}else{return {left:d.scrollLeft,top:d.scrollTop};}},getColor:function(J,K,L){var v=this.getStyle(J);if(!v||v=="transparent"||v=="inherit"){return K;}var M=typeof L=="undefined"?"#":L;if(v.substr(0,4)=="rgb("){var N=v.slice(4,v.length-1).split(",");
410 for(var i=0;i<3;i++){var h=parseInt(N[i]).toString(16);if(h<16){h="0"+h;}M+=h;}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);M+=c+c;}}else if(v.length==7){M+=v.substr(1);}}}return (M.length>5?M.toLowerCase():K);},boxWrap:function(J){J=J||'x-box';
411 var el=Roo.get(this.insertHtml('beforeBegin',String.format('<div class="{0}">'+El.boxMarkup+'</div>',J)));el.child('.'+J+'-mc').dom.appendChild(this.dom);return el;},getAttributeNS:Roo.isIE?function(ns,J){var d=this.dom;var K=typeof d[ns+":"+J];if(K!='undefined'&&K!='unknown'){return d[ns+":"+J];
412 }return d[J];}:function(ns,J){var d=this.dom;return d.getAttributeNS(ns,J)||d.getAttribute(ns+":"+J)||d.getAttribute(J)||d[J];},attr:function(J){if(arguments.length>1){this.dom.setAttribute(J,arguments[1]);return arguments[1];}if(typeof(J)=='object'){for(var i in J){this.attr(i,J[i]);
413 }return J;}if(!this.dom.hasAttribute(J)){return undefined;}return this.dom.getAttribute(J);}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;
414 El.addUnits=function(v,J){if(v===""||v=="auto"){return v;}if(v===undefined){return '';}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(J||'px');}return v;};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
415 El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"}
416 ;El.cache={};var H;El.get=function(el){var ex,J,id;if(!el){return null;}if(typeof el=="string"){if(!(J=document.getElementById(el))){return null;}if(ex=El.cache[el]){ex.dom=J;}else{ex=El.cache[el]=new El(J);}return ex;}else if(el.tagName){if(!(id=el.id)){id=Roo.id(el);
417 }if(ex=El.cache[id]){ex.dom=el;}else{ex=El.cache[id]=new El(el);}return ex;}else if(el instanceof El){if(el!=H){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el;}return el;}else if(el.isComposite){return el;}else if(el instanceof Array){return El.select(el);
418 }else if(el==document){if(!H){var f=function(){};f.prototype=El.prototype;H=new f();H.dom=document;}return H;}return null;};El.uncache=function(el){for(var i=0,a=arguments,J=a.length;i<J;i++){if(a[i]){delete El.cache[a[i].id||a[i]];}}};El.garbageCollect=function(){if(!Roo.enableGarbageCollector){clearInterval(El.collectorThread);
419 return;}for(var J in El.cache){var el=El.cache[J],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(J))){delete El.cache[J];if(d&&Roo.enableListenerCollection){E.purgeElement(d);}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);
420 El.Flyweight=function(J){this.dom=J;};El.Flyweight.prototype=El.prototype;El._flyweights={};El.fly=function(el,J){J=J||'_global';el=Roo.getDom(el);if(!el){return null;}if(!El._flyweights[J]){El._flyweights[J]=new El.Flyweight();}El._flyweights[J].dom=el;return El._flyweights[J];
421 };Roo.get=El.get;Roo.fly=El.fly;var I=Roo.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Roo.isIE||Roo.isGecko){I['button']=1;}Roo.EventManager.on(window,'unload',function(){delete El.cache;delete El._flyweights;});})();if(Roo.DomQuery){Roo.Element.selectorFunction=Roo.DomQuery.select;
422 }Roo.Element.select=function(A,B,C){var D;if(typeof A=="string"){D=Roo.Element.selectorFunction(A,C);}else if(A.length!==undefined){D=A;}else{throw "Invalid selector";}if(B===true){return new Roo.CompositeElement(D);}else{return new Roo.CompositeElementLite(D);
423 }};Roo.select=Roo.Element.select;
424 // Roo/Fx.js
425 Roo.enableFx=true;Roo.Fx={slideIn:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"t";this.fixDisplay();var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var B=this.fxWrap(r.pos,o,"hidden");var st=this.dom.style;st.visibility="visible";
426 st.position="absolute";var C=function(){el.fxUnwrap(B,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o);};var a,pt={to:[b.x,b.y]},bw={to:b.width},bh={to:b.height};switch(A.toLowerCase()){case "t":B.setSize(b.width,0);st.left=st.bottom="0";a={height:bh}
427 ;break;case "l":B.setSize(0,b.height);st.right=st.top="0";a={width:bw};break;case "r":B.setSize(0,b.height);B.setX(b.right);st.left=st.top="0";a={width:bw,points:pt};break;case "b":B.setSize(b.width,0);B.setY(b.bottom);st.left=st.top="0";a={height:bh,points:pt}
428 ;break;case "tl":B.setSize(0,0);st.right=st.bottom="0";a={width:bw,height:bh};break;case "bl":B.setSize(0,0);B.setY(b.y+b.height);st.right=st.top="0";a={width:bw,height:bh,points:pt};break;case "br":B.setSize(0,0);B.setXY([b.right,b.bottom]);st.left=st.top="0";
429 a={width:bw,height:bh,points:pt};break;case "tr":B.setSize(0,0);B.setX(b.x+b.width);st.left=st.bottom="0";a={width:bw,height:bh,points:pt};break;}this.dom.style.visibility="visible";B.show();arguments.callee.anim=B.fxanim(a,o,'motion',.5,'easeOut',C);});return this;
430 },slideOut:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"t";var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var B=this.fxWrap(r.pos,o,"visible");var st=this.dom.style;st.visibility="visible";st.position="absolute";
431 B.setSize(b);var C=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.fxUnwrap(B,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o);};var a,D={to:0};switch(A.toLowerCase()){case "t":st.left=st.bottom="0";a={height:D};break;case "l":st.right=st.top="0";
432 a={width:D};break;case "r":st.left=st.top="0";a={width:D,points:{to:[b.right,b.y]}};break;case "b":st.left=st.top="0";a={height:D,points:{to:[b.x,b.bottom]}};break;case "tl":st.right=st.bottom="0";a={width:D,height:D};break;case "bl":st.right=st.top="0";a={width:D,height:D,points:{to:[b.x,b.bottom]}
433 };break;case "br":st.left=st.top="0";a={width:D,height:D,points:{to:[b.x+b.width,b.bottom]}};break;case "tr":st.left=st.bottom="0";a={width:D,height:D,points:{to:[b.right,b.y]}};break;}arguments.callee.anim=B.fxanim(a,o,'motion',.5,"easeOut",C);});return this;
434 },puff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.show();var r=this.getFxRestore();var st=this.dom.style;var A=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);
435 st.width=r.width;st.height=r.height;st.fontSize='';el.afterFx(o);};var B=this.getWidth();var C=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(B*2)},height:{to:this.adjustHeight(C*2)},points:{by:[-(B*.5),-(C*.5)]},opacity:{to:0}
436 ,fontSize:{to:200,unit:"%"}},o,'motion',.5,"easeOut",A);});return this;},switchOff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.clip();var r=this.getFxRestore();var st=this.dom.style;var A=function(){if(o.useDisplay){el.setDisplayed(false);
437 }else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);};this.fxanim({opacity:{to:0.3}},null,null,.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*.5]}
438 },o,'motion',0.3,'easeIn',A);}).defer(100,this);});});return this;},highlight:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"ffff9c";attr=o.attr||"backgroundColor";this.clearOpacity();this.show();var B=this.getColor(attr);var C=this.dom.style[attr];
439 endColor=(o.endColor||B)||"ffffff";var D=function(){el.dom.style[attr]=C;el.afterFx(o);};var a={};a[attr]={from:A,to:endColor};arguments.callee.anim=this.fxanim(a,o,'color',1,'easeIn',D);});return this;},frame:function(A,B,o){var el=this.getFxEl();o=o||{}
440 ;el.queueFx(o,function(){A=A||"#C3DAF9";if(A.length==6){A="#"+A;}B=B||1;duration=o.duration||1;this.show();var b=this.getBox();var C=function(){var D=this.createProxy({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+A}}
441 );var E=Roo.isBorderBox?2:1;D.animate({top:{from:b.y,to:b.y-20},left:{from:b.x,to:b.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:b.height,to:(b.height+(20*E))},width:{from:b.width,to:(b.width+(20*E))}},duration,function(){D.remove();
442 });if(--B>0){C.defer((duration/2)*1000,this);}else{el.afterFx(o);}};C.call(this);});return this;},pause:function(A){var el=this.getFxEl();var o={};el.queueFx(o,function(){setTimeout(function(){el.afterFx(o);},A*1000);});return this;},fadeIn:function(o){var el=this.getFxEl();
443 o=o||{};el.queueFx(o,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility='visible';var to=o.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,.5,"easeOut",function(){if(to==1){this.clearOpacity();}el.afterFx(o);
444 });});return this;},fadeOut:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){arguments.callee.anim=this.fxanim({opacity:{to:o.endOpacity||0}},o,null,.5,"easeOut",function(){if(this.visibilityMode==Roo.Element.DISPLAY||o.useDisplay){this.dom.style.display="none";
445 }else{this.dom.style.visibility="hidden";}this.clearOpacity();el.afterFx(o);});});return this;},scale:function(w,h,o){this.shift(Roo.apply({},o,{width:w,height:h}));return this;},shift:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){var a={}
446 ,w=o.width,h=o.height,x=o.x,y=o.y,op=o.opacity;if(w!==undefined){a.width={to:this.adjustWidth(w)};}if(h!==undefined){a.height={to:this.adjustHeight(h)};}if(x!==undefined||y!==undefined){a.points={to:[x!==undefined?x:this.getX(),y!==undefined?y:this.getY()]}
447 ;}if(op!==undefined){a.opacity={to:op};}if(o.xy!==undefined){a.points={to:o.xy};}arguments.callee.anim=this.fxanim(a,o,'motion',.35,"easeOut",function(){el.afterFx(o);});});return this;},ghost:function(A,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){A=A||"b";
448 var r=this.getFxRestore();var w=this.getWidth(),h=this.getHeight();var st=this.dom.style;var B=function(){if(o.useDisplay){el.setDisplayed(false);}else{el.hide();}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o);
449 };var a={opacity:{to:0},points:{}},pt=a.points;switch(A.toLowerCase()){case "t":pt.by=[0,-h];break;case "l":pt.by=[-w,0];break;case "r":pt.by=[w,0];break;case "b":pt.by=[0,h];break;case "tl":pt.by=[-w,-h];break;case "bl":pt.by=[-w,h];break;case "br":pt.by=[w,h];
450 break;case "tr":pt.by=[w,-h];break;}arguments.callee.anim=this.fxanim(a,o,'motion',.5,"easeOut",B);});return this;},syncFx:function(){this.fxDefaults=Roo.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this;},sequenceFx:function(){this.fxDefaults=Roo.apply(this.fxDefaults||{}
451 ,{block:false,concurrent:false,stopFx:false});return this;},nextFx:function(){var ef=this.fxQueue[0];if(ef){ef.call(this);}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0];},stopFx:function(){if(this.hasActiveFx()){var A=this.fxQueue[0];if(A&&A.anim&&A.anim.isAnimated()){this.fxQueue=[A];
452 A.anim.stop(true);}}return this;},beforeFx:function(o){if(this.hasActiveFx()&&!o.concurrent){if(o.stopFx){this.stopFx();return true;}return false;}return true;},hasFxBlock:function(){var q=this.fxQueue;return q&&q[0]&&q[0].block;},queueFx:function(o,fn){if(!this.fxQueue){this.fxQueue=[];
453 }if(!this.hasFxBlock()){Roo.applyIf(o,this.fxDefaults);if(!o.concurrent){var A=this.beforeFx(o);fn.block=o.block;this.fxQueue.push(fn);if(A){this.nextFx();}}else{fn.call(this);}}return this;},fxWrap:function(A,o,B){var C;if(!o.wrap||!(C=Roo.get(o.wrap))){var D;
454 if(o.fixPosition){D=this.getXY();}var E=document.createElement("div");E.style.visibility=B;C=Roo.get(this.dom.parentNode.insertBefore(E,this.dom));C.setPositioning(A);if(C.getStyle("position")=="static"){C.position("relative");}this.clearPositioning('auto');
455 C.clip();C.dom.appendChild(this.dom);if(D){C.setXY(D);}}return C;},fxUnwrap:function(A,B,o){this.clearPositioning();this.setPositioning(B);if(!o.wrap){A.dom.parentNode.insertBefore(this.dom,A.dom);A.remove();}},getFxRestore:function(){var st=this.dom.style;
456 return {pos:this.getPositioning(),width:st.width,height:st.height};},afterFx:function(o){if(o.afterStyle){this.applyStyles(o.afterStyle);}if(o.afterCls){this.addClass(o.afterCls);}if(o.remove===true){this.remove();}Roo.callback(o.callback,o.scope,[this]);
457 if(!o.concurrent){this.fxQueue.shift();this.nextFx();}},getFxEl:function(){return Roo.get(this.dom);},fxanim:function(A,B,C,D,E,cb){C=C||'run';B=B||{};var F=Roo.lib.Anim[C](this.dom,A,(B.duration||D)||.35,(B.easing||E)||'easeOut',function(){Roo.callback(cb,this);
458 },this);B.anim=F;return F;}};Roo.Fx.resize=Roo.Fx.scale;Roo.apply(Roo.Element.prototype,Roo.Fx);
459 // Roo/CompositeElement.js
460 Roo.CompositeElement=function(A){this.elements=[];this.addElements(A);};Roo.CompositeElement.prototype={isComposite:true,addElements:function(A){if(!A){return this;}if(typeof A=="string"){A=Roo.Element.selectorFunction(A);}var B=this.elements;var C=B.length-1;
461 for(var i=0,D=A.length;i<D;i++){B[++C]=Roo.get(A[i]);}return this;},fill:function(A){this.elements=[];this.add(A);return this;},filter:function(A,B){var C=[];B=B||false;this.each(function(el){var D=B?!el.is(A):el.is(A);if(D){C[C.length]=el.dom;}});this.fill(C);
462 return this;},invoke:function(fn,A){var B=this.elements;for(var i=0,C=B.length;i<C;i++){Roo.Element.prototype[fn].apply(B[i],A);}return this;},add:function(A){if(typeof A=="string"){this.addElements(Roo.Element.selectorFunction(A));}else if(A.length!==undefined){this.addElements(A);
463 }else{this.addElements([A]);}return this;},each:function(fn,A){var B=this.elements;for(var i=0,C=B.length;i<C;i++){if(fn.call(A||B[i],B[i],this,i)===false){break;}}return this;},item:function(A){return this.elements[A]||null;},first:function(){return this.item(0);
464 },last:function(){return this.item(this.elements.length-1);},getCount:function(){return this.elements.length;},contains:function(el){return this.indexOf(el)!==-1;},indexOf:function(el){return this.elements.indexOf(Roo.get(el));},removeElement:function(el,A){if(el instanceof Array){for(var i=0,B=el.length;
465 i<B;i++){this.removeElement(el[i]);}return this;}var C=typeof el=='number'?el:this.indexOf(el);if(C!==-1){if(A){var d=this.elements[C];if(d.dom){d.remove();}else{d.parentNode.removeChild(d);}}this.elements.splice(C,1);}return this;},replaceElement:function(el,A,B){var C=typeof el=='number'?el:this.indexOf(el);
466 if(C!==-1){if(B){this.elements[C].replaceWith(A);}else{this.elements.splice(C,1,Roo.get(A))}}return this;},clear:function(){this.elements=[];}};(function(){Roo.CompositeElement.createCall=function(B,C){if(!B[C]){B[C]=function(){return this.invoke(C,arguments);
467 };}};for(var A in Roo.Element.prototype){if(typeof Roo.Element.prototype[A]=="function"){Roo.CompositeElement.createCall(Roo.CompositeElement.prototype,A);}};})();
468 // Roo/CompositeElementLite.js
469 Roo.CompositeElementLite=function(A){Roo.CompositeElementLite.superclass.constructor.call(this,A);this.el=new Roo.Element.Flyweight();};Roo.extend(Roo.CompositeElementLite,Roo.CompositeElement,{addElements:function(A){if(A){if(A instanceof Array){this.elements=this.elements.concat(A);
470 }else{var B=this.elements;var C=B.length-1;for(var i=0,D=A.length;i<D;i++){B[++C]=A[i];}}}return this;},invoke:function(fn,A){var B=this.elements;var el=this.el;for(var i=0,C=B.length;i<C;i++){el.dom=B[i];Roo.Element.prototype[fn].apply(el,A);}return this;
471 },item:function(A){if(!this.elements[A]){return null;}this.el.dom=this.elements[A];return this.el;},addListener:function(A,B,C,D){var E=this.elements;for(var i=0,F=E.length;i<F;i++){Roo.EventManager.on(E[i],A,B,C||E[i],D);}return this;},each:function(fn,A){var B=this.elements;
472 var el=this.el;for(var i=0,C=B.length;i<C;i++){el.dom=B[i];if(fn.call(A||el,el,this,i)===false){break;}}return this;},indexOf:function(el){return this.elements.indexOf(Roo.getDom(el));},replaceElement:function(el,A,B){var C=typeof el=='number'?el:this.indexOf(el);
473 if(C!==-1){A=Roo.getDom(A);if(B){var d=this.elements[C];d.parentNode.insertBefore(A,d);d.parentNode.removeChild(d);}this.elements.splice(C,1,A);}return this;}});Roo.CompositeElementLite.prototype.on=Roo.CompositeElementLite.prototype.addListener;
474 // Roo/data/Connection.js
475 Roo.data.Connection=function(A){Roo.apply(this,A);this.addEvents({"beforerequest":true,"requestcomplete":true,"requestexception":true});Roo.data.Connection.superclass.constructor.call(this);};Roo.extend(Roo.data.Connection,Roo.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,request:function(o){if(this.fireEvent("beforerequest",this,o)!==false){var p=o.params;
476 if(typeof p=="function"){p=p.call(o.scope||window,o);}if(typeof p=="object"){p=Roo.urlEncode(o.params);}if(this.extraParams){var A=Roo.urlEncode(this.extraParams);p=p?(p+'&'+A):A;}var B=o.url||this.url;if(typeof B=='function'){B=B.call(o.scope||window,o);
477 }if(o.form){var C=Roo.getDom(o.form);B=B||C.action;var D=C.getAttribute("enctype");if(o.formData){return this.doFormDataUpload(o,p,B);}if(o.isUpload||(D&&D.toLowerCase()=='multipart/form-data')){return this.doFormUpload(o,p,B);}var f=Roo.lib.Ajax.serializeForm(C);
478 p=p?(p+'&'+f):f;}var hs=o.headers;if(this.defaultHeaders){hs=Roo.apply(hs||{},this.defaultHeaders);if(!o.headers){o.headers=hs;}}var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:o.timeout||this.timeout}
479 ;var E=o.method||this.method||(p?"POST":"GET");if(E=='GET'&&(this.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){B+=(B.indexOf('?')!=-1?'&':'?')+'_dc='+(new Date().getTime());}if(typeof o.autoAbort=='boolean'){if(o.autoAbort){this.abort();
480 }}else if(this.autoAbort!==false){this.abort();}if((E=='GET'&&p)||o.xmlData){B+=(B.indexOf('?')!=-1?'&':'?')+p;p='';}Roo.lib.Ajax.useDefaultHeader=typeof(o.headers)=='undefined'||typeof(o.headers['Content-Type'])=='undefined';this.transId=Roo.lib.Ajax.request(E,B,cb,p,o);
481 Roo.lib.Ajax.useDefaultHeader==true;return this.transId;}else{Roo.callback(o.callback,o.scope,[o,null,null]);return null;}},isLoading:function(A){if(A){return Roo.lib.Ajax.isCallInProgress(A);}else{return this.transId?true:false;}},abort:function(A){if(A||this.isLoading()){Roo.lib.Ajax.abort(A||this.transId);
482 }},handleResponse:function(A){this.transId=false;var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestcomplete",this,A,B);Roo.callback(B.success,B.scope,[A,B]);Roo.callback(B.callback,B.scope,[B,true,A]);},handleFailure:function(A,e){this.transId=false;
483 var B=A.argument.options;A.argument=B?B.argument:null;this.fireEvent("requestexception",this,A,B,e);Roo.callback(B.failure,B.scope,[A,B]);Roo.callback(B.callback,B.scope,[B,false,A]);},doFormUpload:function(o,ps,A){var id=Roo.id();var B=document.createElement('iframe');
484 B.id=id;B.name=id;B.className='x-hidden';if(Roo.isIE){B.src=Roo.SSL_SECURE_URL;}document.body.appendChild(B);if(Roo.isIE){document.frames[id].name=id;}var C=Roo.getDom(o.form);C.target=id;C.method='POST';C.enctype=C.encoding='multipart/form-data';if(A){C.action=A;
485 }var D,hd;if(ps){D=[];ps=Roo.urlDecode(ps,false);for(var k in ps){if(ps.hasOwnProperty(k)){hd=document.createElement('input');hd.type='hidden';hd.name=k;hd.value=ps[k];C.appendChild(hd);D.push(hd);}}}function cb(){var r={responseText:'',responseXML:null};
486 r.argument=o?o.argument:null;try{var F;if(Roo.isIE){F=B.contentWindow.document;}else{F=(B.contentDocument||window.frames[id].document);}if(F&&F.body){r.responseText=F.body.innerHTML;}if(F&&F.XMLDocument){r.responseXML=F.XMLDocument;}else{r.responseXML=F;}
487 }catch(e){}Roo.EventManager.removeListener(B,'load',cb,this);this.fireEvent("requestcomplete",this,r,o);Roo.callback(o.success,o.scope,[r,o]);Roo.callback(o.callback,o.scope,[o,true,r]);setTimeout(function(){document.body.removeChild(B);},100);}Roo.EventManager.on(B,'load',cb,this);
488 C.submit();if(D){for(var i=0,E=D.length;i<E;i++){C.removeChild(D[i]);}}},doFormDataUpload:function(o,ps,A){var B=Roo.getDom(o.form);B.enctype=B.encoding='multipart/form-data';var C=o.formData===true?new FormData(B):o.formData;var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o}
489 ,timeout:o.timeout||this.timeout};if(typeof o.autoAbort=='boolean'){if(o.autoAbort){this.abort();}}else if(this.autoAbort!==false){this.abort();}Roo.lib.Ajax.useDefaultHeader=false;this.transId=Roo.lib.Ajax.request("POST",A,cb,o.formData,o);Roo.lib.Ajax.useDefaultHeader=true;
490 }});
491 // Roo/Ajax.js
492 Roo.Ajax=new Roo.data.Connection({autoAbort:false,serializeForm:function(A){return Roo.lib.Ajax.serializeForm(A);}});
493 // Roo/UpdateManager.js
494 Roo.UpdateManager=function(el,A){el=Roo.get(el);if(!A&&el.updateManager){return el.updateManager;}this.el=el;this.defaultUrl=null;this.addEvents({"beforeupdate":true,"update":true,"failure":true});var d=Roo.UpdateManager.defaults;this.sslBlankUrl=d.sslBlankUrl;
495 this.disableCaching=d.disableCaching;this.indicatorText=d.indicatorText;this.showLoadIndicator=d.showLoadIndicator;this.timeout=d.timeout;this.loadScripts=d.loadScripts;this.transaction=null;this.autoRefreshProcId=null;this.refreshDelegate=this.refresh.createDelegate(this);
496 this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);this.successDelegate=this.processSuccess.createDelegate(this);this.failureDelegate=this.processFailure.createDelegate(this);if(!this.renderer){this.renderer=new Roo.UpdateManager.BasicRenderer();
497 }Roo.UpdateManager.superclass.constructor.call(this);};Roo.extend(Roo.UpdateManager,Roo.util.Observable,{getEl:function(){return this.el;},update:function(A,B,C,D){if(this.fireEvent("beforeupdate",this.el,A,B)!==false){var E=this.method,F;if(typeof A=="object"){F=A;
498 A=F.url;B=B||F.params;C=C||F.callback;D=D||F.discardUrl;if(C&&F.scope){C=C.createDelegate(F.scope);}if(typeof F.method!="undefined"){E=F.method;};if(typeof F.nocache!="undefined"){this.disableCaching=F.nocache;};if(typeof F.text!="undefined"){this.indicatorText='<div class="loading-indicator">'+F.text+"</div>";
499 };if(typeof F.scripts!="undefined"){this.loadScripts=F.scripts;};if(typeof F.timeout!="undefined"){this.timeout=F.timeout;};}this.showLoading();if(!D){this.defaultUrl=A;}if(typeof A=="function"){A=A.call(this);}E=E||(B?"POST":"GET");if(E=="GET"){A=this.prepareUrl(A);
500 }var o=Roo.apply(F||{},{url:A,params:B,success:this.successDelegate,failure:this.failureDelegate,callback:undefined,timeout:(this.timeout*1000),argument:{"url":A,"form":null,"callback":C,"params":B}});Roo.log("updated manager called with timeout of "+o.timeout);
501 this.transaction=Roo.Ajax.request(o);}},formUpdate:function(A,B,C,D){if(this.fireEvent("beforeupdate",this.el,A,B)!==false){if(typeof B=="function"){B=B.call(this);}A=Roo.getDom(A);this.transaction=Roo.Ajax.request({form:A,url:B,success:this.successDelegate,failure:this.failureDelegate,timeout:(this.timeout*1000),argument:{"url":B,"form":A,"callback":D,"reset":C}
502 });this.showLoading.defer(1,this);}},refresh:function(A){if(this.defaultUrl==null){return;}this.update(this.defaultUrl,null,A,true);},startAutoRefresh:function(A,B,C,D,E){if(E){this.update(B||this.defaultUrl,C,D,true);}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);
503 }this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[B||this.defaultUrl,C,D,true]),A*1000);},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId;}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false;
504 },showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText);}},prepareUrl:function(A){if(this.disableCaching){var B="_dc="+(new Date().getTime());if(A.indexOf("?")!==-1){A+="&"+B;}else{A+="?"+B;}}return A;},processSuccess:function(A){this.transaction=null;
505 if(A.argument.form&&A.argument.reset){try{A.argument.form.reset();}catch(e){}}if(this.loadScripts){this.renderer.render(this.el,A,this,this.updateComplete.createDelegate(this,[A]));}else{this.renderer.render(this.el,A,this);this.updateComplete(A);}},updateComplete:function(A){this.fireEvent("update",this.el,A);
506 if(typeof A.argument.callback=="function"){A.argument.callback(this.el,true,A);}},processFailure:function(A){this.transaction=null;this.fireEvent("failure",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,false,A);}},setRenderer:function(A){this.renderer=A;
507 },getRenderer:function(){return this.renderer;},setDefaultUrl:function(A){this.defaultUrl=A;},abort:function(){if(this.transaction){Roo.Ajax.abort(this.transaction);}},isUpdating:function(){if(this.transaction){return Roo.Ajax.isLoading(this.transaction);
508 }return false;}});Roo.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Roo.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>'};Roo.UpdateManager.updateElement=function(el,A,B,C){var um=Roo.get(el,true).getUpdateManager();
509 Roo.apply(um,C);um.update(A,B,C?C.callback:null);};Roo.UpdateManager.update=Roo.UpdateManager.updateElement;Roo.UpdateManager.BasicRenderer=function(){};Roo.UpdateManager.BasicRenderer.prototype={render:function(el,A,B,C){el.update(A.responseText,B.loadScripts,C);
510 }};
511 // Roo/DomTemplate.js
512 Roo.DomTemplate=function(){Roo.DomTemplate.superclass.constructor.apply(this,arguments);if(this.html){this.compile();}};Roo.extend(Roo.DomTemplate,Roo.Template,{id:0,inPre:false,tpls:false,re:/(\{|\%7B)([\w-\.]+)(?:\:([\w\.]*)(?:\(([^)]*?)?\))?)?(\}|\%7D)/g,iterChild:function(A,B){var C=this.inPre;
513 if(A.tagName=='PRE'){this.inPre=true;}for(var i=0;i<A.childNodes.length;i++){B.call(this,A.childNodes[i]);}this.inPre=C;},compile:function(){var s=this.html;var A=false;var B=false;try{A=document.implementation.createHTMLDocument("");A.documentElement.innerHTML=this.html;
514 B=A.documentElement;}catch(e){B=document.createElement('div');B.innerHTML=this.html;}this.tpls=[];var _t=this;this.iterChild(B,function(n){_t.compileNode(n,true);});var C=this.tpls;var D={uid:'master',id:this.id++,attr:false,value:false,body:B.innerHTML,forCall:false,execCall:false,dom:B,isTop:true}
515 ;C.unshift(D);this.tpls=[];Roo.each(C,function(tp){this.compileTpl(tp);this.tpls[tp.id]=tp;},this);this.master=C[0];return this;},compileNode:function(A,B){if(A.nodeType!=1){if(A.nodeType==3&&!this.inPre){A.nodeValue=A.nodeValue.replace(/\s+/g,' ');}return;
516 }var C={uid:false,id:false,attr:false,value:false,body:'',forCall:false,execCall:false,dom:false,isTop:B};switch(true){case (A.hasAttribute('roo-for')):C.attr='for';break;case (A.hasAttribute('roo-if')):C.attr='if';break;case (A.hasAttribute('roo-name')):C.attr='name';
517 break;case (A.hasAttribute('roo-exec')):C.attr='exec';break;}if(!C.attr){this.iterChild(A,this.compileNode);return;}C.uid=this.id++;C.value=A.getAttribute('roo-'+C.attr);A.removeAttribute('roo-'+C.attr);if(C.attr!='name'){var D=document.createTextNode('{domtpl'+C.uid+'}');
518 A.parentNode.replaceChild(D,A);}else{var D=document.createElement('span');D.className='roo-tpl-'+C.value;A.parentNode.replaceChild(D,A);}this.iterChild(A,this.compileNode);var E=document.createElement('div');E.appendChild(A);C.dom=A;C.body=E.innerHTML;C.id=C.uid;
519 switch(C.attr){case 'for':switch(C.value){case '.':C.forCall=new Function('values','parent','with(values){ return values; }');break;case '..':C.forCall=new Function('values','parent','with(values){ return parent; }');break;default:C.forCall=new Function('values','parent','with(values){ return '+C.value+'; }');
520 }break;case 'exec':C.execCall=new Function('values','parent','with(values){ '+(Roo.util.Format.htmlDecode(C.value))+'; }');break;case 'if':C.ifCall=new Function('values','parent','with(values){ return '+(Roo.util.Format.htmlDecode(C.value))+'; }');break;case 'name':C.id=C.value;
521 break;}this.tpls.push(C);},compileTpl:function(tpl){var fm=Roo.util.Format;var useF=this.disableFormats!==true;var A=Roo.isGecko?"+\n":",\n";var undef=function(C){Roo.debug&&Roo.log("Property not found :"+C);return '';};var fn=function(m,C,D,E,F){F=F?F.replace(/\\'/g,"'"):F;
522 if(typeof(E)=='undefined'){E='htmlEncode';}if(E=='raw'){E=false;}if(D.substr(0,6)=='domtpl'){return "'"+A+'this.applySubTemplate('+D.substr(6)+', values, parent)'+A+"'";}var G=[];var H='';Roo.each(D.split('.'),function(st){H+=(H.length?'.':'')+st;G.push("(typeof("+H+") == 'undefined')");
523 });var I='(('+G.join(" || ")+") ? undef('"+D+"') : ";if(E&&useF){F=F?','+F:"";if(E.substr(0,5)!="this."){E="fm."+E+'(';}else{E='this.call("'+E.substr(5)+'", ';F=", values";}return "'"+A+I+E+D+F+"))"+A+"'";}if(F&&F.length){return "'"+A+I+D+'('+F+"))"+A+"'";
524 }return "'"+A+I+D+")"+A+"'";};var B;if(Roo.isGecko){B="tpl.compiled = function(values, parent){  with(values) { return '"+tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn)+"';};};";}else{B=["tpl.compiled = function(values, parent){  with (values) { return ['"];
525 B.push(tpl.body.replace(/(\r\n|\n)/g,'\\n').replace(/'/g,"\\'").replace(this.re,fn));B.push("'].join('');};};");B=B.join('');}Roo.debug&&Roo.log(B.replace(/\\n/,'\n'));eval(B);return this;},applySubTemplate:function(id,A,B){var t=this.tpls[id];try{if(t.ifCall&&!t.ifCall.call(this,A,B)){Roo.debug&&Roo.log('if call on '+t.value+' return false');
526 return '';}}catch(e){Roo.log('Xtemplate.applySubTemplate('+id+'): Exception thrown on roo-if="'+t.value+'" - '+e.toString());Roo.log(A);return '';}try{if(t.execCall&&t.execCall.call(this,A,B)){return '';}}catch(e){Roo.log('Xtemplate.applySubTemplate('+id+'): Exception thrown on roo-for="'+t.value+'" - '+e.toString());
527 Roo.log(A);return '';}try{var vs=t.forCall?t.forCall.call(this,A,B):A;B=t.target?A:B;if(t.forCall&&vs instanceof Array){var C=[];for(var i=0,D=vs.length;i<D;i++){try{C[C.length]=t.compiled.call(this,vs[i],B);}catch(e){Roo.log('Xtemplate.applySubTemplate('+id+'): Exception thrown on body="'+t.value+'" - '+e.toString());
528 Roo.log(e.body);Roo.log(vs[i]);}}return C.join('');}}catch(e){Roo.log('Xtemplate.applySubTemplate('+id+'): Exception thrown on roo-for="'+t.value+'" - '+e.toString());Roo.log(A);return '';}try{return t.compiled.call(this,vs,B);}catch(e){Roo.log('Xtemplate.applySubTemplate('+id+'): Exception thrown on body="'+t.value+'" - '+e.toString());
529 Roo.log(e.body);Roo.log(A);return '';}},applyTemplate:function(A){return this.master.compiled.call(this,A,{});},apply:function(){return this.applyTemplate.apply(this,arguments);}});Roo.DomTemplate.from=function(el){el=Roo.getDom(el);return new Roo.Domtemplate(el.value||el.innerHTML);
530 };
531 // Roo/util/DelayedTask.js
532 Roo.util.DelayedTask=function(fn,A,B){var id=null,d,t;var C=function(){var D=new Date().getTime();if(D-t>=d){clearInterval(id);id=null;fn.apply(A,B||[]);}};this.delay=function(D,E,F,G){if(id&&D!=d){this.cancel();}d=D;t=new Date().getTime();fn=E||fn;A=F||A;
533 B=G||B;if(!id){id=setInterval(C,d);}};this.cancel=function(){if(id){clearInterval(id);id=null;}};};
534 // Roo/util/TaskRunner.js
535 Roo.util.TaskRunner=function(A){A=A||10;var B=[],C=[];var id=0;var D=false;var E=function(){D=false;clearInterval(id);id=0;};var F=function(){if(!D){D=true;id=setInterval(H,A);}};var G=function(I){C.push(I);if(I.onStop){I.onStop();}};var H=function(){if(C.length>0){for(var i=0,I=C.length;
536 i<I;i++){B.remove(C[i]);}C=[];if(B.length<1){E();return;}}var J=new Date().getTime();for(var i=0,I=B.length;i<I;++i){var t=B[i];var K=J-t.taskRunTime;if(t.interval<=K){var rt=t.run.apply(t.scope||t,t.args||[++t.taskRunCount]);t.taskRunTime=J;if(rt===false||t.taskRunCount===t.repeat){G(t);
537 return;}}if(t.duration&&t.duration<=(J-t.taskStartTime)){G(t);}}};this.start=function(I){B.push(I);I.taskStartTime=new Date().getTime();I.taskRunTime=0;I.taskRunCount=0;F();return I;};this.stop=function(I){G(I);return I;};this.stopAll=function(){E();for(var i=0,I=B.length;
538 i<I;i++){if(B[i].onStop){B[i].onStop();}}B=[];C=[];};};Roo.TaskMgr=new Roo.util.TaskRunner();
539 // Roo/util/MixedCollection.js
540 Roo.util.MixedCollection=function(A,B){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents({"clear":true,"add":true,"replace":true,"remove":true,"sort":true});this.allowFunctions=A===true;if(B){this.getKey=B;}Roo.util.MixedCollection.superclass.constructor.call(this);
541 };Roo.extend(Roo.util.MixedCollection,Roo.util.Observable,{allowFunctions:false,add:function(A,o){if(arguments.length==1){o=arguments[0];A=this.getKey(o);}if(typeof A=="undefined"||A===null){this.length++;this.items.push(o);this.keys.push(null);}else{var B=this.map[A];
542 if(B){return this.replace(A,o);}this.length++;this.items.push(o);this.map[A]=o;this.keys.push(A);}this.fireEvent("add",this.length-1,o,A);return o;},getKey:function(o){return o.id;},replace:function(A,o){if(arguments.length==1){o=arguments[0];A=this.getKey(o);
543 }var B=this.item(A);if(typeof A=="undefined"||A===null||typeof B=="undefined"){return this.add(A,o);}var C=this.indexOfKey(A);this.items[C]=o;this.map[A]=o;this.fireEvent("replace",A,B,o);return o;},addAll:function(A){if(arguments.length>1||A instanceof Array){var B=arguments.length>1?arguments:A;
544 for(var i=0,C=B.length;i<C;i++){this.add(B[i]);}}else{for(var D in A){if(this.allowFunctions||typeof A[D]!="function"){this.add(D,A[D]);}}}},each:function(fn,A){var B=[].concat(this.items);for(var i=0,C=B.length;i<C;i++){if(fn.call(A||B[i],B[i],i,C)===false){break;
545 }}},eachKey:function(fn,A){for(var i=0,B=this.keys.length;i<B;i++){fn.call(A||window,this.keys[i],this.items[i],i,B);}},find:function(fn,A){for(var i=0,B=this.items.length;i<B;i++){if(fn.call(A||window,this.items[i],this.keys[i])){return this.items[i];}}return null;
546 },insert:function(A,B,o){if(arguments.length==2){o=arguments[1];B=this.getKey(o);}if(A>=this.length){return this.add(B,o);}this.length++;this.items.splice(A,0,o);if(typeof B!="undefined"&&B!=null){this.map[B]=o;}this.keys.splice(A,0,B);this.fireEvent("add",A,o,B);
547 return o;},remove:function(o){return this.removeAt(this.indexOf(o));},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var o=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B];}this.keys.splice(A,1);
548 this.fireEvent("remove",o,B);}},removeKey:function(A){return this.removeAt(this.indexOfKey(A));},getCount:function(){return this.length;},indexOf:function(o){if(!this.items.indexOf){for(var i=0,A=this.items.length;i<A;i++){if(this.items[i]==o){return i;}}
549 return -1;}else{return this.items.indexOf(o);}},indexOfKey:function(A){if(!this.keys.indexOf){for(var i=0,B=this.keys.length;i<B;i++){if(this.keys[i]==A){return i;}}return -1;}else{return this.keys.indexOf(A);}},item:function(A){if(A==='length'){return null;
550 }var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];return typeof B!='function'||this.allowFunctions?B:null;},itemAt:function(A){return this.items[A];},key:function(A){return this.map[A];},contains:function(o){return this.indexOf(o)!=-1;},containsKey:function(A){return typeof this.map[A]!="undefined";
551 },clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear");},first:function(){return this.items[0];},last:function(){return this.items[this.length-1];},_sort:function(A,B,fn){var C=String(B).toUpperCase()=="DESC"?-1:1;
552 fn=fn||function(a,b){return a-b;};var c=[],k=this.keys,D=this.items;for(var i=0,E=D.length;i<E;i++){c[c.length]={key:k[i],value:D[i],index:i};}c.sort(function(a,b){var v=fn(a[A],b[A])*C;if(v==0){v=(a.index<b.index?-1:1);}return v;});for(var i=0,E=c.length;
553 i<E;i++){D[i]=c[i].value;k[i]=c[i].key;}this.fireEvent("sort",this);},sort:function(A,fn){this._sort("value",A,fn);},keySort:function(A,fn){this._sort("key",A,fn||function(a,b){return String(a).toUpperCase()-String(b).toUpperCase();});},getRange:function(A,B){var C=this.items;
554 if(C.length<1){return [];}A=A||0;B=Math.min(typeof B=="undefined"?this.length-1:B,this.length-1);var r=[];if(A<=B){for(var i=A;i<=B;i++){r[r.length]=C[i];}}else{for(var i=A;i>=B;i--){r[r.length]=C[i];}}return r;},filter:function(A,B){if(!B.exec){B=String(B);
555 if(B.length==0){return this.clone();}B=new RegExp("^"+Roo.escapeRe(B),"i");}return this.filterBy(function(o){return o&&B.test(o[A]);});},filterBy:function(fn,A){var r=new Roo.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,B=it.length;
556 i<B;i++){if(fn.call(A||this,it[i],k[i])){r.add(k[i],it[i]);}}return r;},clone:function(){var r=new Roo.util.MixedCollection();var k=this.keys,it=this.items;for(var i=0,A=it.length;i<A;i++){r.add(k[i],it[i]);}r.getKey=this.getKey;return r;}});Roo.util.MixedCollection.prototype.get=Roo.util.MixedCollection.prototype.item;
557
558 // Roo/util/JSON.js
559 Roo.util.JSON=new (function(){var A={}.hasOwnProperty?true:false;var B=function(n){return n<10?"0"+n:n;};var m={"\b":'\\b',"\t":'\\t',"\n":'\\n',"\f":'\\f',"\r":'\\r','"':'\\"',"\\":'\\\\'};var C=function(s){if(/["\\\x00-\x1f]/.test(s)){return '"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];
560 if(c){return c;}c=b.charCodeAt();return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}return '"'+s+'"';};var D=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case "undefined":case "function":case "unknown":break;
561 default:if(b){a.push(',');}a.push(v===null?"null":Roo.util.JSON.encode(v));b=true;}}a.push("]");return a.join("");};var E=function(o){return '"'+o.getFullYear()+"-"+B(o.getMonth()+1)+"-"+B(o.getDate())+"T"+B(o.getHours())+":"+B(o.getMinutes())+":"+B(o.getSeconds())+'"';
562 };this.encode=function(o){if(typeof o=="undefined"||o===null){return "null";}else if(o instanceof Array){return D(o);}else if(o instanceof Date){return E(o);}else if(typeof o=="string"){return C(o);}else if(typeof o=="number"){return isFinite(o)?String(o):"null";
563 }else if(typeof o=="boolean"){return String(o);}else{var a=["{"],b,i,v;for(i in o){if(!A||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case "undefined":case "function":case "unknown":break;default:if(b){a.push(',');}a.push(this.encode(i),":",v===null?"null":this.encode(v));
564 b=true;}}}a.push("}");return a.join("");}};this.decode=function(json){return eval("("+json+')');};})();Roo.encode=typeof(JSON)!='undefined'&&JSON.stringify?JSON.stringify:Roo.util.JSON.encode;Roo.decode=typeof(JSON)!='undefined'&&JSON.parse?JSON.parse:Roo.util.JSON.decode;
565
566 // Roo/util/Format.js
567 Roo.util.Format=function(){var A=/^\s+|\s+$/g;return {ellipsis:function(B,C){if(B&&B.length>C){return B.substr(0,C-3)+"...";}return B;},undef:function(B){return typeof B!="undefined"?B:"";},htmlEncode:function(B){return !B?B:String(B).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;");
568 },htmlDecode:function(B){return !B?B:String(B).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"');},trim:function(B){return String(B).replace(A,"");},substr:function(B,C,D){return String(B).substr(C,D);},lowercase:function(B){return String(B).toLowerCase();
569 },uppercase:function(B){return String(B).toUpperCase();},capitalize:function(B){return !B?B:B.charAt(0).toUpperCase()+B.substr(1).toLowerCase();},call:function(value,fn){if(arguments.length>2){var B=Array.prototype.slice.call(arguments,2);B.unshift(value);
570 return eval(fn).apply(window,B);}else{return eval(fn).call(window,value);}},toFixed:function(v,n){if(!n){return Math.round(v-0);}var B=Math.pow(10,n+1);v=(Math.round((v-0)*B))/B;var z=(''+B).substring(2);if(v==Math.floor(v)){return Math.floor(v)+'.'+z;}var ps=String(v).split('.');
571 var fd=(ps[1]+z);var r=fd.substring(0,n);var rm=fd.substring(n);if(rm<5){return ps[0]+'.'+r;}r*=1;r++;if(String(r).length!=n){ps[0]*=1;ps[0]++;r=String(r).substring(1);}return ps[0]+'.'+r;},usMoney:function(v){return '$'+Roo.util.Format.number(v);},number:function(v,B,C){B=typeof(B)=='undefined'?2:B;
572 C=typeof(C)=='undefined'?',':C;var D=Math.pow(10,B);var E=String(D).substring(1);v=(Math.round((v-0)*D))/D;v=String(v);var ps=v.split('.');var F=ps[0];var r=/(\d+)(\d{3})/;if(C.length!=0){F=F.replace(/\B(?=(\d{3})+(?!\d))/g,C);}var G=ps[1]?(B?('.'+ps[1]+E.substring(ps[1].length)):''):(B?('.'+E):'');
573 return F+G;},date:function(v,B){if(!v){return "";}if(!(v instanceof Date)){v=new Date(Date.parse(v));}return v.dateFormat(B||Roo.util.Format.defaults.date);},dateRenderer:function(B){return function(v){return Roo.util.Format.date(v,B);};},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"");
574 }};}();Roo.util.Format.defaults={date:'d/M/Y'};
575 // Roo/MasterTemplate.js
576 Roo.MasterTemplate=function(){Roo.MasterTemplate.superclass.constructor.apply(this,arguments);this.originalHtml=this.html;var st={};var m,re=this.subTemplateRe;re.lastIndex=0;var A=0;while(m=re.exec(this.html)){var B=m[1],C=m[2];st[A]={name:B,index:A,buffer:[],tpl:new Roo.Template(C)}
577 ;if(B){st[B]=st[A];}st[A].tpl.compile();st[A].tpl.call=this.call.createDelegate(this);A++;}this.subCount=A;this.subs=st;};Roo.extend(Roo.MasterTemplate,Roo.Template,{subTemplateRe:/<tpl(?:\sname="([\w-]+)")?>((?:.|\n)*?)<\/tpl>/gi,add:function(A,B){if(arguments.length==1){B=arguments[0];
578 A=0;}var s=this.subs[A];s.buffer[s.buffer.length]=s.tpl.apply(B);return this;},fill:function(A,B,C){var a=arguments;if(a.length==1||(a.length==2&&typeof a[1]=="boolean")){B=a[0];A=0;C=a[1];}if(C){this.reset();}for(var i=0,D=B.length;i<D;i++){this.add(A,B[i]);
579 }return this;},reset:function(){var s=this.subs;for(var i=0;i<this.subCount;i++){s[i].buffer=[];}return this;},applyTemplate:function(A){var s=this.subs;var B=-1;this.html=this.originalHtml.replace(this.subTemplateRe,function(m,C){return s[++B].buffer.join("");
580 });return Roo.MasterTemplate.superclass.applyTemplate.call(this,A);},apply:function(){return this.applyTemplate.apply(this,arguments);},compile:function(){return this;}});Roo.MasterTemplate.prototype.addAll=Roo.MasterTemplate.prototype.fill;Roo.MasterTemplate.from=function(el,A){el=Roo.getDom(el);
581 return new Roo.MasterTemplate(el.value||el.innerHTML,A||'');};
582 // Roo/util/CSS.js
583 Roo.util.CSS=function(){var A=null;var B=document;var C=/(-[a-z])/gi;var D=function(m,a){return a.charAt(1).toUpperCase();};return {createStyleSheet:function(E,id){var ss;var F=B.getElementsByTagName("head")[0];var G=B.createElement("style");G.setAttribute("type","text/css");
584 if(id){G.setAttribute("id",id);}if(typeof(E)!='string'){var H=[];for(var n in E){var I=[];for(var k in E[n]){I.push(k+' : '+E[n][k]+';');}H.push(n+' { '+I.join(' ')+'} ');}E=H.join("\n");}if(Roo.isIE){F.appendChild(G);ss=G.styleSheet;ss.cssText=E;}else{try{G.appendChild(B.createTextNode(E));
585 }catch(e){G.cssText=E;}F.appendChild(G);ss=G.styleSheet?G.styleSheet:(G.sheet||B.styleSheets[B.styleSheets.length-1]);}this.cacheStyleSheet(ss);return ss;},removeStyleSheet:function(id){var E=B.getElementById(id);if(E){E.parentNode.removeChild(E);}},swapStyleSheet:function(id,E){this.removeStyleSheet(id);
586 var ss=B.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",E);B.getElementsByTagName("head")[0].appendChild(ss);},refreshCache:function(){return this.getRules(true);
587 },cacheStyleSheet:function(E){if(!A){A={};}try{var F=E.cssRules||E.rules;for(var j=F.length-1;j>=0;--j){A[F[j].selectorText]=F[j];}}catch(e){}},getRules:function(E){if(A==null||E){A={};var ds=B.styleSheets;for(var i=0,F=ds.length;i<F;i++){try{this.cacheStyleSheet(ds[i]);
588 }catch(e){}}}return A;},getRule:function(E,F){var rs=this.getRules(F);if(!(E instanceof Array)){return rs[E];}for(var i=0;i<E.length;i++){if(rs[E[i]]){return rs[E[i]];}}return null;},updateRule:function(E,F,G){if(!(E instanceof Array)){var H=this.getRule(E);
589 if(H){H.style[F.replace(C,D)]=G;return true;}}else{for(var i=0;i<E.length;i++){if(this.updateRule(E[i],F,G)){return true;}}}return false;}};}();
590 // Roo/util/ClickRepeater.js
591 Roo.util.ClickRepeater=function(el,A){this.el=Roo.get(el);this.el.unselectable();Roo.apply(this,A);this.addEvents({"mousedown":true,"click":true,"mouseup":true});this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(e){if(this.preventDefault){e.preventDefault();
592 }if(this.stopDefault){e.stopEvent();}},this);}if(this.handler){this.on("click",this.handler,this.scope||this);}Roo.util.ClickRepeater.superclass.constructor.call(this);};Roo.extend(Roo.util.ClickRepeater,Roo.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,handleMouseDown:function(){clearTimeout(this.timer);
593 this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass);}this.mousedownTime=new Date();Roo.get(document).on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);
594 this.timer=this.click.defer(this.delay||this.interval,this);},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.getInterval(),this);},getInterval:function(){if(!this.accelerate){return this.interval;}var A=this.mousedownTime.getElapsed();
595 if(A<500){return 400;}else if(A<1700){return 320;}else if(A<2600){return 250;}else if(A<3500){return 180;}else if(A<4400){return 140;}else if(A<5300){return 80;}else if(A<6200){return 50;}else{return 10;}},handleMouseOut:function(){clearTimeout(this.timer);
596 if(this.pressClass){this.el.removeClass(this.pressClass);}this.el.on("mouseover",this.handleMouseReturn,this);},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn);if(this.pressClass){this.el.addClass(this.pressClass);}this.click();
597 },handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn);this.el.un("mouseout",this.handleMouseOut);Roo.get(document).un("mouseup",this.handleMouseUp);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this);
598 }});
599 // Roo/KeyNav.js
600 Roo.KeyNav=function(el,A){this.el=Roo.get(el);Roo.apply(this,A);if(!this.disabled){this.disabled=true;this.enable();}};Roo.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(e){var k=e.getKey();var h=this.keyToHandler[k];
601 if(Roo.isSafari&&h&&k>=37&&k<=40){e.stopEvent();}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]();}}},doRelay:function(e,h,A){return h.call(this.scope||this,e);
602 },enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"}
603 ,enable:function(){if(this.disabled){if(this.forceKeyDown||Roo.isIE||Roo.isAir){this.el.on("keydown",this.relay,this);}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this);}this.disabled=false;}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Roo.isIE||Roo.isAir){this.el.un("keydown",this.relay);
604 }else{this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay);}this.disabled=true;}}};
605 // Roo/KeyMap.js
606 Roo.KeyMap=function(el,A,B){this.el=Roo.get(el);this.eventName=B||"keydown";this.bindings=[];if(A){this.addBinding(A);}this.enable();};Roo.KeyMap.prototype={stopEvent:false,addBinding:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){this.addBinding(A[i]);
607 }return;}var C=A.key,D=A.shift,E=A.ctrl,F=A.alt,fn=A.fn,G=A.scope;if(typeof C=="string"){var ks=[];var H=C.toUpperCase();for(var j=0,B=H.length;j<B;j++){ks.push(H.charCodeAt(j));}C=ks;}var I=C instanceof Array;var J=function(e){if((!D||e.shiftKey)&&(!E||e.ctrlKey)&&(!F||e.altKey)){var k=e.getKey();
608 if(I){for(var i=0,K=C.length;i<K;i++){if(C[i]==k){if(this.stopEvent){e.stopEvent();}fn.call(G||window,k,e);return;}}}else{if(k==C){if(this.stopEvent){e.stopEvent();}fn.call(G||window,k,e);}}}};this.bindings.push(J);},on:function(A,fn,B){var C,D,E,F;if(typeof A=="object"&&!(A instanceof Array)){C=A.key;
609 D=A.shift;E=A.ctrl;F=A.alt;}else{C=A;}this.addBinding({key:C,shift:D,ctrl:E,alt:F,fn:fn,scope:B})},handleKeyDown:function(e){if(this.enabled){var b=this.bindings;for(var i=0,A=b.length;i<A;i++){b[i].call(this,e);}}},isEnabled:function(){return this.enabled;
610 },enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true;}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false;}}};
611 // Roo/util/TextMetrics.js
612 Roo.util.TextMetrics=function(){var A;return {measure:function(el,B,C){if(!A){A=Roo.util.TextMetrics.Instance(el,C);}A.bind(el);A.setFixedWidth(C||'auto');return A.getSize(B);},createInstance:function(el,B){return Roo.util.TextMetrics.Instance(el,B);}};}();
613 Roo.util.TextMetrics.Instance=function(A,B){var ml=new Roo.Element(document.createElement('div'));document.body.appendChild(ml.dom);ml.position('absolute');ml.setLeftTop(-1000,-1000);ml.hide();if(B){ml.setWidth(B);}var C={getSize:function(D){ml.update(D);
614 var s=ml.getSize();ml.update('');return s;},bind:function(el){ml.setStyle(Roo.fly(el).getStyles('font-size','font-style','font-weight','font-family','line-height'));},setFixedWidth:function(D){ml.setWidth(D);},getWidth:function(D){ml.dom.style.width='auto';
615 return this.getSize(D).width;},getHeight:function(D){return this.getSize(D).height;}};C.bind(A);return C;};Roo.Element.measureText=Roo.util.TextMetrics.measure;
616 // Roo/state/Provider.js
617 Roo.state.Provider=function(){this.addEvents({"statechange":true});this.state={};Roo.state.Provider.superclass.constructor.call(this);};Roo.extend(Roo.state.Provider,Roo.util.Observable,{get:function(A,B){return typeof this.state[A]=="undefined"?B:this.state[A];
618 },clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null);},set:function(A,B){this.state[A]=B;this.fireEvent("statechange",this,A,B);},decodeValue:function(A){var re=/^(a|n|d|b|s|o)\:(.*)$/;var B=re.exec(unescape(A));if(!B||!B[1]){return;
619 }var C=B[1];var v=B[2];switch(C){case "n":return parseFloat(v);case "d":return new Date(Date.parse(v));case "b":return (v=="1");case "a":var D=[];var E=v.split("^");for(var i=0,F=E.length;i<F;i++){D.push(this.decodeValue(E[i]));}return D;case "o":var D={}
620 ;var E=v.split("^");for(var i=0,F=E.length;i<F;i++){var kv=E[i].split("=");D[kv[0]]=this.decodeValue(kv[1]);}return D;default:return v;}},encodeValue:function(v){var A;if(typeof v=="number"){A="n:"+v;}else if(typeof v=="boolean"){A="b:"+(v?"1":"0");}else if(v instanceof Date){A="d:"+v.toGMTString();
621 }else if(v instanceof Array){var B="";for(var i=0,C=v.length;i<C;i++){B+=this.encodeValue(v[i]);if(i!=C-1){B+="^";}}A="a:"+B;}else if(typeof v=="object"){var B="";for(var D in v){if(typeof v[D]!="function"){B+=D+"="+this.encodeValue(v[D])+"^";}}A="o:"+B.substring(0,B.length-1);
622 }else{A="s:"+v;}return escape(A);}});
623 // Roo/state/Manager.js
624 Roo.state.Manager=function(){var A=new Roo.state.Provider();return {setProvider:function(B){A=B;},get:function(B,C){return A.get(B,C);},set:function(B,C){A.set(B,C);},clear:function(B){A.clear(B);},getProvider:function(){return A;}};}();
625 // Roo/state/CookieProvider.js
626 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();}
627 ;Roo.extend(Roo.state.CookieProvider,Roo.state.Provider,{set:function(A,B){if(typeof B=="undefined"||B===null){this.clear(A);return;}this.setCookie(A,B);Roo.state.CookieProvider.superclass.set.call(this,A,B);},clear:function(A){this.clearCookie(A);Roo.state.CookieProvider.superclass.clear.call(this,A);
628 },readCookies:function(){var A={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var B;while((B=re.exec(c))!=null){var C=B[1];var D=B[2];if(C&&C.substring(0,3)=="ys-"){A[C.substr(3)]=this.decodeValue(D);}}return A;},setCookie:function(A,B){document.cookie="ys-"+A+"="+this.encodeValue(B)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"");
629 },clearCookie:function(A){document.cookie="ys-"+A+"=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":"");}});
630 // Roo/ComponentMgr.js
631 Roo.ComponentMgr=function(){var A=new Roo.util.MixedCollection();return {register:function(c){A.add(c);},unregister:function(c){A.remove(c);},get:function(id){return A.get(id);},onAvailable:function(id,fn,B){A.on("add",function(C,o){if(o.id==id){fn.call(B||o,o);
632 A.un("add",fn,B);}});}};}();
633 // Roo/Component.js
634 Roo.Component=function(A){A=A||{};if(A.tagName||A.dom||typeof A=="string"){A={el:A,id:A.id||A};}this.initialConfig=A;Roo.apply(this,A);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true}
635 );if(!this.id){this.id="roo-comp-"+(++Roo.Component.AUTO_ID);}Roo.ComponentMgr.register(this);Roo.Component.superclass.constructor.call(this);this.initComponent();if(this.renderTo){this.render(this.renderTo);delete this.renderTo;}};Roo.Component.AUTO_ID=1000;
636 Roo.extend(Roo.Component,Roo.util.Observable,{hidden:false,disabled:false,rendered:false,disabledClass:"x-item-disabled",allowDomMove:true,hideMode:'display',ctype:"Roo.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode];},initComponent:Roo.emptyFn,render:function(A,B){if(this.rendered){return this;
637 }if(this.fireEvent("beforerender",this)===false){return false;}if(!A&&this.el){this.el=Roo.get(this.el);A=this.el.dom.parentNode;this.allowDomMove=false;}this.container=Roo.get(A);this.rendered=true;if(B!==undefined){if(typeof B=='number'){B=this.container.dom.childNodes[B];
638 }else{B=Roo.getDom(B);}}this.onRender(this.container,B||null);if(this.cls){this.el.addClass(this.cls);delete this.cls;}if(this.style){this.el.applyStyles(this.style);delete this.style;}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide();
639 }if(this.disabled){this.disable();}return this;},onRender:function(ct,A){if(this.el){this.el=Roo.get(this.el);if(this.allowDomMove!==false){ct.dom.insertBefore(this.el.dom,A);}}},getAutoCreate:function(){var A=typeof this.autoCreate=="object"?this.autoCreate:Roo.apply({}
640 ,this.defaultAutoCreate);if(this.id&&!A.id){A.id=this.id;}return A;},afterRender:Roo.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.purgeListeners();this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();
641 if(this.actionMode=="container"){this.container.remove();}}this.onDestroy();Roo.ComponentMgr.unregister(this);this.fireEvent("destroy",this);}},beforeDestroy:function(){},onDestroy:function(){},getEl:function(){return this.el;},getId:function(){return this.id;
642 },focus:function(A){if(this.rendered){this.el.focus();if(A===true){this.el.dom.select();}}return this;},blur:function(){if(this.rendered){this.el.blur();}return this;},disable:function(){if(this.rendered){this.onDisable();}this.disabled=true;this.fireEvent("disable",this);
643 return this;},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true;},enable:function(){if(this.rendered){this.onEnable();}this.disabled=false;this.fireEvent("enable",this);return this;},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);
644 this.el.dom.disabled=false;},setDisabled:function(A){this[A?"disable":"enable"]();},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.rendered){this.onShow();}this.fireEvent("show",this);}return this;},onShow:function(){var ae=this.getActionEl();
645 if(this.hideMode=='visibility'){ae.dom.style.visibility="visible";}else if(this.hideMode=='offsets'){ae.removeClass('x-hidden');}else{ae.dom.style.display="";}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide();
646 }this.fireEvent("hide",this);}return this;},onHide:function(){var ae=this.getActionEl();if(this.hideMode=='visibility'){ae.dom.style.visibility="hidden";}else if(this.hideMode=='offsets'){ae.addClass('x-hidden');}else{ae.dom.style.display="none";}},setVisible:function(A){if(A){this.show();
647 }else{this.hide();}return this;},isVisible:function(){return this.getActionEl().isVisible();},cloneConfig:function(A){A=A||{};var id=A.id||Roo.id();var B=Roo.applyIf(A,this.initialConfig);B.id=id;return new this.constructor(B);}});
648 // Roo/BoxComponent.js
649 Roo.BoxComponent=function(A){Roo.Component.call(this,A);this.addEvents({resize:true,move:true});};Roo.extend(Roo.BoxComponent,Roo.Component,{boxReady:false,deferHeight:false,setSize:function(w,h){if(typeof w=='object'){h=w.height;w=w.width;}if(!this.boxReady){this.width=w;
650 this.height=h;return this;}if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return this;}this.lastSize={width:w,height:h};var A=this.adjustSize(w,h);var aw=A.width,ah=A.height;if(aw!==undefined||ah!==undefined){var rz=this.getResizeEl();
651 if(!this.deferHeight&&aw!==undefined&&ah!==undefined){rz.setSize(aw,ah);}else if(!this.deferHeight&&ah!==undefined){rz.setHeight(ah);}else if(aw!==undefined){rz.setWidth(aw);}this.onResize(aw,ah,w,h);this.fireEvent('resize',this,aw,ah,w,h);}return this;},getSize:function(){return this.el.getSize();
652 },getPosition:function(A){if(A===true){return [this.el.getLeft(true),this.el.getTop(true)];}return this.xy||this.el.getXY();},getBox:function(A){var s=this.el.getSize();if(A){s.x=this.el.getLeft(true);s.y=this.el.getTop(true);}else{var xy=this.xy||this.el.getXY();
653 s.x=xy[0];s.y=xy[1];}return s;},updateBox:function(A){this.setSize(A.width,A.height);this.setPagePosition(A.x,A.y);return this;},getResizeEl:function(){return this.resizeEl||this.el;},getPositionEl:function(){return this.positionEl||this.el;},setPosition:function(x,y){this.x=x;
654 this.y=y;if(!this.boxReady){return this;}var A=this.adjustPosition(x,y);var ax=A.x,ay=A.y;var el=this.getPositionEl();if(ax!==undefined||ay!==undefined){if(ax!==undefined&&ay!==undefined){el.setLeftTop(ax,ay);}else if(ax!==undefined){el.setLeft(ax);}else if(ay!==undefined){el.setTop(ay);
655 }this.onPosition(ax,ay);this.fireEvent('move',this,ax,ay);}return this;},setPagePosition:function(x,y){this.pageX=x;this.pageY=y;if(!this.boxReady){return;}if(x===undefined||y===undefined){return;}var p=this.el.translatePoints(x,y);this.setPosition(p.left,p.top);
656 return this;},onRender:function(ct,A){Roo.BoxComponent.superclass.onRender.call(this,ct,A);if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl);}if(this.positionEl){this.positionEl=Roo.get(this.positionEl);}},afterRender:function(){Roo.BoxComponent.superclass.afterRender.call(this);
657 this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y);}if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY);}},syncSize:function(){delete this.lastSize;this.setSize(this.el.getWidth(),this.el.getHeight());
658 return this;},onResize:function(A,B,C,D){},onPosition:function(x,y){},adjustSize:function(w,h){if(this.autoWidth){w='auto';}if(this.autoHeight){h='auto';}return {width:w,height:h};},adjustPosition:function(x,y){return {x:x,y:y};}});
659 // Roo/XComponent.js
660 Roo.XComponent=function(A){Roo.apply(this,A);this.addEvents({'built':true});this.region=this.region||'center';Roo.XComponent.register(this);this.modules=false;this.el=false;};Roo.extend(Roo.XComponent,Roo.util.Observable,{el:false,panel:false,layout:false,disabled:false,parent:false,order:false,name:false,region:'center',items:false,_tree:false,render:function(el){el=el||false;
661 var hp=this.parent?1:0;Roo.debug&&Roo.log(this);var A=this._tree?this._tree():this.tree();if(!el&&typeof(this.parent)=='string'&&this.parent.substring(0,1)=='#'){var B=this.parent.substr(1);this.parent=false;Roo.debug&&Roo.log(B);switch(B){case 'bootstrap-body':if(typeof(A.el)!='undefined'&&A.el==document.body){this.parent={el:true}
662 ;break;}if(["Nest","Content","Grid","Tree"].indexOf(A.xtype)>-1){this.parent={el:new Roo.bootstrap.layout.Border({el:document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,hideTabs:false}})};break;}if(typeof(Roo.bootstrap.Body)!='undefined'){this.parent={el:new Roo.bootstrap.Body()}
663 ;Roo.debug&&Roo.log("setting el to doc body");}else{throw "Container is bootstrap body, but Roo.bootstrap.Body is not defined";}break;case 'bootstrap':this.parent={el:true};default:el=Roo.get(B);if(typeof(Roo.bootstrap)!='undefined'&&A['|xns']=='Roo.bootstrap'){this.parent={el:true}
664 ;}break;}if(!el&&!this.parent){Roo.debug&&Roo.log("Warning - element can not be found :#"+B);return;}}Roo.debug&&Roo.log("EL:");Roo.debug&&Roo.log(el);Roo.debug&&Roo.log("this.parent.el:");Roo.debug&&Roo.log(this.parent.el);var C=Roo.XComponent.is_alt||(typeof(A.el)!='undefined'&&A.el==document.body)||(typeof(Roo.bootstrap)!='undefined'&&A.xns==Roo.bootstrap)||(typeof(Roo.mailer)!='undefined'&&A.xns==Roo.mailer);
665 if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("no parent - creating one");el=el?Roo.get(el):false;if(typeof(Roo.BorderLayout)=='undefined'){this.parent={el:new Roo.bootstrap.layout.Border({el:el||document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:false,hideTabs:true,minTabWidth:140,overflow:'visible'}
666 })};}else{this.parent={el:new Roo.BorderLayout(el||document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:el&&hp?false:true,hideTabs:el||!hp?true:false,minTabWidth:140}})};}}if(!this.parent.el){return;}A.region=A.region||this.region;
667 var D=false;if(this.parent.el===true){if(el){A.el=el;}this.parent.el=Roo.factory(A);D=true;}this.el=this.parent.el.addxtype(A,undefined,D);this.fireEvent('built',this);this.panel=this.el;this.layout=this.panel.layout;this.parentLayout=this.parent.layout||false;
668 }});Roo.apply(Roo.XComponent,{hideProgress:false,buildCompleted:false,topModule:false,modules:[],elmodules:[],is_alt:false,build_from_html:false,register:function(A){Roo.XComponent.event.fireEvent('register',A);switch(typeof(A.disabled)){case 'undefined':break;
669 case 'function':if(A.disabled()){return;}break;default:if(A.disabled||A.region=='#disabled'){return;}break;}this.modules.push(A);},toObject:function(str){if(!str||typeof(str)=='object'){return str;}if(str.substring(0,1)=='#'){return str;}var ar=str.split('.');
670 var rt,o;rt=ar.shift();try{eval('if (typeof '+rt+' == "undefined"){ o = false;} o = '+rt+';');}catch(e){throw "Module not found : "+str;}if(o===false){throw "Module not found : "+str;}Roo.each(ar,function(e){if(typeof(o[e])=='undefined'){throw "Module not found : "+str;
671 }o=o[e];});return o;},preBuild:function(){var _t=this;Roo.each(this.modules,function(A){Roo.XComponent.event.fireEvent('beforebuild',A);var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.debug&&Roo.log("parent:toObject failed: "+e.toString());return;
672 }if(!A.parent){Roo.debug&&Roo.log("GOT top level module");Roo.debug&&Roo.log(A);A.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(A.parent.constructor!=Roo.XComponent){Roo.debug&&Roo.log("Warning : Object Parent is not instance of XComponent:"+A.name)}
673 if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});}if(A.parent.disabled){A.disabled=true;}A.parent.modules.add(A);},this);},buildOrder:function(){var A=this;var B=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;
674 };if((!this.topModule||!this.topModule.modules)&&!this.elmodules.length){throw "No top level modules to build";}var C=this.topModule?[this.topModule]:[];Roo.each(this.elmodules,function(e){C.push(e);if(!this.topModule&&typeof(e.parent)=='string'&&e.parent.substring(0,1)=='#'&&Roo.get(e.parent.substr(1))){A.topModule=e;
675 }});var D=function(m){Roo.debug&&Roo.log("build Order: add: "+m.name);C.push(m);if(m.modules&&!m.disabled){Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules");m.modules.keySort('ASC',B);Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules (after sort)");
676 m.modules.each(D);}else{Roo.debug&&Roo.log("build Order: no child modules");}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}};if(this.topModule&&this.topModule.modules){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);
677 }return C;},build:function(A){if(typeof(A)!='undefined'){Roo.apply(this,A);}this.preBuild();var B=this.buildOrder();if(!B.length){throw "NO modules!!!";}var C="Building Interface...";if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.show({title:'loading'}
678 );Roo.MessageBox.show({title:"Please wait...",msg:C,width:450,progress:true,buttons:false,closable:false,modal:false});}var D=B.length;var E=this;var F=function(){if(!B.length){Roo.debug&&Roo.log('hide?');if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.hide();
679 }Roo.XComponent.build_from_html=false;Roo.XComponent.event.fireEvent('buildcomplete',E.topModule);return false;}var m=B.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return F.defer(10,E);}C="Building Interface "+(D-B.length)+" of "+D+(m.name?(' - '+m.name):'');
680 Roo.debug&&Roo.log(C);if(!E.hideProgress&&Roo.MessageBox){Roo.MessageBox.updateProgress((D-B.length)/D,C);}var G=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(G){return F();}m.render();return F.defer(10,E);};F.defer(1,E);
681 },overlayStrings:function(A,B){if(typeof(A['_named_strings'])=='undefined'){throw "ERROR: component does not have _named_strings";}for(var k in B){var md=typeof(A['_named_strings'][k])=='undefined'?false:A['_named_strings'][k];if(md!==false){A['_strings'][md]=B[k];
682 }else{Roo.log('could not find named string: '+k+' in');Roo.log(A);}}},event:false,on:false});Roo.XComponent.event=new Roo.util.Observable({events:{'register':true,'beforebuild':true,'buildcomplete':true}});Roo.XComponent.on=Roo.XComponent.event.on.createDelegate(Roo.XComponent.event);
683
684 // Roo/Markdown.js
685 Roo.Markdown={};Roo.Markdown.toHtml=function(A){var c=new Roo.Markdown.marked.setOptions({renderer:new Roo.Markdown.marked.Renderer(),gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:true,smartypants:false});A=A.replace(/\\\n/g,' ');
686 return Roo.Markdown.marked(A);};(function(){var A=function(I,J){return I.replace(!J?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');};var unescape=function(I){return I.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
687 if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});};var replace=function(I,J){I=I.source;J=J||'';return function K(L,M){if(!L){return new RegExp(I,J);
688 }M=M.source||M;M=M.replace(/(^|[^\[])\^/g,'$1');I=I.replace(L,M);return K;};};var noop=function(){};noop.exec=noop;var B=function(I){var i=1,J,K;for(;i<arguments.length;i++){J=arguments[i];for(K in J){if(Object.prototype.hasOwnProperty.call(J,K)){I[K]=J[K];
689 }}}return I;};var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/}
690 ;block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,'gm')(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)('hr','\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')('def','\\n+(?='+block.def.source+')')();
691 block.blockquote=replace(block.blockquote)('def',block.def)();block._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';block.html=replace(block.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();
692 block.paragraph=replace(block.paragraph)('hr',block.hr)('heading',block.heading)('lheading',block.lheading)('blockquote',block.blockquote)('tag','<'+block._tag)('def',block.def)();block.normal=B({},block);block.gfm=B({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
693 );block.gfm.paragraph=replace(block.paragraph)('(?!','(?!'+block.gfm.fences.source.replace('\\1','\\2')+'|'+block.list.source.replace('\\1','\\3')+'|')();block.tables=B({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
694 );var C=function(I){this.tokens=[];this.tokens.links={};this.options=I||H.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables;}else{this.rules=block.gfm;}}};C.rules=block;C.lex=function(I,J){var K=new C(J);
695 return K.lex(I);};C.prototype.lex=function(I){I=I.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(I,true);};C.prototype.token=function(I,J,bq){var I=I.replace(/^ +$/gm,''),K,L,M,N,b,O,P,i,l;while(I){if(M=this.rules.newline.exec(I)){I=I.substring(M[0].length);
696 if(M[0].length>1){this.tokens.push({type:'space'});}}if(M=this.rules.code.exec(I)){I=I.substring(M[0].length);M=M[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?M.replace(/\n+$/,''):M});continue;}if(M=this.rules.fences.exec(I)){I=I.substring(M[0].length);
697 this.tokens.push({type:'code',lang:M[2],text:M[3]||''});continue;}if(M=this.rules.heading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[1].length,text:M[2]});continue;}if(J&&(M=this.rules.nptable.exec(I))){I=I.substring(M[0].length);
698 O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/\n$/,'').split('\n')};for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';
699 }else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].split(/ *\| */);}this.tokens.push(O);continue;}if(M=this.rules.lheading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[2]==='='?1:2,text:M[1]}
700 );continue;}if(M=this.rules.hr.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'hr'});continue;}if(M=this.rules.blockquote.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'blockquote_start'});M=M[0].replace(/^ *> ?/gm,'');this.token(M,J,true);
701 this.tokens.push({type:'blockquote_end'});continue;}if(M=this.rules.list.exec(I)){I=I.substring(M[0].length);N=M[2];this.tokens.push({type:'list_start',ordered:N.length>1});M=M[0].match(this.rules.item);K=false;l=M.length;i=0;for(;i<l;i++){O=M[i];P=O.length;
702 O=O.replace(/^ *([*+-]|\d+\.) +/,'');if(~O.indexOf('\n ')){P-=O.length;O=!this.options.pedantic?O.replace(new RegExp('^ {1,'+P+'}','gm'),''):O.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(M[i+1])[0];if(N!==b&&!(N.length>1&&b.length>1)){I=M.slice(i+1).join('\n')+I;
703 i=l-1;}}L=K||/\n\n(?!\s*$)/.test(O);if(i!==l-1){K=O.charAt(O.length-1)==='\n';if(!L){L=K;}}this.tokens.push({type:L?'loose_item_start':'list_item_start'});this.token(O,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
704 continue;}if(M=this.rules.html.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(M[1]==='pre'||M[1]==='script'||M[1]==='style'),text:M[0]});continue;}if((!bq&&J)&&(M=this.rules.def.exec(I))){I=I.substring(M[0].length);
705 this.tokens.links[M[1].toLowerCase()]={href:M[2],title:M[3]};continue;}if(J&&(M=this.rules.table.exec(I))){I=I.substring(M[0].length);O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
706 ;for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
707 }this.tokens.push(O);continue;}if(J&&(M=this.rules.paragraph.exec(I))){I=I.substring(M[0].length);this.tokens.push({type:'paragraph',text:M[1].charAt(M[1].length-1)==='\n'?M[1].slice(0,-1):M[1]});continue;}if(M=this.rules.text.exec(I)){I=I.substring(M[0].length);
708 this.tokens.push({type:'text',text:M[0]});continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return this.tokens;};var D={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
709 ;D._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;D._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;D.link=replace(D.link)('inside',D._inside)('href',D._href)();D.reflink=replace(D.reflink)('inside',D._inside)();D.normal=B({},D);D.pedantic=B({},D.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}
710 );D.gfm=B({},D.normal,{escape:replace(D.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(D.text)(']|','~]|')('|','|https?://|')()});D.breaks=B({},D.gfm,{br:replace(D.br)('{2,}','*')(),text:replace(D.gfm.text)('{2,}','*')()}
711 );var E=function(I,J){this.options=J||H.defaults;this.links=I;this.rules=D.normal;this.renderer=this.options.renderer||new F;this.renderer.options=this.options;if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=D.breaks;
712 }else{this.rules=D.gfm;}}else if(this.options.pedantic){this.rules=D.pedantic;}};E.rules=D;E.output=function(I,J,K){var L=new E(J,K);return L.output(I);};E.prototype.output=function(I){var J='',K,L,M,N;while(I){if(N=this.rules.escape.exec(I)){I=I.substring(N[0].length);
713 J+=N[1];continue;}if(N=this.rules.autolink.exec(I)){I=I.substring(N[0].length);if(N[2]==='@'){L=N[1].charAt(6)===':'?this.mangle(N[1].substring(7)):this.mangle(N[1]);M=this.mangle('mailto:')+L;}else{L=A(N[1]);M=L;}J+=this.renderer.link(M,null,L);continue;
714 }if(!this.inLink&&(N=this.rules.url.exec(I))){I=I.substring(N[0].length);L=A(N[1]);M=L;J+=this.renderer.link(M,null,L);continue;}if(N=this.rules.tag.exec(I)){if(!this.inLink&&/^<a /i.test(N[0])){this.inLink=true;}else if(this.inLink&&/^<\/a>/i.test(N[0])){this.inLink=false;
715 }I=I.substring(N[0].length);J+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):A(N[0]):N[0];continue;}if(N=this.rules.link.exec(I)){I=I.substring(N[0].length);this.inLink=true;J+=this.outputLink(N,{href:N[2],title:N[3]});this.inLink=false;
716 continue;}if((N=this.rules.reflink.exec(I))||(N=this.rules.nolink.exec(I))){I=I.substring(N[0].length);K=(N[2]||N[1]).replace(/\s+/g,' ');K=this.links[K.toLowerCase()];if(!K||!K.href){J+=N[0].charAt(0);I=N[0].substring(1)+I;continue;}this.inLink=true;J+=this.outputLink(N,K);
717 this.inLink=false;continue;}if(N=this.rules.strong.exec(I)){I=I.substring(N[0].length);J+=this.renderer.strong(this.output(N[2]||N[1]));continue;}if(N=this.rules.em.exec(I)){I=I.substring(N[0].length);J+=this.renderer.em(this.output(N[2]||N[1]));continue;
718 }if(N=this.rules.code.exec(I)){I=I.substring(N[0].length);J+=this.renderer.codespan(A(N[2],true));continue;}if(N=this.rules.br.exec(I)){I=I.substring(N[0].length);J+=this.renderer.br();continue;}if(N=this.rules.del.exec(I)){I=I.substring(N[0].length);J+=this.renderer.del(this.output(N[1]));
719 continue;}if(N=this.rules.text.exec(I)){I=I.substring(N[0].length);J+=this.renderer.text(A(this.smartypants(N[0])));continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return J;};E.prototype.outputLink=function(I,J){var K=A(J.href),L=J.title?A(J.title):null;
720 return I[0].charAt(0)!=='!'?this.renderer.link(K,L,this.output(I[1])):this.renderer.image(K,L,A(I[1]));};E.prototype.smartypants=function(I){if(!this.options.smartypants){return I;}return I.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
721 };E.prototype.mangle=function(I){if(!this.options.mangle){return I;}var J='',l=I.length,i=0,ch;for(;i<l;i++){ch=I.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}J+='&#'+ch+';';}return J;};var F=function(I){this.options=I||{};};F.prototype.code=function(I,J,K){if(this.options.highlight){var L=this.options.highlight(I,J);
722 if(L!=null&&L!==I){K=true;I=L;}}else{K=true;}if(!J){return '<pre><code>'+(K?I:A(I,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+A(J,true)+'">'+(K?I:A(I,true))+'\n</code></pre>\n';};F.prototype.blockquote=function(I){return '<blockquote>\n'+I+'</blockquote>\n';
723 };F.prototype.html=function(I){return I;};F.prototype.heading=function(I,J,K){return '<h'+J+' id="'+this.options.headerPrefix+K.toLowerCase().replace(/[^\w]+/g,'-')+'">'+I+'</h'+J+'>\n';};F.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
724 };F.prototype.list=function(I,J){var K=J?'ol':'ul';return '<'+K+'>\n'+I+'</'+K+'>\n';};F.prototype.listitem=function(I){return '<li>'+I+'</li>\n';};F.prototype.paragraph=function(I){return '<p>'+I+'</p>\n';};F.prototype.table=function(I,J){return '<table class="table table-striped">\n'+'<thead>\n'+I+'</thead>\n'+'<tbody>\n'+J+'</tbody>\n'+'</table>\n';
725 };F.prototype.tablerow=function(I){return '<tr>\n'+I+'</tr>\n';};F.prototype.tablecell=function(I,J){var K=J.header?'th':'td';var L=J.align?'<'+K+' style="text-align:'+J.align+'">':'<'+K+'>';return L+I+'</'+K+'>\n';};F.prototype.strong=function(I){return '<strong>'+I+'</strong>';
726 };F.prototype.em=function(I){return '<em>'+I+'</em>';};F.prototype.codespan=function(I){return '<code>'+I+'</code>';};F.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};F.prototype.del=function(I){return '<del>'+I+'</del>';};F.prototype.link=function(I,J,K){if(this.options.sanitize){try{var L=decodeURIComponent(unescape(I)).replace(/[^\w:]/g,'').toLowerCase();
727 }catch(e){return '';}if(L.indexOf('javascript:')===0||L.indexOf('vbscript:')===0){return '';}}var M='<a href="'+I+'"';if(J){M+=' title="'+J+'"';}M+='>'+K+'</a>';return M;};F.prototype.image=function(I,J,K){var L='<img src="'+I+'" alt="'+K+'"';if(J){L+=' title="'+J+'"';
728 }L+=this.options.xhtml?'/>':'>';return L;};F.prototype.text=function(I){return I;};var G=function(I){this.tokens=[];this.token=null;this.options=I||H.defaults;this.options.renderer=this.options.renderer||new F;this.renderer=this.options.renderer;this.renderer.options=this.options;
729 };G.parse=function(I,J,K){var L=new G(J,K);return L.parse(I);};G.prototype.parse=function(I){this.inline=new E(I.links,this.options,this.renderer);this.tokens=I.reverse();var J='';while(this.next()){J+=this.tok();}return J;};G.prototype.next=function(){return this.token=this.tokens.pop();
730 };G.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};G.prototype.parseText=function(){var I=this.token.text;while(this.peek().type==='text'){I+='\n'+this.next().text;}return this.inline.output(I);};G.prototype.tok=function(){switch(this.token.type){case 'space':{return '';
731 }case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var I='',J='',i,K,L,M,j;
732 L='';for(i=0;i<this.token.header.length;i++){M={header:true,align:this.token.align[i]};L+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}I+=this.renderer.tablerow(L);for(i=0;i<this.token.cells.length;
733 i++){K=this.token.cells[i];L='';for(j=0;j<K.length;j++){L+=this.renderer.tablecell(this.inline.output(K[j]),{header:false,align:this.token.align[j]});}J+=this.renderer.tablerow(L);}return this.renderer.table(I,J);}case 'blockquote_start':{var J='';while(this.next().type!=='blockquote_end'){J+=this.tok();
734 }return this.renderer.blockquote(J);}case 'list_start':{var J='',N=this.token.ordered;while(this.next().type!=='list_end'){J+=this.tok();}return this.renderer.list(J,N);}case 'list_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.token.type==='text'?this.parseText():this.tok();
735 }return this.renderer.listitem(J);}case 'loose_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.tok();}return this.renderer.listitem(J);}case 'html':{var O=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
736 return this.renderer.html(O);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var H=function(I,J,K){if(K||typeof J==='function'){if(!K){K=J;J=null;}J=B({}
737 ,H.defaults,J||{});var L=J.highlight,M,N,i=0;try{M=C.lex(I,J)}catch(e){return K(e);}N=M.length;var O=function(P){if(P){J.highlight=L;return K(P);}var Q;try{Q=G.parse(M,J);}catch(e){P=e;}J.highlight=L;return P?K(P):K(null,Q);};if(!L||L.length<3){return O();
738 }delete J.highlight;if(!N){return O();}for(;i<M.length;i++){(function(P){if(P.type!=='code'){return --N||O();}return L(P.text,P.lang,function(Q,R){if(Q){return O(Q);}if(R==null||R===P.text){return --N||O();}P.text=R;P.escaped=true;--N||O();});})(M[i]);}return;
739 }try{if(J){J=B({},H.defaults,J);}return G.parse(C.lex(I,J),J);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((J||H.defaults).silent){return '<p>An error occured:</p><pre>'+A(e.message+'',true)+'</pre>';}throw e;}};H.options=H.setOptions=function(I){B(H.defaults,I);
740 return H;};H.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new F,xhtml:false};H.Parser=G;H.parser=G.parse;
741 H.Renderer=F;H.Lexer=C;H.lexer=C.lex;H.InlineLexer=E;H.inlineLexer=E.output;H.parse=H;Roo.Markdown.marked=H;})();
742 // Roo/dd/DragDrop.js
743 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
744 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
745 ,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){}
746 ,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}
747 ;}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}
748 ;}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);
749 }return this._domRef;},getDragEl:function(){return Roo.getDom(this.dragElId);},init:function(id,C,D){this.initTarget(id,C,D);if(!Roo.isTouch){A.on(this.id,"mousedown",this.handleMouseDown,this);}A.on(this.id,"touchstart",this.handleMouseDown,this);},initTarget:function(id,C,D){this.config=D||{}
750 ;this.DDM=Roo.dd.DDM;this.groups={};if(typeof id!=="string"){id=Roo.id(id);}this.id=id;this.addToGroup((C)?C:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();
751 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;
752 this.resetConstraints();this.onAvailable();},setPadding:function(C,D,E,F){if(!D&&0!==D){this.padding=[C,C,C,C];}else if(!E&&0!==E){this.padding=[C,D,C,D];}else{this.padding=[C,D,E,F];}},setInitPosition:function(C,D){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;
753 }var dx=C||0;var dy=D||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(C){var p=C||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];
754 this.startPageY=p[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Roo.id(id);
755 }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);
756 A.un(this.id,"touchstart",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},destroy:function(){this.unreg();},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,C){if(!Roo.isTouch&&this.primaryButtonOnly&&e.button!=0){return;
757 }if(e.browserEvent.touches&&e.browserEvent.touches.length!=1){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)){}
758 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 C=e.getTarget();return (this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));
759 },addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);
760 },removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Roo.id(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(C){for(var i=0,D=this.invalidHandleClasses.length;
761 i<D;++i){if(this.invalidHandleClasses[i]==C){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(C){var D=true;var E;try{E=C.nodeName.toUpperCase();}catch(e){E=C.nodeName;}D=D&&!this.invalidHandleTypes[E];D=D&&!this.invalidHandleIds[C.id];
762 for(var i=0,F=this.invalidHandleClasses.length;D&&i<F;++i){D=!B.hasClass(C,this.invalidHandleClasses[i]);}return D;},setXTicks:function(C,D){this.xTicks=[];this.xTickSize=D;var E={};for(var i=this.initPageX;i>=this.minX;i=i-D){if(!E[i]){this.xTicks[this.xTicks.length]=i;
763 E[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+D){if(!E[i]){this.xTicks[this.xTicks.length]=i;E[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(C,D){this.yTicks=[];this.yTickSize=D;var E={};for(var i=this.initPageY;i>=this.minY;i=i-D){if(!E[i]){this.yTicks[this.yTicks.length]=i;
764 E[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+D){if(!E[i]){this.yTicks[this.yTicks.length]=i;E[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(C,D,E){this.leftConstraint=C;this.rightConstraint=D;this.minX=this.initPageX-C;this.maxX=this.initPageX+D;
765 if(E){this.setXTicks(this.initPageX,E);}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(C,D,E){this.topConstraint=C;
766 this.bottomConstraint=D;this.minY=this.initPageY-C;this.maxY=this.initPageY+D;if(E){this.setYTicks(this.initPageY,E);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;
767 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);
768 }},getTick:function(C,D){if(!D){return C;}else if(D[0]>=C){return D[0];}else{for(var i=0,E=D.length;i<E;++i){var F=i+1;if(D[F]&&D[F]>=C){var G=C-D[i];var H=D[F]-C;return (H>G)?D[i]:D[F];}}return D[D.length-1];}},toString:function(){return ("DragDrop "+this.id);
769 }});})();
770 // Roo/dd/DragDropMgr.js
771 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;
772 },POINT:0,INTERSECT:1,mode:0,_execOnAll:function(B,C){for(var i in this.ids){for(var j in this.ids[i]){var D=this.ids[i][j];if(!this.isTypeOfDD(D)){continue;}D[B].apply(D,C);}}},_onLoad:function(){this.init();if(!Roo.isTouch){A.on(document,"mouseup",this.handleMouseUp,this,true);
773 A.on(document,"mousemove",this.handleMouseMove,this,true);}A.on(document,"touchend",this.handleMouseUp,this,true);A.on(document,"touchmove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);
774 },_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(B,C){if(!this.initialized){this.init();
775 }if(!this.ids[C]){this.ids[C]={};}this.ids[C][B.id]=B;},removeDDFromGroup:function(B,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[B.id]){delete D[B.id];}},_remove:function(B){for(var g in B.groups){if(g&&this.ids[g][B.id]){delete this.ids[g][B.id];
776 }}delete this.handleIds[B.id];},regHandle:function(B,C){if(!this.handleIds[B]){this.handleIds[B]={};}this.handleIds[B][C]=C;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(B,C){var D=[];for(var i in B.groups){for(j in this.ids[i]){var dd=this.ids[i][j];
777 if(!this.isTypeOfDD(dd)){continue;}if(!C||dd.isTarget){D[D.length]=dd;}}}return D;},isLegalTarget:function(B,C){var D=this.getRelated(B,true);for(var i=0,E=D.length;i<E;++i){if(D[i].id==C.id){return true;}}return false;},isTypeOfDD:function(B){return (B&&B.__ygDragDrop);
778 },isHandle:function(B,C){return (this.handleIds[B]&&this.handleIds[B][C]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,B){if(Roo.QuickTips){Roo.QuickTips.disable();}this.currentTarget=e.getTarget();
779 this.dragCurrent=B;var el=B.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 C=Roo.dd.DDM;C.startDrag(C.startX,C.startY);
780 },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();
781 }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();
782 }},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;
783 }if(Roo.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var B=Math.abs(this.startX-e.getPageX());var C=Math.abs(this.startY-e.getPageY());if(B>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);
784 }}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,B){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var pt=e.getPoint();
785 var C=[];var D=[];var E=[];var F=[];var G=[];for(var i in this.dragOvers){var H=this.dragOvers[i];if(!this.isTypeOfDD(H)){continue;}if(!this.isOverTarget(pt,H,this.mode)){D.push(H);}C[i]=true;delete this.dragOvers[i];}for(var I in dc.groups){if("string"!=typeof I){continue;
786 }for(i in this.ids[I]){var J=this.ids[I][i];if(!this.isTypeOfDD(J)){continue;}if(J.isTarget&&!J.isLocked()&&J!=dc){if(this.isOverTarget(pt,J,this.mode)){if(B){F.push(J);}else{if(!C[J.id]){G.push(J);}else{E.push(J);}this.dragOvers[J.id]=J;}}}}}if(this.mode){if(D.length){dc.b4DragOut(e,D);
787 dc.onDragOut(e,D);}if(G.length){dc.onDragEnter(e,G);}if(E.length){dc.b4DragOver(e,E);dc.onDragOver(e,E);}if(F.length){dc.b4DragDrop(e,F);dc.onDragDrop(e,F);}}else{var K=0;for(i=0,K=D.length;i<K;++i){dc.b4DragOut(e,D[i].id);dc.onDragOut(e,D[i].id);}for(i=0,K=G.length;
788 i<K;++i){dc.onDragEnter(e,G[i].id);}for(i=0,K=E.length;i<K;++i){dc.b4DragOver(e,E[i].id);dc.onDragOver(e,E[i].id);}for(i=0,K=F.length;i<K;++i){dc.b4DragDrop(e,F[i].id);dc.onDragDrop(e,F[i].id);}}if(B&&!F.length){dc.onInvalidDrop(e);}},getBestMatch:function(B){var C=null;
789 var D=B.length;if(D==1){C=B[0];}else{for(var i=0;i<D;++i){var dd=B[i];if(dd.cursorIsOver){C=dd;break;}else{if(!C||C.overlap.getArea()<dd.overlap.getArea()){C=dd;}}}}return C;},refreshCache:function(B){for(var C in B){if("string"!=typeof C){continue;}for(var i in this.ids[C]){var D=this.ids[C][i];
790 if(this.isTypeOfDD(D)){var E=this.getLocation(D);if(E){this.locationCache[D.id]=E;}else{delete this.locationCache[D.id];}}}}},verifyEl:function(el){if(el){var B;if(Roo.isIE){try{B=el.offsetParent;}catch(e){}}else{B=el.offsetParent;}if(B){return true;}}return false;
791 },getLocation:function(B){if(!this.isTypeOfDD(B)){return null;}var el=B.getEl(),C,x1,x2,y1,y2,t,r,b,l;try{C=Roo.lib.Dom.getXY(el);}catch(e){}if(!C){return null;}x1=C[0];x2=x1+el.offsetWidth;y1=C[1];y2=y1+el.offsetHeight;t=y1-B.padding[0];r=x2+B.padding[1];
792 b=y2+B.padding[2];l=x1-B.padding[3];return new Roo.lib.Region(t,r,b,l);},isOverTarget:function(pt,B,C){var D=this.locationCache[B.id];if(!D||!this.useCache){D=this.getLocation(B);this.locationCache[B.id]=D;}if(!D){return false;}B.cursorIsOver=D.contains(pt);
793 var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!C&&!dc.constrainX&&!dc.constrainY)){return B.cursorIsOver;}B.overlap=null;var E=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var F=new Roo.lib.Region(E.y,E.x+el.offsetWidth,E.y+el.offsetHeight,E.x);
794 var G=F.intersect(D);if(G){B.overlap=G;return (C)?true:B.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",[]);
795 for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var B=this.elementCache[id];if(!B||!B.el){B=this.elementCache[id]=new this.ElementWrapper(Roo.getDom(id));}return B;},getElement:function(id){return Roo.getDom(id);
796 },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);
797 },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,B=document.documentElement,db=document.body;
798 if(B&&(B.scrollTop||B.scrollLeft)){t=B.scrollTop;l=B.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}return {top:t,left:l};},getStyle:function(el,B){return Roo.fly(el).getStyle(B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;
799 },moveToEl:function(B,C){var D=Roo.lib.Dom.getXY(C);Roo.lib.Dom.setXY(B,D);},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var B=Roo.dd.DDM;if(Roo.lib.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);
800 if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,id){if(this.isHandle(id,B.id)){return true;}else{var p=B.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;}};}();Roo.dd.DDM=Roo.dd.DragDropMgr;
801 Roo.dd.DDM._addListeners();}
802 // Roo/dd/DD.js
803 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(A,B){var x=A-this.startPageX;var y=B-this.startPageY;this.setDelta(x,y);},setDelta:function(A,B){this.deltaX=A;this.deltaY=B;},setDragElPos:function(A,B){var el=this.getDragEl();
804 this.alignElWithMouse(el,A,B);},alignElWithMouse:function(el,A,B){var C=this.getTargetCoord(A,B);var D=el.dom?el:Roo.fly(el);if(!this.deltaSetXY){var E=[C.x,C.y];D.setXY(E);var F=D.getLeft(true);var G=D.getTop(true);this.deltaSetXY=[F-C.x,G-C.y];}else{D.setLeftTop(C.x+this.deltaSetXY[0],C.y+this.deltaSetXY[1]);
805 }this.cachePosition(C.x,C.y);this.autoScroll(C.x,C.y,el.offsetHeight,el.offsetWidth);return C;},cachePosition:function(A,B){if(A){this.lastPageX=A;this.lastPageY=B;}else{var C=Roo.lib.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var A=Roo.lib.Dom.getViewWidth();
806 var B=Roo.lib.Dom.getViewHeight();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var C=h+y;var D=w+x;var E=(A+st-y-this.deltaY);var F=(B+sl-x-this.deltaX);var G=40;var H=(document.all)?80:30;if(C>A&&E<G){window.scrollTo(sl,st+H);}if(y<st&&st>0&&y-st<G){window.scrollTo(sl,st-H);
807 }if(D>B&&F<G){window.scrollTo(sl+H,st);}if(x<sl&&sl>0&&x-sl<G){window.scrollTo(sl-H,st);}}},getTargetCoord:function(A,B){var x=A-this.deltaX;var y=B-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;
808 }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());
809 },b4Drag:function(e){this.setDragElPos(e.getPageX(),e.getPageY());},toString:function(){return ("DD "+this.id);}});
810 // Roo/dd/DDProxy.js
811 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 A=this;var B=document.body;if(!B||!B.firstChild){setTimeout(function(){A.createFrame();
812 },50);return;}var C=this.getDragEl();if(!C){C=document.createElement("div");C.id=this.dragElId;var s=C.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;B.insertBefore(C,B.firstChild);}},initFrame:function(){this.createFrame();
813 },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(A,B){var el=this.getEl();
814 var C=this.getDragEl();var s=C.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(A,B);Roo.fly(C).show();},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();
815 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();
816 },endDrag:function(e){var A=this.getEl();var B=this.getDragEl();B.style.visibility="";this.beforeMove();A.style.visibility="hidden";Roo.dd.DDM.moveToEl(A,B);B.style.visibility="hidden";A.style.visibility="";this.afterDrag();},beforeMove:function(){},afterDrag:function(){}
817 ,toString:function(){return ("DDProxy "+this.id);}});
818 // Roo/dd/DDTarget.js
819 Roo.dd.DDTarget=function(id,A,B){if(id){this.initTarget(id,A,B);}if(B&&(B.listeners||B.events)){Roo.dd.DragDrop.superclass.constructor.call(this,{listeners:B.listeners||{},events:B.events||{}});}};Roo.extend(Roo.dd.DDTarget,Roo.dd.DragDrop,{toString:function(){return ("DDTarget "+this.id);
820 }});
821 // Roo/dd/ScrollManager.js
822 Roo.dd.ScrollManager=function(){var A=Roo.dd.DragDropMgr;var B={};var C=null;var D={};var E=function(e){C=null;H();};var F=function(){if(A.dragCurrent){A.refreshCache(A.dragCurrent.groups);}};var G=function(){if(A.dragCurrent){var K=Roo.dd.ScrollManager;if(!K.animate){if(D.el.scroll(D.dir,K.increment)){F();
823 }}else{D.el.scroll(D.dir,K.increment,true,K.animDuration,F);}}};var H=function(){if(D.id){clearInterval(D.id);}D.id=0;D.el=null;D.dir="";};var I=function(el,K){Roo.log('scroll startproc');H();D.el=el;D.dir=K;D.id=setInterval(G,Roo.dd.ScrollManager.frequency);
824 };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");
825 }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);
826 A.stopDrag=A.stopDrag.createSequence(E,A);return {register:function(el){if(el instanceof Array){for(var i=0,K=el.length;i<K;i++){this.register(el[i]);}}else{el=Roo.get(el);B[el.id]=el;}Roo.dd.ScrollManager.els=B;},unregister:function(el){if(el instanceof Array){for(var i=0,K=el.length;
827 i<K;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();}}}};}();
828 // Roo/dd/Registry.js
829 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,E){E=E||{};if(typeof el=="string"){el=document.getElementById(el);
830 }E.ddel=el;A[D(el)]=E;if(E.isHandle!==false){B[E.ddel.id]=E;}if(E.handles){var hs=E.handles;for(var i=0,F=hs.length;i<F;i++){B[D(hs[i])]=E;}}},unregister:function(el){var id=D(el,false);var E=A[id];if(E){delete A[id];if(E.handles){var hs=E.handles;for(var i=0,F=hs.length;
831 i<F;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;
832 }return A[id];},getTargetFromEvent:function(e){var t=Roo.lib.Event.getTarget(e);return t?A[t.id]||B[t.id]:null;}};}();
833 // Roo/dd/StatusProxy.js
834 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}
835 );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(A){A=A||this.dropNotAllowed;if(this.dropStatus!=A){this.el.replaceClass(this.dropStatus,A);
836 this.dropStatus=A;}},reset:function(A){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(A){this.ghost.update("");}},update:function(A){if(typeof A=="string"){this.ghost.update(A);}else{this.ghost.update("");
837 A.style.margin="0";this.ghost.dom.appendChild(A);}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(A){this.el.hide();if(A){this.reset(true);
838 }},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,A,B){this.callback=A;this.scope=B;if(xy&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");
839 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);
840 }this.callback=null;this.scope=null;}};
841 // Roo/dd/DragSource.js
842 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}
843 );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 A=Roo.dd.DragDropMgr.getDDById(id);this.cachedTarget=A;
844 if(this.beforeDragEnter(A,e,id)!==false){if(A.isNotifyTarget){var B=A.notifyEnter(this,e,this.dragData);this.proxy.setStatus(B);}else{this.proxy.setStatus(this.dropAllowed);}if(this.afterDragEnter){this.afterDragEnter(A,e,id);}}},beforeDragEnter:function(A,e,id){return true;
845 },alignElWithMouse:function(){Roo.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync();},onDragOver:function(e,id){var A=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragOver(A,e,id)!==false){if(A.isNotifyTarget){var B=A.notifyOver(this,e,this.dragData);
846 this.proxy.setStatus(B);}if(this.afterDragOver){this.afterDragOver(A,e,id);}}},beforeDragOver:function(A,e,id){return true;},onDragOut:function(e,id){var A=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragOut(A,e,id)!==false){if(A.isNotifyTarget){A.notifyOut(this,e,this.dragData);
847 }this.proxy.reset();if(this.afterDragOut){this.afterDragOut(A,e,id);}}this.cachedTarget=null;},beforeDragOut:function(A,e,id){return true;},onDragDrop:function(e,id){var A=this.cachedTarget||Roo.dd.DragDropMgr.getDDById(id);if(this.beforeDragDrop(A,e,id)!==false){if(A.isNotifyTarget){if(A.notifyDrop(this,e,this.dragData)){this.onValidDrop(A,e,id);
848 }else{this.onInvalidDrop(A,e,id);}}else{this.onValidDrop(A,e,id);}if(this.afterDragDrop){this.afterDragDrop(A,e,id);}}delete this.cachedTarget;},beforeDragDrop:function(A,e,id){return true;},onValidDrop:function(A,e,id){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(A,e,id);
849 }},getRepairXY:function(e,A){return this.el.getXY();},onInvalidDrop:function(A,e,id){this.beforeInvalidDrop(A,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);
850 if(this.afterInvalidDrop){this.afterInvalidDrop(e,id);}},afterRepair:function(){if(Roo.enableFx){this.el.highlight(this.hlColor||"c3daf9");}this.dragging=false;},beforeInvalidDrop:function(A,e,id){return true;},handleMouseDown:function(e){if(this.dragging){return;
851 }var A=this.getDragData(e);if(A&&this.onBeforeDrag(A,e)!==false){this.dragData=A;this.proxy.stop();Roo.dd.DragSource.superclass.handleMouseDown.apply(this,arguments);}},onBeforeDrag:function(A,e){return true;},onStartDrag:Roo.emptyFn,startDrag:function(x,y){this.proxy.reset();
852 this.dragging=true;this.proxy.update("");this.onInitDrag(x,y);this.proxy.show();},onInitDrag:function(x,y){var A=this.el.dom.cloneNode(true);A.id=Roo.id();this.proxy.update(A);this.onStartDrag(x,y);return true;},getProxy:function(){return this.proxy;},hideProxy:function(){this.proxy.hide();
853 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(A,e){},autoOffset:function(x,y){this.setDelta(-12,-20);
854 }});
855 // Roo/dd/DropTarget.js
856 Roo.dd.DropTarget=function(el,A){this.el=Roo.get(el);var B=false;;if(A&&A.listeners){B=A.listeners;delete A.listeners;}Roo.apply(this,A);if(this.containerScroll){Roo.dd.ScrollManager.register(this.el);}this.addEvents({"enter":true,"over":true,"out":true,"drop":true}
857 );Roo.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true,listeners:B||{}});};Roo.extend(Roo.dd.DropTarget,Roo.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",success:false,valid:false,isTarget:true,isNotifyTarget:true,notifyEnter:function(dd,e,A){this.valid=true;
858 this.fireEvent('enter',dd,e,A);if(this.overClass){this.el.addClass(this.overClass);}return typeof(this.valid)=='string'?'x-dd-drop-'+this.valid:(this.valid?this.dropAllowed:this.dropNotAllowed);},notifyOver:function(dd,e,A){this.valid=true;this.fireEvent('over',dd,e,A);
859 return typeof(this.valid)=='string'?'x-dd-drop-'+this.valid:(this.valid?this.dropAllowed:this.dropNotAllowed);},notifyOut:function(dd,e,A){this.fireEvent('out',dd,e,A);if(this.overClass){this.el.removeClass(this.overClass);}},notifyDrop:function(dd,e,A){this.success=false;
860 this.fireEvent('drop',dd,e,A);return this.success;}});
861 // Roo/dd/DragZone.js
862 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);
863 },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();
864 }});
865 // Roo/dd/DropZone.js
866 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,A){},onNodeOver:function(n,dd,e,A){return this.dropAllowed;
867 },onNodeOut:function(n,dd,e,A){},onNodeDrop:function(n,dd,e,A){return false;},onContainerOver:function(dd,e,A){return this.dropNotAllowed;},onContainerDrop:function(dd,e,A){return false;},notifyEnter:function(dd,e,A){return this.dropNotAllowed;},notifyOver:function(dd,e,A){var n=this.getTargetFromEvent(e);
868 if(!n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,A);this.lastOverNode=null;}return this.onContainerOver(dd,e,A);}if(this.lastOverNode!=n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,A);}this.onNodeEnter(n,dd,e,A);this.lastOverNode=n;
869 }return this.onNodeOver(n,dd,e,A);},notifyOut:function(dd,e,A){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,A);this.lastOverNode=null;}},notifyDrop:function(dd,e,A){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,A);this.lastOverNode=null;
870 }var n=this.getTargetFromEvent(e);return n?this.onNodeDrop(n,dd,e,A):this.onContainerDrop(dd,e,A);},triggerCacheRefresh:function(){Roo.dd.DDM.refreshCache(this.groups);}});