Ext.DomHelper=function(){var f=null,o=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,q=/^table|tbody|tr|td$/i,r=/tag|children|cn|html$/i,p=/td|tr|tbody/i,s=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,t=/end/i,i,b="afterbegin",d="afterend",a="beforebegin",e="beforeend",m="<table>",l="</table>",k=m+"<tbody>",j="</tbody>"+l,v=k+"<tr>",u="</tr>"+j;function g(e,f,b,d){var a=i.insertHtml(d,Ext.getDom(e),c(f));return b?Ext.get(a,true):a}function c(a){var b="",d,e,g,i,h;if(typeof a=="string")b=a;else if(Ext.isArray(a)){for(var f=0;f<a.length;f++)if(a[f])b+=c(a[f])}else{b+="<"+(a.tag=a.tag||"div");for(d in a){e=a[d];if(!r.test(d))if(typeof e=="object"){b+=" "+d+'="';for(g in e)b+=g+":"+e[g]+";";b+='"'}else b+=" "+(({cls:"class",htmlFor:"for"})[d]||d)+'="'+e+'"'}if(o.test(a.tag))b+="/>";else{b+=">";if(h=a.children||a.cn)b+=c(h);else if(a.html)b+=a.html;b+="</"+a.tag+">"}}return b}function h(d,i,g,e){f.innerHTML=[i,g,e].join("");var h=-1,a=f,b;while(++h<d)a=a.firstChild;if(b=a.nextSibling){var c=document.createDocumentFragment();while(a){b=a.nextSibling;c.appendChild(a);a=b}a=c}return a}function n(g,c,i,o){var n,q;f=f||document.createElement("div");if(g=="td"&&(c==b||c==e)||!p.test(g)&&(c==a||c==d))return;q=c==a?i:c==d?i.nextSibling:c==b?i.firstChild:null;if(c==a||c==d)i=i.parentNode;if(g=="td"||g=="tr"&&(c==e||c==b))n=h(4,v,o,u);else if(g=="tbody"&&(c==e||c==b)||g=="tr"&&(c==a||c==d))n=h(3,k,o,j);else n=h(2,m,o,l);i.insertBefore(n,q);return n}i={markup:function(a){return c(a)},applyStyles:function(b,a){if(a){var f=0,e,d,c;b=Ext.fly(b);if(typeof a=="function")a=a.call();if(typeof a=="string")while(c=s.exec(a))b.setStyle(c[1],c[2]);else typeof a=="object"&&b.setStyle(a)}},insertHtml:function(f,c,j){var g={},l,k,h,i,m,o;f=f.toLowerCase();g[a]=["BeforeBegin","previousSibling"];g[d]=["AfterEnd","nextSibling"];if(c.insertAdjacentHTML){if(q.test(c.tagName)&&(o=n(c.tagName.toLowerCase(),f,c,j)))return o;g[b]=["AfterBegin","firstChild"];g[e]=["BeforeEnd","lastChild"];if(l=g[f]){c.insertAdjacentHTML(l[0],j);return c[l[1]]}}else{h=c.ownerDocument.createRange();k="setStart"+(t.test(f)?"After":"Before");if(g[f]){h[k](c);i=h.createContextualFragment(j);c.parentNode.insertBefore(i,f==a?c:c.nextSibling);return c[(f==a?"previous":"next")+"Sibling"]}else{m=(f==b?"first":"last")+"Child";if(c.firstChild){h[k](c[m]);i=h.createContextualFragment(j);if(f==b)c.insertBefore(i,c.firstChild);else c.appendChild(i)}else c.innerHTML=j;return c[m]}}throw'Illegal insertion point -> "'+f+'"'},insertBefore:function(c,d,b){return g(c,d,b,a)},insertAfter:function(b,c,a){return g(b,c,a,d,"nextSibling")},insertFirst:function(c,d,a){return g(c,d,a,b,"firstChild")},append:function(b,c,a){return g(b,c,a,e,"",true)},overwrite:function(a,d,b){a=Ext.getDom(a);a.innerHTML=c(d);return b?Ext.get(a.firstChild):a.firstChild},createHtml:c};return i}();Ext.apply(Ext.DomHelper,function(){var c,e="afterbegin",g="afterend",d="beforebegin",f="beforeend",h=/tag|children|cn|html$/i;function b(b,f,g,i,e,h){b=Ext.getDom(b);var d;if(c.useDom){d=a(f,null);if(h)b.appendChild(d);else(e=="firstChild"?b:b.parentNode).insertBefore(d,b[e]||b)}else d=Ext.DomHelper.insertHtml(i,b,Ext.DomHelper.createHtml(f));return g?Ext.get(d,true):d}function a(c,i){var b,f=document,j,d,e,k;if(Ext.isArray(c)){b=f.createDocumentFragment();for(var g=0,l=c.length;g<l;g++)a(c[g],b)}else if(typeof c=="string")b=f.createTextNode(c);else{b=f.createElement(c.tag||"div");j=!!b.setAttribute;for(var d in c)if(!h.test(d)){e=c[d];if(d=="cls")b.className=e;else if(j)b.setAttribute(d,e);else b[d]=e}Ext.DomHelper.applyStyles(b,c.style);if(k=c.children||c.cn)a(k,b);else if(c.html)b.innerHTML=c.html}i&&i.appendChild(b);return b}c={createTemplate:function(b){var a=Ext.DomHelper.createHtml(b);return new Ext.Template(a)},useDom:false,insertBefore:function(c,e,a){return b(c,e,a,d)},insertAfter:function(c,d,a){return b(c,d,a,g,"nextSibling")},insertFirst:function(c,d,a){return b(c,d,a,e,"firstChild")},append:function(c,d,a){return b(c,d,a,f,"",true)},createDom:a};return c}());Ext.Template=function(a){var b=this,d=arguments,f=[],c;if(Ext.isArray(a))a=a.join("");else if(d.length>1){for(var e=0,g=d.length;e<g;e++){c=d[e];if(typeof c=="object")Ext.apply(b,c);else f.push(c)}a=f.join("")}b.html=a;b.compiled&&b.compile()};Ext.Template.prototype={re:/\{([\w-]+)\}/g,applyTemplate:function(b){var a=this;return a.compiled?a.compiled(b):a.html.replace(a.re,function(c,a){return b[a]!==undefined?b[a]:""})},"set":function(c,b){var a=this;a.html=c;a.compiled=null;return b?a.compile():a},compile:function(){var me=this,sep=Ext.isGecko?"+":",";function fn(b,a){a="values['"+a+"']";return "'"+sep+"("+a+" == undefined ? '' : "+a+")"+sep+"'"}eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+me.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+(Ext.isGecko?"';};":"'].join('');};"));return me},insertFirst:function(c,b,a){return this.doInsert("afterBegin",c,b,a)},insertBefore:function(c,b,a){return this.doInsert("beforeBegin",c,b,a)},insertAfter:function(c,b,a){return this.doInsert("afterEnd",c,b,a)},append:function(c,b,a){return this.doInsert("beforeEnd",c,b,a)},doInsert:function(e,a,d,c){a=Ext.getDom(a);var b=Ext.DomHelper.insertHtml(e,a,this.applyTemplate(d));return c?Ext.get(b,true):b},overwrite:function(a,c,b){a=Ext.getDom(a);a.innerHTML=this.applyTemplate(c);return b?Ext.get(a.firstChild,true):a.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.Template.from=function(a,b){a=Ext.getDom(a);return new Ext.Template(a.value||a.innerHTML,b||"")};Ext.apply(Ext.Template.prototype,{disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,argsRe:/^\s*['"](.*)["']\s*$/,compileARe:/\\/g,compileBRe:/(\r\n|\n)/g,compileCRe:/'/g,applyTemplate:function(a){var b=this,d=b.disableFormats!==true,c=Ext.util.Format,e=b;if(b.compiled)return b.compiled(a);function f(l,g,h,f){if(h&&d)if(h.substr(0,5)=="this.")return e.call(h.substr(5),a[g],a);else{if(f){var k=b.argsRe;f=f.split(",");for(var i=0,j=f.length;i<j;i++)f[i]=f[i].replace(k,"$1");f=[a[g]].concat(f)}else f=[a[g]];return c[h].apply(c,f)}else return a[g]!==undefined?a[g]:""}return b.html.replace(b.re,f)},compile:function(){var me=this,fm=Ext.util.Format,useF=me.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(d,c,a,b){if(a&&useF){b=b?","+b:"";if(a.substr(0,5)!="this.")a="fm."+a+"(";else{a='this.call("'+a.substr(5)+'", ';b=", values"}}else{b="";a="(values['"+c+"'] == undefined ? '' : "}return "'"+sep+a+"values['"+c+"']"+b+")"+sep+"'"}if(Ext.isGecko)body="this.compiled = function(values){ return '"+me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn)+"';};";else{body=["this.compiled = function(values){ return ['"];body.push(me.html.replace(me.compileARe,"\\\\").replace(me.compileBRe,"\\n").replace(me.compileCRe,"\\'").replace(me.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return me},call:function(b,c,a){return this[b](c,a)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={},nonSpace=/\S/,trimRe=/^\s+|\s+$/g,tplRe=/\{(\d+)\}/g,modeRe=/^(\s?[\/>+~]\s?|\s|$)/,tagTokenRe=/^(#)?([\w-\*]+)/,nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/,isIE=window.ActiveXObject?true:false,key=30803;eval("var batch = 30803;");function child(b,c){var d=0,a=b.firstChild;while(a){if(a.nodeType==1)if(++d==c)return a;a=a.nextSibling}return null}function next(a){while((a=a.nextSibling)&&a.nodeType!=1);return a}function prev(a){while((a=a.previousSibling)&&a.nodeType!=1);return a}function children(c){var a=c.firstChild,d=-1,b;while(a){b=a.nextSibling;if(a.nodeType==3&&!nonSpace.test(a.nodeValue))c.removeChild(a);else a.nodeIndex=++d;a=b}return this}function byClassName(b,d){if(!d)return b;for(var c=[],f=-1,e=0,a;a=b[e];e++)if((" "+a.className+" ").indexOf(d)!=-1)c[++f]=a;return c}function attrValue(a,b){if(!a.tagName&&typeof a.length!="undefined")a=a[0];if(!a)return null;if(b=="for")return a.htmlFor;if(b=="class"||b=="className")return a.className;return a.getAttribute(b)||a[b]}function getNodes(c,f,b){var e=[],i=-1,n;if(!c)return e;b=b||"*";if(typeof c.getElementsByTagName!="undefined")c=[c];if(!f)for(var d=0,h;h=c[d];d++){n=h.getElementsByTagName(b);for(var j=0,l;l=n[j];j++)e[++i]=l}else if(f=="/"||f==">")for(var k=b.toUpperCase(),d=0,h,m;h=c[d];d++){m=h.childNodes;for(var j=0,g;g=m[j];j++)if(g.nodeName==k||g.nodeName==b||b=="*")e[++i]=g}else if(f=="+")for(var k=b.toUpperCase(),d=0,a;a=c[d];d++){while((a=a.nextSibling)&&a.nodeType!=1);if(a&&(a.nodeName==k||a.nodeName==b||b=="*"))e[++i]=a}else if(f=="~")for(var k=b.toUpperCase(),d=0,a;a=c[d];d++)while(a=a.nextSibling)if(a.nodeName==k||a.nodeName==b||b=="*")e[++i]=a;return e}function concat(a,b){if(b.slice)return a.concat(b);for(var c=0,d=b.length;c<d;c++)a[a.length]=b[c];return a}function byTag(a,b){if(a.tagName||a==document)a=[a];if(!b)return a;var d=[],f=-1;b=b.toLowerCase();for(var e=0,c;c=a[e];e++)if(c.nodeType==1&&c.tagName.toLowerCase()==b)d[++f]=c;return d}function byId(a,d){if(a.tagName||a==document)a=[a];if(!d)return a;for(var c=[],f=-1,e=0,b;b=a[e];e++)if(b&&b.id==d){c[++f]=b;return c}return c}function byAttribute(k,c,j,l,i){for(var f=[],m=-1,h=i=="{",e=Ext.DomQuery.operators[l],b,d,g=0,a;a=k[g];g++){if(a.nodeType!=1)continue;d=a.innerHTML;if(d!==null&&d!==undefined)if(h)b=Ext.DomQuery.getStyle(a,c);else if(c=="class"||c=="className")b=a.className;else if(c=="for")b=a.htmlFor;else if(c=="href")b=a.getAttribute("href",2);else b=a.getAttribute(c);else b=a.getAttribute(c);if(e&&e(b,j)||!e&&b)f[++m]=a}return f}function byPseudo(c,b,a){return Ext.DomQuery.pseudos[b](c,a)}function nodupIEXml(a){var e=++key,c;a[0].setAttribute("_nodup",e);c=[a[0]];for(var b=1,f=a.length;b<f;b++){var d=a[b];if(!d.getAttribute("_nodup")!=e){d.setAttribute("_nodup",e);c[c.length]=d}}for(var b=0,f=a.length;b<f;b++)a[b].removeAttribute("_nodup");return c}function nodup(a){if(!a)return [];var h=a.length,g,d,e=a,f,i=-1;if(!h||typeof a.nodeType!="undefined"||h==1)return a;if(isIE&&typeof a[0].selectSingleNode!="undefined")return nodupIEXml(a);var c=++key;a[0]._nodup=c;for(d=1;g=a[d];d++)if(g._nodup!=c)g._nodup=c;else{e=[];for(var b=0;b<d;b++)e[++i]=a[b];for(b=d+1;f=a[b];b++)if(f._nodup!=c){f._nodup=c;e[++i]=f}return e}return e}function quickDiffIEXml(b,d){for(var f=++key,e=[],a=0,c=b.length;a<c;a++)b[a].setAttribute("_qdiff",f);for(var a=0,c=d.length;a<c;a++)if(d[a].getAttribute("_qdiff")!=f)e[e.length]=d[a];for(var a=0,c=b.length;a<c;a++)b[a].removeAttribute("_qdiff");return e}function quickDiff(c,b){var e=c.length,f=++key,d=[];if(!e)return b;if(isIE&&typeof c[0].selectSingleNode!="undefined")return quickDiffIEXml(c,b);for(var a=0;a<e;a++)c[a]._qdiff=f;for(var a=0,g=b.length;a<g;a++)if(b[a]._qdiff!=f)d[d.length]=b[a];return d}function quickId(a,d,b,c){if(a==b){var e=b.ownerDocument||b;return e.getElementById(c)}a=getNodes(a,d,"*");return byId(a,c)}return {getStyle:function(b,a){return Ext.fly(b).getStyle(a)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],mode,lastPath,matchers=Ext.DomQuery.matchers,matchersLn=matchers.length,modeMatch,lmode=path.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';path=path.replace(lmode[1],"")}while(path.substr(0,1)=="/")path=path.substr(1);while(path&&lastPath!=path){lastPath=path;var tokenMatch=path.match(tagTokenRe);if(type=="select"){if(tokenMatch){if(tokenMatch[1]=="#")fn[fn.length]='n = quickId(n, mode, root, "'+tokenMatch[2]+'");';else fn[fn.length]='n = getNodes(n, mode, "'+tokenMatch[2]+'");';path=path.replace(tokenMatch[0],"")}else if(path.substr(0,1)!="@")fn[fn.length]='n = getNodes(n, mode, "*");'}else if(tokenMatch){if(tokenMatch[1]=="#")fn[fn.length]='n = byId(n, "'+tokenMatch[2]+'");';else fn[fn.length]='n = byTag(n, "'+tokenMatch[2]+'");';path=path.replace(tokenMatch[0],"")}while(!(modeMatch=path.match(modeRe))){for(var matched=false,j=0;j<matchersLn;j++){var t=matchers[j],m=path.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(b,a){return m[a]});path=path.replace(m[0],"");matched=true;break}}if(!matched)throw'Error parsing selector, parsing failed at "'+path+'"'}if(modeMatch[1]){fn[fn.length]='mode="'+modeMatch[1].replace(trimRe,"")+'";';path=path.replace(modeMatch[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},jsSelect:function(g,b){b=b||document;if(typeof b=="string")b=document.getElementById(b);for(var e=g.split(","),c=[],f=0,h=e.length;f<h;f++){var a=e[f].replace(trimRe,"");if(!cache[a]){cache[a]=Ext.DomQuery.compile(a);if(!cache[a])throw a+" is not a valid selector"}var d=cache[a](b);if(d&&d!=document)c=c.concat(d)}if(e.length>1)return nodup(c);return c},isXml:function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":false},select:document.querySelectorAll?function(b,a,c){a=a||document;if(!Ext.DomQuery.isXml(a))try{var d=a.querySelectorAll(b);return Ext.toArray(d)}catch(e){}return Ext.DomQuery.jsSelect.call(this,b,a,c)}:function(a,b,c){return Ext.DomQuery.jsSelect.call(this,a,b,c)},selectNode:function(a,b){return Ext.DomQuery.select(a,b)[0]},selectValue:function(b,e,d){b=b.replace(trimRe,"");if(!valueCache[b])valueCache[b]=Ext.DomQuery.compile(b,"select");var a=valueCache[b](e),c;a=a[0]?a[0]:a;typeof a.normalize=="function"&&a.normalize();c=a&&a.firstChild?a.firstChild.nodeValue:null;return c===null||c===undefined||c===""?d:c},selectNumber:function(b,c,a){var d=Ext.DomQuery.selectValue(b,c,a||0);return parseFloat(d)},is:function(a,d){if(typeof a=="string")a=document.getElementById(a);var b=Ext.isArray(a),c=Ext.DomQuery.filter(b?a:[a],d);return b?c.length==a.length:c.length>0},filter:function(c,a,d){a=a.replace(trimRe,"");if(!simpleCache[a])simpleCache[a]=Ext.DomQuery.compile(a,"simple");var b=simpleCache[a](c);return d?quickDiff(b,c):b},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,b){return a==b},"!=":function(a,b){return a!=b},"^=":function(a,b){return a&&a.substr(0,b.length)==b},"$=":function(a,b){return a&&a.substr(a.length-b.length)==b},"*=":function(a,b){return a&&a.indexOf(b)!==-1},"%=":function(a,b){return a%b==0},"|=":function(a,b){return a&&(a==b||a.substr(0,b.length+1)==b+"-")},"~=":function(a,b){return a&&(" "+a+" ").indexOf(" "+b+" ")!=-1}},pseudos:{"first-child":function(f){for(var d=[],e=-1,a,c=0,b;b=a=f[c];c++){while((a=a.previousSibling)&&a.nodeType!=1);if(!a)d[++e]=b}return d},"last-child":function(f){for(var d=[],e=-1,a,c=0,b;b=a=f[c];c++){while((a=a.nextSibling)&&a.nodeType!=1);if(!a)d[++e]=b}return d},"nth-child":function(k,c){for(var f=[],g=-1,j=nthRe.exec(c=="even"&&"2n"||c=="odd"&&"2n+1"||!nthRe2.test(c)&&"n+"+c||c),h=(j[1]||1)-0,e=j[2]-0,i=0,a;a=k[i];i++){var d=a.parentNode;if(batch!=d._batch){for(var l=0,b=d.firstChild;b;b=b.nextSibling)if(b.nodeType==1)b.nodeIndex=++l;d._batch=batch}if(h==1){if(e==0||a.nodeIndex==e)f[++g]=a}else if((a.nodeIndex+e)%h==0)f[++g]=a}return f},"only-child":function(e){for(var c=[],d=-1,b=0,a;a=e[b];b++)if(!prev(a)&&!next(a))c[++d]=a;return c},empty:function(i){for(var f=[],h=-1,d=0,a;a=i[d];d++){var g=a.childNodes,e=0,b,c=true;while(b=g[e]){++e;if(b.nodeType==1||b.nodeType==3){c=false;break}}if(c)f[++h]=a}return f},contains:function(e,f){for(var c=[],d=-1,b=0,a;a=e[b];b++)if((a.textContent||a.innerText||"").indexOf(f)!=-1)c[++d]=a;return c},nodeValue:function(e,f){for(var c=[],d=-1,b=0,a;a=e[b];b++)if(a.firstChild&&a.firstChild.nodeValue==f)c[++d]=a;return c},checked:function(e){for(var c=[],d=-1,b=0,a;a=e[b];b++)if(a.checked==true)c[++d]=a;return c},not:function(b,a){return Ext.DomQuery.filter(b,a,true)},any:function(i,f){for(var h=f.split("|"),d=[],g=-1,e,b=0,a;a=i[b];b++)for(var c=0;e=h[c];c++)if(Ext.DomQuery.is(a,e)){d[++g]=a;break}return d},odd:function(a){return this["nth-child"](a,"odd")},even:function(a){return this["nth-child"](a,"even")},nth:function(b,a){return b[a-1]||[]},first:function(a){return a[0]||[]},last:function(a){return a[a.length-1]||[]},has:function(f,e){for(var g=Ext.DomQuery.select,c=[],d=-1,b=0,a;a=f[b];b++)if(g(e,a).length>0)c[++d]=a;return c},next:function(h,g){for(var e=Ext.DomQuery.is,d=[],f=-1,b=0,a;a=h[b];b++){var c=next(a);if(c&&e(c,g))d[++f]=a}return d},prev:function(h,g){for(var e=Ext.DomQuery.is,d=[],f=-1,b=0,a;a=h[b];b++){var c=prev(a);if(c&&e(c,g))d[++f]=a}return d}}}}();Ext.query=Ext.DomQuery.select;Ext.util.DelayedTask=function(d,b,c){var e=this,a,f=function(){clearInterval(a);a=null;d.apply(b,c||[])};e.delay=function(i,j,g,h){e.cancel();d=j||d;b=g||b;c=h||c;a=setInterval(f,i)};e.cancel=function(){if(a){clearInterval(a);a=null}}};(function(){var a=Ext.util,i=Ext.each,b=true,c=false;a.Observable=function(){var a=this,b=a.events;if(a.listeners){a.on(a.listeners);delete a.listeners}a.events=b||{}};a.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var e=Array.prototype.slice.call(arguments,0),h=e[0].toLowerCase(),f=this,i=b,d=f.events[h],g,j,a;if(f.eventsSuspended===b)(j=f.eventQueue)&&j.push(e);else if(typeof d=="object")if(d.bubble){if(d.fire.apply(d,e.slice(1))===c)return c;a=f.getBubbleTarget&&f.getBubbleTarget();if(a&&a.enableBubble){g=a.events[h];(!g||typeof g!="object"||!g.bubble)&&a.enableBubble(h);return a.fireEvent.apply(a,e)}}else{e.shift();i=d.fire.apply(d,e)}return i},addListener:function(c,j,i,d){var f=this,h,e,k,g;if(typeof c=="object"){d=c;for(h in d){e=d[h];!f.filterOptRe.test(h)&&f.addListener(h,e.fn||e,e.scope||d.scope,e.fn?e:d)}}else{c=c.toLowerCase();g=f.events[c]||b;if(typeof g=="boolean")f.events[c]=g=new a.Event(f,c);g.addListener(j,i,typeof d=="object"?d:{})}},removeListener:function(b,d,c){var a=this.events[b.toLowerCase()];typeof a=="object"&&a.removeListener(d,c)},purgeListeners:function(){var b=this.events,a,c;for(c in b){a=b[c];typeof a=="object"&&a.clearListeners()}},addEvents:function(e){var a=this;a.events=a.events||{};if(typeof e=="string"){var c=arguments,d=c.length;while(d--)a.events[c[d]]=a.events[c[d]]||b}else Ext.applyIf(a.events,e)},hasListener:function(b){var a=this.events[b.toLowerCase()];return typeof a=="object"&&a.listeners.length>0},suspendEvents:function(a){this.eventsSuspended=b;if(a&&!this.eventQueue)this.eventQueue=[]},resumeEvents:function(){var a=this,b=a.eventQueue||[];a.eventsSuspended=c;delete a.eventQueue;i(b,function(b){a.fireEvent.apply(a,b)})}};var d=a.Observable.prototype;d.on=d.addListener;d.un=d.removeListener;a.Observable.releaseCapture=function(a){a.fireEvent=d.fireEvent};function f(b,c,a){return function(){c.target==arguments[0]&&b.apply(a,Array.prototype.slice.call(arguments,0))}}function e(d,e,b,c){b.task=new a.DelayedTask;return function(){b.task.delay(e.buffer,d,c,Array.prototype.slice.call(arguments,0))}}function h(d,c,b,a){return function(){c.removeListener(b,a);return d.apply(a,arguments)}}function g(d,e,b,c){return function(){var f=new a.DelayedTask;if(!b.tasks)b.tasks=[];b.tasks.push(f);f.delay(e.delay||10,d,c,Array.prototype.slice.call(arguments,0))}}a.Event=function(b,a){this.name=a;this.obj=b;this.listeners=[]};a.Event.prototype={addListener:function(c,b,e){var a=this,d;b=b||a.obj;if(!a.isListening(c,b)){d=a.createListener(c,b,e);if(a.firing)a.listeners=a.listeners.slice(0);a.listeners.push(d)}},createListener:function(i,c,a){a=a||{},c=c||this.obj;var d={fn:i,scope:c,options:a},b=i;if(a.target)b=f(b,a,c);if(a.delay)b=g(b,a,d,c);if(a.single)b=h(b,this,i,c);if(a.buffer)b=e(b,a,d,c);d.fireFn=b;return d},findListener:function(e,b){var d=this.listeners,c=d.length,a;b=b||this.obj;while(c--){a=d[c];if(a)if(a.fn==e&&a.scope==b)return c}return -1},isListening:function(b,a){return this.findListener(b,a)!=-1},removeListener:function(i,h){var f,a,e,d=this,g=c;if((f=d.findListener(i,h))!=-1){if(d.firing)d.listeners=d.listeners.slice(0);a=d.listeners[f];if(a.task){a.task.cancel();delete a.task}e=a.tasks&&a.tasks.length;if(e){while(e--)a.tasks[e].cancel();delete a.tasks}d.listeners.splice(f,1);g=b}return g},clearListeners:function(){var c=this,b=c.listeners,a=b.length;while(a--)c.removeListener(b[a].fn,b[a].scope)},fire:function(){var a=this,f=a.listeners,g=f.length,e=0,d;if(g>0){a.firing=b;for(var h=Array.prototype.slice.call(arguments,0);e<g;e++){d=f[e];if(d&&d.fireFn.apply(d.scope||a.obj||window,h)===c)return a.firing=c}}a.firing=c;return b}}})();Ext.apply(Ext.util.Observable.prototype,function(){function a(e){var a=(this.methodEvents=this.methodEvents||{})[e],c,b,d,g=this;if(!a){this.methodEvents[e]=a={};a.originalFn=this[e];a.methodName=e;a.before=[];a.after=[];var f=function(f,a,e){if((b=f.apply(a||g,e))!==undefined)if(typeof b=="object"){if(b.returnValue!==undefined)c=b.returnValue;else c=b;d=!!b.cancel}else if(b===false)d=true;else c=b};this[e]=function(){var i=Array.prototype.slice.call(arguments,0),e;c=b=undefined;d=false;for(var h=0,j=a.before.length;h<j;h++){e=a.before[h];f(e.fn,e.scope,i);if(d)return c}if((b=a.originalFn.apply(g,i))!==undefined)c=b;for(var h=0,j=a.after.length;h<j;h++){e=a.after[h];f(e.fn,e.scope,i);if(d)return c}return c}}return a}return {beforeMethod:function(b,d,c){a.call(this,b).before.push({fn:d,scope:c})},afterMethod:function(b,d,c){a.call(this,b).after.push({fn:d,scope:c})},removeMethodListener:function(f,e,c){for(var b=this.getMethodEvent(f),a=0,d=b.before.length;a<d;a++)if(b.before[a].fn==e&&b.before[a].scope==c){b.before.splice(a,1);return}for(var a=0,d=b.after.length;a<d;a++)if(b.after[a].fn==e&&b.after[a].scope==c){b.after.splice(a,1);return}},relayEvents:function(g,d){var a=this;function e(b){return function(){return a.fireEvent.apply(a,[b].concat(Array.prototype.slice.call(arguments,0)))}}for(var c=0,f=d.length;c<f;c++){var b=d[c];a.events[b]=a.events[b]||true;g.on(b,e(b),a)}},enableBubble:function(a){var d=this;if(!Ext.isEmpty(a)){a=Ext.isArray(a)?a:Array.prototype.slice.call(arguments,0);for(var e=0,f=a.length;e<f;e++){var b=a[e];b=b.toLowerCase();var c=d.events[b]||true;if(typeof c=="boolean"){c=new Ext.util.Event(d,b);d.events[b]=c}c.bubble=true}}}}}());Ext.util.Observable.capture=function(a,c,b){a.fireEvent=a.fireEvent.createInterceptor(c,b)};Ext.util.Observable.observeClass=function(a,b){if(a){if(!a.fireEvent){Ext.apply(a,new Ext.util.Observable);Ext.util.Observable.capture(a.prototype,a.fireEvent,a)}typeof b=="object"&&a.on(b);return a}};Ext.EventManager=function(){var b,i,j=false,p=Ext.isGecko||Ext.isWebKit||Ext.isSafari,d=Ext.lib.Event,A=Ext.lib.Dom,a=document,n=window,h="DOMContentLoaded",q="complete",z=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,k=[];function g(b){var a=false,c=0,f=k.length,a=false,e=false,d;if(b){if(b.getElementById||b.navigator){for(;c<f;++c){d=k[c];if(d.el===b){a=d.id;break}}if(!a){a=Ext.id(b);k.push({id:a,el:b});e=true}}else a=Ext.id(b);if(!Ext.elCache[a]){Ext.Element.addToCache(new Ext.Element(b),a);if(e)Ext.elCache[a].skipGC=true}}return a}function x(b,c,l,k,e,j){b=Ext.getDom(b);var m=g(b),f=Ext.elCache[m].events,i;i=d.on(b,c,e);f[c]=f[c]||[];f[c].push([l,e,j,i,k]);if(b.addEventListener&&c=="mousewheel"){var h=["DOMMouseScroll",e,false];b.addEventListener.apply(b,h);Ext.EventManager.addListener(n,"unload",function(){b.removeEventListener.apply(b,h)})}b==a&&c=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.addListener(e)}function y(){if(window!=top)return false;try{a.documentElement.doScroll("left")}catch(b){return false}c();return true}function e(){if(Ext.isIE&&y())return true;if(a.readyState==q){c();return true}j||(i=setTimeout(arguments.callee,2));return false}var m;function o(){m||(m=Ext.query("style, link[rel=stylesheet]"));if(m.length==a.styleSheets.length){c();return true}j||(i=setTimeout(arguments.callee,2));return false}function r(){a.removeEventListener(h,arguments.callee,false);o()}function c(){if(!j){j=true;i&&clearTimeout(i);p&&a.removeEventListener(h,c,false);Ext.isIE&&e.bindIE&&a.detachEvent("onreadystatechange",e);d.un(n,"load",arguments.callee)}if(b&&!Ext.isReady){Ext.isReady=true;b.fire();b.listeners=[]}}function w(){b||(b=new Ext.util.Event);p&&a.addEventListener(h,c,false);if(Ext.isIE){if(!e()){e.bindIE=true;a.attachEvent("onreadystatechange",e)}}else if(Ext.isOpera)a.readyState==q&&o()||a.addEventListener(h,r,false);else Ext.isWebKit&&e();d.on(n,"load",c)}function t(a,b){return function(){var c=Ext.toArray(arguments);b.target==Ext.EventObject.setEvent(c[0]).target&&a.apply(this,c)}}function s(b,c,a){return function(d){a.delay(c.buffer,b,null,[new Ext.EventObjectImpl(d)])}}function v(e,c,a,d,b){return function(f){Ext.EventManager.removeListener(c,a,d,b);e(f)}}function u(b,c,a){return function(e){var d=new Ext.util.DelayedTask(b);if(!a.tasks)a.tasks=[];a.tasks.push(d);d.delay(c.delay||10,b,null,[new Ext.EventObjectImpl(e)])}}function l(i,f,h,c,d){var a=!h||typeof h=="boolean"?{}:h,e=Ext.getDom(i),g;c=c||a.fn;d=d||a.scope;if(!e)throw'Error listening for "'+f+'". Element "'+i+"\" doesn't exist.";function b(b){if(!Ext)return;b=Ext.EventObject.setEvent(b);var f;if(a.delegate){if(!(f=b.getTarget(a.delegate,e)))return}else f=b.target;a.stopEvent&&b.stopEvent();a.preventDefault&&b.preventDefault();a.stopPropagation&&b.stopPropagation();if(a.normalized)b=b.browserEvent;c.call(d||e,b,f,a)}if(a.target)b=t(b,a);if(a.delay)b=u(b,a,c);if(a.single)b=v(b,e,f,c,d);if(a.buffer){g=new Ext.util.DelayedTask(b);b=s(b,a,g)}x(e,f,c,g,b,d);return b}var f={addListener:function(e,d,h,g,f){if(typeof d=="object"){var c=d,a,b;for(a in c){b=c[a];if(!z.test(a))if(Ext.isFunction(b))l(e,a,c,b,c.scope);else l(e,a,b)}}else l(e,d,f,h,g)},removeListener:function(b,f,h,m){b=Ext.getDom(b);var k=g(b),l=b&&Ext.elCache[k].events[f]||[],e,i,o,j,n,c;for(i=0,n=l.length;i<n;i++)if(Ext.isArray(c=l[i])&&c[0]==h&&(!m||c[2]==m)){c[4]&&c[4].cancel();j=h.tasks&&h.tasks.length;if(j){while(j--)h.tasks[j].cancel();delete h.tasks}e=c[1];d.un(b,f,d.extAdapter?c[3]:e);e&&b.addEventListener&&f=="mousewheel"&&b.removeEventListener("DOMMouseScroll",e,false);e&&b==a&&f=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(e);l.splice(i,1);if(l.length===0)delete Ext.elCache[k].events[f];for(j in Ext.elCache[k].events)return false;Ext.elCache[k].events={};return false}},removeAll:function(c){c=Ext.getDom(c);var j=g(c),n=Ext.elCache[j]||{},i=n.events||{},k,h,m,e,b,l,f;for(e in i)if(i.hasOwnProperty(e)){k=i[e];for(h=0,m=k.length;h<m;h++){b=k[h];b[4]&&b[4].cancel();if(b[0].tasks&&(l=b[0].tasks.length)){while(l--)b[0].tasks[l].cancel();delete b.tasks}f=b[1];d.un(c,e,d.extAdapter?b[3]:f);c.addEventListener&&f&&e=="mousewheel"&&c.removeEventListener("DOMMouseScroll",f,false);f&&c==a&&e=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(f)}}if(Ext.elCache[j])Ext.elCache[j].events={}},getListeners:function(a,c){a=Ext.getDom(a);var e=g(a),d=Ext.elCache[e]||{},b=d.events||{},f=[];if(b&&b[c])return b[c];else return null},purgeElement:function(a,h,c){a=Ext.getDom(a);var j=g(a),i=Ext.elCache[j]||{},e=i.events||{},b,f,d;if(c){if(e&&e.hasOwnProperty(c)){f=e[c];for(b=0,d=f.length;b<d;b++)Ext.EventManager.removeListener(a,c,f[b][0])}}else Ext.EventManager.removeAll(a);if(h&&a&&a.childNodes)for(b=0,d=a.childNodes.length;b<d;b++)Ext.EventManager.purgeElement(a.childNodes[b],h,c)},_unload:function(){var e;for(e in Ext.elCache)Ext.EventManager.removeAll(e);delete Ext.elCache;delete Ext.Element._flyweights;var d,a,c,b=Ext.lib.Ajax;typeof b.conn=="object"?(a=b.conn):(a={});for(c in a){d=a[c];d&&b.abort({conn:d,tId:c})}},onDocumentReady:function(d,c,a){if(Ext.isReady){b||(b=new Ext.util.Event);b.addListener(d,c,a);b.fire();b.listeners=[]}else{!b&&w();a=a||{};a.delay=a.delay||1;b.addListener(d,c,a)}},fireDocReady:c};f.on=f.addListener;f.un=f.removeListener;f.stoppedMouseDownEvent=new Ext.util.Event;return f}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var a=function(){var b=document.body||document.getElementsByTagName("body")[0];if(!b)return false;var a=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":Ext.isIE7?"ext-ie7":"ext-ie8"):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isWebKit?"ext-webkit":""];if(Ext.isSafari)a.push("ext-safari "+(Ext.isSafari2?"ext-safari2":Ext.isSafari3?"ext-safari3":"ext-safari4"));else Ext.isChrome&&a.push("ext-chrome");Ext.isMac&&a.push("ext-mac");Ext.isLinux&&a.push("ext-linux");if(Ext.isStrict||Ext.isBorderBox){var c=b.parentNode;if(c)c.className+=Ext.isStrict?" ext-strict":" ext-border-box"}b.className+=a.join(" ");return true};!a()&&Ext.onReady(a)})();Ext.EventObject=function(){var a=Ext.lib.Event,b={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},c=Ext.isIE?{1:0,4:1,2:2}:Ext.isWebKit?{1:0,2:1,3:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(a){a&&this.setEvent(a.browserEvent||a)};Ext.EventObjectImpl.prototype={setEvent:function(d){var b=this;if(d==b||d&&d.browserEvent)return d;b.browserEvent=d;if(d){b.button=d.button?c[d.button]:d.which?d.which-1:-1;if(d.type=="click"&&b.button==-1)b.button=0;b.type=d.type;b.shiftKey=d.shiftKey;b.ctrlKey=d.ctrlKey||d.metaKey||false;b.altKey=d.altKey;b.keyCode=d.keyCode;b.charCode=d.charCode;b.target=a.getTarget(d);b.xy=a.getXY(d)}else{b.button=-1;b.shiftKey=false;b.ctrlKey=false;b.altKey=false;b.keyCode=0;b.charCode=0;b.target=null;b.xy=[0,0]}return b},stopEvent:function(){var b=this;if(b.browserEvent){b.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(b);a.stopEvent(b.browserEvent)}},preventDefault:function(){this.browserEvent&&a.preventDefault(this.browserEvent)},stopPropagation:function(){var b=this;if(b.browserEvent){b.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(b);a.stopPropagation(b.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(a){return Ext.isSafari?b[a]||a:a},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},getTarget:function(b,c,a){return b?Ext.fly(this.target).findParent(b,c,a):a?Ext.get(this.target):this.target},getRelatedTarget:function(){return this.browserEvent?a.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var a=this.browserEvent,b=0;if(a.wheelDelta)b=a.wheelDelta/120;else if(a.detail)b=-a.detail/3;return b},within:function(a,d,c){if(a){var b=this[d?"getRelatedTarget":"getTarget"]();return b&&((c?b==Ext.getDom(a):false)||Ext.fly(a).contains(b))}return false}};return new Ext.EventObjectImpl}();Ext.apply(Ext.EventManager,function(){var a,e,b,c,d=Ext.lib.Dom,i=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,g=0,f=0,h=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!(Ext.isGecko&&!Ext.isWindows||Ext.isOpera);return {doResizeEvent:function(){var b=d.getViewHeight(),c=d.getViewWidth();(f!=b||g!=c)&&a.fire(g=c,f=b)},onWindowResize:function(d,c,b){if(!a){a=new Ext.util.Event;e=new Ext.util.DelayedTask(this.doResizeEvent);Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}a.addListener(d,c,b)},fireWindowResize:function(){a&&e.delay(100)},onTextResize:function(f,e,d){if(!b){b=new Ext.util.Event;var a=new Ext.Element(document.createElement("div"));a.dom.className="x-text-resize";a.dom.innerHTML="X";a.appendTo(document.body);c=a.dom.offsetHeight;setInterval(function(){a.dom.offsetHeight!=c&&b.fire(c,c=a.dom.offsetHeight)},this.textResizeInterval)}b.addListener(f,e,d)},removeResizeListener:function(c,b){a&&a.removeListener(c,b)},fireResize:function(){a&&a.fire(d.getViewWidth(),d.getViewHeight())},textResizeInterval:50,ieDeferSrc:false,useKeydown:h}}());Ext.EventManager.on=Ext.EventManager.addListener;Ext.apply(Ext.EventObjectImpl.prototype,{BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,isNavKeyPress:function(){var b=this,a=this.normalizeKey(b.keyCode);return a>=33&&a<=40||a==b.RETURN||a==b.TAB||a==b.ESC},isSpecialKey:function(){var a=this.normalizeKey(this.keyCode);return this.type=="keypress"&&this.ctrlKey||this.isNavKeyPress()||a==this.BACKSPACE||a>=16&&a<=20||a>=44&&a<=46},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])},hasModifier:function(){return this.ctrlKey||this.altKey||this.shiftKey}});(function(){var c=document;Ext.Element=function(d,e){var b=typeof d=="string"?c.getElementById(d):d,a;if(!b)return null;a=b.id;if(!e&&a&&Ext.elCache[a])return Ext.elCache[a].el;this.dom=b;this.id=a||Ext.id(b)};var l=Ext.lib.Dom,j=Ext.DomHelper,m=Ext.lib.Event,k=Ext.lib.Anim,a=Ext.Element,b=Ext.elCache;a.prototype={"set":function(d,e){var c=this.dom,a,b,e=e!==false&&!!c.setAttribute;for(a in d)if(d.hasOwnProperty(a)){b=d[a];if(a=="style")j.applyStyles(c,b);else if(a=="cls")c.className=b;else if(e)c.setAttribute(a,b);else c[a]=b}return this},defaultUnit:"px",is:function(a){return Ext.DomQuery.is(this.dom,a)},focus:function(c,a){var b=this,a=a||b.dom;try{if(Number(c))b.focus.defer(c,null,[null,a]);else a.focus()}catch(d){}return b},blur:function(){try{this.dom.blur()}catch(a){}return this},getValue:function(b){var a=this.dom.value;return b?parseInt(a,10):a},addListener:function(a,d,c,b){Ext.EventManager.on(this.dom,a,d,c||this,b);return this},removeListener:function(a,c,b){Ext.EventManager.removeListener(this.dom,a,c,b||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(a){if(a===""||a=="auto"||a===undefined)a=a||"";else if(!isNaN(a)||!i.test(a))a=a+(this.defaultUnit||"px");return a},load:function(a,b,c){Ext.Ajax.request(Ext.apply({params:b,url:a.url||a,callback:c,el:this.dom,indicatorText:a.indicatorText||""},Ext.isObject(a)?a:{}));return this},isBorderBox:function(){return f[(this.dom.tagName||"").toLowerCase()]||Ext.isBorderBox},remove:function(){var b=this,a=b.dom;if(a){delete b.dom;Ext.removeNode(a)}},hover:function(d,e,c,b){var a=this;a.on("mouseenter",d,c||a.dom,b);a.on("mouseleave",e,c||a.dom,b);return a},contains:function(a){return !a?false:Ext.lib.Dom.isAncestor(this.dom,a.dom?a.dom:a)},getAttributeNS:function(b,a){return this.getAttribute(a,b)},getAttribute:Ext.isIE?function(a,c){var b=this.dom,d=typeof b[c+":"+a];if(["undefined","unknown"].indexOf(d)==-1)return b[c+":"+a];return b[a]}:function(a,c){var b=this.dom;return b.getAttributeNS(c,a)||b.getAttribute(c+":"+a)||b.getAttribute(a)||b[a]},update:function(a){if(this.dom)this.dom.innerHTML=a;return this}};var d=a.prototype;a.addMethods=function(a){Ext.apply(d,a)};d.on=d.addListener;d.un=d.removeListener;d.autoBoxAdjust=true;var i=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,e;a.get=function(d){var f,h,g;if(!d)return null;if(typeof d=="string"){if(!(h=c.getElementById(d)))return null;if(b[d]&&b[d].el){f=b[d].el;f.dom=h}else f=a.addToCache(new a(h));return f}else if(d.tagName){if(!(g=d.id))g=Ext.id(d);if(b[g]&&b[g].el){f=b[g].el;f.dom=d}else f=a.addToCache(new a(d));return f}else if(d instanceof a){if(d!=e)if(Ext.isIE&&(d.id==undefined||d.id==""))d.dom=d.dom;else d.dom=c.getElementById(d.id)||d.dom;return d}else if(d.isComposite)return d;else if(Ext.isArray(d))return a.select(d);else if(d==c){if(!e){var i=function(){};i.prototype=a.prototype;e=new i;e.dom=c}return e}return null};a.addToCache=function(a,c){c=c||a.id;b[c]={el:a,data:{},events:{}};return a};a.data=function(c,d,f){c=a.get(c);if(!c)return null;var e=b[c.id].data;if(arguments.length==2)return e[d];else return e[d]=f};function h(){if(!Ext.enableGarbageCollector)clearInterval(a.collectorThreadId);else{var d,g,e,f;for(d in b){f=b[d];if(f.skipGC)continue;g=f.el;e=g.dom;if(!e||!e.parentNode||!e.offsetParent&&!c.getElementById(d)){Ext.enableListenerCollection&&Ext.EventManager.removeAll(e);delete b[d]}}if(Ext.isIE){var h={};for(d in b)h[d]=b[d];b=Ext.elCache=h}}}a.collectorThreadId=setInterval(h,3e4);var g=function(){};g.prototype=a.prototype;a.Flyweight=function(a){this.dom=a};a.Flyweight.prototype=new g;a.Flyweight.prototype.isFlyweight=true;a._flyweights={};a.fly=function(c,b){var d=null;b=b||"_global";if(c=Ext.getDom(c)){(a._flyweights[b]=a._flyweights[b]||new a.Flyweight).dom=c;d=a._flyweights[b]}return d};Ext.get=a.get;Ext.fly=a.fly;var f=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko)f["button"]=1})();Ext.Element.addMethods({swallowEvent:function(b,d){var a=this;function c(a){a.stopPropagation();d&&a.preventDefault()}if(Ext.isArray(b)){Ext.each(b,function(b){a.on(b,c)});return a}a.on(b,c);return a},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(d){var c=this,b=c.dom,a=b.firstChild,e=-1;if(Ext.Element.data(b,"isCleaned")&&d!==true)return c;while(a){var f=a.nextSibling;if(a.nodeType==3&&!/\S/.test(a.nodeValue))b.removeChild(a);else a.nodeIndex=++e;a=f}Ext.Element.data(b,"isCleaned",true);return c},load:function(){var a=this.getUpdater();a.update.apply(a,arguments);return this},getUpdater:function(){return this.updateManager||(this.updateManager=new Ext.Updater(this))},update:function(html,loadScripts,callback){if(!this.dom)return this;html=html||"";if(loadScripts!==true){this.dom.innerHTML=html;typeof callback=="function"&&callback();return this}var id=Ext.id(),dom=this.dom;html+='<span id="'+id+'"></span>';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,match,attrs,srcMatch,typeMatch,el,s;while(match=re.exec(html)){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2])s.type=typeMatch[2];hd.appendChild(s)}else if(match[2]&&match[2].length>0)if(window.execScript)window.execScript(match[2]);else window.eval(match[2])}el=DOC.getElementById(id);el&&Ext.removeNode(el);typeof callback=="function"&&callback()});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,c,e){a=typeof a=="object"?a:{tag:"div",cls:a};var b=this,d=c?Ext.DomHelper.append(c,a,true):Ext.DomHelper.insertBefore(b.dom,a,true);e&&b.setBox&&b.getBox&&d.setBox(b.getBox());return d}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;Ext.Element.addMethods({getAnchorXY:function(g,j,f){g=(g||"tl").toLowerCase();f=f||{};var a=this,e=a.dom==document.body||a.dom==document,d=f.width||e?Ext.lib.Dom.getViewWidth():a.getWidth(),b=f.height||e?Ext.lib.Dom.getViewHeight():a.getHeight(),h,c=Math.round,k=a.getXY(),i=a.getScroll(),l=e?i.left:!j?k[0]:0,m=e?i.top:!j?k[1]:0,n={c:[c(d*.5),c(b*.5)],t:[c(d*.5),0],l:[0,c(b*.5)],r:[d,c(b*.5)],b:[c(d*.5),b],tl:[0,0],bl:[0,b],br:[d,b],tr:[d,0]};h=n[g];return [h[0]+l,h[1]+m]},anchorTo:function(k,f,i,h,b,g){var c=this,e=c.dom,d=!Ext.isEmpty(b),a=function(){Ext.fly(e).alignTo(k,f,i,h);Ext.callback(g,Ext.fly(e))},j=this.getAnchor();this.removeAnchor();Ext.apply(j,{fn:a,scroll:d});Ext.EventManager.onWindowResize(a,null);d&&Ext.EventManager.on(window,"scroll",a,null,{buffer:!isNaN(b)?b:50});a.call(c);return c},removeAnchor:function(){var b=this,a=this.getAnchor();if(a&&a.fn){Ext.EventManager.removeResizeListener(a.fn);a.scroll&&Ext.EventManager.un(window,"scroll",a.fn);delete a.fn}return b},getAnchor:function(){var c=Ext.Element.data,b=this.dom;if(!b)return;var a=c(b,"_anchor");if(!a)a=c(b,"_anchor",{});return a},getAlignToXY:function(b,a,m){b=Ext.get(b);if(!b||!b.dom)throw"Element.alignToXY with an element that doesn't exist";m=m||[0,0];a=(!a||a=="?"?"tl-bl?":!/-/.test(a)&&a!==""?"tl-"+a:a||"tl-bl").toLowerCase();var j=this,C=j.dom,u,v,c,d,n,k,g,A=Ext.lib.Dom.getViewWidth()-10,z=Ext.lib.Dom.getViewHeight()-10,r,q,t,s,p,o,y=document,w=y.documentElement,x=y.body,h=(w.scrollLeft||x.scrollLeft||0)+5,i=(w.scrollTop||x.scrollTop||0)+5,B=false,e="",f="",l=a.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!l)throw"Element.alignTo with an invalid alignment "+a;e=l[1];f=l[2];B=!!l[3];u=j.getAnchorXY(e,true);v=b.getAnchorXY(f,false);c=v[0]-u[0]+m[0];d=v[1]-u[1]+m[1];if(B){n=j.getWidth();k=j.getHeight();g=b.getRegion();r=e.charAt(0);q=e.charAt(e.length-1);t=f.charAt(0);s=f.charAt(f.length-1);p=r=="t"&&t=="b"||r=="b"&&t=="t";o=q=="r"&&s=="l"||q=="l"&&s=="r";if(c+n>A+h)c=o?g.left-n:A+h-n;if(c<h)c=o?g.right:h;if(d+k>z+i)d=p?g.top-k:z+i-k;if(d<i)d=p?g.bottom:i}return [c,d]},alignTo:function(d,b,e,c){var a=this;return a.setXY(a.getAlignToXY(d,b,e),a.preanim&&!!c?a.preanim(arguments,3):false)},adjustForConstraints:function(a,c,b){return this.getConstrainToXY(c||document,false,b,a)||a},getConstrainToXY:function(){var a={top:0,left:0,bottom:0,right:0};return function(b,k,c,s){b=Ext.get(b);c=c?Ext.applyIf(c,a):a;var j,i,e=0,f=0;if(b.dom==document.body||b.dom==document){j=Ext.lib.Dom.getViewWidth();i=Ext.lib.Dom.getViewHeight()}else{j=b.dom.clientWidth;i=b.dom.clientHeight;if(!k){var l=b.getXY();e=l[0];f=l[1]}}var q=b.getScroll();e+=c.left+q.left;f+=c.top+q.top;j-=c.right;i-=c.bottom;var n=e+j,m=f+i,o=s||(!k?this.getXY():[this.getLeft(true),this.getTop(true)]),g=o[0],h=o[1],r=this.dom.offsetWidth,p=this.dom.offsetHeight,d=false;if(g+r>n){g=n-r;d=true}if(h+p>m){h=m-p;d=true}if(g<e){g=e;d=true}if(h<f){h=f;d=true}return d?[g,h]:false}}(),getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||document,"c-c")}});Ext.Element.addMethods(function(){var e="parentNode",d="nextSibling",c="previousSibling",a=Ext.DomQuery,b=Ext.get;return {findParent:function(g,d,h){var c=this.dom,i=document.body,f=0,e;if(Ext.isGecko&&Object.prototype.toString.call(c)=="[object XULElement]")return null;d=d||50;if(isNaN(d)){e=Ext.getDom(d);d=Number.MAX_VALUE}while(c&&c.nodeType==1&&f<d&&c!=i&&c!=e){if(a.is(c,g))return h?b(c):c;f++;c=c.parentNode}return null},findParentNode:function(b,c,d){var a=Ext.fly(this.dom.parentNode,"_internal");return a?a.findParent(b,c,d):null},up:function(a,b){return this.findParentNode(a,b,true)},select:function(a){return Ext.Element.select(a,this.dom)},query:function(b){return a.select(b,this.dom)},child:function(e,d){var c=a.selectNode(e,this.dom);return d?c:b(c)},down:function(e,d){var c=a.selectNode(" > "+e,this.dom);return d?c:b(c)},parent:function(b,a){return this.matchNode(e,e,b,a)},next:function(b,a){return this.matchNode(d,d,b,a)},prev:function(b,a){return this.matchNode(c,c,b,a)},first:function(b,a){return this.matchNode(d,"firstChild",b,a)},last:function(b,a){return this.matchNode(c,"lastChild",b,a)},matchNode:function(g,f,d,e){var c=this.dom[f];while(c){if(c.nodeType==1&&(!d||a.is(c,d)))return !e?b(c):c;c=c[g]}return null}}}());Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});Ext.Element.addMethods(function(){var a=Ext.getDom,c=Ext.get,b=Ext.DomHelper;return {appendChild:function(a){return c(a).appendTo(this)},appendTo:function(b){a(b).appendChild(this.dom);return this},insertBefore:function(b){(b=a(b)).parentNode.insertBefore(this.dom,b);return this},insertAfter:function(b){(b=a(b)).parentNode.insertBefore(this.dom,b.nextSibling);return this},insertFirst:function(b,d){b=b||{};if(b.nodeType||b.dom||typeof b=="string"){b=a(b);this.dom.insertBefore(b,this.dom.firstChild);return !d?c(b):b}else return this.createChild(b,this.dom.firstChild,d)},replace:function(a){a=c(a);this.insertBefore(a);a.remove();return this},replaceWith:function(d){var c=this;if(d.nodeType||d.dom||typeof d=="string"){d=a(d);c.dom.parentNode.insertBefore(d,c.dom)}else d=b.insertBefore(c.dom,d);delete Ext.elCache[c.id];Ext.removeNode(c.dom);c.id=Ext.id(c.dom=d);Ext.Element.addToCache(c.isFlyweight?new Ext.Element(c.dom):c);return c},createChild:function(a,c,d){a=a||{tag:"div"};return c?b.insertBefore(c,a,d!==true):b[!this.dom.firstChild?"overwrite":"append"](this.dom,a,d!==true)},wrap:function(d,c){var a=b.insertBefore(this.dom,d||{tag:"div"},!c);a.dom?a.dom.appendChild(this.dom):a.appendChild(this.dom);return a},insertHtml:function(d,e,c){var a=b.insertHtml(d,this.dom,e);return c?Ext.get(a):a}}}());Ext.apply(Ext.Element.prototype,function(){var b=Ext.getDom,c=Ext.get,a=Ext.DomHelper;return {insertSibling:function(d,j,g){var f=this,e,h=(j||"before").toLowerCase()=="after",i;if(Ext.isArray(d)){i=f;Ext.each(d,function(a){e=Ext.fly(i,"_internal").insertSibling(a,j,g);if(h)i=e});return e}d=d||{};if(d.nodeType||d.dom){e=f.dom.parentNode.insertBefore(b(d),h?f.dom.nextSibling:f.dom);if(!g)e=c(e)}else if(h&&!f.dom.nextSibling)e=a.append(f.dom.parentNode,d,!g);else e=a[h?"insertAfter":"insertBefore"](f.dom,d,!g);return e}}}());Ext.Element.addMethods(function(){var u={},A=/(-[a-z])/gi,D={},r=document.defaultView,v=Ext.isIE?"styleFloat":"cssFloat",h=/alpha\(opacity=(.*)\)/i,f=/^\s+|\s+$/g,x=/\s+/,C=/\w/g,E=Ext.Element,c="padding",e="margin",d="border",p="-left",o="-right",s="-top",m="-bottom",g="-width",q=Math,n="hidden",b="isClipped",l="overflow",i="overflow-x",j="overflow-y",t="originalClip",y={l:d+p+g,r:d+o+g,t:d+s+g,b:d+m+g},w={l:c+p,r:c+o,t:c+s,b:c+m},B={l:e+p,r:e+o,t:e+s,b:e+m},a=Ext.Element.data;function z(b,a){return a.charAt(1).toUpperCase()}function k(a){return u[a]||(u[a]=a=="float"?v:a.replace(A,z))}return {adjustWidth:function(a){var b=this,c=typeof a=="number";if(c&&b.autoBoxAdjust&&!b.isBorderBox())a-=b.getBorderWidth("lr")+b.getPadding("lr");return c&&a<0?0:a},adjustHeight:function(a){var b=this,c=typeof a=="number";if(c&&b.autoBoxAdjust&&!b.isBorderBox())a-=b.getBorderWidth("tb")+b.getPadding("tb");return c&&a<0?0:a},addClass:function(a){var b=this,c,f,d,e=[];if(!Ext.isArray(a)){if(typeof a=="string"&&!this.hasClass(a))b.dom.className+=" "+a}else{for(c=0,f=a.length;c<f;c++){d=a[c];typeof d=="string"&&(" "+b.dom.className+" ").indexOf(" "+d+" ")==-1&&e.push(d)}if(e.length)b.dom.className+=" "+e.join(" ")}return b},removeClass:function(a){var c=this,e,g,h,b,d;if(!Ext.isArray(a))a=[a];if(c.dom&&c.dom.className){d=c.dom.className.replace(f,"").split(x);for(e=0,h=a.length;e<h;e++){b=a[e];if(typeof b=="string"){b=b.replace(f,"");g=d.indexOf(b);g!=-1&&d.splice(g,1)}}c.dom.className=d.join(" ")}return c},radioClass:function(a){var e=this.dom.parentNode.childNodes,c,b,d;a=Ext.isArray(a)?a:[a];for(b=0,d=e.length;b<d;b++){c=e[b];c&&c.nodeType==1&&Ext.fly(c,"_internal").removeClass(a)}return this.addClass(a)},toggleClass:function(a){return this.hasClass(a)?this.removeClass(a):this.addClass(a)},hasClass:function(a){return a&&(" "+this.dom.className+" ").indexOf(" "+a+" ")!=-1},replaceClass:function(b,a){return this.removeClass(b).addClass(a)},isStyle:function(a,b){return this.getStyle(a)==b},getStyle:function(){return r&&r.getComputedStyle?function(a){var b=this.dom,g,e,c,f=Ext.isWebKit,d;if(b==document)return null;a=k(a);if(f&&/marginRight/.test(a)){d=this.getStyle("display");b.style.display="inline-block"}c=(g=b.style[a])?g:(e=r.getComputedStyle(b,""))?e[a]:null;if(f)if(c=="rgba(0, 0, 0, 0)")c="transparent";else if(d)b.style.display=d;return c}:function(a){var b=this.dom,e,d;if(b==document)return null;if(a=="opacity"){if(b.style.filter.match)if(e=b.style.filter.match(h)){var c=parseFloat(e[1]);if(!isNaN(c))return c?c/100:0}return 1}a=k(a);return b.style[a]||((d=b.currentStyle)?d[a]:null)}}(),getColor:function(f,d,e){var a=this.getStyle(f),b=typeof e!="undefined"?e:"#",c;if(!a||/transparent|inherit/.test(a))return d;if(/^r/.test(a))Ext.each(a.slice(4,a.length-1).split(","),function(a){c=parseInt(a,10);b+=(c<16?"0":"")+c.toString(16)});else{a=a.replace("#","");b+=a.length==3?a.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):a}return b.length>5?b.toLowerCase():d},setStyle:function(a,c){var d,b,e;if(typeof a!="object"){d={};d[a]=c;a=d}for(b in a){c=a[b];b=="opacity"?this.setOpacity(c):(this.dom.style[k(b)]=c)}return this},setOpacity:function(b,e){var a=this,c=a.dom.style;if(!e||!a.anim)if(Ext.isIE){var g=b<1?"alpha(opacity="+b*100+")":"",d=c.filter.replace(h,"").replace(f,"");c.zoom=1;c.filter=d+(d.length>0?" ":"")+g}else c.opacity=b;else a.anim({opacity:{to:b}},a.preanim(arguments,1),null,.35,"easeIn");return a},clearOpacity:function(){var a=this.dom.style;if(Ext.isIE){if(!Ext.isEmpty(a.filter))a.filter=a.filter.replace(h,"").replace(f,"")}else a.opacity=a["-moz-opacity"]=a["-khtml-opacity"]="";return this},getHeight:function(d){var b=this,c=b.dom,e=Ext.isIE&&b.isStyle("display","none"),a=q.max(c.offsetHeight,e?0:c.clientHeight)||0;a=!d?a:a-b.getBorderWidth("tb")-b.getPadding("tb");return a<0?0:a},getWidth:function(d){var b=this,c=b.dom,e=Ext.isIE&&b.isStyle("display","none"),a=q.max(c.offsetWidth,e?0:c.clientWidth)||0;a=!d?a:a-b.getBorderWidth("lr")-b.getPadding("lr");return a<0?0:a},setWidth:function(b,c){var a=this;b=a.adjustWidth(b);!c||!a.anim?(a.dom.style.width=a.addUnits(b)):a.anim({width:{to:b}},a.preanim(arguments,1));return a},setHeight:function(b,c){var a=this;b=a.adjustHeight(b);!c||!a.anim?(a.dom.style.height=a.addUnits(b)):a.anim({height:{to:b}},a.preanim(arguments,1));return a},getBorderWidth:function(a){return this.addStyles(a,y)},getPadding:function(a){return this.addStyles(a,w)},clip:function(){var c=this,d=c.dom;if(!a(d,b)){a(d,b,true);a(d,t,{o:c.getStyle(l),x:c.getStyle(i),y:c.getStyle(j)});c.setStyle(l,n);c.setStyle(i,n);c.setStyle(j,n)}return c},unclip:function(){var d=this,e=d.dom;if(a(e,b)){a(e,b,false);var c=a(e,t);c.o&&d.setStyle(l,c.o);c.x&&d.setStyle(i,c.x);c.y&&d.setStyle(j,c.y)}return d},addStyles:function(g,f){for(var e=0,d=g.match(C),a,b,h=d.length,c=0;c<h;c++){a=d[c];b=a&&parseInt(this.getStyle(f[a]),10);if(b)e+=q.abs(b)}return e},margins:B}}());Ext.Element.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>';Ext.Element.addMethods(function(){var a="_internal",b=/(\d+\.?\d+)px/;return {applyStyles:function(a){Ext.DomHelper.applyStyles(this.dom,a);return this},getStyles:function(){var a={};Ext.each(arguments,function(b){a[b]=this.getStyle(b)},this);return a},setOverflow:function(b){var a=this.dom;if(b=="auto"&&Ext.isMac&&Ext.isGecko2){a.style.overflow="hidden";(function(){a.style.overflow="auto"}).defer(1)}else a.style.overflow=b},boxWrap:function(a){a=a||"x-box";var b=Ext.get(this.insertHtml("beforeBegin","<div class='"+a+"'>"+String.format(Ext.Element.boxMarkup,a)+"</div>"));Ext.DomQuery.selectNode("."+a+"-mc",b.dom).appendChild(this.dom);return b},setSize:function(b,c,d){var a=this;if(typeof b=="object"){c=b.height;b=b.width}b=a.adjustWidth(b);c=a.adjustHeight(c);if(!d||!a.anim){a.dom.style.width=a.addUnits(b);a.dom.style.height=a.addUnits(c)}else a.anim({width:{to:b},height:{to:c}},a.preanim(arguments,2));return a},getComputedHeight:function(){var a=this,b=Math.max(a.dom.offsetHeight,a.dom.clientHeight);if(!b){b=parseFloat(a.getStyle("height"))||0;if(!a.isBorderBox())b+=a.getFrameWidth("tb")}return b},getComputedWidth:function(){var a=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!a){a=parseFloat(this.getStyle("width"))||0;if(!this.isBorderBox())a+=this.getFrameWidth("lr")}return a},getFrameWidth:function(a,b){return b&&this.isBorderBox()?0:this.getPadding(a)+this.getBorderWidth(a)},addClassOnOver:function(b){this.hover(function(){Ext.fly(this,a).addClass(b)},function(){Ext.fly(this,a).removeClass(b)});return this},addClassOnFocus:function(b){this.on("focus",function(){Ext.fly(this,a).addClass(b)},this.dom);this.on("blur",function(){Ext.fly(this,a).removeClass(b)},this.dom);return this},addClassOnClick:function(b){var c=this.dom;this.on("mousedown",function(){Ext.fly(c,a).addClass(b);var e=Ext.getDoc(),d=function(){Ext.fly(c,a).removeClass(b);e.removeListener("mouseup",d)};e.on("mouseup",d)});return this},getViewSize:function(){var c=document,a=this.dom,d=a==c||a==c.body;if(d){var b=Ext.lib.Dom;return {width:b.getViewWidth(),height:b.getViewHeight()}}else return {width:a.clientWidth,height:a.clientHeight}},getStyleSize:function(){var a=this,e,d,g=document,c=this.dom,h=c==g||c==g.body,b=c.style;if(h){var f=Ext.lib.Dom;return {width:f.getViewWidth(),height:f.getViewHeight()}}if(b.width&&b.width!="auto"){e=parseFloat(b.width);if(a.isBorderBox())e-=a.getFrameWidth("lr")}if(b.height&&b.height!="auto"){d=parseFloat(b.height);if(a.isBorderBox())d-=a.getFrameWidth("tb")}return {width:e||a.getWidth(true),height:d||a.getHeight(true)}},getSize:function(a){return {width:this.getWidth(a),height:this.getHeight(a)}},repaint:function(){var a=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.fly(a).removeClass("x-repaint")},1);return this},unselectable:function(){this.dom.unselectable="on";return this.swallowEvent("selectstart",true).applyStyles("-moz-user-select:none;-khtml-user-select:none;").addClass("x-unselectable")},getMargins:function(c){var a=this,b,e={t:"top",l:"left",r:"right",b:"bottom"},d={};if(!c){for(b in a.margins)d[e[b]]=parseFloat(a.getStyle(a.margins[b]))||0;return d}else return a.addStyles.call(a,c,a.margins)}}}());(function(){var d=Ext.lib.Dom,b="left",i="right",c="top",f="bottom",a="position",g="static",e="relative",j="auto",h="z-index";Ext.Element.addMethods({getX:function(){return d.getX(this.dom)},getY:function(){return d.getY(this.dom)},getXY:function(){return d.getXY(this.dom)},getOffsetsTo:function(c){var b=this.getXY(),a=Ext.fly(c,"_internal").getXY();return [b[0]-a[0],b[1]-a[1]]},setX:function(b,a){return this.setXY([b,this.getY()],this.animTest(arguments,a,1))},setY:function(b,a){return this.setXY([this.getX(),b],this.animTest(arguments,a,1))},setLeft:function(a){this.setStyle(b,this.addUnits(a));return this},setTop:function(a){this.setStyle(c,this.addUnits(a));return this},setRight:function(a){this.setStyle(i,this.addUnits(a));return this},setBottom:function(a){this.setStyle(f,this.addUnits(a));return this},setXY:function(b,c){var a=this;if(!c||!a.anim)d.setXY(a.dom,b);else a.anim({points:{to:b}},a.preanim(arguments,1),"motion");return a},setLocation:function(b,c,a){return this.setXY([b,c],this.animTest(arguments,a,2))},moveTo:function(b,c,a){return this.setXY([b,c],this.animTest(arguments,a,2))},getLeft:function(a){return !a?this.getX():parseInt(this.getStyle(b),10)||0},getRight:function(b){var a=this;return !b?a.getX()+a.getWidth():a.getLeft(true)+a.getWidth()||0},getTop:function(a){return !a?this.getY():parseInt(this.getStyle(c),10)||0},getBottom:function(b){var a=this;return !b?a.getY()+a.getHeight():a.getTop(true)+a.getHeight()||0},position:function(c,d,f,i){var b=this;if(!c&&b.isStyle(a,g))b.setStyle(a,e);else c&&b.setStyle(a,c);d&&b.setStyle(h,d);(f||i)&&b.setXY([f||false,i||false])},clearPositioning:function(a){a=a||"";this.setStyle({left:a,right:a,top:a,bottom:a,"z-index":"",position:g});return this},getPositioning:function(){var d=this.getStyle(b),e=this.getStyle(c);return {position:this.getStyle(a),left:d,right:d?"":this.getStyle(i),top:e,bottom:e?"":this.getStyle(f),"z-index":this.getStyle(h)}},setPositioning:function(b){var a=this,c=a.dom.style;a.setStyle(b);if(b.right==j)c.right="";if(b.bottom==j)c.bottom="";return a},translatePoints:function(d,i){i=isNaN(d[1])?i:d[1];d=isNaN(d[0])?d:d[0];var f=this,j=f.isStyle(a,e),k=f.getXY(),g=parseInt(f.getStyle(b),10),h=parseInt(f.getStyle(c),10);g=!isNaN(g)?g:j?0:f.dom.offsetLeft;h=!isNaN(h)?h:j?0:f.dom.offsetTop;return {left:d-k[0]+g,top:i-k[1]+h}},animTest:function(b,a,c){return !!a&&this.preanim?this.preanim(b,c):false}})})();Ext.Element.addMethods({setBox:function(b,f,e){var a=this,d=b.width,c=b.height;if(f&&!a.autoBoxAdjust&&!a.isBorderBox()){d-=a.getBorderWidth("lr")+a.getPadding("lr");c-=a.getBorderWidth("tb")+a.getPadding("tb")}a.setBounds(b.x,b.y,d,c,a.animTest.call(a,arguments,e,2));return a},getBox:function(o,p){var a=this,b,h,i,d=a.getBorderWidth,e=a.getPadding,f,m,g,k;if(!p)b=a.getXY();else{h=parseInt(a.getStyle("left"),10)||0;i=parseInt(a.getStyle("top"),10)||0;b=[h,i]}var j=a.dom,n=j.offsetWidth,l=j.offsetHeight,c;if(!o)c={x:b[0],y:b[1],0:b[0],1:b[1],width:n,height:l};else{f=d.call(a,"l")+e.call(a,"l");m=d.call(a,"r")+e.call(a,"r");g=d.call(a,"t")+e.call(a,"t");k=d.call(a,"b")+e.call(a,"b");c={x:b[0]+f,y:b[1]+g,0:b[0]+f,1:b[1]+g,width:n-(f+m),height:l-(g+k)}}c.right=c.x+c.width;c.bottom=c.y+c.height;return c},move:function(a,b,l){var c=this,k=c.getXY(),d=k[0],e=k[1],j=[d-b,e],h=[d+b,e],g=[d,e-b],f=[d,e+b],i={l:j,left:j,r:h,right:h,t:g,top:g,up:g,b:f,bottom:f,down:f};a=a.toLowerCase();c.moveTo(i[a][0],i[a][1],c.animTest.call(c,arguments,l,2))},setLeftTop:function(c,d){var a=this,b=a.dom.style;b.left=a.addUnits(c);b.top=a.addUnits(d);return a},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(d,e,c,b,f){var a=this;if(!f||!a.anim){a.setSize(c,b);a.setLocation(d,e)}else a.anim({points:{to:[d,e]},width:{to:a.adjustWidth(c)},height:{to:a.adjustHeight(b)}},a.preanim(arguments,4),"motion");return a},setRegion:function(a,b){return this.setBounds(a.left,a.top,a.right-a.left,a.bottom-a.top,this.animTest.call(this,arguments,b,1))}});Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(b,a){this.dom["scroll"+(/top/i.test(b)?"Top":"Left")]=a;return this},getScroll:function(){var b=this.dom,c=document,a=c.body,g=c.documentElement,e,f,d;if(b==c||b==a){if(Ext.isIE&&Ext.isStrict){e=g.scrollLeft;f=g.scrollTop}else{e=window.pageXOffset;f=window.pageYOffset}d={left:e||(a?a.scrollLeft:0),top:f||(a?a.scrollTop:0)}}else d={left:b.scrollLeft,top:b.scrollTop};return d}});Ext.Element.addMethods({scrollTo:function(g,c,f){var e=/top/i.test(g),b=this,d=b.dom,a;if(!f||!b.anim)a="scroll"+(e?"Top":"Left"),d[a]=c;else a="scroll"+(e?"Left":"Top"),b.anim({scroll:{to:e?[d[a],c]:[c,d[a]]}},b.preanim(arguments,2),"scroll");return b},scrollIntoView:function(k,l){var a=Ext.getDom(k)||Ext.getBody().dom,b=this.dom,i=this.getOffsetsTo(a),d=i[0]+a.scrollLeft,e=i[1]+a.scrollTop,h=e+b.offsetHeight,j=d+b.offsetWidth,c=a.clientHeight,g=parseInt(a.scrollTop,10),f=parseInt(a.scrollLeft,10),m=g+c,n=f+a.clientWidth;if(b.offsetHeight>c||e<g)a.scrollTop=e;else if(h>m)a.scrollTop=h-c;a.scrollTop=a.scrollTop;if(l!==false){if(b.offsetWidth>a.clientWidth||d<f)a.scrollLeft=d;else if(j>n)a.scrollLeft=j-a.clientWidth;a.scrollLeft=a.scrollLeft}return this},scrollChildIntoView:function(b,a){Ext.fly(b,"_scrollChildIntoView").scrollIntoView(this,a)},scroll:function(b,d){if(!this.isScrollable())return;var a=this.dom,g=a.scrollLeft,h=a.scrollTop,l=a.scrollWidth,k=a.scrollHeight,j=a.clientWidth,i=a.clientHeight,f=false,e,c={l:Math.min(g+d,l-j),r:e=Math.max(g-d,0),t:Math.max(h-d,0),b:Math.min(h+d,k-i)};c.d=c.b;c.u=c.t;b=b.substr(0,1);if((e=c[b])>-1){f=true;this.scrollTo(b=="l"||b=="r"?"left":"top",e,this.preanim(arguments,2))}return f}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.addMethods(function(){var d="visibility",a="display",e="hidden",k="offsets",c="none",g="originalDisplay",f="visibilityMode",j=Ext.Element.DISPLAY,b=Ext.Element.data,h=function(c){var a=b(c,g);a===undefined&&b(c,g,a="");return a},i=function(c){var a=b(c,f);a===undefined&&b(c,f,a=1);return a};return {originalDisplay:"",visibilityMode:1,setVisibilityMode:function(a){b(this.dom,f,a);return this},animate:function(e,c,a,d,b){this.anim(e,{duration:c,callback:a,easing:d},b);return this},anim:function(h,a,c,g,f,e){c=c||"run";a=a||{};var b=this,d=Ext.lib.Anim[c](b.dom,h,a.duration||g||.35,a.easing||f||"easeOut",function(){e&&e.call(b);a.callback&&a.callback.call(a.scope||b,b,a)},b);a.anim=d;return d},preanim:function(a,b){return !a[b]?false:typeof a[b]=="object"?a[b]:{duration:a[b+1],callback:a[b+2],easing:a[b+3]}},isVisible:function(){return !this.isStyle(d,e)&&!this.isStyle(a,c)},setVisible:function(h,g){var b=this,f,n,m,l=b.dom;if(typeof g=="string"){f=g==a;n=g==d;m=g==k;g=false}else{f=i(this.dom)==j;n=!f}if(!g||!b.anim)if(f)b.setDisplayed(h);else if(m)if(!h){b.hideModeStyles={position:b.getStyle("position"),top:b.getStyle("top"),left:b.getStyle("left")};b.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else b.applyStyles(b.hideModeStyles||{position:"",top:"",left:""});else{b.fixDisplay();l.style.visibility=h?"visible":e}else{if(h){b.setOpacity(.01);b.setVisible(true)}b.anim({opacity:{to:h?1:0}},b.preanim(arguments,1),null,.35,"easeIn",function(){if(!h){l.style[f?a:d]=f?c:e;Ext.fly(l).setOpacity(1)}})}return b},toggle:function(){var a=this;a.setVisible(!a.isVisible(),a.preanim(arguments,0));return a},setDisplayed:function(b){if(typeof b=="boolean")b=b?h(this.dom):c;this.setStyle(a,b);return this},fixDisplay:function(){var b=this;if(b.isStyle(a,c)){b.setStyle(d,e);b.setStyle(a,h(this.dom));b.isStyle(a,c)&&b.setStyle(a,"block")}},hide:function(a){if(typeof a=="string"){this.setVisible(false,a);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(a){if(typeof a=="string"){this.setVisible(true,a);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());Ext.Element.addMethods(function(){var f="visibility",c="display",g="hidden",e="none",d="x-masked",b="x-masked-relative",a=Ext.Element.data;return {isVisible:function(d){var b=!this.isStyle(f,g)&&!this.isStyle(c,e),a=this.dom.parentNode;if(d!==true||!b)return b;while(a&&!/^body/i.test(a.tagName)){if(!Ext.fly(a,"_isVisible").isVisible())return false;a=a.parentNode}return true},isDisplayed:function(){return !this.isStyle(c,e)},enableDisplayMode:function(b){this.setVisibilityMode(Ext.Element.DISPLAY);!Ext.isEmpty(b)&&a(this.dom,"originalDisplay",b);return this},mask:function(k,j){var e=this,c=e.dom,l=Ext.DomHelper,i="ext-el-mask-msg",h,f;!/^body/i.test(c.tagName)&&e.getStyle("position")=="static"&&e.addClass(b);(h=a(c,"maskMsg"))&&h.remove();(h=a(c,"mask"))&&h.remove();f=l.append(c,{cls:"ext-el-mask"},true);a(c,"mask",f);e.addClass(d);f.setDisplayed(true);if(typeof k=="string"){var g=l.append(c,{cls:i,cn:{tag:"div"}},true);a(c,"maskMsg",g);g.dom.className=j?i+" "+j:i;g.dom.firstChild.innerHTML=k;g.setDisplayed(true);g.center(e)}Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&e.getStyle("height")=="auto"&&f.setSize(undefined,e.getHeight());return f},unmask:function(){var g=this,c=g.dom,f=a(c,"mask"),e=a(c,"maskMsg");if(f){if(e){e.remove();a(c,"maskMsg",undefined)}f.remove();a(c,"mask",undefined)}g.removeClass([d,b])},isMasked:function(){var b=a(this.dom,"mask");return b&&b.isVisible()},createShim:function(){var a=document.createElement("iframe"),b;a.frameBorder="0";a.className="ext-shim";a.src=Ext.SSL_SECURE_URL;b=Ext.get(this.dom.parentNode.insertBefore(a,this.dom));b.autoBoxAdjust=false;return b}}}());Ext.Element.addMethods({addKeyListener:function(a,d,c){var b;if(typeof a!="object"||Ext.isArray(a))b={key:a,fn:d,scope:c};else b={key:a.key,shift:a.shift,ctrl:a.ctrl,alt:a.alt,fn:d,scope:c};return new Ext.KeyMap(this,b)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});(function(){var b=null,x=undefined,n=true,d=false,v="setX",w="setY",z="setXY",e="left",i="bottom",f="top",l="right",j="height",m="width",p="points",u="hidden",r="absolute",o="visible",k="motion",y="position",g="easeOut",s=new Ext.Element.Flyweight,q={},c=function(a){return a||{}},a=function(a){s.dom=a;s.id=Ext.id(a);return s},h=function(a){if(!q[a])q[a]=[];return q[a]},t=function(b,a){q[b]=a};Ext.enableFx=n;Ext.Fx={switchStatements:function(b,c,a){return c.apply(this,a[b])},slideIn:function(y,q){q=c(q);var A=this,m=A.dom,h=m.style,t,x,d,j,C,B,p,s,n;y=y||"t";A.queueFx(q,function(){t=a(m).getXY();a(m).fixDisplay();x=a(m).getFxRestore();d={x:t[0],y:t[1],0:t[0],1:t[1],width:m.offsetWidth,height:m.offsetHeight};d.right=d.x+d.width;d.bottom=d.y+d.height;a(m).setWidth(d.width).setHeight(d.height);j=a(m).fxWrap(x.pos,q,u);h.visibility=o;h.position=r;function A(){a(m).fxUnwrap(j,x.pos,q);h.width=x.width;h.height=x.height;a(m).afterFx(q)}p={to:[d.x,d.y]};s={to:d.width};n={to:d.height};function c(c,d,m,l,e,i,j,k,h,f,g){var b={};a(c).setWidth(m).setHeight(l);a(c)[e]&&a(c)[e](i);d[j]=d[k]="0";if(h)b.width=h;if(f)b.height=f;if(g)b.points=g;return b}B=a(m).switchStatements(y.toLowerCase(),c,{t:[j,h,d.width,0,b,b,e,i,b,n,b],l:[j,h,0,d.height,b,b,l,f,s,b,b],r:[j,h,d.width,d.height,v,d.right,e,f,b,b,p],b:[j,h,d.width,d.height,w,d.bottom,e,f,b,n,p],tl:[j,h,0,0,b,b,l,i,s,n,p],bl:[j,h,0,0,w,d.y+d.height,l,f,s,n,p],br:[j,h,0,0,z,[d.right,d.bottom],e,f,s,n,p],tr:[j,h,0,0,v,d.x+d.width,e,i,s,n,p]});h.visibility=o;a(j).show();arguments.callee.anim=a(j).fxanim(B,q,k,.5,g,A)});return A},slideOut:function(x,s){s=c(s);var v=this,q=v.dom,n=q.style,w=v.getXY(),u,t,b,y,h={to:0};x=x||"t";v.queueFx(s,function(){t=a(q).getFxRestore();b={x:w[0],y:w[1],0:w[0],1:w[1],width:q.offsetWidth,height:q.offsetHeight};b.right=b.x+b.width;b.bottom=b.y+b.height;a(q).setWidth(b.width).setHeight(b.height);u=a(q).fxWrap(t.pos,s,o);n.visibility=o;n.position=r;a(u).setWidth(b.width).setHeight(b.height);function v(){s.useDisplay?a(q).setDisplayed(d):a(q).hide();a(q).fxUnwrap(u,t.pos,s);n.width=t.width;n.height=t.height;a(q).afterFx(s)}function c(b,f,g,e,h,c,i,d,j){var a={};b[f]=b[g]="0";a[e]=h;if(c)a[c]=i;if(d)a[d]=j;return a}y=a(q).switchStatements(x.toLowerCase(),c,{t:[n,e,i,j,h],l:[n,l,f,m,h],r:[n,e,f,m,h,p,{to:[b.right,b.y]}],b:[n,e,f,j,h,p,{to:[b.x,b.bottom]}],tl:[n,l,i,m,h,j,h],bl:[n,l,f,m,h,j,h,p,{to:[b.x,b.bottom]}],br:[n,e,f,m,h,j,h,p,{to:[b.x+b.width,b.bottom]}],tr:[n,e,i,m,h,j,h,p,{to:[b.right,b.y]}]});arguments.callee.anim=a(u).fxanim(y,s,k,.5,g,v)});return v},puff:function(e){e=c(e);var j=this,b=j.dom,l=b.style,i,h,f;j.queueFx(e,function(){i=a(b).getWidth();h=a(b).getHeight();a(b).clearOpacity();a(b).show();f=a(b).getFxRestore();function c(){e.useDisplay?a(b).setDisplayed(d):a(b).hide();a(b).clearOpacity();a(b).setPositioning(f.pos);l.width=f.width;l.height=f.height;l.fontSize="";a(b).afterFx(e)}arguments.callee.anim=a(b).fxanim({width:{to:a(b).adjustWidth(i*2)},height:{to:a(b).adjustHeight(h*2)},points:{by:[-i*.5,-h*.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},e,k,.5,g,c)});return j},switchOff:function(f){f=c(f);var h=this,e=h.dom,i=e.style,g;h.queueFx(f,function(){a(e).clearOpacity();a(e).clip();g=a(e).getFxRestore();function c(){f.useDisplay?a(e).setDisplayed(d):a(e).hide();a(e).clearOpacity();a(e).setPositioning(g.pos);i.width=g.width;i.height=g.height;a(e).afterFx(f)}a(e).fxanim({opacity:{to:.3}},b,b,.1,b,function(){a(e).clearOpacity();(function(){a(e).fxanim({height:{to:1},points:{by:[0,a(e).getHeight()*.5]}},f,k,.3,"easeIn",c)}).defer(100)})});return h},highlight:function(i,d){d=c(d);var f=this,b=f.dom,e=d.attr||"backgroundColor",h={},g;f.queueFx(d,function(){a(b).clearOpacity();a(b).show();function c(){b.style[e]=g;a(b).afterFx(d)}g=b.style[e];h[e]={from:i||"ffff9c",to:d.endColor||a(b).getColor(e)||"ffffff"};arguments.callee.anim=a(b).fxanim(h,d,"color",1,"easeIn",c)});return f},frame:function(b,g,f){f=c(f);var h=this,e=h.dom,d,i;h.queueFx(f,function(){b=b||"#C3DAF9";if(b.length==6)b="#"+b;g=g||1;a(e).show();var h=a(e).getXY(),c={x:h[0],y:h[1],0:h[0],1:h[1],width:e.offsetWidth,height:e.offsetHeight},j=function(){d=a(document.body||document.documentElement).createChild({style:{position:r,"z-index":35000,border:"0px solid "+b}});return d.queueFx({},k)};arguments.callee.anim={isAnimated:true,stop:function(){g=0;d.stopFx()}};function k(){var b=Ext.isBorderBox?2:1;i=d.anim({top:{from:c.y,to:c.y-20},left:{from:c.x,to:c.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:c.height,to:c.height+20*b},width:{from:c.width,to:c.width+20*b}},{duration:f.duration||1,callback:function(){d.remove();--g>0?j():a(e).afterFx(f)}});arguments.callee.anim={isAnimated:true,stop:function(){i.stop()}}}j()});return h},pause:function(d){var b=this.dom,c;this.queueFx({},function(){c=setTimeout(function(){a(b).afterFx({})},d*1e3);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(c);a(b).afterFx({})}}});return this},fadeIn:function(e){e=c(e);var f=this,d=f.dom,h=e.endOpacity||1;f.queueFx(e,function(){a(d).setOpacity(0);a(d).fixDisplay();d.style.visibility=o;arguments.callee.anim=a(d).fxanim({opacity:{to:h}},e,b,.5,g,function(){h==1&&a(d).clearOpacity();a(d).afterFx(e)})});return f},fadeOut:function(d){d=c(d);var f=this,e=f.dom,h=e.style,i=d.endOpacity||0;f.queueFx(d,function(){arguments.callee.anim=a(e).fxanim({opacity:{to:i}},d,b,.5,g,function(){if(i==0){Ext.Element.data(e,"visibilityMode")==Ext.Element.DISPLAY||d.useDisplay?(h.display="none"):(h.visibility=u);a(e).clearOpacity()}a(e).afterFx(d)})});return f},scale:function(c,a,b){this.shift(Ext.apply({},b,{width:c,height:a}));return this},shift:function(d){d=c(d);var e=this.dom,b={};this.queueFx(d,function(){for(var c in d)if(d[c]!=x)b[c]={to:d[c]};b.width?(b.width.to=a(e).adjustWidth(d.width)):b;b.height?(b.height.to=a(e).adjustWidth(d.height)):b;if(b.x||b.y||b.xy)b.points=b.xy||{to:[b.x?b.x.to:a(e).getX(),b.y?b.y.to:a(e).getY()]};arguments.callee.anim=a(e).fxanim(b,d,k,.35,g,function(){a(e).afterFx(d)})});return this},ghost:function(j,h){h=c(h);var l=this,b=l.dom,m=b.style,n={opacity:{to:0},points:{}},o=n.points,i,f,e;j=j||"b";l.queueFx(h,function(){i=a(b).getFxRestore();f=a(b).getWidth();e=a(b).getHeight();function c(){h.useDisplay?a(b).setDisplayed(d):a(b).hide();a(b).clearOpacity();a(b).setPositioning(i.pos);m.width=i.width;m.height=i.height;a(b).afterFx(h)}o.by=a(b).switchStatements(j.toLowerCase(),function(a,b){return [a,b]},{t:[0,-e],l:[-f,0],r:[f,0],b:[0,e],tl:[-f,-e],bl:[-f,e],br:[f,e],tr:[f,-e]});arguments.callee.anim=a(b).fxanim(n,h,k,.5,g,c)});return l},syncFx:function(){var a=this;a.fxDefaults=Ext.apply(a.fxDefaults||{},{block:d,concurrent:n,stopFx:d});return a},sequenceFx:function(){var a=this;a.fxDefaults=Ext.apply(a.fxDefaults||{},{block:d,concurrent:d,stopFx:d});return a},nextFx:function(){var a=h(this.dom.id)[0];a&&a.call(this)},hasActiveFx:function(){return h(this.dom.id)[0]},stopFx:function(d){var c=this,b=c.dom.id;if(c.hasActiveFx()){var a=h(b)[0];if(a&&a.anim)if(a.anim.isAnimated){t(b,[a]);a.anim.stop(d!==undefined?d:n)}else t(b,[])}return c},beforeFx:function(a){if(this.hasActiveFx()&&!a.concurrent){if(a.stopFx){this.stopFx();return n}return d}return n},hasFxBlock:function(){var a=h(this.dom.id);return a&&a[0]&&a[0].block},queueFx:function(c,d){var b=a(this.dom);if(!b.hasFxBlock()){Ext.applyIf(c,b.fxDefaults);if(!c.concurrent){var e=b.beforeFx(c);d.block=c.block;h(b.dom.id).push(d);e&&b.nextFx()}else d.call(b)}return b},fxWrap:function(g,e,h){var c=this.dom,b,d;if(!e.wrap||!(b=Ext.getDom(e.wrap))){if(e.fixPosition)d=a(c).getXY();var f=document.createElement("div");f.style.visibility=h;b=c.parentNode.insertBefore(f,c);a(b).setPositioning(g);a(b).isStyle(y,"static")&&a(b).position("relative");a(c).clearPositioning("auto");a(b).clip();b.appendChild(c);d&&a(b).setXY(d)}return b},fxUnwrap:function(b,d,f){var c=this.dom;a(c).clearPositioning();a(c).setPositioning(d);if(!f.wrap){var e=a(b).dom.parentNode;e.insertBefore(c,b);a(b).remove()}},getFxRestore:function(){var a=this.dom.style;return {pos:this.getPositioning(),width:a.width,height:a.height}},afterFx:function(b){var c=this.dom,d=c.id;b.afterStyle&&a(c).setStyle(b.afterStyle);b.afterCls&&a(c).addClass(b.afterCls);b.remove==n&&a(c).remove();b.callback&&b.callback.call(b.scope,a(c));if(!b.concurrent){h(d).shift();a(c).nextFx()}},fxanim:function(f,a,b,e,d,h){b=b||"run";a=a||{};var c=Ext.lib.Anim[b](this.dom,f,a.duration||e||.35,a.easing||d||g,h,this);a.anim=c;return c}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(b,a){this.elements=[];this.add(b,a);this.el=new Ext.Element.Flyweight};Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(b){var a=this.el;a.dom=b;a.id=b.id;return a},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(a,e){var b=this,d=b.elements;if(!a)return this;if(typeof a=="string")a=Ext.Element.selectorFunction(a,e);else if(a.isComposite)a=a.elements;else if(!Ext.isIterable(a))a=[a];for(var c=0,f=a.length;c<f;++c)d.push(b.transformElement(a[c]));return b},invoke:function(g,e){for(var a=this,d=a.elements,f=d.length,b,c=0;c<f;c++){b=d[c];b&&Ext.Element.prototype[g].apply(a.getElement(b),e)}return a},item:function(d){var c=this,b=c.elements[d],a=null;if(b)a=c.getElement(b);return a},addListener:function(d,e,f,h){for(var c=this.elements,g=c.length,a,b=0;b<g;b++){a=c[b];a&&Ext.EventManager.on(a,d,e,f||a,h)}return this},each:function(g,e){for(var c=this,d=c.elements,f=d.length,a,b=0;b<f;b++){a=d[b];if(a){a=this.getElement(a);if(g.call(e||a,a,c,b)===false)break}}return c},fill:function(b){var a=this;a.elements=[];a.add(b);return a},filter:function(b){var c=[],a=this,e=a.elements,d=Ext.isFunction(b)?b:function(a){return a.is(b)};a.each(function(b,f,e){if(d(b,e)!==false)c[c.length]=a.transformElement(b)});a.elements=c;return a},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(d,a,e){var c=!isNaN(d)?d:this.indexOf(d),b;if(c>-1){a=Ext.getDom(a);if(e){b=this.elements[c];b.parentNode.insertBefore(a,b);Ext.removeNode(b)}this.elements.splice(c,1,a)}return this},clear:function(){this.elements=[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;(function(){var b,c=Ext.Element.prototype,a=Ext.CompositeElementLite.prototype;for(b in c)Ext.isFunction(c[b])&&(function(b){a[b]=a[b]||function(){return this.invoke(b,arguments)}}).call(a,b)})();if(Ext.DomQuery)Ext.Element.selectorFunction=Ext.DomQuery.select;Ext.Element.select=function(a,c){var b;if(typeof a=="string")b=Ext.Element.selectorFunction(a,c);else if(a.length!==undefined)b=a;else throw"Invalid selector";return new Ext.CompositeElementLite(b)};Ext.select=Ext.Element.select;Ext.apply(Ext.CompositeElementLite.prototype,{addElements:function(a,b){if(!a)return this;if(typeof a=="string")a=Ext.Element.selectorFunction(a,b);var c=this.elements;Ext.each(a,function(a){c.push(Ext.get(a))});return this},first:function(){return this.item(0)},last:function(){return this.item(this.getCount()-1)},contains:function(a){return this.indexOf(a)!=-1},removeElement:function(d,c){var e=this,b=this.elements,a;Ext.each(d,function(d){if(a=b[d]||b[d=e.indexOf(d)]){if(c)if(a.dom)a.remove();else Ext.removeNode(a);b.splice(d,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(b,a){this.elements=[];this.add(b,a)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,c,d){var b;if(typeof a=="string")b=Ext.Element.selectorFunction(a,d);else if(a.length!==undefined)b=a;else throw"Invalid selector";return c===true?new Ext.CompositeElement(b):new Ext.CompositeElementLite(b)};Ext.select=Ext.Element.select;(function(){var e="beforerequest",a="requestcomplete",d="requestexception",f=undefined,g="load",h="POST",c="GET",b=window;Ext.data.Connection=function(b){Ext.apply(this,b);this.addEvents(e,a,d);Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:3e4,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(a){var d=this;if(d.fireEvent(e,d,a)){if(a.el){if(!Ext.isEmpty(a.indicatorText))d.indicatorText='<div class="loading-indicator">'+a.indicatorText+"</div>";if(d.indicatorText)Ext.getDom(a.el).innerHTML=d.indicatorText;a.success=(Ext.isFunction(a.success)?a.success:function(){}).createInterceptor(function(b){Ext.getDom(a.el).innerHTML=b.responseText})}var g=a.params,i=a.url||d.url,j,n={success:d.handleResponse,failure:d.handleFailure,scope:d,argument:{options:a},timeout:a.timeout||d.timeout},k,l;if(Ext.isFunction(g))g=g.call(a.scope||b,a);g=Ext.urlEncode(d.extraParams,Ext.isObject(g)?Ext.urlEncode(g):g);if(Ext.isFunction(i))i=i.call(a.scope||b,a);if(k=Ext.getDom(a.form)){i=i||k.action;if(a.isUpload||/multipart\/form-data/i.test(k.getAttribute("enctype")))return d.doFormUpload.call(d,a,g,i);l=Ext.lib.Ajax.serializeForm(k);g=g?g+"&"+l:l}j=a.method||d.method||(g||a.xmlData||a.jsonData?h:c);if(j===c&&(d.disableCaching&&a.disableCaching!==false)||a.disableCaching===true){var m=a.disableCachingParam||d.disableCachingParam;i=Ext.urlAppend(i,m+"="+(new Date).getTime())}a.headers=Ext.apply(a.headers||{},d.defaultHeaders||{});(a.autoAbort===true||d.autoAbort)&&d.abort();if((j==c||a.xmlData||a.jsonData)&&g){i=Ext.urlAppend(i,g);g=""}return d.transId=Ext.lib.Ajax.request(j,i,n,g,a)}else return a.callback?a.callback.apply(a.scope,[a,f,f]):null},isLoading:function(a){return a?Ext.lib.Ajax.isCallInProgress(a):!!this.transId},abort:function(a){(a||this.isLoading())&&Ext.lib.Ajax.abort(a||this.transId)},handleResponse:function(c){this.transId=false;var b=c.argument.options;c.argument=b?b.argument:null;this.fireEvent(a,this,c,b);b.success&&b.success.call(b.scope,c,b);b.callback&&b.callback.call(b.scope,b,true,c)},handleFailure:function(b,c){this.transId=false;var a=b.argument.options;b.argument=a?a.argument:null;this.fireEvent(d,this,b,a,c);a.failure&&a.failure.call(a.scope,b,a);a.callback&&a.callback.call(a.scope,a,false,b)},doFormUpload:function(d,p,o){var f=Ext.id(),j=document,e=j.createElement("iframe"),c=Ext.getDom(d.form),l=[],i,k="multipart/form-data",m={target:c.target,method:c.method,encoding:c.encoding,enctype:c.enctype,action:c.action};Ext.fly(e).set({id:f,name:f,cls:"x-hidden",src:Ext.SSL_SECURE_URL});j.body.appendChild(e);if(Ext.isIE)document.frames[f].name=f;Ext.fly(c).set({target:f,method:h,enctype:k,encoding:k,action:o||m.action});Ext.iterate(Ext.urlDecode(p,false),function(a,b){i=j.createElement("input");Ext.fly(i).set({type:"hidden",value:b,name:a});c.appendChild(i);l.push(i)});function n(){var i=this,h={responseText:"",responseXML:null,argument:d.argument},c,k;try{c=e.contentWindow.document||e.contentDocument||b.frames[f].document;if(c){if(c.body)if(/textarea/i.test((k=c.body.firstChild||{}).tagName))h.responseText=k.value;else h.responseText=c.body.innerHTML;h.responseXML=c.XMLDocument||c}}catch(l){}Ext.EventManager.removeListener(e,g,n,i);i.fireEvent(a,i,h,d);function j(a,b,c){Ext.isFunction(a)&&a.apply(b,c)}j(d.success,d.scope,[h,d]);j(d.callback,d.scope,[d,true,h]);!i.debugUploads&&setTimeout(function(){Ext.removeNode(e)},100)}Ext.EventManager.on(e,g,n,this);c.submit();Ext.fly(c).set(m);Ext.each(l,function(a){Ext.removeNode(a)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){var b="beforeupdate",f="update",e="failure";function d(c){var b=this;b.transaction=null;if(c.argument.form&&c.argument.reset)try{c.argument.form.reset()}catch(d){}if(b.loadScripts)b.renderer.render(b.el,c,b,a.createDelegate(b,[c]));else{b.renderer.render(b.el,c,b);a.call(b,c)}}function a(a,c,b){this.fireEvent(c||f,this.el,a);Ext.isFunction(a.argument.callback)&&a.argument.callback.call(a.argument.scope,this.el,Ext.isEmpty(b)?true:false,a,a.argument.options)}function c(b){a.call(this,b,e,!!(this.transaction=null))}return {constructor:function(c,d){var a=this;c=Ext.get(c);if(!d&&c.updateManager)return c.updateManager;a.el=c;a.defaultUrl=null;a.addEvents(b,f,e);Ext.apply(a,Ext.Updater.defaults);a.transaction=null;a.refreshDelegate=a.refresh.createDelegate(a);a.updateDelegate=a.update.createDelegate(a);a.formUpdateDelegate=(a.formUpdate||function(){}).createDelegate(a);a.renderer=a.renderer||a.getDefaultRenderer();Ext.Updater.superclass.constructor.call(a)},setRenderer:function(a){this.renderer=a},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer},setDefaultUrl:function(a){this.defaultUrl=a},getEl:function(){return this.el},update:function(f,g,j,i){var e=this,a,h;if(e.fireEvent(b,e.el,f,g)!==false){if(Ext.isObject(f)){a=f;f=a.url;g=g||a.params;j=j||a.callback;i=i||a.discardUrl;h=a.scope;if(!Ext.isEmpty(a.nocache))e.disableCaching=a.nocache;if(!Ext.isEmpty(a.text))e.indicatorText='<div class="loading-indicator">'+a.text+"</div>";if(!Ext.isEmpty(a.scripts))e.loadScripts=a.scripts;if(!Ext.isEmpty(a.timeout))e.timeout=a.timeout}e.showLoading();if(!i)e.defaultUrl=f;if(Ext.isFunction(f))f=f.call(e);var k=Ext.apply({},{url:f,params:Ext.isFunction(g)&&h?g.createDelegate(h):g,success:d,failure:c,scope:e,callback:undefined,timeout:e.timeout*1e3,disableCaching:e.disableCaching,argument:{options:a,url:f,form:null,callback:j,scope:h||window,params:g}},a);e.transaction=Ext.Ajax.request(k)}},formUpdate:function(f,e,h,g){var a=this;if(a.fireEvent(b,a.el,f,e)!==false){if(Ext.isFunction(e))e=e.call(a);f=Ext.getDom(f);a.transaction=Ext.Ajax.request({form:f,url:e,success:d,failure:c,scope:a,timeout:a.timeout*1e3,argument:{url:e,form:f,callback:g,reset:h}});a.showLoading.defer(1,a)}},startAutoRefresh:function(f,d,c,b,e){var a=this;e&&a.update(d||a.defaultUrl,c,b,true);a.autoRefreshProcId&&clearInterval(a.autoRefreshProcId);a.autoRefreshProcId=setInterval(a.update.createDelegate(a,[d||a.defaultUrl,c,b,true]),f*1e3)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return !!this.autoRefreshProcId},showLoading:function(){if(this.showLoadIndicator)this.el.dom.innerHTML=this.indicatorText},abort:function(){this.transaction&&Ext.Ajax.abort(this.transaction)},isUpdating:function(){return this.transaction?Ext.Ajax.isLoading(this.transaction):false},refresh:function(a){this.defaultUrl&&this.update(this.defaultUrl,null,a,true)}}}());Ext.Updater.defaults={timeout:30,disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>',loadScripts:false,sslBlankUrl:Ext.SSL_SECURE_URL};Ext.Updater.updateElement=function(e,d,c,a){var b=Ext.get(e).getUpdater();Ext.apply(b,a);b.update(d,c,a?a.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(d,c,a,b){d.update(c.responseText,a.loadScripts,b)}};(function(){Date.useStrict=false;function b(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/\{(\d+)\}/g,function(c,a){return b[a]})}Date.formatCodeToRegex=function(c,d){var a=Date.parseCodes[c];if(a){a=typeof a=="function"?a():a;Date.parseCodes[c]=a}return a?Ext.applyIf({c:a.c?b(a.c,d||"{0}"):a.c},a):{g:0,c:null,s:Ext.escapeRe(c)}};var a=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{M$:function(b){var c=new RegExp("\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/"),a=(b||"").match(c);return a?new Date(((a[1]||"")+a[2])*1):null}},parseRegexes:[],formatFunctions:{M$:function(){return "\\/Date("+this.getTime()+")\\/"}},y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",defaults:{},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],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},getShortMonthName:function(a){return Date.monthNames[a].substring(0,3)},getShortDayName:function(a){return Date.dayNames[a].substring(0,3)},getMonthNumber:function(a){return Date.monthNumbers[a.substring(0,1).toUpperCase()+a.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var c="Y-m-dTH:i:sP",b=[],a=0,e=c.length;a<e;++a){var d=c.charAt(a);b.push(d=="T"?"'T'":Date.getFormatCode(d))}return b.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(h,g,f,c,d,e,b){c=c||0;d=d||0;e=e||0;b=b||0;var a=new Date(h,g-1,f,c,d,e,b);return h==a.getFullYear()&&g==a.getMonth()+1&&f==a.getDate()&&c==a.getHours()&&d==a.getMinutes()&&e==a.getSeconds()&&b==a.getMilliseconds()},parseDate:function(d,a,b){var c=Date.parseFunctions;c[a]==null&&Date.createParser(a);return c[a](d,Ext.isDefined(b)?b:Date.useStrict)},getFormatCode:function(b){var a=Date.formatCodes[b];if(a){a=typeof a=="function"?a():a;Date.formatCodes[b]=a}return a||"'"+String.escape(b)+"'"},createFormat:function(c){for(var d=[],a=false,b="",e=0;e<c.length;++e){b=c.charAt(e);if(!a&&b=="\\")a=true;else if(a){a=false;d.push("'"+String.escape(b)+"'")}else d.push(Date.getFormatCode(b))}Date.formatFunctions[c]=new Function("return "+d.join("+"))},createParser:function(){var c=["var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,","def = Date.defaults,","results = String(input).match(Date.parseRegexes[{0}]);","if(results){","{1}","if(u != null){","v = new Date(u * 1000);","}else{","dt = (new Date()).clearTime();","y = Ext.num(y, Ext.num(def.y, dt.getFullYear()));","m = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));","d = Ext.num(d, Ext.num(def.d, dt.getDate()));","h  = Ext.num(h, Ext.num(def.h, dt.getHours()));","i  = Ext.num(i, Ext.num(def.i, dt.getMinutes()));","s  = Ext.num(s, Ext.num(def.s, dt.getSeconds()));","ms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));","if(z >= 0 && y >= 0){","v = new Date(y, 0, 1, h, i, s, ms);","v = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);","}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){","v = null;","}else{","v = new Date(y, m, d, h, i, s, ms);","}","}","}","if(v){","if(zz != null){","v = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);","}else if(o){","v = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));","}","}","return v;"].join("\n");return function(g){for(var k=Date.parseRegexes.length,j=1,l=[],h=[],e=false,f="",i=0;i<g.length;++i){f=g.charAt(i);if(!e&&f=="\\")e=true;else if(e){e=false;h.push(String.escape(f))}else{var d=a(f,j);j+=d.g;h.push(d.s);d.g&&d.c&&l.push(d.c)}}Date.parseRegexes[k]=new RegExp("^"+h.join("")+"$");Date.parseFunctions[g]=new Function("input","strict",b(c,k,l.join("")))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var b=[],a=0;a<7;b.push(Date.getShortDayName(a)),++a);return {g:0,c:null,s:"(?:"+b.join("|")+")"}},l:function(){return {g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:1,c:"z = parseInt(results[{0}], 10);\n",s:"(\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return {g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var c=[],b=0;b<12;c.push(Date.getShortMonthName(b)),++b);return Ext.applyIf({s:"("+c.join("|")+")"},a("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return a("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM)"},g:function(){return a("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return a("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),","mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1),","hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),","mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"zz = results[{0}] * 1;\nzz = (-43200 <= zz && zz <= 50400)? zz : null;\n",s:"([+-]?\\d{1,5})"},c:function(){for(var d=[],b=[a("Y",1),a("m",2),a("d",3),a("h",4),a("i",5),a("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {","if(results[8] == 'Z'){","zz = 0;","}else if (results[8].indexOf(':') > -1){",a("P",8).c,"}else{",a("O",8).c,"}","}"].join("\n")}],c=0,e=b.length;c<e;++c)d.push(b[c].c);return {g:1,c:d.join(""),s:[b[0].s,"(?:","-",b[1].s,"(?:","-",b[2].s,"(?:","(?:T| )?",b[3].s,":",b[4].s,"(?::",b[5].s,")?","(?:(?:\\.|,)(\\d+))?","(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",")?",")?",")?"].join("")}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})})();Ext.apply(Date.prototype,{dateFormat:function(a){Date.formatFunctions[a]==null&&Date.createFormat(a);return Date.formatFunctions[a].call(this)},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(a){return (this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(a?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var c=0,a=this.clone(),d=this.getMonth(),b;for(b=0,a.setDate(1),a.setMonth(0);b<d;a.setMonth(++b))c+=a.getDaysInMonth();return c+this.getDate()-1},getWeekOfYear:function(){var a=8.64e7,b=7*a;return function(){var d=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/a,c=Math.floor(d/7),e=(new Date(c*b)).getUTCFullYear();return c-Math.floor(Date.UTC(e,0,7)/b)+1}}(),isLeapYear:function(){var a=this.getFullYear();return !!((a&3)==0&&(a%100||a%400==0&&a))},getFirstDayOfMonth:function(){var a=(this.getDay()-(this.getDate()-1))%7;return a<0?a+7:a},getLastDayOfMonth:function(){return this.getLastDateOfMonth().getDay()},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){var a=[31,28,31,30,31,30,31,31,30,31,30,31];return function(){var b=this.getMonth();return b==1&&this.isLeapYear()?29:a[b]}}(),getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return "st";case 2:case 22:return "nd";case 3:case 23:return "rd";default:return "th"}},clone:function(){return new Date(this.getTime())},isDST:function(){return (new Date(this.getFullYear(),0,1)).getTimezoneOffset()!=this.getTimezoneOffset()},clearTime:function(d){if(d)return this.clone().clearTime();var c=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=c){for(var a=1,b=this.add(Date.HOUR,a);b.getDate()!=c;a++,b=this.add(Date.HOUR,a));this.setDate(c);this.setHours(b.getHours())}return this},add:function(d,b){var a=this.clone();if(!d||b===0)return a;switch(d.toLowerCase()){case Date.MILLI:a.setMilliseconds(this.getMilliseconds()+b);break;case Date.SECOND:a.setSeconds(this.getSeconds()+b);break;case Date.MINUTE:a.setMinutes(this.getMinutes()+b);break;case Date.HOUR:a.setHours(this.getHours()+b);break;case Date.DAY:a.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());a.setDate(c);a.setMonth(this.getMonth()+b);break;case Date.YEAR:a.setFullYear(this.getFullYear()+b)}return a},between:function(b,c){var a=this.getTime();return b.getTime()<=a&&a<=c.getTime()}});Date.prototype.format=Date.prototype.dateFormat;Ext.isSafari&&(navigator.userAgent.match(/WebKit\/(\d+)/)[1]||NaN)<420&&Ext.apply(Date.prototype,{_xMonth:Date.prototype.setMonth,_xDate:Date.prototype.setDate,setMonth:function(a){if(a<=-1){var b=Math.ceil(-a),c=Math.ceil(b/12),d=b%12?12-b%12:0;this.setFullYear(this.getFullYear()-c);return this._xMonth(d)}else return this._xMonth(a)},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*8.64e7)}});Ext.util.MixedCollection=function(b,a){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=b===true;if(a)this.getKey=a;Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(a,b){if(arguments.length==1){b=arguments[0];a=this.getKey(b)}if(typeof a!="undefined"&&a!==null){var c=this.map[a];if(typeof c!="undefined")return this.replace(a,b);this.map[a]=b}this.length++;this.items.push(b);this.keys.push(a);this.fireEvent("add",this.length-1,b,a);return b},getKey:function(a){return a.id},replace:function(a,b){if(arguments.length==1){b=arguments[0];a=this.getKey(b)}var c=this.map[a];if(typeof a=="undefined"||a===null||typeof c=="undefined")return this.add(a,b);var d=this.indexOfKey(a);this.items[d]=b;this.map[a]=b;this.fireEvent("replace",a,c,b);return b},addAll:function(a){if(arguments.length>1||Ext.isArray(a))for(var d=arguments.length>1?arguments:a,c=0,e=d.length;c<e;c++)this.add(d[c]);else for(var b in a)(this.allowFunctions||typeof a[b]!="function")&&this.add(b,a[b])},each:function(e,d){for(var b=[].concat(this.items),a=0,c=b.length;a<c;a++)if(e.call(d||b[a],b[a],a,c)===false)break},eachKey:function(d,c){for(var a=0,b=this.keys.length;a<b;a++)d.call(c||window,this.keys[a],this.items[a],a,b)},find:function(d,b){for(var a=0,c=this.items.length;a<c;a++)if(d.call(b||window,this.items[a],this.keys[a]))return this.items[a];return null},insert:function(c,a,b){if(arguments.length==2){b=arguments[1];a=this.getKey(b)}if(this.containsKey(a)){this.suspendEvents();this.removeKey(a);this.resumeEvents()}if(c>=this.length)return this.add(a,b);this.length++;this.items.splice(c,0,b);if(typeof a!="undefined"&&a!==null)this.map[a]=b;this.keys.splice(c,0,a);this.fireEvent("add",c,b,a);return b},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var c=this.items[a];this.items.splice(a,1);var b=this.keys[a];if(typeof b!="undefined")delete this.map[b];this.keys.splice(a,1);this.fireEvent("remove",c,b);return c}return false},removeKey:function(a){return this.removeAt(this.indexOfKey(a))},getCount:function(){return this.length},indexOf:function(a){return this.items.indexOf(a)},indexOfKey:function(a){return this.keys.indexOf(a)},item:function(a){var c=this.map[a],b=c!==undefined?c:typeof a=="number"?this.items[a]:undefined;return typeof b!="function"||this.allowFunctions?b:null},itemAt:function(a){return this.items[a]},key:function(a){return this.map[a]},contains:function(a){return this.indexOf(a)!=-1},containsKey:function(a){return typeof this.map[a]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(f,h,e){var a,c,i=String(h).toUpperCase()=="DESC"?-1:1,b=[],g=this.keys,d=this.items;e=e||function(a,b){return a-b};for(a=0,c=d.length;a<c;a++)b[b.length]={key:g[a],value:d[a],index:a};b.sort(function(b,c){var a=e(b[f],c[f])*i;if(a===0)a=b.index<c.index?-1:1;return a});for(a=0,c=b.length;a<c;a++){d[a]=b[a].value;g[a]=b[a].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(c){this.suspendEvents();var d=this.items,a=0,f=d.length,b=[],e=[];for(oldIndex in c)b[c[oldIndex]]=d[oldIndex];for(a=0;a<f;a++)c[a]==undefined&&e.push(d[a]);for(a=0;a<f;a++)if(b[a]==undefined)b[a]=e.shift();this.clear();this.addAll(b);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(c,d){var a=String(c).toUpperCase(),b=String(d).toUpperCase();return a>b?1:a<b?-1:0})},getRange:function(c,b){var e=this.items;if(e.length<1)return [];c=c||0;b=Math.min(typeof b=="undefined"?this.length-1:b,this.length-1);var a,d=[];if(c<=b)for(a=c;a<=b;a++)d[d.length]=e[a];else for(a=c;a>=b;a--)d[d.length]=e[a];return d},filter:function(d,a,c,b){if(Ext.isEmpty(a,false))return this.clone();a=this.createValueMatcher(a,c,b);return this.filterBy(function(b){return b&&a.test(b[d])})},filterBy:function(g,e){var c=new Ext.util.MixedCollection;c.getKey=this.getKey;for(var d=this.keys,b=this.items,a=0,f=b.length;a<f;a++)g.call(e||this,b[a],d[a])&&c.add(d[a],b[a]);return c},findIndex:function(d,a,e,c,b){if(Ext.isEmpty(a,false))return -1;a=this.createValueMatcher(a,c,b);return this.findIndexBy(function(b){return b&&a.test(b[d])},null,e)},findIndexBy:function(f,c,d){for(var g=this.keys,b=this.items,a=d||0,e=b.length;a<e;a++)if(f.call(c||this,b[a],g[a]))return a;return -1},createValueMatcher:function(a,e,c,d){if(!a.exec){var b=Ext.escapeRe;a=String(a);if(e===true)a=b(a);else{a="^"+b(a);if(d===true)a+="$"}a=new RegExp(a,c?"":"i")}return a},clone:function(){for(var b=new Ext.util.MixedCollection,e=this.keys,c=this.items,a=0,d=c.length;a<d;a++)b.add(e[a],c[a]);b.getKey=this.getKey;return b}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.util.JSON=new function(){var useHasOwn=!!{}.hasOwnProperty,isNative=function(){var a=null;return function(){if(a===null)a=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]";return a}}(),pad=function(a){return a<10?"0"+a:a},doDecode=function(json){return eval("("+json+")")},doEncode=function(a){if(!Ext.isDefined(a)||a===null)return "null";else if(Ext.isArray(a))return encodeArray(a);else if(Ext.isDate(a))return Ext.util.JSON.encodeDate(a);else if(Ext.isString(a))return encodeString(a);else if(typeof a=="number")return isFinite(a)?String(a):"null";else if(Ext.isBoolean(a))return String(a);else{var b=["{"],e,c,d;for(c in a)if(!a.getElementsByTagName)if(!useHasOwn||a.hasOwnProperty(c)){d=a[c];switch(typeof d){case "undefined":case "function":case "unknown":break;default:e&&b.push(",");b.push(doEncode(c),":",d===null?"null":doEncode(d));e=true}}b.push("}");return b.join("")}},m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(a){if(/["\\\x00-\x1f]/.test(a))return '"'+a.replace(/([\x00-\x1f\\"])/g,function(c,b){var a=m[b];if(a)return a;a=b.charCodeAt();return "\\u00"+Math.floor(a/16).toString(16)+(a%16).toString(16)})+'"';return '"'+a+'"'},encodeArray=function(e){for(var a=["["],d,f=e.length,b,c=0;c<f;c+=1){b=e[c];switch(typeof b){case "undefined":case "function":case "unknown":break;default:d&&a.push(",");a.push(b===null?"null":Ext.util.JSON.encode(b));d=true}}a.push("]");return a.join("")};this.encodeDate=function(a){return '"'+a.getFullYear()+"-"+pad(a.getMonth()+1)+"-"+pad(a.getDate())+"T"+pad(a.getHours())+":"+pad(a.getMinutes())+":"+pad(a.getSeconds())+'"'};this.encode=function(){var a;return function(b){if(!a)a=isNative()?JSON.stringify:doEncode;return a(b)}}();this.decode=function(){var a;return function(b){if(!a)a=isNative()?JSON.parse:doDecode;return a(b)}}()};Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g,stripTagsRE=/<\/?[^>]+>/gi,stripScriptsRe=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,nl2brRe=/\r?\n/g;return {ellipsis:function(a,b,e){if(a&&a.length>b)if(e){var c=a.substr(0,b-2),d=Math.max(c.lastIndexOf(" "),c.lastIndexOf("."),c.lastIndexOf("!"),c.lastIndexOf("?"));if(d==-1||d<b-15)return a.substr(0,b-3)+"...";else return c.substr(0,d)+"..."}else return a.substr(0,b-3)+"...";return a},undef:function(a){return a!==undefined?a:""},defaultValue:function(a,b){return a!==undefined&&a!==""?a:b},htmlEncode:function(a){return !a?a:String(a).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(a){return !a?a:String(a).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(a){return String(a).replace(trimRe,"")},substr:function(c,b,a){return String(c).substr(b,a)},lowercase:function(a){return String(a).toLowerCase()},uppercase:function(a){return String(a).toUpperCase()},capitalize:function(a){return !a?a:a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return (eval(fn)).apply(window,args)}else return (eval(fn)).call(window,value)},usMoney:function(a){a=Math.round((a-0)*100)/100;a=a==Math.floor(a)?a+".00":a*10==Math.floor(a*10)?a+"0":a;a=String(a);var c=a.split("."),b=c[0],e=c[1]?"."+c[1]:".00",d=/(\d+)(\d{3})/;while(d.test(b))b=b.replace(d,"$1,$2");a=b+e;if(a.charAt(0)=="-")return "-$"+a.substr(1);return "$"+a},date:function(a,b){if(!a)return "";if(!Ext.isDate(a))a=new Date(Date.parse(a));return a.dateFormat(b||"m/d/Y")},dateRenderer:function(a){return function(b){return Ext.util.Format.date(b,a)}},stripTags:function(a){return !a?a:String(a).replace(stripTagsRE,"")},stripScripts:function(a){return !a?a:String(a).replace(stripScriptsRe,"")},fileSize:function(a){if(a<1024)return a+" bytes";else if(a<1048576)return Math.round(a*10/1024)/10+" KB";else return Math.round(a*10/1048576)/10+" MB"},math:function(){var a={};return function(c,b){if(!a[b])a[b]=new Function("v","return v "+b+";");return a[b](c)}}(),round:function(c,a){var b=Number(c);if(typeof a=="number"){a=Math.pow(10,a);b=Math.round(c*a)/a}return b},number:function(a,b){if(!b)return a;a=Ext.num(a,NaN);if(isNaN(a))return "";var g=",",e=".",k=false,n=a<0;a=Math.abs(a);if(b.substr(b.length-2)=="/i"){b=b.substr(0,b.length-2);k=true;g=".";e=","}var m=b.indexOf(g)!=-1,c=(k?b.replace(/[^\d\,]/g,""):b.replace(/[^\d\.]/g,"")).split(e);if(1<c.length)a=a.toFixed(c[1].length);else if(2<c.length)throw"NumberFormatException: invalid format, formats should have no more than 1 period: "+b;else a=a.toFixed(0);var d=a.toString();c=d.split(".");if(m){for(var h=c[0],i=[],l=h.length,o=Math.floor(l/3),j=h.length%3||3,f=0;f<l;f+=j){if(f!=0)j=3;i[i.length]=h.substr(f,j);o-=1}d=i.join(g);if(c[1])d+=e+c[1]}else if(c[1])d=c[0]+e+c[1];return (n?"-":"")+b.replace(/[\d,?\.?]+/,d)},numberRenderer:function(a){return function(b){return Ext.util.Format.number(b,a)}},plural:function(c,b,a){return c+" "+(c==1?b:a?a:b+"s")},nl2br:function(a){return Ext.isEmpty(a)?"":a.replace(nl2brRe,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var l=this,h=l.html,w=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,u=/^<tpl\b[^>]*?for="(.*?)"/,v=/^<tpl\b[^>]*?if="(.*?)"/,t=/^<tpl\b[^>]*?exec="(.*?)"/,f,m=0,d=[],c="values",b="parent",q="xindex",p="xcount",i="return ",g="with(values){ ";h=["<tpl>",h,"</tpl>"].join("");while(f=h.match(w)){var n=f[0].match(u),j=f[0].match(v),k=f[0].match(t),e=null,s=null,r=null,a=n&&n[1]?n[1]:"";if(j){e=j&&j[1]?j[1]:null;if(e)s=new Function(c,b,q,p,g+i+Ext.util.Format.htmlDecode(e)+"; }")}if(k){e=k&&k[1]?k[1]:null;if(e)r=new Function(c,b,q,p,g+Ext.util.Format.htmlDecode(e)+"; }")}if(a)switch(a){case ".":a=new Function(c,b,g+i+c+"; }");break;case "..":a=new Function(c,b,g+i+b+"; }");break;default:a=new Function(c,b,g+i+a+"; }")}d.push({id:m,target:a,exec:r,test:s,body:f[1]||""});h=h.replace(f[0],"{xtpl"+m+"}");++m}for(var o=d.length-1;o>=0;--o)l.compileTpl(d[o]);l.master=d[d.length-1];l.tpls=d};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(k,e,b,h,g){var c=this,j,a=c.tpls[k],d,i=[];if(a.test&&!a.test.call(c,e,b,h,g)||a.exec&&a.exec.call(c,e,b,h,g))return "";d=a.target?a.target.call(c,e,b):e;j=d.length;b=a.target?e:b;if(a.target&&Ext.isArray(d)){for(var f=0,j=d.length;f<j;f++)i[i.length]=a.compiled.call(c,d[f],b,f+1,j);return i.join("")}return a.compiled.call(c,d,b,h,g)},compileTpl:function(tpl){var fm=Ext.util.Format,useF=this.disableFormats!==true,sep=Ext.isGecko?"+":",",body;function fn(f,c,a,d,e){if(c.substr(0,4)=="xtpl")return "'"+sep+"this.applySubTemplate("+c.substr(4)+", values, parent, xindex, xcount)"+sep+"'";var b;if(c===".")b="values";else if(c==="#")b="xindex";else if(c.indexOf(".")!=-1)b=c;else b="values['"+c+"']";if(e)b="("+b+e+")";if(a&&useF){d=d?","+d:"";if(a.substr(0,5)!="this.")a="fm."+a+"(";else{a='this.call("'+a.substr(5)+'", ';d=", values"}}else{d="";a="("+b+" === undefined ? '' : "}return "'"+sep+a+b+d+")"+sep+"'"}function codeFn(b,a){return "'"+sep+"("+a.replace(/\\'/g,"'")+")"+sep+"'"}if(Ext.isGecko)body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};";else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(a){return this.master.compiled.call(this,a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(a){a=Ext.getDom(a);return new Ext.XTemplate(a.value||a.innerHTML)};Ext.util.CSS=function(){var b=null,a=document,d=/(-[a-z])/gi,c=function(b,a){return a.charAt(1).toUpperCase()};return {createStyleSheet:function(d,f){var c,e=a.getElementsByTagName("head")[0],b=a.createElement("style");b.setAttribute("type","text/css");f&&b.setAttribute("id",f);if(Ext.isIE){e.appendChild(b);c=b.styleSheet;c.cssText=d}else{try{b.appendChild(a.createTextNode(d))}catch(g){b.cssText=d}e.appendChild(b);c=b.styleSheet?b.styleSheet:b.sheet||a.styleSheets[a.styleSheets.length-1]}this.cacheStyleSheet(c);return c},removeStyleSheet:function(c){var b=a.getElementById(c);b&&b.parentNode.removeChild(b)},swapStyleSheet:function(c,d){this.removeStyleSheet(c);var b=a.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("id",c);b.setAttribute("href",d);a.getElementsByTagName("head")[0].appendChild(b)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(d){if(!b)b={};try{for(var c=d.cssRules||d.rules,a=c.length-1;a>=0;--a)b[c[a].selectorText.toLowerCase()]=c[a]}catch(e){}},getRules:function(e){if(b===null||e){b={};for(var d=a.styleSheets,c=0,f=d.length;c<f;c++)try{this.cacheStyleSheet(d[c])}catch(g){}}return b},getRule:function(a,d){var c=this.getRules(d);if(!Ext.isArray(a))return c[a.toLowerCase()];for(var b=0;b<a.length;b++)if(c[a[b]])return c[a[b].toLowerCase()];return null},updateRule:function(a,e,f){if(!Ext.isArray(a)){var g=this.getRule(a);if(g){g.style[e.replace(d,c)]=f;return true}}else for(var b=0;b<a.length;b++)if(this.updateRule(a[b],e,f))return true;return false}}}();Ext.util.ClickRepeater=function(b,a){this.el=Ext.get(b);this.el.unselectable();Ext.apply(this,a);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}this.handler&&this.on("click",this.handler,this.scope||this);Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,enable:function(){if(this.disabled){this.el.on("mousedown",this.handleMouseDown,this);Ext.isIE&&this.el.on("dblclick",this.handleDblClick,this);(this.preventDefault||this.stopDefault)&&this.el.on("click",this.eventOptions,this)}this.disabled=false},disable:function(a){if(a||!this.disabled){clearTimeout(this.timer);this.pressClass&&this.el.removeClass(this.pressClass);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeAllListeners()}this.disabled=true},setDisabled:function(a){this[a?"disable":"enable"]()},eventOptions:function(a){this.preventDefault&&a.preventDefault();this.stopDefault&&a.stopEvent()},destroy:function(){this.disable(true);Ext.destroy(this.el);this.purgeListeners()},handleDblClick:function(){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this);this.fireEvent("click",this)},handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();this.pressClass&&this.el.addClass(this.pressClass);this.mousedownTime=new Date;Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);if(this.accelerate)this.delay=400;this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this)},easeOutExpo:function(d,a,b,c){return d==c?a+b:b*(-Math.pow(2,-10*d/c)+1)+a},handleMouseOut:function(){clearTimeout(this.timer);this.pressClass&&this.el.removeClass(this.pressClass);this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);this.pressClass&&this.el.addClass(this.pressClass);this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});Ext.KeyNav=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(b){var c=b.getKey(),a=this.keyToHandler[c];if(a&&this[a])this.doRelay(b,this[a],a)!==true&&b[this.defaultEventAction]()},doRelay:function(a,b){return b.call(this.scope||this,a)},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"},stopKeyUp:function(a){var b=a.getKey();b>=37&&b<=40&&a.stopEvent()},destroy:function(){this.disable()},enable:function(){if(this.disabled){Ext.isSafari2&&this.el.on("keyup",this.stopKeyUp,this);this.el.on(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=false}},disable:function(){if(!this.disabled){Ext.isSafari2&&this.el.un("keyup",this.stopKeyUp,this);this.el.un(this.isKeydown()?"keydown":"keypress",this.relay,this);this.disabled=true}},setDisabled:function(a){this[a?"disable":"enable"]()},isKeydown:function(){return this.forceKeyDown||Ext.EventManager.useKeydown}};Ext.KeyMap=function(c,a,b){this.el=Ext.get(c);this.eventName=b||"keydown";this.bindings=[];a&&this.addBinding(a);this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(a){if(Ext.isArray(a)){Ext.each(a,function(a){this.addBinding(a)},this);return}var b=a.key,f=a.fn||a.handler,e=a.scope;if(a.stopEvent)this.stopEvent=a.stopEvent;if(typeof b=="string"){for(var g=[],d=b.toUpperCase(),c=0,j=d.length;c<j;c++)g.push(d.charCodeAt(c));b=g}var h=Ext.isArray(b),i=function(c){if(this.checkModifiers(a,c)){var d=c.getKey();if(h){for(var g=0,i=b.length;g<i;g++)if(b[g]==d){this.stopEvent&&c.stopEvent();f.call(e||window,d,c);return}}else if(d==b){this.stopEvent&&c.stopEvent();f.call(e||window,d,c)}}};this.bindings.push(i)},checkModifiers:function(e,g){for(var b,a,d=["shift","ctrl","alt"],c=0,f=d.length;c<f;++c){a=d[c];b=e[a];if(!(b===undefined||b===g[a+"Key"]))return false}return true},on:function(a,g,f){var b,c,d,e;if(typeof a=="object"&&!Ext.isArray(a)){b=a.key;c=a.shift;d=a.ctrl;e=a.alt}else b=a;this.addBinding({key:b,shift:c,ctrl:d,alt:e,fn:g,scope:f})},handleKeyDown:function(d){if(this.enabled)for(var b=this.bindings,a=0,c=b.length;a<c;a++)b[a].call(this,d)},isEnabled:function(){return this.enabled},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}},setDisabled:function(a){this[a?"disable":"enable"]()}};Ext.util.TextMetrics=function(){var a;return {measure:function(c,d,b){if(!a)a=Ext.util.TextMetrics.Instance(c,b);a.bind(c);a.setFixedWidth(b||"auto");return a.getSize(d)},createInstance:function(b,a){return Ext.util.TextMetrics.Instance(b,a)}}}();Ext.util.TextMetrics.Instance=function(d,b){var a=new Ext.Element(document.createElement("div"));document.body.appendChild(a.dom);a.position("absolute");a.setLeftTop(-1e3,-1e3);a.hide();b&&a.setWidth(b);var c={getSize:function(b){a.update(b);var c=a.getSize();a.update("");return c},bind:function(b){a.setStyle(Ext.fly(b).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(b){a.setWidth(b)},getWidth:function(b){a.dom.style.width="auto";return this.getSize(b).width},getHeight:function(a){return this.getSize(a).height}};c.bind(d);return c};Ext.Element.addMethods({getTextWidth:function(a,c,b){return Ext.util.TextMetrics.measure(this.dom,Ext.value(a,this.dom.innerHTML,true)).width.constrain(c||0,b||1e6)}});Ext.util.Cookies={"set":function(h,g){var b=arguments,a=arguments.length,c=a>2?b[2]:null,e=a>3?b[3]:"/",d=a>4?b[4]:null,f=a>5?b[5]:false;document.cookie=h+"="+escape(g)+(c===null?"":"; expires="+c.toGMTString())+(e===null?"":"; path="+e)+(d===null?"":"; domain="+d)+(f===true?"; secure":"")},"get":function(f){var c=f+"=",d=c.length,e=document.cookie.length,a=0,b=0;while(a<e){b=a+d;if(document.cookie.substring(a,b)==c)return Ext.util.Cookies.getCookieVal(b);a=document.cookie.indexOf(" ",a)+1;if(a===0)break}return null},clear:function(a){if(Ext.util.Cookies.get(a))document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"},getCookieVal:function(b){var a=document.cookie.indexOf(";",b);if(a==-1)a=document.cookie.length;return unescape(document.cookie.substring(b,a))}};Ext.handleError=function(a){throw a};Ext.Error=function(a){this.message=this.lang[a]?this.lang[a]:a};Ext.Error.prototype=new Error;Ext.apply(Ext.Error.prototype,{lang:{},name:"Ext.Error",getName:function(){return this.name},getMessage:function(){return this.message},toJson:function(){return Ext.encode(this)}});Ext.ComponentMgr=function(){var a=new Ext.util.MixedCollection,c={},b={};return {register:function(b){a.add(b)},unregister:function(b){a.remove(b)},"get":function(b){return a.get(b)},onAvailable:function(d,c,b){a.on("add",function(f,e){if(e.id==d){c.call(b||e,e);a.un("add",c,b)}})},all:a,types:c,ptypes:b,isRegistered:function(a){return c[a]!==undefined},isPluginRegistered:function(a){return b[a]!==undefined},registerType:function(a,b){c[a]=b;b.xtype=a},create:function(a,b){return a.render?a:new c[a.xtype||b](a)},registerPlugin:function(a,c){b[a]=c;c.ptype=a},createPlugin:function(c,d){var a=b[c.ptype||d];if(a.init)return a;else return new a(c)}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(a){a=a||{};if(a.initialConfig){if(a.isAction)this.baseAction=a;a=a.initialConfig}else if(a.tagName||a.dom||Ext.isString(a))a={applyTo:a,id:a.id||a};this.initialConfig=a;Ext.apply(this,a);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);this.baseAction&&this.baseAction.addComponent(this);this.initComponent();if(this.plugins)if(Ext.isArray(this.plugins))for(var b=0,c=this.plugins.length;b<c;b++)this.plugins[b]=this.initPlugin(this.plugins[b]);else this.plugins=this.initPlugin(this.plugins);this.stateful!==false&&this.initState();if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else if(this.renderTo){this.render(this.renderTo);delete this.renderTo}};Ext.Component.AUTO_ID=1e3;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(a){if(a.ptype&&!Ext.isFunction(a.init))a=Ext.ComponentMgr.createPlugin(a);else if(Ext.isString(a))a=Ext.ComponentMgr.createPlugin({ptype:a});a.init(this);return a},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(c,a){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!c&&this.el){this.el=Ext.get(this.el);c=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(c);this.ctCls&&this.container.addClass(this.ctCls);this.rendered=true;if(a!==undefined)if(Ext.isNumber(a))a=this.container.dom.childNodes[a];else a=Ext.getDom(a);this.onRender(this.container,a||null);this.autoShow&&this.el.removeClass(["x-hidden","x-hide-"+this.hideMode]);if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}this.overCls&&this.el.addClassOnOver(this.overCls);this.fireEvent("render",this);var b=this.getContentTarget();if(this.html){b.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var d=Ext.getDom(this.contentEl);Ext.fly(d).removeClass(["x-hidden","x-hide-display"]);b.appendChild(d)}if(this.tpl){if(!this.tpl.compile)this.tpl=new Ext.XTemplate(this.tpl);if(this.data){this.tpl[this.tplWriteMode](b,this.data);delete this.data}}this.afterRender(this.container);this.hidden&&this.doHide();this.disabled&&this.disable(true);this.stateful!==false&&this.initStateEvents();this.fireEvent("afterrender",this)}return this},update:function(a,c,e){var b=this.getContentTarget();if(this.tpl&&typeof a!=="string")this.tpl[this.tplWriteMode](b,a||{});else{var d=Ext.isObject(a)?Ext.DomHelper.markup(a):a;b.update(d,c,e)}},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.fireEvent("added",this,a,b)},onRemoved:function(){this.removeRef();this.fireEvent("removed",this,this.ownerCt);delete this.ownerCt},initRef:function(){if(this.ref&&!this.refOwner){var c=this.ref.split("/"),d=c.length,b=0,a=this;while(a&&b<d){a=a.ownerCt;++b}if(a){a[this.refName=c[--b]]=this;this.refOwner=a}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var b=this.getStateId();if(b){var a=Ext.state.Manager.get(b);if(a)if(this.fireEvent("beforestaterestore",this,a)!==false){this.applyState(Ext.apply({},a));this.fireEvent("staterestore",this,a)}}}},getStateId:function(){return this.stateId||(/^(ext-comp-|ext-gen)/.test(String(this.id))?null:this.id)},initStateEvents:function(){if(this.stateEvents)for(var b=0,a;a=this.stateEvents[b];b++)this.on(a,this.saveState,this,{delay:100})},applyState:function(a){a&&Ext.apply(this,a)},getState:function(){return null},saveState:function(){if(Ext.state.Manager&&this.stateful!==false){var b=this.getStateId();if(b){var a=this.getState();if(this.fireEvent("beforestatesave",this,a)!==false){Ext.state.Manager.set(b,a);this.fireEvent("statesave",this,a)}}}},applyToMarkup:function(a){this.allowDomMove=false;this.el=Ext.get(a);this.render(this.el.dom.parentNode)},addClass:function(a){if(this.el)this.el.addClass(a);else this.cls=this.cls?this.cls+" "+a:a;return this},removeClass:function(a){if(this.el)this.el.removeClass(a);else if(this.cls)this.cls=this.cls.split(" ").remove(a).join(" ");return this},onRender:function(c,b){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl))this.el=document.createElement(this.autoEl);else{var a=document.createElement("div");Ext.DomHelper.overwrite(a,this.autoEl);this.el=a.firstChild}if(!this.el.id)this.el.id=this.getId()}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){c.dom.insertBefore(this.el.dom,b);if(a){Ext.removeNode(a);a=null}}}},getAutoCreate:function(){var a=Ext.isObject(this.autoCreate)?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!a.id)a.id=this.id;return a},afterRender:Ext.emptyFn,destroy:function(){if(!this.isDestroyed)if(this.fireEvent("beforedestroy",this)!==false){this.destroying=true;this.beforeDestroy();this.ownerCt&&this.ownerCt.remove&&this.ownerCt.remove(this,false);if(this.rendered){this.el.remove();(this.actionMode=="container"||this.removeMode=="container")&&this.container.remove()}this.focusTask&&this.focusTask.cancel&&this.focusTask.cancel();this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners();this.destroying=false;this.isDestroyed=true}},deleteMembers:function(){for(var b=arguments,a=0,c=b.length;a<c;++a)delete this[b[a]]},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getContentTarget:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+ ++Ext.Component.AUTO_ID)},getItemId:function(){return this.itemId||this.getId()},focus:function(b,a){if(a){this.focusTask=new Ext.util.DelayedTask(this.focus,this,[b,false]);this.focusTask.delay(Ext.isNumber(a)?a:10);return}if(this.rendered&&!this.isDestroyed){this.el.focus();b===true&&this.el.dom.select()}return this},blur:function(){this.rendered&&this.el.blur();return this},disable:function(a){this.rendered&&this.onDisable();this.disabled=true;a!==true&&this.fireEvent("disable",this);return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){this.rendered&&this.onEnable();this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(a){return this[a?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;this.autoRender&&this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender);this.rendered&&this.onShow();this.fireEvent("show",this)}return this},onShow:function(){this.getVisibilityEl().removeClass("x-hide-"+this.hideMode)},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.doHide();this.fireEvent("hide",this)}return this},doHide:function(){this.hidden=true;this.rendered&&this.onHide()},onHide:function(){this.getVisibilityEl().addClass("x-hide-"+this.hideMode)},getVisibilityEl:function(){return this.hideParent?this.container:this.getActionEl()},setVisible:function(a){return this[a?"show":"hide"]()},isVisible:function(){return this.rendered&&this.getVisibilityEl().isVisible()},cloneConfig:function(a){a=a||{};var c=a.id||Ext.id(),b=Ext.applyIf(a,this.initialConfig);b.id=c;return new this.constructor(b)},getXType:function(){return this.constructor.xtype},isXType:function(a,b){if(Ext.isFunction(a))a=a.xtype;else if(Ext.isObject(a))a=a.constructor.xtype;return !b?("/"+this.getXTypes()+"/").indexOf("/"+a+"/")!=-1:this.constructor.xtype==a},getXTypes:function(){var b=this.constructor;if(!b.xtypes){var c=[],a=this;while(a&&a.constructor.xtype){c.unshift(a.constructor.xtype);a=a.constructor.superclass}b.xtypeChain=c;b.xtypes=c.join("/")}return b.xtypes},findParentBy:function(b){for(var a=this.ownerCt;a!=null&&!b(a,this);a=a.ownerCt);return a||null},findParentByType:function(a){return Ext.isFunction(a)?this.findParentBy(function(b){return b.constructor===a}):this.findParentBy(function(b){return b.constructor.xtype===a})},getPositionEl:function(){return this.positionEl||this.el},purgeListeners:function(){Ext.Component.superclass.purgeListeners.call(this);this.mons&&this.on("beforedestroy",this.clearMons,this,{single:true})},clearMons:function(){Ext.each(this.mons,function(a){a.item.un(a.ename,a.fn,a.scope)},this);this.mons=[]},createMons:function(){if(!this.mons){this.mons=[];this.on("beforedestroy",this.clearMons,this,{single:true})}},mon:function(c,d,f,e,h){this.createMons();if(Ext.isObject(d)){var g=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,b=d;for(var a in b){if(g.test(a))continue;if(Ext.isFunction(b[a])){this.mons.push({item:c,ename:a,fn:b[a],scope:b.scope});c.on(a,b[a],b.scope,b)}else{this.mons.push({item:c,ename:a,fn:b[a],scope:b.scope});c.on(a,b[a])}}return}this.mons.push({item:c,ename:d,fn:f,scope:e});c.on(d,f,e,h)},mun:function(f,c,g,e){var d,a;this.createMons();for(var b=0,h=this.mons.length;b<h;++b){a=this.mons[b];if(f===a.item&&c==a.ename&&g===a.fn&&e===a.scope){this.mons.splice(b,1);f.un(c,g,e);d=true;break}}return d},nextSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a!=-1&&a+1<this.ownerCt.items.getCount())return this.ownerCt.items.itemAt(a+1)}return null},previousSibling:function(){if(this.ownerCt){var a=this.ownerCt.items.indexOf(this);if(a>0)return this.ownerCt.items.itemAt(a-1)}return null},getBubbleTarget:function(){return this.ownerCt}});Ext.reg("component",Ext.Component);Ext.Action=Ext.extend(Object,{constructor:function(a){this.initialConfig=a;this.itemId=a.itemId=a.itemId||a.id||Ext.id();this.items=[]},isAction:true,setText:function(a){this.initialConfig.text=a;this.callEach("setText",[a])},getText:function(){return this.initialConfig.text},setIconClass:function(a){this.initialConfig.iconCls=a;this.callEach("setIconClass",[a])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(a){this.initialConfig.disabled=a;this.callEach("setDisabled",[a])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(a){this.initialConfig.hidden=a;this.callEach("setVisible",[!a])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(b,a){this.initialConfig.handler=b;this.initialConfig.scope=a;this.callEach("setHandler",[b,a])},each:function(b,a){Ext.each(this.items,b,a)},callEach:function(c,d){for(var b=this.items,a=0,e=b.length;a<e;a++)b[a][c].apply(b[a],d)},addComponent:function(a){this.items.push(a);a.on("destroy",this.removeComponent,this)},removeComponent:function(a){this.items.remove(a)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}});(function(){Ext.Layer=function(a,b){a=a||{};var e=Ext.DomHelper,c=a.parentEl,d=c?Ext.getDom(c):document.body;if(b)this.dom=Ext.getDom(b);if(!this.dom){var f=a.dh||{tag:"div",cls:"x-layer"};this.dom=e.append(d,f)}a.cls&&this.addClass(a.cls);this.constrain=a.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);if(a.id)this.id=this.dom.id=a.id;else this.id=Ext.id(this.dom);this.zindex=a.zindex||this.getZIndex();this.position("absolute",this.zindex);if(a.shadow){this.shadowOffset=a.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:a.shadow})}else this.shadowOffset=0;this.useShim=a.shim!==false&&Ext.useShims;this.useDisplay=a.useDisplay;this.hide()};var a=Ext.Element.prototype,b=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt((this.getShim()||this).getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim)return null;if(this.shim)return this.shim;var a=b.shift();if(!a){a=this.createShim();a.enableDisplayMode("block");a.dom.style.display="none";a.dom.style.visibility="visible"}var c=this.dom.parentNode;a.dom.parentNode!=c&&c.insertBefore(a.dom,this.dom);a.setStyle("z-index",this.getZIndex()-2);this.shim=a;return a},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(a){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;a&&this.sync(true)}},sync:function(d){var a=this.shadow;if(!this.updating&&this.isVisible()&&(a||this.useShim)){var b=this.getShim(),j=this.getWidth(),g=this.getHeight(),h=this.getLeft(true),i=this.getTop(true);if(a&&!this.shadowDisabled){if(d&&!a.isVisible())a.show(this);else a.realign(h,i,j,g);if(b){d&&b.show();var f=a.el.getXY(),c=b.dom.style,e=a.el.getSize();c.left=f[0]+"px";c.top=f[1]+"px";c.width=e.width+"px";c.height=e.height+"px"}}else if(b){d&&b.show();b.setSize(j,g);b.setLeftTop(h,i)}}},destroy:function(){this.hideShim();this.shadow&&this.shadow.hide();this.removeAllListeners();Ext.removeNode(this.dom);delete this.dom},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(){this.shadow&&this.shadow.hide();this.hideShim()},constrainXY:function(){if(this.constrain){var k=Ext.lib.Dom.getViewWidth(),j=Ext.lib.Dom.getViewHeight(),c=Ext.getDoc().getScroll(),e=this.getXY(),f=e[0],b=e[1],g=this.shadowOffset,l=this.dom.offsetWidth+g,h=this.dom.offsetHeight+g,d=false;if(f+l>k+c.left){f=k-l-g;d=true}if(b+h>j+c.top){b=j-h-g;d=true}if(f<c.left){f=c.left;d=true}if(b<c.top){b=c.top;d=true}if(d){if(this.avoidY){var i=this.avoidY;if(b<=i&&b+h>=i)b=i-h-5}e=[f,b];this.storeXY(e);a.setXY.call(this,e);this.sync()}}return this},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true)this.setDisplayed("");else if(this.lastXY)a.setXY.call(this,this.lastXY);else this.lastLT&&a.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])},hideAction:function(){this.visible=false;if(this.useDisplay===true)this.setDisplayed(false);else this.setLeftTop(-1e4,-1e4)},setVisible:function(c,d,f,b,g){c&&this.showAction();if(d&&c){var e=function(){this.sync(true);b&&b()}.createDelegate(this);a.setVisible.call(this,true,true,f,e,g)}else{!c&&this.hideUnders(true);var e=b;if(d)e=function(){this.hideAction();b&&b()}.createDelegate(this);a.setVisible.call(this,c,d,f,e,g);if(c)this.sync(true);else!d&&this.hideAction()}return this},storeXY:function(a){delete this.lastLT;this.lastXY=a},storeLeftTop:function(a,b){delete this.lastXY;this.lastLT=[a,b]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){!this.updating&&this.shadow&&this.shadow.hide()},setLeft:function(b){this.storeLeftTop(b,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(b){this.storeLeftTop(this.getLeft(true),b);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(b,c){this.storeLeftTop(b,c);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(c,d,f,e,g){this.fixDisplay();this.beforeAction();this.storeXY(c);var b=this.createCB(e);a.setXY.call(this,c,d,f,b,g);!d&&b();return this},createCB:function(b){var a=this;return function(){a.constrainXY();a.sync(true);b&&b()}},setX:function(e,a,c,b,d){this.setXY([e,this.getY()],a,c,b,d);return this},setY:function(e,a,c,b,d){this.setXY([this.getX(),e],a,c,b,d);return this},setSize:function(h,g,c,e,d,f){this.beforeAction();var b=this.createCB(d);a.setSize.call(this,h,g,c,e,b,f);!c&&b();return this},setWidth:function(g,c,e,d,f){this.beforeAction();var b=this.createCB(d);a.setWidth.call(this,g,c,e,b,f);!c&&b();return this},setHeight:function(g,c,e,d,f){this.beforeAction();var b=this.createCB(d);a.setHeight.call(this,g,c,e,b,f);!c&&b();return this},setBounds:function(d,e,i,h,c,f,j,g){this.beforeAction();var b=this.createCB(j);if(!c){this.storeXY([d,e]);a.setXY.call(this,[d,e]);a.setSize.call(this,i,h,c,f,b,g);b()}else a.setBounds.call(this,d,e,i,h,c,f,b,g);return this},setZIndex:function(a){this.zindex=a;this.setStyle("z-index",a+2);this.shadow&&this.shadow.setZIndex(a+1);this.shim&&this.shim.setStyle("z-index",a);return this}})})();Ext.Shadow=function(d){Ext.apply(this,d);if(typeof this.mode!="string")this.mode=this.defaultMode;var c=this.offset,a={h:0},b=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":a.w=0;a.l=a.t=c;a.t-=1;if(Ext.isIE){a.l-=this.offset+b;a.t-=this.offset+b;a.w-=b;a.h-=b;a.t+=1}break;case "sides":a.w=c*2;a.l=-c;a.t=c-1;if(Ext.isIE){a.l-=this.offset-b;a.t-=this.offset+b;a.l+=1;a.w-=(this.offset-b)*2;a.w-=b+1;a.h-=1}break;case "frame":a.w=a.h=c*2;a.l=a.t=-c;a.t+=1;a.h-=2;if(Ext.isIE){a.l-=this.offset-b;a.t-=this.offset-b;a.l+=1;a.w-=this.offset+b+1;a.h-=this.offset+b;a.h+=1}}this.adjusts=a};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(a){a=Ext.get(a);if(!this.el){this.el=Ext.Shadow.Pool.pull();this.el.dom.nextSibling!=a.dom&&this.el.insertBefore(a)}this.el.setStyle("z-index",this.zIndex||parseInt(a.getStyle("z-index"),10)-1);if(Ext.isIE)this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+this.offset+")";this.realign(a.getLeft(true),a.getTop(true),a.getWidth(),a.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(k,l,m,j){if(!this.el)return;var c=this.adjusts,i=this.el.dom,a=i.style,n=0;a.left=k+c.l+"px";a.top=l+c.t+"px";var h=m+c.w,g=j+c.h,f=h+"px",e=g+"px";if(a.width!=f||a.height!=e){a.width=f;a.height=e;if(!Ext.isIE){var b=i.childNodes,d=Math.max(0,h-12)+"px";b[0].childNodes[1].style.width=d;b[1].childNodes[1].style.width=d;b[2].childNodes[1].style.width=d;b[1].style.height=Math.max(0,g-12)+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(a){this.zIndex=a;this.el&&this.el.setStyle("z-index",a)}};Ext.Shadow.Pool=function(){var a=[],b=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return {pull:function(){var c=a.shift();if(!c){c=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,b));c.autoBoxAdjust=false}return c},push:function(b){a.push(b)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(a,b){if(typeof a=="object"){b=a.height;a=a.width}if(Ext.isDefined(a)&&Ext.isDefined(this.boxMinWidth)&&a<this.boxMinWidth)a=this.boxMinWidth;if(Ext.isDefined(b)&&Ext.isDefined(this.boxMinHeight)&&b<this.boxMinHeight)b=this.boxMinHeight;if(Ext.isDefined(a)&&Ext.isDefined(this.boxMaxWidth)&&a>this.boxMaxWidth)a=this.boxMaxWidth;if(Ext.isDefined(b)&&Ext.isDefined(this.boxMaxHeight)&&b>this.boxMaxHeight)b=this.boxMaxHeight;if(!this.boxReady){this.width=a;this.height=b;return this}if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==a&&this.lastSize.height==b)return this;this.lastSize={width:a,height:b};var f=this.adjustSize(a,b),d=f.width,c=f.height,e;if(d!==undefined||c!==undefined){e=this.getResizeEl();if(!this.deferHeight&&d!==undefined&&c!==undefined)e.setSize(d,c);else if(!this.deferHeight&&c!==undefined)e.setHeight(c);else d!==undefined&&e.setWidth(d);this.onResize(d,c,a,b);this.fireEvent("resize",this,d,c,a,b)}return this},setWidth:function(a){return this.setSize(a)},setHeight:function(a){return this.setSize(undefined,a)},getSize:function(){return this.getResizeEl().getSize()},getWidth:function(){return this.getResizeEl().getWidth()},getHeight:function(){return this.getResizeEl().getHeight()},getOuterSize:function(){var a=this.getResizeEl();return {width:a.getWidth()+a.getMargins("lr"),height:a.getHeight()+a.getMargins("tb")}},getPosition:function(b){var a=this.getPositionEl();if(b===true)return [a.getLeft(true),a.getTop(true)];return this.xy||a.getXY()},getBox:function(c){var b=this.getPosition(c),a=this.getSize();a.x=b[0];a.y=b[1];return a},updateBox:function(a){this.setSize(a.width,a.height);this.setPagePosition(a.x,a.y);return this},getResizeEl:function(){return this.resizeEl||this.el},setAutoScroll:function(a){this.rendered&&this.getContentTarget().setOverflow(a?"auto":"");this.autoScroll=a;return this},setPosition:function(c,e){if(c&&typeof c[1]=="number"){e=c[1];c=c[0]}this.x=c;this.y=e;if(!this.boxReady)return this;var f=this.adjustPosition(c,e),a=f.x,b=f.y,d=this.getPositionEl();if(a!==undefined||b!==undefined){if(a!==undefined&&b!==undefined)d.setLeftTop(a,b);else if(a!==undefined)d.setLeft(a);else b!==undefined&&d.setTop(b);this.onPosition(a,b);this.fireEvent("move",this,a,b)}return this},setPagePosition:function(a,b){if(a&&typeof a[1]=="number"){b=a[1];a=a[0]}this.pageX=a;this.pageY=b;if(!this.boxReady)return;if(a===undefined||b===undefined)return;var c=this.getPositionEl().translatePoints(a,b);this.setPosition(c.left,c.top);return this},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);if(this.resizeEl)this.resizeEl=Ext.get(this.resizeEl);if(this.positionEl)this.positionEl=Ext.get(this.positionEl);this.boxReady=true;Ext.isDefined(this.autoScroll)&&this.setAutoScroll(this.autoScroll);this.setSize(this.width,this.height);if(this.x||this.y)this.setPosition(this.x,this.y);else(this.pageX||this.pageY)&&this.setPagePosition(this.pageX,this.pageY)},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());return this},onResize:function(){},onPosition:function(){},adjustSize:function(b,a){if(this.autoWidth)b="auto";if(this.autoHeight)a="auto";return {width:b,height:a}},adjustPosition:function(a,b){return {x:a,y:b}}});Ext.reg("box",Ext.BoxComponent);Ext.Spacer=Ext.extend(Ext.BoxComponent,{autoEl:"div"});Ext.reg("spacer",Ext.Spacer);Ext.SplitBar=function(d,c,e,b,a){this.el=Ext.get(d,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(c,true);this.orientation=e||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2e3;this.animate=false;this.useShim=false;this.shim=null;if(!a)this.proxy=Ext.SplitBar.createProxy(this.orientation);else this.proxy=Ext.get(a).dom;this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter;this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=b||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=b||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(d,e){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var c=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var a=c-this.activeMinSize,b=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?a:b,this.placement==Ext.SplitBar.LEFT?b:a,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?a:b,this.placement==Ext.SplitBar.TOP?b:a,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[d,e];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,d,e)},onEndProxyDrag:function(c){Ext.get(this.proxy).setDisplayed(false);var b=Ext.lib.Event.getXY(c);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var a;if(this.orientation==Ext.SplitBar.HORIZONTAL)a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?b[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-b[0]);else a=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?b[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-b[1]);a=Math.min(Math.max(a,this.activeMinSize),this.activeMaxSize);if(a!=this.dragSpecs.startSize)if(this.fireEvent("beforeapply",this,a)!==false){this.adapter.setElementSize(this,a);this.fireEvent("moved",this,a);this.fireEvent("resize",this,a)}},getAdapter:function(){return this.adapter},setAdapter:function(a){this.adapter=a;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(a){this.minSize=a},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(a){this.maxSize=a},setCurrentSize:function(b){var a=this.animate;this.animate=false;this.adapter.setElementSize(this,b);this.animate=a},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();a&&this.el.remove();this.purgeListeners()}});Ext.SplitBar.createProxy=function(c){var a=new Ext.Element(document.createElement("div"));document.body.appendChild(a.dom);a.unselectable();var b="x-splitbar-proxy";a.addClass(b+" "+(c==Ext.SplitBar.HORIZONTAL?b+"-h":b+"-v"));return a.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(){},getElementSize:function(a){if(a.orientation==Ext.SplitBar.HORIZONTAL)return a.resizingEl.getWidth();else return a.resizingEl.getHeight()},setElementSize:function(a,c,b){if(a.orientation==Ext.SplitBar.HORIZONTAL)if(!a.animate){a.resizingEl.setWidth(c);b&&b(a,c)}else a.resizingEl.setWidth(c,true,.1,b,"easeOut");else if(!a.animate){a.resizingEl.setHeight(c);b&&b(a,c)}else a.resizingEl.setHeight(c,true,.1,b,"easeOut")}};Ext.SplitBar.AbsoluteLayoutAdapter=function(a){this.basic=new Ext.SplitBar.BasicLayoutAdapter;this.container=Ext.get(a)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(a){this.basic.init(a)},getElementSize:function(a){return this.basic.getElementSize(a)},setElementSize:function(a,b){this.basic.setElementSize(a,b,this.moveSplitter.createDelegate(this,[a]))},moveSplitter:function(a){var b=Ext.SplitBar;switch(a.placement){case b.LEFT:a.el.setX(a.resizingEl.getRight());break;case b.RIGHT:a.el.setStyle("right",this.container.getWidth()-a.resizingEl.getLeft()+"px");break;case b.TOP:a.el.setY(a.resizingEl.getBottom());break;case b.BOTTOM:a.el.setY(a.resizingEl.getTop()-a.el.getHeight())}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{bufferResize:50,autoDestroy:true,forceLayout:false,defaultType:"panel",resizeEvent:"resize",bubbleEvents:["add","remove"],initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var a=this.items;if(a){delete this.items;this.add(a)}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(a){this.layout&&this.layout!=a&&this.layout.setContainer(null);this.layout=a;this.initItems();a.setContainer(this)},afterRender:function(){Ext.Container.superclass.afterRender.call(this);if(!this.layout)this.layout="auto";if(Ext.isObject(this.layout)&&!this.layout.layout){this.layoutConfig=this.layout;this.layout=this.layoutConfig.type}if(Ext.isString(this.layout))this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);this.setLayout(this.layout);if(this.activeItem!==undefined){var a=this.activeItem;delete this.activeItem;this.layout.setActiveItem(a)}!this.ownerCt&&this.doLayout(false,true);this.monitorResize===true&&Ext.EventManager.onWindowResize(this.doLayout,this,[false])},getLayoutTarget:function(){return this.el},getComponentId:function(a){return a.getItemId()},add:function(c){this.initItems();var e=arguments.length>1;if(e||Ext.isArray(c)){var d=[];Ext.each(e?arguments:c,function(a){d.push(this.add(a))},this);return d}var a=this.lookupComponent(this.applyDefaults(c)),b=this.items.length;if(this.fireEvent("beforeadd",this,a,b)!==false&&this.onBeforeAdd(a)!==false){this.items.add(a);a.onAdded(this,b);this.onAdd(a);this.fireEvent("add",this,a,b)}return a},onAdd:function(){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(a){a.initRef()});this.fireEvent("added",this,a,b)},insert:function(b,g){this.initItems();var f=arguments,e=f.length;if(e>2){for(var d=[],c=e-1;c>=1;--c)d.push(this.insert(b,f[c]));return d}var a=this.lookupComponent(this.applyDefaults(g));b=Math.min(b,this.items.length);if(this.fireEvent("beforeadd",this,a,b)!==false&&this.onBeforeAdd(a)!==false){a.ownerCt==this&&this.items.remove(a);this.items.insert(b,a);a.onAdded(this,b);this.onAdd(a);this.fireEvent("add",this,a,b)}return a},applyDefaults:function(a){var b=this.defaults;if(b){if(Ext.isFunction(b))b=b.call(this,a);if(Ext.isString(a)){a=Ext.ComponentMgr.get(a);Ext.apply(a,b)}else if(!a.events)Ext.applyIf(a,b);else Ext.apply(a,b)}return a},onBeforeAdd:function(a){a.ownerCt&&a.ownerCt.remove(a,false);if(this.hideBorders===true)a.border=a.border===true},remove:function(c,b){this.initItems();var a=this.getComponent(c);if(a&&this.fireEvent("beforeremove",this,a)!==false){this.doRemove(a,b);this.fireEvent("remove",this,a)}return a},onRemove:function(){},doRemove:function(a,c){var b=this.layout,d=b&&this.rendered;d&&b.onRemove(a);this.items.remove(a);a.onRemoved();this.onRemove(a);(c===true||c!==false&&this.autoDestroy)&&a.destroy();d&&b.afterRemove(a)},removeAll:function(e){this.initItems();var a,b=[],d=[];this.items.each(function(a){b.push(a)});for(var c=0,f=b.length;c<f;++c){a=b[c];this.remove(a,e);a.ownerCt!==this&&d.push(a)}return d},getComponent:function(a){if(Ext.isObject(a))a=a.getItemId();return this.items.get(a)},lookupComponent:function(a){if(Ext.isString(a))return Ext.ComponentMgr.get(a);else if(!a.events)return this.createComponent(a);return a},createComponent:function(a,c){if(a.render)return a;var b=Ext.create(Ext.apply({ownerCt:this},a),c||this.defaultType);delete b.initialConfig.ownerCt;delete b.ownerCt;return b},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(a,g){var d=this.rendered,b=g||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!a;if(!b)return;a=a&&!this.deferLayout}else delete this.deferLayout;d&&this.layout&&this.layout.layout();if(a!==true&&this.items)for(var e=this.items.items,c=0,h=e.length;c<h;c++){var f=e[c];f.doLayout&&f.doLayout(false,b)}d&&this.onLayout(a,b);this.hasLayout=true;delete this.forceLayout},onLayout:Ext.emptyFn,shouldBufferLayout:function(){var a=this.hasLayout;if(this.ownerCt)return a?!this.hasLayoutPending():false;return a},hasLayoutPending:function(){var a=false;this.ownerCt.bubble(function(b){if(b.layoutPending){a=true;return false}});return a},onShow:function(){Ext.Container.superclass.onShow.call(this);if(Ext.isDefined(this.deferLayout)){delete this.deferLayout;this.doLayout(true)}},getLayout:function(){if(!this.layout){var a=new Ext.layout.AutoLayout(this.layoutConfig);this.setLayout(a)}return this.layout},beforeDestroy:function(){var a;if(this.items)while(a=this.items.first())this.doRemove(a,true);this.monitorResize&&Ext.EventManager.removeResizeListener(this.doLayout,this);Ext.destroy(this.layout);Ext.Container.superclass.beforeDestroy.call(this)},bubble:function(d,b,c){var a=this;while(a){if(d.apply(b||a,c||[a])===false)break;a=a.ownerCt}return this},cascade:function(e,c,d){if(e.apply(c||this,d||[this])!==false)if(this.items)for(var b=this.items.items,a=0,f=b.length;a<f;a++)if(b[a].cascade)b[a].cascade(e,c,d);else e.apply(c||b[a],d||[b[a]]);return this},findById:function(c){var a,b=this;this.cascade(function(d){if(b!=d&&d.id===c){a=d;return false}});return a||null},findByType:function(b,a){return this.findBy(function(c){return c.isXType(b,a)})},find:function(b,a){return this.findBy(function(c){return c[b]===a})},findBy:function(d,c){var b=[],a=this;this.cascade(function(e){a!=e&&d.call(c||e,e,a)===true&&b.push(e)});return b},"get":function(a){return this.items.get(a)}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=Ext.extend(Object,{monitorResize:false,activeItem:null,constructor:function(a){this.id=Ext.id(null,"ext-layout-");Ext.apply(this,a)},type:"container",IEMeasureHack:function(e,i){for(var d=e.dom.childNodes,f=d.length,c,h=[],b,g,a=0;a<f;a++){c=d[a];b=Ext.get(c);if(b){h[a]=b.getStyle("display");b.setStyle({display:"none"})}}g=e?e.getViewSize(i):{};for(a=0;a<f;a++){c=d[a];b=Ext.get(c);b&&b.setStyle({display:h[a]})}return g},getLayoutTargetSize:Ext.EmptyFn,layout:function(){var a=this.container,b=a.getLayoutTarget();!(this.hasLayout||Ext.isEmpty(this.targetCls))&&b.addClass(this.targetCls);this.onLayout(a,b);a.fireEvent("afterlayout",a,this)},onLayout:function(b,a){this.renderAll(b,a)},isValidParent:function(b,a){return a&&b.getPositionEl().dom.parentNode==(a.dom||a)},renderAll:function(f,c){for(var d=f.items.items,a,e=d.length,b=0;b<e;b++){a=d[b];a&&(!a.rendered||!this.isValidParent(a,c))&&this.renderItem(a,b,c)}},renderItem:function(a,b,c){if(a)if(!a.rendered){a.render(c,b);this.configureItem(a,b)}else if(!this.isValidParent(a,c)){if(Ext.isNumber(b))b=c.dom.childNodes[b];c.dom.insertBefore(a.getPositionEl().dom,b||null);a.container=c;this.configureItem(a,b)}},getRenderedItems:function(e){for(var g=e.getLayoutTarget(),d=e.items.items,f=d.length,a,c=[],b=0;b<f;b++)(a=d[b]).rendered&&this.isValidParent(a,g)&&c.push(a);return c},configureItem:function(a){if(this.extraCls){var b=a.getPositionEl?a.getPositionEl():a;b.addClass(this.extraCls)}a.doLayout&&this.forceLayout&&a.doLayout();this.renderHidden&&a!=this.activeItem&&a.hide()},onRemove:function(a){if(this.activeItem==a)delete this.activeItem;if(a.rendered&&this.extraCls){var b=a.getPositionEl?a.getPositionEl():a;b.removeClass(this.extraCls)}},afterRemove:function(a){if(a.removeRestore){a.removeMode="container";delete a.removeRestore}},onResize:function(){var a=this.container,b;if(a.collapsed)return;if(b=a.bufferResize&&a.shouldBufferLayout()){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);this.resizeBuffer=Ext.isNumber(b)?b:50}a.layoutPending=true;this.resizeTask.delay(this.resizeBuffer)}else this.runLayout()},runLayout:function(){var a=this.container;this.layout();a.onLayout();delete a.layoutPending},setContainer:function(a){if(this.monitorResize&&a!=this.container){var b=this.container;b&&b.un(b.resizeEvent,this.onResize,this);a&&a.on(a.resizeEvent,this.onResize,this)}this.container=a},parseMargins:function(b){if(Ext.isNumber(b))b=b.toString();var a=b.split(" "),c=a.length;if(c==1)a[1]=a[2]=a[3]=a[0];else if(c==2){a[2]=a[0];a[3]=a[1]}else if(c==3)a[3]=a[1];return {top:parseInt(a[0],10)||0,right:parseInt(a[1],10)||0,bottom:parseInt(a[2],10)||0,left:parseInt(a[3],10)||0}},fieldTpl:function(){var a=new Ext.Template('<div class="x-form-item {itemCls}" tabIndex="-1">','<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>','<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">','</div><div class="{clearCls}"></div>',"</div>");a.disableFormats=true;return a.compile()}(),destroy:function(){this.resizeTask&&this.resizeTask.cancel&&this.resizeTask.cancel();if(!Ext.isEmpty(this.targetCls)){var a=this.container.getLayoutTarget();a&&a.removeClass(this.targetCls)}}});Ext.layout.AutoLayout=Ext.extend(Ext.layout.ContainerLayout,{type:"auto",monitorResize:true,onLayout:function(d,e){Ext.layout.AutoLayout.superclass.onLayout.call(this,d,e);for(var c=this.getRenderedItems(d),f=c.length,a,b=0;b<f;b++){a=c[b];a.doLayout&&a.doLayout(true)}}});Ext.Container.LAYOUTS["auto"]=Ext.layout.AutoLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"fit",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a)return {};return a.getStyleSize()},onLayout:function(a,b){Ext.layout.FitLayout.superclass.onLayout.call(this,a,b);!a.collapsed&&this.setItemSize(this.activeItem||a.items.itemAt(0),this.getLayoutTargetSize())},setItemSize:function(a,b){a&&b.height>0&&a.setSize(b)}});Ext.Container.LAYOUTS["fit"]=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,layoutOnCardChange:false,renderHidden:true,type:"card",setActiveItem:function(a){var b=this.activeItem,d=this.container;a=d.getComponent(a);if(a&&b!=a){if(b){b.hide();if(b.hidden!==true)return false;b.fireEvent("deactivate",b)}var c=a.doLayout&&(this.layoutOnCardChange||!a.rendered);this.activeItem=a;delete a.deferLayout;a.show();this.layout();c&&a.doLayout();a.fireEvent("activate",a)}},renderAll:function(b,a){if(this.deferredRender)this.renderItem(this.activeItem,undefined,a);else Ext.layout.CardLayout.superclass.renderAll.call(this,b,a)}});Ext.Container.LAYOUTS["card"]=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"anchor",defaultAnchor:"100%",parseAnchorRE:/^(r|right|b|bottom)$/i,getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();if(!a)return {};return a.getStyleSize()},onLayout:function(b,q){Ext.layout.AnchorLayout.superclass.onLayout.call(this,b,q);var m=this.getLayoutTargetSize(),p=m.width,o=m.height;if(p<20&&o<20)return;var e,h;if(b.anchorSize)if(typeof b.anchorSize=="number")e=b.anchorSize;else{e=b.anchorSize.width;h=b.anchorSize.height}else{e=b.initialConfig.width;h=b.initialConfig.height}for(var n=this.getRenderedItems(b),g=n.length,a,c,j,i,k,l,f=[],d=0;d<g;d++){a=n[d];k=a.getPositionEl();if(!a.anchor&&a.items&&!Ext.isNumber(a.width)&&!(Ext.isIE6&&Ext.isStrict))a.anchor=this.defaultAnchor;if(a.anchor){c=a.anchorSpec;if(!c){l=a.anchor.split(" ");a.anchorSpec=c={right:this.parseAnchor(l[0],a.initialConfig.width,e),bottom:this.parseAnchor(l[1],a.initialConfig.height,h)}}j=c.right?this.adjustWidthAnchor(c.right(p)-k.getMargins("lr"),a):undefined;i=c.bottom?this.adjustHeightAnchor(c.bottom(o)-k.getMargins("tb"),a):undefined;(j||i)&&f.push({comp:a,width:j||undefined,height:i||undefined})}}for(d=0,g=f.length;d<g;d++){a=f[d];a.comp.setSize(a.width,a.height)}},parseAnchor:function(a,e,c){if(a&&a!="none"){var b;if(this.parseAnchorRE.test(a)){var f=c-e;return function(a){if(a!==b){b=a;return a-f}}}else if(a.indexOf("%")!=-1){var d=parseFloat(a.replace("%",""))*.01;return function(a){if(a!==b){b=a;return Math.floor(a*d)}}}else{a=parseInt(a,10);if(!isNaN(a))return function(c){if(c!==b){b=c;return c+a}}}}return false},adjustWidthAnchor:function(a){return a},adjustHeightAnchor:function(a){return a}});Ext.Container.LAYOUTS["anchor"]=Ext.layout.AnchorLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,type:"border",targetCls:"x-border-layout-ct",getLayoutTargetSize:function(){var a=this.container.getLayoutTarget();return a?a.getViewSize():{}},onLayout:function(t,k){var e,d,c,h,v=t.items.items,s=v.length;if(!this.rendered){e=[];for(d=0;d<s;d++){c=v[d];h=c.region;c.collapsed&&e.push(c);c.collapsed=false;if(!c.rendered){c.render(k,d);c.getPositionEl().addClass("x-border-panel")}this[h]=h!="center"&&c.split?new Ext.layout.BorderLayout.SplitRegion(this,c.initialConfig,h):new Ext.layout.BorderLayout.Region(this,c.initialConfig,h);this[h].render(k,c)}this.rendered=true}var g=this.getLayoutTargetSize();if(g.width<20||g.height<20){if(e)this.restoreCollapsed=e;return}else if(this.restoreCollapsed){e=this.restoreCollapsed;delete this.restoreCollapsed}var p=g.width,x=g.height,r=p,i=x,j=0,u=0,n=this.north,o=this.south,l=this.west,m=this.east,c=this.center,b,a,f,q;if(!c&&Ext.layout.BorderLayout.WARN!==false)throw"No center region defined in BorderLayout "+t.id;if(n&&n.isVisible()){b=n.getSize();a=n.getMargins();b.width=p-(a.left+a.right);b.x=a.left;b.y=a.top;j=b.height+b.y+a.bottom;i-=j;n.applyLayout(b)}if(o&&o.isVisible()){b=o.getSize();a=o.getMargins();b.width=p-(a.left+a.right);b.x=a.left;q=b.height+a.top+a.bottom;b.y=x-q+a.top;i-=q;o.applyLayout(b)}if(l&&l.isVisible()){b=l.getSize();a=l.getMargins();b.height=i-(a.top+a.bottom);b.x=a.left;b.y=j+a.top;f=b.width+a.left+a.right;u+=f;r-=f;l.applyLayout(b)}if(m&&m.isVisible()){b=m.getSize();a=m.getMargins();b.height=i-(a.top+a.bottom);f=b.width+a.left+a.right;b.x=p-f+a.left;b.y=j+a.top;r-=f;m.applyLayout(b)}if(c){a=c.getMargins();var y={x:u+a.left,y:j+a.top,width:r-(a.left+a.right),height:i-(a.top+a.bottom)};c.applyLayout(y)}if(e)for(d=0,s=e.length;d<s;d++)e[d].collapse(false);Ext.isIE&&Ext.isStrict&&k.repaint();if(d=k.getStyle("overflow")&&d!="hidden"&&!this.adjustmentPass){var w=this.getLayoutTargetSize();if(w.width!=g.width||w.height!=g.height){this.adjustmentPass=true;this.onLayout(t,k)}}delete this.adjustmentPass},destroy:function(){for(var c=["north","south","east","west"],a,b=0;b<c.length;b++){a=this[c[b]];if(a)if(a.destroy)a.destroy();else a.split&&a.split.destroy(true)}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(c,b,a){Ext.apply(this,b);this.layout=c;this.position=a;this.state={};if(typeof this.margins=="string")this.margins=this.layout.parseMargins(this.margins);this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string")this.cmargins=this.layout.parseMargins(this.cmargins);if(this.collapseMode=="mini"&&!this.cmargins)this.cmargins={left:0,top:0,right:0,bottom:0};else this.cmargins=Ext.applyIf(this.cmargins||{},a=="north"||a=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},floatingZIndex:100,isCollapsed:false,render:function(c,a){this.panel=a;a.el.enableDisplayMode();this.targetEl=c;this.el=a.el;var d=a.getState,b=this.position;a.getState=function(){return Ext.apply(d.call(a)||{},this.state)}.createDelegate(this);if(b!="center"){a.allowQueuedExpand=false;a.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){a.collapseEl="el";a.slideAnchor=this.getSlideAnchor()}if(a.tools&&a.tools.toggle){a.tools.toggle.addClass("x-tool-collapse-"+b);a.tools.toggle.addClassOnOver("x-tool-collapse-"+b+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var a=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');a.disableFormats=true;a.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=a}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var b=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);b.addClassOnOver("x-tool-expand-"+this.position+"-over");b.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(){if(this.isSlid)this.panel.expand(false);else this.panel.expand()},onCollapseClick:function(){this.panel.collapse()},beforeCollapse:function(c,b){this.lastAnim=b;this.splitEl&&this.splitEl.hide();this.getCollapsedEl().show();var a=this.panel.getEl();this.originalZIndex=a.getStyle("z-index");a.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false)this.getCollapsedEl().dom.style.visibility="visible";else this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:.2});this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(){this.isSlid&&this.afterSlideIn();var a=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west")this.panel.setSize(undefined,a.getHeight());else this.panel.setSize(a.getWidth(),undefined);a.hide();a.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",this.floatingZIndex)},onExpand:function(){this.isCollapsed=false;this.splitEl&&this.splitEl.show();this.layout.layout();this.panel.el.setStyle("z-index",this.originalZIndex);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(a){if(this.isSlid){a.stopPropagation();this.slideIn()}else{a.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed)this.getCollapsedEl().hide();else this.splitEl&&this.splitEl.hide()},onShow:function(){if(this.isCollapsed)this.getCollapsedEl().show();else this.splitEl&&this.splitEl.show()},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(a){this.panel=a},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(a){var b=this.getCollapsedEl();b.setLeftTop(a.x,a.y);b.setSize(a.width,a.height)},applyLayout:function(a){if(this.isCollapsed)this.applyLayoutCollapsed(a);else{this.panel.setPosition(a.x,a.y);this.panel.setSize(a.width,a.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){this.autoHideSlideTask=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){!a.within(this.el,true)&&this.autoHideSlideTask.delay(500)},mouseover:function(){this.autoHideSlideTask.cancel()},scope:this}}this.el.on(this.autoHideHd);this.collapsedEl.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover);this.collapsedEl.un("mouseout",this.autoHideHd.mouseout);this.collapsedEl.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx())return;this.isSlid=true;var a=this.panel.tools,b,c;a&&a.toggle&&a.toggle.hide();this.el.show();c=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){b=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=b}else this.panel.setSize(this.collapsedEl.getWidth(),undefined);this.panel.collapsed=c;this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",this.floatingZIndex+2);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var a=this.panel.tools;a&&a.toggle&&a.toggle.show()},slideIn:function(a){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(a);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(a)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(a){!a.within(this.el)&&this.slideIn()},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var a=this.cmargins;switch(this.position){case "west":return [0,0];break;case "east":return [0,0];break;case "north":return [0,0];break;case "south":return [0,0]}},getExpandAdj:function(){var b=this.collapsedEl,a=this.cmargins;switch(this.position){case "west":return [-(a.right+b.getWidth()+a.left),0];break;case "east":return [a.right+b.getWidth()+a.left,0];break;case "north":return [0,-(a.top+a.bottom+b.getHeight())];break;case "south":return [0,a.top+a.bottom+b.getHeight()]}},destroy:function(){this.autoHideSlideTask&&this.autoHideSlideTask.cancel&&this.autoHideSlideTask.cancel();Ext.destroy(this.miniCollapsedEl,this.collapsedEl)}};Ext.layout.BorderLayout.SplitRegion=function(c,b,a){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,c,b,a);this.applyLayout=this.applyFns[a]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var c=this.splitEl.dom,b=c.style;this.panel.setPosition(a.x,a.y);var d=c.offsetWidth;b.left=a.x+a.width-d+"px";b.top=a.y+"px";b.height=Math.max(0,a.height)+"px";this.panel.setSize(a.width-d,a.height)},east:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var c=this.splitEl.dom,b=c.style,d=c.offsetWidth;this.panel.setPosition(a.x+d,a.y);b.left=a.x+"px";b.top=a.y+"px";b.height=Math.max(0,a.height)+"px";this.panel.setSize(a.width-d,a.height)},north:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var c=this.splitEl.dom,b=c.style,d=c.offsetHeight;this.panel.setPosition(a.x,a.y);b.left=a.x+"px";b.top=a.y+a.height-d+"px";b.width=Math.max(0,a.width)+"px";this.panel.setSize(a.width,a.height-d)},south:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var c=this.splitEl.dom,b=c.style,d=c.offsetHeight;this.panel.setPosition(a.x,a.y+d);b.left=a.x+"px";b.top=a.y+"px";b.width=Math.max(0,a.width)+"px";this.panel.setSize(a.width,a.height-d)}},render:function(d,c){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,d,c);var b=this.position;this.splitEl=d.createChild({cls:"x-layout-split x-layout-split-"+b,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+b,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var a=this.splitSettings[b];this.split=new Ext.SplitBar(this.splitEl.dom,c.el,a.orientation);this.split.tickSize=this.tickSize;this.split.placement=a.placement;this.split.getMaximumSize=this[a.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[a.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[a.maxProp];c.hidden&&this.splitEl.hide();if(this.useSplitTips)this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip;this.collapsible&&this.splitEl.on("dblclick",this.onCollapseClick,this)},getSize:function(){if(this.isCollapsed)return this.collapsedEl.getSize();var a=this.panel.getSize();if(this.position=="north"||this.position=="south")a.height+=this.splitEl.dom.offsetHeight;else a.width+=this.splitEl.dom.offsetWidth;return a},getHMaxSize:function(){var b=this.maxSize||1e4,a=this.layout.center;return Math.min(b,this.el.getWidth()+a.el.getWidth()-a.getMinWidth())},getVMaxSize:function(){var b=this.maxSize||1e4,a=this.layout.center;return Math.min(b,this.el.getHeight()+a.el.getHeight()-a.getMinHeight())},onSplitMove:function(c,a){var b=this.panel.getSize();this.lastSplitSize=a;if(this.position=="north"||this.position=="south"){this.panel.setSize(b.width,a);this.state.height=a}else{this.panel.setSize(a,b.height);this.state.width=a}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl);Ext.layout.BorderLayout.SplitRegion.superclass.destroy.call(this)}});Ext.Container.LAYOUTS["border"]=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",trackLabels:false,type:"form",onRemove:function(a){Ext.layout.FormLayout.superclass.onRemove.call(this,a);if(this.trackLabels){a.un("show",this.onFieldShow,this);a.un("hide",this.onFieldHide,this)}var c=a.getPositionEl(),b=a.getItemCt&&a.getItemCt();if(a.rendered&&b){c&&c.dom&&c.insertAfter(b);Ext.destroy(b);Ext.destroyMembers(a,"label","itemCt");a.customItemCt&&Ext.destroyMembers(a,"getItemCt","customItemCt")}},setContainer:function(a){Ext.layout.FormLayout.superclass.setContainer.call(this,a);a.labelAlign&&a.addClass("x-form-label-"+a.labelAlign);if(a.hideLabels)Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0});else{this.labelSeparator=a.labelSeparator||this.labelSeparator;a.labelWidth=a.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=Ext.isNumber(a.labelPad)?a.labelPad:5;Ext.apply(this,{labelAdjust:a.labelWidth+b,labelStyle:"width:"+a.labelWidth+"px;",elementStyle:"padding-left:"+(a.labelWidth+b)+"px"})}a.labelAlign=="top"&&Ext.apply(this,{labelStyle:"width:auto;",labelAdjust:0,elementStyle:"padding-left:0;"})}},isHide:function(a){return a.hideLabel||this.container.hideLabels},onFieldShow:function(a){a.getItemCt().removeClass("x-hide-"+a.hideMode);a.isComposite&&a.doLayout()},onFieldHide:function(a){a.getItemCt().addClass("x-hide-"+a.hideMode)},getLabelStyle:function(e){for(var a="",c=[this.labelStyle,e],b=0,d=c.length;b<d;++b)if(c[b]){a+=c[b];if(a.substr(-1,1)!=";")a+=";"}return a},renderItem:function(a,b,c){if(a&&(a.isFormField||a.fieldLabel)&&a.inputType!="hidden"){var d=this.getTemplateArgs(a);if(Ext.isNumber(b))b=c.dom.childNodes[b]||null;if(b)a.itemCt=this.fieldTpl.insertBefore(b,d,true);else a.itemCt=this.fieldTpl.append(c,d,true);!a.getItemCt&&Ext.apply(a,{getItemCt:function(){return a.itemCt},customItemCt:true});a.label=a.getItemCt().child("label.x-form-item-label");if(!a.rendered)a.render("x-form-el-"+a.id);else!this.isValidParent(a,c)&&Ext.fly("x-form-el-"+a.id).appendChild(a.getPositionEl());if(this.trackLabels){a.hidden&&this.onFieldHide(a);a.on({scope:this,show:this.onFieldShow,hide:this.onFieldHide})}this.configureItem(a)}else Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)},getTemplateArgs:function(a){var b=!a.fieldLabel||a.hideLabel;return {id:a.id,label:a.fieldLabel,itemCls:(a.itemCls||this.container.itemCls||"")+(a.hideLabel?" x-hide-label":""),clearCls:a.clearCls||"x-form-clear-left",labelStyle:this.getLabelStyle(a.labelStyle),elementStyle:this.elementStyle||"",labelSeparator:b?"":Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator}},adjustWidthAnchor:function(a,b){if(b.label&&!this.isHide(b)&&this.container.labelAlign!="top"){var c=Ext.isIE6||Ext.isIE&&!Ext.isStrict;return a-this.labelAdjust+(c?-3:0)}return a},adjustHeightAnchor:function(b,a){if(a.label&&!this.isHide(a)&&this.container.labelAlign=="top")return b-a.label.getHeight();return b},isValidParent:function(b,a){return a&&this.container.getEl().contains(b.getPositionEl())}});Ext.Container.LAYOUTS["form"]=Ext.layout.FormLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(b,a){a.position();this.paddingLeft=a.getPadding("l");this.paddingTop=a.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,b,a)},adjustWidthAnchor:function(a,b){return a?a-b.getPosition(true)[0]+this.paddingLeft:a},adjustHeightAnchor:function(a,b){return a?a-b.getPosition(true)[1]+this.paddingTop:a}});Ext.Container.LAYOUTS["absolute"]=Ext.layout.AbsoluteLayout;Ext.layout.ToolbarLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"toolbar",triggerWidth:18,noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',lastOverflow:false,tableHTML:['<table cellspacing="0" class="x-toolbar-ct">',"<tbody>","<tr>",'<td class="x-toolbar-left" align="{0}">','<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-left-row"></tr>',"</tbody>","</table>","</td>",'<td class="x-toolbar-right" align="right">','<table cellspacing="0" class="x-toolbar-right-ct">',"<tbody>","<tr>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-right-row"></tr>',"</tbody>","</table>","</td>","<td>",'<table cellspacing="0">',"<tbody>",'<tr class="x-toolbar-extras-row"></tr>',"</tbody>","</table>","</td>","</tr>","</tbody>","</table>","</td>","</tr>","</tbody>","</table>"].join(""),onLayout:function(e,b){if(!this.leftTr){var i=e.buttonAlign=="center"?"center":"left";b.addClass("x-toolbar-layout-ct");b.insertHtml("beforeEnd",String.format(this.tableHTML,i));this.leftTr=b.child("tr.x-toolbar-left-row",true);this.rightTr=b.child("tr.x-toolbar-right-row",true);this.extrasTr=b.child("tr.x-toolbar-extras-row",true);if(this.hiddenItem==undefined)this.hiddenItems=[]}for(var d=e.buttonAlign=="right"?this.rightTr:this.leftTr,g=e.items.items,c=0,f=0,j=g.length,a;f<j;f++,c++){a=g[f];if(a.isFill){d=this.rightTr;c=-1}else if(!a.rendered)a.render(this.insertCell(a,d,c));else if(!a.xtbHidden&&!this.isValidParent(a,d.childNodes[c])){var h=this.insertCell(a,d,c);h.appendChild(a.getPositionEl().dom);a.container=Ext.get(h)}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(b)},cleanup:function(d){for(var c=d.childNodes,a,b=c.length-1;b>=0&&(a=c[b]);b--)!a.firstChild&&d.removeChild(a)},insertCell:function(d,b,c){var a=document.createElement("td");a.className="x-toolbar-cell";b.insertBefore(a,b.childNodes[c]||null);return a},hideItem:function(a){this.hiddenItems.push(a);a.xtbHidden=true;a.xtbWidth=a.getPositionEl().dom.parentNode.offsetWidth;a.hide()},unhideItem:function(a){a.show();a.xtbHidden=false;this.hiddenItems.remove(a)},getItemWidth:function(a){return a.hidden?a.xtbWidth||0:a.getPositionEl().dom.parentNode.offsetWidth},fitToSize:function(g){if(this.container.enableOverflow===false)return;var b=g.dom.clientWidth,i=g.dom.firstChild.offsetWidth,j=b-this.triggerWidth,k=this.lastWidth||0,e=this.hiddenItems,c=e.length!=0,l=b>=k;this.lastWidth=b;if(i>b||c&&l)for(var h=this.container.items.items,m=h.length,f=0,a,d=0;d<m;d++){a=h[d];if(!a.isFill){f+=this.getItemWidth(a);if(f>j)!(a.hidden||a.xtbHidden)&&this.hideItem(a);else a.xtbHidden&&this.unhideItem(a)}}c=e.length!=0;if(c){this.initMore();if(!this.lastOverflow){this.container.fireEvent("overflowchange",this.container,true);this.lastOverflow=true}}else if(this.more){this.clearMenu();this.more.destroy();delete this.more;if(this.lastOverflow){this.container.fireEvent("overflowchange",this.container,false);this.lastOverflow=false}}},createMenuConfig:function(a,d){var b=Ext.apply({},a.initialConfig),c=a.toggleGroup;Ext.copyTo(b,a,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(b,{text:a.overflowText||a.text,hideOnClick:d});(c||a.enableToggle)&&Ext.apply(b,{group:c,checked:a.pressed,listeners:{checkchange:function(c,b){a.toggle(b)}}});delete b.ownerCt;delete b.xtype;delete b.id;return b},addComponentToMenu:function(b,a){if(a instanceof Ext.Toolbar.Separator)b.add("-");else if(Ext.isFunction(a.isXType))if(a.isXType("splitbutton"))b.add(this.createMenuConfig(a,true));else if(a.isXType("button"))b.add(this.createMenuConfig(a,!a.menu));else a.isXType("buttongroup")&&a.items.each(function(a){this.addComponentToMenu(b,a)},this)},clearMenu:function(){var a=this.moreMenu;a&&a.items&&a.items.each(function(a){delete a.menu})},beforeMoreShow:function(b){var f=this.container.items.items,g=f.length,a,c,e=function(a,b){return a.isXType("buttongroup")&&!(b instanceof Ext.Toolbar.Separator)};this.clearMenu();b.removeAll();for(var d=0;d<g;d++){a=f[d];if(a.xtbHidden){c&&(e(a,c)||e(c,a))&&b.add("-");this.addComponentToMenu(b,a);c=a}}b.items.length<1&&b.add(this.noItemsMenuText)},initMore:function(){if(!this.more){this.moreMenu=new Ext.menu.Menu({ownerCt:this.container,listeners:{beforeshow:this.beforeMoreShow,scope:this}});this.more=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.moreMenu,ownerCt:this.container});var a=this.insertCell(this.more,this.extrasTr,100);this.more.render(a)}},destroy:function(){Ext.destroy(this.more,this.moreMenu);delete this.leftTr;delete this.rightTr;delete this.extrasTr;Ext.layout.ToolbarLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.toolbar=Ext.layout.ToolbarLayout;Ext.layout.MenuLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"menu",setContainer:function(a){this.monitorResize=!a.floating;a.on("autosize",this.doAutoSize,this);Ext.layout.MenuLayout.superclass.setContainer.call(this,a)},renderItem:function(a,b,c){if(!this.itemTpl)this.itemTpl=Ext.layout.MenuLayout.prototype.itemTpl=new Ext.XTemplate('<li id="{itemId}" class="{itemCls}">','<tpl if="needsIcon">','<img src="{icon}" class="{iconCls}"/>',"</tpl>","</li>");if(a&&!a.rendered){if(Ext.isNumber(b))b=c.dom.childNodes[b];var d=this.getItemArgs(a);a.render(a.positionEl=b?this.itemTpl.insertBefore(b,d,true):this.itemTpl.append(c,d,true));a.positionEl.menuItemId=a.getItemId();!d.isMenuItem&&d.needsIcon&&a.positionEl.addClass("x-menu-list-item-indent");this.configureItem(a,b)}else if(a&&!this.isValidParent(a,c)){if(Ext.isNumber(b))b=c.dom.childNodes[b];c.dom.insertBefore(a.getActionEl().dom,b||null)}},getItemArgs:function(a){var b=a instanceof Ext.menu.Item;return {isMenuItem:b,needsIcon:!b&&(a.icon||a.iconCls),icon:a.icon||Ext.BLANK_IMAGE_URL,iconCls:"x-menu-item-icon "+(a.iconCls||""),itemId:"x-menu-el-"+a.id,itemCls:"x-menu-list-item "}},isValidParent:function(b,a){return b.el.up("li.x-menu-list-item",5).dom.parentNode===(a.dom||a)},onLayout:function(b,a){Ext.layout.MenuLayout.superclass.onLayout.call(this,b,a);this.doAutoSize()},doAutoSize:function(){var a=this.container,c=a.width;if(a.floating)if(c)a.setWidth(c);else if(Ext.isIE){a.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8)?"auto":a.minWidth);var b=a.getEl(),d=b.dom.offsetWidth;a.setWidth(a.getLayoutTarget().getWidth()+b.getFrameWidth("lr"))}}});Ext.Container.LAYOUTS["menu"]=Ext.layout.MenuLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(b,a){this.fireEvent("resize",this,b,a,b,a)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",preventBodyReset:false,padding:undefined,resizeEvent:"bodyresize",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:.25},collapseDefaults:{duration:.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.unstyled)this.baseCls="x-plain";this.toolbars=[];if(this.tbar){this.elements+=",tbar";this.topToolbar=this.createToolbar(this.tbar);this.tbar=null}if(this.bbar){this.elements+=",bbar";this.bottomToolbar=this.createToolbar(this.bbar);this.bbar=null}if(this.header===true){this.elements+=",header";this.header=null}else if(this.headerCfg||this.title&&this.header!==false)this.elements+=",header";if(this.footerCfg||this.footer===true){this.elements+=",footer";this.footer=null}if(this.buttons){this.fbar=this.buttons;this.buttons=null}this.fbar&&this.createFbar(this.fbar);this.autoLoad&&this.on("render",this.doAutoLoad,this,{delay:10})},createFbar:function(a){var b=this.minButtonWidth;this.elements+=",footer";this.fbar=this.createToolbar(a,{buttonAlign:this.buttonAlign,toolbarCls:"x-panel-fbar",enableOverflow:false,defaults:function(a){return {minWidth:a.minWidth||b}}});this.fbar.items.each(function(a){a.minWidth=a.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(a,c){var b;if(Ext.isArray(a))a={items:a};b=a.events?Ext.apply(a,c):this.createComponent(Ext.apply({},a,c),"toolbar");this.toolbars.push(b);return b},createElement:function(a,b){if(this[a]){b.appendChild(this[a].dom);return}if(a==="bwrap"||this.elements.indexOf(a)!=-1){if(this[a+"Cfg"])this[a]=Ext.fly(b).createChild(this[a+"Cfg"]);else{var c=document.createElement("div");c.className=this[a+"Cls"];this[a]=Ext.get(b.appendChild(c))}this[a+"CssClass"]&&this[a].addClass(this[a+"CssClass"]);this[a+"Style"]&&this[a].applyStyles(this[a+"Style"])}},onRender:function(i,g){Ext.Panel.superclass.onRender.call(this,i,g);this.createClasses();var b=this.el,c=b.dom,a,f;if(this.collapsible&&!this.hideCollapseTool){this.tools=this.tools?this.tools.slice(0):[];this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.tools){f=this.tools;this.elements+=this.header!==false?",header":""}this.tools={};b.addClass(this.baseCls);if(c.firstChild){this.header=b.down("."+this.headerCls);this.bwrap=b.down("."+this.bwrapCls);var d=this.bwrap?this.bwrap:b;this.tbar=d.down("."+this.tbarCls);this.body=d.down("."+this.bodyCls);this.bbar=d.down("."+this.bbarCls);this.footer=d.down("."+this.footerCls);this.fromMarkup=true}this.preventBodyReset===true&&b.addClass("x-panel-reset");this.cls&&b.addClass(this.cls);if(this.buttons)this.elements+=",footer";if(this.frame){b.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",c.firstChild.firstChild.firstChild);this.createElement("bwrap",c);a=this.bwrap.dom;var j=c.childNodes[1],h=c.childNodes[2];a.appendChild(j);a.appendChild(h);var e=a.firstChild.firstChild.firstChild;this.createElement("tbar",e);this.createElement("body",e);this.createElement("bbar",e);this.createElement("footer",a.lastChild.firstChild.firstChild);if(!this.footer)this.bwrap.dom.lastChild.className+=" x-panel-nofooter";this.ft=Ext.get(this.bwrap.dom.lastChild);this.mc=Ext.get(e)}else{this.createElement("header",c);this.createElement("bwrap",c);a=this.bwrap.dom;this.createElement("tbar",a);this.createElement("body",a);this.createElement("bbar",a);this.createElement("footer",a);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");this.tbar&&this.tbar.addClass(this.tbarCls+"-noheader")}}Ext.isDefined(this.padding)&&this.body.setStyle("padding",this.body.addUnits(this.padding));if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");this.header&&this.header.addClass(this.headerCls+"-noborder");this.footer&&this.footer.addClass(this.footerCls+"-noborder");this.tbar&&this.tbar.addClass(this.tbarCls+"-noborder");this.bbar&&this.bbar.addClass(this.bbarCls+"-noborder")}this.bodyBorder===false&&this.body.addClass(this.bodyCls+"-noborder");this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";this.iconCls&&this.setIconClass(this.iconCls)}}this.floating&&this.makeFloating(this.floating);if(this.collapsible&&this.titleCollapse&&this.header){this.mon(this.header,"click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}f&&this.addTool.apply(this,f);if(this.fbar){this.footer.addClass("x-panel-btns");this.fbar.ownerCt=this;this.fbar.render(this.footer);this.footer.createChild({cls:"x-clear"})}if(this.tbar&&this.topToolbar){this.topToolbar.ownerCt=this;this.topToolbar.render(this.tbar)}if(this.bbar&&this.bottomToolbar){this.bottomToolbar.ownerCt=this;this.bottomToolbar.render(this.bbar)}},setIconClass:function(c){var a=this.iconCls;this.iconCls=c;if(this.rendered&&this.header)if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(a,this.iconCls)}else{var e=this.header,d=e.child("img.x-panel-inline-icon");if(d)Ext.fly(d).replaceClass(a,this.iconCls);else{var b=e.child("span."+this.headerTextCls);b&&Ext.DomHelper.insertBefore(b.dom,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}this.fireEvent("iconchange",this,c,a)},makeFloating:function(a){this.floating=true;this.el=new Ext.Layer(Ext.apply({},a,{shadow:Ext.isDefined(this.shadow)?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined}),this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},getFooterToolbar:function(){return this.fbar},addButton:function(a,b,c){!this.fbar&&this.createFbar([]);if(b){if(Ext.isString(a))a={text:a};a=Ext.apply({handler:b,scope:c},a)}return this.fbar.add(a)},addTool:function(){if(!this.rendered){if(!this.tools)this.tools=[];Ext.each(arguments,function(a){this.tools.push(a)},this);return}if(!this[this.toolTarget])return;if(!this.toolTemplate){var c=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');c.disableFormats=true;c.compile();Ext.Panel.prototype.toolTemplate=c}for(var d=0,f=arguments,g=f.length;d<g;d++){var a=f[d];if(!this.tools[a.id]){var e="x-tool-"+a.id+"-over",b=this.toolTemplate.insertFirst(this[this.toolTarget],a,true);this.tools[a.id]=b;b.enableDisplayMode("block");this.mon(b,"click",this.createToolHandler(b,a,e,this));a.on&&this.mon(b,a.on);a.hidden&&b.hide();if(a.qtip)if(Ext.isObject(a.qtip))Ext.QuickTips.register(Ext.apply({target:b.id},a.qtip));else b.dom.qtip=a.qtip;b.addClassOnOver(e)}}},onLayout:function(b,a){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){Ext.each(this.toolbars,function(b){b.doLayout(undefined,a)});this.syncHeight()}},syncHeight:function(){var c=this.toolbarHeight,d=this.body,a=this.lastSize.height,b;if(this.autoHeight||!Ext.isDefined(a)||a=="auto")return;if(c!=this.getToolbarHeight()){c=Math.max(0,a-this.getFrameHeight());d.setHeight(c);b=d.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(b.width,b.height)}},onShow:function(){if(this.floating)return this.el.show();Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating)return this.el.hide();Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(b,a,c,d){return function(e){b.removeClass(c);a.stopEvent!==false&&e.stopEvent();a.handler&&a.handler.call(a.scope||b,e,b,d,a)}},afterRender:function(){this.floating&&!this.hidden&&this.el.show();this.title&&this.setTitle(this.title);Ext.Panel.superclass.afterRender.call(this);if(this.collapsed){this.collapsed=false;this.collapse(false)}this.initEvents()},getKeyMap:function(){if(!this.keyMap)this.keyMap=new Ext.KeyMap(this.el,this.keys);return this.keyMap},initEvents:function(){this.keys&&this.getKeyMap();this.draggable&&this.initDraggable();if(this.toolbars.length>0){Ext.each(this.toolbars,function(a){a.doLayout();a.on({scope:this,afterlayout:this.syncHeight,remove:this.syncHeight})},this);this.syncHeight()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)},beforeEffect:function(a){this.floating&&this.el.beforeAction();a!==false&&this.el.addClass("x-panel-animated")},afterEffect:function(){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(a,c,d){var b={scope:d,block:true};if(a===true){b.callback=c;return b}else if(!a.callback)b.callback=c;else b.callback=function(){c.call(d);Ext.callback(a.callback,a.scope)};return Ext.applyIf(b,a)},collapse:function(a){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,a)===false)return;var b=a===true||a!==false&&this.animCollapse;this.beforeEffect(b);this.onCollapse(b,a);return this},onCollapse:function(b,a){if(b)this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(a||true,this.afterCollapse,this),this.collapseDefaults));else{this[this.collapseEl].hide(this.hideMode);this.afterCollapse(false)}},afterCollapse:function(a){this.collapsed=true;this.el.addClass(this.collapsedCls);a!==false&&this[this.collapseEl].hide(this.hideMode);this.afterEffect(a);this.cascade(function(a){if(a.lastSize)a.lastSize={width:undefined,height:undefined}});this.fireEvent("collapse",this)},expand:function(a){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,a)===false)return;var b=a===true||a!==false&&this.animCollapse;this.el.removeClass(this.collapsedCls);this.beforeEffect(b);this.onExpand(b,a);return this},onExpand:function(b,a){if(b)this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(a||true,this.afterExpand,this),this.expandDefaults));else{this[this.collapseEl].show(this.hideMode);this.afterExpand(false)}},afterExpand:function(a){this.collapsed=false;a!==false&&this[this.collapseEl].show(this.hideMode);this.afterEffect(a);if(this.deferLayout){delete this.deferLayout;this.doLayout(true)}this.fireEvent("expand",this)},toggleCollapse:function(a){this[this.collapsed?"expand":"collapse"](a);return this},onDisable:function(){this.rendered&&this.maskDisabled&&this.el.mask();Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){this.rendered&&this.maskDisabled&&this.el.unmask();Ext.Panel.superclass.onEnable.call(this)},onResize:function(d,c,f,e){var a=d,b=c;if(Ext.isDefined(a)||Ext.isDefined(b)){if(!this.collapsed){if(Ext.isNumber(a))this.body.setWidth(a=this.adjustBodyWidth(a-this.getFrameWidth()));else if(a=="auto")a=this.body.setWidth("auto").dom.offsetWidth;else a=this.body.dom.offsetWidth;if(this.tbar){this.tbar.setWidth(a);this.topToolbar&&this.topToolbar.setSize(a)}if(this.bbar){this.bbar.setWidth(a);if(this.bottomToolbar){this.bottomToolbar.setSize(a);if(Ext.isIE){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(a);this.fbar&&this.fbar.setSize(Ext.isIE?a-this.footer.getFrameWidth("lr"):"auto")}if(Ext.isNumber(b)){b=Math.max(0,b-this.getFrameHeight());this.body.setHeight(b)}else b=="auto"&&this.body.setHeight(b);this.disabled&&this.el._mask&&this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}else{this.queuedBodySize={width:a,height:b};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height)},this,{single:true})}}this.onBodyResize(a,b)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,d,c,f,e)},onBodyResize:function(b,a){this.fireEvent("bodyresize",this,b,a)},getToolbarHeight:function(){var a=0;this.rendered&&Ext.each(this.toolbars,function(b){a+=b.getHeight()},this);return a},adjustBodyHeight:function(a){return a},adjustBodyWidth:function(a){return a},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var a=this.el.getFrameWidth("lr")+this.bwrap.getFrameWidth("lr");if(this.frame){var b=this.bwrap.dom.firstChild;a+=Ext.fly(b).getFrameWidth("l")+Ext.fly(b.firstChild).getFrameWidth("r");a+=this.mc.getFrameWidth("lr")}return a},getFrameHeight:function(){var a=Math.max(0,this.getHeight()-this.body.getHeight());if(isNaN(a))a=0;return a},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.body.getHeight()},syncShadow:function(){this.floating&&this.el.sync(true)},getLayoutTarget:function(){return this.body},getContentTarget:function(){return this.body},setTitle:function(a,b){this.title=a;this.header&&this.headerAsText&&this.header.child("span").update(a);b&&this.setIconClass(b);this.fireEvent("titlechange",this,a);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var a=this.body.getUpdater();a.update.apply(a,arguments);return this},beforeDestroy:function(){Ext.Panel.superclass.beforeDestroy.call(this);this.header&&this.header.removeAllListeners();if(this.tools)for(var a in this.tools)Ext.destroy(this.tools[a]);this.toolbars.length>0&&Ext.each(this.toolbars,function(a){a.un("afterlayout",this.syncHeight,this);a.un("remove",this.syncHeight,this)},this);if(Ext.isArray(this.buttons))while(this.buttons.length)Ext.destroy(this.buttons[0]);if(this.rendered){Ext.destroy(this.ft,this.header,this.footer,this.tbar,this.bbar,this.body,this.mc,this.bwrap,this.dd);this.fbar&&Ext.destroy(this.fbar,this.fbar.el)}Ext.destroy(this.toolbars)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(d,e,b){var a=document.createElement("div");a.className="x-panel-ghost "+(d?d:"");this.header&&a.appendChild(this.el.dom.firstChild.cloneNode(true));Ext.fly(a.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());a.style.width=this.el.dom.offsetWidth+"px";if(!b)this.container.dom.appendChild(a);else Ext.getDom(b).appendChild(a);if(e!==false&&this.el.useShim!==false){var c=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},a);c.show();return c}else return new Ext.Element(a)},doAutoLoad:function(){var a=this.body.getUpdater();this.renderer&&a.setRenderer(this.renderer);a.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad})},getTool:function(a){return this.tools[a]}});Ext.reg("panel",Ext.Panel);Ext.DatePicker=Ext.extend(Ext.BoxComponent,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,focusOnSelect:true,initHour:12,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime(true):(new Date).clearTime();this.addEvents("select");this.handler&&this.on("select",this.handler,this.scope||this);this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var a=this.disabledDates,c=a.length-1,b="(?:";Ext.each(a,function(d,e){b+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":a[e];if(e!=c)b+="|"},this);this.disabledDatesRE=new RegExp(b+")")}},setDisabledDates:function(a){if(Ext.isArray(a)){this.disabledDates=a;this.disabledDatesRE=null}else this.disabledDatesRE=a;this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(a){this.disabledDays=a;this.update(this.value,true)},setMinDate:function(a){this.minDate=a;this.update(this.value,true)},setMaxDate:function(a){this.maxDate=a;this.update(this.value,true)},setValue:function(a){this.value=a.clearTime(true);this.update(this.value)},getValue:function(){return this.value},focus:function(){this.update(this.activeDate)},onEnable:function(a){Ext.DatePicker.superclass.onEnable.call(this);this.doDisabled(false);this.update(a?this.value:this.activeDate);Ext.isIE&&this.el.repaint()},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);Ext.isIE&&!Ext.isIE8&&Ext.each([].concat(this.textNodes,this.el.query("th span")),function(a){Ext.fly(a).repaint()})},doDisabled:function(a){this.keyNav.setDisabled(a);this.prevRepeater.setDisabled(a);this.nextRepeater.setDisabled(a);if(this.showToday){this.todayKeyListener.setDisabled(a);this.todayBtn.setDisabled(a)}},onRender:function(f,g){for(var a=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],h=this.dayNames,b=0;b<7;b++){var d=this.startDay+b;if(d>6)d=d-7;a.push("<th><span>",h[d].substr(0,1),"</span></th>")}a[a.length]="</tr></thead><tbody><tr>";for(b=0;b<42;b++){if(b%7===0&&b!==0)a[a.length]="</tr><tr>";a[a.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}a.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var c=document.createElement("div");c.className="x-date-picker";c.innerHTML=a.join("");f.dom.insertBefore(c,g);this.el=Ext.get(c);this.eventEl=Ext.get(c.firstChild);this.prevRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.nextRepeater=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.keyNav=new Ext.KeyNav(this.eventEl,{left:function(a){if(a.ctrlKey)this.showPrevMonth();else this.update(this.activeDate.add("d",-1))},right:function(a){if(a.ctrlKey)this.showNextMonth();else this.update(this.activeDate.add("d",1))},up:function(a){if(a.ctrlKey)this.showNextYear();else this.update(this.activeDate.add("d",-7))},down:function(a){if(a.ctrlKey)this.showPrevYear();else this.update(this.activeDate.add("d",7))},pageUp:function(){this.showNextMonth()},pageDown:function(){this.showPrevMonth()},enter:function(a){a.stopPropagation();return true},scope:this});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.el.child("em").addClass("x-btn-arrow");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var e=(new Date).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,e),tooltip:String.format(this.todayTip,e),handler:this.selectToday,scope:this})}this.mon(this.eventEl,"mousewheel",this.handleMouseWheel,this);this.mon(this.eventEl,"click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.mon(this.mbtn,"click",this.showMonthPicker,this);this.onEnable(true)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){for(var b=['<table border="0" cellspacing="0">'],a=0;a<6;a++)b.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(a),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(a+6),"</a></td>",a===0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>');b.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(b.join(""));this.mon(this.monthPicker,"click",this.onMonthClick,this);this.mon(this.monthPicker,"dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(b,c,a){a+=1;if(a%2===0)b.dom.xmonth=5+Math.round(a*.5);else b.dom.xmonth=Math.round((a-1)*.5)})}},showMonthPicker:function(){if(!this.disabled){this.createMonthPicker();var a=this.el.getSize();this.monthPicker.setSize(a);this.monthPicker.child("table").setSize(a);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:.2})}},updateMPYear:function(d){this.mpyear=d;for(var e=this.mpYears.elements,b=1;b<=10;b++){var c=e[b-1],a;if(b%2===0){a=d+Math.round(b*.5);c.firstChild.innerHTML=a;c.xyear=a}else{a=d-(5-Math.round(b*.5));c.firstChild.innerHTML=a;c.xyear=a}this.mpYears.item(b-1)[a==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(a){this.mpMonths.each(function(b){b[b.dom.xmonth==a?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(){},onMonthClick:function(d,e){d.stopEvent();var a=new Ext.Element(e),b;if(a.is("button.x-date-mp-cancel"))this.hideMonthPicker();else if(a.is("button.x-date-mp-ok")){var c=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(c.getMonth()!=this.mpSelMonth)c=(new Date(this.mpSelYear,this.mpSelMonth,1)).getLastDateOfMonth();this.update(c);this.hideMonthPicker()}else if(b=a.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");b.addClass("x-date-mp-sel");this.mpSelMonth=b.dom.xmonth}else if(b=a.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");b.addClass("x-date-mp-sel");this.mpSelYear=b.dom.xyear}else if(a.is("a.x-date-mp-prev"))this.updateMPYear(this.mpyear-10);else a.is("a.x-date-mp-next")&&this.updateMPYear(this.mpyear+10)},onMonthDblClick:function(c,d){c.stopEvent();var b=new Ext.Element(d),a;if(a=b.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,a.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else if(a=b.up("td.x-date-mp-year",2)){this.update(new Date(a.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}},hideMonthPicker:function(a){if(this.monthPicker)if(a===true)this.monthPicker.hide();else this.monthPicker.slideOut("t",{duration:.2})},showPrevMonth:function(){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(b){b.stopEvent();if(!this.disabled){var a=b.getWheelDelta();if(a>0)this.showPrevMonth();else a<0&&this.showNextMonth()}},handleDateClick:function(b,a){b.stopEvent();if(!this.disabled&&a.dateValue&&!Ext.fly(a.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(a.dateValue));delete this.cancelFocus;this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue((new Date).clearTime());this.fireEvent("select",this,this.value)}},update:function(b,w){if(this.rendered){var n=this.activeDate,u=this.isVisible();this.activeDate=b;if(!w&&n&&this.el){var D=b.getTime();if(n.getMonth()==b.getMonth()&&n.getFullYear()==b.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(a){if(a.dom.firstChild.dateValue==D){a.addClass("x-date-selected");u&&!this.cancelFocus&&Ext.fly(a.dom.firstChild).focus(50);return false}},this);return}}var r=b.getDaysInMonth(),v=b.getFirstDateOfMonth(),d=v.getDay()-this.startDay;if(d<0)d+=7;r+=d;var m=b.add("mo",-1),p=m.getDaysInMonth()-d,e=this.cells.elements,l=this.textNodes,c=new Date(m.getFullYear(),m.getMonth(),p,this.initHour),B=(new Date).clearTime().getTime(),C=b.clearTime(true).getTime(),t=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,s=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,g=this.disabledDatesRE,z=this.disabledDatesText,i=this.disabledDays?this.disabledDays.join(""):false,x=this.disabledDaysText,h=this.format;if(this.showToday){var j=(new Date).clearTime(),q=j<t||j>s||g&&h&&g.test(j.dateFormat(h))||i&&i.indexOf(j.getDay())!=-1;if(!this.disabled){this.todayBtn.setDisabled(q);this.todayKeyListener[q?"disable":"enable"]()}}for(var k=function(d,a){a.title="";var b=c.clearTime(true).getTime();a.firstChild.dateValue=b;if(b==B){a.className+=" x-date-today";a.title=d.todayText}if(b==C){a.className+=" x-date-selected";u&&Ext.fly(a.firstChild).focus(50)}if(b<t){a.className=" x-date-disabled";a.title=d.minText;return}if(b>s){a.className=" x-date-disabled";a.title=d.maxText;return}if(i)if(i.indexOf(c.getDay())!=-1){a.title=x;a.className=" x-date-disabled"}if(g&&h){var e=c.dateFormat(h);if(g.test(e)){a.title=z.replace("%0",e);a.className=" x-date-disabled"}}},a=0;a<d;a++){l[a].innerHTML=++p;c.setDate(c.getDate()+1);e[a].className="x-date-prevday";k(this,e[a])}for(;a<r;a++){var A=a-d+1;l[a].innerHTML=A;c.setDate(c.getDate()+1);e[a].className="x-date-active";k(this,e[a])}for(var y=0;a<42;a++){l[a].innerHTML=++y;c.setDate(c.getDate()+1);e[a].className="x-date-nextday";k(this,e[a])}this.mbtn.setText(this.monthNames[b.getMonth()]+" "+b.getFullYear());if(!this.internalRender){var f=this.el.dom.firstChild,o=f.offsetWidth;this.el.setWidth(o+this.el.getBorderWidth("lr"));Ext.fly(f).setWidth(o);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){f.rows[0].cells[1].style.width=o-(f.rows[0].cells[0].offsetWidth+f.rows[0].cells[2].offsetWidth)+"px";this.secondPass=true;this.update.defer(10,this,[b])}}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.keyNav,this.monthPicker,this.eventEl,this.mbtn,this.nextRepeater,this.prevRepeater,this.cells.el,this.todayBtn);delete this.textNodes;delete this.cells.elements}}});Ext.reg("datepicker",Ext.DatePicker);Ext.LoadMask=function(c,b){this.el=Ext.get(c);Ext.apply(this,b);if(this.store){this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.onLoad});this.removeMask=Ext.value(this.removeMask,false)}else{var a=this.el.getUpdater();a.showLoadIndicator=false;a.on({scope:this,beforeupdate:this.onBeforeLoad,update:this.onLoad,failure:this.onLoad});this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){!this.disabled&&this.el.mask(this.msg,this.msgCls)},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoad,this)}else{var a=this.el.getUpdater();a.un("beforeupdate",this.onBeforeLoad,this);a.un("update",this.onLoad,this);a.un("failure",this.onLoad,this)}}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(e,b){var c=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");this.el=b?c.insertBefore(b,{cls:this.baseCls},true):c.append(e,{cls:this.baseCls},true);if(this.id)this.el.dom.id=this.id;var a=this.el.dom.firstChild;this.progressBar=Ext.get(a.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var d=Ext.get(a.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,d.dom.firstChild]);this.textEl.setWidth(a.offsetWidth)}this.progressBar.setHeight(a.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value)this.updateProgress(this.value,this.text);else this.updateText(this.text)},updateProgress:function(a,b,c){this.value=a||0;b&&this.updateText(b);if(this.rendered&&!this.isDestroyed){var d=Math.floor(a*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(d,c===true||c!==false&&this.animate);this.textTopEl&&this.textTopEl.removeClass("x-hidden").setWidth(d)}this.fireEvent("update",this,a,b);return this},wait:function(a){if(!this.waitTimer){var b=this;a=a||{};this.updateText(a.text);this.waitTimer=Ext.TaskMgr.start({run:function(c){var b=a.increment||10;c-=1;this.updateProgress(((c+b)%b+1)*(100/b)*.01,null,a.animate)},interval:a.interval||1e3,duration:a.duration,onStop:function(){a.fn&&a.fn.apply(a.scope||this);this.reset()},scope:b})}return this},isWaiting:function(){return this.waitTimer!==null},updateText:function(a){this.text=a||"&#160;";this.rendered&&this.textEl.update(this.text);return this},syncProgressBar:function(){this.value&&this.updateProgress(this.value,this.text);return this},setSize:function(c,b){Ext.ProgressBar.superclass.setSize.call(this,c,b);if(this.textTopEl){var a=this.el.dom.firstChild;this.textEl.setSize(a.offsetWidth,a.offsetHeight)}this.syncProgressBar();return this},reset:function(a){this.updateProgress(0);this.textTopEl&&this.textTopEl.addClass("x-hidden");this.clearTimer();a===true&&this.hide();return this},clearTimer:function(){if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}},onDestroy:function(){this.clearTimer();if(this.rendered){this.textEl.isComposite&&this.textEl.clear();Ext.destroyMembers(this,"textEl","progressBar","textTopEl")}Ext.ProgressBar.superclass.onDestroy.call(this)}});Ext.reg("progress",Ext.ProgressBar);(function(){var a=Ext.EventManager,b=Ext.lib.Dom;Ext.dd.DragDrop=function(a,c,b){a&&this.init(a,c,b)};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,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(){},startDrag:function(){},b4Drag:function(){},onDrag:function(){},onDragEnter:function(){},b4DragOver:function(){},onDragOver:function(){},b4DragOut:function(){},onDragOut:function(){},b4DragDrop:function(){},onDragDrop:function(){},onInvalidDrop:function(){},b4EndDrag:function(){},endDrag:function(){},b4MouseDown:function(){},onMouseDown:function(){},onMouseUp:function(){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(j,a){if(Ext.isNumber(a))a={left:a,right:a,top:a,bottom:a};a=a||this.defaultPadding;var c=Ext.get(this.getEl()).getBox(),e=Ext.get(j),i=e.getScroll(),b,d=e.dom;if(d==document.body)b={x:i.left,y:i.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()};else{var h=e.getXY();b={x:h[0],y:h[1],width:d.clientWidth,height:d.clientHeight}}var g=c.y-b.y,f=c.x-b.x;this.resetConstraints();this.setXConstraint(f-(a.left||0),b.width-f-c.width-(a.right||0),this.xTickSize);this.setYConstraint(g-(a.top||0),b.height-g-c.height-(a.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef)this._domRef=Ext.getDom(this.id);return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(d,c,b){this.initTarget(d,c,b);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(a,b,c){this.config=c||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof a!=="string")a=Ext.id(a);this.id=a;this.addToGroup(b?b:"default");this.handleElId=a;this.setDragElId(a);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=this.config.isTarget!==false;this.maintainOffset=this.config.maintainOffset;this.primaryButtonOnly=this.config.primaryButtonOnly!==false},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(a,b,c,d){if(!b&&0!==b)this.padding=[a,a,a,a];else if(!c&&0!==c)this.padding=[a,b,a,b];else this.padding=[a,b,c,d]},setInitPosition:function(d,e){var c=this.getEl();if(!this.DDM.verifyEl(c))return;var f=d||0,g=e||0,a=b.getXY(c);this.initPageX=a[0]-f;this.initPageY=a[1]-g;this.lastPageX=a[0];this.lastPageY=a[1];this.setStartPosition(a)},setStartPosition:function(c){var a=c||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=a[0];this.startPageY=a[1]},addToGroup:function(a){this.groups[a]=true;this.DDM.regDragDrop(this,a)},removeFromGroup:function(a){if(this.groups[a])delete this.groups[a];this.DDM.removeDDFromGroup(this,a)},setDragElId:function(a){this.dragElId=a},setHandleElId:function(a){if(typeof a!=="string")a=Ext.id(a);this.handleElId=a;this.DDM.regHandle(this.id,a)},setOuterHandleElId:function(b){if(typeof b!=="string")b=Ext.id(b);a.on(b,"mousedown",this.handleMouseDown,this);this.setHandleElId(b);this.hasOuterHandles=true},unreg:function(){a.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return this.DDM.isLocked()||this.locked},handleMouseDown:function(a){if(this.primaryButtonOnly&&a.button!=0)return;if(this.isLocked())return;this.DDM.refreshCache(this.groups);var b=new Ext.lib.Point(Ext.lib.Event.getPageX(a),Ext.lib.Event.getPageY(a));if(!(!this.hasOuterHandles&&!this.DDM.isOverTarget(b,this)))if(this.clickValidator(a)){this.setStartPosition();this.b4MouseDown(a);this.onMouseDown(a);this.DDM.handleMouseDown(a,this);this.DDM.stopEvent(a)}},clickValidator:function(b){var a=b.getTarget();return this.isValidHandleChild(a)&&(this.id==this.handleElId||this.DDM.handleWasClicked(a,this.id))},addInvalidHandleType:function(b){var a=b.toUpperCase();this.invalidHandleTypes[a]=a},addInvalidHandleId:function(a){if(typeof a!=="string")a=Ext.id(a);this.invalidHandleIds[a]=a},addInvalidHandleClass:function(a){this.invalidHandleClasses.push(a)},removeInvalidHandleType:function(a){var b=a.toUpperCase();delete this.invalidHandleTypes[b]},removeInvalidHandleId:function(a){if(typeof a!=="string")a=Ext.id(a);delete this.invalidHandleIds[a]},removeInvalidHandleClass:function(b){for(var a=0,c=this.invalidHandleClasses.length;a<c;++a)if(this.invalidHandleClasses[a]==b)delete this.invalidHandleClasses[a]},isValidHandleChild:function(b){var a=true,c;try{c=b.nodeName.toUpperCase()}catch(f){c=b.nodeName}a=a&&!this.invalidHandleTypes[c];a=a&&!this.invalidHandleIds[b.id];for(var d=0,e=this.invalidHandleClasses.length;a&&d<e;++d)a=!Ext.fly(b).hasClass(this.invalidHandleClasses[d]);return a},setXTicks:function(d,c){this.xTicks=[];this.xTickSize=c;for(var b={},a=this.initPageX;a>=this.minX;a=a-c)if(!b[a]){this.xTicks[this.xTicks.length]=a;b[a]=true}for(a=this.initPageX;a<=this.maxX;a=a+c)if(!b[a]){this.xTicks[this.xTicks.length]=a;b[a]=true}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(d,c){this.yTicks=[];this.yTickSize=c;for(var b={},a=this.initPageY;a>=this.minY;a=a-c)if(!b[a]){this.yTicks[this.yTicks.length]=a;b[a]=true}for(a=this.initPageY;a<=this.maxY;a=a+c)if(!b[a]){this.yTicks[this.yTicks.length]=a;b[a]=true}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(c,b,a){this.leftConstraint=c;this.rightConstraint=b;this.minX=this.initPageX-c;this.maxX=this.initPageX+b;a&&this.setXTicks(this.initPageX,a);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,b,a){this.topConstraint=c;this.bottomConstraint=b;this.minY=this.initPageY-c;this.maxY=this.initPageY+b;a&&this.setYTicks(this.initPageY,a);this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var a=this.maintainOffset?this.lastPageX-this.initPageX:0,b=this.maintainOffset?this.lastPageY-this.initPageY:0;this.setInitPosition(a,b)}else this.setInitPosition();this.constrainX&&this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);this.constrainY&&this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)},getTick:function(b,a){if(!a)return b;else if(a[0]>=b)return a[0];else{for(var c=0,g=a.length;c<g;++c){var d=c+1;if(a[d]&&a[d]>=b){var e=b-a[c],f=a[d]-b;return f>e?a[c]:a[d]}}return a[a.length-1]}},toString:function(){return "DragDrop "+this.id}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var a=Ext.EventManager;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(c,d){for(var b in this.ids)for(var e in this.ids[b]){var a=this.ids[b][e];if(!this.isTypeOfDD(a))continue;a[c].apply(a,d)}},_onLoad:function(){this.init();a.on(document,"mouseup",this.handleMouseUp,this,true);a.on(document,"mousemove",this.handleMouseMove,this,true);a.on(window,"unload",this._onUnload,this,true);a.on(window,"resize",this._onResize,this,true)},_onResize:function(){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,a){!this.initialized&&this.init();if(!this.ids[a])this.ids[a]={};this.ids[a][b.id]=b},removeDDFromGroup:function(c,a){if(!this.ids[a])this.ids[a]={};var b=this.ids[a];if(b&&b[c.id])delete b[c.id]},_remove:function(a){for(var b in a.groups)if(b&&this.ids[b]&&this.ids[b][a.id])delete this.ids[b][a.id];delete this.handleIds[a.id]},regHandle:function(a,b){if(!this.handleIds[a])this.handleIds[a]={};this.handleIds[a][b]=b},isDragDrop:function(a){return this.getDDById(a)?true:false},getRelated:function(e,d){var a=[];for(var c in e.groups)for(var f in this.ids[c]){var b=this.ids[c][f];if(!this.isTypeOfDD(b))continue;if(!d||b.isTarget)a[a.length]=b}return a},isLegalTarget:function(e,c){for(var b=this.getRelated(e,true),a=0,d=b.length;a<d;++a)if(b[a].id==c.id)return true;return false},isTypeOfDD:function(a){return a&&a.__ygDragDrop},isHandle:function(a,b){return this.handleIds[a]&&this.handleIds[a][b]},getDDById:function(a){for(var b in this.ids)if(this.ids[b][a])return this.ids[b][a];return null},handleMouseDown:function(a,b){Ext.QuickTips&&Ext.QuickTips.disable();this.dragCurrent&&this.handleMouseUp(a);this.currentTarget=a.getTarget();this.dragCurrent=b;var c=b.getEl();this.startX=a.getPageX();this.startY=a.getPageY();this.deltaX=this.startX-c.offsetLeft;this.deltaY=this.startY-c.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var a=Ext.dd.DDM;a.startDrag(a.startX,a.startY)},this.clickTimeThresh)},startDrag:function(a,b){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(a,b);this.dragCurrent.startDrag(a,b)}this.dragThreshMet=true},handleMouseUp:function(a){Ext.QuickTips&&Ext.QuickTips.enable();if(!this.dragCurrent)return;clearTimeout(this.clickTimeout);this.dragThreshMet&&this.fireEvents(a,true);this.stopDrag(a);this.stopEvent(a)},stopEvent:function(a){this.stopPropagation&&a.stopPropagation();this.preventDefault&&a.preventDefault()},stopDrag:function(a){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(a);this.dragCurrent.endDrag(a)}this.dragCurrent.onMouseUp(a)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(a){if(!this.dragCurrent)return true;if(Ext.isIE&&(a.button!==0&&a.button!==1&&a.button!==2)){this.stopEvent(a);return this.handleMouseUp(a)}if(!this.dragThreshMet){var b=Math.abs(this.startX-a.getPageX()),c=Math.abs(this.startY-a.getPageY());(b>this.clickPixelThresh||c>this.clickPixelThresh)&&this.startDrag(this.startX,this.startY)}if(this.dragThreshMet){this.dragCurrent.b4Drag(a);this.dragCurrent.onDrag(a);!this.dragCurrent.moveOnly&&this.fireEvents(a,false)}this.stopEvent(a);return true},fireEvents:function(c,m){var b=this.dragCurrent;if(!b||b.isLocked())return;var n=c.getPoint(),l=[],h=[],g=[],e=[],i=[];for(var a in this.dragOvers){var k=this.dragOvers[a];if(!this.isTypeOfDD(k))continue;!this.isOverTarget(n,k,this.mode)&&h.push(k);l[a]=true;delete this.dragOvers[a]}for(var j in b.groups){if("string"!=typeof j)continue;for(a in this.ids[j]){var d=this.ids[j][a];if(!this.isTypeOfDD(d))continue;if(d.isTarget&&!d.isLocked()&&(d!=b||b.ignoreSelf===false))if(this.isOverTarget(n,d,this.mode))if(m)e.push(d);else{if(!l[d.id])i.push(d);else g.push(d);this.dragOvers[d.id]=d}}}if(this.mode){if(h.length){b.b4DragOut(c,h);b.onDragOut(c,h)}i.length&&b.onDragEnter(c,i);if(g.length){b.b4DragOver(c,g);b.onDragOver(c,g)}if(e.length){b.b4DragDrop(c,e);b.onDragDrop(c,e)}}else{var f=0;for(a=0,f=h.length;a<f;++a){b.b4DragOut(c,h[a].id);b.onDragOut(c,h[a].id)}for(a=0,f=i.length;a<f;++a)b.onDragEnter(c,i[a].id);for(a=0,f=g.length;a<f;++a){b.b4DragOver(c,g[a].id);b.onDragOver(c,g[a].id)}for(a=0,f=e.length;a<f;++a){b.b4DragDrop(c,e[a].id);b.onDragDrop(c,e[a].id)}}m&&!e.length&&b.onInvalidDrop(c)},getBestMatch:function(c){var a=null,e=c.length;if(e==1)a=c[0];else for(var d=0;d<e;++d){var b=c[d];if(b.cursorIsOver){a=b;break}else if(!a||a.overlap.getArea()<b.overlap.getArea())a=b}return a},refreshCache:function(d){for(var b in d){if("string"!=typeof b)continue;for(var e in this.ids[b]){var a=this.ids[b][e];if(this.isTypeOfDD(a)){var c=this.getLocation(a);if(c)this.locationCache[a.id]=c;else delete this.locationCache[a.id]}}}},verifyEl:function(b){if(b){var a;if(Ext.isIE)try{a=b.offsetParent}catch(c){}else a=b.offsetParent;if(a)return true}return false},getLocation:function(a){if(!this.isTypeOfDD(a))return null;var c=a.getEl(),b,d,f,e,g,k,j,h,i;try{b=Ext.lib.Dom.getXY(c)}catch(l){}if(!b)return null;d=b[0];f=d+c.offsetWidth;e=b[1];g=e+c.offsetHeight;k=e-a.padding[0];j=f+a.padding[1];h=g+a.padding[2];i=d-a.padding[3];return new Ext.lib.Region(k,j,h,i)},isOverTarget:function(e,a,f){var b=this.locationCache[a.id];if(!b||!this.useCache){b=this.getLocation(a);this.locationCache[a.id]=b}if(!b)return false;a.cursorIsOver=b.contains(e);var c=this.dragCurrent;if(!c||!c.getTargetCoord||!f&&!c.constrainX&&!c.constrainY)return a.cursorIsOver;a.overlap=null;var d=c.getTargetCoord(e.x,e.y),h=c.getDragEl(),i=new Ext.lib.Region(d.y,d.x+h.offsetWidth,d.y+h.offsetHeight,d.x),g=i.intersect(b);if(g){a.overlap=g;return f?true:a.cursorIsOver}else return false},_onUnload:function(){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var a in this.elementCache)delete this.elementCache[a];this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(b){var a=this.elementCache[b];if(!a||!a.el)a=this.elementCache[b]=new this.ElementWrapper(Ext.getDom(b));return a},getElement:function(a){return Ext.getDom(a)},getCss:function(b){var a=Ext.getDom(b);return a?a.style:null},ElementWrapper:function(a){this.el=a||null;this.id=this.el&&a.id;this.css=this.el&&a.style},getPosX:function(a){return Ext.lib.Dom.getX(a)},getPosY:function(a){return Ext.lib.Dom.getY(a)},swapNode:function(a,b){if(a.swapNode)a.swapNode(b);else{var c=b.parentNode,d=b.nextSibling;if(d==a)c.insertBefore(a,b);else if(b==a.nextSibling)c.insertBefore(b,a);else{a.parentNode.replaceChild(b,a);c.insertBefore(a,d)}}},getScroll:function(){var d,c,a=document.documentElement,b=document.body;if(a&&(a.scrollTop||a.scrollLeft)){d=a.scrollTop;c=a.scrollLeft}else if(b){d=b.scrollTop;c=b.scrollLeft}return {top:d,left:c}},getStyle:function(b,a){return Ext.fly(b).getStyle(a)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(c,a){var b=Ext.lib.Dom.getXY(a);Ext.lib.Dom.setXY(c,b)},numericSort:function(a,b){return a-b},_timeoutCount:0,_addListeners:function(){var a=Ext.dd.DDM;if(Ext.lib.Event&&document)a._onLoad();else if(a._timeoutCount<=2e3){setTimeout(a._addListeners,10);if(document&&document.body)a._timeoutCount+=1}},handleWasClicked:function(b,c){if(this.isHandle(c,b.id))return true;else{var a=b.parentNode;while(a)if(this.isHandle(c,a.id))return true;else a=a.parentNode}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(a,c,b){a&&this.init(a,c,b)};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(a,b){var c=a-this.startPageX,d=b-this.startPageY;this.setDelta(c,d)},setDelta:function(a,b){this.deltaX=a;this.deltaY=b},setDragElPos:function(a,b){var c=this.getDragEl();this.alignElWithMouse(c,a,b)},alignElWithMouse:function(b,f,g){var a=this.getTargetCoord(f,g),c=b.dom?b:Ext.fly(b,"_dd");if(!this.deltaSetXY){var e=[a.x,a.y];c.setXY(e);var d=c.getLeft(true),h=c.getTop(true);this.deltaSetXY=[d-a.x,h-a.y]}else c.setLeftTop(a.x+this.deltaSetXY[0],a.y+this.deltaSetXY[1]);this.cachePosition(a.x,a.y);this.autoScroll(a.x,a.y,b.offsetHeight,b.offsetWidth);return a},cachePosition:function(b,c){if(b){this.lastPageX=b;this.lastPageY=c}else{var a=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=a[0];this.lastPageY=a[1]}},autoScroll:function(e,f,m,n){if(this.scroll){var g=Ext.lib.Dom.getViewHeight(),h=Ext.lib.Dom.getViewWidth(),b=this.DDM.getScrollTop(),a=this.DDM.getScrollLeft(),l=m+f,j=n+e,k=g+b-f-this.deltaY,i=h+a-e-this.deltaX,d=40,c=document.all?80:30;l>g&&k<d&&window.scrollTo(a,b+c);f<b&&b>0&&f-b<d&&window.scrollTo(a,b-c);j>h&&i<d&&window.scrollTo(a+c,b);e<a&&a>0&&e-a<d&&window.scrollTo(a-c,b)}},getTargetCoord:function(c,d){var a=c-this.deltaX,b=d-this.deltaY;if(this.constrainX){if(a<this.minX)a=this.minX;if(a>this.maxX)a=this.maxX}if(this.constrainY){if(b<this.minY)b=this.minY;if(b>this.maxY)b=this.maxY}a=this.getTick(a,this.xTicks);b=this.getTick(b,this.yTicks);return {x:a,y:b}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=this.config.scroll!==false},b4MouseDown:function(a){this.autoOffset(a.getPageX(),a.getPageY())},b4Drag:function(a){this.setDragElPos(a.getPageX(),a.getPageY())},toString:function(){return "DD "+this.id}});Ext.dd.DDProxy=function(a,c,b){if(a){this.init(a,c,b);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var d=this,c=document.body;if(!c||!c.firstChild){setTimeout(function(){d.createFrame()},50);return}var a=this.getDragEl();if(!a){a=document.createElement("div");a.id=this.dragElId;var b=a.style;b.position="absolute";b.visibility="hidden";b.cursor="move";b.border="2px solid #aaa";b.zIndex=999;c.insertBefore(a,c.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=this.config.resizeFrame!==false;this.centerFrame=this.config.centerFrame;this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(c,d){var e=this.getEl(),a=this.getDragEl(),b=a.style;this._resizeProxy();this.centerFrame&&this.setDelta(Math.round(parseInt(b.width,10)/2),Math.round(parseInt(b.height,10)/2));this.setDragElPos(c,d);Ext.fly(a).show()},_resizeProxy:function(){if(this.resizeFrame){var a=this.getEl();Ext.fly(this.getDragEl()).setSize(a.offsetWidth,a.offsetHeight)}},b4MouseDown:function(a){var b=a.getPageX(),c=a.getPageY();this.autoOffset(b,c);this.setDragElPos(b,c)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(){Ext.fly(this.getDragEl()).hide()},endDrag:function(){var b=this.getEl(),a=this.getDragEl();a.style.visibility="";this.beforeMove();b.style.visibility="hidden";Ext.dd.DDM.moveToEl(b,a);a.style.visibility="hidden";b.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return "DDProxy "+this.id}});Ext.dd.DDTarget=function(a,c,b){a&&this.initTarget(a,c,b)};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{getDragEl:Ext.emptyFn,isValidHandleChild:Ext.emptyFn,startDrag:Ext.emptyFn,endDrag:Ext.emptyFn,onDrag:Ext.emptyFn,onDragDrop:Ext.emptyFn,onDragEnter:Ext.emptyFn,onDragOut:Ext.emptyFn,onDragOver:Ext.emptyFn,onInvalidDrop:Ext.emptyFn,onMouseDown:Ext.emptyFn,onMouseUp:Ext.emptyFn,setXConstraint:Ext.emptyFn,setYConstraint:Ext.emptyFn,resetConstraints:Ext.emptyFn,clearConstraints:Ext.emptyFn,clearTicks:Ext.emptyFn,setInitPosition:Ext.emptyFn,setDragElId:Ext.emptyFn,setHandleElId:Ext.emptyFn,setOuterHandleElId:Ext.emptyFn,addInvalidHandleClass:Ext.emptyFn,addInvalidHandleId:Ext.emptyFn,addInvalidHandleType:Ext.emptyFn,removeInvalidHandleClass:Ext.emptyFn,removeInvalidHandleId:Ext.emptyFn,removeInvalidHandleType:Ext.emptyFn,toString:function(){return "DDTarget "+this.id}});Ext.dd.DragTracker=Ext.extend(Ext.util.Observable,{active:false,tolerance:5,autoStart:false,constructor:function(a){Ext.apply(this,a);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);this.el&&this.initEl(this.el);Ext.dd.DragTracker.superclass.constructor.call(this,a)},initEl:function(a){this.el=Ext.get(a);a.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(a,c){if(this.fireEvent("mousedown",this,a)!==false&&this.onBeforeStart(a)!==false){this.startXY=this.lastXY=a.getXY();this.dragTarget=this.delegate?c:this.el.dom;this.preventDefault!==false&&a.preventDefault();var b=Ext.getDoc();b.on("mouseup",this.onMouseUp,this);b.on("mousemove",this.onMouseMove,this);b.on("selectstart",this.stopSelect,this);if(this.autoStart)this.timer=this.triggerStart.defer(this.autoStart===true?1e3:this.autoStart,this)}},onMouseMove:function(a){if(this.active&&Ext.isIE&&!a.browserEvent.button){a.preventDefault();this.onMouseUp(a);return}a.preventDefault();var b=a.getXY(),c=this.startXY;this.lastXY=b;if(!this.active)if(Math.abs(c[0]-b[0])>this.tolerance||Math.abs(c[1]-b[1])>this.tolerance)this.triggerStart();else return;this.fireEvent("mousemove",this,a);this.onDrag(a);this.fireEvent("drag",this,a)},onMouseUp:function(a){var b=Ext.getDoc();b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,this);b.un("selectstart",this.stopSelect,this);a.preventDefault();this.clearStart();var c=this.active;this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,a);if(c){this.onEnd(a);this.fireEvent("dragend",this,a)}},triggerStart:function(){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(a){a.stopEvent();return false},onBeforeStart:function(){},onStart:function(){},onDrag:function(){},onEnd:function(){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(a){return a?this.constrainModes[a].call(this,this.lastXY):this.lastXY},getOffset:function(c){var a=this.getXY(c),b=this.startXY;return [b[0]-a[0],b[1]-a[1]]},constrainModes:{point:function(b){if(!this.elRegion)this.elRegion=this.getDragCt().getRegion();var a=this.dragRegion;a.left=b[0];a.top=b[1];a.right=b[0];a.bottom=b[1];a.constrainTo(this.elRegion);return [a.left,a.top]}}});Ext.dd.ScrollManager=function(){var b=Ext.dd.DragDropMgr,c={},e=null,a={},j=function(){e=null;f()},g=function(){b.dragCurrent&&b.refreshCache(b.dragCurrent.groups)},h=function(){if(b.dragCurrent){var c=Ext.dd.ScrollManager,d=a.el.ddScrollConfig?a.el.ddScrollConfig.increment:c.increment;if(!c.animate)a.el.scroll(a.dir,d)&&g();else a.el.scroll(a.dir,d,true,c.animDuration,g)}},f=function(){a.id&&clearInterval(a.id);a.id=0;a.el=null;a.dir=""},d=function(b,d){f();a.el=b;a.dir=d;var c=b.ddScrollConfig&&b.ddScrollConfig.frequency?b.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;a.id=setInterval(h,c)},i=function(o,m){if(m||!b.dragCurrent)return;var k=Ext.dd.ScrollManager;if(!e||e!=b.dragCurrent){e=b.dragCurrent;k.refreshCache()}var l=Ext.lib.Event.getXY(o),i=new Ext.lib.Point(l[0],l[1]);for(var n in c){var g=c[n],h=g._region,j=g.ddScrollConfig?g.ddScrollConfig:k;if(h&&h.contains(i)&&g.isScrollable())if(h.bottom-i.y<=j.vthresh){a.el!=g&&d(g,"down");return}else if(h.right-i.x<=j.hthresh){a.el!=g&&d(g,"left");return}else if(i.y-h.top<=j.vthresh){a.el!=g&&d(g,"up");return}else if(i.x-h.left<=j.hthresh){a.el!=g&&d(g,"right");return}}f()};b.fireEvents=b.fireEvents.createSequence(i,b);b.stopDrag=b.stopDrag.createSequence(j,b);return {register:function(a){if(Ext.isArray(a))for(var b=0,d=a.length;b<d;b++)this.register(a[b]);else{a=Ext.get(a);c[a.id]=a}},unregister:function(a){if(Ext.isArray(a))for(var b=0,d=a.length;b<d;b++)this.unregister(a[b]);else{a=Ext.get(a);delete c[a.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:.4,refreshCache:function(){for(var a in c)if(typeof c[a]=="object")c[a]._region=c[a].getRegion()}}}();Ext.dd.Registry=function(){var b={},a={},d=0,c=function(a,c){if(typeof a=="string")return a;var b=a.id;if(!b&&c!==false){b="extdd-"+ ++d;a.id=b}return b};return {register:function(e,d){d=d||{};if(typeof e=="string")e=document.getElementById(e);d.ddel=e;b[c(e)]=d;if(d.isHandle!==false)a[d.ddel.id]=d;if(d.handles)for(var g=d.handles,f=0,h=g.length;f<h;f++)a[c(g[f])]=d},unregister:function(i){var g=c(i,false),d=b[g];if(d){delete b[g];if(d.handles)for(var f=d.handles,e=0,h=f.length;e<h;e++)delete a[c(f[e],false)]}},getHandle:function(b){if(typeof b!="string")b=b.id;return a[b]},getHandleFromEvent:function(c){var b=Ext.lib.Event.getTarget(c);return b?a[b.id]:null},getTarget:function(a){if(typeof a!="string")a=a.id;return b[a]},getTargetFromEvent:function(d){var c=Ext.lib.Event.getTarget(d);return c?b[c.id]||a[c.id]:null}}}();Ext.dd.StatusProxy=function(a){Ext.apply(this,a);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!a||a.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.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);this.dropStatus=a}},reset:function(a){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;a&&this.ghost.update("")},update:function(a){if(typeof a=="string")this.ghost.update(a);else{this.ghost.update("");a.style.margin="0";this.ghost.dom.appendChild(a)}var b=this.ghost.dom.firstChild;b&&Ext.fly(b).setStyle("float","none")},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(a){this.el.hide();a&&this.reset(true)},stop:function(){this.anim&&this.anim.isAnimated&&this.anim.isAnimated()&&this.anim.stop()},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(a,b,c){this.callback=b;this.scope=c;if(a&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||.5,easing:"easeOut",xy:a,stopFx:true,callback:this.afterRepair,scope:this})}else this.afterRepair()},afterRepair:function(){this.hide(true);typeof this.callback=="function"&&this.callback.call(this.scope||this);this.callback=null;this.scope=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};Ext.dd.DragSource=function(b,a){this.el=Ext.get(b);if(!this.dragData)this.dragData={};Ext.apply(this,a);if(!this.proxy)this.proxy=new Ext.dd.StatusProxy;Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(){return this.dragData},onDragEnter:function(c,b){var a=Ext.dd.DragDropMgr.getDDById(b);this.cachedTarget=a;if(this.beforeDragEnter(a,c,b)!==false){if(a.isNotifyTarget){var d=a.notifyEnter(this,c,this.dragData);this.proxy.setStatus(d)}else this.proxy.setStatus(this.dropAllowed);this.afterDragEnter&&this.afterDragEnter(a,c,b)}},beforeDragEnter:function(){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(c,b){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragOver(a,c,b)!==false){if(a.isNotifyTarget){var d=a.notifyOver(this,c,this.dragData);this.proxy.setStatus(d)}this.afterDragOver&&this.afterDragOver(a,c,b)}},beforeDragOver:function(){return true},onDragOut:function(c,b){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragOut(a,c,b)!==false){a.isNotifyTarget&&a.notifyOut(this,c,this.dragData);this.proxy.reset();this.afterDragOut&&this.afterDragOut(a,c,b)}this.cachedTarget=null},beforeDragOut:function(){return true},onDragDrop:function(c,b){var a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragDrop(a,c,b)!==false){if(a.isNotifyTarget)if(a.notifyDrop(this,c,this.dragData))this.onValidDrop(a,c,b);else this.onInvalidDrop(a,c,b);else this.onValidDrop(a,c,b);this.afterDragDrop&&this.afterDragDrop(a,c,b)}delete this.cachedTarget},beforeDragDrop:function(){return true},onValidDrop:function(a,c,b){this.hideProxy();this.afterValidDrop&&this.afterValidDrop(a,c,b)},getRepairXY:function(){return this.el.getXY()},onInvalidDrop:function(c,a,b){this.beforeInvalidDrop(c,a,b);if(this.cachedTarget){this.cachedTarget.isNotifyTarget&&this.cachedTarget.notifyOut(this,a,this.dragData);this.cacheTarget=null}this.proxy.repair(this.getRepairXY(a,this.dragData),this.afterRepair,this);this.afterInvalidDrop&&this.afterInvalidDrop(a,b)},afterRepair:function(){Ext.enableFx&&this.el.highlight(this.hlColor||"c3daf9");this.dragging=false},beforeInvalidDrop:function(){return true},handleMouseDown:function(b){if(this.dragging)return;var a=this.getDragData(b);if(a&&this.onBeforeDrag(a,b)!==false){this.dragData=a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(){return true},onStartDrag:Ext.emptyFn,startDrag:function(a,b){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(a,b);this.proxy.show()},onInitDrag:function(b,c){var a=this.el.dom.cloneNode(true);a.id=Ext.id();this.proxy.update(a);this.onStartDrag(b,c);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(){},endDrag:function(a){this.onEndDrag(this.dragData,a)},onEndDrag:function(){},autoOffset:function(){this.setDelta(-12,-20)},destroy:function(){Ext.dd.DragSource.superclass.destroy.call(this);Ext.destroy(this.proxy)}});Ext.dd.DropTarget=function(b,a){this.el=Ext.get(b);Ext.apply(this,a);this.containerScroll&&Ext.dd.ScrollManager.register(this.el);Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(){this.overClass&&this.el.addClass(this.overClass);return this.dropAllowed},notifyOver:function(){return this.dropAllowed},notifyOut:function(){this.overClass&&this.el.removeClass(this.overClass)},notifyDrop:function(){return false}});Ext.dd.DragZone=function(b,a){Ext.dd.DragZone.superclass.constructor.call(this,b,a);this.containerScroll&&Ext.dd.ScrollManager.register(this.el)};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(a){return Ext.dd.Registry.getHandleFromEvent(a)},onInitDrag:function(a,b){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(a,b);return true},afterRepair:function(){Ext.enableFx&&Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9");this.dragging=false},getRepairXY:function(){return Ext.Element.fly(this.dragData.ddel).getXY()}});Ext.dd.DropZone=function(b,a){Ext.dd.DropZone.superclass.constructor.call(this,b,a)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(a){return Ext.dd.Registry.getTargetFromEvent(a)},onNodeEnter:function(){},onNodeOver:function(){return this.dropAllowed},onNodeOut:function(){},onNodeDrop:function(){return false},onContainerOver:function(){return this.dropNotAllowed},onContainerDrop:function(){return false},notifyEnter:function(){return this.dropNotAllowed},notifyOver:function(c,a,b){var d=this.getTargetFromEvent(a);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,c,a,b);this.lastOverNode=null}return this.onContainerOver(c,a,b)}if(this.lastOverNode!=d){this.lastOverNode&&this.onNodeOut(this.lastOverNode,c,a,b);this.onNodeEnter(d,c,a,b);this.lastOverNode=d}return this.onNodeOver(d,c,a,b)},notifyOut:function(b,c,a){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,b,c,a);this.lastOverNode=null}},notifyDrop:function(c,a,b){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,c,a,b);this.lastOverNode=null}var d=this.getTargetFromEvent(a);return d?this.onNodeDrop(d,c,a,b):this.onContainerDrop(c,a,b)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(c,b,a){var d=new Ext.dd.DD(Ext.id(this.dom),c,b);return Ext.apply(d,a)},initDDProxy:function(c,b,a){var d=new Ext.dd.DDProxy(Ext.id(this.dom),c,b);return Ext.apply(d,a)},initDDTarget:function(c,b,a){var d=new Ext.dd.DDTarget(Ext.id(this.dom),c,b);return Ext.apply(d,a)}});Ext.data.Api=function(){var a={};return {actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(a){return Ext.data.Api.actions[a]?true:false},getVerb:function(b){if(a[b])return a[b];for(var c in this.actions)if(this.actions[c]===b){a[b]=c;break}return a[b]!==undefined?a[b]:null},isValid:function(d){var a=[],c=this.actions;for(var b in d)!(b in c)&&a.push(b);return !a.length?true:a},hasUniqueUrl:function(a,b){var e=a.api[b]?a.api[b].url:null,d=true;for(var c in a.api)if((d=c===b?true:a.api[c].url!=e?true:false)===false)break;return d},prepare:function(a){if(!a.api)a.api={};for(var c in this.actions){var b=this.actions[c];a.api[b]=a.api[b]||a.url||a.directFn;if(typeof a.api[b]=="string")a.api[b]={url:a.api[b],method:a.restful===true?Ext.data.Api.restActions[b]:undefined}}},restify:function(a){a.restful=true;for(var b in this.restActions)a.api[this.actions[b]].method||(a.api[this.actions[b]].method=this.restActions[b]);a.onWrite=a.onWrite.createInterceptor(function(c,b,d,e){var f=b.reader,a=new Ext.data.Response({action:c,raw:d});switch(d.status){case 200:return true;break;case 201:if(Ext.isEmpty(a.raw.responseText))a.success=true;else return true;break;case 204:a.success=true;a.data=null;break;default:return true}if(a.success===true)this.fireEvent("write",this,c,a.data,a,e,b.request.arg);else this.fireEvent("exception",this,"remote",c,b,a,e);b.request.callback.call(b.request.scope,a.data,a,a.success);return false},a)}}}();Ext.data.Response=function(b,a){Ext.apply(this,b,{raw:a})};Ext.data.Response.prototype={message:null,success:false,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}};Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b;Ext.Error.call(this,a)},name:"Ext.data.Api"});Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action.  When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url.  Please review your proxy configuration.",execute:'Attempted to execute an unknown action.  Valid API actions are defined in Ext.data.Api.actions"'}});Ext.data.SortTypes={none:function(a){return a},stripTagsRE:/<\/?[^>]+>/gi,asText:function(a){return String(a).replace(this.stripTagsRE,"")},asUCText:function(a){return String(a).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(a){return String(a).toUpperCase()},asDate:function(a){if(!a)return 0;if(Ext.isDate(a))return a.getTime();return Date.parse(String(a))},asFloat:function(b){var a=parseFloat(String(b).replace(/,/g,""));return isNaN(a)?0:a},asInt:function(b){var a=parseInt(String(b).replace(/,/g,""),10);return isNaN(a)?0:a}};Ext.data.Record=function(b,a){this.id=a||a===0?a:Ext.data.Record.id(this);this.data=b||{}};Ext.data.Record.create=function(d){var a=Ext.extend(Ext.data.Record,{}),c=a.prototype;c.fields=new Ext.util.MixedCollection(false,function(a){return a.name});for(var b=0,e=d.length;b<e;b++)c.fields.add(new Ext.data.Field(d[b]));a.getField=function(a){return c.fields.get(a)};return a};Ext.data.Record.PREFIX="ext-record";Ext.data.Record.AUTO_ID=1;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.id=function(a){a.phantom=true;return [Ext.data.Record.PREFIX,"-",Ext.data.Record.AUTO_ID++].join("")};Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,phantom:false,join:function(a){this.store=a},"set":function(a,b){var c=Ext.isPrimitive(b)?String:Ext.encode;if(c(this.data[a])==c(b))return;this.dirty=true;if(!this.modified)this.modified={};if(this.modified[a]===undefined)this.modified[a]=this.data[a];this.data[a]=b;!this.editing&&this.afterEdit()},afterEdit:function(){this.store!=undefined&&typeof this.store.afterEdit=="function"&&this.store.afterEdit(this)},afterReject:function(){this.store&&this.store.afterReject(this)},afterCommit:function(){this.store&&this.store.afterCommit(this)},"get":function(a){return this.data[a]},beginEdit:function(){this.editing=true;this.modified=this.modified||{}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;this.dirty&&this.afterEdit()},reject:function(c){var a=this.modified;for(var b in a)if(typeof a[b]!="function")this.data[b]=a[b];this.dirty=false;delete this.modified;this.editing=false;c!==true&&this.afterReject()},commit:function(a){this.dirty=false;delete this.modified;this.editing=false;a!==true&&this.afterCommit()},getChanges:function(){var c=this.modified,b={};for(var a in c)if(c.hasOwnProperty(a))b[a]=this.data[a];return b},hasError:function(){return this.error!==null},clearError:function(){this.error=null},copy:function(a){return new this.constructor(Ext.apply({},this.data),a||this.id)},isModified:function(a){return !!(this.modified&&this.modified.hasOwnProperty(a))},isValid:function(){return this.fields.find(function(a){return a.allowBlank===false&&Ext.isEmpty(this.data[a.name])?true:false},this)?false:true},markDirty:function(){this.dirty=true;if(!this.modified)this.modified={};this.fields.each(function(a){this.modified[a.name]=this.data[a.name]},this)}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection,{register:function(){for(var a=0,b;b=arguments[a];a++)this.add(b)},unregister:function(){for(var a=0,b;b=arguments[a];a++)this.remove(this.lookup(b))},lookup:function(a){if(Ext.isArray(a)){var d=["field1"],c=!Ext.isArray(a[0]);if(!c)for(var b=2,e=a[0].length;b<=e;++b)d.push("field"+b);return new Ext.data.ArrayStore({fields:d,data:a,expandData:c,autoDestroy:true,autoCreated:true})}return Ext.isObject(a)?a.events?a:Ext.create(a,"store"):this.get(a)},getKey:function(a){return a.storeId}});Ext.data.Store=Ext.extend(Ext.util.Observable,{writer:undefined,remoteSort:false,autoDestroy:false,pruneModifiedRecords:false,lastOptions:null,autoSave:true,batch:true,restful:false,paramNames:undefined,defaultParamNames:{start:"start",limit:"limit",sort:"sort",dir:"dir"},isDestroyed:false,hasMultiSort:false,batchKey:"_ext_batch_",constructor:function(a){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(a){return a.id};this.removed=[];if(a&&a.data){this.inlineData=a.data;delete a.data}Ext.apply(this,a);this.baseParams=Ext.isObject(this.baseParams)?this.baseParams:{};this.paramNames=Ext.applyIf(this.paramNames||{},this.defaultParamNames);if((this.url||this.api)&&!this.proxy)this.proxy=new Ext.data.HttpProxy({url:this.url,api:this.api});if(this.restful===true&&this.proxy){this.batch=false;Ext.data.Api.restify(this.proxy)}if(this.reader){if(!this.recordType)this.recordType=this.reader.recordType;if(this.reader.onMetaChange)this.reader.onMetaChange=this.reader.onMetaChange.createSequence(this.onMetaChange,this);if(this.writer){if(this.writer instanceof Ext.data.DataWriter===false)this.writer=this.buildWriter(this.writer);this.writer.meta=this.reader.meta;this.pruneModifiedRecords=true}}if(this.recordType)this.fields=this.recordType.prototype.fields;this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","exception","beforeload","load","loadexception","beforewrite","write","beforesave","save");this.proxy&&this.relayEvents(this.proxy,["loadexception","exception"]);this.writer&&this.on({scope:this,add:this.createRecords,remove:this.destroyRecord,update:this.updateRecord,clear:this.onClear});this.sortToggle={};if(this.sortField)this.setDefaultSort(this.sortField,this.sortDir);else this.sortInfo&&this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction);Ext.data.Store.superclass.constructor.call(this);if(this.id){this.storeId=this.id;delete this.id}this.storeId&&Ext.StoreMgr.register(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else this.autoLoad&&this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined]);this.batchCounter=0;this.batches={}},buildWriter:function(b){var a=undefined,c=(b.format||"json").toLowerCase();switch(c){case "json":a=Ext.data.JsonWriter;break;case "xml":a=Ext.data.XmlWriter;break;default:a=Ext.data.JsonWriter}return new a(b)},destroy:function(){if(!this.isDestroyed){this.storeId&&Ext.StoreMgr.unregister(this);this.clearData();this.data=null;Ext.destroy(this.proxy);this.reader=this.writer=null;this.purgeListeners();this.isDestroyed=true}},add:function(a){a=[].concat(a);if(a.length<1)return;for(var b=0,d=a.length;b<d;b++)a[b].join(this);var c=this.data.length;this.data.addAll(a);this.snapshot&&this.snapshot.addAll(a);this.fireEvent("add",this,a,c)},addSorted:function(a){var b=this.findInsertIndex(a);this.insert(b,a)},remove:function(a){if(Ext.isArray(a)){Ext.each(a,function(a){this.remove(a)},this);return}var b=this.data.indexOf(a);if(b>-1){a.join(null);this.data.removeAt(b)}this.pruneModifiedRecords&&this.modified.remove(a);this.snapshot&&this.snapshot.remove(a);b>-1&&this.fireEvent("remove",this,a,b)},removeAt:function(a){this.remove(this.getAt(a))},removeAll:function(b){var a=[];this.each(function(b){a.push(b)});this.clearData();this.snapshot&&this.snapshot.clear();if(this.pruneModifiedRecords)this.modified=[];b!==true&&this.fireEvent("clear",this,a)},onClear:function(b,a){Ext.each(a,function(b,a){this.destroyRecord(this,b,a)},this)},insert:function(c,a){a=[].concat(a);for(var b=0,d=a.length;b<d;b++){this.data.insert(c,a[b]);a[b].join(this)}this.snapshot&&this.snapshot.addAll(a);this.fireEvent("add",this,a,c)},indexOf:function(a){return this.data.indexOf(a)},indexOfId:function(a){return this.data.indexOfKey(a)},getById:function(a){return (this.snapshot||this.data).key(a)},getAt:function(a){return this.data.itemAt(a)},getRange:function(a,b){return this.data.getRange(a,b)},storeOptions:function(a){a=Ext.apply({},a);delete a.callback;delete a.scope;this.lastOptions=a},clearData:function(){this.data.each(function(a){a.join(null)});this.data.clear()},load:function(a){a=Ext.apply({},a);this.storeOptions(a);if(this.sortInfo&&this.remoteSort){var b=this.paramNames;a.params=Ext.apply({},a.params);a.params[b.sort]=this.sortInfo.field;a.params[b.dir]=this.sortInfo.direction}try{return this.execute("read",null,a)}catch(c){this.handleException(c);return false}},updateRecord:function(c,a,b){b==Ext.data.Record.EDIT&&this.autoSave===true&&(!a.phantom||a.phantom&&a.isValid())&&this.save()},createRecords:function(e,b){for(var a=0,c=b.length;a<c;a++)if(b[a].phantom&&b[a].isValid()){b[a].markDirty();this.modified.push(b[a])}this.autoSave===true&&this.save()},destroyRecord:function(c,a,b){this.modified.indexOf(a)!=-1&&this.modified.remove(a);if(!a.phantom){this.removed.push(a);a.lastIndex=b;this.autoSave===true&&this.save()}},execute:function(c,a,b,e){if(!Ext.data.Api.isAction(c))throw new Ext.data.Api.Error("execute",c);b=Ext.applyIf(b||{},{params:{}});e!==undefined&&this.addToBatch(e);var d=true;if(c==="read"){d=this.fireEvent("beforeload",this,b);Ext.applyIf(b.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true)a=Ext.isArray(a)?a:[a];else if(Ext.isArray(a)&&a.length==1)a=a.shift();(d=this.fireEvent("beforewrite",this,c,a,b))!==false&&this.writer.apply(b.params,this.baseParams,c,a)}if(d!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,c))b.params.xaction=c;this.proxy.request(Ext.data.Api.actions[c],a,b.params,this.reader,this.createCallback(c,a,e),this,b)}return d},save:function(){if(!this.writer)throw new Ext.data.Store.Error("writer-undefined");var c=[],e,d,g,h={};this.removed.length&&c.push(["destroy",this.removed]);var b=[].concat(this.getModifiedRecords());if(b.length){for(var f=[],a=b.length-1;a>=0;a--)if(b[a].phantom===true){var i=b.splice(a,1).shift();i.isValid()&&f.push(i)}else!b[a].isValid()&&b.splice(a,1);f.length&&c.push(["create",f]);b.length&&c.push(["update",b])}e=c.length;if(e){g=++this.batchCounter;for(var a=0;a<e;++a){d=c[a];h[d[0]]=d[1]}if(this.fireEvent("beforesave",this,h)!==false){for(var a=0;a<e;++a){d=c[a];this.doTransaction(d[0],d[1],g)}return g}}return -1},doTransaction:function(d,a,e){function c(a){try{this.execute(d,a,undefined,e)}catch(b){this.handleException(b)}}if(this.batch===false)for(var b=0,f=a.length;b<f;b++)c.call(this,a[b]);else c.call(this,a)},addToBatch:function(b){var d=this.batches,c=this.batchKey+b,a=d[c];if(!a)d[c]=a={id:b,count:0,data:{}};++a.count},removeFromBatch:function(d,c,b){var g=this.batches,f=this.batchKey+d,a=g[f],b,e;if(a){e=a.data[c]||[];a.data[c]=e.concat(b);if(a.count===1){b=a.data;delete g[f];this.fireEvent("save",this,d,b)}else--a.count}},createCallback:function(a,b,c){var d=Ext.data.Api.actions;return a=="read"?this.loadRecords:function(d,f,e){this["on"+Ext.util.Format.capitalize(a)+"Records"](e,b,[].concat(d));e===true&&this.fireEvent("write",this,a,d,f,b);this.removeFromBatch(c,a,d)}},clearModified:function(a){if(Ext.isArray(a))for(var b=a.length-1;b>=0;b--)this.modified.splice(this.modified.indexOf(a[b]),1);else this.modified.splice(this.modified.indexOf(a),1)},reMap:function(a){if(Ext.isArray(a))for(var b=0,d=a.length;b<d;b++)this.reMap(a[b]);else{delete this.data.map[a._phid];this.data.map[a.id]=a;var c=this.data.keys.indexOf(a._phid);this.data.keys.splice(c,1,a.id);delete a._phid}},onCreateRecords:function(b,a,c){if(b===true)try{this.reader.realize(a,c);this.reMap(a)}catch(d){this.handleException(d);Ext.isArray(a)&&this.onCreateRecords(b,a,c)}},onUpdateRecords:function(b,a,c){if(b===true)try{this.reader.update(a,c)}catch(d){this.handleException(d);Ext.isArray(a)&&this.onUpdateRecords(b,a,c)}},onDestroyRecords:function(c,a){a=a instanceof Ext.data.Record?[a]:[].concat(a);for(var b=0,d=a.length;b<d;b++)this.removed.splice(this.removed.indexOf(a[b]),1);if(c===false)for(b=a.length-1;b>=0;b--)this.insert(a[b].lastIndex,a[b])},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(c,a,e){if(this.isDestroyed===true)return;if(!c||e===false){e!==false&&this.fireEvent("load",this,[],a);a.callback&&a.callback.call(a.scope||this,[],a,false,c);return}var b=c.records,f=c.totalRecords||b.length;if(!a||a.add!==true){if(this.pruneModifiedRecords)this.modified=[];for(var d=0,g=b.length;d<g;d++)b[d].join(this);if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.clearData();this.data.addAll(b);this.totalLength=f;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(f,this.data.length+b.length);this.add(b)}this.fireEvent("load",this,b,a);a.callback&&a.callback.call(a.scope||this,b,a,true)},loadData:function(b,a){var c=this.reader.readRecords(b);this.loadRecords(c,{add:a},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){(this.sortInfo||this.multiSortInfo)&&!this.remoteSort&&this.sortData()},sortData:function(){var e=this.hasMultiSort?this.multiSortInfo:this.sortInfo,b=e.direction||"ASC",c=e.sorters,a=[];if(!this.hasMultiSort)c=[{direction:b,field:e.field}];for(var d=0,h=c.length;d<h;d++)a.push(this.createSortFunction(c[d].field,c[d].direction));if(a.length==0)return;var g=b.toUpperCase()=="DESC"?-1:1,f=function(d,e){var b=a[0].call(this,d,e);if(a.length>1)for(var c=1,f=a.length;c<f;c++)b=b||a[c].call(this,d,e);return g*b};this.data.sort(b,f);this.snapshot&&this.snapshot!=this.data&&this.snapshot.sort(b,f)},createSortFunction:function(b,a){a=a||"ASC";var d=a.toUpperCase()=="DESC"?-1:1,c=this.fields.get(b).sortType;return function(f,g){var a=c(f.data[b]),e=c(g.data[b]);return d*(a>e?1:a<e?-1:0)}},setDefaultSort:function(b,a){a=a?a.toUpperCase():"ASC";this.sortInfo={field:b,direction:a};this.sortToggle[b]=a},sort:function(a,b){if(Ext.isArray(arguments[0]))return this.multiSort.call(this,a,b);else return this.singleSort(a,b)},singleSort:function(f,b){var d=this.fields.get(f);if(!d)return false;var a=d.name,c=this.sortInfo||null,e=this.sortToggle?this.sortToggle[a]:null;if(!b)if(c&&c.field==a)b=(this.sortToggle[a]||"ASC").toggle("ASC","DESC");else b=d.sortDir;this.sortToggle[a]=b;this.sortInfo={field:a,direction:b};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(e)this.sortToggle[a]=e;if(c)this.sortInfo=c}}else{this.applySort();this.fireEvent("datachanged",this)}},multiSort:function(b,a){this.hasMultiSort=true;a=a||"ASC";if(this.multiSortInfo&&a==this.multiSortInfo.direction)a=a.toggle("ASC","DESC");this.multiSortInfo={sorters:b,direction:a};if(this.remoteSort)this.singleSort(b[0].field,b[0].direction);else{this.applySort();this.fireEvent("datachanged",this)}},each:function(b,a){this.data.each(b,a)},getModifiedRecords:function(){return this.modified},sum:function(f,b,a){var d=this.data.items,e=0;b=b||0;a=a||a===0?a:d.length-1;for(var c=b;c<=a;c++)e+=d[c].data[f]||0;return e},createFilterFn:function(e,a,d,b,c){if(Ext.isEmpty(a,false))return false;a=this.data.createValueMatcher(a,d,b,c);return function(b){return a.test(b.data[e])}},createMultipleFilterFn:function(a){return function(e){for(var b=true,c=0,h=a.length;c<h;c++){var d=a[c],g=d.fn,f=d.scope;b=b&&g.call(f,e)}return b}},filter:function(a,k,i,g,h){if(Ext.isObject(a))a=[a];if(Ext.isArray(a)){for(var e=[],d=0,l=a.length;d<l;d++){var b=a[d],c=b.fn,j=b.scope||this;if(!Ext.isFunction(c))c=this.createFilterFn(b.property,b.value,b.anyMatch,b.caseSensitive,b.exactMatch);e.push({fn:c,scope:j})}var f=this.createMultipleFilterFn(e)}else var f=this.createFilterFn(a,k,i,g,h);return f?this.filterBy(f):this.clearFilter()},filterBy:function(b,a){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(b,a||this);this.fireEvent("datachanged",this)},clearFilter:function(a){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;a!==true&&this.fireEvent("datachanged",this)}},isFiltered:function(){return !!this.snapshot&&this.snapshot!=this.data},query:function(d,e,c,b){var a=this.createFilterFn(d,e,c,b);return a?this.queryBy(a):this.data.clone()},queryBy:function(c,a){var b=this.snapshot||this.data;return b.filterBy(c,a||this)},find:function(d,f,e,c,b){var a=this.createFilterFn(d,f,c,b);return a?this.data.findIndexBy(a,null,e):-1},findExact:function(a,c,b){return this.data.findIndexBy(function(b){return b.get(a)===c},this,b)},findBy:function(c,a,b){return this.data.findIndexBy(c,a,b)},collect:function(i,h,g){for(var e=g===true&&this.snapshot?this.snapshot.items:this.data.items,a,b,d=[],f={},c=0,j=e.length;c<j;c++){a=e[c].data[i];b=String(a);if((h||!Ext.isEmpty(a))&&!f[b]){f[b]=true;d[d.length]=a}}return d},afterEdit:function(a){this.modified.indexOf(a)==-1&&this.modified.push(a);this.fireEvent("update",this,a,Ext.data.Record.EDIT)},afterReject:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.REJECT)},afterCommit:function(a){this.modified.remove(a);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},commitChanges:function(){var b=this.modified.slice(0);this.modified=[];for(var a=0,c=b.length;a<c;a++)b[a].commit()},rejectChanges:function(){var b=this.modified.slice(0);this.modified=[];for(var a=0,c=b.length;a<c;a++)b[a].reject();var b=this.removed.slice(0).reverse();this.removed=[];for(var a=0,c=b.length;a<c;a++){this.insert(b[a].lastIndex||0,b[a]);b[a].reject()}},onMetaChange:function(){this.recordType=this.reader.recordType;this.fields=this.recordType.prototype.fields;delete this.snapshot;if(this.reader.meta.sortInfo)this.sortInfo=this.reader.meta.sortInfo;else if(this.sortInfo&&!this.fields.get(this.sortInfo.field))delete this.sortInfo;if(this.writer)this.writer.meta=this.reader.meta;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(a){this.suspendEvents();var c=this.data.clone();this.data.add(a);this.applySort();var b=this.data.indexOf(a);this.data=c;this.resumeEvents();return b},setBaseParam:function(b,a){this.baseParams=this.baseParams||{};this.baseParams[b]=a}});Ext.reg("store",Ext.data.Store);Ext.data.Store.Error=Ext.extend(Ext.Error,{name:"Ext.data.Store"});Ext.apply(Ext.data.Store.Error.prototype,{lang:{"writer-undefined":"Attempted to execute a write-action without a DataWriter installed."}});Ext.data.Field=Ext.extend(Object,{constructor:function(a){if(Ext.isString(a))a={name:a};Ext.apply(this,a);var c=Ext.data.Types,b=this.sortType,d;if(this.type){if(Ext.isString(this.type))this.type=Ext.data.Types[this.type.toUpperCase()]||c.AUTO}else this.type=c.AUTO;if(Ext.isString(b))this.sortType=Ext.data.SortTypes[b];else if(Ext.isEmpty(b))this.sortType=this.type.sortType;if(!this.convert)this.convert=this.type.convert},dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",allowBlank:true});Ext.data.DataReader=function(b,a){this.meta=b;this.recordType=Ext.isArray(a)?Ext.data.Record.create(a):a;this.recordType&&this.buildExtractors()};Ext.data.DataReader.prototype={getTotal:Ext.emptyFn,getRoot:Ext.emptyFn,getMessage:Ext.emptyFn,getSuccess:Ext.emptyFn,getId:Ext.emptyFn,buildExtractors:Ext.emptyFn,extractValues:Ext.emptyFn,realize:function(a,b){if(Ext.isArray(a))for(var c=a.length-1;c>=0;c--)if(Ext.isArray(b))this.realize(a.splice(c,1).shift(),b.splice(c,1).shift());else this.realize(a.splice(c,1).shift(),b);else{if(Ext.isArray(b)&&b.length==1)b=b.shift();if(!this.isData(b))throw new Ext.data.DataReader.Error("realize",a);a.phantom=false;a._phid=a.id;a.id=this.getId(b);a.data=b;a.commit()}},update:function(b,a){if(Ext.isArray(b))for(var c=b.length-1;c>=0;c--)if(Ext.isArray(a))this.update(b.splice(c,1).shift(),a.splice(c,1).shift());else this.update(b.splice(c,1).shift(),a);else{if(Ext.isArray(a)&&a.length==1)a=a.shift();if(this.isData(a))b.data=Ext.apply(b.data,a);b.commit()}},extractData:function(a,j){var k=this instanceof Ext.data.JsonReader?"json":"node",c=[];if(this.isData(a)&&!(this instanceof Ext.data.XmlReader))a=[a];var i=this.recordType.prototype.fields,g=i.items,h=i.length,c=[];if(j===true)for(var l=this.recordType,b=0;b<a.length;b++){var d=a[b],e=new l(this.extractValues(d,g,h),this.getId(d));e[k]=d;c.push(e)}else for(var b=0;b<a.length;b++){var f=this.extractValues(a[b],g,h);f[this.meta.idProperty]=this.getId(a[b]);c.push(f)}return c},isData:function(a){return a&&Ext.isObject(a)&&!Ext.isEmpty(this.getId(a))?true:false},onMetaChange:function(a){delete this.ef;this.meta=a;this.recordType=Ext.data.Record.create(a.fields);this.buildExtractors()}};Ext.data.DataReader.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b;Ext.Error.call(this,a)},name:"Ext.data.DataReader"});Ext.apply(Ext.data.DataReader.Error.prototype,{lang:{update:"#update received invalid data from server.  Please see docs for DataReader#update and review your DataReader configuration.",realize:"#realize was called with invalid remote-data.  Please see the docs for DataReader#realize and review your DataReader configuration.","invalid-response":"#readResponse received an invalid response from the server."}});Ext.data.DataWriter=function(a){Ext.apply(this,a)};Ext.data.DataWriter.prototype={writeAllFields:false,listful:false,apply:function(f,d,e,a){var b=[],c=e+"Record";if(Ext.isArray(a))Ext.each(a,function(a){b.push(this[c](a))},this);else if(a instanceof Ext.data.Record)b=this[c](a);this.render(f,d,b)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(a){var d=a.fields.map,b={},e=this.writeAllFields===false&&a.phantom===false?a.getChanges():a.data,c;Ext.iterate(e,function(e,a){if(c=d[e])b[c.mapping?c.mapping:c.name]=a});if(a.phantom){if(a.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(a.data[this.meta.idProperty]))delete b[this.meta.idProperty]}else b[this.meta.idProperty]=a.id;return b},toArray:function(b){var a=[];Ext.iterate(b,function(b,c){a.push({name:b,value:c})},this);return a}};Ext.data.DataProxy=function(a){a=a||{};this.api=a.api;this.url=a.url;this.restful=a.restful;this.listeners=a.listeners;this.prettyUrls=a.prettyUrls;this.addEvents("exception","beforeload","load","loadexception","beforewrite","write");Ext.data.DataProxy.superclass.constructor.call(this);try{Ext.data.Api.prepare(this)}catch(b){b instanceof Ext.data.Api.Error&&b.toConsole()}Ext.data.DataProxy.relayEvents(this,["beforewrite","write","exception"])};Ext.extend(Ext.data.DataProxy,Ext.util.Observable,{restful:false,setApi:function(){if(arguments.length==1){var a=Ext.data.Api.isValid(arguments[0]);if(a===true)this.api=arguments[0];else throw new Ext.data.Api.Error("invalid",a)}else if(arguments.length==2){if(!Ext.data.Api.isAction(arguments[0]))throw new Ext.data.Api.Error("invalid",arguments[0]);this.api[arguments[0]]=arguments[1]}Ext.data.Api.prepare(this)},isApiAction:function(a){return this.api[a]?true:false},request:function(a,f,b,g,c,e,d){if(!this.api[a]&&!this.load)throw new Ext.data.DataProxy.Error("action-undefined",a);b=b||{};if(a===Ext.data.Api.actions.read?this.fireEvent("beforeload",this,b):this.fireEvent("beforewrite",this,a,f,b)!==false)this.doRequest.apply(this,arguments);else c.call(e||this,null,d,false)},load:null,doRequest:function(f,g,c,d,a,e,b){this.load(c,d,a,e,b)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(d,b){b=b||null;var a=this.conn&&this.conn.url?this.conn.url:this.api[d]?this.api[d].url:this.url;if(!a)throw new Ext.data.Api.Error("invalid-url",d);var c=null,e=a.match(/(.*)(\.json|\.xml|\.html)$/);if(e){c=e[2];a=e[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom)a+="/"+b.id;return c===null?a:a+c},destroy:function(){this.purgeListeners()}});Ext.apply(Ext.data.DataProxy,Ext.util.Observable.prototype);Ext.util.Observable.call(Ext.data.DataProxy);Ext.data.DataProxy.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b;Ext.Error.call(this,a)},name:"Ext.data.DataProxy"});Ext.apply(Ext.data.DataProxy.Error.prototype,{lang:{"action-undefined":"DataProxy attempted to execute an API-action but found an undefined url / function.  Please review your Proxy url/api-configuration.","api-invalid":"Recieved an invalid API-configuration.  Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions."}});Ext.data.Request=function(a){Ext.apply(this,a)};Ext.data.Request.prototype={action:undefined,rs:undefined,params:undefined,callback:Ext.emptyFn,scope:undefined,reader:undefined};Ext.data.Response=function(a){Ext.apply(this,a)};Ext.data.Response.prototype={action:undefined,success:undefined,message:undefined,data:undefined,raw:undefined,records:undefined};Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(f,h,c,g,b,e,a){c=c||{};var d;try{d=g.readRecords(this.data)}catch(i){this.fireEvent("loadexception",this,null,a,i);this.fireEvent("exception",this,"response",f,a,null,i);b.call(e,null,a,false);return}b.call(e,d,a,true)}});Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(a){return a},sortType:a.none,type:"auto"},STRING:{convert:function(a){return a===undefined||a===null?"":String(a)},sortType:a.asUCString,type:"string"},INT:{convert:function(a){return a!==undefined&&a!==null&&a!==""?parseInt(String(a).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"int"},FLOAT:{convert:function(a){return a!==undefined&&a!==null&&a!==""?parseFloat(String(a).replace(Ext.data.Types.stripRe,""),10):0},sortType:a.none,type:"float"},BOOL:{convert:function(a){return a===true||a==="true"||a==1},sortType:a.none,type:"bool"},DATE:{convert:function(a){var b=this.dateFormat;if(!a)return null;if(Ext.isDate(a))return a;if(b){if(b=="timestamp")return new Date(a*1e3);if(b=="time")return new Date(parseInt(a,10));return Date.parseDate(a,b)}var c=Date.parse(a);return c?new Date(c):null},sortType:a.asDate,type:"date"}});Ext.apply(this,{BOOLEAN:this.BOOL,INTEGER:this.INT,NUMBER:this.FLOAT})};Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(a){Ext.data.JsonWriter.superclass.constructor.call(this,a)},render:function(a,b,d){if(this.encode===true){Ext.apply(a,b);a[this.meta.root]=Ext.encode(d)}else{var c=Ext.apply({},b);c[this.meta.root]=d;a.jsonData=c}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(b){if(this.encodeDelete){var a={};a[this.meta.idProperty]=b.id;return a}else return b.id}});Ext.data.JsonReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(b){var c=b.responseText,a=Ext.decode(c);if(!a)throw{message:"JsonReader.read: Json object not found"};return this.readRecords(a)},readResponse:function(d,c){var a=c.responseText!==undefined?Ext.decode(c.responseText):c;if(!a)throw new Ext.data.JsonReader.Error("response");var b=this.getRoot(a);if(d===Ext.data.Api.actions.create){var e=Ext.isDefined(b);if(e&&Ext.isEmpty(b))throw new Ext.data.JsonReader.Error("root-empty",this.meta.root);else if(!e)throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}var f=new Ext.data.Response({action:d,success:this.getSuccess(a),data:b?this.extractData(b,false):[],message:this.getMessage(a),raw:a});if(Ext.isEmpty(f.success))throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty);return f},readRecords:function(a){this.jsonData=a;a.metaData&&this.onMetaChange(a.metaData);var g=this.meta,h=this.recordType,f=h.prototype.fields,j=f.items,k=f.length,b,e=this.getRoot(a),i=e.length,c=i,d=true;if(g.totalProperty){b=parseInt(this.getTotal(a),10);if(!isNaN(b))c=b}if(g.successProperty){b=this.getSuccess(a);if(b===false||b==="false")d=false}return {success:d,records:this.extractData(e,true),totalRecords:c}},buildExtractors:function(){if(this.ef)return;var a=this.meta,e=this.recordType,b=e.prototype.fields,g=b.items,h=b.length;if(a.totalProperty)this.getTotal=this.createAccessor(a.totalProperty);if(a.successProperty)this.getSuccess=this.createAccessor(a.successProperty);if(a.messageProperty)this.getMessage=this.createAccessor(a.messageProperty);this.getRoot=a.root?this.createAccessor(a.root):function(a){return a};if(a.id||a.idProperty){var i=this.createAccessor(a.id||a.idProperty);this.getId=function(b){var a=i(b);return a===undefined||a===""?null:a}}else this.getId=function(){return null};for(var d=[],c=0;c<h;c++){b=g[c];var f=b.mapping!==undefined&&b.mapping!==null?b.mapping:b.name;d.push(this.createAccessor(f))}this.ef=d},simpleAccess:function(b,a){return b[a]},createAccessor:function(){var a=/[\[\.]/;return function(b){if(Ext.isEmpty(b))return Ext.emptyFn;if(Ext.isFunction(b))return b;var c=String(b).search(a);if(c>=0)return new Function("obj","return obj"+(c>0?".":"")+b);return function(a){return a[b]}}}(),extractValues:function(d,f,g){for(var a,c={},b=0;b<g;b++){a=f[b];var e=this.ef[b](d);c[a.name]=a.convert(e!==undefined?e:a.defaultValue,d)}return c}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(a,b){this.arg=b;Ext.Error.call(this,a)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response.  Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response.  See the JsonReader docs.',"root-undefined-config":'Your JsonReader was configured without a "root" property.  Please review your JsonReader config and make sure to define the root property.  See the JsonReader docs.',"idProperty-undefined":'Your JsonReader was configured without an "idProperty"  Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id").  See the JsonReader docs.',"root-empty":'Data was expected to be returned by the server in the "root" property of the response.  Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response.  See JsonReader docs.'}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(h){this.arrayData=h;for(var e=this.meta,d=e?Ext.num(e.idIndex,e.id):null,k=this.recordType,m=k.prototype.fields,f=[],l=true,a,p=this.getRoot(h),i=0,s=p.length;i<s;i++){for(var b=p[i],o={},t=(d||d===0)&&b[d]!==undefined&&b[d]!==""?b[d]:null,g=0,r=m.length;g<r;g++){var c=m.items[g],q=c.mapping!==undefined&&c.mapping!==null?c.mapping:g;a=b[q]!==undefined?b[q]:c.defaultValue;a=c.convert(a,b);o[c.name]=a}var n=new k(o,t);n.json=b;f[f.length]=n}var j=f.length;if(e.totalProperty){a=parseInt(this.getTotal(h),10);if(!isNaN(a))j=a}if(e.successProperty){a=this.getSuccess(h);if(a===false||a==="false")l=false}return {success:l,records:f,totalRecords:j}}});Ext.data.ArrayStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.ArrayStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.ArrayReader(a)}))},loadData:function(a,d){if(this.expandData===true){for(var c=[],b=0,e=a.length;b<e;b++)c[c.length]=[a[b]];a=c}Ext.data.ArrayStore.superclass.loadData.call(this,a,d)}});Ext.reg("arraystore",Ext.data.ArrayStore);Ext.data.SimpleStore=Ext.data.ArrayStore;Ext.reg("simplestore",Ext.data.SimpleStore);Ext.data.JsonStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.JsonReader(a)}))}});Ext.reg("jsonstore",Ext.data.JsonStore);Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=a||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var d=this.multiSortInfo.sorters,b=a.groupField||this.groupField,c=a.sortInfo||this.sortInfo,e=a.groupDir||this.groupDir;b&&d.push({field:b,direction:e});c&&d.push(c);Ext.data.GroupingStore.superclass.constructor.call(this,a);this.addEvents("groupchange");this.applyGroupField()},remoteGroup:false,groupOnSort:false,groupDir:"ASC",clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy;delete this.baseParams.groupDir}var a=this.lastOptions;if(a&&a.params){delete a.params.groupBy;delete a.params.groupDir}this.reload()}else{this.sort();this.fireEvent("datachanged",this)}},groupBy:function(c,d,a){a=a?String(a).toUpperCase()=="DESC"?"DESC":"ASC":this.groupDir;if(this.groupField==c&&this.groupDir==a&&!d)return;sorters=this.multiSortInfo.sorters;sorters.length>0&&sorters[0].field==this.groupField&&sorters.shift();this.groupField=c;this.groupDir=a;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(c,a);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(sorters);b.call(this)}},sort:function(d,a){if(this.remoteSort)return Ext.data.GroupingStore.superclass.sort.call(this,d,a);var b=[];if(Ext.isArray(arguments[0]))b=arguments[0];else if(d==undefined)b=this.sortInfo?[this.sortInfo]:[];else{var e=this.fields.get(d);if(!e)return false;var c=e.name,f=this.sortInfo||null,g=this.sortToggle?this.sortToggle[c]:null;if(!a)if(f&&f.field==c)a=(this.sortToggle[c]||"ASC").toggle("ASC","DESC");else a=e.sortDir;this.sortToggle[c]=a;this.sortInfo={field:c,direction:a};b=[this.sortInfo]}this.groupField&&b.unshift({direction:this.groupDir,field:this.groupField});return this.multiSort.call(this,b,a)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams)this.baseParams={};Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{a===true&&this.fireEvent("datachanged",this);return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?this.sortInfo?this.sortInfo.field:undefined:this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(m,a){this.el=Ext.get(m);if(a&&a.wrap){a.resizeChild=this.el;this.el=this.el.wrap(typeof a.wrap=="object"?a.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=a.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(a.resizeChild.getPositioning());a.resizeChild.clearPositioning();if(!a.width||!a.height){var h=a.resizeChild.getSize();this.el.setSize(h.width,h.height)}if(a.pinned&&!a.adjustments)a.adjustments="auto"}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,a);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var g=this.el.getStyle("position");g!="absolute"&&g!="fixed"&&this.el.setStyle("position","relative");if(!this.handles){this.handles="s,e,se";if(this.multiDirectional)this.handles+=",n,w"}if(this.handles=="all")this.handles="n s e w ne nw se sw";for(var b=this.handles.split(/\s*?[,;]\s*?| /),k=Ext.Resizable.positions,e=0,l=b.length;e<l;e++)if(b[e]&&k[b[e]]){var i=k[b[e]];this[i]=new Ext.Resizable.Handle(this,i,this.disableTrackOver,this.transparent,this.handleCls)}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1)this.updateBox=true;this.activeHandle=null;if(this.resizeChild)if(typeof this.resizeChild=="boolean")this.resizeChild=Ext.get(this.el.dom.firstChild,true);else this.resizeChild=Ext.get(this.resizeChild,true);if(this.adjustments=="auto"){var f=this.resizeChild,d=this.west,j=this.east,c=this.north,b=this.south;if(f&&(d||c)){f.position("relative");f.setLeft(d?d.el.getWidth():0);f.setTop(c?c.el.getHeight():0)}this.adjustments=[(j?-j.el.getWidth():0)+(d?-d.el.getWidth():0),(c?-c.el.getHeight():0)+(b?-b.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);this.constrainTo&&this.dd.constrainTo(this.constrainTo)}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null)this.resizeTo(this.width,this.height);else this.updateChildSize();if(Ext.isIE)this.el.dom.style.zoom=1;Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:1e4,maxWidth:1e4,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(b,a){this.el.setSize(b,a);this.updateChildSize();this.fireEvent("resize",this,b,a,null)},startSizing:function(b,c){this.fireEvent("beforeresize",this,b);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",c.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=b.getXY();this.offsets=[this.startBox.x+this.startBox.width-this.startPoint[0],this.startBox.y+this.startBox.height-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var a=Ext.get(this.constrainTo);this.resizeRegion=a.getRegion().adjust(a.getFrameWidth("t"),a.getFrameWidth("l"),-a.getFrameWidth("b"),-a.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);!this.dynamic&&this.proxy.setStyle("visibility","visible")}},onMouseDown:function(a,b){if(this.enabled){b.stopEvent();this.activeHandle=a;this.startSizing(b,a)}},onMouseUp:function(b){this.activeHandle=null;var a=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,a.width,a.height,b)},updateChildSize:function(){if(this.resizeChild){var b=this.el,c=this.resizeChild,a=this.adjustments;if(b.dom.offsetWidth){var d=b.getSize(true);c.setSize(d.width+a[0],d.height+a[1])}Ext.isIE&&setTimeout(function(){if(b.dom.offsetWidth){var d=b.getSize(true);c.setSize(d.width+a[0],d.height+a[1])}},10)}},snap:function(a,b,e){if(!b||!a)return a;var d=a,c=a%b;if(c>0)if(c>b/2)d=a+(b-c);else d=a-c;return Math.max(e,d)},resizeElement:function(){var a=this.proxy.getBox();if(this.updateBox)this.el.setBox(a,false,this.animate,this.duration,null,this.easing);else this.el.setSize(a.width,a.height,this.animate,this.duration,null,this.easing);this.updateChildSize();!this.dynamic&&this.proxy.hide();if(this.draggable&&this.constrainTo){this.dd.resetConstraints();this.dd.constrainTo(this.constrainTo)}return a},constrain:function(b,a,d,c){if(b-a<d)a=b-d;else if(b-a>c)a=b-c;return a},onMouseMove:function(t){if(this.enabled&&this.activeHandle)try{if(this.resizeRegion&&!this.resizeRegion.contains(t.getPoint()))return;var r=this.curSize||this.startBox,g=this.startBox.x,k=this.startBox.y,w=g,x=k,a=r.width,b=r.height,f=a,e=b,j=this.minWidth,h=this.minHeight,l=this.maxWidth,i=this.maxHeight,v=this.widthIncrement,u=this.heightIncrement,s=t.getXY(),c=-(this.startPoint[0]-Math.max(this.minX,s[0])),d=-(this.startPoint[1]-Math.max(this.minY,s[1])),q=this.activeHandle.position,m,p;switch(q){case "east":a+=c;a=Math.min(Math.max(j,a),l);break;case "south":b+=d;b=Math.min(Math.max(h,b),i);break;case "southeast":a+=c;b+=d;a=Math.min(Math.max(j,a),l);b=Math.min(Math.max(h,b),i);break;case "north":d=this.constrain(b,d,h,i);k+=d;b-=d;break;case "west":c=this.constrain(a,c,j,l);g+=c;a-=c;break;case "northeast":a+=c;a=Math.min(Math.max(j,a),l);d=this.constrain(b,d,h,i);k+=d;b-=d;break;case "northwest":c=this.constrain(a,c,j,l);d=this.constrain(b,d,h,i);k+=d;b-=d;g+=c;a-=c;break;case "southwest":c=this.constrain(a,c,j,l);b+=d;b=Math.min(Math.max(h,b),i);g+=c;a-=c}var o=this.snap(a,v,j),n=this.snap(b,u,h);if(o!=a||n!=b){switch(q){case "northeast":k-=n-b;break;case "north":k-=n-b;break;case "southwest":g-=o-a;break;case "west":g-=o-a;break;case "northwest":g-=o-a;k-=n-b}a=o;b=n}if(this.preserveRatio)switch(q){case "southeast":case "east":b=e*(a/f);b=Math.min(Math.max(h,b),i);a=f*(b/e);break;case "south":a=f*(b/e);a=Math.min(Math.max(j,a),l);b=e*(a/f);break;case "northeast":a=f*(b/e);a=Math.min(Math.max(j,a),l);b=e*(a/f);break;case "north":m=a;a=f*(b/e);a=Math.min(Math.max(j,a),l);b=e*(a/f);g+=(m-a)/2;break;case "southwest":b=e*(a/f);b=Math.min(Math.max(h,b),i);m=a;a=f*(b/e);g+=m-a;break;case "west":p=b;b=e*(a/f);b=Math.min(Math.max(h,b),i);k+=(p-b)/2;m=a;a=f*(b/e);g+=m-a;break;case "northwest":m=a;p=b;b=e*(a/f);b=Math.min(Math.max(h,b),i);a=f*(b/e);k+=p-b;g+=m-a}this.proxy.setBounds(g,k,a,b);this.dynamic&&this.resizeElement()}catch(y){}},handleOver:function(){this.enabled&&this.el.addClass("x-resizable-over")},handleOut:function(){!this.resizing&&this.el.removeClass("x-resizable-over")},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(c){Ext.destroy(this.dd,this.overlay,this.proxy);this.overlay=null;this.proxy=null;var a=Ext.Resizable.positions;for(var b in a)typeof a[b]!="function"&&this[a[b]]&&this[a[b]].destroy();if(c){this.el.update("");Ext.destroy(this.el);this.el=null}this.purgeListeners()},syncHandleHeight:function(){var a=this.el.getHeight(true);this.west&&this.west.el.setHeight(a);this.east&&this.east.el.setHeight(a)}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=Ext.extend(Object,{constructor:function(c,f,d,e,a){if(!this.tpl){var b=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});b.compile();Ext.Resizable.Handle.prototype.tpl=b}this.position=f;this.rz=c;this.el=this.tpl.append(c.el.dom,[this.position],true);this.el.unselectable();e&&this.el.setOpacity(0);!Ext.isEmpty(a)&&this.el.addClass(a);this.el.on("mousedown",this.onMouseDown,this);!d&&this.el.on({scope:this,mouseover:this.onMouseOver,mouseout:this.onMouseOut})},afterResize:function(){},onMouseDown:function(a){this.rz.onMouseDown(this,a)},onMouseOver:function(a){this.rz.handleOver(this,a)},onMouseOut:function(a){this.rz.handleOut(this,a)},destroy:function(){Ext.destroy(this.el);this.el=null}});Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden))this.hidden=this.initHidden;if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(b,a){Ext.Window.superclass.onRender.call(this,b,a);this.plain&&this.el.addClass("x-window-plain");this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}this.maximizable&&this.mon(this.header,"dblclick",this.toggleMaximize,this)},initEvents:function(){Ext.Window.superclass.initEvents.call(this);this.animateTarget&&this.setAnimateTarget(this.animateTarget);if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}this.draggable&&this.header.addClass("x-window-draggable");this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var a=this.getKeyMap();a.on(27,this.onEsc,this);a.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(b,a){a.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){this.manager&&this.manager.unregister(this);Ext.Window.superclass.onDestroy.call(this)},initTools:function(){this.minimizable&&this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])});if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}this.closable&&this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})},resizerAction:function(){var a=this.proxy.getBox();this.proxy.hide();this.window.handleResize(a);return a},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(a){var b=this.resizeBox;if(b.x!=a.x||b.y!=a.y)this.updateBox(a);else{this.setSize(a);Ext.isIE6&&Ext.isStrict&&this.doLayout()}this.focus();this.updateHandles();this.saveState()},focus:function(){var a=this.focusEl,b=this.defaultButton,e=typeof b,d,c;if(Ext.isDefined(b)){if(Ext.isNumber(b)&&this.fbar)a=this.fbar.items.get(b);else if(Ext.isString(b))a=Ext.getCmp(b);else a=b;d=a.getEl();c=Ext.getDom(this.container);if(d&&c)if(!Ext.lib.Region.getRegion(c).contains(Ext.lib.Region.getRegion(d.dom)))return}a=a||this.focusEl;a.focus.defer(10,a)},setAnimateTarget:function(a){a=Ext.get(a);this.animateTarget=a},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var b=this.el.getAlignToXY(this.container,"c-c"),a=this.el.translatePoints(b[0],b[1]);this.x=this.x===undefined?a.left:this.x;this.y=this.y===undefined?a.top:this.y}this.el.setLeftTop(this.x,this.y);this.expandOnShow&&this.expand(false);if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(a,b,c){!this.rendered&&this.render(Ext.getBody());if(this.hidden===false){this.toFront();return this}if(this.fireEvent("beforeshow",this)===false)return this;b&&this.on("show",b,c,{single:true});this.hidden=false;Ext.isDefined(a)&&this.setAnimateTarget(a);this.beforeShow();if(this.animateTarget)this.animShow();else this.afterShow();return this},afterShow:function(b){if(this.isDestroyed)return false;this.proxy.hide();this.el.setStyle("display","block");this.el.show();this.maximized&&this.fitContainer();Ext.isMac&&Ext.isGecko2&&this.cascade(this.setAutoScroll);(this.monitorResize||this.modal||this.constrain||this.constrainHeader)&&Ext.EventManager.onWindowResize(this.onWindowResize,this);this.doConstrain();this.doLayout();this.keyMap&&this.keyMap.enable();this.toFront();this.updateHandles();if(b&&(Ext.isIE||Ext.isWebKit)){var a=this.getSize();this.onResize(a.width,a.height)}this.onShow();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var a=this.getBox();this.el.setStyle("display","none");this.proxy.shift(Ext.apply(a,{callback:this.afterShow.createDelegate(this,[true],false),scope:this,easing:"easeNone",duration:.25,opacity:.5}))},hide:function(a,b,c){if(this.hidden||this.fireEvent("beforehide",this)===false)return this;b&&this.on("hide",b,c,{single:true});this.hidden=true;a!==undefined&&this.setAnimateTarget(a);if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.animateTarget)this.animHide();else{this.el.hide();this.afterHide()}return this},afterHide:function(){this.proxy.hide();(this.monitorResize||this.modal||this.constrain||this.constrainHeader)&&Ext.EventManager.removeResizeListener(this.onWindowResize,this);this.keyMap&&this.keyMap.disable();this.onHide();this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(.5);this.proxy.show();var a=this.getBox(false);this.proxy.setBox(a);this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:.25,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,onHide:Ext.emptyFn,onWindowResize:function(){this.maximized&&this.fitContainer();if(this.modal){this.mask.setSize("100%","100%");var a=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var a;if(this.constrain)a={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset};else{var c=this.getSize();a={right:-(c.width-100),bottom:-(c.height-25)}}var b=this.el.getConstrainToXY(this.container,true,a);b&&this.setPosition(b[0],b[1])}},ghost:function(c){var a=this.createGhost(c),b=this.getBox(true);a.setLeftTop(b.x,b.y);a.setWidth(b.width);this.el.hide();this.activeGhost=a;return a},unghost:function(b,a){if(!this.activeGhost)return;if(b!==false){this.el.show();this.focus.defer(10,this);Ext.isMac&&Ext.isGecko2&&this.cascade(this.setAutoScroll)}a!==false&&this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true));this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this);return this},close:function(){if(this.fireEvent("beforeclose",this)!==false)if(this.hidden)this.doClose();else this.hide(null,this.doClose,this)},doClose:function(){this.fireEvent("close",this);this.destroy()},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();this.dd&&this.dd.lock();this.collapsible&&this.tools.toggle.hide();this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}return this},restore:function(){if(this.maximized){var a=this.tools;this.el.removeClass("x-window-maximized");a.restore&&a.restore.hide();a.maximize&&a.maximize.show();this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);this.dd&&this.dd.unlock();this.collapsible&&a.toggle&&a.toggle.show();this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}return this},toggleMaximize:function(){return this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var a=this.container.getViewSize(false);this.setSize(a.width,a.height)},setZIndex:function(a){this.modal&&this.mask.setStyle("z-index",a);this.el.setZIndex(++a);a+=5;this.resizer&&this.resizer.proxy.setStyle("z-index",++a);this.lastZIndex=a},alignTo:function(c,b,d){var a=this.el.getAlignToXY(c,b,d);this.setPagePosition(a[0],a[1]);return this},anchorTo:function(e,c,d,a){this.clearAnchor();this.anchorTarget={el:e,alignment:c,offsets:d};Ext.EventManager.onWindowResize(this.doAnchor,this);var b=typeof a;b!="undefined"&&Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:b=="number"?a:50});return this.doAnchor()},doAnchor:function(){var a=this.anchorTarget;this.alignTo(a.el,a.alignment,a.offsets);return this},clearAnchor:function(){if(this.anchorTarget){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this);delete this.anchorTarget}return this},toFront:function(a){if(this.manager.bringToFront(this))(!a||!a.getTarget().focus)&&this.focus();return this},setActive:function(a){if(a){!this.maximized&&this.el.enableShadow(true);this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var a=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(a[0],a[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(a){this.win=a;Ext.Window.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost();if(a.constrain!==false){var b=a.el.shadowOffset;this.constrainTo(a.container,{right:b,left:b,bottom:b})}else if(a.constrainHeader!==false){var c=this.proxy.getSize();this.constrainTo(a.container,{right:-(c.width-this.headerOffsets[0]),bottom:-(c.height-this.headerOffsets[1])})}},b4Drag:Ext.emptyFn,onDrag:function(a){this.alignElWithMouse(this.proxy,a.getPageX(),a.getPageY())},endDrag:function(){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var a={},b=[],c=null,g=function(a,b){return !a._lastAccess||a._lastAccess<b._lastAccess?-1:1},e=function(){var a=b,f=a.length;if(f>0){a.sort(g);for(var h=a[0].manager.zseed,c=0;c<f;c++){var e=a[c];e&&!e.hidden&&e.setZIndex(h+c*10)}}d()},f=function(a){if(a!=c){c&&c.setActive(false);c=a;a&&a.setActive(true)}},d=function(){for(var a=b.length-1;a>=0;--a)if(!b[a].hidden){f(b[a]);return}f(null)};return {zseed:9e3,register:function(c){c.manager&&c.manager.unregister(c);c.manager=this;a[c.id]=c;b.push(c);c.on("hide",d)},unregister:function(c){delete c.manager;delete a[c.id];c.un("hide",d);b.remove(c)},"get":function(b){return typeof b=="object"?b:a[b]},bringToFront:function(a){a=this.get(a);if(a!=c){a._lastAccess=(new Date).getTime();e();return true}return false},sendToBack:function(a){a=this.get(a);a._lastAccess=-(new Date).getTime();e();return a},hideAll:function(){for(var b in a)a[b]&&typeof a[b]!="function"&&a[b].isVisible()&&a[b].hide()},getActive:function(){return c},getBy:function(f,e){for(var d=[],c=b.length-1;c>=0;--c){var a=b[c];f.call(e||a,a)!==false&&d.push(a)}return d},each:function(d,c){for(var b in a)if(a[b]&&typeof a[b]!="function")if(d.call(c||a[b],a[b])===false)return}}};Ext.WindowMgr=new Ext.WindowGroup;Ext.MessageBox=function(){var b,a,q,t,f,l,d,c,h,v,i,u,e,g,o,m="",k="",p=["ok","yes","no","cancel"],j=function(c){e[c].blur();if(b.isVisible()){b.hide();n();Ext.callback(a.fn,a.scope||window,[c,g.dom.value,a],1)}},n=function(){a&&a.cls&&b.el.removeClass(a.cls);h.reset()},s=function(d,e,c){if(a&&a.closable!==false){b.hide();n()}c&&c.stopEvent()},r=function(d){var c=0,a;if(!d){Ext.each(p,function(a){e[a].hide()});return c}b.footer.dom.style.display="";Ext.iterate(e,function(e,b){a=d[e];if(a){b.show();b.setText(Ext.isString(a)?a:Ext.MessageBox.buttonText[e]);c+=b.getEl().getWidth()+15}else b.hide()});return c};return {getDialog:function(m){if(!b){var k=[];e={};Ext.each(p,function(a){k.push(e[a]=new Ext.Button({text:this.buttonText[a],handler:j.createCallback(a),hideMode:"offsets"}))},this);b=new Ext.Window({autoCreate:true,title:m,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(a&&a.buttons&&a.buttons.no&&!a.buttons.cancel)j("no");else j("cancel")},fbar:new Ext.Toolbar({items:k,enableOverflow:false})});b.render(document.body);b.getEl().addClass("x-window-dlg");q=b.mask;f=b.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});i=Ext.get(f.dom.firstChild);var g=f.dom.childNodes[1];l=Ext.get(g.firstChild);d=Ext.get(g.childNodes[2].firstChild);d.enableDisplayMode();d.addKeyListener([10,13],function(){if(b.isVisible()&&a&&a.buttons)if(a.buttons.ok)j("ok");else a.buttons.yes&&j("yes")});c=Ext.get(g.childNodes[2].childNodes[1]);c.enableDisplayMode();h=new Ext.ProgressBar({renderTo:f});f.createChild({cls:"x-clear"})}return b},updateText:function(j){!b.isVisible()&&!a.width&&b.setSize(this.maxWidth,100);l.update(j||"&#160;");var d=k!=""?i.getWidth()+i.getMargins("lr"):0,m=l.getWidth()+l.getMargins("lr"),f=b.getFrameWidth("lr"),e=b.body.getFrameWidth("lr"),c;if(Ext.isIE&&d>0)d+=3;c=Math.max(Math.min(a.width||d+m+f+e,a.maxWidth||this.maxWidth),Math.max(a.minWidth||this.minWidth,o||0));a.prompt===true&&g.setWidth(c-d-f-e);(a.progress===true||a.wait===true)&&h.setSize(c-d-f-e);if(Ext.isIE&&c==o)c+=4;b.setSize(c,"auto").center();return this},updateProgress:function(c,b,a){h.updateProgress(c,b);a&&this.updateText(a);return this},isVisible:function(){return b&&b.isVisible()},hide:function(){var a=b?b.activeGhost:null;if(this.isVisible()||a){b.hide();n();a&&b.unghost(false,false)}return this},show:function(l){this.isVisible()&&this.hide();a=l;var f=this.getDialog(a.title||"&#160;");f.setTitle(a.title||"&#160;");var k=a.closable!==false&&a.progress!==true&&a.wait!==true;f.tools.close.setDisplayed(k);g=d;a.prompt=a.prompt||(a.multiline?true:false);if(a.prompt)if(a.multiline){d.hide();c.show();c.setHeight(Ext.isNumber(a.multiline)?a.multiline:this.defaultTextHeight);g=c}else{d.show();c.hide()}else{d.hide();c.hide()}g.dom.value=a.value||"";if(a.prompt)f.focusEl=g;else{var i=a.buttons,j=null;if(i&&i.ok)j=e["ok"];else if(i&&i.yes)j=e["yes"];if(j)f.focusEl=j}a.iconCls&&f.setIconClass(a.iconCls);this.setIcon(Ext.isDefined(a.icon)?a.icon:m);o=r(a.buttons);h.setVisible(a.progress===true||a.wait===true);this.updateProgress(0,a.progressText);this.updateText(a.msg);a.cls&&f.el.addClass(a.cls);f.proxyDrag=a.proxyDrag===true;f.modal=a.modal!==false;f.mask=a.modal!==false?q:false;if(!f.isVisible()){document.body.appendChild(b.el.dom);f.setAnimateTarget(a.animEl);f.on("show",function(){if(k===true)f.keyMap.enable();else f.keyMap.disable()},this,{single:true});f.show(a.animEl)}a.wait===true&&h.wait(a.waitConfig);return this},setIcon:function(a){if(!b){m=a;return}m=undefined;if(a&&a!=""){i.removeClass("x-hidden");i.replaceClass(k,a);f.addClass("x-dlg-icon");k=a}else{i.replaceClass(k,"x-hidden");f.removeClass("x-dlg-icon");k=""}return this},progress:function(b,c,a){this.show({title:b,msg:c,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:a});return this},wait:function(c,b,a){this.show({title:b,msg:c,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:a});return this},alert:function(b,c,d,a){this.show({title:b,msg:c,buttons:this.OK,fn:d,scope:a,minWidth:this.minWidth});return this},confirm:function(b,c,d,a){this.show({title:b,msg:c,buttons:this.YESNO,fn:d,scope:a,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(c,e,f,b,a,d){this.show({title:c,msg:e,buttons:this.OKCANCEL,fn:f,minWidth:this.minPromptWidth,scope:b,prompt:true,multiline:a,value:d});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,minPromptWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.dd.PanelProxy=function(b,a){this.panel=b;this.id=this.panel.id+"-ddproxy";Ext.apply(this,a)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(c,a,b){this.hide();typeof a=="function"&&a.call(b||this)},moveProxy:function(a,b){this.proxy&&a.insertBefore(this.proxy.dom,b)}};Ext.Panel.DD=function(a,c){this.panel=a;this.dragData={panel:a};this.proxy=new Ext.dd.PanelProxy(a,c);Ext.Panel.DD.superclass.constructor.call(this,a.el,c);var b=a.header;b&&this.setHandleElId(b.id);(b?b:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(){this.proxy.show()},b4MouseDown:function(a){var b=a.getPageX(),c=a.getPageY();this.autoOffset(b,c)},onInitDrag:function(a,b){this.onStartDrag(a,b);return true},createFrame:Ext.emptyFn,getDragEl:function(){return this.proxy.ghost.dom},endDrag:function(){this.proxy.hide();this.panel.saveState()},autoOffset:function(a,b){a-=this.startPageX;b-=this.startPageY;this.setDelta(a,b)}});Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{"get":function(a,b){return typeof this.state[a]=="undefined"?b:this.state[a]},clear:function(a){delete this.state[a];this.fireEvent("statechange",this,a,null)},"set":function(b,a){this.state[b]=a;this.fireEvent("statechange",this,b,a)},decodeValue:function(d){var f=/^(a|n|d|b|s|o)\:(.*)$/,b=f.exec(unescape(d));if(!b||!b[1])return;var e=b[1],a=b[2];switch(e){case "n":return parseFloat(a);case "d":return new Date(Date.parse(a));case "b":return a=="1";case "a":var c=[];a!=""&&Ext.each(a.split("^"),function(a){c.push(this.decodeValue(a))},this);return c;case "o":var c={};a!=""&&Ext.each(a.split("^"),function(b){var a=b.split("=");c[a[0]]=this.decodeValue(a[1])},this);return c;default:return a}},encodeValue:function(a){var b;if(typeof a=="number")b="n:"+a;else if(typeof a=="boolean")b="b:"+(a?"1":"0");else if(Ext.isDate(a))b="d:"+a.toGMTString();else if(Ext.isArray(a)){for(var c="",e=0,f=a.length;e<f;e++){c+=this.encodeValue(a[e]);if(e!=f-1)c+="^"}b="a:"+c}else if(typeof a=="object"){var c="";for(var d in a)if(typeof a[d]!="function"&&a[d]!==undefined)c+=d+"="+this.encodeValue(a[d])+"^";b="o:"+c.substring(0,c.length-1)}else b="s:"+a;return escape(b)}});Ext.state.Manager=function(){var a=new Ext.state.Provider;return {setProvider:function(b){a=b},"get":function(c,b){return a.get(c,b)},"set":function(c,b){a.set(c,b)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl))this.tpl=new Ext.XTemplate(this.tpl);this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite;this.selected=new Ext.CompositeElementLite},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});(this.overClass||this.trackOver)&&this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this});this.store&&this.bindStore(this.store,true)},refresh:function(){this.clearSelections(false,true);var a=this.getTemplateTarget();a.update("");var b=this.store.getRange();if(b.length<1){(!this.deferEmptyText||this.hasSkippedEmptyText)&&a.update(this.emptyText);this.all.clear()}else{this.tpl.overwrite(a,this.collectData(b,0));this.all.fill(Ext.query(this.itemSelector,a.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(a){return a},collectData:function(b,d){for(var c=[],a=0,e=b.length;a<e;a++)c[c.length]=this.prepareData(b[a].data,d+a,b[a]);return c},bufferRender:function(b){var a=document.createElement("div");this.tpl.overwrite(a,this.collectData(b));return Ext.query(this.itemSelector,a)},onUpdate:function(f,b){var a=this.store.indexOf(b);if(a>-1){var e=this.isSelected(a),d=this.all.elements[a],c=this.bufferRender([b],a)[0];this.all.replaceElement(a,c,true);if(e){this.selected.replaceElement(d,c);this.all.item(a).addClass(this.selectedClass)}this.updateIndexes(a,a)}},onAdd:function(f,e,a){if(this.all.getCount()===0){this.refresh();return}var b=this.bufferRender(e,a),d,c=this.all.elements;if(a<this.all.getCount()){d=this.all.item(a).insertSibling(b,"before",true);c.splice.apply(c,[a,0].concat(b))}else{d=this.all.last().insertSibling(b,"after",true);c.push.apply(c,b)}this.updateIndexes(a)},onRemove:function(c,b,a){this.deselect(a);this.all.removeElement(a,true);this.updateIndexes(a);this.store.getCount()===0&&this.refresh()},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(c,a){var d=this.all.elements;c=c||0;a=a||(a===0?0:d.length-1);for(var b=c;b<=a;b++)d[b].viewIndex=b},getStore:function(){return this.store},bindStore:function(a,b){if(!b&&this.store){if(a!==this.store&&this.store.autoDestroy)this.store.destroy();else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!a)this.store=null}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=a;a&&this.refresh()},onDataChanged:function(){this.blockRefresh!==true&&this.refresh.apply(this,arguments)},findItemFromChild:function(a){return Ext.fly(a).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());if(b){var c=this.indexOf(b);this.onItemClick(b,c,a)!==false&&this.fireEvent("click",this,c,b,a)}else this.fireEvent("containerclick",this,a)!==false&&this.onContainerClick(a)},onContainerClick:function(){this.clearSelections()},onContextMenu:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a)this.fireEvent("contextmenu",this,this.indexOf(a),a,b);else this.fireEvent("containercontextmenu",this,b)},onDblClick:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());a&&this.fireEvent("dblclick",this,this.indexOf(a),a,b)},onMouseOver:function(b){var a=b.getTarget(this.itemSelector,this.getTemplateTarget());if(a&&a!==this.lastItem){this.lastItem=a;Ext.fly(a).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(a),a,b)}},onMouseOut:function(a){if(this.lastItem)if(!a.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,a);delete this.lastItem}},onItemClick:function(c,b,a){if(this.fireEvent("beforeclick",this,b,c,a)===false)return false;if(this.multiSelect){this.doMultiSelection(c,b,a);a.preventDefault()}else if(this.singleSelect){this.doSingleSelection(c,b,a);a.preventDefault()}return true},doSingleSelection:function(c,a,b){if(b.ctrlKey&&this.isSelected(a))this.deselect(a);else this.select(a,false)},doMultiSelection:function(d,b,a){if(a.shiftKey&&this.last!==false){var c=this.last;this.selectRange(c,b,a.ctrlKey);this.last=c}else if((a.ctrlKey||this.simpleSelect)&&this.isSelected(b))this.deselect(b);else this.select(b,a.ctrlKey||a.shiftKey||this.simpleSelect)},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){for(var b=[],c=this.selected.elements,a=0,d=c.length;a<d;a++)b.push(c[a].viewIndex);return b},getSelectedRecords:function(){for(var b=[],c=this.selected.elements,a=0,d=c.length;a<d;a++)b[b.length]=this.store.getAt(c[a].viewIndex);return b},getRecords:function(d){for(var b=[],c=d,a=0,e=c.length;a<e;a++)b[b.length]=this.store.getAt(c[a].viewIndex);return b},getRecord:function(a){return this.store.getAt(a.viewIndex)},clearSelections:function(a,b){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){!b&&this.selected.removeClass(this.selectedClass);this.selected.clear();this.last=false;!a&&this.fireEvent("selectionchange",this,this.selected.elements)}},isSelected:function(a){return this.selected.contains(this.getNode(a))},deselect:function(a){if(this.isSelected(a)){a=this.getNode(a);this.selected.removeElement(a);if(this.last==a.viewIndex)this.last=false;Ext.fly(a).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(b,e,d){if(Ext.isArray(b)){!e&&this.clearSelections(true);for(var c=0,f=b.length;c<f;c++)this.select(b[c],true,true);!d&&this.fireEvent("selectionchange",this,this.selected.elements)}else{var a=this.getNode(b);!e&&this.clearSelections(true);if(a&&!this.isSelected(a))if(this.fireEvent("beforeselect",this,a,this.selected.elements)!==false){Ext.fly(a).addClass(this.selectedClass);this.selected.add(a);this.last=a.viewIndex;!d&&this.fireEvent("selectionchange",this,this.selected.elements)}}},selectRange:function(b,c,a){!a&&this.clearSelections(true);this.select(this.getNodes(b,c),true)},getNode:function(a){if(Ext.isString(a))return document.getElementById(a);else if(Ext.isNumber(a))return this.all.elements[a];else if(a instanceof Ext.data.Record){var b=this.store.indexOf(a);return this.all.elements[b]}return a},getNodes:function(c,b){var d=this.all.elements;c=c||0;b=!Ext.isDefined(b)?Math.max(d.length-1,0):b;var e=[],a;if(c<=b)for(a=c;a<=b&&d[a];a++)e.push(d[a]);else for(a=c;a>=b&&d[a];a--)e.push(d[a]);return e},indexOf:function(a){a=this.getNode(a);if(Ext.isNumber(a.viewIndex))return a.viewIndex;return this.all.indexOf(a)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.getTemplateTarget().update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){this.all.clear();this.selected.clear();Ext.DataView.superclass.onDestroy.call(this);this.bindStore(null)}});Ext.DataView.prototype.setStore=Ext.DataView.prototype.bindStore;Ext.reg("dataview",Ext.DataView);Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig)));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack)this.stack=Ext.TabPanel.AccessStack();this.initItems()},onRender:function(f,e){Ext.TabPanel.superclass.onRender.call(this,f,e);if(this.plain){var b=this.tabPosition=="top"?"header":"footer";this[b].addClass("x-tab-panel-"+b+"-plain")}var c=this[this.stripTarget];this.stripWrap=c.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var d=this.tabPosition=="bottom"?this.stripWrap:null;c.createChild({cls:"x-tab-strip-spacer"},d);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var a=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");a.disableFormats=true;a.compile();Ext.TabPanel.prototype.itemTpl=a}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);this.autoTabs&&this.readTabs(false);if(this.activeTab!==undefined){var a=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});this.enableTabScroll&&this.mon(this.strip,"mousewheel",this.onWheel,this)},findTargets:function(c){var b=null,a=c.getTarget("li:not(.x-tab-edge)",this.strip);if(a){b=this.getComponent(a.id.split(this.idDelimiter)[1]);if(b.disabled)return {close:null,item:null,el:null}}return {close:c.getTarget(".x-tab-strip-close",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!==0)return;b.preventDefault();var a=this.findTargets(b);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}return}a.item&&a.item!=this.activeTab&&this.setActiveTab(a.item)},onStripContextMenu:function(a){a.preventDefault();var b=this.findTargets(a);b.item&&this.fireEvent("contextmenu",this,b.item,a)},readTabs:function(d){d===true&&this.items.each(function(a){this.remove(a)},this);for(var c=this.el.query(this.autoTabSelector),b=0,f=c.length;b<f;b++){var a=c[b],e=a.getAttribute("title");a.removeAttribute("title");this.add({title:e,contentEl:a})}},initTab:function(a,g){var c=this.strip.dom.childNodes[g],f=this.getTemplateArgs(a),e=c?this.itemTpl.insertBefore(c,f):this.itemTpl.append(this.strip,f),d="x-tab-strip-over",b=Ext.get(e);b.hover(function(){!a.disabled&&b.addClass(d)},function(){b.removeClass(d)});if(a.tabTip)b.child("span.x-tab-strip-text",true).qtip=a.tabTip;a.tabEl=e;b.select("a").on("click",function(a){!a.getPageX()&&this.onStripMouseDown(a)},this,{preventDefault:true});a.on({scope:this,disable:this.onItemDisabled,enable:this.onItemEnabled,titlechange:this.onItemTitleChanged,iconchange:this.onItemIconChanged,beforeshow:this.onBeforeShowItem})},getTemplateArgs:function(a){var b=a.closable?"x-tab-strip-closable":"";if(a.disabled)b+=" x-item-disabled";if(a.iconCls)b+=" x-tab-with-icon";if(a.tabCls)b+=" "+a.tabCls;return {id:this.id+this.idDelimiter+a.getItemId(),text:a.title,cls:b,iconCls:a.iconCls||""}},onAdd:function(a){Ext.TabPanel.superclass.onAdd.call(this,a);if(this.rendered){var b=this.items;this.initTab(a,b.indexOf(a));this.delegateUpdates()}},onBeforeAdd:function(a){var c=a.events?this.items.containsKey(a.getItemId())?a:null:this.items.get(a);if(c){this.setActiveTab(a);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var b=a.elements;a.elements=b?b.replace(",header",""):b;a.border=a.border===true},onRemove:function(a){var b=Ext.get(a.tabEl);if(b){b.select("a").removeAllListeners();Ext.destroy(b)}Ext.TabPanel.superclass.onRemove.call(this,a);this.stack.remove(a);delete a.tabEl;a.un("disable",this.onItemDisabled,this);a.un("enable",this.onItemEnabled,this);a.un("titlechange",this.onItemTitleChanged,this);a.un("iconchange",this.onItemIconChanged,this);a.un("beforeshow",this.onBeforeShowItem,this);if(a==this.activeTab){var c=this.stack.next();if(c)this.setActiveTab(c);else if(this.items.getCount()>0)this.setActiveTab(0);else this.setActiveTab(null)}!this.destroying&&this.delegateUpdates()},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onItemDisabled:function(a){var b=this.getTabEl(a);b&&Ext.fly(b).addClass("x-item-disabled");this.stack.remove(a)},onItemEnabled:function(b){var a=this.getTabEl(b);a&&Ext.fly(a).removeClass("x-item-disabled")},onItemTitleChanged:function(a){var b=this.getTabEl(a);if(b)Ext.fly(b).child("span.x-tab-strip-text",true).innerHTML=a.title},onItemIconChanged:function(d,b,c){var a=this.getTabEl(d);if(a){a=Ext.get(a);a.child("span.x-tab-strip-text").replaceClass(c,b);a[Ext.isEmpty(b)?"removeClass":"addClass"]("x-tab-with-icon")}},getTabEl:function(b){var a=this.getComponent(b);return a?a.tabEl:null},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(a){a=this.getComponent(a);var b=this.getTabEl(a);if(b){b.style.display="none";this.delegateUpdates()}this.stack.remove(a)},unhideTabStripItem:function(a){a=this.getComponent(a);var b=this.getTabEl(a);if(b){b.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates)return;this.resizeTabs&&this.rendered&&this.autoSizeTabs();this.enableTabScroll&&this.rendered&&this.autoScrollTabs()},autoSizeTabs:function(){var b=this.items.length,g=this.tabPosition!="bottom"?"header":"footer",l=this[g].dom.offsetWidth,f=this[g].dom.clientWidth;if(!this.resizeTabs||b<1||!f)return;var d=Math.max(Math.min(Math.floor((f-4)/b)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=d;for(var e=this.strip.query("li:not(.x-tab-edge)"),a=0,i=e.length;a<i;a++){var h=e[a],c=Ext.fly(h).child(".x-tab-strip-inner",true),k=h.offsetWidth,j=c.offsetWidth;c.style.width=d-(k-j)+"px"}},adjustBodyWidth:function(a){this.header&&this.header.setWidth(a);this.footer&&this.footer.setWidth(a);return a},setActiveTab:function(a){a=this.getComponent(a);if(this.fireEvent("beforetabchange",this,a,this.activeTab)===false)return;if(!this.rendered){this.activeTab=a;return}if(this.activeTab!=a){if(this.activeTab){var b=this.getTabEl(this.activeTab);b&&Ext.fly(b).removeClass("x-tab-strip-active")}this.activeTab=a;if(a){var c=this.getTabEl(a);Ext.fly(c).addClass("x-tab-strip-active");this.stack.add(a);this.layout.setActiveItem(a);this.scrolling&&this.scrollToTab(a,this.animScroll)}this.fireEvent("tabchange",this,a)}},getActiveTab:function(){return this.activeTab||null},getItem:function(a){return this.getComponent(a)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var f=this.items.length,h=this.pos.dom.offsetWidth,a=this.pos.dom.clientWidth,c=this.stripWrap,b=c.dom,g=b.offsetWidth,e=this.getScrollPos(),d=this.edge.getOffsetsTo(this.stripWrap)[0]+e;if(!this.enableTabScroll||f<1||g<20)return;if(d<=a){b.scrollLeft=0;c.setWidth(a);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){b.style.marginLeft="";b.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){b.style.marginLeft="18px";b.style.marginRight="18px"}}a-=c.getMargins("lr");c.setWidth(a>20?a:20);if(!this.scrolling)if(!this.scrollLeft)this.createScrollers();else{this.scrollLeft.show();this.scrollRight.show()}this.scrolling=true;if(e>d-a)b.scrollLeft=d-a;else this.scrollToTab(this.activeTab,false);this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var c=this.stripWrap.dom.offsetHeight,a=this.pos.insertFirst({cls:"x-tab-scroller-left"});a.setHeight(c);a.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=a;var b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(c);b.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=b},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return {duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(f,c){if(!f)return;var g=this.getTabEl(f),b=this.getScrollPos(),e=this.getScrollArea(),a=Ext.fly(g).getOffsetsTo(this.stripWrap)[0]+b,d=a+g.offsetWidth;if(a<b)this.scrollTo(a,c);else d>b+e&&this.scrollTo(d-e,c)},scrollTo:function(b,a){this.stripWrap.scrollTo("left",b,a?this.getScrollAnim():false);!a&&this.updateScrollButtons()},onWheel:function(b){var f=b.getWheelDelta()*this.wheelIncrement*-1;b.stopEvent();var a=this.getScrollPos(),d=a+f,e=this.getScrollWidth()-this.getScrollArea(),c=Math.max(0,Math.min(e,d));c!=a&&this.scrollTo(c,false)},onScrollRight:function(){var c=this.getScrollWidth()-this.getScrollArea(),a=this.getScrollPos(),b=Math.min(c,a+this.getScrollIncrement());b!=a&&this.scrollTo(b,this.animScroll)},onScrollLeft:function(){var a=this.getScrollPos(),b=Math.max(0,a-this.getScrollIncrement());b!=a&&this.scrollTo(b,this.animScroll)},updateScrollButtons:function(){var a=this.getScrollPos();this.scrollLeft[a===0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[a>=this.getScrollWidth()-this.getScrollArea()?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){Ext.destroy(this.leftRepeater,this.rightRepeater);this.deleteMembers("strip","edge","scrollLeft","scrollRight","stripWrap");this.activeTab=null;Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var a=[];return {add:function(b){a.push(b);a.length>10&&a.shift()},remove:function(d){for(var c=[],b=0,e=a.length;b<e;b++)a[b]!=d&&c.push(a[b]);a=c},next:function(){return a.pop()}}};Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu)this.menu=Ext.menu.MenuMgr.get(this.menu);if(Ext.isString(this.toggleGroup))this.enableToggle=true},getTemplateArgs:function(){return [this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){if(this.useSetClass){!Ext.isEmpty(this.oldCls)&&this.el.removeClass([this.oldCls,"x-btn-pressed"]);this.oldCls=this.iconCls||this.icon?this.text?"x-btn-text-icon":"x-btn-icon":"x-btn-noicon";this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null])}},getMenuClass:function(){return this.menu?this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom":""},onRender:function(d,b){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var a,c=this.getTemplateArgs();if(b)a=this.template.insertBefore(b,c,true);else a=this.template.append(d,c,true);this.btnEl=a.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(a,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(a,c){this.el=a;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex))c.dom.tabIndex=this.tabIndex;this.tooltip&&this.setTooltip(this.tooltip,true);this.handleMouseEvents&&this.mon(a,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown});this.menu&&this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide});if(this.repeat){var b=new Ext.util.ClickRepeater(a,Ext.isObject(this.repeat)?this.repeat:{});this.mon(b,"click",this.onClick,this)}this.mon(a,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(a){this.iconCls=a;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",a||""]);this.setButtonClass()}return this},setTooltip:function(a,b){if(this.rendered){!b&&this.clearTip();if(Ext.isObject(a)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},a));this.tooltip=a}else this.btnEl.dom[this.tooltipType]=a}else this.tooltip=a;return this},clearTip:function(){Ext.isObject(this.tooltip)&&Ext.QuickTips.unregister(this.btnEl)},beforeDestroy:function(){this.rendered&&this.clearTip();this.menu&&this.destroyMenu!==false&&Ext.destroy(this.menu);Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var a=this.btnEl;if(a&&a.getWidth()>20){a.clip();a.setWidth(Ext.util.TextMetrics.measure(a,this.text).width+a.getFrameWidth("lr"))}}if(this.minWidth)this.el.getWidth()<this.minWidth&&this.el.setWidth(this.minWidth)}},setHandler:function(a,b){this.handler=a;this.scope=b;return this},setText:function(a){this.text=a;if(this.el){this.btnEl.update(a||"&#160;");this.setButtonClass()}this.doAutoWidth();return this},setIcon:function(a){this.icon=a;if(this.el){this.btnEl.setStyle("background-image",a?"url("+a+")":"");this.setButtonClass()}return this},getText:function(){return this.text},toggle:function(a,b){a=a===undefined?!this.pressed:!!a;if(a!=this.pressed){this.rendered&&this.el[a?"addClass":"removeClass"]("x-btn-pressed");this.pressed=a;if(!b){this.fireEvent("toggle",this,a);this.toggleHandler&&this.toggleHandler.call(this.scope||this,this,a)}}return this},onDisable:function(){this.onDisableChange(true)},onEnable:function(){this.onDisableChange(false)},onDisableChange:function(a){if(this.el){(!Ext.isIE6||!this.text)&&this.el[a?"addClass":"removeClass"](this.disabledClass);this.el.dom.disabled=a}this.disabled=a},showMenu:function(){if(this.rendered&&this.menu){this.tooltip&&Ext.QuickTips.getQuickTip().cancelShow(this.btnEl);this.menu.isVisible()&&this.menu.hide();this.menu.ownerCt=this;this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){this.hasVisibleMenu()&&this.menu.hide();return this},hasVisibleMenu:function(){return this.menu&&this.menu.ownerCt==this&&this.menu.isVisible()},onClick:function(a){a&&a.preventDefault();if(a.button!==0)return;if(!this.disabled){this.enableToggle&&(this.allowDepress!==false||!this.pressed)&&this.toggle();this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick&&this.showMenu();this.fireEvent("click",this,a);this.handler&&this.handler.call(this.scope||this,this,a)}},isMenuTriggerOver:function(b,a){return this.menu&&!a},isMenuTriggerOut:function(b,a){return this.menu&&!a},onMouseOver:function(a){if(!this.disabled){var b=a.within(this.el,true);if(!b){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){this.doc.on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,a)}this.isMenuTriggerOver(a,b)&&this.fireEvent("menutriggerover",this,this.menu,a)}},monitorMouseOver:function(a){if(a.target!=this.el.dom&&!a.within(this.el)){if(this.monitoringMouseOver){this.doc.un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(a)}},onMouseOut:function(a){var b=a.within(this.el)&&a.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,a);this.isMenuTriggerOut(a,b)&&this.fireEvent("menutriggerout",this,this.menu,a)},focus:function(){this.btnEl.focus()},blur:function(){this.btnEl.blur()},onFocus:function(){!this.disabled&&this.el.addClass("x-btn-focus")},onBlur:function(){this.el.removeClass("x-btn-focus")},getClickEl:function(){return this.el},onMouseDown:function(a){if(!this.disabled&&a.button===0){this.getClickEl(a).addClass("x-btn-click");this.doc.on("mouseup",this.onMouseUp,this)}},onMouseUp:function(a){if(a.button===0){this.getClickEl(a,true).removeClass("x-btn-click");this.doc.un("mouseup",this.onMouseUp,this)}},onMenuShow:function(){if(this.menu.ownerCt==this){this.menu.ownerCt=this;this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)}},onMenuHide:function(){if(this.menu.ownerCt==this){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu);delete this.menu.ownerCt}},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var a={};function b(d,e){if(e)for(var c=a[d.toggleGroup],b=0,f=c.length;b<f;b++)c[b]!=d&&c[b].toggle(false)}return {register:function(c){if(!c.toggleGroup)return;var d=a[c.toggleGroup];if(!d)d=a[c.toggleGroup]=[];d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup)return;var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getPressed:function(d){var b=a[d];if(b)for(var c=0,e=b.length;c<e;c++)if(b[c].pressed===true)return b[c];return null}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"em",split:true,initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(){Ext.SplitButton.superclass.onRender.apply(this,arguments);if(this.arrowTooltip)this.el.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip},setArrowHandler:function(a,b){this.arrowHandler=a;this.scope=b},getMenuClass:function(){return "x-btn-split"+(this.arrowAlign=="bottom"?"-bottom":"")},isClickOnArrow:function(b){if(this.arrowAlign!="bottom"){var a=this.el.child("em.x-btn-split"),c=a.getRegion().right-a.getPadding("r");return b.getPageX()>c}else return b.getPageY()>this.btnEl.getRegion().bottom},onClick:function(a){a.preventDefault();if(!this.disabled)if(this.isClickOnArrow(a)){this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick&&this.showMenu();this.fireEvent("arrowclick",this,a);this.arrowHandler&&this.arrowHandler.call(this.scope||this,this,a)}else{this.enableToggle&&this.toggle();this.fireEvent("click",this,a);this.handler&&this.handler.call(this.scope||this,this,a)}},isMenuTriggerOver:function(a){return this.menu&&a.target.tagName==this.arrowSelector},isMenuTriggerOut:function(a){return this.menu&&a.target.tagName!=this.arrowSelector}});Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(b){if(b&&this.showText===true){var a="";if(this.prependText)a+=this.prependText;a+=b.text;return a}return undefined},setActiveItem:function(a,c){if(!Ext.isObject(a))a=this.menu.getComponent(a);if(a){if(!this.rendered){this.text=this.getItemText(a);this.iconCls=a.iconCls}else{var b=this.getItemText(a);b&&this.setText(b);this.setIconClass(a.iconCls)}this.activeItem=a;!a.checked&&a.setChecked(true,false);this.forceIcon&&this.setIconClass(this.forceIcon);!c&&this.fireEvent("change",this,a)}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var a=0;Ext.each(this.items,function(b,c){Ext.apply(b,{group:b.group||this.id,itemIndex:c,checkHandler:this.checkHandler,scope:this,checked:b.checked||false});this.menu.items.push(b);if(b.checked)a=c},this);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this);this.setActiveItem(a,true)},checkHandler:function(b,a){a&&this.setActiveItem(b)},toggleSelected:function(){var a=this.menu;a.render();!a.hasLayout&&a.doLayout();for(var d,b,c=1;c<this.itemCount;c++){d=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(d);if(!b.disabled){b.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(a){if(Ext.isArray(a))a={items:a,layout:"toolbar"};else{a=Ext.apply({layout:"toolbar"},a);if(a.buttons)a.items=a.buttons}Ext.Toolbar.superclass.constructor.call(this,a)};(function(){var a=Ext.Toolbar;Ext.extend(a,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){a.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(b,a){if(!this.el){if(!this.autoCreate)this.autoCreate={cls:this.toolbarCls+" x-small-editor"};this.el=b.createChild(Ext.apply({id:this.id},this.autoCreate),a);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(b){if(Ext.isString(b)){if(b=="-")b=new a.Separator;else if(b==" ")b=new a.Spacer;else if(b=="->")b=new a.Fill;else b=new a.TextItem(b);this.applyDefaults(b)}else if(b.isFormField||b.render)b=this.createComponent(b);else if(b.tag)b=new a.Item({autoEl:b});else if(b.tagName)b=new a.Item({el:b});else if(Ext.isObject(b))b=b.xtype?this.createComponent(b):this.constructButton(b);return b},applyDefaults:function(a){if(!Ext.isString(a)){a=Ext.Toolbar.superclass.applyDefaults.call(this,a);var b=this.internalDefaults;if(a.events){Ext.applyIf(a.initialConfig,b);Ext.apply(a,b)}else Ext.applyIf(a,b)}return a},addSeparator:function(){return this.add(new a.Separator)},addSpacer:function(){return this.add(new a.Spacer)},addFill:function(){this.add(new a.Fill)},addElement:function(b){return this.addItem(new a.Item({el:b}))},addItem:function(){return this.add.apply(this,arguments)},addButton:function(a){if(Ext.isArray(a)){for(var c=[],b=0,d=a.length;b<d;b++)c.push(this.addButton(a[b]));return c}return this.add(this.constructButton(a))},addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(a){return this.add(a)},insertButton:function(d,a){if(Ext.isArray(a)){for(var c=[],b=0,e=a.length;b<e;b++)c.push(this.insertButton(d+b,a[b]));return c}return Ext.Toolbar.superclass.insert.call(this,d,a)},trackMenu:function(a,c){if(this.trackMenus&&a.menu){var b=c?"mun":"mon";this[b](a,"menutriggerover",this.onButtonTriggerOver,this);this[b](a,"menushow",this.onButtonMenuShow,this);this[b](a,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(a){var b=a.events?a:this.createComponent(a,a.split?"splitbutton":this.defaultType);return b},onAdd:function(a){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(a);this.disabled&&a.disable()},onRemove:function(a){Ext.Toolbar.superclass.onRemove.call(this);this.trackMenu(a,true)},onDisable:function(){this.items.each(function(a){a.disable&&a.disable()})},onEnable:function(){this.items.each(function(a){a.enable&&a.enable()})},onButtonTriggerOver:function(a){if(this.activeMenuBtn&&this.activeMenuBtn!=a){this.activeMenuBtn.hideMenu();a.showMenu();this.activeMenuBtn=a}},onButtonMenuShow:function(a){this.activeMenuBtn=a},onButtonMenuHide:function(){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);a.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",a.Item);a.Separator=Ext.extend(a.Item,{onRender:function(b,a){this.el=b.createChild({tag:"span",cls:"xtb-sep"},a)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(b,a){this.el=b.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},a)}});Ext.reg("tbspacer",a.Spacer);a.Fill=Ext.extend(a.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",a.Fill);a.TextItem=Ext.extend(a.Item,{constructor:function(b){a.TextItem.superclass.constructor.call(this,Ext.isString(b)?{text:b}:b)},onRender:function(c,b){this.autoEl={cls:"xtb-text",html:this.text||""};a.TextItem.superclass.onRender.call(this,c,b)},setText:function(a){if(this.rendered)this.el.update(a);else this.text=a}});Ext.reg("tbtext",a.TextItem);a.Button=Ext.extend(Ext.Button,{});a.SplitButton=Ext.extend(Ext.SplitButton,{});Ext.reg("tbbutton",a.Button);Ext.reg("tbsplit",a.SplitButton)})();(function(){var a=Ext.Toolbar;Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",initComponent:function(){var b=[this.first=new a.Button({tooltip:this.firstText,overflowText:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.moveFirst,scope:this}),this.prev=new a.Button({tooltip:this.prevText,overflowText:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.movePrevious,scope:this}),"-",this.beforePageText,this.inputItem=new Ext.form.NumberField({cls:"x-tbar-page-number",allowDecimals:false,allowNegative:false,enableKeyEvents:true,selectOnFocus:true,submitValue:false,listeners:{scope:this,keydown:this.onPagingKeyDown,blur:this.onPagingBlur}}),this.afterTextItem=new a.TextItem({text:String.format(this.afterPageText,1)}),"-",this.next=new a.Button({tooltip:this.nextText,overflowText:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.moveNext,scope:this}),this.last=new a.Button({tooltip:this.lastText,overflowText:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.moveLast,scope:this}),"-",this.refresh=new a.Button({tooltip:this.refreshText,overflowText:this.refreshText,iconCls:"x-tbar-loading",handler:this.doRefresh,scope:this})],c=this.items||this.buttons||[];if(this.prependButtons)this.items=c.concat(b);else this.items=b.concat(c);delete this.buttons;if(this.displayInfo){this.items.push("->");this.items.push(this.displayItem=new a.TextItem({}))}Ext.PagingToolbar.superclass.initComponent.call(this);this.addEvents("change","beforechange");this.on("afterlayout",this.onFirstLayout,this,{single:true});this.cursor=0;this.bindStore(this.store,true)},onFirstLayout:function(){this.dsLoaded&&this.onLoad.apply(this,this.dsLoaded)},updateInfo:function(){if(this.displayItem){var a=this.store.getCount(),b=a==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+a,this.store.getTotalCount());this.displayItem.setText(b)}},onLoad:function(f,g,c){if(!this.rendered){this.dsLoaded=[f,g,c];return}var e=this.getParams();this.cursor=c.params&&c.params[e.start]?c.params[e.start]:0;var b=this.getPageData(),a=b.activePage,d=b.pages;this.afterTextItem.setText(String.format(this.afterPageText,b.pages));this.inputItem.setValue(a);this.first.setDisabled(a==1);this.prev.setDisabled(a==1);this.next.setDisabled(a==d);this.last.setDisabled(a==d);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,b)},getPageData:function(){var a=this.store.getTotalCount();return {total:a,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:a<this.pageSize?1:Math.ceil(a/this.pageSize)}},changePage:function(a){this.doLoad(((a-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){if(!this.rendered)return;this.refresh.enable()},readPage:function(c){var b=this.inputItem.getValue(),a;if(!b||isNaN(a=parseInt(b,10))){this.inputItem.setValue(c.activePage);return false}return a},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(f,a){var c=a.getKey(),d=this.getPageData(),b;if(c==a.RETURN){a.stopEvent();b=this.readPage(d);if(b!==false){b=Math.min(Math.max(1,b),d.pages)-1;this.doLoad(b*this.pageSize)}}else if(c==a.HOME||c==a.END){a.stopEvent();b=c==a.HOME?1:d.pages;f.setValue(b)}else if(c==a.UP||c==a.PAGEUP||c==a.DOWN||c==a.PAGEDOWN){a.stopEvent();if(b=this.readPage(d)){var e=a.shiftKey?10:1;if(c==a.DOWN||c==a.PAGEDOWN)e*=-1;b+=e;b>=1&b<=d.pages&&f.setValue(b)}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){this.rendered&&this.refresh&&this.refresh.disable()},doLoad:function(c){var a={},b=this.getParams();a[b.start]=c;a[b.limit]=this.pageSize;this.fireEvent("beforechange",this,a)!==false&&this.store.load({params:a})},moveFirst:function(){this.doLoad(0)},movePrevious:function(){this.doLoad(Math.max(0,this.cursor-this.pageSize))},moveNext:function(){this.doLoad(this.cursor+this.pageSize)},moveLast:function(){var a=this.store.getTotalCount(),b=a%this.pageSize;this.doLoad(b?a-b:a-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(a,c){var b;if(!c&&this.store){if(a!==this.store&&this.store.autoDestroy)this.store.destroy();else{this.store.un("beforeload",this.beforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.onLoadError,this)}if(!a)this.store=null}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});b=true}this.store=a;b&&this.onLoad(a,null,{})},unbind:function(){this.bindStore(null)},bind:function(a){this.bindStore(a)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){Ext.isArray(this.initialConfig)&&Ext.apply(this,{items:this.initialConfig});this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating)Ext.EventManager.onWindowResize(this.hide,this);else{if(this.initialConfig.hidden!==false)this.hidden=false;this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var a=this.doLayout.createDelegate(this,[]);this.on({add:a,remove:a})}},getLayoutTarget:function(){return this.ul},onRender:function(a,c){if(!a)a=Ext.getBody();var b={id:this.getId(),cls:"x-menu "+(this.floating?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating)this.el=new Ext.Layer({shadow:this.shadow,dh:b,constrain:false,parentEl:a,zindex:this.zIndex});else this.el=a.createChild(b);Ext.menu.Menu.superclass.onRender.call(this,a,c);if(!this.keyNav)this.keyNav=new Ext.menu.MenuNav(this);this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});this.enableScrolling&&this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})},findTargetItem:function(b){var a=b.getTarget(".x-menu-list-item",this.ul,true);if(a&&a.menuItemId)return this.items.get(a.menuItemId)},onClick:function(b){var a=this.findTargetItem(b);if(a)if(a.isFormField)this.setActiveItem(a);else if(a instanceof Ext.menu.BaseItem)if(a.menu&&this.ignoreParentClicks){a.expandMenu();b.preventDefault()}else if(a.onClick){a.onClick(b);this.fireEvent("click",this,a,b)}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();if((this.activeItem=a).isFormField)a.focus();else a.activate(b)}else b&&a.expandMenu()},deactivateActive:function(){var a=this.activeItem;if(a){if(a.isFormField)a.collapse&&a.collapse();else a.deactivate();delete this.activeItem}},tryActivate:function(d,e){for(var c=this.items,b=d,f=c.length;b>=0&&b<f;b+=e){var a=c.get(b);if(!a.disabled&&(a.canActivate||a.isFormField)){this.setActiveItem(a,false);return a}}return false},onMouseOver:function(b){var a=this.findTargetItem(b);if(a)a.canActivate&&!a.disabled&&this.setActiveItem(a,true);this.over=true;this.fireEvent("mouseover",this,b,a)},onMouseOut:function(b){var a=this.findTargetItem(b);if(a)if(a==this.activeItem&&a.shouldDeactivate&&a.shouldDeactivate(b)){this.activeItem.deactivate();delete this.activeItem}this.over=false;this.fireEvent("mouseout",this,b,a)},onScroll:function(c,d){c&&c.stopEvent();var a=this.ul.dom,b=Ext.fly(d).is(".x-menu-scroller-top");a.scrollTop+=this.scrollIncrement*(b?-1:1);(b?a.scrollTop<=0:a.scrollTop+this.activeMax>=a.scrollHeight)&&this.onScrollerOut(null,d)},onScrollerIn:function(d,b){var a=this.ul.dom,c=Ext.fly(b).is(".x-menu-scroller-top");(c?a.scrollTop>0:a.scrollTop+this.activeMax<a.scrollHeight)&&Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])},onScrollerOut:function(b,a){Ext.fly(a).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(c,b,a){if(this.floating){this.parentMenu=a;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(c,b||this.defaultAlign,this.defaultOffsets),a)}else Ext.menu.Menu.superclass.show.call(this)},showAt:function(a,b){if(this.fireEvent("beforeshow",this)!==false){this.parentMenu=b;!this.el&&this.render();if(this.enableScrolling){this.el.setXY(a);a[1]=this.constrainScroll(a[1]);a=[this.el.adjustForConstraints(a)[0],a[1]]}else a=this.el.adjustForConstraints(a);this.el.setXY(a);this.el.show();Ext.menu.Menu.superclass.onShow.call(this);if(Ext.isIE){this.fireEvent("autosize",this);!Ext.isIE8&&this.el.repaint()}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(d){var a,b=this.ul.setHeight("auto").getHeight(),g=d,f,e,h,c;if(this.floating){e=Ext.fly(this.el.dom.parentNode);h=e.getScroll().top;c=e.getViewSize().height;f=d-h;a=this.maxHeight?this.maxHeight:c-f;if(b>c){a=c;g=d-f}else if(a<b){g=d-(b-a);a=b}}else a=this.getHeight();if(this.maxHeight)a=Math.min(this.maxHeight,a);if(b>a&&a>0){this.activeMax=a-this.scrollerHeight*2-this.el.getFrameWidth("tb")-Ext.num(this.el.shadowOffset,0);this.ul.setHeight(this.activeMax);this.createScrollers();this.el.select(".x-menu-scroller").setDisplayed("")}else{this.ul.setHeight(b);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return g},createScrollers:function(){if(!this.scroller){this.scroller={pos:0,top:this.el.insertFirst({tag:"div",cls:"x-menu-scroller x-menu-scroller-top",html:"&#160;"}),bottom:this.el.createChild({tag:"div",cls:"x-menu-scroller x-menu-scroller-bottom",html:"&#160;"})};this.scroller.top.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.topRepeater=new Ext.util.ClickRepeater(this.scroller.top,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.top],false)}});this.scroller.bottom.hover(this.onScrollerIn,this.onScrollerOut,this);this.scroller.bottomRepeater=new Ext.util.ClickRepeater(this.scroller.bottom,{listeners:{click:this.onScroll.createDelegate(this,[null,this.scroller.bottom],false)}})}},onLayout:function(){if(this.isVisible()){this.enableScrolling&&this.constrainScroll(this.el.getTop());this.floating&&this.el.sync()}},focus:function(){!this.hidden&&this.doFocus.defer(50,this)},doFocus:function(){!this.hidden&&this.focusEl.focus()},hide:function(a){if(!this.isDestroyed){this.deepHide=a;Ext.menu.Menu.superclass.hide.call(this);delete this.deepHide}},onHide:function(){Ext.menu.Menu.superclass.onHide.call(this);this.deactivateActive();this.el&&this.floating&&this.el.hide();var a=this.parentMenu;if(this.deepHide===true&&a)if(a.floating)a.hide(true);else a.deactivateActive()},lookupComponent:function(a){if(Ext.isString(a)){a=a=="separator"||a=="-"?new Ext.menu.Separator:new Ext.menu.TextItem(a);this.applyDefaults(a)}else if(Ext.isObject(a))a=this.getMenuItem(a);else if(a.tagName||a.el)a=new Ext.BoxComponent({el:a});return a},applyDefaults:function(a){if(!Ext.isString(a)){a=Ext.menu.Menu.superclass.applyDefaults.call(this,a);var b=this.internalDefaults;if(b)if(a.events){Ext.applyIf(a.initialConfig,b);Ext.apply(a,b)}else Ext.applyIf(a,b)}return a},getMenuItem:function(a){if(!a.isXType){if(!a.xtype&&Ext.isBoolean(a.checked))return new Ext.menu.CheckItem(a);return Ext.create(a,this.defaultType)}return a},addSeparator:function(){return this.add(new Ext.menu.Separator)},addElement:function(a){return this.add(new Ext.menu.BaseItem({el:a}))},addItem:function(a){return this.add(a)},addMenuItem:function(a){return this.add(this.getMenuItem(a))},addText:function(a){return this.add(new Ext.menu.TextItem(a))},onDestroy:function(){Ext.EventManager.removeResizeListener(this.hide,this);var b=this.parentMenu;if(b&&b.activeChild==this)delete b.activeChild;delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);this.keyNav&&this.keyNav.disable();var a=this.scroller;a&&Ext.destroy(a.topRepeater,a.bottomRepeater,a.top,a.bottom);Ext.destroy(this.el,this.focusEl,this.ul)}});Ext.reg("menu",Ext.menu.Menu);Ext.menu.MenuNav=Ext.extend(Ext.KeyNav,function(){function b(b,a){!a.tryActivate(a.items.indexOf(a.activeItem)-1,-1)&&a.tryActivate(a.items.length-1,-1)}function a(b,a){!a.tryActivate(a.items.indexOf(a.activeItem)+1,1)&&a.tryActivate(0,1)}return {constructor:function(a){Ext.menu.MenuNav.superclass.constructor.call(this,a.el);this.scope=this.menu=a},doRelay:function(a,c){var b=a.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&b!=a.TAB)return false;if(!this.menu.activeItem&&a.isNavKeyPress()&&b!=a.SPACE&&b!=a.RETURN){this.menu.tryActivate(0,1);return false}return c.call(this.scope||this,a,this.menu)},tab:function(c,d){c.stopEvent();if(c.shiftKey)b(c,d);else a(c,d)},up:b,down:a,right:function(b,a){a.activeItem&&a.activeItem.expandMenu(true)},left:function(b,a){a.hide();a.parentMenu&&a.parentMenu.activeItem&&a.parentMenu.activeItem.activate()},enter:function(b,a){if(a.activeItem){b.stopPropagation();a.activeItem.onClick(b);a.fireEvent("click",this,a.activeItem);return true}}}}());Ext.menu.MenuMgr=function(){var c,a,b={},e=false,j=new Date;function m(){c={};a=new Ext.util.MixedCollection;Ext.getDoc().addKeyListener(27,function(){a.length>0&&d()})}function d(){if(a&&a.length>0){var b=a.clone();b.each(function(a){a.hide()});return true}return false}function k(b){a.remove(b);if(a.length<1){Ext.getDoc().un("mousedown",i);e=false}}function l(b){var c=a.last();j=new Date;a.add(b);if(!e){Ext.getDoc().on("mousedown",i);e=true}if(b.parentMenu){b.getEl().setZIndex(parseInt(b.parentMenu.getEl().getStyle("z-index"),10)+3);b.parentMenu.activeChild=b}else c&&!c.isDestroyed&&c.isVisible()&&b.getEl().setZIndex(parseInt(c.getEl().getStyle("z-index"),10)+3)}function g(a){a.activeChild&&a.activeChild.hide();if(a.autoHideTimer){clearTimeout(a.autoHideTimer);delete a.autoHideTimer}}function h(b){var a=b.parentMenu;if(!a&&!b.allowOtherMenus)d();else a&&a.activeChild&&a.activeChild.hide()}function i(b){j.getElapsed()>50&&a.length>0&&!b.getTarget(".x-menu")&&d()}function f(d,e){if(e)for(var c=b[d.group],a=0,f=c.length;a<f;a++)c[a]!=d&&c[a].setChecked(false)}return {hideAll:function(){return d()},register:function(a){!c&&m();c[a.id]=a;a.on({beforehide:g,hide:k,beforeshow:h,show:l})},"get":function(a){if(typeof a=="string"){if(!c)return null;return c[a]}else if(a.events)return a;else if(typeof a.length=="number")return new Ext.menu.Menu({items:a});else return Ext.create(a,"menu")},unregister:function(a){delete c[a.id];a.un("beforehide",g);a.un("hide",k);a.un("beforeshow",h);a.un("show",l)},registerCheckable:function(c){var a=c.group;if(a){if(!b[a])b[a]=[];b[a].push(c);c.on("beforecheckchange",f)}},unregisterCheckable:function(a){var c=a.group;if(c){b[c].remove(a);a.un("beforecheckchange",f)}},getCheckedItem:function(d){var a=b[d];if(a)for(var c=0,e=a.length;c<e;c++)if(a[c].checked)return a[c];return null},setCheckedItem:function(d,e){var a=b[d];if(a)for(var c=0,f=a.length;c<f;c++)a[c].id==e&&a[c].setChecked(true);return null}}}();Ext.menu.BaseItem=Ext.extend(Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,clickHideDelay:1,ctype:"Ext.menu.BaseItem",actionMode:"container",initComponent:function(){Ext.menu.BaseItem.superclass.initComponent.call(this);this.addEvents("click","activate","deactivate");this.handler&&this.on("click",this.handler,this.scope)},onRender:function(){Ext.menu.BaseItem.superclass.onRender.apply(this,arguments);if(this.ownerCt&&this.ownerCt instanceof Ext.menu.Menu)this.parentMenu=this.ownerCt;else{this.container.addClass("x-menu-list-item");this.mon(this.el,{scope:this,click:this.onClick,mouseenter:this.activate,mouseleave:this.deactivate})}},setHandler:function(a,b){this.handler&&this.un("click",this.handler,this.scope);this.on("click",this.handler=a,this.scope=b)},onClick:function(a){if(!this.disabled&&this.fireEvent("click",this,a)!==false&&(this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false))this.handleClick(a);else a.stopEvent()},activate:function(){if(this.disabled)return false;var a=this.container;a.addClass(this.activeClass);this.region=a.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(a){return !this.region||!this.region.contains(a.getPoint())},handleClick:function(){var a=this.parentMenu;if(this.hideOnClick)if(a.floating)a.hide.defer(this.clickHideDelay,a,[true]);else a.deactivateActive()},expandMenu:Ext.emptyFn,hideMenu:Ext.emptyFn});Ext.reg("menubaseitem",Ext.menu.BaseItem);Ext.menu.TextItem=Ext.extend(Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",constructor:function(a){if(typeof a=="string")a={text:a};Ext.menu.TextItem.superclass.constructor.call(this,a)},onRender:function(){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML=this.text;this.el=a;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.reg("menutextitem",Ext.menu.TextItem);Ext.menu.Separator=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,activeClass:"",onRender:function(b){var a=document.createElement("span");a.className=this.itemCls;a.innerHTML="&#160;";this.el=a;b.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.reg("menuseparator",Ext.menu.Separator);Ext.menu.Item=Ext.extend(Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=this}},onRender:function(b,a){if(!this.itemTpl)this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"','<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>");var c=this.getTemplateArgs();this.el=a?this.itemTpl.insertBefore(a,c,true):this.itemTpl.append(b,c,true);this.iconEl=this.el.child("img.x-menu-item-icon");this.textEl=this.el.child(".x-menu-item-text");!this.href&&this.mon(this.el,"click",Ext.emptyFn,null,{preventDefault:true});Ext.menu.Item.superclass.onRender.call(this,b,a)},getTemplateArgs:function(){return {id:this.id,cls:this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:""),href:this.href||"#",hrefTarget:this.hrefTarget,icon:this.icon||Ext.BLANK_IMAGE_URL,iconCls:this.iconCls||"",text:this.itemText||this.text||"&#160;"}},setText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(b){var a=this.iconCls;this.iconCls=b;this.rendered&&this.iconEl.replaceClass(a,this.iconCls)},beforeDestroy:function(){if(this.menu){delete this.menu.ownerCt;this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(a){!this.href&&a.stopEvent();Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(a){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();a&&this.expandMenu()}return true},shouldDeactivate:function(a){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,a)){if(this.menu&&this.menu.isVisible())return !this.menu.getEl().getRegion().contains(a.getPoint());return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(a){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer)this.showTimer=this.deferExpand.defer(this.showDelay,this,[a]);else this.menu.isVisible()&&a&&this.menu.tryActivate(0,1)}},deferExpand:function(a){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);a&&this.menu.tryActivate(0,1)},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible())this.hideTimer=this.deferHide.defer(this.hideDelay,this)},deferHide:function(){delete this.hideTimer;if(this.menu.over)this.parentMenu.setActiveItem(this,false);else this.menu.hide()}});Ext.reg("menuitem",Ext.menu.Item);Ext.menu.CheckItem=Ext.extend(Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",initComponent:function(){Ext.menu.CheckItem.superclass.initComponent.call(this);this.addEvents("beforecheckchange","checkchange");this.checkHandler&&this.on("checkchange",this.checkHandler,this.scope);Ext.menu.MenuMgr.registerCheckable(this)},onRender:function(){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);this.group&&this.el.addClass(this.groupClass);if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(a,c){var b=c===true;if(this.checked!=a&&(b||this.fireEvent("beforecheckchange",this,a)!==false)){this.container&&this.container[a?"addClass":"removeClass"]("x-menu-item-checked");this.checked=a;!b&&this.fireEvent("checkchange",this,a)}},handleClick:function(){!this.disabled&&!(this.checked&&this.group)&&this.setChecked(!this.checked);Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.reg("menucheckitem",Ext.menu.CheckItem);Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(d,c){if(!this.el){var b=this.getAutoCreate();if(!b.name)b.name=this.name||this.id;if(this.inputType)b.type=this.inputType;this.autoEl=b}Ext.form.Field.superclass.onRender.call(this,d,c);this.submitValue===false&&this.el.dom.removeAttribute("name");var a=this.el.dom.type;if(a){if(a=="password")a="text";this.el.addClass("x-form-"+a)}this.readOnly&&this.setReadOnly(true);this.tabIndex!==undefined&&this.el.dom.setAttribute("tabIndex",this.tabIndex);this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined)this.setValue(this.value);else!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText&&this.setValue(this.el.dom.value);this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered)return false;return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(a){if(this.rendered)this.el.dom.readOnly=a;this.readOnly=a},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(a){a.isSpecialKey()&&this.fireEvent("specialkey",this,a)},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();this.focusClass&&this.el.addClass(this.focusClass);if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();this.focusClass&&this.el.removeClass(this.focusClass);this.hasFocus=false;this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")&&this.validate();var a=this.getValue();String(a)!==String(this.startValue)&&this.fireEvent("change",this,a,this.startValue);this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(a){if(this.disabled)return true;var b=this.preventMark;this.preventMark=a===true;var c=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=b;return c},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},validateValue:function(b){var a=this.getErrors(b)[0];if(a==undefined)return true;else{this.markInvalid(a);return false}},getErrors:function(){return []},getActiveError:function(){return this.activeError||""},markInvalid:function(a){if(this.rendered&&!this.preventMark){a=a||this.invalidText;var c=this.getMessageHandler();if(c)c.mark(this,a);else if(this.msgTarget){this.el.addClass(this.invalidClass);var b=Ext.getDom(this.msgTarget);if(b){b.innerHTML=a;b.style.display=this.msgDisplay}}}this.setActiveError(a)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var b=this.getMessageHandler();if(b)b.clear(this);else if(this.msgTarget){this.el.removeClass(this.invalidClass);var a=Ext.getDom(this.msgTarget);if(a){a.innerHTML="";a.style.display="none"}}}this.unsetActiveError()},setActiveError:function(a,b){this.activeError=a;b!==true&&this.fireEvent("invalid",this,a)},unsetActiveError:function(a){delete this.activeError;a!==true&&this.fireEvent("valid",this)},getMessageHandler:function(){return Ext.form.MessageTargets[this.msgTarget]},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorEl:function(){this.errorEl.setWidth(this.getErrorCt().getWidth(true)-20)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},getRawValue:function(){var a=this.rendered?this.el.getValue():Ext.value(this.value,"");if(a===this.emptyText)a="";return a},getValue:function(){if(!this.rendered)return this.value;var a=this.el.getValue();if(a===this.emptyText||a===undefined)a="";return a},setRawValue:function(a){return this.rendered?(this.el.dom.value=Ext.isEmpty(a)?"":a):""},setValue:function(a){this.value=a;if(this.rendered){this.el.dom.value=Ext.isEmpty(a)?"":a;this.validate()}return this},append:function(a){this.setValue([this.getValue(),a].join(""))}});Ext.form.MessageTargets={qtip:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.qtip=b;a.el.dom.qclass="x-form-invalid-tip";Ext.QuickTips&&Ext.QuickTips.enable()},clear:function(a){a.el.removeClass(a.invalidClass);a.el.dom.qtip=""}},title:{mark:function(a,b){a.el.addClass(a.invalidClass);a.el.dom.title=b},clear:function(a){a.el.dom.title=""}},under:{mark:function(a,c){a.el.addClass(a.invalidClass);if(!a.errorEl){var b=a.getErrorCt();if(!b){a.el.dom.title=c;return}a.errorEl=b.createChild({cls:"x-form-invalid-msg"});a.on("resize",a.alignErrorEl,a);a.on("destroy",function(){Ext.destroy(this.errorEl)},a)}a.alignErrorEl();a.errorEl.update(c);Ext.form.Field.msgFx[a.msgFx].show(a.errorEl,a)},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorEl)Ext.form.Field.msgFx[a.msgFx].hide(a.errorEl,a);else a.el.dom.title=""}},side:{mark:function(a,c){a.el.addClass(a.invalidClass);if(!a.errorIcon){var b=a.getErrorCt();if(!b){a.el.dom.title=c;return}a.errorIcon=b.createChild({cls:"x-form-invalid-icon"});if(a.ownerCt){a.ownerCt.on("afterlayout",a.alignErrorIcon,a);a.ownerCt.on("expand",a.alignErrorIcon,a)}a.on("resize",a.alignErrorIcon,a);a.on("destroy",function(){Ext.destroy(this.errorIcon)},a)}a.alignErrorIcon();a.errorIcon.dom.qtip=c;a.errorIcon.dom.qclass="x-form-invalid-tip";a.errorIcon.show()},clear:function(a){a.el.removeClass(a.invalidClass);if(a.errorIcon){a.errorIcon.dom.qtip="";a.errorIcon.hide()}else a.el.dom.title=""}}};Ext.form.Field.msgFx={normal:{show:function(a){a.setDisplayed("block")},hide:function(a){a.setDisplayed(false).update("")}},slide:{show:function(a){a.slideIn("t",{stopFx:true})},hide:function(a){a.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(a,b){a.fixDisplay();a.alignTo(b.el,"tl-tr");a.slideIn("l",{stopFx:true})},hide:function(a){a.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.mon(this.el,"keyup",this.filterValidation,this)}else this.validationEvent!==false&&this.validationEvent!="blur"&&this.mon(this.el,this.validationEvent,this.validate,this,{buffer:this.validationDelay});if(this.selectOnFocus||this.emptyText){this.mon(this.el,"mousedown",this.onMouseDown,this);this.emptyText&&this.applyEmptyText()}(this.maskRe||this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))&&this.mon(this.el,"keypress",this.filterKeys,this);if(this.grow){this.mon(this.el,"keyup",this.onKeyUpBuffered,this,{buffer:50});this.mon(this.el,"click",this.autoSize,this)}this.enableKeyEvents&&this.mon(this.el,{scope:this,keyup:this.onKeyUp,keydown:this.onKeyDown,keypress:this.onKeyPress})},onMouseDown:function(){!this.hasFocus&&this.mon(this.el,"mouseup",Ext.emptyFn,this,{single:true,preventDefault:true})},processValue:function(b){if(this.stripCharsRe){var a=b.replace(this.stripCharsRe,"");if(a!==b){this.setRawValue(a);return a}}return b},filterValidation:function(a){!a.isNavKeyPress()&&this.validationTask.delay(this.validationDelay)},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE)this.el.dom.unselectable="on"},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE)this.el.dom.unselectable=""},onKeyUpBuffered:function(a){this.doAutoSize(a)&&this.autoSize()},doAutoSize:function(a){return !a.isNavKeyPress()},onKeyUp:function(a){this.fireEvent("keyup",this,a)},onKeyDown:function(a){this.fireEvent("keydown",this,a)},onKeyPress:function(a){this.fireEvent("keypress",this,a)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){var a=this.el;if(this.emptyText){a.dom.value==this.emptyText&&this.setRawValue("");a.removeClass(this.emptyClass)}this.selectOnFocus&&a.dom.select()},postBlur:function(){this.applyEmptyText()},filterKeys:function(a){if(a.ctrlKey)return;var c=a.getKey();if(Ext.isGecko&&(a.isNavKeyPress()||c==a.BACKSPACE||c==a.DELETE&&a.button==-1))return;var b=String.fromCharCode(a.getCharCode());if(!Ext.isGecko&&a.isSpecialKey()&&!b)return;!this.maskRe.test(b)&&a.stopEvent()},setValue:function(a){this.emptyText&&this.el&&!Ext.isEmpty(a)&&this.el.removeClass(this.emptyClass);Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize();return this},getErrors:function(a){var b=Ext.form.TextField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(Ext.isFunction(this.validator)){var c=this.validator(a);c!==true&&b.push(c)}if(a.length<1||a===this.emptyText)if(this.allowBlank)return b;else b.push(this.blankText);!this.allowBlank&&(a.length<1||a===this.emptyText)&&b.push(this.blankText);a.length<this.minLength&&b.push(String.format(this.minLengthText,this.minLength));a.length>this.maxLength&&b.push(String.format(this.maxLengthText,this.maxLength));if(this.vtype){var d=Ext.form.VTypes;!d[this.vtype](a,this)&&b.push(this.vtypeText||d[this.vtype+"Text"])}this.regex&&!this.regex.test(a)&&b.push(this.regexText);return b},selectText:function(a,b){var f=this.getRawValue(),d=false;if(f.length>0){a=a===undefined?0:a;b=b===undefined?f.length:b;var c=this.el.dom;if(c.setSelectionRange)c.setSelectionRange(a,b);else if(c.createTextRange){var e=c.createTextRange();e.moveStart("character",a);e.moveEnd("character",b-f.length);e.select()}d=Ext.isGecko||Ext.isOpera}else d=true;d&&this.focus()},autoSize:function(){if(!this.grow||!this.rendered)return;if(!this.metrics)this.metrics=Ext.util.TextMetrics.createInstance(this.el);var d=this.el,b=d.dom.value,a=document.createElement("div");a.appendChild(document.createTextNode(b));b=a.innerHTML;Ext.removeNode(a);a=null;b+="&#160;";var c=Math.min(this.growMax,Math.max(this.metrics.getWidth(b)+10,this.growMin));this.el.setWidth(c);this.fireEvent("autosize",this,c)},onDestroy:function(){if(this.validationTask){this.validationTask.cancel();this.validationTask=null}Ext.form.TextField.superclass.onDestroy.call(this)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,editable:true,readOnly:false,wrapFocusClass:"x-trigger-wrap-focus",autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,actionMode:"wrap",defaultTriggerWidth:17,onResize:function(a,c){Ext.form.TriggerField.superclass.onResize.call(this,a,c);var b=this.getTriggerWidth();Ext.isNumber(a)&&this.el.setWidth(a-b);this.wrap.setWidth(this.el.getWidth()+b)},getTriggerWidth:function(){var a=this.trigger.getWidth();if(!this.hideTrigger&&!this.readOnly&&a===0)a=this.defaultTriggerWidth;return a},alignErrorIcon:function(){this.wrap&&this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},onRender:function(b,a){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,b,a);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-field-trigger-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});this.initTrigger();!this.width&&this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());this.resizeEl=this.positionEl=this.wrap},getWidth:function(){return this.el.getWidth()+this.trigger.getWidth()},updateEditState:function(){if(this.rendered){if(this.readOnly){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this);this.trigger.setDisplayed(false)}else{if(!this.editable){this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}this.trigger.setDisplayed(!this.hideTrigger)}this.onResize(this.width||this.wrap.getWidth())}},setHideTrigger:function(a){if(a!=this.hideTrigger){this.hideTrigger=a;this.updateEditState()}},setEditable:function(a){if(a!=this.editable){this.editable=a;this.updateEditState()}},setReadOnly:function(a){if(a!=this.readOnly){this.readOnly=a;this.updateEditState()}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);this.updateEditState()},initTrigger:function(){this.mon(this.trigger,"click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){Ext.destroy(this.trigger,this.wrap);this.mimicing&&this.doc.un("mousedown",this.mimicBlur,this);delete this.doc;Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;this.doc.on("mousedown",this.mimicBlur,this,{delay:10});this.monitorTab&&this.on("specialkey",this.checkTab,this)}},checkTab:function(b,a){a.getKey()==a.TAB&&this.triggerBlur()},onBlur:Ext.emptyFn,mimicBlur:function(a){!this.isDestroyed&&!this.wrap.contains(a.target)&&this.validateBlur(a)&&this.triggerBlur()},triggerBlur:function(){this.mimicing=false;this.doc.un("mousedown",this.mimicBlur,this);this.monitorTab&&this.el&&this.un("specialkey",this.checkTab,this);Ext.form.TriggerField.superclass.onBlur.call(this);this.wrap&&this.wrap.removeClass(this.wrapFocusClass)},beforeBlur:Ext.emptyFn,validateBlur:function(){return true},onTriggerClick:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1e3,growAppend:"&#160;\n&#160;",enterIsSpecial:false,preventScrollbars:false,onRender:function(b,a){if(!this.el)this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"};Ext.form.TextArea.superclass.onRender.call(this,b,a);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});this.preventScrollbars&&this.el.setStyle("overflow","hidden");this.el.setHeight(this.growMin)}},onDestroy:function(){Ext.removeNode(this.textSizeEl);Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(a){a.isSpecialKey()&&(this.enterIsSpecial||(a.getKey()!=a.ENTER||a.hasModifier()))&&this.fireEvent("specialkey",this,a)},doAutoSize:function(a){return !a.isNavKeyPress()||a.getKey()==a.ENTER},autoSize:function(){if(!this.grow||!this.textSizeEl)return;var d=this.el,a=Ext.util.Format.htmlEncode(d.dom.value),c=this.textSizeEl,b;Ext.fly(c).setWidth(this.el.getWidth());if(a.length<1)a="&#160;&#160;";else{a+=this.growAppend;if(Ext.isIE)a=a.replace(/\n/g,"&#160;<br />")}c.innerHTML=a;b=Math.min(this.growMax,Math.max(c.offsetHeight,this.growMin));if(b!=this.lastHeight){this.lastHeight=b;this.el.setHeight(b);this.fireEvent("autosize",this,b)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals)a+=this.decimalSeparator;if(this.allowNegative)a+="-";this.maskRe=new RegExp("["+Ext.escapeRe(a)+"]");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(a){var b=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);a=a||this.processValue(this.getRawValue());if(a.length<1)return b;a=String(a).replace(this.decimalSeparator,".");isNaN(a)&&b.push(String.format(this.nanText,a));var c=this.parseValue(a);c<this.minValue&&b.push(String.format(this.minText,this.minValue));c>this.maxValue&&b.push(String.format(this.maxText,this.maxValue));return b},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(a){a=Ext.isNumber(a)?a:parseFloat(String(a).replace(this.decimalSeparator,"."));a=isNaN(a)?"":String(a).replace(".",this.decimalSeparator);return Ext.form.NumberField.superclass.setValue.call(this,a)},setMinValue:function(a){this.minValue=Ext.num(a,Number.NEGATIVE_INFINITY)},setMaxValue:function(a){this.maxValue=Ext.num(a,Number.MAX_VALUE)},parseValue:function(a){a=parseFloat(String(a).replace(this.decimalSeparator,"."));return isNaN(a)?"":a},fixPrecision:function(a){var b=isNaN(a);if(!this.allowDecimals||this.decimalPrecision==-1||b||!a)return b?"":a;return parseFloat(parseFloat(a).toFixed(this.decimalPrecision))},beforeBlur:function(){var a=this.parseValue(this.getRawValue());!Ext.isEmpty(a)&&this.setValue(this.fixPrecision(a))}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(c,a){if(/[gGhH]/.test(a.replace(/(\\.)/g,"")))return Date.parseDate(c,a);else{var b=Date.parseDate(c+" "+this.initTime,a+" "+this.initTimeFormat);if(b)return b.clearTime()}},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(Ext.isString(this.minValue))this.minValue=this.parseDate(this.minValue);if(Ext.isString(this.maxValue))this.maxValue=this.parseDate(this.maxValue);this.disabledDatesRE=null;this.initDisabledDays()},initEvents:function(){Ext.form.DateField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{down:function(){this.onTriggerClick()},scope:this,forceKeyDown:true})},initDisabledDays:function(){if(this.disabledDates){var a=this.disabledDates,c=a.length-1,b="(?:";Ext.each(a,function(d,e){b+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":a[e];if(e!=c)b+="|"},this);this.disabledDatesRE=new RegExp(b+")")}},setDisabledDates:function(a){this.disabledDates=a;this.initDisabledDays();this.menu&&this.menu.picker.setDisabledDates(this.disabledDatesRE)},setDisabledDays:function(a){this.disabledDays=a;this.menu&&this.menu.picker.setDisabledDays(a)},setMinValue:function(a){this.minValue=Ext.isString(a)?this.parseDate(a):a;this.menu&&this.menu.picker.setMinDate(this.minValue)},setMaxValue:function(a){this.maxValue=Ext.isString(a)?this.parseDate(a):a;this.menu&&this.menu.picker.setMaxDate(this.maxValue)},getErrors:function(a){var b=Ext.form.DateField.superclass.getErrors.apply(this,arguments);a=this.formatDate(a||this.processValue(this.getRawValue()));if(a.length<1)return b;var f=a;a=this.parseDate(a);if(!a){b.push(String.format(this.invalidText,f,this.format));return b}var e=a.getTime();this.minValue&&e<this.minValue.getTime()&&b.push(String.format(this.minText,this.formatDate(this.minValue)));this.maxValue&&e>this.maxValue.getTime()&&b.push(String.format(this.maxText,this.formatDate(this.maxValue)));if(this.disabledDays)for(var g=a.getDay(),c=0;c<this.disabledDays.length;c++)if(g===this.disabledDays[c]){b.push(this.disabledDaysText);break}var d=this.formatDate(a);this.disabledDatesRE&&this.disabledDatesRE.test(d)&&b.push(String.format(this.disabledDatesText,d));return b},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(a){return Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))},parseDate:function(a){if(!a||Ext.isDate(a))return a;var c=this.safeParse(a,this.format),e=this.altFormats,b=this.altFormatsArray;if(!c&&e){b=b||e.split("|");for(var d=0,f=b.length;d<f&&!c;d++)c=this.safeParse(a,b[d])}return c},onDestroy:function(){Ext.destroy(this.menu,this.keyNav);Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(a){return Ext.isDate(a)?a.dateFormat(this.format):a},onTriggerClick:function(){if(this.disabled)return;if(this.menu==null)this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false});this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.picker.setValue(this.getValue()||new Date);this.menu.show(this.el,"tl-bl?");this.menuEvents("on")},menuEvents:function(a){this.menu[a]("select",this.onSelect,this);this.menu[a]("hide",this.onMenuHide,this);this.menu[a]("show",this.onFocus,this)},onSelect:function(b,a){this.setValue(a);this.fireEvent("select",this,a);this.menu.hide()},onMenuHide:function(){this.focus(false,60);this.menuEvents("un")},beforeBlur:function(){var a=this.parseDate(this.getRawValue());a&&this.setValue(a)}});Ext.reg("datefield",Ext.form.DateField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",listEmptyText:"",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,autoSelect:true,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,clearFilterOnReset:true,submitValue:undefined,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){var b=Ext.getDom(this.transform);if(!this.hiddenName)this.hiddenName=b.name;if(!this.store){this.mode="local";for(var f=[],e=b.options,c=0,g=e.length;c<g;c++){var a=e[c],d=a.hasAttribute?a.hasAttribute("value"):a.getAttributeNode("value").specified?a.value:a.text;if(a.selected&&Ext.isEmpty(this.value,true))this.value=d;f.push([d,a.text])}this.store=new Ext.data.ArrayStore({id:0,fields:["value","text"],data:f,autoDestroy:true});this.valueField="value";this.displayField="text"}b.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(b,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,b)}Ext.removeNode(b)}else if(this.store){this.store=Ext.StoreMgr.lookup(this.store);if(this.store.autoCreated){this.displayField=this.valueField="field1";if(!this.store.expandData)this.displayField="field2";this.mode="local"}}this.selectedIndex=-1;if(this.mode=="local"){if(!Ext.isDefined(this.initialConfig.queryDelay))this.queryDelay=10;if(!Ext.isDefined(this.initialConfig.minChars))this.minChars=0}},onRender:function(b,a){if(this.hiddenName&&!Ext.isDefined(this.submitValue))this.submitValue=false;Ext.form.ComboBox.superclass.onRender.call(this,b,a);if(this.hiddenName)this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:this.hiddenId||this.hiddenName},"before",true);Ext.isGecko&&this.el.dom.setAttribute("autocomplete","off");if(!this.lazyInit)this.initList();else this.on("focus",this.initList,this,{single:true})},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField)this.hiddenField.value=Ext.value(Ext.isDefined(this.hiddenValue)?this.hiddenValue:this.value,"")},getParentZIndex:function(){var a;this.ownerCt&&this.findParentBy(function(b){a=parseInt(b.getPositionEl().getStyle("z-index"),10);return !!a});return a},initList:function(){if(!this.list){var a="x-combo-list",c=Ext.getDom(this.getListParent()||Ext.getBody()),b=parseInt(Ext.fly(c).getStyle("z-index"),10);if(!b)b=this.getParentZIndex();this.list=new Ext.Layer({parentEl:c,shadow:this.shadow,cls:[a,this.listClass].join(" "),constrain:false,zindex:(b||12000)+5});var d=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(d,0);this.list.swallowEvent("mousewheel");this.assetHeight=0;this.syncFont!==false&&this.list.setStyle("font-size",this.el.getStyle("font-size"));if(this.title){this.header=this.list.createChild({cls:a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:a+"-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(d-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl)this.tpl='<tpl for="."><div class="'+a+'-item">{'+this.displayField+"}</div></tpl>";this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+a+"-item",emptyText:this.listEmptyText,deferEmptyText:false});this.mon(this.view,{containerclick:this.onViewClick,click:this.onViewClick,scope:this});this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.mon(this.resizer,"resize",function(c,a,b){this.maxHeight=b-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=a;this.innerList.setWidth(a-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getListParent:function(){return document.body},getStore:function(){return this.store},bindStore:function(a,b){if(this.store&&!b){if(this.store!==a&&this.store.autoDestroy)this.store.destroy();else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("exception",this.collapse,this)}if(!a){this.store=null;this.view&&this.view.bindStore(null);this.pageTb&&this.pageTb.bindStore(null)}}if(a){if(!b){this.lastQuery=null;this.pageTb&&this.pageTb.bindStore(a)}this.store=Ext.StoreMgr.lookup(a);this.store.on({scope:this,beforeload:this.onBeforeLoad,load:this.onLoad,exception:this.collapse});this.view&&this.view.bindStore(a)}},reset:function(){Ext.form.ComboBox.superclass.reset.call(this);this.clearFilterOnReset&&this.mode=="local"&&this.store.clearFilter()},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(){this.inKeyMode=true;this.selectPrev()},down:function(){if(!this.isExpanded())this.onTriggerClick();else{this.inKeyMode=true;this.selectNext()}},enter:function(){this.onViewClick()},esc:function(){this.collapse()},tab:function(){if(this.forceSelection===true)this.collapse();else this.onViewClick(false);return true},scope:this,doRelay:function(c,d,a){if(a=="down"||this.scope.isExpanded()){var b=Ext.KeyNav.prototype.doRelay.apply(this,arguments);!Ext.isIE&&Ext.EventManager.useKeydown&&this.scope.fireKey(c);return b}return true},forceKeyDown:true,defaultEventAction:"stopEvent"});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead)this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this);!this.enableKeyEvents&&this.mon(this.el,"keyup",this.onKeyUp,this)},onDestroy:function(){if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.destroy(this.resizer,this.view,this.pageTb,this.list);Ext.destroyMembers(this,"hiddenField");Ext.form.ComboBox.superclass.onDestroy.call(this)},fireKey:function(a){!this.isExpanded()&&Ext.form.ComboBox.superclass.fireKey.call(this,a)},onResize:function(a){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(!isNaN(a)&&this.isVisible()&&this.list)this.doResize(a);else this.bufferSize=a},doResize:function(b){if(!Ext.isDefined(this.listWidth)){var a=Math.max(b,this.minListWidth);this.list.setWidth(a);this.innerList.setWidth(a-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField)this.hiddenField.disabled=false},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField)this.hiddenField.disabled=true},onBeforeLoad:function(){if(!this.hasFocus)return;this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus)return;if(this.store.getCount()>0||this.listEmptyText){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){this.editable&&this.el.dom.select();this.autoSelect!==false&&!this.selectByValue(this.value,true)&&this.select(0,true)}else{this.autoSelect!==false&&this.selectNext();this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE&&this.taTask.delay(this.typeAheadDelay)}}else this.collapse()},onTypeAhead:function(){if(this.store.getCount()>0){var d=this.store.getAt(0),a=d.data[this.displayField],c=a.length,b=this.getRawValue().length;if(b!=c){this.setRawValue(a);this.selectText(b,a.length)}}},assertValue:function(){var a=this.getRawValue(),b=this.findRecord(this.displayField,a);if(!b&&this.forceSelection)if(a.length>0&&a!=this.emptyText){this.el.dom.value=Ext.value(this.lastSelectionText,"");this.applyEmptyText()}else this.clearValue();else{if(b){if(a==b.get(this.displayField)&&this.value==b.get(this.valueField))return;a=b.get(this.valueField||this.displayField)}this.setValue(a)}},onSelect:function(a,b){if(this.fireEvent("beforeselect",this,a,b)!==false){this.setValue(a.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,a,b)}},getName:function(){var a=this.hiddenField;return a&&a.name?a.name:this.hiddenName||Ext.form.ComboBox.superclass.getName.call(this)},getValue:function(){if(this.valueField)return Ext.isDefined(this.value)?this.value:"";else return Ext.form.ComboBox.superclass.getValue.call(this)},clearValue:function(){if(this.hiddenField)this.hiddenField.value="";this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(b){var a=b;if(this.valueField){var c=this.findRecord(this.valueField,b);if(c)a=c.data[this.displayField];else if(Ext.isDefined(this.valueNotFoundText))a=this.valueNotFoundText}this.lastSelectionText=a;if(this.hiddenField)this.hiddenField.value=Ext.value(b,"");Ext.form.ComboBox.superclass.setValue.call(this,a);this.value=b;return this},findRecord:function(c,b){var a;this.store.getCount()>0&&this.store.each(function(d){if(d.data[c]==b){a=d;return false}});return a},onViewMove:function(){this.inKeyMode=false},onViewOver:function(d,c){if(this.inKeyMode)return;var a=this.view.findItemFromChild(c);if(a){var b=this.view.indexOf(a);this.select(b,false)}},onViewClick:function(c){var a=this.view.getSelectedIndexes()[0],d=this.store,b=d.getAt(a);if(b)this.onSelect(b,a);else this.collapse();c!==false&&this.el.focus()},restrictHeight:function(){this.innerList.dom.style.height="";var b=this.innerList.dom,c=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight,a=Math.max(b.clientHeight,b.offsetHeight,b.scrollHeight),d=this.getPosition()[1]-Ext.getBody().getScroll().top,f=Ext.lib.Dom.getViewHeight()-d-this.getSize().height,e=Math.max(d,f,this.minHeight||0)-this.list.shadowOffset-c-5;a=Math.min(a,e,this.maxHeight);this.innerList.setHeight(a);this.list.beginUpdate();this.list.setHeight(a+c);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(b,c){if(!Ext.isEmpty(b,true)){var a=this.findRecord(this.valueField||this.displayField,b);if(a){this.select(this.store.indexOf(a),c);return true}}return false},select:function(a,c){this.selectedIndex=a;this.view.select(a);if(c!==false){var b=this.view.getNode(a);b&&this.innerList.scrollChildIntoView(b,false)}},selectNext:function(){var a=this.store.getCount();if(a>0)if(this.selectedIndex==-1)this.select(0);else this.selectedIndex<a-1&&this.select(this.selectedIndex+1)},selectPrev:function(){var a=this.store.getCount();if(a>0)if(this.selectedIndex==-1)this.select(0);else this.selectedIndex!==0&&this.select(this.selectedIndex-1)},onKeyUp:function(a){var b=a.getKey();if(this.editable!==false&&this.readOnly!==true&&(b==a.BACKSPACE||!a.isSpecialKey())){this.lastKey=b;this.dqTask.delay(this.queryDelay)}Ext.form.ComboBox.superclass.onKeyUp.call(this,a)},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},beforeBlur:function(){this.assertValue()},postBlur:function(){Ext.form.ComboBox.superclass.postBlur.call(this);this.collapse();this.inKeyMode=false},doQuery:function(a,b){a=Ext.isEmpty(a)?"":a;var c={query:a,forceAll:b,combo:this,cancel:false};if(this.fireEvent("beforequery",c)===false||c.cancel)return false;a=c.query;b=c.forceAll;if(b===true||a.length>=this.minChars)if(this.lastQuery!==a){this.lastQuery=a;if(this.mode=="local"){this.selectedIndex=-1;if(b)this.store.clearFilter();else this.store.filter(this.displayField,a);this.onLoad()}else{this.store.baseParams[this.queryParam]=a;this.store.load({params:this.getParams(a)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}},getParams:function(){var a={};if(this.pageSize){a.start=0;a.limit=this.pageSize}return a},collapse:function(){if(!this.isExpanded())return;this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(a){!this.isDestroyed&&!a.within(this.wrap)&&!a.within(this.list)&&this.collapse()},expand:function(){if(this.isExpanded()||!this.hasFocus)return;if(this.title||this.pageSize){this.assetHeight=0;if(this.title)this.assetHeight+=this.header.getHeight();if(this.pageSize)this.assetHeight+=this.footer.getHeight()}if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize}this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));var b=Ext.getDom(this.getListParent()||Ext.getBody()),a=parseInt(Ext.fly(b).getStyle("z-index"),10);if(!a)a=this.getParentZIndex();a&&this.list.setZIndex(a+5);this.list.show();Ext.isGecko2&&this.innerList.setOverflow("auto");this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});this.fireEvent("expand",this)},onTriggerClick:function(){if(this.readOnly||this.disabled)return;if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all")this.doQuery(this.allQuery,true);else this.doQuery(this.getRawValue());this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(b,a){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):this.html||"";this.forId&&this.el.setAttribute("for",this.forId)}Ext.form.Label.superclass.onRender.call(this,b,a)},setText:function(a,b){var c=b===false;this[!c?"text":"html"]=a;delete this[c?"text":"html"];if(this.rendered)this.el.dom.innerHTML=b!==false?Ext.util.Format.htmlEncode(a):a;return this}});Ext.reg("label",Ext.form.Label);Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:false,autoExpandMax:1e3,autoExpandMin:50,columnLines:false,ddText:"{0} selected row{1}",deferRowRender:true,enableColumnHide:true,enableColumnMove:true,enableDragDrop:false,enableHdMenu:true,loadMask:false,minColumnWidth:25,stripeRows:false,trackMouseOver:true,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:false,viewReady:false,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);if(this.columnLines)this.cls=(this.cls||"")+" x-grid-with-col-lines";this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var b=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(b,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(b,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var a=this.getView();a.init(this);a.render();this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask)this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(d){var g=this.colModel,h=d.columns,b=this.store,a,e,f;if(h)for(var c=0,j=h.length;c<j;c++){a=h[c];e=g.getColumnById(a.id);if(e){e.hidden=a.hidden;e.width=a.width;f=g.getIndexById(a.id);f!=c&&g.moveColumn(f,c)}}if(b){a=d.sort;a&&b[b.remoteSort?"setDefaultSort":"sort"](a.field,a.direction);a=d.group;if(b.groupBy)if(a)b.groupBy(a);else b.clearGrouping()}var i=Ext.apply({},d);delete i.columns;delete i.sort;Ext.grid.GridPanel.superclass.applyState.call(this,i)},getState:function(){for(var a={columns:[]},b=this.store,f,e,d=0,c;c=this.colModel.config[d];d++){a.columns[d]={id:c.id,width:c.width};if(c.hidden)a.columns[d].hidden=true}if(b){f=b.getSortState();if(f)a.sort=f;if(b.getGroupState){e=b.getGroupState();if(e)a.group=e}}return a},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout();if(this.deferRowRender){if(!this.deferRowRenderTask)this.deferRowRenderTask=new Ext.util.DelayedTask(a.afterRender,this.view);this.deferRowRenderTask.delay(10)}else a.afterRender();this.viewReady=true},reconfigure:function(a,b){var c=this.rendered;if(c)if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:a},this.initialConfig.loadMask))}this.view&&this.view.initData(a,b);this.store=a;this.colModel=b;c&&this.view.refresh(true);this.fireEvent("reconfigure",this,a,b)},onDestroy:function(){this.deferRowRenderTask&&this.deferRowRenderTask.cancel&&this.deferRowRenderTask.cancel();if(this.rendered)Ext.destroy(this.view,this.loadMask);else this.store&&this.store.autoDestroy&&this.store.destroy();Ext.destroy(this.colModel,this.selModel);this.store=this.selModel=this.colModel=this.view=this.loadMask=null;Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(a,b){this.view.processEvent(a,b)},onClick:function(a){this.processEvent("click",a)},onMouseDown:function(a){this.processEvent("mousedown",a)},onContextMenu:function(a){this.processEvent("contextmenu",a)},onDblClick:function(a){this.processEvent("dblclick",a)},walkCells:function(b,a,i,g,f){var e=this.colModel,d=e.getColumnCount(),j=this.store,h=j.getCount(),c=true;if(i<0){if(a<0){b--;c=false}while(b>=0){if(!c)a=d-1;c=false;while(a>=0){if(g.call(f||this,b,a,e)===true)return [b,a];a--}b--}}else{if(a>=d){b++;c=false}while(b<h){if(!c)a=0;c=false;while(a<d){if(g.call(f||this,b,a,e)===true)return [b,a];a++}b++}}return null},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel)this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null);return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view)this.view=new Ext.grid.GridView(this.viewConfig);return this.view},getDragDropText:function(){var a=this.selModel.getCount();return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.GridView=Ext.extend(Ext.util.Observable,{deferEmptyText:true,scrollOffset:undefined,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",selectedRowClass:"x-grid3-row-selected",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",markDirty:true,cellSelectorDepth:4,rowSelectorDepth:10,rowBodySelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",rowBodySelector:"div.x-grid3-row-body",firstRowCls:"x-grid3-row-first",lastRowCls:"x-grid3-row-last",rowClsRe:/(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},initTemplates:function(){var a=this.templates||{};if(!a.master)a.master=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{ostyle}">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{bstyle}">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>");if(!a.header)a.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">','<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>',"</table>");if(!a.hcell)a.hcell=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{value}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div></td>");if(!a.body)a.body=new Ext.Template("{rows}");if(!a.row)a.row=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':"","</tbody></table></div>");if(!a.cell)a.cell=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>");for(var c in a){var b=a[c];if(b&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}}this.templates=a;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(a){if(!this._flyweight)this._flyweight=new Ext.Element.Flyweight(document.body);this._flyweight.dom=a;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var a=Ext.Element,c=this.grid.getGridEl().dom.firstChild,b=c.childNodes;this.el=new a(c);this.mainWrap=new a(b[0]);this.mainHd=new a(this.mainWrap.dom.firstChild);this.grid.hideHeaders&&this.mainHd.setDisplayed(false);this.innerHd=this.mainHd.dom.firstChild;this.scroller=new a(this.mainWrap.dom.childNodes[1]);this.forceFit&&this.scroller.setStyle("overflow-x","hidden");this.mainBody=new a(this.scroller.dom.firstChild);this.focusEl=new a(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new a(b[1]);this.resizeProxy=new a(b[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(a){if(!a)return false;return this.fly(a).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(c,b){var a=this.findCell(c);if(a&&(!b||this.fly(a).hasClass(b)))return this.getCellIndex(a);return false},getCellIndex:function(b){if(b){var a=b.className.match(this.colRe);if(a&&a[1])return this.cm.getIndexById(a[1])}return false},findHeaderCell:function(b){var a=this.findCell(b);return a&&this.fly(a).hasClass(this.hdCls)?a:null},findHeaderIndex:function(a){return this.findCellIndex(a,this.hdCls)},findRow:function(a){if(!a)return false;return this.fly(a).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(b){var a=this.findRow(b);return a?a.rowIndex:false},findRowBody:function(a){if(!a)return false;return this.fly(a).findParent(this.rowBodySelector,this.rowBodySelectorDepth)},getRow:function(a){return this.getRows()[a]},getCell:function(b,a){return this.getRow(b).getElementsByTagName("td")[a]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(c,b){var a=this.getRow(c);a&&this.fly(a).addClass(b)},removeRowClass:function(c,b){var a=this.getRow(c);a&&this.fly(a).removeClass(b)},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},removeRows:function(a,c){for(var d=this.mainBody.dom,b=a;b<=c;b++)Ext.removeNode(d.childNodes[a]);this.syncFocusEl(a)},getScrollState:function(){var a=this.scroller.dom;return {left:a.scrollLeft,top:a.scrollTop}},restoreScroll:function(a){var b=this.scroller.dom;b.scrollLeft=a.left;b.scrollTop=a.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.scroller.dom;this.innerHd.scrollLeft=a.scrollLeft;this.innerHd.scrollLeft=a.scrollLeft},updateSortIcon:function(b,c){var a=this.sortClasses,d=this.mainHd.select("td").removeClass(a);d.item(b).addClass(a[c=="DESC"?1:0])},updateAllColumnWidths:function(){for(var c=this.getTotalWidth(),f=this.cm.getColumnCount(),d=[],h,a=0;a<f;a++)d[a]=this.getColumnWidth(a);this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=c;this.mainBody.dom.style.width=c;for(a=0;a<f;a++){var j=this.getHeaderCell(a);j.style.width=d[a]}var i=this.getRows(),b,g;for(a=0,h=i.length;a<h;a++){b=i[a];b.style.width=c;if(b.firstChild){b.firstChild.style.width=c;g=b.firstChild.rows[0];for(var e=0;e<f;e++)g.childNodes[e].style.width=d[e]}}this.onAllColumnWidthsUpdated(d,c)},updateColumnWidth:function(c){var e=this.getColumnWidth(c),b=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=b;this.mainBody.dom.style.width=b;var h=this.getHeaderCell(c);h.style.width=e;for(var f=this.getRows(),a,d=0,g=f.length;d<g;d++){a=f[d];a.style.width=b;if(a.firstChild){a.firstChild.style.width=b;a.firstChild.rows[0].childNodes[c].style.width=e}}this.onColumnWidthUpdated(c,e,b)},updateColumnHidden:function(c,f){var b=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=b;this.mainBody.dom.style.width=b;var e=f?"none":"",i=this.getHeaderCell(c);i.style.display=e;for(var g=this.getRows(),a,d=0,h=g.length;d<h;d++){a=g[d];a.style.width=b;if(a.firstChild){a.firstChild.style.width=b;a.firstChild.rows[0].childNodes[c].style.display=e}}this.onColumnHiddenUpdated(c,f,b);delete this.lastViewWidth;this.layout()},doRender:function(r,m,n,q,j,s){for(var l=this.templates,o=l.cell,p=l.row,u=j-1,t="width:"+this.getTotalWidth()+";",i=[],f=[],e={tstyle:t},a={},b,c,h=0,v=m.length;h<v;h++){c=m[h];f=[];for(var k=h+q,d=0;d<j;d++){b=r[d];a.id=b.id;a.css=d===0?"x-grid3-cell-first ":d==u?"x-grid3-cell-last ":"";a.attr=a.cellAttr="";a.style=b.style;a.value=b.renderer.call(b.scope,c.data[b.name],a,c,k,d,n);if(Ext.isEmpty(a.value))a.value="&#160;";if(this.markDirty&&c.dirty&&Ext.isDefined(c.modified[b.name]))a.css+=" x-grid3-dirty-cell";f[f.length]=o.apply(a)}var g=[];if(s&&(k+1)%2===0)g[0]="x-grid3-row-alt";if(c.dirty)g[1]=" x-grid3-dirty-row";e.cols=j;if(this.getRowClass)g[2]=this.getRowClass(c,k,e,n);e.alt=g.join(" ");e.cells=f.join("");i[i.length]=p.apply(e)}return i.join("")},processRows:function(e,d){if(!this.ds||this.ds.getCount()<1)return;var c=this.getRows(),f=c.length,a,b;d=d||!this.grid.stripeRows;e=e||0;for(a=0;a<f;a++){b=c[a];if(b){b.rowIndex=a;if(!d){b.className=b.className.replace(this.rowClsRe," ");if((a+1)%2===0)b.className+=" x-grid3-row-alt"}}}e===0&&Ext.fly(c[0]).addClass(this.firstRowCls);Ext.fly(c[c.length-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm)return;this.mainBody.dom.innerHTML=this.renderRows()||"&#160;";this.processRows(0,true);this.deferEmptyText!==true&&this.applyEmptyText();this.grid.fireEvent("viewready",this.grid)},renderUI:function(){var b=this.templates,c=this.renderHeaders(),d=b.body.apply({rows:"&#160;"}),e=b.master.apply({body:d,header:c,ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"}),a=this.grid;a.getGridEl().dom.innerHTML=e;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false)this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom);if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}a.trackMouseOver&&this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut});if(a.enableDragDrop||a.enableDrag)this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"});this.updateHeaderSortState()},processEvent:function(c,b){var e=b.getTarget(),a=this.grid,g=this.findHeaderIndex(e);a.fireEvent(c,b);if(g!==false)a.fireEvent("header"+c,a,g,b);else{var d=this.findRowIndex(e),f,h;if(d!==false){a.fireEvent("row"+c,a,d,b);f=this.findCellIndex(e);if(f!==false)a.fireEvent("cell"+c,a,d,f,b);else{h=this.findRowBody(e);h&&a.fireEvent("rowbody"+c,a,d,b)}}else a.fireEvent("container"+c,a,b)}},layout:function(){if(!this.mainBody)return;var c=this.grid,f=c.getGridEl(),b=f.getSize(true),a=b.width;if(!c.hideHeaders&&(a<20||b.height<20))return;if(c.autoHeight){this.scroller.dom.style.overflow="visible";if(Ext.isWebKit)this.scroller.dom.style.position="static"}else{this.el.setSize(b.width,b.height);var e=this.mainHd.getHeight(),d=b.height-e;this.scroller.setSize(a,d);if(this.innerHd)this.innerHd.style.width=a+"px"}if(this.forceFit){if(this.lastViewWidth!=a){this.fitColumns(false,false);this.lastViewWidth=a}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(a,d)},onLayout:function(){},onColumnWidthUpdated:function(){},onAllColumnWidthsUpdated:function(){},onColumnHiddenUpdated:function(){},updateColumnText:function(){},afterMove:function(){},init:function(a){this.grid=a;this.initTemplates();this.initData(a.store,a.colModel);this.initUI(a)},getColumnId:function(a){return this.cm.getColumnId(a)},getOffsetWidth:function(){return this.cm.getTotalWidth()+this.getScrollOffset()+"px"},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())},renderHeaders:function(){for(var c=this.cm,f=this.templates,h=f.hcell,d=[],b={},e=c.getColumnCount(),g=e-1,a=0;a<e;a++){b.id=c.getColumnId(a);b.value=c.getColumnHeader(a)||"";b.style=this.getColumnStyle(a,true);b.tooltip=this.getColumnTooltip(a);b.css=a===0?"x-grid3-cell-first ":a==g?"x-grid3-cell-last ":"";if(c.config[a].align=="right")b.istyle="padding-right:16px";else delete b.istyle;d[d.length]=h.apply(b)}return f.header.apply({cells:d.join(""),tstyle:"width:"+this.getTotalWidth()+";"})},getColumnTooltip:function(b){var a=this.cm.getColumnTooltip(b);if(a)if(Ext.QuickTips.isEnabled())return 'ext:qtip="'+a+'"';else return 'title="'+a+'"';return ""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=this.getTotalWidth()},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(c,b,a){this.syncFocusEl(this.ensureVisible(c,b,a));if(Ext.isGecko)this.focusEl.focus();else this.focusEl.focus.defer(1,this.focusEl)},resolveCell:function(b,a,f){if(!Ext.isNumber(b))b=b.rowIndex;if(!this.ds)return null;if(b<0||b>=this.ds.getCount())return null;a=a!==undefined?a:0;var g=this.getRow(b),d=this.cm,e=d.getColumnCount(),c;if(!(f===false&&a===0)){while(a<e&&d.isHidden(a))a++;c=this.getCell(b,a)}return {row:g,cell:c}},getResolvedXY:function(a){if(!a)return null;var d=this.scroller.dom,b=a.cell,c=a.row;return b?Ext.fly(b).getXY():[this.el.getX(),Ext.fly(c).getY()]},syncFocusEl:function(a,d,c){var b=a;if(!Ext.isArray(b)){a=Math.min(a,Math.max(0,this.getRows().length-1));if(isNaN(a))return;b=this.getResolvedXY(this.resolveCell(a,d,c))}this.focusEl.setXY(b||this.scroller.getXY())},ensureVisible:function(q,p,g){var b=this.resolveCell(q,p,g);if(!b||!b.row)return;var j=b.row,h=b.cell,a=this.scroller.dom,c=0,d=j,e=this.el.dom;while(d&&d!=e){c+=d.offsetTop;d=d.offsetParent}c-=this.mainHd.dom.offsetHeight;e=parseInt(a.scrollTop,10);var l=c+j.offsetHeight,m=a.clientHeight,o=e+m;if(c<e)a.scrollTop=c;else if(l>o)a.scrollTop=l-m;if(g!==false){var f=parseInt(h.offsetLeft,10),i=f+h.offsetWidth,k=parseInt(a.scrollLeft,10),n=k+a.clientWidth;if(f<k)a.scrollLeft=f;else if(i>n)a.scrollLeft=i-a.clientWidth}return this.getResolvedXY(b)},insertRows:function(h,a,b,c){var d=h.getCount()-1;if(!c&&a===0&&b>=d){this.fireEvent("beforerowsinserted",this,a,b);this.refresh();this.fireEvent("rowsinserted",this,a,b)}else{!c&&this.fireEvent("beforerowsinserted",this,a,b);var f=this.renderRows(a,b),e=this.getRow(a);if(e){a===0&&Ext.fly(this.getRow(0)).removeClass(this.firstRowCls);Ext.DomHelper.insertHtml("beforeBegin",e,f)}else{var g=this.getRow(d-1);g&&Ext.fly(g).removeClass(this.lastRowCls);Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,f)}if(!c){this.fireEvent("rowsinserted",this,a,b);this.processRows(a)}else(a===0||a>=d)&&Ext.fly(this.getRow(a)).addClass(a===0?this.firstRowCls:this.lastRowCls)}this.syncFocusEl(a)},deleteRows:function(c,a,b){if(c.getRowCount()<1)this.refresh();else{this.fireEvent("beforerowsdeleted",this,a,b);this.removeRows(a,b);this.processRows(a);this.fireEvent("rowsdeleted",this,a,b)}},getColumnStyle:function(b,d){var a=!d?this.cm.config[b].css||"":"";a+="width:"+this.getColumnWidth(b)+";";if(this.cm.isHidden(b))a+="display:none;";var c=this.cm.config[b].align;if(c)a+="text-align:"+c+";";return a},getColumnWidth:function(b){var a=this.cm.getColumnWidth(b);if(Ext.isNumber(a))return (Ext.isBorderBox||Ext.isWebKit&&!Ext.isSafari2?a:a-this.borderWidth>0?a-this.borderWidth:0)+"px";return a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(m,q,f){var a=this.cm,b,h=a.getTotalWidth(false),e=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(e<20)return;var o=e-h;if(o===0)return false;var l=a.getColumnCount(true),g=l-(Ext.isNumber(f)?1:0);if(g===0){g=1;f=undefined}var n=a.getColumnCount(),d=[],j=0,k=0,c;for(b=0;b<n;b++)if(!a.isHidden(b)&&!a.isFixed(b)&&b!==f){c=a.getColumnWidth(b);d.push(b);j=b;d.push(c);k+=c}var p=(e-a.getTotalWidth())/k;while(d.length){c=d.pop();b=d.pop();a.setColumnWidth(b,Math.max(this.grid.minColumnWidth,Math.floor(c+c*p)),true)}if((h=a.getTotalWidth(false))>e){var i=g!=l?f:j;a.setColumnWidth(i,Math.max(1,a.getColumnWidth(i)-(h-e)),true)}m!==true&&this.updateAllColumnWidths();return true},autoExpand:function(h){var b=this.grid,a=this.cm;if(!this.userResized&&b.autoExpandColumn){var g=a.getTotalWidth(false),f=this.grid.getGridEl().getWidth(true)-this.getScrollOffset();if(g!=f){var c=a.getIndexById(b.autoExpandColumn),e=a.getColumnWidth(c),d=Math.min(Math.max(f-g+e,b.autoExpandMin),b.autoExpandMax);if(d!=e){a.setColumnWidth(c,d,true);h!==true&&this.updateColumnWidth(c,d)}}}},getColumnData:function(){for(var d=[],b=this.cm,e=b.getColumnCount(),a=0;a<e;a++){var c=b.getDataIndex(a);d[a]={name:!Ext.isDefined(c)?this.ds.fields.get(a).name:c,renderer:b.getRenderer(a),scope:b.getRendererScope(a),id:b.getColumnId(a),style:this.getColumnStyle(a)}}return d},renderRows:function(a,b){var d=this.grid,g=d.colModel,c=d.store,f=d.stripeRows,e=g.getColumnCount();if(c.getCount()<1)return "";var h=this.getColumnData();a=a||0;b=!Ext.isDefined(b)?c.getCount()-1:b;var i=c.getRange(a,b);return this.doRender(h,i,c,a,e,f)},renderBody:function(){var a=this.renderRows()||"&#160;";return this.templates.body.apply({rows:a})},refreshRow:function(b){var c=this.ds,a;if(Ext.isNumber(b)){a=b;b=c.getAt(a);if(!b)return}else{a=c.indexOf(b);if(a<0)return}this.insertRows(c,a,a,true);this.getRow(a).rowIndex=a;this.onRemove(c,b,a+1,true);this.fireEvent("rowupdated",this,a,b)},refresh:function(a){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var b=this.renderBody();this.mainBody.update(b).setWidth(this.getTotalWidth());if(a===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){this.emptyText&&!this.hasRows()&&this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")},updateHeaderSortState:function(){var a=this.ds.getSortState();if(!a)return;(!this.sortState||(this.sortState.field!=a.field||this.sortState.direction!=a.direction))&&this.grid.fireEvent("sortchange",this.grid,a);this.sortState=a;var b=this.cm.findColumnIndex(a.field);if(b!=-1){var c=a.direction;this.updateSortIcon(b,c)}},clearHeaderSortState:function(){if(!this.sortState)return;this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState},destroy:function(){this.scrollToTopTask&&this.scrollToTopTask.cancel&&this.scrollToTopTask.cancel();if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(this.grid.enableColumnMove){Ext.destroy(this.columnDrag.el,this.columnDrag.proxy.ghost,this.columnDrag.proxy.el,this.columnDrop.el,this.columnDrop.proxyTop,this.columnDrop.proxyBottom,this.columnDrag.dragData.ddel,this.columnDrag.dragData.header);this.columnDrag.proxy.anim&&Ext.destroy(this.columnDrag.proxy.anim);delete this.columnDrag.proxy.ghost;delete this.columnDrag.dragData.ddel;delete this.columnDrag.dragData.header;this.columnDrag.destroy();delete Ext.dd.DDM.locationCache[this.columnDrag.id];delete this.columnDrag._domRef;delete this.columnDrop.proxyTop;delete this.columnDrop.proxyBottom;this.columnDrop.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+this.grid.getGridEl().id];delete this.columnDrop._domRef;delete Ext.dd.DDM.ids[this.columnDrop.ddGroup]}if(this.splitZone){this.splitZone.destroy();delete this.splitZone._domRef;delete Ext.dd.DDM.ids["gridSplitters"+this.grid.getGridEl().id]}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);delete this.innerHd;Ext.destroy(this.el,this.mainWrap,this.mainHd,this.scroller,this.mainBody,this.focusEl,this.resizeMarker,this.resizeProxy,this.activeHdBtn,this.dragZone,this.splitZone,this._flyweight);delete this.grid.container;this.dragZone&&this.dragZone.destroy();Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[this.grid.getGridEl().id];Ext.EventManager.removeResizeListener(this.onWindowResize,this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;if(a&&a.getLayout())a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true});else this.fitColumns(true,true)}else if(this.forceFit)this.fitColumns(true,false);else this.grid.autoExpandColumn&&this.autoExpand(true);this.renderUI()},initData:function(a,b){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this);this.ds!==a&&this.ds.autoDestroy&&this.ds.destroy()}a&&a.on({scope:this,load:this.onLoad,datachanged:this.onDataChange,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear});this.ds=a;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this)}if(b){delete this.lastViewWidth;b.on({scope:this,configchange:this.onColConfigChange,widthchange:this.onColWidthChange,headerchange:this.onHeaderChange,hiddenchange:this.onHiddenChange,columnmoved:this.onColumnMove})}this.cm=b},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(b,a){this.refreshRow(a)},onAdd:function(c,b,a){this.insertRows(c,a,a+(b.length-1))},onRemove:function(d,c,a,b){b!==true&&this.fireEvent("beforerowremoved",this,a,c);this.removeRow(a);if(b!==true){this.processRows(a);this.applyEmptyText();this.fireEvent("rowremoved",this,a,c)}},onLoad:function(){if(Ext.isGecko){if(!this.scrollToTopTask)this.scrollToTopTask=new Ext.util.DelayedTask(this.scrollToTop,this);this.scrollToTopTask.delay(1)}else this.scrollToTop()},onColWidthChange:function(c,b,a){this.updateColumnWidth(b,a)},onHeaderChange:function(){this.updateHeaders()},onHiddenChange:function(c,b,a){this.updateColumnHidden(b,a)},onColumnMove:function(d,b,a){this.indexMap=null;var c=this.getScrollState();this.refresh(true);this.restoreScroll(c);this.afterMove(a);this.grid.fireEvent("columnmove",b,a)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(b,a){if(this.headersDisabled||!this.cm.isSortable(a))return;b.stopEditing(true);b.store.sort(this.cm.getDataIndex(a))},onRowOver:function(c,b){var a;(a=this.findRowIndex(b))!==false&&this.addRowClass(a,"x-grid3-row-over")},onRowOut:function(b,c){var a;(a=this.findRowIndex(c))!==false&&!b.within(this.getRow(a),true)&&this.removeRowClass(a,"x-grid3-row-over")},handleWheel:function(a){a.stopPropagation()},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(c,b){var a=this.getCell(c,b);a&&this.fly(a).addClass("x-grid3-cell-selected")},onCellDeselect:function(c,b){var a=this.getCell(c,b);a&&this.fly(a).removeClass("x-grid3-cell-selected")},onColumnSplitterMoved:function(a,b){this.userResized=true;var c=this.grid.colModel;c.setColumnWidth(a,b,true);if(this.forceFit){this.fitColumns(true,false,a);this.updateAllColumnWidths()}else{this.updateColumnWidth(a,b);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",a,b)},handleHdMenuClick:function(c){var a=this.hdCtxIndex,b=this.cm,d=this.ds,e=c.getItemId();switch(e){case "asc":d.sort(b.getDataIndex(a),"ASC");break;case "desc":d.sort(b.getDataIndex(a),"DESC");break;default:a=b.getIndexById(e.substr(4));if(a!=-1){if(c.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}b.setHidden(a,c.checked)}}return true},isHideableColumn:function(a){return !a.hidden},beforeColMenuShow:function(){var b=this.cm,c=b.getColumnCount();this.colMenu.removeAll();for(var a=0;a<c;a++)b.config[a].hideable!==false&&this.colMenu.add(new Ext.menu.CheckItem({itemId:"col-"+b.getColumnId(a),text:b.getColumnHeader(a),checked:!b.isHidden(a),hideOnClick:false,disabled:b.config[a].hideable===false}))},handleHdDown:function(f,c){if(Ext.fly(c).hasClass("x-grid3-hd-btn")){f.stopEvent();var b=this.findHeaderCell(c);Ext.fly(b).addClass("x-grid3-hd-menu-open");var a=this.getCellIndex(b);this.hdCtxIndex=a;var e=this.hmenu.items,d=this.cm;e.get("asc").setDisabled(!d.isSortable(a));e.get("desc").setDisabled(!d.isSortable(a));this.hmenu.on("hide",function(){Ext.fly(b).removeClass("x-grid3-hd-menu-open")},this,{single:true});this.hmenu.show(c,"tl-bl?")}},handleHdOver:function(d,c){var a=this.findHeaderCell(c);if(a&&!this.headersDisabled){this.activeHdRef=c;this.activeHdIndex=this.getCellIndex(a);var b=this.fly(a);this.activeHdRegion=b.getRegion();if(!this.cm.isMenuDisabled(this.activeHdIndex)){b.addClass("x-grid3-hd-over");this.activeHdBtn=b.child(".x-grid3-hd-btn");if(this.activeHdBtn)this.activeHdBtn.dom.style.height=a.firstChild.offsetHeight-1+"px"}}},handleHdMove:function(g){var b=this.findHeaderCell(this.activeHdRef);if(b&&!this.headersDisabled){var c=this.splitHandleWidth||5,d=this.activeHdRegion,e=g.getPageX(),f=b.style,a="";if(this.grid.enableColumnResize!==false)if(e-d.left<=c&&this.cm.isResizable(this.activeHdIndex-1))a=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize";else if(d.right-e<=(!this.activeHdBtn?c:2)&&this.cm.isResizable(this.activeHdIndex))a=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize";f.cursor=a}},handleHdOut:function(b,c){var a=this.findHeaderCell(c);if(a&&(!Ext.isIE||!b.within(a,true))){this.activeHdRef=null;this.fly(a).removeClass("x-grid3-hd-over");a.style.cursor=""}},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},bind:function(b,a){this.initData(b,a)}});Ext.grid.GridView.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{constructor:function(a,b){this.grid=a;this.view=a.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5},b4StartDrag:function(a,e){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var c=this.view.mainWrap.getHeight();this.marker.setHeight(c);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(c);var d=this.cm.getColumnWidth(this.cellIndex),b=Math.max(d-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(b,1e3);this.setYConstraint(0,0);this.minX=a-b;this.maxX=a+1e3;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,e)},allowHeaderDrag:function(){return true},handleMouseDown:function(d){var b=this.view.findHeaderCell(d.getTarget());if(b&&this.allowHeaderDrag(d)){var f=this.view.fly(b).getXY(),g=f[0],j=f[1],h=d.getXY(),e=h[0],i=b.offsetWidth,a=false;if(e-g<=this.hw)a=-1;else if(g+i-e<=this.hw)a=0;if(a!==false){this.cm=this.grid.colModel;var c=this.view.getCellIndex(b);if(a==-1){if(c+a<0)return;while(this.cm.isHidden(c+a)){--a;if(c+a<0)return}}this.cellIndex=c+a;this.split=b.dom;this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)&&Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}else this.view.columnDrag&&this.view.columnDrag.callHandleMouseDown(d)}},endDrag:function(e){this.marker.hide();var a=this.view,d=Math.max(this.minX,e.getPageX()),c=d-this.startPos,b=this.dragHeadersDisabled;a.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+c);setTimeout(function(){a.headersDisabled=b},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,c,b){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,c);if(b){this.setHandleElId(Ext.id(c));this.setOuterHandleElId(Ext.id(b))}this.scroll=false},getDragData:function(b){var c=Ext.lib.Event.getTarget(b),a=this.view.findHeaderCell(c);if(a)return {ddel:a.firstChild,header:a};return false},onInitDrag:function(){this.dragHeadersDisabled=this.view.headersDisabled;this.view.headersDisabled=true;var a=this.dragData.ddel.cloneNode(true);a.id=Ext.id();a.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(a);return true},afterValidDrop:function(){this.completeDrop()},afterInvalidDrop:function(){this.completeDrop()},completeDrop:function(){var b=this.view,a=this.dragHeadersDisabled;setTimeout(function(){b.headersDisabled=a},50)}});Ext.grid.HeaderDropZone=Ext.extend(Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,constructor:function(a){this.grid=a;this.view=a.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,a.getGridEl().dom)},getTargetFromEvent:function(b){var c=Ext.lib.Event.getTarget(b),a=this.view.findCellIndex(c);if(a!==false)return this.view.getHeaderCell(a)},nextVisible:function(a){var c=this.view,b=this.grid.colModel;a=a.nextSibling;while(a){if(!b.isHidden(c.getCellIndex(a)))return a;a=a.nextSibling}return null},prevVisible:function(a){var c=this.view,b=this.grid.colModel;a=a.prevSibling;while(a){if(!b.isHidden(c.getCellIndex(a)))return a;a=a.prevSibling}return null},positionIndicator:function(h,e,f){var g=Ext.lib.Event.getPageX(f),a=Ext.lib.Dom.getRegion(e.firstChild),b,c,d=a.top+this.proxyOffsets[1];if(a.right-g<=(a.right-a.left)/2){b=a.right+this.view.borderWidth;c="after"}else{b=a.left;c="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(e)))return false;b+=this.proxyOffsets[0];this.proxyTop.setLeftTop(b,d);this.proxyTop.show();if(!this.bottomOffset)this.bottomOffset=this.view.mainHd.getHeight();this.proxyBottom.setLeftTop(b,d+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return c},onNodeEnter:function(b,d,c,a){a.header!=b&&this.positionIndicator(a.header,b,c)},onNodeOver:function(c,e,d,b){var a=false;if(b.header!=c)a=this.positionIndicator(b.header,c,d);if(!a){this.proxyTop.hide();this.proxyBottom.hide()}return a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(b,k,i,f){var e=f.header;if(e!=b){var g=this.grid.colModel,j=Ext.lib.Event.getPageX(i),c=Ext.lib.Dom.getRegion(b.firstChild),h=c.right-j<=(c.right-c.left)/2?"after":"before",d=this.view.getCellIndex(e),a=this.view.getCellIndex(b);if(h=="after")a++;if(d<a)a--;g.moveColumn(d,a);return true}return false}});Ext.grid.GridView.ColumnDragZone=Ext.extend(Ext.grid.HeaderDragZone,{constructor:function(a,b){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,a,b,null);this.proxy.el.addClass("x-grid3-col-dd")},handleMouseDown:function(){},callHandleMouseDown:function(a){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,a)}});Ext.grid.SplitDragZone=Ext.extend(Ext.dd.DDProxy,{fly:Ext.Element.fly,constructor:function(a,b,c){this.grid=a;this.view=a.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,b,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(b));this.setOuterHandleElId(Ext.id(c));this.scroll=false},b4StartDrag:function(a,d){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var c=this.cm.getColumnWidth(this.cellIndex),b=Math.max(c-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(b,1e3);this.setYConstraint(0,0);this.minX=a-b;this.maxX=a+1e3;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,d)},handleMouseDown:function(c){var b=Ext.EventObject.setEvent(c),a=this.fly(b.getTarget());if(a.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(a.dom);this.split=a.dom;this.cm=this.grid.colModel;this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)&&Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}},endDrag:function(c){this.view.headersDisabled=false;var b=Math.max(this.minX,Ext.lib.Event.getPageX(c)),a=b-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+a)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(a,b){this.view=a.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,b);this.scroll=false;this.grid=a;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(c){var d=Ext.lib.Event.getTarget(c),a=this.view.findRowIndex(d);if(a!==false){var b=this.grid.selModel;(!b.isSelected(a)||c.hasModifier())&&b.handleMouseDown(this.grid,a,c);return {grid:this.grid,ddel:this.ddel,rowIndex:a,selections:b.getSelections()}}return false},onInitDrag:function(){var a=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(){return false},onEndDrag:function(){},onValidDrop:function(){this.hideProxy()},beforeInvalidDrop:function(){}});Ext.grid.ColumnModel=Ext.extend(Ext.util.Observable,{defaultWidth:100,defaultSortable:false,constructor:function(a){if(a.columns){Ext.apply(this,a);this.setConfig(a.columns,true)}else this.setConfig(a,true);this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)},getColumnId:function(a){return this.config[a].id},getColumnAt:function(a){return this.config[a]},setConfig:function(c,e){var b,a,d;if(!e){delete this.totalWidth;for(b=0,d=this.config.length;b<d;b++){a=this.config[b];a.setEditor&&a.setEditor(null)}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=c;this.lookup={};for(b=0,d=c.length;b<d;b++){a=Ext.applyIf(c[b],this.defaults);if(Ext.isEmpty(a.id))a.id=b;if(!a.isColumn){var f=Ext.grid.Column.types[a.xtype||"gridcolumn"];a=new f(a);c[b]=a}this.lookup[a.id]=a}!e&&this.fireEvent("configchange",this)},getColumnById:function(a){return this.lookup[a]},getIndexById:function(c){for(var a=0,b=this.config.length;a<b;a++)if(this.config[a].id==c)return a;return -1},moveColumn:function(a,b){var c=this.config[a];this.config.splice(a,1);this.config.splice(b,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,a,b)},getColumnCount:function(c){if(c===true){for(var b=0,a=0,d=this.config.length;a<d;a++)if(!this.isHidden(a))b++;return b}return this.config.length},getColumnsBy:function(f,d){for(var b=[],a=0,e=this.config.length;a<e;a++){var c=this.config[a];if(f.call(d||this,c,a)===true)b[b.length]=c}return b},isSortable:function(a){return !!this.config[a].sortable},isMenuDisabled:function(a){return !!this.config[a].menuDisabled},getRenderer:function(a){if(!this.config[a].renderer)return Ext.grid.ColumnModel.defaultRenderer;return this.config[a].renderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){return this.config[a].width},setColumnWidth:function(b,a,c){this.config[b].width=a;this.totalWidth=null;!c&&this.fireEvent("widthchange",this,b,a)},getTotalWidth:function(b){if(!this.totalWidth){this.totalWidth=0;for(var a=0,c=this.config.length;a<c;a++)if(b||!this.isHidden(a))this.totalWidth+=this.getColumnWidth(a)}return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(b,a){this.config[b].header=a;this.fireEvent("headerchange",this,b,a)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(b,a){this.config[b].tooltip=a},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(b,a){this.config[b].dataIndex=a},findColumnIndex:function(c){for(var b=this.config,a=0,d=b.length;a<d;a++)if(b[a].dataIndex==c)return a;return -1},isCellEditable:function(c){var b=this.config[c],a=b.editable;return !!(a||!Ext.isDefined(a)&&b.editor)},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(b,a){this.config[b].editable=a},isHidden:function(a){return !!this.config[a].hidden},isFixed:function(a){return !!this.config[a].fixed},isResizable:function(a){return a>=0&&this.config[a].resizable!==false&&this.config[a].fixed!==true},setHidden:function(b,a){var c=this.config[b];if(c.hidden!==a){c.hidden=a;this.totalWidth=null;this.fireEvent("hiddenchange",this,b,a)}},setEditor:function(b,a){this.config[b].setEditor(a)},destroy:function(){for(var a,b=0,c=this.config.length;b<c;b++){a=this.config[b];a.setEditor&&a.setEditor(null)}this.purgeListeners()}});Ext.grid.ColumnModel.defaultRenderer=function(a){if(typeof a=="string"&&a.length<1)return "&#160;";return a};Ext.grid.AbstractSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)},init:function(a){this.grid=a;if(this.lockOnInit){delete this.lockOnInit;this.locked=false;this.lock()}this.initEvents()},lock:function(){if(!this.locked){this.locked=true;var a=this.grid;if(a)a.getView().on({scope:this,beforerefresh:this.sortUnLock,refresh:this.sortLock});else this.lockOnInit=true}},sortLock:function(){this.locked=true},sortUnLock:function(){this.locked=false},unlock:function(){if(this.locked){this.locked=false;var b=this.grid,a;if(b){a=b.getView();a.un("beforerefresh",this.sortUnLock,this);a.un("refresh",this.sortLock,this)}else delete this.lockOnInit}},isLocked:function(){return this.locked},destroy:function(){this.unlock();this.purgeListeners()}});Ext.grid.RowSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{singleSelect:false,constructor:function(a){Ext.apply(this,a);this.selections=new Ext.util.MixedCollection(false,function(a){return a.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)},initEvents:function(){!this.grid.enableDragDrop&&!this.grid.enableDrag&&this.grid.on("rowmousedown",this.handleMouseDown,this);this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:function(b){if(!b.shiftKey||this.singleSelect)this.selectPrevious(false);else if(this.last!==false&&this.lastActive!==false){var a=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(a!==false)this.last=a}else this.selectFirstRow()},down:function(b){if(!b.shiftKey||this.singleSelect)this.selectNext(false);else if(this.last!==false&&this.lastActive!==false){var a=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(a!==false)this.last=a}else this.selectFirstRow()},scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onRefresh:function(){var e=this.grid.store,c,b=this.getSelections();this.clearSelections(true);for(var a=0,d=b.length;a<d;a++){var f=b[a];(c=e.indexOfId(f.id))!=-1&&this.selectRow(c,true)}b.length!=this.selections.getCount()&&this.fireEvent("selectionchange",this)},onRemove:function(c,b,a){this.selections.remove(a)!==false&&this.fireEvent("selectionchange",this)},onRowUpdated:function(c,a,b){this.isSelected(b)&&c.onRowSelect(a)},selectRecords:function(b,c){!c&&this.clearSelections();for(var e=this.grid.store,a=0,d=b.length;a<d;a++)this.selectRow(e.indexOf(b[a]),true)},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(a){this.selectRow(this.grid.store.getCount()-1,a)},selectNext:function(a){if(this.hasNext()){this.selectRow(this.last+1,a);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(a){if(this.hasPrevious()){this.selectRow(this.last-1,a);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&this.last+1<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return [].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(e,c){for(var b=this.getSelections(),a=0,d=b.length;a<d;a++)if(e.call(c||this,b[a],a)===false)return false;return true},clearSelections:function(b){if(this.isLocked())return;if(b!==true){var c=this.grid.store,a=this.selections;a.each(function(a){this.deselectRow(c.indexOfId(a.id))},this);a.clear()}else this.selections.clear();this.last=false},selectAll:function(){if(this.isLocked())return;this.selections.clear();for(var a=0,b=this.grid.store.getCount();a<b;a++)this.selectRow(a,true)},hasSelection:function(){return this.selections.length>0},isSelected:function(a){var b=Ext.isNumber(a)?this.grid.store.getAt(a):a;return b&&this.selections.key(b.id)?true:false},isIdSelected:function(a){return this.selections.key(a)?true:false},handleMouseDown:function(f,a,b){if(b.button!==0||this.isLocked())return;var e=this.grid.getView();if(b.shiftKey&&!this.singleSelect&&this.last!==false){var d=this.last;this.selectRange(d,a,b.ctrlKey);this.last=d;e.focusRow(a)}else{var c=this.isSelected(a);if(b.ctrlKey&&c)this.deselectRow(a);else if(!c||this.getCount()>1){this.selectRow(a,b.ctrlKey||b.shiftKey);e.focusRow(a)}}},selectRows:function(b,c){!c&&this.clearSelections();for(var a=0,d=b.length;a<d;a++)this.selectRow(b[a],true)},selectRange:function(b,c,d){var a;if(this.isLocked())return;!d&&this.clearSelections();if(b<=c)for(a=b;a<=c;a++)this.selectRow(a,true);else for(a=b;a>=c;a--)this.selectRow(a,true)},deselectRange:function(c,d,b){if(this.isLocked())return;for(var a=c;a<=d;a++)this.deselectRow(a,b)},selectRow:function(a,c,d){if(this.isLocked()||(a<0||a>=this.grid.store.getCount())||c&&this.isSelected(a))return;var b=this.grid.store.getAt(a);if(b&&this.fireEvent("beforerowselect",this,a,c,b)!==false){(!c||this.singleSelect)&&this.clearSelections();this.selections.add(b);this.last=this.lastActive=a;!d&&this.grid.getView().onRowSelect(a);this.fireEvent("rowselect",this,a,b);this.fireEvent("selectionchange",this)}},deselectRow:function(a,c){if(this.isLocked())return;if(this.last==a)this.last=false;if(this.lastActive==a)this.lastActive=false;var b=this.grid.store.getAt(a);if(b){this.selections.remove(b);!c&&this.grid.getView().onRowDeselect(a);this.fireEvent("rowdeselect",this,a,b);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last)this.last=this._last},acceptsNav:function(c,a,b){return !b.isHidden(a)&&b.isCellEditable(a,c)},onEditorKey:function(k,e){var j=e.getKey(),b,a=this.grid,c=a.lastEdit,d=a.activeEditor,f,g,i,h=e.shiftKey;if(j==e.TAB){e.stopEvent();d.completeEdit();if(h)b=a.walkCells(d.row,d.col-1,-1,this.acceptsNav,this);else b=a.walkCells(d.row,d.col+1,1,this.acceptsNav,this)}else if(j==e.ENTER)if(this.moveEditorOnEnter!==false)if(h)b=a.walkCells(c.row-1,c.col,-1,this.acceptsNav,this);else b=a.walkCells(c.row+1,c.col,1,this.acceptsNav,this);if(b){g=b[0];i=b[1];c.row!=g&&this.selectRow(g);if(a.isEditor&&a.editing){f=a.activeEditor;f&&f.field.triggerBlur&&f.field.triggerBlur()}a.startEditing(g,i)}},destroy:function(){if(this.rowNav){this.rowNav.disable();this.rowNav=null}Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});Ext.grid.Column=Ext.extend(Object,{isColumn:true,constructor:function(a){Ext.apply(this,a);if(Ext.isString(this.renderer))this.renderer=Ext.util.Format[this.renderer];else if(Ext.isObject(this.renderer)){this.scope=this.renderer.scope;this.renderer=this.renderer.fn}if(!this.scope)this.scope=this;var b=this.editor;delete this.editor;this.setEditor(b)},renderer:function(a){if(Ext.isString(a)&&a.length<1)return "&#160;";return a},getEditor:function(){return this.editable!==false?this.editor:null},setEditor:function(a){var b=this.editor;if(b)if(b.gridEditor){b.gridEditor.destroy();delete b.gridEditor}else b.destroy();this.editor=null;if(a){if(!a.isXType)a=Ext.create(a,"textfield");this.editor=a}},getCellEditor:function(b){var a=this.getEditor(b);if(a)if(!a.startEdit){if(!a.gridEditor)a.gridEditor=new Ext.grid.GridEditor(a);a=a.gridEditor}return a}});Ext.grid.NumberColumn=Ext.extend(Ext.grid.Column,{format:"0,000.00",constructor:function(a){Ext.grid.NumberColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.numberRenderer(this.format)}});Ext.grid.DateColumn=Ext.extend(Ext.grid.Column,{format:"m/d/Y",constructor:function(a){Ext.grid.DateColumn.superclass.constructor.call(this,a);this.renderer=Ext.util.Format.dateRenderer(this.format)}});Ext.grid.TemplateColumn=Ext.extend(Ext.grid.Column,{constructor:function(b){Ext.grid.TemplateColumn.superclass.constructor.call(this,b);var a=!Ext.isPrimitive(this.tpl)&&this.tpl.compile?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(c,d,b){return a.apply(b.data)};this.tpl=a}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn};Ext.grid.RowNumberer=Ext.extend(Object,{header:"",width:23,sortable:false,constructor:function(a){Ext.apply(this,a);if(this.rowspan)this.renderer=this.renderer.createDelegate(this)},fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(d,b,c,a){if(this.rowspan)b.cellAttr='rowspan="'+this.rowspan+'"';return a+1}});Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{groupByText:"Group By This Field",showGroupsText:"Show in Groups",hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",groupMode:"value",initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var a=this.grid.getSelectionModel();a.on(a.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup)this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">');this.startGroup.compile();if(!this.endGroup)this.endGroup="</div></div>"},findGroup:function(a){return Ext.fly(a).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(c,b,a){if(this.canGroup()&&!this.ignoreAdd){var d=this.getScrollState();this.fireEvent("beforerowsinserted",c,a,a+(b.length-1));this.refresh();this.restoreScroll(d);this.fireEvent("rowsinserted",c,a,a+(b.length-1))}else!this.canGroup()&&Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)},onRemove:function(e,b){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var a=document.getElementById(b._groupId);a&&a.childNodes[1].childNodes.length<1&&Ext.removeNode(a);this.applyEmptyText()},refreshRow:function(){if(this.ds.getCount()==1)this.refresh();else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var a,c=this.hmenu.items,b=this.cm.config[this.hdCtxIndex].groupable===false;(a=c.get("groupBy"))&&a.setDisabled(b);if(a=c.get("showGroups")){a.setDisabled(b);a.setChecked(this.enableGrouping,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{itemId:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});this.enableNoGroups&&this.hmenu.add({itemId:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this});this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},processEvent:function(d,b){Ext.grid.GroupingView.superclass.processEvent.call(this,d,b);var e=b.getTarget(".x-grid-group-hd",this.mainBody);if(e){var c=this.getGroupField(),f=this.getPrefix(c),a=e.id.substring(f.length);a=a.substr(0,a.length-3);a&&this.grid.fireEvent("group"+d,this.grid,c,a,b)}},onGroupByClick:function(){this.enableGrouping=true;this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.grid.fireEvent("groupchange",this,this.grid.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(b,a){this.enableGrouping=a;if(a)this.onGroupByClick();else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(c,b){if(!this.canGroup())return;var a=this.getRow(c);a&&this.toggleGroup(this.findGroup(a),b)},toggleGroup:function(c,a){var b=Ext.get(c);a=Ext.isDefined(a)?a:b.hasClass("x-grid-group-collapsed");if(this.state[b.id]!==a){this.grid.stopEditing(true);this.state[b.id]=a;b[a?"removeClass":"addClass"]("x-grid-group-collapsed")}},toggleAllGroups:function(c){for(var b=this.getGroups(),a=0,d=b.length;a<d;a++)this.toggleGroup(b[a],c)},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},interceptMouse:function(b){var a=b.getTarget(".x-grid-group-hd",this.mainBody);if(a){b.stopEvent();this.toggleGroup(a.parentNode)}},getGroup:function(d,g,b,e,c,f){var a=b?b(d,{},g,e,c,f):String(d);if(a===""||a==="&#160;")a=this.cm.config[c].emptyGroupText||this.emptyGroupText;return a},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(!this.ds||!this.cm)return;Ext.grid.GroupingView.superclass.afterRender.call(this);this.grid.deferRowRender&&this.updateGroupWidths()},renderRows:function(){var a=this.getGroupField(),c=!!a;if(this.hideGroupedColumn){var d=this.cm.findColumnIndex(a),b=Ext.isDefined(this.lastGroupField);if(!c&&b){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else if(c&&!b){this.lastGroupField=a;this.cm.setHidden(d,true)}else if(c&&b&&a!==this.lastGroupField){this.mainBody.update("");var e=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(e,false);this.lastGroupField=a;this.cm.setHidden(d,true)}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(o,p,i,s,k,v){if(p.length<1)return "";if(!this.canGroup()||this.isUpdating)return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments);var j=this.getGroupField(),l=this.cm.findColumnIndex(j),a,t="width:"+this.getTotalWidth()+";",g=this.cm.config[l],r=g.groupRenderer||g.renderer,u=this.showGroupName?(g.groupName||g.header)+": ":"",m=[],d,b,h,c;for(b=0,h=p.length;b<h;b++){var q=s+b,f=p[b],n=f.data[j];a=this.getGroup(n,f,r,q,l,i);if(!d||d.group!=a){c=this.constructId(n,j,l);this.state[c]=!(Ext.isDefined(this.state[c])?!this.state[c]:this.startCollapsed);d={group:a,gvalue:n,text:u+a,groupId:c,startRow:q,rs:[f],cls:this.state[c]?"":"x-grid-group-collapsed",style:t};m.push(d)}else d.rs.push(f);f._groupId=c}var e=[];for(b=0,h=m.length;b<h;b++){a=m[b];this.doGroupStart(e,a,o,i,k);e[e.length]=Ext.grid.GroupingView.superclass.doRender.call(this,o,a.rs,i,a.startRow,k,v);this.doGroupEnd(e,a,o,i,k)}return e.join("")},getGroupId:function(b){var a=this.getGroupField();return this.constructId(b,a,this.cm.findColumnIndex(a))},constructId:function(a,e,c){var b=this.cm.config[c],d=b.groupRenderer||b.renderer,f=this.groupMode=="value"?a:this.getGroup(a,{data:{}},d,0,c,this.ds);return this.getPrefix(e)+Ext.util.Format.htmlEncode(f)},canGroup:function(){return this.enableGrouping&&!!this.getGroupField()},getPrefix:function(a){return this.grid.getGridEl().id+"-gp-"+a+"-"},doGroupStart:function(a,b){a[a.length]=this.startGroup.apply(b)},doGroupEnd:function(a){a[a.length]=this.endGroup},getRows:function(){if(!this.canGroup())return Ext.grid.GroupingView.superclass.getRows.call(this);for(var d=[],f=this.getGroups(),a,c=0,g=f.length,b,e;c<g;++c){a=f[c].childNodes[1];if(a){a=a.childNodes;for(b=0,e=a.length;b<e;++b)d[d.length]=a[b]}}return d},updateGroupWidths:function(){if(!this.canGroup()||!this.hasRows())return;for(var d=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px",b=this.getGroups(),a=0,c=b.length;a<c;a++)b[a].firstChild.style.width=d},onColumnWidthUpdated:function(a,c,b){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,a,c,b);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(b,a){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,b,a);this.updateGroupWidths()},onColumnHiddenUpdated:function(b,a,c){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,b,a,c);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(b,a){this.toggleRowIndex(a,true)}});Ext.grid.GroupingView.GROUP_ID=1e3;
