(function(){function a(i,j,k){return function(){j.target==arguments[0]&&i.apply(k,Array.prototype.slice.call(arguments,0))}}function b(i,j,k,m){k.task=new e.DelayedTask;return function(){k.task.delay(j.buffer,i,m,Array.prototype.slice.call(arguments,0))}}function c(i,j,k,m){return function(){j.removeListener(k,m);return i.apply(m,arguments)}}function d(i,j,k,m){return function(){var p=new e.DelayedTask,o=Array.prototype.slice.call(arguments,0);if(!k.tasks)k.tasks=[];k.tasks.push(p);p.delay(j.delay||
10,function(){k.tasks.remove(p);i.apply(m,o)},m)}}var e=Ext.util,g=Ext.each;e.Observable=function(){var i=this.events;if(this.listeners){this.on(this.listeners);delete this.listeners}this.events=i||{}};e.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:function(){var i=Array.prototype.slice.call(arguments,0),j=i[0].toLowerCase(),k=true,m=this.events[j];if(this.eventsSuspended===true){if(j=this.eventQueue)j.push(i)}else if(typeof m=="object")if(m.bubble){if(m.fire.apply(m,
i.slice(1))===false)return false;if((m=this.getBubbleTarget&&this.getBubbleTarget())&&m.enableBubble){k=m.events[j];if(!k||typeof k!="object"||!k.bubble)m.enableBubble(j);return m.fireEvent.apply(m,i)}}else{i.shift();k=m.fire.apply(m,i)}return k},addListener:function(i,j,k,m){var p;if(typeof i=="object"){m=i;for(p in m){i=m[p];this.filterOptRe.test(p)||this.addListener(p,i.fn||i,i.scope||m.scope,i.fn?i:m)}}else{i=i.toLowerCase();p=this.events[i]||true;if(typeof p=="boolean")this.events[i]=p=new e.Event(this,
i);p.addListener(j,k,typeof m=="object"?m:{})}},removeListener:function(i,j,k){i=this.events[i.toLowerCase()];typeof i=="object"&&i.removeListener(j,k)},purgeListeners:function(){var i=this.events,j,k;for(k in i){j=i[k];typeof j=="object"&&j.clearListeners()}},addEvents:function(i){this.events=this.events||{};if(typeof i=="string")for(var j=arguments,k=j.length;k--;)this.events[j[k]]=this.events[j[k]]||true;else Ext.applyIf(this.events,i)},hasListener:function(i){i=this.events[i.toLowerCase()];return typeof i==
"object"&&i.listeners.length>0},suspendEvents:function(i){this.eventsSuspended=true;if(i&&!this.eventQueue)this.eventQueue=[]},resumeEvents:function(){var i=this,j=i.eventQueue||[];i.eventsSuspended=false;delete i.eventQueue;g(j,function(k){i.fireEvent.apply(i,k)})}};var h=e.Observable.prototype;h.on=h.addListener;h.un=h.removeListener;e.Observable.releaseCapture=function(i){i.fireEvent=h.fireEvent};e.Event=function(i,j){this.name=j;this.obj=i;this.listeners=[]};e.Event.prototype={addListener:function(i,
j,k){j=j||this.obj;if(!this.isListening(i,j)){i=this.createListener(i,j,k);if(this.firing)this.listeners=this.listeners.slice(0);this.listeners.push(i)}},createListener:function(i,j,k){k=k||{};j=j||this.obj;var m={fn:i,scope:j,options:k},p=i;if(k.target)p=a(p,k,j);if(k.delay)p=d(p,k,m,j);if(k.single)p=c(p,this,i,j);if(k.buffer)p=b(p,k,m,j);m.fireFn=p;return m},findListener:function(i,j){var k=this.listeners,m=k.length,p;for(j=j||this.obj;m--;)if(p=k[m])if(p.fn==i&&p.scope==j)return m;return-1},isListening:function(i,
j){return this.findListener(i,j)!=-1},removeListener:function(i,j){var k,m,p;m=false;if((k=this.findListener(i,j))!=-1){if(this.firing)this.listeners=this.listeners.slice(0);m=this.listeners[k];if(m.task){m.task.cancel();delete m.task}if(p=m.tasks&&m.tasks.length){for(;p--;)m.tasks[p].cancel();delete m.tasks}this.listeners.splice(k,1);m=true}return m},clearListeners:function(){for(var i=this.listeners,j=i.length;j--;)this.removeListener(i[j].fn,i[j].scope)},fire:function(){var i=this.listeners,j=
i.length,k=0,m;if(j>0){this.firing=true;for(var p=Array.prototype.slice.call(arguments,0);k<j;k++)if((m=i[k])&&m.fireFn.apply(m.scope||this.obj||window,p)===false)return this.firing=false}this.firing=false;return true}}})();
Ext.DomHelper=function(){function a(o,s,l,n){o=p.insertHtml(n,Ext.getDom(o),b(s));return l?Ext.get(o,true):o}function b(o){var s="",l,n,r;if(typeof o=="string")s=o;else if(Ext.isArray(o))for(l=0;l<o.length;l++){if(o[l])s+=b(o[l])}else{s+="<"+(o.tag=o.tag||"div");for(l in o){n=o[l];if(!i.test(l))if(typeof n=="object"){s+=" "+l+'="';for(r in n)s+=r+":"+n[r]+";";s+='"'}else s+=" "+({cls:"class",htmlFor:"for"}[l]||l)+'="'+n+'"'}if(g.test(o.tag))s+="/>";else{s+=">";if(l=o.children||o.cn)s+=b(l);else if(o.html)s+=
o.html;s+="</"+o.tag+">"}}return s}function c(o,s,l,n){e.innerHTML=[s,l,n].join("");l=-1;for(s=e;++l<o;)s=s.firstChild;if(s.nextSibling){for(l=document.createDocumentFragment();s;){o=s.nextSibling;l.appendChild(s);s=o}s=l}return s}function d(o){var s=document.createElement("div"),l=document.createDocumentFragment(),n=0;s.innerHTML=o;s=s.childNodes;for(o=s.length;n<o;n++)l.appendChild(s[n].cloneNode(true));return l}var e=null,g=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
h=/^table|tbody|tr|td$/i,i=/tag|children|cn|html$/i,j=/td|tr|tbody/i,k=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,m=/end/i,p;return p={markup:function(o){return b(o)},applyStyles:function(o,s){if(s){var l;o=Ext.fly(o);if(typeof s=="function")s=s.call();if(typeof s=="string")for(k.lastIndex=0;l=k.exec(s);)o.setStyle(l[1],l[2]);else typeof s=="object"&&o.setStyle(s)}},insertHtml:function(o,s,l){var n={},r,q;o=o.toLowerCase();n.beforebegin=["BeforeBegin","previousSibling"];n.afterend=["AfterEnd",
"nextSibling"];if(s.insertAdjacentHTML){if(q=h.test(s.tagName)){var t=s.tagName.toLowerCase(),u=o;r=s;e=e||document.createElement("div");if(t=="td"&&(u=="afterbegin"||u=="beforeend")||!j.test(t)&&(u=="beforebegin"||u=="afterend"))r=void 0;else{q=u=="beforebegin"?r:u=="afterend"?r.nextSibling:u=="afterbegin"?r.firstChild:null;if(u=="beforebegin"||u=="afterend")r=r.parentNode;t=t=="td"||t=="tr"&&(u=="beforeend"||u=="afterbegin")?c(4,"<table><tbody><tr>",l,"</tr></tbody></table>"):t=="tbody"&&(u=="beforeend"||
u=="afterbegin")||t=="tr"&&(u=="beforebegin"||u=="afterend")?c(3,"<table><tbody>",l,"</tbody></table>"):c(2,"<table>",l,"</table>");r.insertBefore(t,q);r=t}q=r=r}if(q)return r;n.afterbegin=["AfterBegin","firstChild"];n.beforeend=["BeforeEnd","lastChild"];if(n=n[o]){s.insertAdjacentHTML(n[0],l);return s[n[1]]}}else{r=s.ownerDocument.createRange();q="setStart"+(m.test(o)?"After":"Before");if(n[o]){r[q](s);l=r.createContextualFragment?r.createContextualFragment(l):d(l);s.parentNode.insertBefore(l,o==
"beforebegin"?s:s.nextSibling);return s[(o=="beforebegin"?"previous":"next")+"Sibling"]}else{n=(o=="afterbegin"?"first":"last")+"Child";if(s.firstChild){r[q](s[n]);l=r.createContextualFragment?r.createContextualFragment(l):d(l);o=="afterbegin"?s.insertBefore(l,s.firstChild):s.appendChild(l)}else s.innerHTML=l;return s[n]}}throw'Illegal insertion point -> "'+o+'"';},insertBefore:function(o,s,l){return a(o,s,l,"beforebegin")},insertAfter:function(o,s,l){return a(o,s,l,"afterend","nextSibling")},insertFirst:function(o,
s,l){return a(o,s,l,"afterbegin","firstChild")},append:function(o,s,l){return a(o,s,l,"beforeend","",true)},overwrite:function(o,s,l){o=Ext.getDom(o);o.innerHTML=b(s);return l?Ext.get(o.firstChild):o.firstChild},createHtml:b}}();Ext.Template=function(a){var b=arguments,c=[],d;if(Ext.isArray(a))a=a.join("");else if(b.length>1){for(var e=0,g=b.length;e<g;e++){d=b[e];typeof d=="object"?Ext.apply(this,d):c.push(d)}a=c.join("")}this.html=a;this.compiled&&this.compile()};
Ext.Template.prototype={re:/\{([\w\-]+)\}/g,applyTemplate:function(a){return this.compiled?this.compiled(a):this.html.replace(this.re,function(b,c){return a[c]!==undefined?a[c]:""})},set:function(a,b){this.html=a;this.compiled=null;return b?this.compile():this},compile:function(){var a=Ext.isGecko?"+":",";eval("this.compiled = function(values){ return "+(Ext.isGecko?"'":"['")+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,function(b,c){c="values['"+
c+"']";return"'"+a+"("+c+" == undefined ? '' : "+c+")"+a+"'"})+(Ext.isGecko?"';};":"'].join('');};"));return this},insertFirst:function(a,b,c){return this.doInsert("afterBegin",a,b,c)},insertBefore:function(a,b,c){return this.doInsert("beforeBegin",a,b,c)},insertAfter:function(a,b,c){return this.doInsert("afterEnd",a,b,c)},append:function(a,b,c){return this.doInsert("beforeEnd",a,b,c)},doInsert:function(a,b,c,d){b=Ext.getDom(b);a=Ext.DomHelper.insertHtml(a,b,this.applyTemplate(c));return d?Ext.get(a,
true):a},overwrite:function(a,b,c){a=Ext.getDom(a);a.innerHTML=this.applyTemplate(b);return c?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.DomQuery=function(){function a(l){for(;(l=l.nextSibling)&&l.nodeType!=1;);return l}function b(l){for(;(l=l.previousSibling)&&l.nodeType!=1;);return l}function c(l){if(!l)return[];var n=l.length,r,q,t=l,u=-1;if(!n||typeof l.nodeType!="undefined"||n==1)return l;if(o&&typeof l[0].selectSingleNode!="undefined"){t=++s;l[0].setAttribute("_nodup",t);u=[l[0]];n=1;for(q=l.length;n<q;n++){r=l[n];if(!r.getAttribute("_nodup")!=t){r.setAttribute("_nodup",t);u[u.length]=r}}n=0;for(q=l.length;n<q;n++)l[n].removeAttribute("_nodup");
return u}n=++s;l[0]._nodup=n;for(q=1;r=l[q];q++)if(r._nodup!=n)r._nodup=n;else{t=[];for(r=0;r<q;r++)t[++u]=l[r];for(r=q+1;q=l[r];r++)if(q._nodup!=n){q._nodup=n;t[++u]=q}break}return t}var d={},e={},g={},h=/^\s+|\s+$/g,i=/\{(\d+)\}/g,j=/^(\s?[\/>+~]\s?|\s|$)/,k=/^(#)?([\w\-\*]+)/,m=/(\d*)n\+?(\d*)/,p=/\D/,o=window.ActiveXObject?true:false,s=30803;eval("var batch = 30803;");return{getStyle:function(l,n){return Ext.fly(l).getStyle(n)},compile:function(l,n){n=n||"select";var r=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],
q,t=Ext.DomQuery.matchers,u=t.length,v;if((v=l.match(j))&&v[1]){r[r.length]='mode="'+v[1].replace(h,"")+'";';l=l.replace(v[1],"")}for(;l.substr(0,1)=="/";)l=l.substr(1);for(;l&&q!=l;){q=l;v=l.match(k);if(n=="select")if(v){r[r.length]=v[1]=="#"?'n = quickId(n, mode, root, "'+v[2]+'");':'n = getNodes(n, mode, "'+v[2]+'");';l=l.replace(v[0],"")}else{if(l.substr(0,1)!="@")r[r.length]='n = getNodes(n, mode, "*");'}else if(v){r[r.length]=v[1]=="#"?'n = byId(n, "'+v[2]+'");':'n = byTag(n, "'+v[2]+'");';
l=l.replace(v[0],"")}for(;!(v=l.match(j));){v=false;for(var z=0;z<u;z++){var x=t[z],A=l.match(x.re);if(A){r[r.length]=x.select.replace(i,function(N,B){return A[B]});l=l.replace(A[0],"");v=true;break}}if(!v)throw'Error parsing selector, parsing failed at "'+l+'"';}if(v[1]){r[r.length]='mode="'+v[1].replace(h,"")+'";';l=l.replace(v[1],"")}}r[r.length]="return nodup(n);\n}";eval(r.join(""));return f},jsSelect:function(l,n){n=n||document;if(typeof n=="string")n=document.getElementById(n);for(var r=l.split(","),
q=[],t=0,u=r.length;t<u;t++){var v=r[t].replace(h,"");if(!d[v]){d[v]=Ext.DomQuery.compile(v);if(!d[v])throw v+" is not a valid selector";}if((v=d[v](n))&&v!=document)q=q.concat(v)}if(r.length>1)return c(q);return q},isXml:function(l){return(l=(l?l.ownerDocument||l:0).documentElement)?l.nodeName!=="HTML":false},select:document.querySelectorAll?function(l,n,r){n=n||document;if(!Ext.DomQuery.isXml(n))try{var q=n.querySelectorAll(l);return Ext.toArray(q)}catch(t){}return Ext.DomQuery.jsSelect.call(this,
l,n,r)}:function(l,n,r){return Ext.DomQuery.jsSelect.call(this,l,n,r)},selectNode:function(l,n){return Ext.DomQuery.select(l,n)[0]},selectValue:function(l,n,r){l=l.replace(h,"");g[l]||(g[l]=Ext.DomQuery.compile(l,"select"));l=g[l](n);l=l[0]?l[0]:l;typeof l.normalize=="function"&&l.normalize();l=l&&l.firstChild?l.firstChild.nodeValue:null;return l===null||l===undefined||l===""?r:l},selectNumber:function(l,n,r){l=Ext.DomQuery.selectValue(l,n,r||0);return parseFloat(l)},is:function(l,n){if(typeof l==
"string")l=document.getElementById(l);var r=Ext.isArray(l),q=Ext.DomQuery.filter(r?l:[l],n);return r?q.length==l.length:q.length>0},filter:function(l,n,r){n=n.replace(h,"");e[n]||(e[n]=Ext.DomQuery.compile(n,"simple"));n=e[n](l);if(r){var q=n.length;r=++s;var t=[];if(q)if(o&&typeof n[0].selectSingleNode!="undefined"){r=++s;t=[];var u=0;for(q=n.length;u<q;u++)n[u].setAttribute("_qdiff",r);u=0;for(q=l.length;u<q;u++)if(l[u].getAttribute("_qdiff")!=r)t[t.length]=l[u];u=0;for(q=n.length;u<q;u++)n[u].removeAttribute("_qdiff");
l=t}else{for(u=0;u<q;u++)n[u]._qdiff=r;u=0;for(n=l.length;u<n;u++)if(l[u]._qdiff!=r)t[t.length]=l[u];l=t}else l=l}else l=n;return l},matchers:[{re:/^\.([\w\-]+)/,select:'n = byClassName(n, " {1} ");'},{re:/^\:([\w\-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w\-]+)\s?(?:(=|.=)\s?(["']?)(.*?)\4)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{5}", "{3}", "{1}");'},{re:/^#([\w\-]+)/,select:'n = byId(n, "{1}");'},{re:/^@([\w\-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],
operators:{"=":function(l,n){return l==n},"!=":function(l,n){return l!=n},"^=":function(l,n){return l&&l.substr(0,n.length)==n},"$=":function(l,n){return l&&l.substr(l.length-n.length)==n},"*=":function(l,n){return l&&l.indexOf(n)!==-1},"%=":function(l,n){return l%n==0},"|=":function(l,n){return l&&(l==n||l.substr(0,n.length+1)==n+"-")},"~=":function(l,n){return l&&(" "+l+" ").indexOf(" "+n+" ")!=-1}},pseudos:{"first-child":function(l){for(var n=[],r=-1,q,t=0,u;u=q=l[t];t++){for(;(q=q.previousSibling)&&
q.nodeType!=1;);q||(n[++r]=u)}return n},"last-child":function(l){for(var n=[],r=-1,q,t=0,u;u=q=l[t];t++){for(;(q=q.nextSibling)&&q.nodeType!=1;);q||(n[++r]=u)}return n},"nth-child":function(l,n){var r=[],q=-1,t=m.exec(n=="even"&&"2n"||n=="odd"&&"2n+1"||!p.test(n)&&"n+"+n||n),u=(t[1]||1)-0;t=t[2]-0;for(var v=0,z;z=l[v];v++){var x=z.parentNode;if(batch!=x._batch){for(var A=0,N=x.firstChild;N;N=N.nextSibling)if(N.nodeType==1)N.nodeIndex=++A;x._batch=batch}if(u==1){if(t==0||z.nodeIndex==t)r[++q]=z}else if((z.nodeIndex+
t)%u==0)r[++q]=z}return r},"only-child":function(l){for(var n=[],r=-1,q=0,t;t=l[q];q++)if(!b(t)&&!a(t))n[++r]=t;return n},empty:function(l){for(var n=[],r=-1,q=0,t;t=l[q];q++){for(var u=t.childNodes,v=0,z,x=true;z=u[v];){++v;if(z.nodeType==1||z.nodeType==3){x=false;break}}if(x)n[++r]=t}return n},contains:function(l,n){for(var r=[],q=-1,t=0,u;u=l[t];t++)if((u.textContent||u.innerText||"").indexOf(n)!=-1)r[++q]=u;return r},nodeValue:function(l,n){for(var r=[],q=-1,t=0,u;u=l[t];t++)if(u.firstChild&&
u.firstChild.nodeValue==n)r[++q]=u;return r},checked:function(l){for(var n=[],r=-1,q=0,t;t=l[q];q++)if(t.checked==true)n[++r]=t;return n},not:function(l,n){return Ext.DomQuery.filter(l,n,true)},any:function(l,n){for(var r=n.split("|"),q=[],t=-1,u,v=0,z;z=l[v];v++)for(var x=0;u=r[x];x++)if(Ext.DomQuery.is(z,u)){q[++t]=z;break}return q},odd:function(l){return this["nth-child"](l,"odd")},even:function(l){return this["nth-child"](l,"even")},nth:function(l,n){return l[n-1]||[]},first:function(l){return l[0]||
[]},last:function(l){return l[l.length-1]||[]},has:function(l,n){for(var r=Ext.DomQuery.select,q=[],t=-1,u=0,v;v=l[u];u++)if(r(n,v).length>0)q[++t]=v;return q},next:function(l,n){for(var r=Ext.DomQuery.is,q=[],t=-1,u=0,v;v=l[u];u++){var z=a(v);if(z&&r(z,n))q[++t]=v}return q},prev:function(l,n){for(var r=Ext.DomQuery.is,q=[],t=-1,u=0,v;v=l[u];u++){var z=b(v);if(z&&r(z,n))q[++t]=v}return q}}}}();Ext.query=Ext.DomQuery.select;
Ext.util.DelayedTask=function(a,b,c){var d=this,e,g=function(){clearInterval(e);e=null;a.apply(b,c||[])};d.delay=function(h,i,j,k){d.cancel();a=i||a;b=j||b;c=k||c;e=setInterval(g,h)};d.cancel=function(){if(e){clearInterval(e);e=null}}};
(function(){var a=document;Ext.Element=function(k,m){var p=typeof k=="string"?a.getElementById(k):k,o;if(!p)return null;o=p.id;if(!m&&o&&Ext.elCache[o])return Ext.elCache[o].el;this.dom=p;this.id=o||Ext.id(p)};var b=Ext.DomHelper,c=Ext.Element,d=Ext.elCache;c.prototype={set:function(k,m){var p=this.dom,o,s;m=m!==false&&!!p.setAttribute;for(o in k)if(k.hasOwnProperty(o)){s=k[o];if(o=="style")b.applyStyles(p,s);else if(o=="cls")p.className=s;else if(m)p.setAttribute(o,s);else p[o]=s}return this},defaultUnit:"px",
is:function(k){return Ext.DomQuery.is(this.dom,k)},focus:function(k,m){m=m||this.dom;try{Number(k)?this.focus.defer(k,null,[null,m]):m.focus()}catch(p){}return this},blur:function(){try{this.dom.blur()}catch(k){}return this},getValue:function(k){var m=this.dom.value;return k?parseInt(m,10):m},addListener:function(k,m,p,o){Ext.EventManager.on(this.dom,k,m,p||this,o);return this},removeListener:function(k,m,p){Ext.EventManager.removeListener(this.dom,k,m,p||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);
return this},purgeAllListeners:function(){Ext.EventManager.purgeElement(this,true);return this},addUnits:function(k){if(k===""||k=="auto"||k===undefined)k=k||"";else if(!isNaN(k)||!g.test(k))k+=this.defaultUnit||"px";return k},load:function(k,m,p){Ext.Ajax.request(Ext.apply({params:m,url:k.url||k,callback:p,el:this.dom,indicatorText:k.indicatorText||""},Ext.isObject(k)?k:{}));return this},isBorderBox:function(){return Ext.isBorderBox||Ext.isForcedBorderBox||j[(this.dom.tagName||"").toLowerCase()]},
remove:function(){var k=this.dom;if(k){delete this.dom;Ext.removeNode(k)}},hover:function(k,m,p,o){this.on("mouseenter",k,p||this.dom,o);this.on("mouseleave",m,p||this.dom,o);return this},contains:function(k){return!k?false:Ext.lib.Dom.isAncestor(this.dom,k.dom?k.dom:k)},getAttributeNS:function(k,m){return this.getAttribute(m,k)},getAttribute:function(){var k=document.createElement("table"),m=false,p=/undefined|unknown/;if("getAttribute"in k){try{k.getAttribute("ext:qtip")}catch(o){m=true}return function(s,
l){var n=this.dom,r;if(n.getAttributeNS)r=n.getAttributeNS(l,s)||null;if(r==null)if(l)if(m&&n.tagName.toUpperCase()=="TABLE")try{r=n.getAttribute(l+":"+s)}catch(q){r=""}else r=n.getAttribute(l+":"+s);else r=n.getAttribute(s)||n[s];return r||""}}else return function(s,l){var n=this.om;if(l){n=n[l+":"+s];n=p.test(typeof n)?undefined:n}else n=n[s];return n||""}}(),update:function(k){if(this.dom)this.dom.innerHTML=k;return this}};var e=c.prototype;c.addMethods=function(k){Ext.apply(e,k)};e.on=e.addListener;
e.un=e.removeListener;e.autoBoxAdjust=true;var g=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i,h;c.get=function(k){var m,p;if(!k)return null;if(typeof k=="string"){if(!(p=a.getElementById(k)))return null;if(d[k]&&d[k].el){m=d[k].el;m.dom=p}else m=c.addToCache(new c(p));return m}else if(k.tagName){if(!(m=k.id))m=Ext.id(k);if(d[m]&&d[m].el){m=d[m].el;m.dom=k}else m=c.addToCache(new c(k));return m}else if(k instanceof c){if(k!=h)k.dom=Ext.isIE&&(k.id==undefined||k.id=="")?k.dom:a.getElementById(k.id)||k.dom;
return k}else if(k.isComposite)return k;else if(Ext.isArray(k))return c.select(k);else if(k==a){if(!h){k=function(){};k.prototype=c.prototype;h=new k;h.dom=a}return h}return null};c.addToCache=function(k,m){m=m||k.id;d[m]={el:k,data:{},events:{}};return k};c.data=function(k,m,p){k=c.get(k);if(!k)return null;var o=d[k.id].data;return arguments.length==2?o[m]:o[m]=p};c.collectorThreadId=setInterval(function(){if(Ext.enableGarbageCollector){var k,m;for(k in d){m=d[k];if(m.skipGC)Ext.EventManager.removeFromSpecialCache(m.el);
else{m=m.el;m=m.dom;if(!m||!m.parentNode||!m.offsetParent&&!a.getElementById(k)){Ext.enableListenerCollection&&Ext.EventManager.removeAll(m);delete d[k]}}}if(Ext.isIE){m={};for(k in d)m[k]=d[k];d=Ext.elCache=m}}else clearInterval(c.collectorThreadId)},3E4);var i=function(){};i.prototype=c.prototype;c.Flyweight=function(k){this.dom=k};c.Flyweight.prototype=new i;c.Flyweight.prototype.isFlyweight=true;c._flyweights={};c.fly=function(k,m){var p=null;m=m||"_global";if(k=Ext.getDom(k)){(c._flyweights[m]=
c._flyweights[m]||new c.Flyweight).dom=k;p=c._flyweights[m]}return p};Ext.get=c.get;Ext.fly=c.fly;var j=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko)j.button=1})();
Ext.Element.addMethods(function(){var a=Ext.DomQuery,b=Ext.get;return{findParent:function(c,d,e){var g=this.dom,h=document.body,i=0,j;if(Ext.isGecko&&Object.prototype.toString.call(g)=="[object XULElement]")return null;d=d||50;if(isNaN(d)){j=Ext.getDom(d);d=Number.MAX_VALUE}for(;g&&g.nodeType==1&&i<d&&g!=h&&g!=j;){if(a.is(g,c))return e?b(g):g;i++;g=g.parentNode}return null},findParentNode:function(c,d,e){var g=Ext.fly(this.dom.parentNode,"_internal");return g?g.findParent(c,d,e):null},up:function(c,
d){return this.findParentNode(c,d,true)},select:function(c){return Ext.Element.select(c,this.dom)},query:function(c){return a.select(c,this.dom)},child:function(c,d){var e=a.selectNode(c,this.dom);return d?e:b(e)},down:function(c,d){var e=a.selectNode(" > "+c,this.dom);return d?e:b(e)},parent:function(c,d){return this.matchNode("parentNode","parentNode",c,d)},next:function(c,d){return this.matchNode("nextSibling","nextSibling",c,d)},prev:function(c,d){return this.matchNode("previousSibling","previousSibling",
c,d)},first:function(c,d){return this.matchNode("nextSibling","firstChild",c,d)},last:function(c,d){return this.matchNode("previousSibling","lastChild",c,d)},matchNode:function(c,d,e,g){for(d=this.dom[d];d;){if(d.nodeType==1&&(!e||a.is(d,e)))return!g?b(d):d;d=d[c]}return null}}}());
Ext.Element.addMethods(function(){var a=Ext.getDom,b=Ext.get,c=Ext.DomHelper;return{appendChild:function(d){return b(d).appendTo(this)},appendTo:function(d){a(d).appendChild(this.dom);return this},insertBefore:function(d){(d=a(d)).parentNode.insertBefore(this.dom,d);return this},insertAfter:function(d){(d=a(d)).parentNode.insertBefore(this.dom,d.nextSibling);return this},insertFirst:function(d,e){d=d||{};if(d.nodeType||d.dom||typeof d=="string"){d=a(d);this.dom.insertBefore(d,this.dom.firstChild);
return!e?b(d):d}else return this.createChild(d,this.dom.firstChild,e)},replace:function(d){d=b(d);this.insertBefore(d);d.remove();return this},replaceWith:function(d){if(d.nodeType||d.dom||typeof d=="string"){d=a(d);this.dom.parentNode.insertBefore(d,this.dom)}else d=c.insertBefore(this.dom,d);delete Ext.elCache[this.id];Ext.removeNode(this.dom);this.id=Ext.id(this.dom=d);Ext.Element.addToCache(this.isFlyweight?new Ext.Element(this.dom):this);return this},createChild:function(d,e,g){d=d||{tag:"div"};
return e?c.insertBefore(e,d,g!==true):c[!this.dom.firstChild?"overwrite":"append"](this.dom,d,g!==true)},wrap:function(d,e){var g=c.insertBefore(this.dom,d||{tag:"div"},!e);g.dom?g.dom.appendChild(this.dom):g.appendChild(this.dom);return g},insertHtml:function(d,e,g){d=c.insertHtml(d,this.dom,e);return g?Ext.get(d):d}}}());
Ext.Element.addMethods(function(){function a(l,n){return n.charAt(1).toUpperCase()}function b(l){return d[l]||(d[l]=l=="float"?c.cssFloat?"cssFloat":"styleFloat":l.replace(e,a))}var c=Ext.supports,d={},e=/(-[a-z])/gi,g=document.defaultView,h=/alpha\(opacity=(.*)\)/i,i=/^\s+|\s+$/g,j=/\s+/,k=/\w/g,m=Math,p={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"},o={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"},s=Ext.Element.data;return{adjustWidth:function(l){var n=
typeof l=="number";if(n&&this.autoBoxAdjust&&!this.isBorderBox())l-=this.getBorderWidth("lr")+this.getPadding("lr");return n&&l<0?0:l},adjustHeight:function(l){var n=typeof l=="number";if(n&&this.autoBoxAdjust&&!this.isBorderBox())l-=this.getBorderWidth("tb")+this.getPadding("tb");return n&&l<0?0:l},addClass:function(l){var n,r,q,t=[];if(Ext.isArray(l)){n=0;for(r=l.length;n<r;n++){q=l[n];typeof q=="string"&&(" "+this.dom.className+" ").indexOf(" "+q+" ")==-1&&t.push(q)}if(t.length)this.dom.className+=
" "+t.join(" ")}else if(typeof l=="string"&&!this.hasClass(l))this.dom.className+=" "+l;return this},removeClass:function(l){var n,r,q,t;Ext.isArray(l)||(l=[l]);if(this.dom&&this.dom.className){t=this.dom.className.replace(i,"").split(j);n=0;for(q=l.length;n<q;n++){r=l[n];if(typeof r=="string"){r=r.replace(i,"");r=t.indexOf(r);r!=-1&&t.splice(r,1)}}this.dom.className=t.join(" ")}return this},radioClass:function(l){var n=this.dom.parentNode.childNodes,r,q,t;l=Ext.isArray(l)?l:[l];q=0;for(t=n.length;q<
t;q++)(r=n[q])&&r.nodeType==1&&Ext.fly(r,"_internal").removeClass(l);return this.addClass(l)},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l)},hasClass:function(l){return l&&(" "+this.dom.className+" ").indexOf(" "+l+" ")!=-1},replaceClass:function(l,n){return this.removeClass(l).addClass(n)},isStyle:function(l,n){return this.getStyle(l)==n},getStyle:function(){return g&&g.getComputedStyle?function(l){var n=this.dom,r,q,t;if(n==document)return null;l=b(l);t=(r=
n.style[l])?r:(q=g.getComputedStyle(n,""))?q[l]:null;if(l=="marginRight"&&t!="0px"&&!c.correctRightMargin){r=n.style.display;n.style.display="inline-block";t=g.getComputedStyle(n,"").marginRight;n.style.display=r}if(l=="backgroundColor"&&t=="rgba(0, 0, 0, 0)"&&!c.correctTransparentColor)t="transparent";return t}:function(l){var n=this.dom,r;if(n==document)return null;if(l=="opacity"){if(n.style.filter.match)if(l=n.style.filter.match(h)){l=parseFloat(l[1]);if(!isNaN(l))return l?l/100:0}return 1}l=
b(l);return n.style[l]||((r=n.currentStyle)?r[l]:null)}}(),getColor:function(l,n,r){l=this.getStyle(l);var q=typeof r!="undefined"?r:"#",t;if(!l||/transparent|inherit/.test(l))return n;if(/^r/.test(l))Ext.each(l.slice(4,l.length-1).split(","),function(u){t=parseInt(u,10);q+=(t<16?"0":"")+t.toString(16)});else{l=l.replace("#","");q+=l.length==3?l.replace(/^(\w)(\w)(\w)$/,"$1$1$2$2$3$3"):l}return q.length>5?q.toLowerCase():n},setStyle:function(l,n){var r,q;if(typeof l!="object"){r={};r[l]=n;l=r}for(q in l){n=
l[q];q=="opacity"?this.setOpacity(n):this.dom.style[b(q)]=n}return this},setOpacity:function(l,n){var r=this.dom.style;if(!n||!this.anim)if(Ext.isIE9m){var q=l<1?"alpha(opacity="+l*100+")":"",t=r.filter.replace(h,"").replace(i,"");r.zoom=1;r.filter=t+(t.length>0?" ":"")+q}else r.opacity=l;else this.anim({opacity:{to:l}},this.preanim(arguments,1),null,0.35,"easeIn");return this},clearOpacity:function(){var l=this.dom.style;if(Ext.isIE9m){if(!Ext.isEmpty(l.filter))l.filter=l.filter.replace(h,"").replace(i,
"")}else l.opacity=l["-moz-opacity"]=l["-khtml-opacity"]="";return this},getHeight:function(l){var n=this.dom,r=Ext.isIE9m&&this.isStyle("display","none");n=m.max(n.offsetHeight,r?0:n.clientHeight)||0;n=!l?n:n-this.getBorderWidth("tb")-this.getPadding("tb");return n<0?0:n},getWidth:function(l){var n=this.dom,r=Ext.isIE9m&&this.isStyle("display","none");n=m.max(n.offsetWidth,r?0:n.clientWidth)||0;n=!l?n:n-this.getBorderWidth("lr")-this.getPadding("lr");return n<0?0:n},setWidth:function(l,n){l=this.adjustWidth(l);
!n||!this.anim?this.dom.style.width=this.addUnits(l):this.anim({width:{to:l}},this.preanim(arguments,1));return this},setHeight:function(l,n){l=this.adjustHeight(l);!n||!this.anim?this.dom.style.height=this.addUnits(l):this.anim({height:{to:l}},this.preanim(arguments,1));return this},getBorderWidth:function(l){return this.addStyles(l,p)},getPadding:function(l){return this.addStyles(l,o)},clip:function(){var l=this.dom;if(!s(l,"isClipped")){s(l,"isClipped",true);s(l,"originalClip",{o:this.getStyle("overflow"),
x:this.getStyle("overflow-x"),y:this.getStyle("overflow-y")});this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){var l=this.dom;if(s(l,"isClipped")){s(l,"isClipped",false);l=s(l,"originalClip");l.o&&this.setStyle("overflow",l.o);l.x&&this.setStyle("overflow-x",l.x);l.y&&this.setStyle("overflow-y",l.y)}return this},addStyles:function(l,n){var r=0,q=l.match(k),t,u,v=q.length;for(u=0;u<v;u++)if(t=(t=q[u])&&parseInt(this.getStyle(n[t]),
10))r+=m.abs(t);return r},margins:{l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"}}}());
(function(){var a=Ext.lib.Dom;Ext.Element.addMethods({getX:function(){return a.getX(this.dom)},getY:function(){return a.getY(this.dom)},getXY:function(){return a.getXY(this.dom)},getOffsetsTo:function(b){var c=this.getXY();b=Ext.fly(b,"_internal").getXY();return[c[0]-b[0],c[1]-b[1]]},setX:function(b,c){return this.setXY([b,this.getY()],this.animTest(arguments,c,1))},setY:function(b,c){return this.setXY([this.getX(),b],this.animTest(arguments,c,1))},setLeft:function(b){this.setStyle("left",this.addUnits(b));
return this},setTop:function(b){this.setStyle("top",this.addUnits(b));return this},setRight:function(b){this.setStyle("right",this.addUnits(b));return this},setBottom:function(b){this.setStyle("bottom",this.addUnits(b));return this},setXY:function(b,c){!c||!this.anim?a.setXY(this.dom,b):this.anim({points:{to:b}},this.preanim(arguments,1),"motion");return this},setLocation:function(b,c,d){return this.setXY([b,c],this.animTest(arguments,d,2))},moveTo:function(b,c,d){return this.setXY([b,c],this.animTest(arguments,
d,2))},getLeft:function(b){return!b?this.getX():parseInt(this.getStyle("left"),10)||0},getRight:function(b){return!b?this.getX()+this.getWidth():this.getLeft(true)+this.getWidth()||0},getTop:function(b){return!b?this.getY():parseInt(this.getStyle("top"),10)||0},getBottom:function(b){return!b?this.getY()+this.getHeight():this.getTop(true)+this.getHeight()||0},position:function(b,c,d,e){if(!b&&this.isStyle("position","static"))this.setStyle("position","relative");else b&&this.setStyle("position",b);
c&&this.setStyle("z-index",c);if(d||e)this.setXY([d||false,e||false])},clearPositioning:function(b){b=b||"";this.setStyle({left:b,right:b,top:b,bottom:b,"z-index":"",position:"static"});return this},getPositioning:function(){var b=this.getStyle("left"),c=this.getStyle("top");return{position:this.getStyle("position"),left:b,right:b?"":this.getStyle("right"),top:c,bottom:c?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},setPositioning:function(b){var c=this.dom.style;this.setStyle(b);
if(b.right=="auto")c.right="";if(b.bottom=="auto")c.bottom="";return this},translatePoints:function(b,c){c=isNaN(b[1])?c:b[1];b=isNaN(b[0])?b:b[0];var d=this.isStyle("position","relative"),e=this.getXY(),g=parseInt(this.getStyle("left"),10),h=parseInt(this.getStyle("top"),10);g=!isNaN(g)?g:d?0:this.dom.offsetLeft;h=!isNaN(h)?h:d?0:this.dom.offsetTop;return{left:b-e[0]+g,top:c-e[1]+h}},animTest:function(b,c,d){return c&&this.preanim?this.preanim(b,d):false}})})();
Ext.Element.addMethods({isScrollable:function(){var a=this.dom;return a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth},scrollTo:function(a,b){this.dom["scroll"+(/top/i.test(a)?"Top":"Left")]=b;return this},getScroll:function(){var a=this.dom,b=document,c=b.body,d=b.documentElement;if(a==b||a==c){if(Ext.isIE&&Ext.isStrict){a=d.scrollLeft;d=d.scrollTop}else{a=window.pageXOffset;d=window.pageYOffset}c={left:a||(c?c.scrollLeft:0),top:d||(c?c.scrollTop:0)}}else c={left:a.scrollLeft,top:a.scrollTop};
return c}});Ext.Element.VISIBILITY=1;Ext.Element.DISPLAY=2;Ext.Element.OFFSETS=3;Ext.Element.ASCLASS=4;Ext.Element.visibilityCls="x-hide-nosize";
Ext.Element.addMethods(function(){var a=Ext.Element,b=a.data,c=function(e){var g=b(e,"originalDisplay");if(g===undefined)b(e,"originalDisplay",g="");return g},d=function(e){var g=b(e,"visibilityMode");if(g===undefined)b(e,"visibilityMode",g=1);return g};return{originalDisplay:"",visibilityMode:1,setVisibilityMode:function(e){b(this.dom,"visibilityMode",e);return this},animate:function(e,g,h,i,j){this.anim(e,{duration:g,callback:h,easing:i},j);return this},anim:function(e,g,h,i,j,k){h=h||"run";g=g||
{};var m=this;e=Ext.lib.Anim[h](m.dom,e,g.duration||i||0.35,g.easing||j||"easeOut",function(){k&&k.call(m);if(g.callback)g.callback.call(g.scope||m,m,g)},m);return g.anim=e},preanim:function(e,g){return!e[g]?false:typeof e[g]=="object"?e[g]:{duration:e[g+1],callback:e[g+2],easing:e[g+3]}},isVisible:function(){var e=this.dom,g=b(e,"isVisible");if(typeof g=="boolean")return g;g=!this.isStyle("visibility","hidden")&&!this.isStyle("display","none")&&!(d(e)==a.ASCLASS&&this.hasClass(this.visibilityCls||
a.visibilityCls));b(e,"isVisible",g);return g},setVisible:function(e,g){var h=this,i=h.dom,j=d(i);if(typeof g=="string"){switch(g){case "display":j=a.DISPLAY;break;case "visibility":j=a.VISIBILITY;break;case "offsets":j=a.OFFSETS;break;case "nosize":case "asclass":j=a.ASCLASS}h.setVisibilityMode(j);g=false}if(!g||!h.anim)if(j==a.ASCLASS)h[e?"removeClass":"addClass"](h.visibilityCls||a.visibilityCls);else if(j==a.DISPLAY)return h.setDisplayed(e);else if(j==a.OFFSETS)if(e){h.applyStyles(h.hideModeStyles||
{position:"",top:"",left:""});delete h.hideModeStyles}else{h.hideModeStyles={position:h.getStyle("position"),top:h.getStyle("top"),left:h.getStyle("left")};h.applyStyles({position:"absolute",top:"-10000px",left:"-10000px"})}else{h.fixDisplay();i.style.visibility=e?"visible":"hidden"}else{if(e){h.setOpacity(0.01);h.setVisible(true)}h.anim({opacity:{to:e?1:0}},h.preanim(arguments,1),null,0.35,"easeIn",function(){e||h.setVisible(false).setOpacity(1)})}b(i,"isVisible",e);return h},hasMetrics:function(){var e=
this.dom;return this.isVisible()||d(e)==a.VISIBILITY},toggle:function(){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(e){if(typeof e=="boolean")e=e?c(this.dom):"none";this.setStyle("display",e);return this},fixDisplay:function(){if(this.isStyle("display","none")){this.setStyle("visibility","hidden");this.setStyle("display",c(this.dom));this.isStyle("display","none")&&this.setStyle("display","block")}},hide:function(e){if(typeof e=="string"){this.setVisible(false,
e);return this}this.setVisible(false,this.preanim(arguments,0));return this},show:function(e){if(typeof e=="string"){this.setVisible(true,e);return this}this.setVisible(true,this.preanim(arguments,0));return this}}}());
(function(){var a=false,b=new Ext.Element.Flyweight,c={},d=function(g){b.dom=g;b.id=Ext.id(g);return b},e=function(g){c[g]||(c[g]=[]);return c[g]};Ext.enableFx=true;Ext.Fx={switchStatements:function(g,h,i){return h.apply(this,i[g])},slideIn:function(g,h){h=h||{};var i=this.dom,j=i.style,k,m,p,o,s,l,n,r;g=g||"t";this.queueFx(h,function(){k=d(i).getXY();d(i).fixDisplay();m=d(i).getFxRestore();p={x:k[0],y:k[1],0:k[0],1:k[1],width:i.offsetWidth,height:i.offsetHeight};p.right=p.x+p.width;p.bottom=p.y+
p.height;d(i).setWidth(p.width).setHeight(p.height);o=d(i).fxWrap(m.pos,h,"hidden");j.visibility="visible";j.position="absolute";l={to:[p.x,p.y]};n={to:p.width};r={to:p.height};s=d(i).switchStatements(g.toLowerCase(),function(q,t,u,v,z,x,A,N,B,E,D){var F={};d(q).setWidth(u).setHeight(v);d(q)[z]&&d(q)[z](x);t[A]=t[N]="0";if(B)F.width=B;if(E)F.height=E;if(D)F.points=D;return F},{t:[o,j,p.width,0,null,null,"left","bottom",null,r,null],l:[o,j,0,p.height,null,null,"right","top",n,null,null],r:[o,j,p.width,
p.height,"setX",p.right,"left","top",null,null,l],b:[o,j,p.width,p.height,"setY",p.bottom,"left","top",null,r,l],tl:[o,j,0,0,null,null,"right","bottom",n,r,l],bl:[o,j,0,0,"setY",p.y+p.height,"right","top",n,r,l],br:[o,j,0,0,"setXY",[p.right,p.bottom],"left","top",n,r,l],tr:[o,j,0,0,"setX",p.x+p.width,"left","bottom",n,r,l]});j.visibility="visible";d(o).show();arguments.callee.anim=d(o).fxanim(s,h,"motion",0.5,"easeOut",function(){d(i).fxUnwrap(o,m.pos,h);j.width=m.width;j.height=m.height;d(i).afterFx(h)})});
return this},slideOut:function(g,h){h=h||{};var i=this.dom,j=i.style,k=this.getXY(),m,p,o,s,l={to:0};g=g||"t";this.queueFx(h,function(){p=d(i).getFxRestore();o={x:k[0],y:k[1],0:k[0],1:k[1],width:i.offsetWidth,height:i.offsetHeight};o.right=o.x+o.width;o.bottom=o.y+o.height;d(i).setWidth(o.width).setHeight(o.height);m=d(i).fxWrap(p.pos,h,"visible");j.visibility="visible";j.position="absolute";d(m).setWidth(o.width).setHeight(o.height);s=d(i).switchStatements(g.toLowerCase(),function(n,r,q,t,u,v,z,
x,A){var N={};n[r]=n[q]="0";N[t]=u;if(v)N[v]=z;if(x)N[x]=A;return N},{t:[j,"left","bottom","height",l],l:[j,"right","top","width",l],r:[j,"left","top","width",l,"points",{to:[o.right,o.y]}],b:[j,"left","top","height",l,"points",{to:[o.x,o.bottom]}],tl:[j,"right","bottom","width",l,"height",l],bl:[j,"right","top","width",l,"height",l,"points",{to:[o.x,o.bottom]}],br:[j,"left","top","width",l,"height",l,"points",{to:[o.x+o.width,o.bottom]}],tr:[j,"left","bottom","width",l,"height",l,"points",{to:[o.right,
o.y]}]});arguments.callee.anim=d(m).fxanim(s,h,"motion",0.5,"easeOut",function(){h.useDisplay?d(i).setDisplayed(a):d(i).hide();d(i).fxUnwrap(m,p.pos,h);j.width=p.width;j.height=p.height;d(i).afterFx(h)})});return this},puff:function(g){g=g||{};var h=this.dom,i=h.style,j,k,m;this.queueFx(g,function(){j=d(h).getWidth();k=d(h).getHeight();d(h).clearOpacity();d(h).show();m=d(h).getFxRestore();arguments.callee.anim=d(h).fxanim({width:{to:d(h).adjustWidth(j*2)},height:{to:d(h).adjustHeight(k*2)},points:{by:[-j*
0.5,-k*0.5]},opacity:{to:0},fontSize:{to:200,unit:"%"}},g,"motion",0.5,"easeOut",function(){g.useDisplay?d(h).setDisplayed(a):d(h).hide();d(h).clearOpacity();d(h).setPositioning(m.pos);i.width=m.width;i.height=m.height;i.fontSize="";d(h).afterFx(g)})});return this},switchOff:function(g){g=g||{};var h=this.dom,i=h.style,j;this.queueFx(g,function(){function k(){g.useDisplay?d(h).setDisplayed(a):d(h).hide();d(h).clearOpacity();d(h).setPositioning(j.pos);i.width=j.width;i.height=j.height;d(h).afterFx(g)}
d(h).clearOpacity();d(h).clip();j=d(h).getFxRestore();d(h).fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){d(h).clearOpacity();(function(){d(h).fxanim({height:{to:1},points:{by:[0,d(h).getHeight()*0.5]}},g,"motion",0.3,"easeIn",k)}).defer(100)})});return this},highlight:function(g,h){h=h||{};var i=this.dom,j=h.attr||"backgroundColor",k={},m;this.queueFx(h,function(){d(i).clearOpacity();d(i).show();m=i.style[j];k[j]={from:g||"ffff9c",to:h.endColor||d(i).getColor(j)||"ffffff"};arguments.callee.anim=
d(i).fxanim(k,h,"color",1,"easeIn",function(){i.style[j]=m;d(i).afterFx(h)})});return this},frame:function(g,h,i){i=i||{};var j=this.dom,k,m;this.queueFx(i,function(){function p(){var n=Ext.isBorderBox?2:1;m=k.anim({top:{from:s.y,to:s.y-20},left:{from:s.x,to:s.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:s.height,to:s.height+20*n},width:{from:s.width,to:s.width+20*n}},{duration:i.duration||1,callback:function(){k.remove();--h>0?l():d(j).afterFx(i)}});arguments.callee.anim={isAnimated:true,
stop:function(){m.stop()}}}g=g||"#C3DAF9";if(g.length==6)g="#"+g;h=h||1;d(j).show();var o=d(j).getXY(),s={x:o[0],y:o[1],0:o[0],1:o[1],width:j.offsetWidth,height:j.offsetHeight},l=function(){k=d(document.body||document.documentElement).createChild({style:{position:"absolute","z-index":35E3,border:"0px solid "+g}});return k.queueFx({},p)};arguments.callee.anim={isAnimated:true,stop:function(){h=0;k.stopFx()}};l()});return this},pause:function(g){var h=this.dom,i;this.queueFx({},function(){i=setTimeout(function(){d(h).afterFx({})},
g*1E3);arguments.callee.anim={isAnimated:true,stop:function(){clearTimeout(i);d(h).afterFx({})}}});return this},fadeIn:function(g){g=g||{};var h=this.dom,i=g.endOpacity||1;this.queueFx(g,function(){d(h).setOpacity(0);d(h).fixDisplay();h.style.visibility="visible";arguments.callee.anim=d(h).fxanim({opacity:{to:i}},g,null,0.5,"easeOut",function(){i==1&&d(h).clearOpacity();d(h).afterFx(g)})});return this},fadeOut:function(g){g=g||{};var h=this.dom,i=h.style,j=g.endOpacity||0;this.queueFx(g,function(){arguments.callee.anim=
d(h).fxanim({opacity:{to:j}},g,null,0.5,"easeOut",function(){if(j==0){Ext.Element.data(h,"visibilityMode")==Ext.Element.DISPLAY||g.useDisplay?i.display="none":i.visibility="hidden";d(h).clearOpacity()}d(h).afterFx(g)})});return this},scale:function(g,h,i){this.shift(Ext.apply({},i,{width:g,height:h}));return this},shift:function(g){g=g||{};var h=this.dom,i={};this.queueFx(g,function(){for(var j in g)if(g[j]!=undefined)i[j]={to:g[j]};i.width&&(i.width.to=d(h).adjustWidth(g.width));i.height&&(i.height.to=
d(h).adjustWidth(g.height));if(i.x||i.y||i.xy)i.points=i.xy||{to:[i.x?i.x.to:d(h).getX(),i.y?i.y.to:d(h).getY()]};arguments.callee.anim=d(h).fxanim(i,g,"motion",0.35,"easeOut",function(){d(h).afterFx(g)})});return this},ghost:function(g,h){h=h||{};var i=this.dom,j=i.style,k={opacity:{to:0},points:{}},m=k.points,p,o,s;g=g||"b";this.queueFx(h,function(){p=d(i).getFxRestore();o=d(i).getWidth();s=d(i).getHeight();m.by=d(i).switchStatements(g.toLowerCase(),function(l,n){return[l,n]},{t:[0,-s],l:[-o,0],
r:[o,0],b:[0,s],tl:[-o,-s],bl:[-o,s],br:[o,s],tr:[o,-s]});arguments.callee.anim=d(i).fxanim(k,h,"motion",0.5,"easeOut",function(){h.useDisplay?d(i).setDisplayed(a):d(i).hide();d(i).clearOpacity();d(i).setPositioning(p.pos);j.width=p.width;j.height=p.height;d(i).afterFx(h)})});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:a,concurrent:true,stopFx:a});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:a,concurrent:a,stopFx:a});
return this},nextFx:function(){var g=e(this.dom.id)[0];g&&g.call(this)},hasActiveFx:function(){return e(this.dom.id)[0]},stopFx:function(g){var h=this.dom.id;if(this.hasActiveFx()){var i=e(h)[0];if(i&&i.anim)if(i.anim.isAnimated){c[h]=[i];i.anim.stop(g!==undefined?g:true)}else c[h]=[]}return this},beforeFx:function(g){if(this.hasActiveFx()&&!g.concurrent){if(g.stopFx){this.stopFx();return true}return a}return true},hasFxBlock:function(){var g=e(this.dom.id);return g&&g[0]&&g[0].block},queueFx:function(g,
h){var i=d(this.dom);if(!i.hasFxBlock()){Ext.applyIf(g,i.fxDefaults);if(g.concurrent)h.call(i);else{var j=i.beforeFx(g);h.block=g.block;e(i.dom.id).push(h);j&&i.nextFx()}}return i},fxWrap:function(g,h,i){var j=this.dom,k,m;if(!h.wrap||!(k=Ext.getDom(h.wrap))){if(h.fixPosition)m=d(j).getXY();h=document.createElement("div");h.style.visibility=i;k=j.parentNode.insertBefore(h,j);d(k).setPositioning(g);d(k).isStyle("position","static")&&d(k).position("relative");d(j).clearPositioning("auto");d(k).clip();
k.appendChild(j);m&&d(k).setXY(m)}return k},fxUnwrap:function(g,h,i){var j=this.dom;d(j).clearPositioning();d(j).setPositioning(h);if(!i.wrap){d(g).dom.parentNode.insertBefore(j,g);d(g).remove()}},getFxRestore:function(){var g=this.dom.style;return{pos:this.getPositioning(),width:g.width,height:g.height}},afterFx:function(g){var h=this.dom,i=h.id;g.afterStyle&&d(h).setStyle(g.afterStyle);g.afterCls&&d(h).addClass(g.afterCls);g.remove==true&&d(h).remove();g.callback&&g.callback.call(g.scope,d(h));
if(!g.concurrent){e(i).shift();d(h).nextFx()}},fxanim:function(g,h,i,j,k,m){i=i||"run";h=h||{};g=Ext.lib.Anim[i](this.dom,g,h.duration||j||0.35,h.easing||k||"easeOut",m,this);return h.anim=g}};Ext.Fx.resize=Ext.Fx.scale;Ext.Element.addMethods(Ext.Fx)})();Ext.CompositeElementLite=function(a,b){this.elements=[];this.add(a,b);this.el=new Ext.Element.Flyweight};
Ext.CompositeElementLite.prototype={isComposite:true,getElement:function(a){var b=this.el;b.dom=a;b.id=a.id;return b},transformElement:function(a){return Ext.getDom(a)},getCount:function(){return this.elements.length},add:function(a,b){var c=this.elements;if(!a)return this;if(typeof a=="string")a=Ext.Element.selectorFunction(a,b);else if(a.isComposite)a=a.elements;else Ext.isIterable(a)||(a=[a]);for(var d=0,e=a.length;d<e;++d)c.push(this.transformElement(a[d]));return this},invoke:function(a,b){var c=
this.elements,d=c.length,e,g;for(g=0;g<d;g++)(e=c[g])&&Ext.Element.prototype[a].apply(this.getElement(e),b);return this},item:function(a){a=this.elements[a];var b=null;if(a)b=this.getElement(a);return b},addListener:function(a,b,c,d){var e=this.elements,g=e.length,h,i;for(h=0;h<g;h++)if(i=e[h])Ext.EventManager.on(i,a,b,c||i,d);return this},each:function(a,b){var c=this.elements,d=c.length,e,g;for(e=0;e<d;e++)if(g=c[e]){g=this.getElement(g);if(a.call(b||g,g,this,e)===false)break}return this},fill:function(a){this.elements=
[];this.add(a);return this},filter:function(a){var b=[],c=this,d=Ext.isFunction(a)?a:function(e){return e.is(a)};c.each(function(e,g,h){if(d(e,h)!==false)b[b.length]=c.transformElement(e)});c.elements=b;return c},indexOf:function(a){return this.elements.indexOf(this.transformElement(a))},replaceElement:function(a,b,c){a=!isNaN(a)?a:this.indexOf(a);if(a>-1){b=Ext.getDom(b);if(c){c=this.elements[a];c.parentNode.insertBefore(b,c);Ext.removeNode(c)}this.elements.splice(a,1,b)}return this},clear:function(){this.elements=
[]}};Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;Ext.CompositeElementLite.importElementMethods=function(){var a,b=Ext.Element.prototype,c=Ext.CompositeElementLite.prototype;for(a in b)typeof b[a]=="function"&&function(d){c[d]=c[d]||function(){return this.invoke(d,arguments)}}.call(c,a)};Ext.CompositeElementLite.importElementMethods();if(Ext.DomQuery)Ext.Element.selectorFunction=Ext.DomQuery.select;
Ext.Element.select=function(a,b){var c;if(typeof a=="string")c=Ext.Element.selectorFunction(a,b);else if(a.length!==undefined)c=a;else throw"Invalid selector";return new Ext.CompositeElementLite(c)};Ext.select=Ext.Element.select;
(function(){var a="requestcomplete",b="load",c=window;Ext.data.Connection=function(d){Ext.apply(this,d);this.addEvents("beforerequest",a,"requestexception");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(d){if(this.fireEvent("beforerequest",this,d)){if(d.el){if(!Ext.isEmpty(d.indicatorText))this.indicatorText='<div class="loading-indicator">'+d.indicatorText+
"</div>";if(this.indicatorText)Ext.getDom(d.el).innerHTML=this.indicatorText;d.success=(Ext.isFunction(d.success)?d.success:function(){}).createInterceptor(function(j){Ext.getDom(d.el).innerHTML=j.responseText})}var e=d.params,g=d.url||this.url,h,i={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:d},timeout:Ext.num(d.timeout,this.timeout)};if(Ext.isFunction(e))e=e.call(d.scope||c,d);e=Ext.urlEncode(this.extraParams,Ext.isObject(e)?Ext.urlEncode(e):e);if(Ext.isFunction(g))g=
g.call(d.scope||c,d);if(h=Ext.getDom(d.form)){g=g||h.action;if(d.isUpload||/multipart\/form-data/i.test(h.getAttribute("enctype")))return this.doFormUpload.call(this,d,e,g);h=Ext.lib.Ajax.serializeForm(h);e=e?e+"&"+h:h}h=d.method||this.method||(e||d.xmlData||d.jsonData?"POST":"GET");if(h==="GET"&&this.disableCaching&&d.disableCaching!==false||d.disableCaching===true)g=Ext.urlAppend(g,(d.disableCachingParam||this.disableCachingParam)+"="+(new Date).getTime());d.headers=Ext.applyIf(d.headers||{},this.defaultHeaders||
{});if(d.autoAbort===true||this.autoAbort)this.abort();if((h=="GET"||d.xmlData||d.jsonData)&&e){g=Ext.urlAppend(g,e);e=""}return this.transId=Ext.lib.Ajax.request(h,g,i,e,d)}else return d.callback?d.callback.apply(d.scope,[d,undefined,undefined]):null},isLoading:function(d){return d?Ext.lib.Ajax.isCallInProgress(d):!!this.transId},abort:function(d){if(d||this.isLoading())Ext.lib.Ajax.abort(d||this.transId)},handleResponse:function(d){this.transId=false;var e=d.argument.options;d.argument=e?e.argument:
null;this.fireEvent(a,this,d,e);e.success&&e.success.call(e.scope,d,e);e.callback&&e.callback.call(e.scope,e,true,d)},handleFailure:function(d,e){this.transId=false;var g=d.argument.options;d.argument=g?g.argument:null;this.fireEvent("requestexception",this,d,g,e);g.failure&&g.failure.call(g.scope,d,g);g.callback&&g.callback.call(g.scope,g,false,d)},doFormUpload:function(d,e,g){function h(){function l(u,v,z){Ext.isFunction(u)&&u.apply(v,z)}var n={responseText:"",responseXML:null,argument:d.argument},
r,q;try{if(r=k.contentWindow.document||k.contentDocument||c.frames[i].document){if(r.body)n.responseText=/textarea/i.test((q=r.body.firstChild||{}).tagName)?q.value:r.body.innerHTML;n.responseXML=r.XMLDocument||r}}catch(t){}Ext.EventManager.removeListener(k,b,h,this);this.fireEvent(a,this,n,d);l(d.success,d.scope,[n,d]);l(d.callback,d.scope,[d,true,n]);this.debugUploads||setTimeout(function(){Ext.removeNode(k)},100)}var i=Ext.id(),j=document,k=j.createElement("iframe"),m=Ext.getDom(d.form),p=[],o,
s={target:m.target,method:m.method,encoding:m.encoding,enctype:m.enctype,action:m.action};Ext.fly(k).set({id:i,name:i,cls:"x-hidden",src:Ext.SSL_SECURE_URL});j.body.appendChild(k);if(Ext.isIE)document.frames[i].name=i;Ext.fly(m).set({target:i,method:"POST",enctype:"multipart/form-data",encoding:"multipart/form-data",action:g||s.action});Ext.iterate(Ext.urlDecode(e,false),function(l,n){o=j.createElement("input");Ext.fly(o).set({type:"hidden",value:n,name:l});m.appendChild(o);p.push(o)});Ext.EventManager.on(k,
b,h,this);m.submit();Ext.fly(m).set(s);Ext.each(p,function(l){Ext.removeNode(l)})}})})();Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});
Ext.util.JSON=new function(){var a=!!{}.hasOwnProperty,b=function(){var i=null;return function(){if(i===null)i=Ext.USE_NATIVE_JSON&&window.JSON&&JSON.toString()=="[object JSON]";return i}}(),c=function(i){return i<10?"0"+i:i},d=function(i){return i?eval("("+i+")"):""},e=function(i){if(!Ext.isDefined(i)||i===null)return"null";else if(Ext.isArray(i)){var j=["["],k,m,p=i.length,o;for(m=0;m<p;m+=1){o=i[m];switch(typeof o){case "undefined":case "function":case "unknown":break;default:k&&j.push(",");j.push(o===
null?"null":Ext.util.JSON.encode(o));k=true}}j.push("]");return j.join("")}else if(Ext.isDate(i))return Ext.util.JSON.encodeDate(i);else if(Ext.isString(i))return h(i);else if(typeof i=="number")return isFinite(i)?String(i):"null";else if(Ext.isBoolean(i))return String(i);else{k=["{"];for(m in i)if(!i.getElementsByTagName)if(!a||i.hasOwnProperty(m)){p=i[m];switch(typeof p){case "undefined":case "function":case "unknown":break;default:j&&k.push(",");k.push(e(m),":",p===null?"null":e(p));j=true}}k.push("}");
return k.join("")}},g={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h=function(i){if(/["\\\x00-\x1f]/.test(i))return'"'+i.replace(/([\x00-\x1f\\"])/g,function(j,k){var m=g[k];if(m)return m;m=k.charCodeAt();return"\\u00"+Math.floor(m/16).toString(16)+(m%16).toString(16)})+'"';return'"'+i+'"'};this.encodeDate=function(i){return'"'+i.getFullYear()+"-"+c(i.getMonth()+1)+"-"+c(i.getDate())+"T"+c(i.getHours())+":"+c(i.getMinutes())+":"+c(i.getSeconds())+'"'};this.encode=
function(){var i;return function(j){i||(i=b()?JSON.stringify:e);return i(j)}}();this.decode=function(){var i;return function(j){i||(i=b()?JSON.parse:d);return i(j)}}()};Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;
Ext.EventManager=function(){function a(B){var E=false,D=0,F=x.length,K=false,J;if(B){if(B.getElementById||B.navigator){for(;D<F;++D){J=x[D];if(J.el===B){E=J.id;break}}if(!E){E=Ext.id(B);x.push({id:E,el:B});K=true}}else E=Ext.id(B);if(!Ext.elCache[E]){Ext.Element.addToCache(new Ext.Element(B),E);if(K)Ext.elCache[E].skipGC=true}}return E}function b(B,E,D,F,K,J){B=Ext.getDom(B);var L=a(B);L=Ext.elCache[L].events;var P;P=r.on(B,E,K);L[E]=L[E]||[];L[E].push([D,K,J,P,F]);B.addEventListener&&E=="mousewheel"&&
B.addEventListener.apply(B,["DOMMouseScroll",K,false]);B==q&&E=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.addListener(K)}function c(){if(window!=top)return false;try{q.documentElement.doScroll("left")}catch(B){return false}h();return true}function d(){if(Ext.isIE9m&&c())return true;if(q.readyState==v){h();return true}l||(s=setTimeout(arguments.callee,2));return false}function e(){A||(A=Ext.query("style, link[rel=stylesheet]"));if(A.length==q.styleSheets.length){h();return true}l||(s=setTimeout(arguments.callee,
2));return false}function g(){q.removeEventListener(u,arguments.callee,false);e()}function h(){if(!l){l=true;s&&clearTimeout(s);n&&q.removeEventListener(u,h,false);Ext.isIE9m&&d.bindIE&&q.detachEvent("onreadystatechange",d);r.un(t,"load",arguments.callee)}if(o&&!Ext.isReady){Ext.isReady=true;o.fire();o.listeners=[]}}function i(B,E){return function(){var D=Ext.toArray(arguments);E.target==Ext.EventObject.setEvent(D[0]).target&&B.apply(this,D)}}function j(B,E,D){return function(F){D.delay(E.buffer,
B,null,[new Ext.EventObjectImpl(F)])}}function k(B,E,D,F,K){return function(J){Ext.EventManager.removeListener(E,D,F,K);B(J)}}function m(B,E,D){return function(F){var K=new Ext.util.DelayedTask(B);if(!D.tasks)D.tasks=[];D.tasks.push(K);K.delay(E.delay||10,B,null,[new Ext.EventObjectImpl(F)])}}function p(B,E,D,F,K){function J(Q){if(Ext){Q=Ext.EventObject.setEvent(Q);var W;if(L.delegate){if(!(W=Q.getTarget(L.delegate,P)))return}else W=Q.target;L.stopEvent&&Q.stopEvent();L.preventDefault&&Q.preventDefault();
L.stopPropagation&&Q.stopPropagation();if(L.normalized===false)Q=Q.browserEvent;F.call(K||P,Q,W,L)}}var L=!D||typeof D=="boolean"?{}:D,P=Ext.getDom(B),T;F=F||L.fn;K=K||L.scope;if(!P)throw'Error listening for "'+E+'". Element "'+B+"\" doesn't exist.";if(L.target)J=i(J,L);if(L.delay)J=m(J,L,F);if(L.single)J=k(J,P,E,F,K);if(L.buffer){T=new Ext.util.DelayedTask(J);J=j(J,L,T)}b(P,E,F,T,J,K);return J}var o,s,l=false,n=Ext.isGecko||Ext.isWebKit||Ext.isSafari||Ext.isIE10p,r=Ext.lib.Event,q=document,t=window,
u="DOMContentLoaded",v="complete",z=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/,x=[],A,N={addListener:function(B,E,D,F,K){if(typeof E=="object")for(var J in E){D=E[J];z.test(J)||(Ext.isFunction(D)?p(B,J,E,D,E.scope):p(B,J,D))}else p(B,E,K,D,F)},removeListener:function(B,E,D,F){B=Ext.getDom(B);var K=a(B),J=B&&Ext.elCache[K].events[E]||[],L,P,T;L=0;for(P=J.length;L<P;L++)if(Ext.isArray(T=J[L])&&T[0]==D&&(!F||T[2]==F)){T[4]&&T[4].cancel();if(F=
D.tasks&&D.tasks.length){for(;F--;)D.tasks[F].cancel();delete D.tasks}D=T[1];r.un(B,E,r.extAdapter?T[3]:D);D&&B.addEventListener&&E=="mousewheel"&&B.removeEventListener("DOMMouseScroll",D,false);D&&B==q&&E=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(D);J.splice(L,1);J.length===0&&delete Ext.elCache[K].events[E];for(F in Ext.elCache[K].events)return false;Ext.elCache[K].events={};return false}},removeAll:function(B){B=Ext.getDom(B);var E=a(B),D=(Ext.elCache[E]||{}).events||
{},F,K,J,L,P,T,Q;for(L in D)if(D.hasOwnProperty(L)){F=D[L];K=0;for(J=F.length;K<J;K++){P=F[K];P[4]&&P[4].cancel();if(P[0].tasks&&(T=P[0].tasks.length)){for(;T--;)P[0].tasks[T].cancel();delete P.tasks}Q=P[1];r.un(B,L,r.extAdapter?P[3]:Q);B.addEventListener&&Q&&L=="mousewheel"&&B.removeEventListener("DOMMouseScroll",Q,false);Q&&B==q&&L=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.removeListener(Q)}}if(Ext.elCache[E])Ext.elCache[E].events={}},getListeners:function(B,E){B=Ext.getDom(B);var D=
a(B);return(D=(Ext.elCache[D]||{}).events||{})&&D[E]?D[E]:null},removeFromSpecialCache:function(B){for(var E=0,D=x.length;E<D;++E)x[E].el==B&&x.splice(E,1)},purgeElement:function(B,E,D){B=Ext.getDom(B);var F=a(B);F=(Ext.elCache[F]||{}).events||{};var K,J;if(D){if(F&&F.hasOwnProperty(D)){K=F[D];F=0;for(J=K.length;F<J;F++)Ext.EventManager.removeListener(B,D,K[F][0])}}else Ext.EventManager.removeAll(B);if(E&&B&&B.childNodes){F=0;for(J=B.childNodes.length;F<J;F++)Ext.EventManager.purgeElement(B.childNodes[F],
E,D)}},_unload:function(){for(var B in Ext.elCache)Ext.EventManager.removeAll(B);delete Ext.elCache;delete Ext.Element._flyweights;var E,D,F=Ext.lib.Ajax;typeof F.conn=="object"?E=F.conn:E={};for(D in E)(B=E[D])&&F.abort({conn:B,tId:D})},onDocumentReady:function(B,E,D){if(Ext.isReady){o||(o=new Ext.util.Event);o.addListener(B,E,D);o.fire();o.listeners=[]}else{if(!o){o||(o=new Ext.util.Event);n&&q.addEventListener(u,h,false);if(Ext.isIE9m){if(!d()){d.bindIE=true;q.attachEvent("onreadystatechange",
d)}}else if(Ext.isOpera)q.readyState==v&&e()||q.addEventListener(u,g,false);else Ext.isWebKit&&d();r.on(t,"load",h)}D=D||{};D.delay=D.delay||1;o.addListener(B,E,D)}},fireDocReady:h};N.on=N.addListener;N.un=N.removeListener;N.stoppedMouseDownEvent=new Ext.util.Event;return N}();Ext.onReady=Ext.EventManager.onDocumentReady;
(function(){var a=function(){var b=document.body||document.getElementsByTagName("body")[0];if(!b)return false;var c=[];if(Ext.isIE){Ext.isIE10p||c.push("ext-ie");if(Ext.isIE6)c.push("ext-ie6");else if(Ext.isIE7)c.push("ext-ie7","ext-ie7m");else if(Ext.isIE8)c.push("ext-ie8","ext-ie8m");else if(Ext.isIE9)c.push("ext-ie9","ext-ie9m");else Ext.isIE10&&c.push("ext-ie10")}if(Ext.isGecko){c.push("ext-gecko");Ext.isGecko2?c.push("ext-gecko2"):c.push("ext-gecko3")}Ext.isOpera&&c.push("ext-opera");Ext.isWebKit&&
c.push("ext-webkit");if(Ext.isSafari)c.push("ext-safari "+(Ext.isSafari2?"ext-safari2":Ext.isSafari3?"ext-safari3":"ext-safari4"));else Ext.isChrome&&c.push("ext-chrome");Ext.isMac&&c.push("ext-mac");Ext.isLinux&&c.push("ext-linux");if(Ext.isStrict||Ext.isBorderBox){var d=b.parentNode;if(d){if(!Ext.isStrict){Ext.fly(d,"_internal").addClass("x-quirks");if(Ext.isIE9m&&!Ext.isStrict)Ext.isIEQuirks=true}Ext.fly(d,"_internal").addClass(Ext.isStrict&&Ext.isIE||!Ext.enableForcedBoxModel&&!Ext.isIE?" ext-strict":
" ext-border-box")}}if(Ext.enableForcedBoxModel&&!Ext.isIE){Ext.isForcedBorderBox=true;c.push("ext-forced-border-box")}Ext.fly(b,"_internal").addClass(c);return true};a()||Ext.onReady(a)})();
(function(){var a=Ext.apply(Ext.supports,{correctRightMargin:true,correctTransparentColor:true,cssFloat:true}),b=function(){var c=document.createElement("div"),d=document,e,g;c.innerHTML='<div style="height:30px;width:50px;"><div style="height:20px;width:20px;"></div></div><div style="float:left;background-color:transparent;">';d.body.appendChild(c);g=c.lastChild;if(e=d.defaultView){if(e.getComputedStyle(c.firstChild.firstChild,null).marginRight!="0px")a.correctRightMargin=false;if(e.getComputedStyle(g,
null).backgroundColor!="transparent")a.correctTransparentColor=false}a.cssFloat=!!g.style.cssFloat;d.body.removeChild(c)};Ext.isReady?b():Ext.onReady(b)})();
Ext.EventObject=function(){var a=Ext.lib.Event,b=/(dbl)?click/,c={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35},d=Ext.isIE?{1:0,4:1,2:2}:{0:0,1:1,2:2};Ext.EventObjectImpl=function(e){if(e)this.setEvent(e.browserEvent||e)};Ext.EventObjectImpl.prototype={setEvent:function(e){if(e==this||e&&e.browserEvent)return e;if(this.browserEvent=e){this.button=e.button?d[e.button]:e.which?e.which-1:-1;if(b.test(e.type)&&this.button==-1)this.button=0;this.type=e.type;this.shiftKey=
e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey||false;this.altKey=e.altKey;this.keyCode=e.keyCode;this.charCode=e.charCode;this.target=a.getTarget(e);this.xy=a.getXY(e)}else{this.button=-1;this.altKey=this.ctrlKey=this.shiftKey=false;this.charCode=this.keyCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){this.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(this);a.stopEvent(this.browserEvent)}},preventDefault:function(){this.browserEvent&&
a.preventDefault(this.browserEvent)},stopPropagation:function(){if(this.browserEvent){this.browserEvent.type=="mousedown"&&Ext.EventManager.stoppedMouseDownEvent.fire(this);a.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){return this.normalizeKey(this.keyCode||this.charCode)},normalizeKey:function(e){return Ext.isSafari?c[e]||e:e},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getXY:function(){return this.xy},
getTarget:function(e,g,h){return e?Ext.fly(this.target).findParent(e,g,h):h?Ext.get(this.target):this.target},getRelatedTarget:function(){return this.browserEvent?a.getRelatedTarget(this.browserEvent):null},getWheelDelta:function(){var e=this.browserEvent,g=0;if(e.wheelDelta)g=e.wheelDelta/120;else if(e.detail)g=-e.detail/3;return g},within:function(e,g,h){if(e)return(g=this[g?"getRelatedTarget":"getTarget"]())&&((h?g==Ext.getDom(e):false)||Ext.fly(e).contains(g));return false}};return new Ext.EventObjectImpl}();
Ext.Loader=Ext.apply({},{load:function(a,b,c,d){c=c||this;var e=document.getElementsByTagName("head")[0],g=document.createDocumentFragment(),h=a.length,i=0,j=this,k=function(){i++;if(h==i&&typeof b=="function")b.call(c);else d===true&&e.appendChild(j.buildScriptTag(a[i],k))};if(d===true)e.appendChild(j.buildScriptTag(a[0],k));else{Ext.each(a,function(m){g.appendChild(this.buildScriptTag(m,k))},this);e.appendChild(g)}},buildScriptTag:function(a,b){var c=document.createElement("script");c.type="text/javascript";
c.src=a;if(c.readyState)c.onreadystatechange=function(){if(c.readyState=="loaded"||c.readyState=="complete"){c.onreadystatechange=null;b()}};else c.onload=b;return c}});Ext.ns("Ext.grid","Ext.list","Ext.dd","Ext.tree","Ext.form","Ext.menu","Ext.state","Ext.layout.boxOverflow","Ext.app","Ext.ux","Ext.chart","Ext.direct","Ext.slider");
Ext.apply(Ext,function(){var a=Ext,b=null;return{emptyFn:function(){},BLANK_IMAGE_URL:Ext.isIE6||Ext.isIE7||Ext.isAir?"http://www.extjs.com/s.gif":"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",extendX:function(c,d){return Ext.extend(c,d(c.prototype))},getDoc:function(){return Ext.get(document)},num:function(c,d){c=Number(Ext.isEmpty(c)||Ext.isArray(c)||typeof c=="boolean"||typeof c=="string"&&c.trim().length==0?NaN:c);return isNaN(c)?d:c},value:function(c,d,
e){return Ext.isEmpty(c,e)?d:c},escapeRe:function(c){return c.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},sequence:function(c,d,e,g){c[d]=c[d].createSequence(e,g)},addBehaviors:function(c){if(Ext.isReady){var d={},e,g,h;for(g in c)if((e=g.split("@"))[1]){h=e[0];d[h]||(d[h]=Ext.select(h));d[h].on(e[1],c[g])}d=null}else Ext.onReady(function(){Ext.addBehaviors(c)})},getScrollBarWidth:function(c){if(!Ext.isReady)return 0;if(c===true||b===null){c=Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>');
var d=c.child("div",true),e=d.offsetWidth;c.setStyle("overflow",Ext.isWebKit||Ext.isGecko?"auto":"scroll");d=d.offsetWidth;c.remove();b=e-d+2}return b},combine:function(){for(var c=arguments,d=c.length,e=[],g=0;g<d;g++){var h=c[g];if(Ext.isArray(h))e=e.concat(h);else if(h.length!==undefined&&!h.substr)e=e.concat(Array.prototype.slice.call(h,0));else e.push(h)}return e},copyTo:function(c,d,e){if(typeof e=="string")e=e.split(/[,;\s]/);Ext.each(e,function(g){if(d.hasOwnProperty(g))c[g]=d[g]},this);return c},
destroy:function(){Ext.each(arguments,function(c){if(c)if(Ext.isArray(c))this.destroy.apply(this,c);else if(typeof c.destroy=="function")c.destroy();else c.dom&&c.remove()},this)},destroyMembers:function(c){for(var d=1,e=arguments,g=e.length;d<g;d++){Ext.destroy(c[e[d]]);delete c[e[d]]}},clean:function(c){var d=[];Ext.each(c,function(e){e&&d.push(e)});return d},unique:function(c){var d=[],e={};Ext.each(c,function(g){e[g]||d.push(g);e[g]=true});return d},flatten:function(c){function d(g){Ext.each(g,
function(h){Ext.isArray(h)?d(h):e.push(h)});return e}var e=[];return d(c)},min:function(c,d){var e=c[0];d=d||function(g,h){return g<h?-1:1};Ext.each(c,function(g){e=d(e,g)==-1?e:g});return e},max:function(c,d){var e=c[0];d=d||function(g,h){return g>h?1:-1};Ext.each(c,function(g){e=d(e,g)==1?e:g});return e},mean:function(c){return c.length>0?Ext.sum(c)/c.length:undefined},sum:function(c){var d=0;Ext.each(c,function(e){d+=e});return d},partition:function(c,d){var e=[[],[]];Ext.each(c,function(g,h,i){e[d&&
d(g,h,i)||!d&&g?0:1].push(g)});return e},invoke:function(c,d){var e=[],g=Array.prototype.slice.call(arguments,2);Ext.each(c,function(h){h&&typeof h[d]=="function"?e.push(h[d].apply(h,g)):e.push(undefined)});return e},pluck:function(c,d){var e=[];Ext.each(c,function(g){e.push(g[d])});return e},zip:function(){var c=Ext.partition(arguments,function(k){return typeof k!="function"}),d=c[0];c=c[1][0];for(var e=Ext.max(Ext.pluck(d,"length")),g=[],h=0;h<e;h++){g[h]=[];if(c)g[h]=c.apply(c,Ext.pluck(d,h));
else for(var i=0,j=d.length;i<j;i++)g[h].push(d[i][h])}return g},getCmp:function(c){return Ext.ComponentMgr.get(c)},useShims:a.isIE6||a.isMac&&a.isGecko2,type:function(c){if(c===undefined||c===null)return false;if(c.htmlElement)return"element";var d=typeof c;if(d=="object"&&c.nodeName)switch(c.nodeType){case 1:return"element";case 3:return/\S/.test(c.nodeValue)?"textnode":"whitespace"}if(d=="object"||d=="function"){switch(c.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof c.length==
"number"&&typeof c.item=="function")return"nodelist"}return d},intercept:function(c,d,e,g){c[d]=c[d].createInterceptor(e,g)},callback:function(c,d,e,g){if(typeof c=="function")g?c.defer(g,d,e||[]):c.apply(d,e||[])}}}());Ext.apply(Function.prototype,{createSequence:function(a,b){var c=this;return typeof a!="function"?this:function(){var d=c.apply(this||window,arguments);a.apply(b||this||window,arguments);return d}}});
Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(a,b,c){a=String(a);for(c||(c=" ");a.length<b;)a=c+a;return a}});String.prototype.toggle=function(a,b){return this==a?b:a};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Date.prototype.getElapsed=function(a){return Math.abs((a||new Date).getTime()-this.getTime())};Ext.applyIf(Number.prototype,{constrain:function(a,b){return Math.min(Math.max(this,a),b)}});
Ext.lib.Dom.getRegion=function(a){return Ext.lib.Region.getRegion(a)};Ext.lib.Region=function(a,b,c,d){this.top=a;this[1]=a;this.right=b;this.bottom=c;this.left=d;this[0]=d};
Ext.lib.Region.prototype={contains:function(a){return a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom},getArea:function(){return(this.bottom-this.top)*(this.right-this.left)},intersect:function(a){var b=Math.max(this.top,a.top),c=Math.min(this.right,a.right),d=Math.min(this.bottom,a.bottom);a=Math.max(this.left,a.left);if(d>=b&&c>=a)return new Ext.lib.Region(b,c,d,a)},union:function(a){return new Ext.lib.Region(Math.min(this.top,a.top),Math.max(this.right,a.right),Math.max(this.bottom,
a.bottom),Math.min(this.left,a.left))},constrainTo:function(a){this.top=this.top.constrain(a.top,a.bottom);this.bottom=this.bottom.constrain(a.top,a.bottom);this.left=this.left.constrain(a.left,a.right);this.right=this.right.constrain(a.left,a.right);return this},adjust:function(a,b,c,d){this.top+=a;this.left+=b;this.right+=d;this.bottom+=c;return this}};Ext.lib.Region.getRegion=function(a){var b=Ext.lib.Dom.getXY(a);return new Ext.lib.Region(b[1],b[0]+a.offsetWidth,b[1]+a.offsetHeight,b[0])};
Ext.lib.Point=function(a,b){if(Ext.isArray(a)){b=a[1];a=a[0]}this.x=this.right=this.left=this[0]=a;this.y=this.top=this.bottom=this[1]=b};Ext.lib.Point.prototype=new Ext.lib.Region;
Ext.apply(Ext.DomHelper,function(){function a(e,g,h,i,j,k){e=Ext.getDom(e);if(c.useDom){g=b(g,null);k?e.appendChild(g):(j=="firstChild"?e:e.parentNode).insertBefore(g,e[j]||e)}else g=Ext.DomHelper.insertHtml(i,e,Ext.DomHelper.createHtml(g));return h?Ext.get(g,true):g}function b(e,g){var h;h=document;var i,j,k;if(Ext.isArray(e)){h=h.createDocumentFragment();j=0;for(i=e.length;j<i;j++)b(e[j],h)}else if(typeof e=="string")h=h.createTextNode(e);else{h=h.createElement(e.tag||"div");i=!!h.setAttribute;
for(j in e)if(!d.test(j)){k=e[j];if(j=="cls")h.className=k;else if(i)h.setAttribute(j,k);else h[j]=k}Ext.DomHelper.applyStyles(h,e.style);if(j=e.children||e.cn)b(j,h);else if(e.html)h.innerHTML=e.html}g&&g.appendChild(h);return h}var c,d=/tag|children|cn|html$/i;return c={createTemplate:function(e){e=Ext.DomHelper.createHtml(e);return new Ext.Template(e)},useDom:false,insertBefore:function(e,g,h){return a(e,g,h,"beforebegin")},insertAfter:function(e,g,h){return a(e,g,h,"afterend","nextSibling")},
insertFirst:function(e,g,h){return a(e,g,h,"afterbegin","firstChild")},append:function(e,g,h){return a(e,g,h,"beforeend","",true)},createDom: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,c=b.disableFormats!==true,d=Ext.util.Format;if(b.compiled)return b.compiled(a);return b.html.replace(b.re,function(e,g,h,i){if(h&&c)if(h.substr(0,5)=="this.")return b.call(h.substr(5),a[g],a);else{if(i){e=b.argsRe;i=i.split(",");for(var j=0,k=i.length;j<k;j++)i[j]=i[j].replace(e,
"$1");i=[a[g]].concat(i)}else i=[a[g]];return d[h].apply(d,i)}else return a[g]!==undefined?a[g]:""})},compile:function(){function a(e,g,h,i){if(h&&b){i=i?","+i:"";if(h.substr(0,5)!="this.")h="fm."+h+"(";else{h='this.call("'+h.substr(5)+'", ';i=", values"}}else{i="";h="(values['"+g+"'] == undefined ? '' : "}return"'"+c+h+"values['"+g+"']"+i+")"+c+"'"}var b=this.disableFormats!==true,c=Ext.isGecko?"+":",",d;if(Ext.isGecko)d="this.compiled = function(values){ return '"+this.html.replace(this.compileARe,
"\\\\").replace(this.compileBRe,"\\n").replace(this.compileCRe,"\\'").replace(this.re,a)+"';};";else{d=["this.compiled = function(values){ return ['"];d.push(this.html.replace(this.compileARe,"\\\\").replace(this.compileBRe,"\\n").replace(this.compileCRe,"\\'").replace(this.re,a));d.push("'].join('');};");d=d.join("")}eval(d);return this},call:function(a,b,c){return this[a](b,c)}});Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;
Ext.util.Functions={createInterceptor:function(a,b,c){return Ext.isFunction(b)?function(){var d=arguments;b.target=this;b.method=a;return b.apply(c||this||window,d)!==false?a.apply(this||window,d):null}:a},createDelegate:function(a,b,c,d){if(!Ext.isFunction(a))return a;return function(){var e=c||arguments;if(d===true){e=Array.prototype.slice.call(arguments,0);e=e.concat(c)}else if(Ext.isNumber(d)){e=Array.prototype.slice.call(arguments,0);var g=[d,0].concat(c);Array.prototype.splice.apply(e,g)}return a.apply(b||
window,e)}},defer:function(a,b,c,d,e){a=Ext.util.Functions.createDelegate(a,c,d,e);if(b>0)return setTimeout(a,b);a();return 0},createSequence:function(a,b,c){return Ext.isFunction(b)?function(){var d=a.apply(this||window,arguments);b.apply(c||this||window,arguments);return d}:a}};Ext.defer=Ext.util.Functions.defer;Ext.createInterceptor=Ext.util.Functions.createInterceptor;Ext.createSequence=Ext.util.Functions.createSequence;Ext.createDelegate=Ext.util.Functions.createDelegate;
Ext.apply(Ext.util.Observable.prototype,function(){function a(b){var c=(this.methodEvents=this.methodEvents||{})[b],d,e,g,h=this;if(!c){this.methodEvents[b]=c={};c.originalFn=this[b];c.methodName=b;c.before=[];c.after=[];var i=function(j,k,m){if((e=j.apply(k||h,m))!==undefined)if(typeof e=="object"){d=e.returnValue!==undefined?e.returnValue:e;g=!!e.cancel}else if(e===false)g=true;else d=e};this[b]=function(){var j=Array.prototype.slice.call(arguments,0),k;d=e=undefined;g=false;for(var m=0,p=c.before.length;m<
p;m++){k=c.before[m];i(k.fn,k.scope,j);if(g)return d}if((e=c.originalFn.apply(h,j))!==undefined)d=e;m=0;for(p=c.after.length;m<p;m++){k=c.after[m];i(k.fn,k.scope,j);if(g)break}return d}}return c}return{beforeMethod:function(b,c,d){a.call(this,b).before.push({fn:c,scope:d})},afterMethod:function(b,c,d){a.call(this,b).after.push({fn:c,scope:d})},removeMethodListener:function(b,c,d){b=this.getMethodEvent(b);for(var e=0,g=b.before.length;e<g;e++)if(b.before[e].fn==c&&b.before[e].scope==d){b.before.splice(e,
1);return}e=0;for(g=b.after.length;e<g;e++)if(b.after[e].fn==c&&b.after[e].scope==d){b.after.splice(e,1);break}},relayEvents:function(b,c){function d(j){return function(){return e.fireEvent.apply(e,[j].concat(Array.prototype.slice.call(arguments,0)))}}for(var e=this,g=0,h=c.length;g<h;g++){var i=c[g];e.events[i]=e.events[i]||true;b.on(i,d(i),e)}},enableBubble:function(b){if(!Ext.isEmpty(b)){b=Ext.isArray(b)?b:Array.prototype.slice.call(arguments,0);for(var c=0,d=b.length;c<d;c++){var e=b[c];e=e.toLowerCase();
var g=this.events[e]||true;if(typeof g=="boolean"){g=new Ext.util.Event(this,e);this.events[e]=g}g.bubble=true}}}}}());Ext.util.Observable.capture=function(a,b,c){a.fireEvent=a.fireEvent.createInterceptor(b,c)};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.apply(Ext.EventManager,function(){var a,b,c,d,e=Ext.lib.Dom,g=Ext.EventManager._unload,h=0,i=0,j=Ext.isWebKit?Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1])>=525:!(Ext.isGecko&&!Ext.isWindows||Ext.isOpera);return{_unload:function(){Ext.EventManager.un(window,"resize",this.fireWindowResize,this);g.call(Ext.EventManager)},doResizeEvent:function(){var k=e.getViewHeight(),m=e.getViewWidth();if(i!=k||h!=m)a.fire(h=m,i=k)},onWindowResize:function(k,m,p){if(!a){a=new Ext.util.Event;b=new Ext.util.DelayedTask(this.doResizeEvent);
Ext.EventManager.on(window,"resize",this.fireWindowResize,this)}a.addListener(k,m,p)},fireWindowResize:function(){a&&b.delay(100)},onTextResize:function(k,m,p){if(!c){c=new Ext.util.Event;var o=new Ext.Element(document.createElement("div"));o.dom.className="x-text-resize";o.dom.innerHTML="X";o.appendTo(document.body);d=o.dom.offsetHeight;setInterval(function(){if(o.dom.offsetHeight!=d)c.fire(d,d=o.dom.offsetHeight)},this.textResizeInterval)}c.addListener(k,m,p)},removeResizeListener:function(k,m){a&&
a.removeListener(k,m)},fireResize:function(){a&&a.fire(e.getViewWidth(),e.getViewHeight())},textResizeInterval:50,ieDeferSrc:false,getKeyEvent:function(){return j?"keydown":"keypress"},useKeydown:j}}());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 a=this.normalizeKey(this.keyCode);return a>=33&&a<=40||a==this.RETURN||a==this.TAB||a==this.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}});
Ext.Element.addMethods({swallowEvent:function(a,b){function c(e){e.stopPropagation();b&&e.preventDefault()}var d=this;if(Ext.isArray(a)){Ext.each(a,function(e){d.on(e,c)});return d}d.on(a,c);return d},relayEvent:function(a,b){this.on(a,function(c){b.fireEvent(a,c)})},clean:function(a){var b=this.dom,c=b.firstChild,d=-1;if(Ext.Element.data(b,"isCleaned")&&a!==true)return this;for(;c;){a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue))b.removeChild(c);else c.nodeIndex=++d;c=a}Ext.Element.data(b,
"isCleaned",true);return this},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(a,b,c){if(!this.dom)return this;a=a||"";if(b!==true){this.dom.innerHTML=a;typeof c=="function"&&c();return this}var d=Ext.id();b=this.dom;a+='<span id="'+d+'"></span>';Ext.lib.Event.onAvailable(d,function(){for(var e=document,g=e.getElementsByTagName("head")[0],h=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
i=/\ssrc=([\'\"])(.*?)\1/i,j=/\stype=([\'\"])(.*?)\1/i,k,m,p;k=h.exec(a);)if((p=(m=k[1])?m.match(i):false)&&p[2]){k=e.createElement("script");k.src=p[2];if((m=m.match(j))&&m[2])k.type=m[2];g.appendChild(k)}else if(k[2]&&k[2].length>0)window.execScript?window.execScript(k[2]):window.eval(k[2]);(e=e.getElementById(d))&&Ext.removeNode(e);typeof c=="function"&&c()});b.innerHTML=a.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},removeAllListeners:function(){this.removeAnchor();
Ext.EventManager.removeAll(this.dom);return this},createProxy:function(a,b,c){a=typeof a=="object"?a:{tag:"div",cls:a};a=b?Ext.DomHelper.append(b,a,true):Ext.DomHelper.insertBefore(this.dom,a,true);c&&this.setBox&&this.getBox&&a.setBox(this.getBox());return a}});Ext.Element.prototype.getUpdateManager=Ext.Element.prototype.getUpdater;
Ext.Element.addMethods({getAnchorXY:function(a,b,c){a=(a||"tl").toLowerCase();c=c||{};var d=this.dom==document.body||this.dom==document,e=c.width||d?Ext.lib.Dom.getViewWidth():this.getWidth(),g=c.height||d?Ext.lib.Dom.getViewHeight():this.getHeight(),h=Math.round,i=this.getXY(),j=this.getScroll();c=d?j.left:!b?i[0]:0;b=d?j.top:!b?i[1]:0;a={c:[h(e*0.5),h(g*0.5)],t:[h(e*0.5),0],l:[0,h(g*0.5)],r:[e,h(g*0.5)],b:[h(e*0.5),g],tl:[0,0],bl:[0,g],br:[e,g],tr:[e,0]}[a];return[a[0]+c,a[1]+b]},anchorTo:function(a,
b,c,d,e,g){var h=this.dom,i=!Ext.isEmpty(e),j=function(){Ext.fly(h).alignTo(a,b,c,d);Ext.callback(g,Ext.fly(h))},k=this.getAnchor();this.removeAnchor();Ext.apply(k,{fn:j,scroll:i});Ext.EventManager.onWindowResize(j,null);if(i)Ext.EventManager.on(window,"scroll",j,null,{buffer:!isNaN(e)?e:50});j.call(this);return this},removeAnchor:function(){var 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 this},getAnchor:function(){var a=
Ext.Element.data,b=this.dom;if(b){var c=a(b,"_anchor");c||(c=a(b,"_anchor",{}));return c}},getAlignToXY:function(a,b,c){a=Ext.get(a);if(!a||!a.dom)throw"Element.alignToXY with an element that doesn't exist";c=c||[0,0];b=(!b||b=="?"?"tl-bl?":!/-/.test(b)&&b!==""?"tl-"+b:b||"tl-bl").toLowerCase();var d,e,g,h=Ext.lib.Dom.getViewWidth()-10,i=Ext.lib.Dom.getViewHeight()-10,j,k,m,p=document,o=p.documentElement;m=p.body;p=(o.scrollLeft||m.scrollLeft||0)+5;o=(o.scrollTop||m.scrollTop||0)+5;g=false;m=j="";
g=b.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!g)throw"Element.alignTo with an invalid alignment "+b;j=g[1];m=g[2];g=!!g[3];d=this.getAnchorXY(j,true);e=a.getAnchorXY(m,false);b=e[0]-d[0]+c[0];c=e[1]-d[1]+c[1];if(g){g=this.getWidth();d=this.getHeight();a=a.getRegion();e=j.charAt(0);j=j.charAt(j.length-1);k=m.charAt(0);m=m.charAt(m.length-1);e=e=="t"&&k=="b"||e=="b"&&k=="t";m=j=="r"&&m=="l"||j=="l"&&m=="r";if(b+g>h+p)b=m?a.left-g:h+p-g;if(b<p)b=m?a.right:p;if(c+d>i+o)c=e?a.top-d:i+o-d;if(c<o)c=e?a.bottom:
o}return[b,c]},alignTo:function(a,b,c,d){return this.setXY(this.getAlignToXY(a,b,c),this.preanim&&d?this.preanim(arguments,3):false)},adjustForConstraints:function(a,b,c){return this.getConstrainToXY(b||document,false,c,a)||a},getConstrainToXY:function(){var a={top:0,left:0,bottom:0,right:0};return function(b,c,d,e){b=Ext.get(b);d=d?Ext.applyIf(d,a):a;var g,h,i=0,j=0;if(b.dom==document.body||b.dom==document){g=Ext.lib.Dom.getViewWidth();h=Ext.lib.Dom.getViewHeight()}else{g=b.dom.clientWidth;h=b.dom.clientHeight;
if(!c){j=b.getXY();i=j[0];j=j[1]}}b=b.getScroll();i+=d.left+b.left;j+=d.top+b.top;g-=d.right;h-=d.bottom;d=i+g;h=j+h;e=e||(!c?this.getXY():[this.getLeft(true),this.getTop(true)]);c=e[0];e=e[1];b=this.getConstrainOffset();g=this.dom.offsetWidth+b;b=this.dom.offsetHeight+b;var k=false;if(c+g>d){c=d-g;k=true}if(e+b>h){e=h-b;k=true}if(c<i){c=i;k=true}if(e<j){e=j;k=true}return k?[c,e]:false}}(),getConstrainOffset:function(){return 0},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(a){return this.alignTo(a||
document,"c-c")}});Ext.Element.addMethods({select:function(a,b){return Ext.Element.select(a,b,this.dom)}});
Ext.apply(Ext.Element.prototype,function(){var a=Ext.getDom,b=Ext.get,c=Ext.DomHelper;return{insertSibling:function(d,e,g){var h,i=(e||"before").toLowerCase()=="after",j;if(Ext.isArray(d)){j=this;Ext.each(d,function(k){h=Ext.fly(j,"_internal").insertSibling(k,e,g);if(i)j=h});return h}d=d||{};if(d.nodeType||d.dom){h=this.dom.parentNode.insertBefore(a(d),i?this.dom.nextSibling:this.dom);g||(h=b(h))}else h=i&&!this.dom.nextSibling?c.append(this.dom.parentNode,d,!g):c[i?"insertAfter":"insertBefore"](this.dom,
d,!g);return h}}}());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(){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(a){var b=this.dom;if(a=="auto"&&Ext.isMac&&Ext.isGecko2){b.style.overflow="hidden";(function(){b.style.overflow="auto"}).defer(1)}else b.style.overflow=a},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(a,b,c){if(typeof a=="object"){b=a.height;a=a.width}a=this.adjustWidth(a);b=this.adjustHeight(b);if(!c||!this.anim){this.dom.style.width=this.addUnits(a);this.dom.style.height=this.addUnits(b)}else this.anim({width:{to:a},height:{to:b}},this.preanim(arguments,2));return this},getComputedHeight:function(){var a=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!a){a=parseFloat(this.getStyle("height"))||
0;this.isBorderBox()||(a+=this.getFrameWidth("tb"))}return a},getComputedWidth:function(){var a=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!a){a=parseFloat(this.getStyle("width"))||0;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(a){this.hover(function(){Ext.fly(this,"_internal").addClass(a)},function(){Ext.fly(this,"_internal").removeClass(a)});return this},
addClassOnFocus:function(a){this.on("focus",function(){Ext.fly(this,"_internal").addClass(a)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(a)},this.dom);return this},addClassOnClick:function(a){var b=this.dom;this.on("mousedown",function(){Ext.fly(b,"_internal").addClass(a);var c=Ext.getDoc(),d=function(){Ext.fly(b,"_internal").removeClass(a);c.removeListener("mouseup",d)};c.on("mouseup",d)});return this},getViewSize:function(){var a=document,b=this.dom;if(b==a||b==a.body){a=
Ext.lib.Dom;return{width:a.getViewWidth(),height:a.getViewHeight()}}else return{width:b.clientWidth,height:b.clientHeight}},getStyleSize:function(){var a,b,c=document,d=this.dom,e=d.style;if(d==c||d==c.body){a=Ext.lib.Dom;return{width:a.getViewWidth(),height:a.getViewHeight()}}if(e.width&&e.width!="auto"){a=parseFloat(e.width);if(this.isBorderBox())a-=this.getFrameWidth("lr")}if(e.height&&e.height!="auto"){b=parseFloat(e.height);if(this.isBorderBox())b-=this.getFrameWidth("tb")}return{width:a||this.getWidth(true),
height:b||this.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).addClass("x-unselectable")},getMargins:function(a){var b,c={t:"top",l:"left",r:"right",b:"bottom"},d={};if(a)return this.addStyles.call(this,a,this.margins);else{for(b in this.margins)d[c[b]]=
parseFloat(this.getStyle(this.margins[b]))||0;return d}}}}());
Ext.Element.addMethods({setBox:function(a,b,c){var d=a.width,e=a.height;if(b&&!this.autoBoxAdjust&&!this.isBorderBox()){d-=this.getBorderWidth("lr")+this.getPadding("lr");e-=this.getBorderWidth("tb")+this.getPadding("tb")}this.setBounds(a.x,a.y,d,e,this.animTest.call(this,arguments,c,2));return this},getBox:function(a,b){var c,d,e=this.getBorderWidth,g=this.getPadding,h,i,j;if(b){c=parseInt(this.getStyle("left"),10)||0;d=parseInt(this.getStyle("top"),10)||0;c=[c,d]}else c=this.getXY();h=this.dom;
d=h.offsetWidth;var k=h.offsetHeight;if(a){h=e.call(this,"l")+g.call(this,"l");i=e.call(this,"r")+g.call(this,"r");j=e.call(this,"t")+g.call(this,"t");e=e.call(this,"b")+g.call(this,"b");e={x:c[0]+h,y:c[1]+j,0:c[0]+h,1:c[1]+j,width:d-(h+i),height:k-(j+e)}}else e={x:c[0],y:c[1],0:c[0],1:c[1],width:d,height:k};e.right=e.x+e.width;e.bottom=e.y+e.height;return e},move:function(a,b,c){var d=this.getXY(),e=d[0],g=d[1];d=[e-b,g];var h=[e+b,g],i=[e,g-b];e=[e,g+b];e={l:d,left:d,r:h,right:h,t:i,top:i,up:i,
b:e,bottom:e,down:e};a=a.toLowerCase();this.moveTo(e[a][0],e[a][1],this.animTest.call(this,arguments,c,2))},setLeftTop:function(a,b){var c=this.dom.style;c.left=this.addUnits(a);c.top=this.addUnits(b);return this},getRegion:function(){return Ext.lib.Dom.getRegion(this.dom)},setBounds:function(a,b,c,d,e){if(!e||!this.anim){this.setSize(c,d);this.setLocation(a,b)}else this.anim({points:{to:[a,b]},width:{to:this.adjustWidth(c)},height:{to:this.adjustHeight(d)}},this.preanim(arguments,4),"motion");return this},
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({scrollTo:function(a,b,c){var d=/top/i.test(a),e=this.dom,g;if(!c||!this.anim){g="scroll"+(d?"Top":"Left");e[g]=b}else{g="scroll"+(d?"Left":"Top");this.anim({scroll:{to:d?[e[g],b]:[b,e[g]]}},this.preanim(arguments,2),"scroll")}return this},scrollIntoView:function(a,b){var c=Ext.getDom(a)||Ext.getBody().dom,d=this.dom,e=this.getOffsetsTo(c),g=e[0]+c.scrollLeft;e=e[1]+c.scrollTop;var h=e+d.offsetHeight,i=g+d.offsetWidth,j=c.clientHeight,k=parseInt(c.scrollTop,10),m=parseInt(c.scrollLeft,
10),p=k+j,o=m+c.clientWidth;if(d.offsetHeight>j||e<k)c.scrollTop=e;else if(h>p)c.scrollTop=h-j;c.scrollTop=c.scrollTop;if(b!==false){if(d.offsetWidth>c.clientWidth||g<m)c.scrollLeft=g;else if(i>o)c.scrollLeft=i-c.clientWidth;c.scrollLeft=c.scrollLeft}return this},scrollChildIntoView:function(a,b){Ext.fly(a,"_scrollChildIntoView").scrollIntoView(this,b)},scroll:function(a,b){if(!this.isScrollable())return false;var c=this.dom,d=c.scrollLeft,e=c.scrollTop,g=false;c={l:Math.min(d+b,c.scrollWidth-c.clientWidth),
r:Math.max(d-b,0),t:Math.max(e-b,0),b:Math.min(e+b,c.scrollHeight-c.clientHeight)};c.d=c.b;c.u=c.t;a=a.substr(0,1);if((c=c[a])>-1){g=true;this.scrollTo(a=="l"||a=="r"?"left":"top",c,this.preanim(arguments,2))}return g}});
Ext.Element.addMethods(function(){var a=Ext.Element.data;return{isVisible:function(b){var c=!this.isStyle("visibility","hidden")&&!this.isStyle("display","none"),d=this.dom.parentNode;if(b!==true||!c)return c;for(;d&&!/^body/i.test(d.tagName);){if(!Ext.fly(d,"_isVisible").isVisible())return false;d=d.parentNode}return true},isDisplayed:function(){return!this.isStyle("display","none")},enableDisplayMode:function(b){this.setVisibilityMode(Ext.Element.DISPLAY);Ext.isEmpty(b)||a(this.dom,"originalDisplay",
b);return this},mask:function(b,c){var d=this.dom,e=Ext.DomHelper,g;!/^body/i.test(d.tagName)&&this.getStyle("position")=="static"&&this.addClass("x-masked-relative");if(g=a(d,"maskMsg"))g.remove();if(g=a(d,"mask"))g.remove();g=e.append(d,{cls:"ext-el-mask"},true);a(d,"mask",g);this.addClass("x-masked");g.setDisplayed(true);if(typeof b=="string"){e=e.append(d,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true);a(d,"maskMsg",e);e.dom.className=c?"ext-el-mask-msg "+c:"ext-el-mask-msg";e.dom.firstChild.innerHTML=
b;e.setDisplayed(true);e.center(this)}Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"&&g.setSize(undefined,this.getHeight());return g},unmask:function(){var b=this.dom,c=a(b,"mask"),d=a(b,"maskMsg");if(c){if(d){d.remove();a(b,"maskMsg",undefined)}c.remove();a(b,"mask",undefined);this.removeClass(["x-masked","x-masked-relative"])}},isMasked:function(){var b=a(this.dom,"mask");return b&&b.isVisible()},createShim:function(){var b=document.createElement("iframe");b.frameBorder="0";
b.className="ext-shim";b.src=Ext.SSL_SECURE_URL;b=Ext.get(this.dom.parentNode.insertBefore(b,this.dom));b.autoBoxAdjust=false;return b}}}());Ext.Element.addMethods({addKeyListener:function(a,b,c){a=typeof a!="object"||Ext.isArray(a)?{key:a,fn:b,scope:c}:{key:a.key,shift:a.shift,ctrl:a.ctrl,alt:a.alt,fn:b,scope:c};return new Ext.KeyMap(this,a)},addKeyMap:function(a){return new Ext.KeyMap(this,a)}});Ext.CompositeElementLite.importElementMethods();
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(d){c.push(Ext.get(d))});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(a,b){var c=this,d=this.elements,e;Ext.each(a,function(g){if(e=d[g]||d[g=c.indexOf(g)]){if(b)e.dom?e.remove():Ext.removeNode(e);
d.splice(g,1)}});return this}});Ext.CompositeElement=Ext.extend(Ext.CompositeElementLite,{constructor:function(a,b){this.elements=[];this.add(a,b)},getElement:function(a){return a},transformElement:function(a){return Ext.get(a)}});Ext.Element.select=function(a,b,c){if(typeof a=="string")a=Ext.Element.selectorFunction(a,c);else if(a.length!==undefined)a=a;else throw"Invalid selector";return b===true?new Ext.CompositeElement(a):new Ext.CompositeElementLite(a)};Ext.select=Ext.Element.select;
Ext.UpdateManager=Ext.Updater=Ext.extend(Ext.util.Observable,function(){function a(g){this.transaction=null;if(g.argument.form&&g.argument.reset)try{g.argument.form.reset()}catch(h){}if(this.loadScripts)this.renderer.render(this.el,g,this,b.createDelegate(this,[g]));else{this.renderer.render(this.el,g,this);b.call(this,g)}}function b(g,h,i){this.fireEvent(h||d,this.el,g);if(Ext.isFunction(g.argument.callback))g.argument.callback.call(g.argument.scope,this.el,Ext.isEmpty(i)?true:false,g,g.argument.options)}
function c(g){b.call(this,g,e,!!(this.transaction=null))}var d="update",e="failure";return{constructor:function(g,h){g=Ext.get(g);if(!h&&g.updateManager)return g.updateManager;this.el=g;this.defaultUrl=null;this.addEvents("beforeupdate",d,e);Ext.apply(this,Ext.Updater.defaults);this.transaction=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=(this.formUpdate||function(){}).createDelegate(this);this.renderer=this.renderer||
this.getDefaultRenderer();Ext.Updater.superclass.constructor.call(this)},setRenderer:function(g){this.renderer=g},getRenderer:function(){return this.renderer},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer},setDefaultUrl:function(g){this.defaultUrl=g},getEl:function(){return this.el},update:function(g,h,i,j){var k,m;if(this.fireEvent("beforeupdate",this.el,g,h)!==false){if(Ext.isObject(g)){k=g;g=k.url;h=h||k.params;i=i||k.callback;j=j||k.discardUrl;m=k.scope;if(!Ext.isEmpty(k.nocache))this.disableCaching=
k.nocache;if(!Ext.isEmpty(k.text))this.indicatorText='<div class="loading-indicator">'+k.text+"</div>";if(!Ext.isEmpty(k.scripts))this.loadScripts=k.scripts;if(!Ext.isEmpty(k.timeout))this.timeout=k.timeout}this.showLoading();if(!j)this.defaultUrl=g;if(Ext.isFunction(g))g=g.call(this);g=Ext.apply({},{url:g,params:Ext.isFunction(h)&&m?h.createDelegate(m):h,success:a,failure:c,scope:this,callback:undefined,timeout:this.timeout*1E3,disableCaching:this.disableCaching,argument:{options:k,url:g,form:null,
callback:i,scope:m||window,params:h}},k);this.transaction=Ext.Ajax.request(g)}},formUpdate:function(g,h,i,j){if(this.fireEvent("beforeupdate",this.el,g,h)!==false){if(Ext.isFunction(h))h=h.call(this);g=Ext.getDom(g);this.transaction=Ext.Ajax.request({form:g,url:h,success:a,failure:c,scope:this,timeout:this.timeout*1E3,argument:{url:h,form:g,callback:j,reset:i}});this.showLoading.defer(1,this)}},startAutoRefresh:function(g,h,i,j,k){if(k)this.update(h||this.defaultUrl,i,j,true);this.autoRefreshProcId&&
clearInterval(this.autoRefreshProcId);this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[h||this.defaultUrl,i,j,true]),g*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(g){this.defaultUrl&&this.update(this.defaultUrl,null,g,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(a,b,c,d){a=Ext.get(a).getUpdater();Ext.apply(a,d);a.update(b,c,d?d.callback:null)};Ext.Updater.BasicRenderer=function(){};
Ext.Updater.BasicRenderer.prototype={render:function(a,b,c,d){a.update(b.responseText,c.loadScripts,d)}};
(function(){function a(c){var d=Array.prototype.slice.call(arguments,1);return c.replace(/\{(\d+)\}/g,function(e,g){return d[g]})}Date.useStrict=false;Date.formatCodeToRegex=function(c,d){var e=Date.parseCodes[c];if(e){e=typeof e=="function"?e():e;Date.parseCodes[c]=e}return e?Ext.applyIf({c:e.c?a(e.c,d||"{0}"):e.c},e):{g:0,c:null,s:Ext.escapeRe(c)}};var b=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{M$:function(c){return(c=(c||"").match(/\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\//))?new Date(((c[1]||
"")+c[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(c){return Date.monthNames[c].substring(0,
3)},getShortDayName:function(c){return Date.dayNames[c].substring(0,3)},getMonthNumber:function(c){return Date.monthNumbers[c.substring(0,1).toUpperCase()+c.substring(1,3).toLowerCase()]},formatContainsHourInfo:function(){var c=/(\\.)/g,d=/([gGhHisucUOPZ]|M\$)/;return function(e){return d.test(e.replace(c,""))}}(),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:"String.leftPad(this.getFullYear(), 4, '0')",
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=[],d=0;d<12;++d){var e="Y-m-dTH:i:sP".charAt(d);c.push(e=="T"?"'T'":Date.getFormatCode(e))}return c.join(" + ")},U:"Math.round(this.getTime() / 1000)"},isValid:function(c,d,e,g,h,i,j){g=g||0;h=h||0;i=i||0;j=j||0;var k=(new Date(c<100?100:c,d-1,e,g,h,i,j)).add(Date.YEAR,c<100?c-100:0);return c==k.getFullYear()&&d==k.getMonth()+1&&e==k.getDate()&&g==k.getHours()&&h==k.getMinutes()&&i==k.getSeconds()&&j==k.getMilliseconds()},
parseDate:function(c,d,e){var g=Date.parseFunctions;g[d]==null&&Date.createParser(d);return g[d](c,Ext.isDefined(e)?e:Date.useStrict)},getFormatCode:function(c){var d=Date.formatCodes[c];if(d){d=typeof d=="function"?d():d;Date.formatCodes[c]=d}return d||"'"+String.escape(c)+"'"},createFormat:function(c){for(var d=[],e=false,g="",h=0;h<c.length;++h){g=c.charAt(h);if(!e&&g=="\\")e=true;else if(e){e=false;d.push("'"+String.escape(g)+"'")}else d.push(Date.getFormatCode(g))}Date.formatFunctions[c]=new Function("return "+
d.join("+"))},createParser:function(){return function(c){for(var d=Date.parseRegexes.length,e=1,g=[],h=[],i=false,j="",k=0,m;k<c.length;++k){j=c.charAt(k);if(!i&&j=="\\")i=true;else if(i){i=false;h.push(String.escape(j))}else{j=b(j,e);e+=j.g;h.push(j.s);if(j.g&&j.c)if(j.calcLast)m=j.c;else g.push(j.c)}}m&&g.push(m);Date.parseRegexes[d]=RegExp("^"+h.join("")+"$","i");Date.parseFunctions[c]=new Function("input","strict",a("var dt, y, m, d, h, i, s, ms, o, z, zz, u, v,\ndef = Date.defaults,\nresults = String(input).match(Date.parseRegexes[{0}]);\nif(results){\n{1}\nif(u != null){\nv = new Date(u * 1000);\n}else{\ndt = (new Date()).clearTime();\ny = Ext.num(y, Ext.num(def.y, dt.getFullYear()));\nm = Ext.num(m, Ext.num(def.m - 1, dt.getMonth()));\nd = Ext.num(d, Ext.num(def.d, dt.getDate()));\nh  = Ext.num(h, Ext.num(def.h, dt.getHours()));\ni  = Ext.num(i, Ext.num(def.i, dt.getMinutes()));\ns  = Ext.num(s, Ext.num(def.s, dt.getSeconds()));\nms = Ext.num(ms, Ext.num(def.ms, dt.getMilliseconds()));\nif(z >= 0 && y >= 0){\nv = new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);\nv = !strict? v : (strict === true && (z <= 364 || (v.isLeapYear() && z <= 365))? v.add(Date.DAY, z) : null);\n}else if(strict === true && !Date.isValid(y, m + 1, d, h, i, s, ms)){\nv = null;\n}else{\nv = new Date(y < 100 ? 100 : y, m, d, h, i, s, ms).add(Date.YEAR, y < 100 ? y - 100 : 0);\n}\n}\n}\nif(v){\nif(zz != null){\nv = v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - zz);\n}else if(o){\nv = v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));\n}\n}\nreturn v;",
d,g.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 c=[],d=0;d<7;c.push(Date.getShortDayName(d)),++d);return{g:0,c:null,s:"(?:"+c.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=[],d=0;d<12;c.push(Date.getShortMonthName(d)),++d);return Ext.applyIf({s:"("+c.join("|")+")"},b("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 b("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:function(){return b("A")},A:{calcLast:true,g:1,c:"if (/(am)/i.test(results[{0}])) {\nif (!h || h == 12) { h = 0; }\n} else { if (!h || h < 12) { h = (h || 0) + 12; }}",s:"(AM|PM|am|pm)"},g:function(){return b("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return b("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}];\nvar sn = o.substring(0,1),\nhr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),\nmn = o.substring(3,5) % 60;\no = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n",s:"([+-]\\d{4})"},P:{g:1,c:"o = results[{0}];\nvar sn = o.substring(0,1),\nhr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),\nmn = o.substring(4,6) % 60;\no = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\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 c=[],d=[b("Y",1),b("m",2),b("d",3),b("h",4),b("i",5),b("s",6),{c:"ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[8]) {\nif(results[8] == 'Z'){\nzz = 0;\n}else if (results[8].indexOf(':') > -1){",b("P",8).c,"}else{",b("O",8).c,"}\n}"].join("\n")}],e=0,g=d.length;e<g;++e)c.push(d[e].c);
return{g:1,c:c.join(""),s:[d[0].s,"(?:-",d[1].s,"(?:-",d[2].s,"(?:(?:T| )?",d[3].s,":",d[4].s,"(?::",d[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 a=0,b=this.clone(),c=this.getMonth(),d;d=0;b.setDate(1);for(b.setMonth(0);d<c;b.setMonth(++d))a+=b.getDaysInMonth();return a+this.getDate()-1},getWeekOfYear:function(){return function(){var a=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/864E5;a=Math.floor(a/7);var b=(new Date(a*6048E5)).getUTCFullYear();return a-Math.floor(Date.UTC(b,0,7)/6048E5)+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(a){if(a)return this.clone().clearTime();a=this.getDate();this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);if(this.getDate()!=a){for(var b=1,c=this.add(Date.HOUR,b);c.getDate()!=a;b++,c=this.add(Date.HOUR,b));this.setDate(a);
this.setHours(c.getHours())}return this},add:function(a,b){var c=this.clone();if(!a||b===0)return c;switch(a.toLowerCase()){case Date.MILLI:c.setMilliseconds(this.getMilliseconds()+b);break;case Date.SECOND:c.setSeconds(this.getSeconds()+b);break;case Date.MINUTE:c.setMinutes(this.getMinutes()+b);break;case Date.HOUR:c.setHours(this.getHours()+b);break;case Date.DAY:c.setDate(this.getDate()+b);break;case Date.MONTH:var d=this.getDate();if(d>28)d=Math.min(d,this.getFirstDateOfMonth().add("mo",b).getLastDateOfMonth().getDate());
c.setDate(d);c.setMonth(this.getMonth()+b);break;case Date.YEAR:c.setFullYear(this.getFullYear()+b)}return c},between:function(a,b){var c=this.getTime();return a.getTime()<=c&&c<=b.getTime()}});Date.prototype.format=Date.prototype.dateFormat;
if(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);a=Math.ceil(b/12);b=b%12?12-b%12:0;this.setFullYear(this.getFullYear()-a);return this._xMonth(b)}else return this._xMonth(a)},setDate:function(a){return this.setTime(this.getTime()-(this.getDate()-a)*864E5)}});
Ext.util.MixedCollection=function(a,b){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=a===true;if(b)this.getKey=b;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){if(typeof this.map[a]!="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);this.items[this.indexOfKey(a)]=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 b=arguments.length>1?arguments:a,c=0,d=b.length;c<d;c++)this.add(b[c]);else for(b in a)if(this.allowFunctions||typeof a[b]!="function")this.add(b,a[b])},each:function(a,b){for(var c=[].concat(this.items),d=0,e=c.length;d<e;d++)if(a.call(b||c[d],c[d],d,e)===false)break},eachKey:function(a,
b){for(var c=0,d=this.keys.length;c<d;c++)a.call(b||window,this.keys[c],this.items[c],c,d)},find:function(a,b){for(var c=0,d=this.items.length;c<d;c++)if(a.call(b||window,this.items[c],this.keys[c]))return this.items[c];return null},insert:function(a,b,c){if(arguments.length==2){c=arguments[1];b=this.getKey(c)}if(this.containsKey(b)){this.suspendEvents();this.removeKey(b);this.resumeEvents()}if(a>=this.length)return this.add(b,c);this.length++;this.items.splice(a,0,c);if(typeof b!="undefined"&&b!==
null)this.map[b]=c;this.keys.splice(a,0,b);this.fireEvent("add",a,c,b);return c},remove:function(a){return this.removeAt(this.indexOf(a))},removeAt:function(a){if(a<this.length&&a>=0){this.length--;var b=this.items[a];this.items.splice(a,1);var c=this.keys[a];typeof c!="undefined"&&delete this.map[c];this.keys.splice(a,1);this.fireEvent("remove",b,c);return b}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 b=this.map[a];a=b!==undefined?b:typeof a=="number"?this.items[a]:undefined;return typeof a!="function"||this.allowFunctions?a: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(a,b,c){var d,e=String(b).toUpperCase()=="DESC"?-1:1,g=[],h=this.keys,i=this.items;c=c||function(j,k){return j-k};b=0;for(d=i.length;b<d;b++)g[g.length]={key:h[b],value:i[b],index:b};g.sort(function(j,k){var m=c(j[a],k[a])*e;if(m===0)m=j.index<k.index?-1:1;return m});b=0;for(d=g.length;b<d;b++){i[b]=g[b].value;h[b]=g[b].key}this.fireEvent("sort",this)},sort:function(a,b){this._sort("value",a,b)},reorder:function(a){this.suspendEvents();
var b=this.items,c=0,d=b.length,e=[],g=[],h;for(h in a)e[a[h]]=b[h];for(c=0;c<d;c++)a[c]==undefined&&g.push(b[c]);for(c=0;c<d;c++)if(e[c]==undefined)e[c]=g.shift();this.clear();this.addAll(e);this.resumeEvents();this.fireEvent("sort",this)},keySort:function(a,b){this._sort("key",a,b||function(c,d){var e=String(c).toUpperCase(),g=String(d).toUpperCase();return e>g?1:e<g?-1:0})},getRange:function(a,b){var c=this.items;if(c.length<1)return[];a=a||0;b=Math.min(typeof b=="undefined"?this.length-1:b,this.length-
1);var d,e=[];if(a<=b)for(d=a;d<=b;d++)e[e.length]=c[d];else for(d=a;d>=b;d--)e[e.length]=c[d];return e},filter:function(a,b,c,d){if(Ext.isEmpty(b,false))return this.clone();b=this.createValueMatcher(b,c,d);return this.filterBy(function(e){return e&&b.test(e[a])})},filterBy:function(a,b){var c=new Ext.util.MixedCollection;c.getKey=this.getKey;for(var d=this.keys,e=this.items,g=0,h=e.length;g<h;g++)if(a.call(b||this,e[g],d[g]))c.add(d[g],e[g]);return c},findIndex:function(a,b,c,d,e){if(Ext.isEmpty(b,
false))return-1;b=this.createValueMatcher(b,d,e);return this.findIndexBy(function(g){return g&&b.test(g[a])},null,c)},findIndexBy:function(a,b,c){var d=this.keys,e=this.items;c=c||0;for(var g=e.length;c<g;c++)if(a.call(b||this,e[c],d[c]))return c;return-1},createValueMatcher:function(a,b,c,d){if(!a.exec){var e=Ext.escapeRe;a=String(a);if(b===true)a=e(a);else{a="^"+e(a);if(d===true)a+="$"}a=RegExp(a,c?"":"i")}return a},clone:function(){for(var a=new Ext.util.MixedCollection,b=this.keys,c=this.items,
d=0,e=c.length;d<e;d++)a.add(b[d],c[d]);a.getKey=this.getKey;return a}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;
Ext.AbstractManager=Ext.extend(Object,{typeName:"type",constructor:function(a){Ext.apply(this,a||{});this.all=new Ext.util.MixedCollection;this.types={}},get:function(a){return this.all.get(a)},register:function(a){this.all.add(a)},unregister:function(a){this.all.remove(a)},registerType:function(a,b){this.types[a]=b;b[this.typeName]=a},isRegistered:function(a){return this.types[a]!==undefined},create:function(a,b){var c=a[this.typeName]||a.type||b,d=this.types[c];if(d==undefined)throw Error(String.format("The '{0}' type has not been registered with this manager",
c));return new d(a)},onAvailable:function(a,b,c){var d=this.all;d.on("add",function(e,g){if(g.id==a){b.call(c||g,g);d.un("add",b,c)}})}});
Ext.util.Format=function(){var a=/^\s+|\s+$/g,b=/<\/?[^>]+>/gi,c=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,d=/\r?\n/g;return{ellipsis:function(e,g,h){if(e&&e.length>g)if(h){h=e.substr(0,g-2);var i=Math.max(h.lastIndexOf(" "),h.lastIndexOf("."),h.lastIndexOf("!"),h.lastIndexOf("?"));return i==-1||i<g-15?e.substr(0,g-3)+"...":h.substr(0,i)+"..."}else return e.substr(0,g-3)+"...";return e},undef:function(e){return e!==undefined?e:""},defaultValue:function(e,g){if(!g&&g!==0)g="";return e!==undefined&&
e!==""?e:g},htmlEncode:function(e){return!e?e:String(e).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(e){return!e?e:String(e).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(e){return String(e).replace(a,"")},substr:function(e,g,h){return String(e).substr(g,h)},lowercase:function(e){return String(e).toLowerCase()},uppercase:function(e){return String(e).toUpperCase()},capitalize:function(e){return!e?
e:e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()},call:function(e,g){if(arguments.length>2){var h=Array.prototype.slice.call(arguments,2);h.unshift(e);return eval(g).apply(window,h)}else return eval(g).call(window,e)},usMoney:function(e){e=Math.round((e-0)*100)/100;e=e==Math.floor(e)?e+".00":e*10==Math.floor(e*10)?e+"0":e;e=String(e);var g=e.split(".");e=g[0];g=g[1]?"."+g[1]:".00";for(var h=/(\d+)(\d{3})/;h.test(e);)e=e.replace(h,"$1,$2");e=e+g;if(e.charAt(0)=="-")return"-$"+e.substr(1);return"$"+
e},date:function(e,g){if(!e)return"";Ext.isDate(e)||(e=new Date(Date.parse(e)));return e.dateFormat(g||"m/d/Y")},dateRenderer:function(e){return function(g){return Ext.util.Format.date(g,e)}},stripTags:function(e){return!e?e:String(e).replace(b,"")},stripScripts:function(e){return!e?e:String(e).replace(c,"")},fileSize:function(e){return e<1024?e+" bytes":e<1048576?Math.round(e*10/1024)/10+" KB":Math.round(e*10/1048576)/10+" MB"},math:function(){var e={};return function(g,h){e[h]||(e[h]=new Function("v",
"return v "+h+";"));return e[h](g)}}(),round:function(e,g){var h=Number(e);if(typeof g=="number"){g=Math.pow(10,g);h=Math.round(e*g)/g}return h},number:function(e,g){if(!g)return e;e=Ext.num(e,NaN);if(isNaN(e))return"";var h=",",i=".",j=false,k=e<0;e=Math.abs(e);if(g.substr(g.length-2)=="/i"){g=g.substr(0,g.length-2);j=true;h=".";i=","}var m=g.indexOf(h)!=-1;j=(j?g.replace(/[^\d\,]/g,""):g.replace(/[^\d\.]/g,"")).split(i);if(1<j.length)e=e.toFixed(j[1].length);else if(2<j.length)throw"NumberFormatException: invalid format, formats should have no more than 1 period: "+
g;else e=e.toFixed(0);var p=e.toString();j=p.split(".");if(m){m=j[0];p=[];var o=m.length,s=Math.floor(o/3),l=m.length%3||3,n;for(n=0;n<o;n+=l){if(n!=0)l=3;p[p.length]=m.substr(n,l);s-=1}p=p.join(h);if(j[1])p+=i+j[1]}else if(j[1])p=j[0]+i+j[1];return(k?"-":"")+g.replace(/[\d,?\.?]+/,p)},numberRenderer:function(e){return function(g){return Ext.util.Format.number(g,e)}},plural:function(e,g,h){return e+" "+(e==1?g:h?h:g+"s")},nl2br:function(e){return Ext.isEmpty(e)?"":e.replace(d,"<br/>")}}}();
Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var a=this.html,b=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/,c=/^<tpl\b[^>]*?for="(.*?)"/,d=/^<tpl\b[^>]*?if="(.*?)"/,e=/^<tpl\b[^>]*?exec="(.*?)"/,g,h=0,i=[];for(a=["<tpl>",a,"</tpl>"].join("");g=a.match(b);){var j=g[0].match(c),k=g[0].match(d),m=g[0].match(e),p=null,o=null,s=null;j=j&&j[1]?j[1]:"";if(k)if(p=k&&k[1]?k[1]:null)o=new Function("values","parent","xindex","xcount","with(values){ return "+
Ext.util.Format.htmlDecode(p)+"; }");if(m)if(p=m&&m[1]?m[1]:null)s=new Function("values","parent","xindex","xcount","with(values){ "+Ext.util.Format.htmlDecode(p)+"; }");if(j)switch(j){case ".":j=new Function("values","parent","with(values){ return values; }");break;case "..":j=new Function("values","parent","with(values){ return parent; }");break;default:j=new Function("values","parent","with(values){ return "+j+"; }")}i.push({id:h,target:j,exec:s,test:o,body:g[1]||""});a=a.replace(g[0],"{xtpl"+
h+"}");++h}for(a=i.length-1;a>=0;--a)this.compileTpl(i[a]);this.master=i[i.length-1];this.tpls=i};
Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w\-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(a,b,c,d,e){a=this.tpls[a];var g,h=[];if(a.test&&!a.test.call(this,b,c,d,e)||a.exec&&a.exec.call(this,b,c,d,e))return"";g=a.target?a.target.call(this,b,c):b;c=a.target?b:c;if(a.target&&Ext.isArray(g)){d=0;for(b=g.length;d<b;d++)h[h.length]=a.compiled.call(this,g[d],c,d+1,b);return h.join("")}return a.compiled.call(this,
g,c,d,e)},compileTpl:function(a){function b(h,i,j,k,m){if(i.substr(0,4)=="xtpl")return"'"+e+"this.applySubTemplate("+i.substr(4)+", values, parent, xindex, xcount)"+e+"'";h=i==="."?"values":i==="#"?"xindex":i.indexOf(".")!=-1?i:"values['"+i+"']";if(m)h="("+h+m+")";if(j&&d){k=k?","+k:"";if(j.substr(0,5)!="this.")j="fm."+j+"(";else{j='this.call("'+j.substr(5)+'", ';k=", values"}}else{k="";j="("+h+" === undefined ? '' : "}return"'"+e+j+h+k+")"+e+"'"}function c(h,i){return"'"+e+"("+i.replace(/\\'/g,"'")+
")"+e+"'"}var d=this.disableFormats!==true,e=Ext.isGecko?"+":",",g;if(Ext.isGecko)g="tpl.compiled = function(values, parent, xindex, xcount){ return '"+a.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,b).replace(this.codeRe,c)+"';};";else{g=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];g.push(a.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,b).replace(this.codeRe,c));g.push("'].join('');};");g=g.join("")}eval(g);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 a=null,b=document,c=/(-[a-z])/gi,d=function(e,g){return g.charAt(1).toUpperCase()};return{createStyleSheet:function(e,g){var h;h=b.getElementsByTagName("head")[0];var i=b.createElement("style");i.setAttribute("type","text/css");g&&i.setAttribute("id",g);if(Ext.isIE){h.appendChild(i);h=i.styleSheet;h.cssText=e}else{try{i.appendChild(b.createTextNode(e))}catch(j){i.cssText=e}h.appendChild(i);h=i.styleSheet?i.styleSheet:i.sheet||b.styleSheets[b.styleSheets.length-1]}this.cacheStyleSheet(h);
return h},removeStyleSheet:function(e){(e=b.getElementById(e))&&e.parentNode.removeChild(e)},swapStyleSheet:function(e,g){this.removeStyleSheet(e);var h=b.createElement("link");h.setAttribute("rel","stylesheet");h.setAttribute("type","text/css");h.setAttribute("id",e);h.setAttribute("href",g);b.getElementsByTagName("head")[0].appendChild(h)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(e){a||(a={});try{for(var g=e.cssRules||e.rules,h=g.length-1;h>=0;--h)a[g[h].selectorText.toLowerCase()]=
g[h]}catch(i){}},getRules:function(e){if(a===null||e){a={};e=b.styleSheets;for(var g=0,h=e.length;g<h;g++)try{this.cacheStyleSheet(e[g])}catch(i){}}return a},getRule:function(e,g){var h=this.getRules(g);if(!Ext.isArray(e))return h[e.toLowerCase()];for(var i=0;i<e.length;i++)if(h[e[i]])return h[e[i].toLowerCase()];return null},updateRule:function(e,g,h){if(Ext.isArray(e))for(var i=0;i<e.length;i++){if(this.updateRule(e[i],g,h))return true}else if(e=this.getRule(e)){e.style[g.replace(c,d)]=h;return true}return false}}}();
Ext.util.ClickRepeater=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.el=Ext.get(a);this.el.unselectable();Ext.apply(this,b);this.addEvents("mousedown","click","mouseup");if(!this.disabled){this.disabled=true;this.enable()}if(this.handler)this.on("click",this.handler,this.scope||this);Ext.util.ClickRepeater.superclass.constructor.call(this)},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);if(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(a){clearTimeout(this.timer);this.el.blur();this.fireEvent("mousedown",this,a);this.fireEvent("click",this,a)},handleMouseDown:function(a){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,a);this.fireEvent("click",this,a);if(this.accelerate)this.delay=400;this.timer=this.click.defer(this.delay||this.interval,this,[a])},click:function(a){this.fireEvent("click",this,a);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12E3):this.interval,this,[a])},easeOutExpo:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},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(a){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,a)}});
Ext.KeyNav=function(a,b){this.el=Ext.get(a);Ext.apply(this,b);if(!this.disabled){this.disabled=true;this.enable()}};
Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,relay:function(a){var b=this.keyToHandler[a.getKey()];b&&this[b]&&this.doRelay(a,this[b],b)!==true&&a[this.defaultEventAction]()},doRelay:function(a,b,c){return b.call(this.scope||this,a,c)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,space: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",32:"space"},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(a,b,c){this.el=Ext.get(a);this.eventName=c||"keydown";this.bindings=[];b&&this.addBinding(b);this.enable()};
Ext.KeyMap.prototype={stopEvent:false,addBinding:function(a){if(Ext.isArray(a))Ext.each(a,function(k){this.addBinding(k)},this);else{var b=a.key,c=a.fn||a.handler,d=a.scope;if(a.stopEvent)this.stopEvent=a.stopEvent;if(typeof b=="string"){for(var e=[],g=b.toUpperCase(),h=0,i=g.length;h<i;h++)e.push(g.charCodeAt(h));b=e}var j=Ext.isArray(b);this.bindings.push(function(k){if(this.checkModifiers(a,k)){var m=k.getKey();if(j)for(var p=0,o=b.length;p<o;p++){if(b[p]==m){this.stopEvent&&k.stopEvent();c.call(d||
window,m,k);break}}else if(m==b){this.stopEvent&&k.stopEvent();c.call(d||window,m,k)}}})}},checkModifiers:function(a,b){for(var c,d,e=["shift","ctrl","alt"],g=0,h=e.length;g<h;++g){d=e[g];c=a[d];if(!(c===undefined||c===b[d+"Key"]))return false}return true},on:function(a,b,c){var d,e,g,h;if(typeof a=="object"&&!Ext.isArray(a)){d=a.key;e=a.shift;g=a.ctrl;h=a.alt}else d=a;this.addBinding({key:d,shift:e,ctrl:g,alt:h,fn:b,scope:c})},handleKeyDown:function(a){if(this.enabled)for(var b=this.bindings,c=0,
d=b.length;c<d;c++)b[c].call(this,a)},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(b,c,d){a||(a=Ext.util.TextMetrics.Instance(b,d));a.bind(b);a.setFixedWidth(d||"auto");return a.getSize(c)},createInstance:function(b,c){return Ext.util.TextMetrics.Instance(b,c)}}}();
Ext.util.TextMetrics.Instance=function(a,b){var c=new Ext.Element(document.createElement("div"));document.body.appendChild(c.dom);c.position("absolute");c.setLeftTop(-1E3,-1E3);c.hide();b&&c.setWidth(b);var d={getSize:function(e){c.update(e);e=c.getSize();c.update("");return e},bind:function(e){c.setStyle(Ext.fly(e).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(e){c.setWidth(e)},getWidth:function(e){c.dom.style.width=
"auto";return this.getSize(e).width},getHeight:function(e){return this.getSize(e).height}};d.bind(a);return d};Ext.Element.addMethods({getTextWidth:function(a,b,c){return Ext.util.TextMetrics.measure(this.dom,Ext.value(a,this.dom.innerHTML,true)).width.constrain(b||0,c||1E6)}});
Ext.util.Cookies={set:function(a,b){var c=arguments,d=arguments.length,e=d>2?c[2]:null,g=d>3?c[3]:"/",h=d>4?c[4]:null;c=d>5?c[5]:false;document.cookie=a+"="+escape(b)+(e===null?"":"; expires="+e.toGMTString())+(g===null?"":"; path="+g)+(h===null?"":"; domain="+h)+(c===true?"; secure":"")},get:function(a){a=a+"=";for(var b=a.length,c=document.cookie.length,d=0,e=0;d<c;){e=d+b;if(document.cookie.substring(d,e)==a)return Ext.util.Cookies.getCookieVal(e);d=document.cookie.indexOf(" ",d)+1;if(d===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(a){var b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;return unescape(document.cookie.substring(a,b))}};Ext.handleError=function(a){throw a;};Ext.Error=function(a){this.message=this.lang[a]?this.lang[a]:a};Ext.Error.prototype=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,b={},c={};return{register:function(d){a.add(d)},unregister:function(d){a.remove(d)},get:function(d){return a.get(d)},onAvailable:function(d,e,g){a.on("add",function(h,i){if(i.id==d){e.call(g||i,i);a.un("add",e,g)}})},all:a,types:b,ptypes:c,isRegistered:function(d){return b[d]!==undefined},isPluginRegistered:function(d){return c[d]!==undefined},registerType:function(d,e){b[d]=e;e.xtype=d},create:function(d,e){return d.render?d:new b[d.xtype||
e](d)},registerPlugin:function(d,e){c[d]=e;e.ptype=d},createPlugin:function(d,e){var g=c[d.ptype||e];return g.init?g:new g(d)}}}();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)){a=0;for(var b=this.plugins.length;a<b;a++)this.plugins[a]=this.initPlugin(this.plugins[a])}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(a,b){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!a&&this.el){this.el=Ext.get(this.el);a=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(a);this.ctCls&&this.container.addClass(this.ctCls);this.rendered=true;if(b!==undefined)b=Ext.isNumber(b)?this.container.dom.childNodes[b]:Ext.getDom(b);this.onRender(this.container,
b||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 c=this.getContentTarget();if(this.html){c.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"]);c.appendChild(d)}if(this.tpl){if(!this.tpl.compile)this.tpl=
new Ext.XTemplate(this.tpl);if(this.data){this.tpl[this.tplWriteMode](c,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,b,c){var d=this.getContentTarget();if(this.tpl&&typeof a!=="string")this.tpl[this.tplWriteMode](d,a||{});else{a=Ext.isObject(a)?Ext.DomHelper.markup(a):a;d.update(a,b,c)}},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){for(var a=this.ref.split("/"),b=a.length,c=0,d=this;d&&c<b;){d=d.ownerCt;++c}if(d){d[this.refName=a[--c]]=this;this.refOwner=d}}},removeRef:function(){if(this.refOwner&&this.refName){delete this.refOwner[this.refName];delete this.refOwner}},initState:function(){if(Ext.state.Manager){var a=this.getStateId();
if(a)if(a=Ext.state.Manager.get(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 a=0,b;b=this.stateEvents[a];a++)this.on(b,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 a=this.getStateId();if(a){var b=this.getState();if(this.fireEvent("beforestatesave",this,b)!==false){Ext.state.Manager.set(a,b);this.fireEvent("statesave",this,b)}}}},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(a,b){if(!this.el&&this.autoEl){if(Ext.isString(this.autoEl))this.el=document.createElement(this.autoEl);else{var c=document.createElement("div");Ext.DomHelper.overwrite(c,this.autoEl);this.el=c.firstChild}if(!this.el.id)this.el.id=this.getId()}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){a.dom.insertBefore(this.el.dom,b);c&&Ext.removeNode(c)}}},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();if(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 a=arguments,b=0,c=a.length;b<c;++b)delete this[a[b]]},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(a,b){if(b){this.focusTask=new Ext.util.DelayedTask(this.focus,this,
[a,false]);this.focusTask.delay(Ext.isNumber(b)?b:10);return this}if(this.rendered&&!this.isDestroyed){this.el.focus();a===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;if(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 b=a.id||Ext.id();a=Ext.applyIf(a,this.initialConfig);a.id=b;return new this.constructor(a)},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 a=this.constructor;if(!a.xtypes){for(var b=[],c=this;c&&c.constructor.xtype;){b.unshift(c.constructor.xtype);c=c.constructor.superclass}a.xtypeChain=
b;a.xtypes=b.join("/")}return a.xtypes},findParentBy:function(a){for(var b=this.ownerCt;b!=null&&!a(b,this);b=b.ownerCt);return b||null},findParentByType:function(a,b){return this.findParentBy(function(c){return c.isXType(a,b)})},bubble:function(a,b,c){for(var d=this;d;){if(a.apply(b||d,c||[d])===false)break;d=d.ownerCt}return this},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(a,b,c,d,e){this.createMons();if(Ext.isObject(b)){c=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;for(var g in b)if(!c.test(g))if(Ext.isFunction(b[g])){this.mons.push({item:a,ename:g,
fn:b[g],scope:b.scope});a.on(g,b[g],b.scope,b)}else{this.mons.push({item:a,ename:g,fn:b[g],scope:b.scope});a.on(g,b[g])}}else{this.mons.push({item:a,ename:b,fn:c,scope:d});a.on(b,c,d,e)}},mun:function(a,b,c,d){var e,g;this.createMons();for(var h=0,i=this.mons.length;h<i;++h){g=this.mons[h];if(a===g.item&&b==g.ename&&c===g.fn&&d===g.scope){this.mons.splice(h,1);a.un(b,c,d);e=true;break}}return e},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(a,b){this.initialConfig.handler=a;this.initialConfig.scope=b;this.callEach("setHandler",[a,b])},each:function(a,b){Ext.each(this.items,
a,b)},callEach:function(a,b){for(var c=this.items,d=0,e=c.length;d<e;d++)c[d][a].apply(c[d],b)},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(c,d){c=c||{};var e=Ext.DomHelper,g=c.parentEl;g=g?Ext.getDom(g):document.body;if(d)this.dom=Ext.getDom(d);if(!this.dom)this.dom=e.append(g,c.dh||{tag:"div",cls:"x-layer"});c.cls&&this.addClass(c.cls);this.constrain=c.constrain!==false;this.setVisibilityMode(Ext.Element.VISIBILITY);this.id=c.id?this.dom.id=c.id:Ext.id(this.dom);this.zindex=c.zindex||this.getZIndex();this.position("absolute",this.zindex);if(c.shadow){this.shadowOffset=c.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,
mode:c.shadow})}else this.shadowOffset=0;this.useShim=c.shim!==false&&Ext.useShims;this.useDisplay=c.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)||11E3},getShim:function(){if(!this.useShim)return null;if(this.shim)return this.shim;var c=b.shift();if(!c){c=this.createShim();c.enableDisplayMode("block");c.dom.style.display="none";c.dom.style.visibility="visible"}var d=
this.dom.parentNode;c.dom.parentNode!=d&&d.insertBefore(c.dom,this.dom);c.setStyle("z-index",this.getZIndex()-2);return this.shim=c},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);b.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(c){if(this.shadow){this.shadowDisabled=false;if(Ext.isDefined(this.lastShadowOffset)){this.shadowOffset=
this.lastShadowOffset;delete this.lastShadowOffset}c&&this.sync(true)}},sync:function(c){var d=this.shadow;if(!this.updating&&this.isVisible()&&(d||this.useShim)){var e=this.getShim(),g=this.getWidth(),h=this.getHeight(),i=this.getLeft(true),j=this.getTop(true);if(d&&!this.shadowDisabled){c&&!d.isVisible()?d.show(this):d.realign(i,j,g,h);if(e){c&&e.show();c=d.el.getXY();e=e.dom.style;d=d.el.getSize();e.left=c[0]+"px";e.top=c[1]+"px";e.width=d.width+"px";e.height=d.height+"px"}}else if(e){c&&e.show();
e.setSize(g,h);e.setLeftTop(i,j)}}},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 c=Ext.lib.Dom.getViewWidth(),d=Ext.lib.Dom.getViewHeight(),e=Ext.getDoc().getScroll(),
g=this.getXY(),h=g[0];g=g[1];var i=this.shadowOffset,j=this.dom.offsetWidth+i,k=this.dom.offsetHeight+i,m=false;if(h+j>c+e.left){h=c-j-i;m=true}if(g+k>d+e.top){g=d-k-i;m=true}if(h<e.left){h=e.left;m=true}if(g<e.top){g=e.top;m=true}if(m){if(this.avoidY){c=this.avoidY;if(g<=c&&g+k>=c)g=c-k-5}g=[h,g];this.storeXY(g);a.setXY.call(this,g);this.sync()}}return this},getConstrainOffset:function(){return this.shadowOffset},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;this.useDisplay===true?this.setDisplayed(false):this.setLeftTop(-1E4,-1E4)},setVisible:function(c,d,e,g,h){c&&this.showAction();if(d&&c){var i=function(){this.sync(true);g&&g()}.createDelegate(this);a.setVisible.call(this,true,true,e,i,h)}else{c||this.hideUnders(true);i=g;if(d)i=function(){this.hideAction();
g&&g()}.createDelegate(this);a.setVisible.call(this,c,d,e,i,h);if(c)this.sync(true);else d||this.hideAction()}return this},storeXY:function(c){delete this.lastLT;this.lastXY=c},storeLeftTop:function(c,d){delete this.lastXY;this.lastLT=[c,d]},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(c){this.storeLeftTop(c,this.getTop(true));a.setLeft.apply(this,arguments);this.sync();return this},setTop:function(c){this.storeLeftTop(this.getLeft(true),c);a.setTop.apply(this,arguments);this.sync();return this},setLeftTop:function(c,d){this.storeLeftTop(c,d);a.setLeftTop.apply(this,arguments);this.sync();return this},setXY:function(c,d,e,g,h){this.fixDisplay();this.beforeAction();this.storeXY(c);g=this.createCB(g);a.setXY.call(this,c,d,e,g,h);d||g();return this},createCB:function(c){var d=
this;return function(){d.constrainXY();d.sync(true);c&&c()}},setX:function(c,d,e,g,h){this.setXY([c,this.getY()],d,e,g,h);return this},setY:function(c,d,e,g,h){this.setXY([this.getX(),c],d,e,g,h);return this},setSize:function(c,d,e,g,h,i){this.beforeAction();h=this.createCB(h);a.setSize.call(this,c,d,e,g,h,i);e||h();return this},setWidth:function(c,d,e,g,h){this.beforeAction();g=this.createCB(g);a.setWidth.call(this,c,d,e,g,h);d||g();return this},setHeight:function(c,d,e,g,h){this.beforeAction();
g=this.createCB(g);a.setHeight.call(this,c,d,e,g,h);d||g();return this},setBounds:function(c,d,e,g,h,i,j,k){this.beforeAction();j=this.createCB(j);if(h)a.setBounds.call(this,c,d,e,g,h,i,j,k);else{this.storeXY([c,d]);a.setXY.call(this,[c,d]);a.setSize.call(this,e,g,h,i,j,k);j()}return this},setZIndex:function(c){this.zindex=c;this.setStyle("z-index",c+2);this.shadow&&this.shadow.setZIndex(c+1);this.shim&&this.shim.setStyle("z-index",c);return this}})})();
Ext.Shadow=function(a){Ext.apply(this,a);if(typeof this.mode!="string")this.mode=this.defaultMode;a=this.offset;var b={h:0},c=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case "drop":b.w=0;b.l=b.t=a;b.t-=1;if(Ext.isIE9m){b.l-=this.offset+c;b.t-=this.offset+c;b.w-=c;b.h-=c;b.t+=1}break;case "sides":b.w=a*2;b.l=-a;b.t=a-1;if(Ext.isIE9m){b.l-=this.offset-c;b.t-=this.offset+c;b.l+=1;b.w-=(this.offset-c)*2;b.w-=c+1;b.h-=1}break;case "frame":b.w=b.h=a*2;b.l=b.t=-a;b.t+=1;b.h-=2;if(Ext.isIE9m){b.l-=
this.offset-c;b.t-=this.offset-c;b.l+=1;b.w-=this.offset+c+1;b.h-=this.offset+c;b.h+=1}}this.adjusts=b};
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.isIE9m)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(a,b,c,d){if(this.el){var e=this.adjusts,g=this.el.dom,h=g.style;c=c+e.w;d=d+e.h;var i=c+"px",j=d+"px";h.left=a+e.l+"px";h.top=b+e.t+"px";if(h.width!=i||h.height!=j){h.width=i;h.height=j;if(!Ext.isIE9m){a=g.childNodes;b=Math.max(0,c-12)+"px";a[0].childNodes[1].style.width=b;a[1].childNodes[1].style.width=b;a[2].childNodes[1].style.width=b;a[1].style.height=Math.max(0,d-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.isIE9m?'<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(c){a.push(c)}}}();
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 c=this.adjustSize(a,b),d=c.width;c=c.height;var 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(a){var b=this.getPositionEl();if(a===true)return[b.getLeft(true),b.getTop(true)];return this.xy||b.getXY()},getBox:function(a){a=this.getPosition(a);var b=this.getSize();b.x=a[0];b.y=a[1];return b},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){if(this.rendered)this.getContentTarget().setOverflow(a?"auto":"");
this.autoScroll=a;return this},setPosition:function(a,b){if(a&&typeof a[1]=="number"){b=a[1];a=a[0]}this.x=a;this.y=b;if(!this.boxReady)return this;var c=this.adjustPosition(a,b),d=c.x;c=c.y;var e=this.getPositionEl();if(d!==undefined||c!==undefined){if(d!==undefined&&c!==undefined)e.setLeftTop(d,c);else if(d!==undefined)e.setLeft(d);else c!==undefined&&e.setTop(c);this.onPosition(d,c);this.fireEvent("move",this,d,c)}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)if(!(a===undefined||b===undefined)){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 if(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(a,b){if(this.autoWidth)a="auto";if(this.autoHeight)b="auto";return{width:a,height:b}},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(a,b,c,d,e){this.el=Ext.get(a,true);this.el.unselectable();this.resizingEl=Ext.get(b,true);this.orientation=c||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2E3;this.useShim=this.animate=false;this.shim=null;this.proxy=e?Ext.get(e).dom:Ext.SplitBar.createProxy(this.orientation);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=d||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=d||(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(a,b){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 d=
c-this.activeMinSize,e=Math.max(this.activeMaxSize-c,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?d:e,this.placement==Ext.SplitBar.LEFT?e:d,this.tickSize);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?d:e,this.placement==Ext.SplitBar.TOP?e:d,this.tickSize)}this.dragSpecs.startSize=c;this.dragSpecs.startPoint=[a,b];
Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,a,b)},onEndProxyDrag:function(a){Ext.get(this.proxy).setDisplayed(false);a=Ext.lib.Event.getXY(a);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}a=this.orientation==Ext.SplitBar.HORIZONTAL?this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?a[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-a[0]):this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?a[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-
a[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(a){var b=this.animate;this.animate=false;this.adapter.setElementSize(this,a);this.animate=b},destroy:function(a){Ext.destroy(this.shim,Ext.get(this.proxy));this.dd.unreg();a&&this.el.remove();this.purgeListeners()}});Ext.SplitBar.createProxy=function(a){var b=new Ext.Element(document.createElement("div"));document.body.appendChild(b.dom);b.unselectable();b.addClass("x-splitbar-proxy "+(a==Ext.SplitBar.HORIZONTAL?"x-splitbar-proxy-h":"x-splitbar-proxy-v"));return b.dom};
Ext.SplitBar.BasicLayoutAdapter=function(){};
Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(){},getElementSize:function(a){return a.orientation==Ext.SplitBar.HORIZONTAL?a.resizingEl.getWidth():a.resizingEl.getHeight()},setElementSize:function(a,b,c){if(a.orientation==Ext.SplitBar.HORIZONTAL)if(a.animate)a.resizingEl.setWidth(b,true,0.1,c,"easeOut");else{a.resizingEl.setWidth(b);c&&c(a,b)}else if(a.animate)a.resizingEl.setHeight(b,true,0.1,c,"easeOut");else{a.resizingEl.setHeight(b);c&&c(a,b)}}};
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&&this.layout.setActiveItem){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(a){this.initItems();var b=arguments.length>1;if(b||Ext.isArray(a)){var c=[];Ext.each(b?arguments:a,function(e){c.push(this.add(e))},this);return c}b=this.lookupComponent(this.applyDefaults(a));var d=this.items.length;
if(this.fireEvent("beforeadd",this,b,d)!==false&&this.onBeforeAdd(b)!==false){this.items.add(b);b.onAdded(this,d);this.onAdd(b);this.fireEvent("add",this,b,d)}return b},onAdd:function(){},onAdded:function(a,b){this.ownerCt=a;this.initRef();this.cascade(function(c){c.initRef()});this.fireEvent("added",this,a,b)},insert:function(a,b){var c=arguments,d=c.length,e=[];this.initItems();if(d>2){for(d=d-1;d>=1;--d)e.push(this.insert(a,c[d]));return e}c=this.lookupComponent(this.applyDefaults(b));a=Math.min(a,
this.items.length);if(this.fireEvent("beforeadd",this,c,a)!==false&&this.onBeforeAdd(c)!==false){c.ownerCt==this&&this.items.remove(c);this.items.insert(a,c);c.onAdded(this,a);this.onAdd(c);this.fireEvent("add",this,c,a)}return c},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 a.events?Ext.apply(a,b):Ext.applyIf(a.isAction?a.initialConfig: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(a,b){this.initItems();var c=this.getComponent(a);if(c&&this.fireEvent("beforeremove",this,c)!==false){this.doRemove(c,b);this.fireEvent("remove",this,c)}return c},onRemove:function(){},doRemove:function(a,b){var c=this.layout,d=c&&this.rendered;d&&c.onRemove(a);this.items.remove(a);a.onRemoved();this.onRemove(a);if(b===true||b!==false&&this.autoDestroy)a.destroy();d&&c.afterRemove(a)},removeAll:function(a){this.initItems();
var b,c=[],d=[];this.items.each(function(h){c.push(h)});for(var e=0,g=c.length;e<g;++e){b=c[e];this.remove(b,a);b.ownerCt!==this&&d.push(b)}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,b){if(a.render)return a;var c=Ext.create(Ext.apply({ownerCt:this},a),b||this.defaultType);delete c.initialConfig.ownerCt;
delete c.ownerCt;return c},canLayout:function(){var a=this.getVisibilityEl();return a&&a.dom&&!a.isStyle("display","none")},doLayout:function(a,b){var c=this.rendered,d=b||this.forceLayout;if(this.collapsed||!this.canLayout()){this.deferLayout=this.deferLayout||!a;if(!d)return;a=a&&!this.deferLayout}else delete this.deferLayout;c&&this.layout&&this.layout.layout();if(a!==true&&this.items)for(var e=this.items.items,g=0,h=e.length;g<h;g++){var i=e[g];i.doLayout&&i.doLayout(false,d)}c&&this.onLayout(a,
d);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(){this.layout||this.setLayout(new Ext.layout.AutoLayout(this.layoutConfig));
return this.layout},beforeDestroy:function(){var a;if(this.items)for(;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)},cascade:function(a,b,c){if(a.apply(b||this,c||[this])!==false)if(this.items)for(var d=this.items.items,e=0,g=d.length;e<g;e++)d[e].cascade?d[e].cascade(a,b,c):a.apply(b||d[e],c||[d[e]]);return this},findById:function(a){var b=null,c=
this;this.cascade(function(d){if(c!=d&&d.id===a){b=d;return false}});return b},findByType:function(a,b){return this.findBy(function(c){return c.isXType(a,b)})},find:function(a,b){return this.findBy(function(c){return c[a]===b})},findBy:function(a,b){var c=[],d=this;this.cascade(function(e){if(d!=e&&a.call(b||e,e,d)===true)c.push(e)});return c},get:function(a){return this.getComponent(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(a,b){var c=a.dom.childNodes,d=c.length,e,g=[],h,i;for(h=0;h<d;h++){e=c[h];if(e=Ext.get(e)){g[h]=e.getStyle("display");e.setStyle({display:"none"})}}i=a?a.getViewSize(b):{};for(h=0;h<d;h++){e=c[h];(e=Ext.get(e))&&e.setStyle({display:g[h]})}return i},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(a,b){this.renderAll(a,b)},isValidParent:function(a,b){return b&&a.getPositionEl().dom.parentNode==(b.dom||b)},renderAll:function(a,b){var c=a.items.items,d,e,g=c.length;for(d=0;d<g;d++)if((e=c[d])&&(!e.rendered||!this.isValidParent(e,b)))this.renderItem(e,d,b)},renderItem:function(a,b,c){if(a)if(a.rendered){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)}}else{a.render(c,b);this.configureItem(a)}},getRenderedItems:function(a){var b=a.getLayoutTarget();a=a.items.items;var c=a.length,d,e,g=[];for(d=0;d<c;d++)if((e=a[d]).rendered&&this.isValidParent(e,b)&&e.shouldLayout!==false)g.push(e);return g},configureItem:function(a){if(this.extraCls)(a.getPositionEl?a.getPositionEl():a).addClass(this.extraCls);a.doLayout&&this.forceLayout&&
a.doLayout();this.renderHidden&&a!=this.activeItem&&a.hide()},onRemove:function(a){this.activeItem==a&&delete this.activeItem;if(a.rendered&&this.extraCls)(a.getPositionEl?a.getPositionEl():a).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)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(a){if(Ext.isNumber(a))a=a.toString();a=a.split(" ");var b=a.length;if(b==
1)a[1]=a[2]=a[3]=a[0];else if(b==2){a[2]=a[0];a[3]=a[1]}else if(b==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();this.container&&this.container.un(this.container.resizeEvent,this.onResize,this);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(a,b){Ext.layout.AutoLayout.superclass.onLayout.call(this,a,b);var c=this.getRenderedItems(a),d=c.length,e,g;for(e=0;e<d;e++){g=c[e];g.doLayout&&g.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;if((a=this.container.getComponent(a))&&b!=a){if(b){b.hide();if(b.hidden!==true)return false;b.fireEvent("deactivate",b)}b=a.doLayout&&(this.layoutOnCardChange||!a.rendered);this.activeItem=a;delete a.deferLayout;a.show();this.layout();b&&a.doLayout();a.fireEvent("activate",a)}},renderAll:function(a,b){this.deferredRender?
this.renderItem(this.activeItem,undefined,b):Ext.layout.CardLayout.superclass.renderAll.call(this,a,b)}});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(),b={};if(a){b=a.getViewSize();if(Ext.isIE9m&&Ext.isStrict&&b.width==0)b=a.getStyleSize();b.width-=a.getPadding("lr");b.height-=a.getPadding("tb")}return b},onLayout:function(a,b){Ext.layout.AnchorLayout.superclass.onLayout.call(this,a,b);var c=this.getLayoutTargetSize(),d=c.width,
e=c.height,g=b.getStyle("overflow"),h=this.getRenderedItems(a),i=h.length,j=[],k,m,p,o,s,l,n;if(!(d<20&&e<20)){if(a.anchorSize)if(typeof a.anchorSize=="number")k=a.anchorSize;else{k=a.anchorSize.width;m=a.anchorSize.height}else{k=a.initialConfig.width;m=a.initialConfig.height}for(n=0;n<i;n++){p=h[n];l=p.getPositionEl();if(!p.anchor&&p.items&&!Ext.isNumber(p.width)&&!(Ext.isIE6&&Ext.isStrict))p.anchor=this.defaultAnchor;if(p.anchor){o=p.anchorSpec;if(!o){s=p.anchor.split(" ");p.anchorSpec=o={right:this.parseAnchor(s[0],
p.initialConfig.width,k),bottom:this.parseAnchor(s[1],p.initialConfig.height,m)}}s=o.right?this.adjustWidthAnchor(o.right(d)-l.getMargins("lr"),p):undefined;l=o.bottom?this.adjustHeightAnchor(o.bottom(e)-l.getMargins("tb"),p):undefined;if(s||l)j.push({component:p,width:s||undefined,height:l||undefined})}}n=0;for(i=j.length;n<i;n++){d=j[n];d.component.setSize(d.width,d.height)}if(g&&g!="hidden"&&!this.adjustmentPass){g=this.getLayoutTargetSize();if(g.width!=c.width||g.height!=c.height){this.adjustmentPass=
true;this.onLayout(a,b)}}delete this.adjustmentPass}},parseAnchor:function(a,b,c){if(a&&a!="none"){var d;if(this.parseAnchorRE.test(a)){var e=c-b;return function(h){if(h!==d){d=h;return h-e}}}else if(a.indexOf("%")!=-1){var g=parseFloat(a.replace("%",""))*0.01;return function(h){if(h!==d){d=h;return Math.floor(h*g)}}}else{a=parseInt(a,10);if(!isNaN(a))return function(h){if(h!==d){d=h;return h+a}}}}return false},adjustWidthAnchor:function(a){return a},adjustHeightAnchor:function(a){return a}});
Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;
Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"column",extraCls:"x-column",scrollOffset:0,targetCls:"x-column-layout-ct",isValidParent:function(a){return this.innerCt&&a.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var a=this.container.getLayoutTarget(),b;if(a){b=a.getViewSize();if(Ext.isIE9m&&Ext.isStrict&&b.width==0)b=a.getStyleSize();b.width-=a.getPadding("lr");b.height-=a.getPadding("tb")}return b},renderAll:function(a,
b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(a,b){var c=a.items.items,d=c.length,e,g,h,i=[];this.renderAll(a,b);var j=this.getLayoutTargetSize();if(!(Ext.isIE9m&&j.width<1&&j.height<1)){var k=e=j.width-this.scrollOffset;this.innerCt.setWidth(e);for(g=0;g<d;g++){e=c[g];h=e.getPositionEl().getMargins("lr");i[g]=h;e.columnWidth||(k-=e.getWidth()+
h)}k=k<0?0:k;for(g=0;g<d;g++){e=c[g];h=i[g];e.columnWidth&&e.setSize(Math.floor(e.columnWidth*k)-h)}if(Ext.isIE9m)if(b.getStyle("overflow")&&g!="hidden"&&!this.adjustmentPass)if(this.getLayoutTargetSize().width!=j.width){this.adjustmentPass=true;this.onLayout(a,b)}delete this.adjustmentPass}}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;
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(a,b){var c,d,e,g,h=a.items.items,i=h.length;if(!this.rendered){c=[];for(d=0;d<i;d++){e=h[d];g=e.region;e.collapsed&&c.push(e);e.collapsed=false;if(!e.rendered){e.render(b,d);e.getPositionEl().addClass("x-border-panel")}this[g]=g!="center"&&e.split?
new Ext.layout.BorderLayout.SplitRegion(this,e.initialConfig,g):new Ext.layout.BorderLayout.Region(this,e.initialConfig,g);this[g].render(b,e)}this.rendered=true}g=this.getLayoutTargetSize();if(g.width<20||g.height<20){if(c)this.restoreCollapsed=c}else{if(this.restoreCollapsed){c=this.restoreCollapsed;delete this.restoreCollapsed}i=g.width;var j=g.height;h=i;var k=j,m=0,p=0,o=this.north,s=this.south,l=this.west,n=this.east;e=this.center;var r,q;if(!e&&Ext.layout.BorderLayout.WARN!==false)throw"No center region defined in BorderLayout "+
a.id;if(o&&o.isVisible()){r=o.getSize();q=o.getMargins();r.width=i-(q.left+q.right);r.x=q.left;r.y=q.top;m=r.height+r.y+q.bottom;k-=m;o.applyLayout(r)}if(s&&s.isVisible()){r=s.getSize();q=s.getMargins();r.width=i-(q.left+q.right);r.x=q.left;o=r.height+q.top+q.bottom;r.y=j-o+q.top;k-=o;s.applyLayout(r)}if(l&&l.isVisible()){r=l.getSize();q=l.getMargins();r.height=k-(q.top+q.bottom);r.x=q.left;r.y=m+q.top;j=r.width+q.left+q.right;p+=j;h-=j;l.applyLayout(r)}if(n&&n.isVisible()){r=n.getSize();q=n.getMargins();
r.height=k-(q.top+q.bottom);j=r.width+q.left+q.right;r.x=i-j+q.left;r.y=m+q.top;h-=j;n.applyLayout(r)}if(e){q=e.getMargins();e.applyLayout({x:p+q.left,y:m+q.top,width:h-(q.left+q.right),height:k-(q.top+q.bottom)})}if(c){d=0;for(i=c.length;d<i;d++)c[d].collapse(false)}Ext.isIE9m&&Ext.isStrict&&b.repaint();if(b.getStyle("overflow")&&d!="hidden"&&!this.adjustmentPass){c=this.getLayoutTargetSize();if(c.width!=g.width||c.height!=g.height){this.adjustmentPass=true;this.onLayout(a,b)}}delete this.adjustmentPass}},
destroy:function(){var a=["north","south","east","west"],b,c;for(b=0;b<a.length;b++)if(c=this[a[b]])if(c.destroy)c.destroy();else c.split&&c.split.destroy(true);Ext.layout.BorderLayout.superclass.destroy.call(this)}});
Ext.layout.BorderLayout.Region=function(a,b,c){Ext.apply(this,b);this.layout=a;this.position=c;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);this.cmargins=this.collapseMode=="mini"&&!this.cmargins?{left:0,top:0,right:0,bottom:0}:Ext.applyIf(this.cmargins||{},c=="north"||c=="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(a,b){this.panel=b;b.el.enableDisplayMode();this.targetEl=a;this.el=b.el;var c=b.getState,d=this.position;b.getState=function(){return Ext.apply(c.call(b)||{},this.state)}.createDelegate(this);
if(d!="center"){b.allowQueuedExpand=false;b.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){b.collapseEl="el";b.slideAnchor=this.getSlideAnchor()}if(b.tools&&b.tools.toggle){b.tools.toggle.addClass("x-tool-collapse-"+d);b.tools.toggle.addClassOnOver("x-tool-collapse-"+d+"-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){a=this.expandToolEl=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);a.addClassOnOver("x-tool-expand-"+this.position+"-over");a.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(){this.isSlid?this.panel.expand(false):this.panel.expand()},onCollapseClick:function(){this.panel.collapse()},beforeCollapse:function(a,b){this.lastAnim=b;this.splitEl&&this.splitEl.hide();this.getCollapsedEl().show();var c=this.panel.getEl();this.originalZIndex=c.getStyle("z-index");
c.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:0.2});this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(){this.isSlid&&this.afterSlideIn();var a=this.getCollapsedEl();this.el.show();this.position=="east"||this.position==
"west"?this.panel.setSize(undefined,a.getHeight()):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())){this.isSlid=true;var a=this.panel.tools,b;a&&a.toggle&&a.toggle.hide();this.el.show();b=this.panel.collapsed;this.panel.collapsed=false;if(this.position=="east"||this.position=="west"){a=this.panel.deferHeight;this.panel.deferHeight=false;this.panel.setSize(undefined,this.collapsedEl.getHeight());this.panel.deferHeight=a}else this.panel.setSize(this.collapsedEl.getWidth(),
undefined);this.panel.collapsed=b;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);else{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(){switch(this.position){case "west":return[0,0];case "east":return[0,0];case "north":return[0,0];case "south":return[0,0]}},getExpandAdj:function(){var a=this.collapsedEl,b=this.cmargins;switch(this.position){case "west":return[-(b.right+a.getWidth()+b.left),0];case "east":return[b.right+a.getWidth()+b.left,0];case "north":return[0,-(b.top+b.bottom+a.getHeight())];case "south":return[0,b.top+b.bottom+a.getHeight()]}},
destroy:function(){this.autoHideSlideTask&&this.autoHideSlideTask.cancel&&this.autoHideSlideTask.cancel();Ext.destroyMembers(this,"miniCollapsedEl","collapsedEl","expandToolEl")}};Ext.layout.BorderLayout.SplitRegion=function(a,b,c){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,a,b,c);this.applyLayout=this.applyFns[c]};
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 b=this.splitEl.dom,c=b.style;this.panel.setPosition(a.x,a.y);b=b.offsetWidth;c.left=a.x+a.width-b+"px";c.top=a.y+"px";c.height=Math.max(0,a.height)+"px";this.panel.setSize(a.width-b,a.height)},east:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);
var b=this.splitEl.dom,c=b.style;b=b.offsetWidth;this.panel.setPosition(a.x+b,a.y);c.left=a.x+"px";c.top=a.y+"px";c.height=Math.max(0,a.height)+"px";this.panel.setSize(a.width-b,a.height)},north:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);var b=this.splitEl.dom,c=b.style;b=b.offsetHeight;this.panel.setPosition(a.x,a.y);c.left=a.x+"px";c.top=a.y+a.height-b+"px";c.width=Math.max(0,a.width)+"px";this.panel.setSize(a.width,a.height-b)},south:function(a){if(this.isCollapsed)return this.applyLayoutCollapsed(a);
var b=this.splitEl.dom,c=b.style;b=b.offsetHeight;this.panel.setPosition(a.x,a.y+b);c.left=a.x+"px";c.top=a.y+"px";c.width=Math.max(0,a.width)+"px";this.panel.setSize(a.width,a.height-b)}},render:function(a,b){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,a,b);var c=this.position;this.splitEl=a.createChild({cls:"x-layout-split x-layout-split-"+c,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+
c,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}c=this.splitSettings[c];this.split=new Ext.SplitBar(this.splitEl.dom,b.el,c.orientation);this.split.tickSize=this.tickSize;this.split.placement=c.placement;this.split.getMaximumSize=this[c.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[c.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=
this.maxSize||this[c.maxProp];b.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 a=
this.layout.center;return Math.min(this.maxSize||1E4,this.el.getWidth()+a.el.getWidth()-a.getMinWidth())},getVMaxSize:function(){var a=this.layout.center;return Math.min(this.maxSize||1E4,this.el.getHeight()+a.el.getHeight()-a.getMinHeight())},onSplitMove:function(a,b){var c=this.panel.getSize();this.lastSplitSize=b;if(this.position=="north"||this.position=="south"){this.panel.setSize(c.width,b);this.state.height=b}else{this.panel.setSize(b,c.height);this.state.width=b}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:true,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 b=a.getPositionEl(),c=a.getItemCt&&a.getItemCt();if(a.rendered&&c){b&&b.dom&&b.insertAfter(c);Ext.destroy(c);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.labelAlign||this.labelAlign;a.labelAlign&&a.addClass("x-form-label-"+a.labelAlign);if(a.hideLabels||this.hideLabels)Ext.apply(this,{labelStyle:"display:none",elementStyle:"padding-left:0;",labelAdjust:0});else{this.labelSeparator=Ext.isDefined(a.labelSeparator)?a.labelSeparator:this.labelSeparator;a.labelWidth=a.labelWidth||this.labelWidth||100;if(Ext.isNumber(a.labelWidth)){var b=a.labelPad||this.labelPad;b=Ext.isNumber(b)?b: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(a){var b="";a=[this.labelStyle,a];for(var c=0,d=a.length;c<
d;++c)if(a[c]){b+=a[c];if(b.substr(-1,1)!=";")b+=";"}return b},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;a.itemCt=b?this.fieldTpl.insertBefore(b,d,true):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)this.isValidParent(a,c)||Ext.fly("x-form-el-"+
a.id).appendChild(a.getPositionEl());else a.render("x-form-el-"+a.id);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,c=(a.itemCls||this.container.itemCls||"")+(a.hideLabel?" x-hide-label":"");if(Ext.isIE9&&Ext.isIEQuirks&&a instanceof Ext.form.TextField)c+=" x-input-wrapper";return{id:a.id,
label:a.fieldLabel,itemCls:c,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")return a-this.labelAdjust+(Ext.isIE6||Ext.isIEQuirks?-3:0);return a},adjustHeightAnchor:function(a,b){if(b.label&&!this.isHide(b)&&this.container.labelAlign=="top")return a-
b.label.getHeight();return a},isValidParent:function(a,b){return b&&this.container.getEl().contains(a.getPositionEl())}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;
Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,type:"accordion",renderItem:function(a){if(this.animate===false)a.animCollapse=false;a.collapsible=true;if(this.autoWidth)a.autoWidth=true;if(this.titleCollapse)a.titleCollapse=true;if(this.hideCollapseTool)a.hideCollapseTool=true;if(this.collapseFirst!==undefined)a.collapseFirst=this.collapseFirst;if(!this.activeItem&&
!a.collapsed)this.setActiveItem(a,true);else if(this.activeItem&&this.activeItem!=a)a.collapsed=true;Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);a.header.addClass("x-accordion-hd");a.on("beforeexpand",this.beforeExpand,this)},onRemove:function(a){Ext.layout.AccordionLayout.superclass.onRemove.call(this,a);a.rendered&&a.header.removeClass("x-accordion-hd");a.un("beforeexpand",this.beforeExpand,this)},beforeExpand:function(a,b){var c=this.activeItem;if(c)if(this.sequence){delete this.activeItem;
if(!c.collapsed){c.collapse({callback:function(){a.expand(b||true)},scope:this});return false}}else c.collapse(this.animate);this.setActive(a);this.activeOnTop&&a.el.dom.parentNode.insertBefore(a.el.dom,a.el.dom.parentNode.firstChild);this.layout()},setItemSize:function(a,b){if(this.fill&&a){var c=0,d,e=this.getRenderedItems(this.container),g=e.length,h;for(d=0;d<g;d++)if((h=e[d])!=a&&!h.hidden)c+=h.header.getHeight();b.height-=c;a.setSize(b)}},setActiveItem:function(a){this.setActive(a,true)},setActive:function(a,
b){var c=this.activeItem;a=this.container.getComponent(a);if(c!=a)if(a.rendered&&a.collapsed&&b)a.expand();else{c&&c.fireEvent("deactivate",c);this.activeItem=a;a.fireEvent("activate",a)}}});Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;Ext.layout.Accordion=Ext.layout.AccordionLayout;
Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,type:"table",targetCls:"x-table-layout-ct",tableAttrs:null,setContainer:function(a){Ext.layout.TableLayout.superclass.setContainer.call(this,a);this.currentColumn=this.currentRow=0;this.cells=[]},onLayout:function(a,b){if(!this.table){b.addClass("x-table-layout-ct");this.table=b.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true)}this.renderAll(a,b)},getRow:function(a){a=
this.table.tBodies[0].childNodes[a];if(!a){a=document.createElement("tr");this.table.tBodies[0].appendChild(a)}return a},getNextCell:function(a){for(var b=this.getNextNonSpan(this.currentColumn,this.currentRow),c=this.currentColumn=b[0],d=b=this.currentRow=b[1];d<b+(a.rowspan||1);d++){this.cells[d]||(this.cells[d]=[]);for(var e=c;e<c+(a.colspan||1);e++)this.cells[d][e]=true}c=document.createElement("td");if(a.cellId)c.id=a.cellId;d="x-table-layout-cell";if(a.cellCls)d+=" "+a.cellCls;c.className=d;
if(a.colspan)c.colSpan=a.colspan;if(a.rowspan)c.rowSpan=a.rowspan;this.getRow(b).appendChild(c);return c},getNextNonSpan:function(a,b){for(var c=this.columns;c&&a>=c||this.cells[b]&&this.cells[b][a];)if(c&&a>=c){b++;a=0}else a++;return[a,b]},renderItem:function(a,b,c){if(!this.table)this.table=c.createChild(Ext.apply({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},this.tableAttrs),null,true);if(a&&!a.rendered){a.render(this.getNextCell(a));this.configureItem(a)}else if(a&&!this.isValidParent(a,
c)){b=this.getNextCell(a);b.insertBefore(a.getPositionEl().dom,null);a.container=Ext.get(b);this.configureItem(a)}},isValidParent:function(a,b){return a.getPositionEl().up("table",5).dom.parentNode===(b.dom||b)},destroy:function(){delete this.table;Ext.layout.TableLayout.superclass.destroy.call(this)}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;
Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",type:"absolute",onLayout:function(a,b){b.position();this.paddingLeft=b.getPadding("l");this.paddingTop=b.getPadding("t");Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,a,b)},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.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{defaultMargins:{left:0,top:0,right:0,bottom:0},padding:"0",pack:"start",monitorResize:true,type:"box",scrollOffset:0,extraCls:"x-box-item",targetCls:"x-box-layout-ct",innerCls:"x-box-inner",constructor:function(a){Ext.layout.BoxLayout.superclass.constructor.call(this,a);if(Ext.isString(this.defaultMargins))this.defaultMargins=this.parseMargins(this.defaultMargins);a=this.overflowHandler;if(typeof a=="string")a={type:a};var b="none";if(a&&
a.type!=undefined)b=a.type;b=Ext.layout.boxOverflow[b];if(b[this.type])b=b[this.type];this.overflowHandler=new b(this,a)},onLayout:function(a,b){Ext.layout.BoxLayout.superclass.onLayout.call(this,a,b);var c=this.getLayoutTargetSize(),d=this.getVisibleItems(a);d=this.calculateChildBoxes(d,c);var e=d.boxes,g=d.meta;if(c.width>0)if(g=this.overflowHandler[g.tooNarrow?"handleOverflow":"clearOverflow"](d,c)){if(g.targetSize)c=g.targetSize;if(g.recalculate){d=this.getVisibleItems(a);d=this.calculateChildBoxes(d,
c);e=d.boxes}}this.layoutTargetLastSize=c;this.childBoxCache=d;this.updateInnerCtSize(c,d);this.updateChildBoxes(e);this.handleTargetOverflow(c,a,b)},updateChildBoxes:function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b],e=d.component;d.dirtySize&&e.setSize(d.width,d.height);isNaN(d.left)||isNaN(d.top)||e.setPosition(d.left,d.top)}},updateInnerCtSize:function(a,b){var c=this.align,d=this.padding,e=a.width,g=a.height;if(this.type=="hbox"){var h=e,i=b.meta.maxHeight+d.top+d.bottom;if(c=="stretch")i=
g;else if(c=="middle")i=Math.max(g,i)}else{i=g;h=b.meta.maxWidth+d.left+d.right;if(c=="stretch")h=e;else if(c=="center")h=Math.max(e,h)}this.innerCt.setSize(h||undefined,i||undefined)},handleTargetOverflow:function(a,b,c){var d=c.getStyle("overflow");if(d&&d!="hidden"&&!this.adjustmentPass){d=this.getLayoutTargetSize();if(d.width!=a.width||d.height!=a.height){this.adjustmentPass=true;this.onLayout(b,c)}}delete this.adjustmentPass},isValidParent:function(a){return this.innerCt&&a.getPositionEl().dom.parentNode==
this.innerCt.dom},getVisibleItems:function(a){a=a||this.container;var b=a.getLayoutTarget();a=a.items.items;var c=a.length,d,e,g=[];for(d=0;d<c;d++)if((e=a[d]).rendered&&this.isValidParent(e,b)&&e.hidden!==true&&e.collapsed!==true&&e.shouldLayout!==false)g.push(e);return g},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:this.innerCls});this.padding=this.parseMargins(this.padding)}Ext.layout.BoxLayout.superclass.renderAll.call(this,a,this.innerCt)},getLayoutTargetSize:function(){var a=
this.container.getLayoutTarget(),b;if(a){b=a.getViewSize();if((Ext.isIE9m||Ext.isIE10||Ext.isIE11)&&Ext.isStrict&&b.width==0)b=a.getStyleSize();b.width-=a.getPadding("lr");b.height-=a.getPadding("tb")}return b},renderItem:function(a){if(Ext.isString(a.margins))a.margins=this.parseMargins(a.margins);else if(!a.margins)a.margins=this.defaultMargins;Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments)},destroy:function(){Ext.destroy(this.overflowHandler);Ext.layout.BoxLayout.superclass.destroy.apply(this,
arguments)}});Ext.layout.boxOverflow.None=Ext.extend(Object,{constructor:function(a,b){this.layout=a;Ext.apply(this,b||{})},handleOverflow:Ext.emptyFn,clearOverflow:Ext.emptyFn});Ext.layout.boxOverflow.none=Ext.layout.boxOverflow.None;
Ext.layout.boxOverflow.Menu=Ext.extend(Ext.layout.boxOverflow.None,{afterCls:"x-strip-right",noItemsMenuText:'<div class="x-toolbar-no-items">(None)</div>',constructor:function(){Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this,arguments);this.menuItems=[]},createInnerElements:function(){if(!this.afterCt)this.afterCt=this.layout.innerCt.insertSibling({cls:this.afterCls},"before")},clearOverflow:function(a,b){var c=b.width+(this.afterCt?this.afterCt.getWidth():0),d=this.menuItems;this.hideTrigger();
for(var e=0,g=d.length;e<g;e++)d.pop().component.show();return{targetSize:{height:b.height,width:c}}},showTrigger:function(){this.createMenu();this.menuTrigger.show()},hideTrigger:function(){this.menuTrigger!=undefined&&this.menuTrigger.hide()},beforeMenuShow:function(a){var b=this.menuItems,c=b.length,d,e,g=function(i,j){return i.isXType("buttongroup")&&!(j instanceof Ext.Toolbar.Separator)};this.clearMenu();a.removeAll();for(var h=0;h<c;h++){d=b[h].component;if(e&&(g(d,e)||g(e,d)))a.add("-");this.addComponentToMenu(a,
d);e=d}a.items.length<1&&a.add(this.noItemsMenuText)},createMenuConfig:function(a,b){var c=Ext.apply({},a.initialConfig),d=a.toggleGroup;Ext.copyTo(c,a,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(c,{text:a.overflowText||a.text,hideOnClick:b});if(d||a.enableToggle)Ext.apply(c,{group:d,checked:a.pressed,listeners:{checkchange:function(e,g){a.toggle(g)}}});delete c.ownerCt;delete c.xtype;delete c.id;return c},addComponentToMenu:function(a,b){if(b instanceof Ext.Toolbar.Separator)a.add("-");
else if(Ext.isFunction(b.isXType))if(b.isXType("splitbutton"))a.add(this.createMenuConfig(b,true));else if(b.isXType("button"))a.add(this.createMenuConfig(b,!b.menu));else b.isXType("buttongroup")&&b.items.each(function(c){this.addComponentToMenu(a,c)},this)},clearMenu:function(){var a=this.moreMenu;a&&a.items&&a.items.each(function(b){delete b.menu})},createMenu:function(){if(!this.menuTrigger){this.createInnerElements();this.menu=new Ext.menu.Menu({ownerCt:this.layout.container,listeners:{scope:this,
beforeshow:this.beforeMenuShow}});this.menuTrigger=new Ext.Button({iconCls:"x-toolbar-more-icon",cls:"x-toolbar-more",menu:this.menu,renderTo:this.afterCt})}},destroy:function(){Ext.destroy(this.menu,this.menuTrigger)}});Ext.layout.boxOverflow.menu=Ext.layout.boxOverflow.Menu;
Ext.layout.boxOverflow.HorizontalMenu=Ext.extend(Ext.layout.boxOverflow.Menu,{constructor:function(){Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this,arguments);var a=this,b=a.layout,c=b.calculateChildBoxes;b.calculateChildBoxes=function(d,e){for(var g=c.apply(b,arguments),h=g.meta,i=a.menuItems,j=0,k=0,m=i.length;k<m;k++)j+=i[k].width;h.minimumWidth+=j;h.tooNarrow=h.minimumWidth>e.width;return g}},handleOverflow:function(a,b){this.showTrigger();for(var c=b.width-this.afterCt.getWidth(),
d=a.boxes,e=0,g=false,h=0,i=d.length;h<i;h++)e+=d[h].width;e=c-e;var j=0;h=0;for(i=this.menuItems.length;h<i;h++){var k=this.menuItems[h],m=k.component;k=k.width;if(k<e){m.show();e-=k;j++;g=true}else break}if(g)this.menuItems=this.menuItems.slice(j);else for(h=d.length-1;h>=0;h--){i=d[h].component;if(d[h].left+d[h].width>=c){this.menuItems.unshift({component:i,width:d[h].width});i.hide()}else break}this.menuItems.length==0&&this.hideTrigger();return{targetSize:{height:b.height,width:c},recalculate:g}}});
Ext.layout.boxOverflow.menu.hbox=Ext.layout.boxOverflow.HorizontalMenu;
Ext.layout.boxOverflow.Scroller=Ext.extend(Ext.layout.boxOverflow.None,{animateScroll:true,scrollIncrement:100,wheelIncrement:3,scrollRepeatInterval:400,scrollDuration:0.4,beforeCls:"x-strip-left",afterCls:"x-strip-right",scrollerCls:"x-strip-scroller",beforeScrollerCls:"x-strip-scroller-left",afterScrollerCls:"x-strip-scroller-right",createWheelListener:function(){this.layout.innerCt.on({scope:this,mousewheel:function(a){a.stopEvent();this.scrollBy(a.getWheelDelta()*this.wheelIncrement*-1,false)}})},
handleOverflow:function(){this.createInnerElements();this.showScrollers()},clearOverflow:function(){this.hideScrollers()},showScrollers:function(){this.createScrollers();this.beforeScroller.show();this.afterScroller.show();this.updateScrollButtons()},hideScrollers:function(){if(this.beforeScroller!=undefined){this.beforeScroller.hide();this.afterScroller.hide()}},createScrollers:function(){if(!this.beforeScroller&&!this.afterScroller){var a=this.beforeCt.createChild({cls:String.format("{0} {1} ",
this.scrollerCls,this.beforeScrollerCls)}),b=this.afterCt.createChild({cls:String.format("{0} {1}",this.scrollerCls,this.afterScrollerCls)});a.addClassOnOver(this.beforeScrollerCls+"-hover");b.addClassOnOver(this.afterScrollerCls+"-hover");a.setVisibilityMode(Ext.Element.DISPLAY);b.setVisibilityMode(Ext.Element.DISPLAY);this.beforeRepeater=new Ext.util.ClickRepeater(a,{interval:this.scrollRepeatInterval,handler:this.scrollLeft,scope:this});this.afterRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,
handler:this.scrollRight,scope:this});this.beforeScroller=a;this.afterScroller=b}},destroy:function(){Ext.destroy(this.beforeScroller,this.afterScroller,this.beforeRepeater,this.afterRepeater,this.beforeCt,this.afterCt)},scrollBy:function(a,b){this.scrollTo(this.getScrollPosition()+a,b)},getItem:function(a){if(Ext.isString(a))a=Ext.getCmp(a);else if(Ext.isNumber(a))a=this.items[a];return a},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},
updateScrollButtons:function(){if(!(this.beforeScroller==undefined||this.afterScroller==undefined)){var a=this.atExtremeBefore()?"addClass":"removeClass",b=this.atExtremeAfter()?"addClass":"removeClass",c=this.afterScrollerCls+"-disabled";this.beforeScroller[a](this.beforeScrollerCls+"-disabled");this.afterScroller[b](c);this.scrolling=false}},atExtremeBefore:function(){return this.getScrollPosition()===0},scrollLeft:function(a){this.scrollBy(-this.scrollIncrement,a)},scrollRight:function(a){this.scrollBy(this.scrollIncrement,
a)},scrollToItem:function(a,b){a=this.getItem(a);if(a!=undefined){var c=this.getItemVisibility(a);if(!c.fullyVisible){var d=a.getBox(true,true),e=d.x;if(c.hiddenRight)e-=this.layout.innerCt.getWidth()-d.width;this.scrollTo(e,b)}}},getItemVisibility:function(a){var b=this.getItem(a).getBox(true,true);a=b.x;b=b.x+b.width;var c=this.getScrollPosition(),d=this.layout.innerCt.getWidth()+c;return{hiddenLeft:a<c,hiddenRight:b>d,fullyVisible:a>c&&b<d}}});Ext.layout.boxOverflow.scroller=Ext.layout.boxOverflow.Scroller;
Ext.layout.boxOverflow.VerticalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{scrollIncrement:75,wheelIncrement:2,handleOverflow:function(a,b){Ext.layout.boxOverflow.VerticalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height-(this.beforeCt.getHeight()+this.afterCt.getHeight()),width:b.width}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");this.afterCt=a.insertSibling({cls:this.afterCls},
"after");this.createWheelListener()}},scrollTo:function(a,b){var c=this.getScrollPosition(),d=a.constrain(0,this.getMaxScrollBottom());if(d!=c&&!this.scrolling){if(b==undefined)b=this.animateScroll;this.layout.innerCt.scrollTo("top",d,b?this.getScrollAnim():false);if(b)this.scrolling=true;else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollTop,10)||0},getMaxScrollBottom:function(){return this.layout.innerCt.dom.scrollHeight-
this.layout.innerCt.getHeight()},atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollBottom()}});Ext.layout.boxOverflow.scroller.vbox=Ext.layout.boxOverflow.VerticalScroller;
Ext.layout.boxOverflow.HorizontalScroller=Ext.extend(Ext.layout.boxOverflow.Scroller,{handleOverflow:function(a,b){Ext.layout.boxOverflow.HorizontalScroller.superclass.handleOverflow.apply(this,arguments);return{targetSize:{height:b.height,width:b.width-(this.beforeCt.getWidth()+this.afterCt.getWidth())}}},createInnerElements:function(){var a=this.layout.innerCt;if(!this.beforeCt){this.afterCt=a.insertSibling({cls:this.afterCls},"before");this.beforeCt=a.insertSibling({cls:this.beforeCls},"before");
this.createWheelListener()}},scrollTo:function(a,b){var c=this.getScrollPosition(),d=a.constrain(0,this.getMaxScrollRight());if(d!=c&&!this.scrolling){if(b==undefined)b=this.animateScroll;this.layout.innerCt.scrollTo("left",d,b?this.getScrollAnim():false);if(b)this.scrolling=true;else{this.scrolling=false;this.updateScrollButtons()}}},getScrollPosition:function(){return parseInt(this.layout.innerCt.dom.scrollLeft,10)||0},getMaxScrollRight:function(){return this.layout.innerCt.dom.scrollWidth-this.layout.innerCt.getWidth()},
atExtremeAfter:function(){return this.getScrollPosition()>=this.getMaxScrollRight()}});Ext.layout.boxOverflow.scroller.hbox=Ext.layout.boxOverflow.HorizontalScroller;
Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"top",type:"hbox",calculateChildBoxes:function(a,b){var c=a.length,d=this.padding,e=d.top,g=d.left,h=g+d.right,i=b.width-this.scrollOffset;d=Math.max(0,b.height-(e+d.bottom));var j=this.pack=="start",k=this.pack=="center",m=this.pack=="end",p=0,o=0,s=0,l=0,n=0,r=[],q,t,u,v,z,x,A;for(x=0;x<c;x++){q=a[x];u=q.height;t=q.width;z=!q.hasLayout&&typeof q.doLayout=="function";if(typeof t!="number")if(q.flex&&!t)s+=q.flex;else{!t&&z&&q.doLayout();
v=q.getSize();t=v.width;u=v.height}v=q.margins;A=v.left+v.right;p+=A+(t||0);l+=A+(q.flex?q.minWidth||0:t);n+=A+(q.minWidth||t||0);if(typeof u!="number"){z&&q.doLayout();u=q.getHeight()}o=Math.max(o,u+v.top+v.bottom);r.push({component:q,height:u||undefined,width:t||undefined})}q=l-i;t=n>i;h=Math.max(0,i-p-h);if(t)for(x=0;x<c;x++)r[x].width=a[x].minWidth||a[x].width||r[x].width;else if(q>0){j=[];x=0;for(v=c;x<v;x++){z=a[x];u=z.minWidth||0;if(z.flex)r[x].width=u;else j.push({minWidth:u,available:r[x].width-
u,index:x})}j.sort(function(N,B){return N.available>B.available?1:-1});x=0;for(v=j.length;x<v;x++){s=j[x].index;if(s!=undefined){z=a[s];A=r[s].width;u=z.minWidth;z=Math.max(u,A-Math.ceil(q/(v-x)));u=A-z;r[s].width=z;q-=u}}}else{z=h;A=s;for(x=0;x<c;x++){q=a[x];s=r[x];v=q.margins;u=v.top+v.bottom;if(j&&q.flex&&!q.width){v=Math.ceil(q.flex/A*z);z-=v;A-=q.flex;s.width=v;s.dirtySize=true}}}if(k)g+=h/2;else if(m)g+=h;for(x=0;x<c;x++){q=a[x];s=r[x];v=q.margins;g+=v.left;u=v.top+v.bottom;s.left=g;s.top=e+
v.top;switch(this.align){case "stretch":k=d-u;s.height=k.constrain(q.minHeight||0,q.maxHeight||1E6);s.dirtySize=true;break;case "stretchmax":k=o-u;s.height=k.constrain(q.minHeight||0,q.maxHeight||1E6);s.dirtySize=true;break;case "middle":k=d-s.height-u;if(k>0)s.top=e+u+k/2}g+=s.width+v.right}return{boxes:r,meta:{maxHeight:o,nonFlexWidth:p,desiredWidth:l,minimumWidth:n,shortfall:l-i,tooNarrow:t}}}});Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;
Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{align:"left",type:"vbox",calculateChildBoxes:function(a,b){var c=a.length,d=this.padding,e=d.top,g=d.left,h=e+d.bottom,i=b.height;d=Math.max(0,b.width-this.scrollOffset-(g+d.right));var j=this.pack=="start",k=this.pack=="center",m=this.pack=="end",p=0,o=0,s=0,l=0,n=0,r=[],q,t,u,v,z,x,A;for(x=0;x<c;x++){q=a[x];u=q.height;t=q.width;z=!q.hasLayout&&typeof q.doLayout=="function";if(typeof u!="number")if(q.flex&&!u)s+=q.flex;else{!u&&z&&q.doLayout();
v=q.getSize();t=v.width;u=v.height}v=q.margins;A=v.top+v.bottom;p+=A+(u||0);l+=A+(q.flex?q.minHeight||0:u);n+=A+(q.minHeight||u||0);if(typeof t!="number"){z&&q.doLayout();t=q.getWidth()}o=Math.max(o,t+v.left+v.right);r.push({component:q,height:u||undefined,width:t||undefined})}q=l-i;t=n>i;h=Math.max(0,i-p-h);if(t){x=0;for(j=c;x<j;x++)r[x].height=a[x].minHeight||a[x].height||r[x].height}else if(q>0){v=[];x=0;for(j=c;x<j;x++){z=a[x];u=z.minHeight||0;if(z.flex)r[x].height=u;else v.push({minHeight:u,
available:r[x].height-u,index:x})}v.sort(function(N,B){return N.available>B.available?1:-1});x=0;for(j=v.length;x<j;x++){s=v[x].index;if(s!=undefined){z=a[s];A=r[s].height;u=z.minHeight;z=Math.max(u,A-Math.ceil(q/(j-x)));u=A-z;r[s].height=z;q-=u}}}else{z=h;A=s;for(x=0;x<c;x++){q=a[x];s=r[x];v=q.margins;u=v.left+v.right;if(j&&q.flex&&!q.height){v=Math.ceil(q.flex/A*z);z-=v;A-=q.flex;s.height=v;s.dirtySize=true}}}if(k)e+=h/2;else if(m)e+=h;for(x=0;x<c;x++){q=a[x];s=r[x];v=q.margins;e+=v.top;u=v.left+
v.right;s.left=g+v.left;s.top=e;switch(this.align){case "stretch":k=d-u;s.width=k.constrain(q.minWidth||0,q.maxWidth||1E6);s.dirtySize=true;break;case "stretchmax":k=o-u;s.width=k.constrain(q.minWidth||0,q.maxWidth||1E6);s.dirtySize=true;break;case "center":k=d-s.width-u;if(k>0)s.left=g+u+k/2}e+=s.height+v.bottom}return{boxes:r,meta:{maxWidth:o,nonFlexHeight:p,desiredHeight:l,minimumHeight:n,shortfall:l-i,tooNarrow:t}}}});Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;
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>',
onLayout:function(a,b){if(!this.leftTr){var c=a.buttonAlign=="center"?"center":"left";b.addClass("x-toolbar-layout-ct");b.insertHtml("beforeEnd",String.format(this.tableHTML,c));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=[]}c=a.buttonAlign=="right"?this.rightTr:this.leftTr;for(var d=a.items.items,e=0,g=0,h=d.length,i;g<h;g++,e++){i=d[g];if(i.isFill){c=
this.rightTr;e=-1}else if(i.rendered){if(!i.xtbHidden&&!this.isValidParent(i,c.childNodes[e])){var j=this.insertCell(i,c,e);j.appendChild(i.getPositionEl().dom);i.container=Ext.get(j)}}else{i.render(this.insertCell(i,c,e));this.configureItem(i)}}this.cleanup(this.leftTr);this.cleanup(this.rightTr);this.cleanup(this.extrasTr);this.fitToSize(b)},cleanup:function(a){var b=a.childNodes,c,d;for(c=b.length-1;c>=0&&(d=b[c]);c--)d.firstChild||a.removeChild(d)},insertCell:function(a,b,c){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(a){if(this.container.enableOverflow!==false){var b=a.dom.clientWidth,c=a.dom.firstChild.offsetWidth;
a=b-this.triggerWidth;var d=this.hiddenItems,e=d.length!=0,g=b>=(this.lastWidth||0);this.lastWidth=b;if(c>b||e&&g){b=this.container.items.items;c=b.length;for(var h=e=0;h<c;h++){g=b[h];if(!g.isFill){e+=this.getItemWidth(g);if(e>a)g.hidden||g.xtbHidden||this.hideItem(g);else g.xtbHidden&&this.unhideItem(g)}}}if(e=d.length!=0){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,b){var c=Ext.apply({},a.initialConfig),d=a.toggleGroup;Ext.copyTo(c,a,["iconCls","icon","itemId","disabled","handler","scope","menu"]);Ext.apply(c,{text:a.overflowText||a.text,hideOnClick:b});if(d||a.enableToggle)Ext.apply(c,{group:d,checked:a.pressed,listeners:{checkchange:function(e,g){a.toggle(g)}}});delete c.ownerCt;delete c.xtype;delete c.id;
return c},addComponentToMenu:function(a,b){if(b instanceof Ext.Toolbar.Separator)a.add("-");else if(Ext.isFunction(b.isXType))if(b.isXType("splitbutton"))a.add(this.createMenuConfig(b,true));else if(b.isXType("button"))a.add(this.createMenuConfig(b,!b.menu));else b.isXType("buttongroup")&&b.items.each(function(c){this.addComponentToMenu(a,c)},this)},clearMenu:function(){var a=this.moreMenu;a&&a.items&&a.items.each(function(b){delete b.menu})},beforeMoreShow:function(a){var b=this.container.items.items,
c=b.length,d,e,g=function(i,j){return i.isXType("buttongroup")&&!(j instanceof Ext.Toolbar.Separator)};this.clearMenu();a.removeAll();for(var h=0;h<c;h++){d=b[h];if(d.xtbHidden){if(e&&(g(d,e)||g(e,d)))a.add("-");this.addComponentToMenu(a,d);e=d}}a.items.length<1&&a.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});this.more.render(this.insertCell(this.more,this.extrasTr,100))}},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 alt="{altText}" 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)}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 instanceof Ext.menu.Separator)&&(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 ",altText:a.altText||""}},isValidParent:function(a,b){return a.el.up("li.x-menu-list-item",5).dom.parentNode===(b.dom||b)},onLayout:function(a,b){Ext.layout.MenuLayout.superclass.onLayout.call(this,a,b);this.doAutoSize()},doAutoSize:function(){var a=this.container,b=a.width;if(a.floating)if(b)a.setWidth(b);
else if(Ext.isIE9m){a.setWidth(Ext.isStrict&&(Ext.isIE7||Ext.isIE8||Ext.isIE9)?"auto":a.minWidth);b=a.getEl();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.autoHeight=this.autoWidth=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(a,b){this.fireEvent("resize",this,
a,b,a,b)}});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:0.25},collapseDefaults:{duration:0.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(c){return{minWidth:c.minWidth||
b}}});this.fbar.items.each(function(c){c.minWidth=c.minWidth||this.minButtonWidth},this);this.buttons=this.fbar.items.items},createToolbar:function(a,b){var c;if(Ext.isArray(a))a={items:a};c=a.events?Ext.apply(a,b):this.createComponent(Ext.apply({},a,b),"toolbar");this.toolbars.push(c);return c},createElement:function(a,b){if(this[a])b.appendChild(this[a].dom);else 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(a,b){Ext.Panel.superclass.onRender.call(this,a,b);this.createClasses();var c=this.el,d=c.dom,e;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){e=this.tools;
this.elements+=this.header!==false?",header":""}this.tools={};c.addClass(this.baseCls);if(d.firstChild){this.header=c.down("."+this.headerCls);var g=(this.bwrap=c.down("."+this.bwrapCls))?this.bwrap:c;this.tbar=g.down("."+this.tbarCls);this.body=g.down("."+this.bodyCls);this.bbar=g.down("."+this.bbarCls);this.footer=g.down("."+this.footerCls);this.fromMarkup=true}this.preventBodyReset===true&&c.addClass("x-panel-reset");this.cls&&c.addClass(this.cls);if(this.buttons)this.elements+=",footer";if(this.frame){c.insertHtml("afterBegin",
String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",d.firstChild.firstChild.firstChild);this.createElement("bwrap",d);c=this.bwrap.dom;g=d.childNodes[2];c.appendChild(d.childNodes[1]);c.appendChild(g);d=c.firstChild.firstChild.firstChild;this.createElement("tbar",d);this.createElement("body",d);this.createElement("bbar",d);this.createElement("footer",c.lastChild.firstChild.firstChild);this.footer||(this.bwrap.dom.lastChild.className+=" x-panel-nofooter");this.ft=Ext.get(this.bwrap.dom.lastChild);
this.mc=Ext.get(d)}else{this.createElement("header",d);this.createElement("bwrap",d);c=this.bwrap.dom;this.createElement("tbar",c);this.createElement("body",c);this.createElement("bbar",c);this.createElement("footer",c);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")}e&&this.addTool.apply(this,e);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(a){var b=this.iconCls;this.iconCls=a;if(this.rendered&&this.header)if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(b,this.iconCls)}else{var c=this.header,d=c.child("img.x-panel-inline-icon");if(d)Ext.fly(d).replaceClass(b,this.iconCls);else(c=c.child("span."+this.headerTextCls))&&Ext.DomHelper.insertBefore(c.dom,{tag:"img",alt:"",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+
this.iconCls})}this.fireEvent("iconchange",this,a,b)},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[this.toolTarget]){if(!this.toolTemplate){var a=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');a.disableFormats=true;a.compile();Ext.Panel.prototype.toolTemplate=a}a=0;for(var b=arguments,c=b.length;a<c;a++){var d=b[a];if(!this.tools[d.id]){var e="x-tool-"+d.id+"-over",g=this.toolTemplate.insertFirst(this[this.toolTarget],d,true);this.tools[d.id]=g;g.enableDisplayMode("block");
this.mon(g,"click",this.createToolHandler(g,d,e,this));d.on&&this.mon(g,d.on);d.hidden&&g.hide();if(d.qtip)if(Ext.isObject(d.qtip))Ext.QuickTips.register(Ext.apply({target:g.id},d.qtip));else g.dom.qtip=d.qtip;g.addClassOnOver(e)}}}}else{if(!this.tools)this.tools=[];Ext.each(arguments,function(h){this.tools.push(h)},this)}},onLayout:function(a,b){Ext.Panel.superclass.onLayout.apply(this,arguments);if(this.hasLayout&&this.toolbars.length>0){Ext.each(this.toolbars,function(c){c.doLayout(undefined,b)});
this.syncHeight()}},syncHeight:function(){var a=this.toolbarHeight,b=this.body,c=this.lastSize.height;if(!(this.autoHeight||!Ext.isDefined(c)||c=="auto"))if(a!=this.getToolbarHeight()){a=Math.max(0,c-this.getFrameHeight());b.setHeight(a);a=b.getSize();this.toolbarHeight=this.getToolbarHeight();this.onBodyResize(a.width,a.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(a,b,c,d){return function(e){a.removeClass(c);b.stopEvent!==false&&e.stopEvent();if(b.handler)b.handler.call(b.scope||a,e,a,d,b)}},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,b,c){var d={scope:c,block:true};if(a===true){d.callback=b;return d}else d.callback=a.callback?function(){b.call(c);Ext.callback(a.callback,a.scope)}:b;return Ext.applyIf(d,a)},collapse:function(a){if(!(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,a)===false)){var b=a===true||a!==false&&this.animCollapse;this.beforeEffect(b);this.onCollapse(b,a);return this}},onCollapse:function(a,b){if(a)this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(b||
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(b){if(b.lastSize)b.lastSize={width:undefined,height:undefined}});this.fireEvent("collapse",this)},expand:function(a){if(!(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,
a)===false)){var b=a===true||a!==false&&this.animCollapse;this.el.removeClass(this.collapsedCls);this.beforeEffect(b);this.onExpand(b,a);return this}},onExpand:function(a,b){if(a)this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(b||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(a,b,c,d){var e=a,g=b;if(Ext.isDefined(e)||Ext.isDefined(g)){if(this.collapsed){this.queuedBodySize={width:e,height:g};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})}}else{if(Ext.isNumber(e))this.body.setWidth(e=this.adjustBodyWidth(e-this.getFrameWidth()));else e=e=="auto"?this.body.setWidth("auto").dom.offsetWidth:this.body.dom.offsetWidth;if(this.tbar){this.tbar.setWidth(e);this.topToolbar&&this.topToolbar.setSize(e)}if(this.bbar){this.bbar.setWidth(e);if(this.bottomToolbar){this.bottomToolbar.setSize(e);
if(Ext.isIE9m){this.bbar.setStyle("position","static");this.bbar.setStyle("position","")}}}if(this.footer){this.footer.setWidth(e);if(this.fbar)this.fbar.setSize(Ext.isIE9m?e-this.footer.getFrameWidth("lr"):"auto")}if(Ext.isNumber(g)){g=Math.max(0,g-this.getFrameHeight());this.body.setHeight(g)}else g=="auto"&&this.body.setHeight(g);this.disabled&&this.el._mask&&this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}this.onBodyResize(e,g)}this.syncShadow();Ext.Panel.superclass.onResize.call(this,
a,b,c,d)},onBodyResize:function(a,b){this.fireEvent("bodyresize",this,a,b)},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=this.el.getFrameWidth("tb")+this.bwrap.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);a+=this.frame?this.el.dom.firstChild.offsetHeight+this.ft.dom.offsetHeight+this.mc.getFrameWidth("tb"):(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():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(b){b.un("afterlayout",this.syncHeight,this);b.un("remove",this.syncHeight,this)},this);if(Ext.isArray(this.buttons))for(;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(a,b,c){var d=document.createElement("div");d.className="x-panel-ghost "+(a?a:"");this.header&&d.appendChild(this.el.dom.firstChild.cloneNode(true));Ext.fly(d.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());
d.style.width=this.el.dom.offsetWidth+"px";c?Ext.getDom(c).appendChild(d):this.container.dom.appendChild(d);if(b!==false&&this.el.useShim!==false){a=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},d);a.show();return a}else return new Ext.Element(d)},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.Editor=function(a,b){if(a.field){this.field=Ext.create(a.field,"textfield");b=Ext.apply({},a);delete b.field}else this.field=a;Ext.Editor.superclass.constructor.call(this,b)};
Ext.extend(Ext.Editor,Ext.Component,{allowBlur:true,value:"",alignment:"c-c?",offsets:[0,0],shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:true,cancelOnEsc:true,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(a){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:a,shim:this.shim,shadowOffset:this.shadowOffset||
4,id:this.id,constrain:this.constrain});this.zIndex&&this.el.setZIndex(this.zIndex);this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title")this.field.msgTarget="qtip";this.field.inEditor=true;this.mon(this.field,{scope:this,blur:this.onBlur,specialkey:this.onSpecialKey});this.field.grow&&this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1});this.field.render(this.el).show();this.field.getEl().dom.name="";this.swallowKeys&&this.field.el.swallowEvent(["keypress",
"keydown"])},onSpecialKey:function(a,b){var c=b.getKey(),d=this.completeOnEnter&&c==b.ENTER;c=this.cancelOnEsc&&c==b.ESC;if(d||c){b.stopEvent();d?this.completeEdit():this.cancelEdit();a.triggerBlur&&a.triggerBlur()}this.fireEvent("specialkey",a,b)},startEdit:function(a,b){this.editing&&this.completeEdit();this.boundEl=Ext.get(a);var c=b!==undefined?b:this.boundEl.dom.innerHTML;this.rendered||this.render(this.parentEl||document.body);if(this.fireEvent("beforestartedit",this,this.boundEl,c)!==false){this.startValue=
c;this.field.reset();this.field.setValue(c);this.realign(true);this.editing=true;this.show()}},doAutoSize:function(){if(this.autoSize){var a=this.boundEl.getSize(),b=this.field.getSize();switch(this.autoSize){case "width":this.setSize(a.width,b.height);break;case "height":this.setSize(b.width,a.height);break;case "none":this.setSize(b.width,b.height);break;default:this.setSize(a.width,a.height)}}},setSize:function(a,b){delete this.field.lastSize;this.field.setSize(a,b);if(this.el){if(Ext.isGecko2||
Ext.isOpera||Ext.isIE7&&Ext.isStrict)this.el.setSize(a,b);this.el.sync()}},realign:function(a){a===true&&this.doAutoSize();this.el.alignTo(this.boundEl,this.alignment,this.offsets)},completeEdit:function(a){if(this.editing){this.field.assertValue&&this.field.assertValue();var b=this.getValue();if(this.field.isValid())if(String(b)===String(this.startValue)&&this.ignoreNoChange)this.hideEdit(a);else{if(this.fireEvent("beforecomplete",this,b,this.startValue)!==false){b=this.getValue();this.updateEl&&
this.boundEl&&this.boundEl.update(b);this.hideEdit(a);this.fireEvent("complete",this,b,this.startValue)}}else this.revertInvalid!==false&&this.cancelEdit(a)}},onShow:function(){this.el.show();this.hideEl!==false&&this.boundEl.hide();this.field.show().focus(false,true);this.fireEvent("startedit",this.boundEl,this.startValue)},cancelEdit:function(a){if(this.editing){var b=this.getValue();this.setValue(this.startValue);this.hideEdit(a);this.fireEvent("canceledit",this,b,this.startValue)}},hideEdit:function(a){if(a!==
true){this.editing=false;this.hide()}},onBlur:function(){this.allowBlur===true&&this.editing&&this.selectSameEditor!==true&&this.completeEdit()},onHide:function(){if(this.editing)this.completeEdit();else{this.field.blur();this.field.collapse&&this.field.collapse();this.el.hide();this.hideEl!==false&&this.boundEl.show()}},setValue:function(a){this.field.setValue(a)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroyMembers(this,"field");delete this.parentEl;delete this.boundEl}});
Ext.reg("editor",Ext.Editor);
Ext.ColorPalette=Ext.extend(Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF",
"FFFFFF"],initComponent:function(){Ext.ColorPalette.superclass.initComponent.call(this);this.addEvents("select");this.handler&&this.on("select",this.handler,this.scope,true)},onRender:function(a,b){this.autoEl={tag:"div",cls:this.itemCls};Ext.ColorPalette.superclass.onRender.call(this,a,b);(this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" class="x-unselectable" unselectable="on">&#160;</span></em></a></tpl>')).overwrite(this.el,
this.colors);this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:"a"});this.clickEvent!="click"&&this.mon(this.el,"click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var a=this.value;this.value=null;this.select(a,true)}},handleClick:function(a,b){a.preventDefault();this.disabled||this.select(b.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1].toUpperCase())},select:function(a,b){a=a.replace("#",
"");if(a!=this.value||this.allowReselect){var c=this.el;this.value&&c.child("a.color-"+this.value).removeClass("x-color-palette-sel");c.child("a.color-"+a).addClass("x-color-palette-sel");this.value=a;b!==true&&this.fireEvent("select",this,a)}}});Ext.reg("colorpalette",Ext.ColorPalette);
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");if(this.handler)this.on("select",this.handler,this.scope||this);this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var a=this.disabledDates,b=a.length-1,c="(?:";Ext.each(a,function(d,e){c+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":
a[e];if(e!=b)c+="|"},this);this.disabledDatesRE=RegExp(c+")")}},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.isIE9m&&this.el.repaint()},onDisable:function(){Ext.DatePicker.superclass.onDisable.call(this);this.doDisabled(true);Ext.isIE9m&&!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(a,b){var c=['<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>'],
d=this.dayNames,e;for(e=0;e<7;e++){var g=this.startDay+e;if(g>6)g-=7;c.push("<th><span>",d[g].substr(0,1),"</span></th>")}c[c.length]="</tr></thead><tbody><tr>";for(e=0;e<42;e++){if(e%7===0&&e!==0)c[c.length]="</tr><tr>";c[c.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}c.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>');
d=document.createElement("div");d.className="x-date-picker";d.innerHTML=c.join("");a.dom.insertBefore(d,b);this.el=Ext.get(d);this.eventEl=Ext.get(d.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(h){h.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},right:function(h){h.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},up:function(h){h.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},down:function(h){h.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},pageUp:function(){this.showNextMonth()},pageDown:function(){this.showPrevMonth()},
enter:function(h){h.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);c=(new Date).dateFormat(this.format);
this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,c),tooltip:String.format(this.todayTip,c),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 a=['<table border="0" cellspacing="0">'],
b=0;b<6;b++)a.push('<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(b),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(b+6),"</a></td>",b===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>');a.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(a.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(c,d,e){e+=1;c.dom.xmonth=e%2===0?5+Math.round(e*0.5):Math.round((e-1)*0.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:0.2})}},updateMPYear:function(a){this.mpyear=a;for(var b=this.mpYears.elements,c=1;c<=10;c++){var d=b[c-1],e;e=
c%2===0?a+Math.round(c*0.5):a-(5-Math.round(c*0.5));d.firstChild.innerHTML=e;d.xyear=e;this.mpYears.item(c-1)[e==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(a,b){a.stopEvent();var c=new Ext.Element(b),d;if(c.is("button.x-date-mp-cancel"))this.hideMonthPicker();else if(c.is("button.x-date-mp-ok")){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(d=c.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");d.addClass("x-date-mp-sel");this.mpSelMonth=d.dom.xmonth}else if(d=c.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");d.addClass("x-date-mp-sel");this.mpSelYear=d.dom.xyear}else if(c.is("a.x-date-mp-prev"))this.updateMPYear(this.mpyear-
10);else c.is("a.x-date-mp-next")&&this.updateMPYear(this.mpyear+10)},onMonthDblClick:function(a,b){a.stopEvent();var c=new Ext.Element(b),d;if(d=c.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,d.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else if(d=c.up("td.x-date-mp-year",2)){this.update(new Date(d.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}},hideMonthPicker:function(a){if(this.monthPicker)a===true?
this.monthPicker.hide():this.monthPicker.slideOut("t",{duration:0.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(a){a.stopEvent();if(!this.disabled){a=a.getWheelDelta();if(a>0)this.showPrevMonth();else a<0&&this.showNextMonth()}},handleDateClick:function(a,
b){a.stopEvent();if(!this.disabled&&b.dateValue&&!Ext.fly(b.parentNode).hasClass("x-date-disabled")){this.cancelFocus=this.focusOnSelect===false;this.setValue(new Date(b.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(a,b){if(this.rendered){var c=this.activeDate,d=this.isVisible();this.activeDate=a;if(!b&&
c&&this.el){var e=a.getTime();if(c.getMonth()==a.getMonth()&&c.getFullYear()==a.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(z){if(z.dom.firstChild.dateValue==e){z.addClass("x-date-selected");d&&!this.cancelFocus&&Ext.fly(z.dom.firstChild).focus(50);return false}},this);return}}var g=a.getDaysInMonth(),h=a.getFirstDateOfMonth().getDay()-this.startDay;if(h<0)h+=7;g+=h;var i=a.add("mo",-1),j=i.getDaysInMonth()-h;c=this.cells.elements;var k=this.textNodes,m=new Date(i.getFullYear(),
i.getMonth(),j,this.initHour),p=(new Date).clearTime().getTime(),o=a.clearTime(true).getTime(),s=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,l=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,n=this.disabledDatesRE,r=this.disabledDatesText,q=this.disabledDays?this.disabledDays.join(""):false,t=this.disabledDaysText,u=this.format;if(this.showToday){i=(new Date).clearTime();i=i<s||i>l||n&&u&&n.test(i.dateFormat(u))||q&&q.indexOf(i.getDay())!=-1;if(!this.disabled){this.todayBtn.setDisabled(i);
this.todayKeyListener[i?"disable":"enable"]()}}i=function(z,x){x.title="";var A=m.clearTime(true).getTime();x.firstChild.dateValue=A;if(A==p){x.className+=" x-date-today";x.title=z.todayText}if(A==o){x.className+=" x-date-selected";d&&Ext.fly(x.firstChild).focus(50)}if(A<s){x.className=" x-date-disabled";x.title=z.minText}else if(A>l){x.className=" x-date-disabled";x.title=z.maxText}else{if(q)if(q.indexOf(m.getDay())!=-1){x.title=t;x.className=" x-date-disabled"}if(n&&u){A=m.dateFormat(u);if(n.test(A)){x.title=
r.replace("%0",A);x.className=" x-date-disabled"}}}};for(var v=0;v<h;v++){k[v].innerHTML=++j;m.setDate(m.getDate()+1);c[v].className="x-date-prevday";i(this,c[v])}for(;v<g;v++){k[v].innerHTML=v-h+1;m.setDate(m.getDate()+1);c[v].className="x-date-active";i(this,c[v])}for(g=0;v<42;v++){k[v].innerHTML=++g;m.setDate(m.getDate()+1);c[v].className="x-date-nextday";i(this,c[v])}this.mbtn.setText(this.monthNames[a.getMonth()]+" "+a.getFullYear());if(!this.internalRender){c=this.el.dom.firstChild;k=c.offsetWidth;
this.el.setWidth(k+this.el.getBorderWidth("lr"));Ext.fly(c).setWidth(k);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){c.rows[0].cells[1].style.width=k-(c.rows[0].cells[0].offsetWidth+c.rows[0].cells[2].offsetWidth)+"px";this.secondPass=true;this.update.defer(10,this,[a])}}}},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(a,b){this.el=Ext.get(a);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 c=this.el.getUpdater();c.showLoadIndicator=false;c.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.slider.Thumb=Ext.extend(Object,{dragging:false,constructor:function(a){Ext.apply(this,a||{},{cls:"x-slider-thumb",constrain:false});Ext.slider.Thumb.superclass.constructor.call(this,a);this.slider.vertical&&Ext.apply(this,Ext.slider.Thumb.Vertical)},render:function(){this.el=this.slider.innerEl.insertFirst({cls:this.cls});this.initEvents()},enable:function(){this.disabled=false;this.el.removeClass(this.slider.disabledClass)},disable:function(){this.disabled=true;this.el.addClass(this.slider.disabledClass)},
initEvents:function(){var a=this.el;a.addClassOnOver("x-slider-thumb-over");this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a)},onBeforeDragStart:function(){if(this.disabled)return false;else{this.slider.promoteThumb(this);return true}},onDragStart:function(a){this.el.addClass("x-slider-thumb-drag");
this.dragging=true;this.dragStartValue=this.value;this.slider.fireEvent("dragstart",this.slider,a,this)},onDrag:function(a){var b=this.slider,c=this.index,d=this.getNewValue();if(this.constrain){var e=b.thumbs[c+1],g=b.thumbs[c-1];if(g!=undefined&&d<=g.value)d=g.value;if(e!=undefined&&d>=e.value)d=e.value}b.setValue(c,d,false);b.fireEvent("drag",b,a,this)},getNewValue:function(){var a=this.slider,b=a.innerEl.translatePoints(this.tracker.getXY());return Ext.util.Format.round(a.reverseValue(b.left),
a.decimalPrecision)},onDragEnd:function(a){var b=this.slider,c=this.value;this.el.removeClass("x-slider-thumb-drag");this.dragging=false;b.fireEvent("dragend",b,a);this.dragStartValue!=c&&b.fireEvent("changecomplete",b,c,this)},destroy:function(){Ext.destroyMembers(this,"tracker","el")}});
Ext.slider.MultiSlider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,decimalPrecision:0,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,constrainThumbs:true,topThumbZIndex:1E4,initComponent:function(){if(!Ext.isDefined(this.value))this.value=this.minValue;this.thumbs=[];Ext.slider.MultiSlider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart",
"drag","dragend");if(this.values==undefined||Ext.isEmpty(this.values))this.values=[0];for(var a=this.values,b=0;b<a.length;b++)this.addThumb(a[b]);this.vertical&&Ext.apply(this,Ext.slider.Vertical)},addThumb:function(a){a=new Ext.slider.Thumb({value:a,slider:this,index:this.thumbs.length,constrain:this.constrainThumbs});this.thumbs.push(a);this.rendered&&a.render()},promoteThumb:function(a){for(var b=this.thumbs,c,d,e=0,g=b.length;e<g;e++){d=b[e];c=d==a?this.topThumbZIndex:"";d.el.setStyle("zIndex",
c)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.slider.MultiSlider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.focusEl=this.innerEl.child(".x-slider-focus");for(var a=0;a<this.thumbs.length;a++)this.thumbs[a].render();a=this.innerEl.child(".x-slider-thumb");
this.halfThumb=(this.vertical?a.getHeight():a.getWidth())/2;this.initEvents()},initEvents:function(){this.mon(this.el,{scope:this,mousedown:this.onMouseDown,keydown:this.onKeyDown});this.focusEl.swallowEvent("click",true)},onMouseDown:function(a){if(!this.disabled){for(var b=false,c=0;c<this.thumbs.length;c++)b=b||a.target==this.thumbs[c].el.dom;this.clickToChange&&!b&&this.onClickChange(this.innerEl.translatePoints(a.getXY()));this.focus()}},onClickChange:function(a){a.top>this.clickRange[0]&&a.top<
this.clickRange[1]&&this.setValue(this.getNearest(a,"left").index,Ext.util.Format.round(this.reverseValue(a.left),this.decimalPrecision),undefined,true)},getNearest:function(a,b){for(var c=this.reverseValue(b=="top"?this.innerEl.getHeight()-a[b]:a[b]),d=this.maxValue-this.minValue+5,e=null,g=0;g<this.thumbs.length;g++){var h=this.thumbs[g],i=Math.abs(h.value-c);if(Math.abs(i<=d)){e=h;d=i}}return e},onKeyDown:function(a){if(this.disabled||this.thumbs.length!==1)a.preventDefault();else switch(a.getKey()){case a.UP:case a.RIGHT:a.stopEvent();
a=a.ctrlKey?this.maxValue:this.getValue(0)+this.keyIncrement;this.setValue(0,a,undefined,true);break;case a.DOWN:case a.LEFT:a.stopEvent();a=a.ctrlKey?this.minValue:this.getValue(0)-this.keyIncrement;this.setValue(0,a,undefined,true);break;default:a.preventDefault()}},doSnap:function(a){if(!(this.increment&&a))return a;var b=a,c=this.increment;a=a%c;if(a!=0){b-=a;if(a*2>=c)b+=c;else if(a*2<-c)b-=c}return b.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.slider.MultiSlider.superclass.afterRender.apply(this,
arguments);for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a];if(b.value!==undefined){var c=this.normalizeValue(b.value);c!==b.value?this.setValue(a,c,false):this.moveThumb(a,this.translateValue(c),false)}}},getRatio:function(){var a=this.innerEl.getWidth(),b=this.maxValue-this.minValue;return b==0?a:a/b},normalizeValue:function(a){a=this.doSnap(a);a=Ext.util.Format.round(a,this.decimalPrecision);return a=a.constrain(this.minValue,this.maxValue)},setMinValue:function(a){this.minValue=a;for(var b=
0,c=this.thumbs,d=c.length,e;b<d;++b){e=c[b];e.value=e.value<a?a:e.value}this.syncThumb()},setMaxValue:function(a){this.maxValue=a;for(var b=0,c=this.thumbs,d=c.length,e;b<d;++b){e=c[b];e.value=e.value>a?a:e.value}this.syncThumb()},setValue:function(a,b,c,d){var e=this.thumbs[a];b=this.normalizeValue(b);if(b!==e.value&&this.fireEvent("beforechange",this,b,e.value,e)!==false){e.value=b;if(this.rendered){this.moveThumb(a,this.translateValue(b),c!==false);this.fireEvent("change",this,b,e);d&&this.fireEvent("changecomplete",
this,b,e)}}},translateValue:function(a){var b=this.getRatio();return a*b-this.minValue*b-this.halfThumb},reverseValue:function(a){var b=this.getRatio();return(a+this.minValue*b)/b},moveThumb:function(a,b,c){a=this.thumbs[a].el;!c||this.animate===false?a.setLeft(b):a.shift({left:b,stopFx:true,duration:0.35})},focus:function(){this.focusEl.focus(10)},onResize:function(a){for(var b=this.thumbs,c=b.length,d=0;d<c;++d)b[d].el.stopFx();Ext.isNumber(a)&&this.innerEl.setWidth(a-(this.el.getPadding("l")+this.endEl.getPadding("r")));
this.syncThumb();Ext.slider.MultiSlider.superclass.onResize.apply(this,arguments)},onDisable:function(){Ext.slider.MultiSlider.superclass.onDisable.call(this);for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a],c=b.el;b.disable();if(Ext.isIE){b=c.getXY();c.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder)this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass});this.thumbHolder.show().setXY(b)}}},onEnable:function(){Ext.slider.MultiSlider.superclass.onEnable.call(this);
for(var a=0;a<this.thumbs.length;a++){var b=this.thumbs[a],c=b.el;b.enable();if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;this.thumbHolder&&this.thumbHolder.hide();c.show();this.syncThumb()}}},syncThumb:function(){if(this.rendered)for(var a=0;a<this.thumbs.length;a++)this.moveThumb(a,this.translateValue(this.thumbs[a].value))},getValue:function(a){return this.thumbs[a].value},getValues:function(){for(var a=[],b=0;b<this.thumbs.length;b++)a.push(this.thumbs[b].value);
return a},beforeDestroy:function(){for(var a=this.thumbs,b=0,c=a.length;b<c;++b){a[b].destroy();a[b]=null}Ext.destroyMembers(this,"endEl","innerEl","focusEl","thumbHolder");Ext.slider.MultiSlider.superclass.beforeDestroy.call(this)}});Ext.reg("multislider",Ext.slider.MultiSlider);
Ext.slider.SingleSlider=Ext.extend(Ext.slider.MultiSlider,{constructor:function(a){a=a||{};Ext.applyIf(a,{values:[a.value||0]});Ext.slider.SingleSlider.superclass.constructor.call(this,a)},getValue:function(){return Ext.slider.SingleSlider.superclass.getValue.call(this,0)},setValue:function(){var a=Ext.toArray(arguments),b=a.length;if(b==1||b<=3&&typeof arguments[1]!="number")a.unshift(0);return Ext.slider.SingleSlider.superclass.setValue.apply(this,a)},syncThumb:function(){return Ext.slider.SingleSlider.superclass.syncThumb.apply(this,
[0].concat(arguments))},getNearest:function(){return this.thumbs[0]}});Ext.Slider=Ext.slider.SingleSlider;Ext.reg("slider",Ext.slider.SingleSlider);
Ext.slider.Vertical={onResize:function(a,b){this.innerEl.setHeight(b-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var a=this.maxValue-this.minValue;return this.innerEl.getHeight()/a},moveThumb:function(a,b,c){a=this.thumbs[a].el;!c||this.animate===false?a.setBottom(b):a.shift({bottom:b,stopFx:true,duration:0.35})},onClickChange:function(a){if(a.left>this.clickRange[0]&&a.left<this.clickRange[1]){var b=this.getNearest(a,"top").index;a=this.minValue+this.reverseValue(this.innerEl.getHeight()-
a.top);this.setValue(b,Ext.util.Format.round(a,this.decimalPrecision),undefined,true)}}};Ext.slider.Thumb.Vertical={getNewValue:function(){var a=this.slider,b=a.innerEl,c=b.translatePoints(this.tracker.getXY());b=b.getHeight()-c.top;return a.minValue+Ext.util.Format.round(b/a.getRatio(),a.decimalPrecision)}};
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(a,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(a,{cls:this.baseCls},true);if(this.id)this.el.dom.id=this.id;c=this.el.dom.firstChild;this.progressBar=Ext.get(c.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(c.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(c.offsetWidth)}this.progressBar.setHeight(c.offsetHeight)},
afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);this.value?this.updateProgress(this.value,this.text):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){a=
a||{};this.updateText(a.text);this.waitTimer=Ext.TaskMgr.start({run:function(b){var c=a.increment||10;b-=1;this.updateProgress(((b+c)%c+1)*(100/c)*0.01,null,a.animate)},interval:a.interval||1E3,duration:a.duration,onStop:function(){if(a.fn)a.fn.apply(a.scope||this);this.reset()},scope:this})}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(a,b){Ext.ProgressBar.superclass.setSize.call(this,a,b);if(this.textTopEl){var c=this.el.dom.firstChild;this.textEl.setSize(c.offsetWidth,c.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(c,d,e){c&&this.init(c,d,e)};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(c,d){if(Ext.isNumber(d))d={left:d,right:d,top:d,bottom:d};d=d||this.defaultPadding;var e=Ext.get(this.getEl()).getBox(),g=Ext.get(c),h=g.getScroll(),i;i=g.dom;if(i==document.body)i={x:h.left,y:h.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()};else{g=g.getXY();i={x:g[0],y:g[1],width:i.clientWidth,height:i.clientHeight}}g=e.y-i.y;h=e.x-i.x;this.resetConstraints();this.setXConstraint(h-
(d.left||0),i.width-h-e.width-(d.right||0),this.xTickSize);this.setYConstraint(g-(d.top||0),i.height-g-e.height-(d.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(c,d,e){this.initTarget(c,d,e);a.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(c,d,e){this.config=e||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof c!=="string")c=Ext.id(c);this.id=
c;this.addToGroup(d?d:"default");this.handleElId=c;this.setDragElId(c);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(c,d,e,g){this.padding=!d&&0!==d?[c,c,c,c]:!e&&0!==e?[c,d,c,d]:[c,d,e,g]},setInitPosition:function(c,d){var e=this.getEl();if(this.DDM.verifyEl(e)){var g=c||0,h=d||0;e=b.getXY(e);this.initPageX=e[0]-g;this.initPageY=e[1]-h;this.lastPageX=e[0];this.lastPageY=e[1];this.setStartPosition(e)}},setStartPosition:function(c){c=c||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=c[0];this.startPageY=c[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},
removeFromGroup:function(c){this.groups[c]&&delete this.groups[c];this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string")c=Ext.id(c);this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string")c=Ext.id(c);a.on(c,"mousedown",this.handleMouseDown,this);this.setHandleElId(c);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(c){if(!(this.primaryButtonOnly&&c.button!=0))if(!this.isLocked()){this.DDM.refreshCache(this.groups);var d=new Ext.lib.Point(Ext.lib.Event.getPageX(c),Ext.lib.Event.getPageY(c));if(this.hasOuterHandles||this.DDM.isOverTarget(d,this))if(this.clickValidator(c)){this.setStartPosition();this.b4MouseDown(c);this.onMouseDown(c);this.DDM.handleMouseDown(c,this);if(this.preventDefault||this.stopPropagation){this.preventDefault&&
c.preventDefault();this.stopPropagation&&c.stopPropagation()}else this.DDM.stopEvent(c)}}},clickValidator:function(c){c=c.getTarget();return this.isValidHandleChild(c)&&(this.id==this.handleElId||this.DDM.handleWasClicked(c,this.id))},addInvalidHandleType:function(c){c=c.toUpperCase();this.invalidHandleTypes[c]=c},addInvalidHandleId:function(c){if(typeof c!=="string")c=Ext.id(c);this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(c){delete this.invalidHandleTypes[c.toUpperCase()]},
removeInvalidHandleId:function(c){if(typeof c!=="string")c=Ext.id(c);delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(c){for(var d=0,e=this.invalidHandleClasses.length;d<e;++d)this.invalidHandleClasses[d]==c&&delete this.invalidHandleClasses[d]},isValidHandleChild:function(c){var d=true,e;try{e=c.nodeName.toUpperCase()}catch(g){e=c.nodeName}d=(d=d&&!this.invalidHandleTypes[e])&&!this.invalidHandleIds[c.id];e=0;for(var h=this.invalidHandleClasses.length;d&&e<h;++e)d=!Ext.fly(c).hasClass(this.invalidHandleClasses[e]);
return d},setXTicks:function(c,d){this.xTicks=[];this.xTickSize=d;for(var e={},g=this.initPageX;g>=this.minX;g-=d)if(!e[g]){this.xTicks[this.xTicks.length]=g;e[g]=true}for(g=this.initPageX;g<=this.maxX;g+=d)if(!e[g]){this.xTicks[this.xTicks.length]=g;e[g]=true}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(c,d){this.yTicks=[];this.yTickSize=d;for(var e={},g=this.initPageY;g>=this.minY;g-=d)if(!e[g]){this.yTicks[this.yTicks.length]=g;e[g]=true}for(g=this.initPageY;g<=this.maxY;g+=d)if(!e[g]){this.yTicks[this.yTicks.length]=
g;e[g]=true}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(c,d,e){this.leftConstraint=c;this.rightConstraint=d;this.minX=this.initPageX-c;this.maxX=this.initPageX+d;e&&this.setXTicks(this.initPageX,e);this.constrainX=true},clearConstraints:function(){this.constrainY=this.constrainX=false;this.clearTicks()},clearTicks:function(){this.yTicks=this.xTicks=null;this.yTickSize=this.xTickSize=0},setYConstraint:function(c,d,e){this.topConstraint=c;this.bottomConstraint=d;this.minY=this.initPageY-
c;this.maxY=this.initPageY+d;e&&this.setYTicks(this.initPageY,e);this.constrainY=true},resetConstraints:function(){this.initPageX||this.initPageX===0?this.setInitPosition(this.maintainOffset?this.lastPageX-this.initPageX:0,this.maintainOffset?this.lastPageY-this.initPageY:0):this.setInitPosition();this.constrainX&&this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);this.constrainY&&this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)},getTick:function(c,
d){if(d)if(d[0]>=c)return d[0];else{for(var e=0,g=d.length;e<g;++e){var h=e+1;if(d[h]&&d[h]>=c)return d[h]-c>c-d[e]?d[e]:d[h]}return d[d.length-1]}else return c},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,notifyOccluded:false,_execOnAll:function(b,c){for(var d in this.ids)for(var e in this.ids[d]){var g=this.ids[d][e];this.isTypeOfDD(g)&&g[b].apply(g,c)}},_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,c){this.initialized||
this.init();this.ids[c]||(this.ids[c]={});this.ids[c][b.id]=b},removeDDFromGroup:function(b,c){this.ids[c]||(this.ids[c]={});var d=this.ids[c];d&&d[b.id]&&delete d[b.id]},_remove:function(b){for(var c in b.groups)c&&this.ids[c]&&this.ids[c][b.id]&&delete this.ids[c][b.id];delete this.handleIds[b.id]},regHandle:function(b,c){this.handleIds[b]||(this.handleIds[b]={});this.handleIds[b][c]=c},isDragDrop:function(b){return this.getDDById(b)?true:false},getRelated:function(b,c){var d=[],e;for(e in b.groups)for(var g in this.ids[e]){var h=
this.ids[e][g];if(this.isTypeOfDD(h))if(!c||h.isTarget)d[d.length]=h}return d},isLegalTarget:function(b,c){for(var d=this.getRelated(b,true),e=0,g=d.length;e<g;++e)if(d[e].id==c.id)return true;return false},isTypeOfDD:function(b){return b&&b.__ygDragDrop},isHandle:function(b,c){return this.handleIds[b]&&this.handleIds[b][c]},getDDById:function(b){for(var c in this.ids)if(this.ids[c][b])return this.ids[c][b];return null},handleMouseDown:function(b,c){Ext.QuickTips&&Ext.QuickTips.ddDisable();this.dragCurrent&&
this.handleMouseUp(b);this.currentTarget=b.getTarget();this.dragCurrent=c;var d=c.getEl();this.startX=b.getPageX();this.startY=b.getPageY();this.deltaX=this.startX-d.offsetLeft;this.deltaY=this.startY-d.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=Ext.dd.DDM;e.startDrag(e.startX,e.startY)},this.clickTimeThresh)},startDrag:function(b,c){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(b,c);this.dragCurrent.startDrag(b,c)}this.dragThreshMet=
true},handleMouseUp:function(b){Ext.QuickTips&&Ext.QuickTips.ddEnable();if(this.dragCurrent){clearTimeout(this.clickTimeout);this.dragThreshMet&&this.fireEvents(b,true);this.stopDrag(b);this.stopEvent(b)}},stopEvent:function(b){this.stopPropagation&&b.stopPropagation();this.preventDefault&&b.preventDefault()},stopDrag:function(b){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(b);this.dragCurrent.endDrag(b)}this.dragCurrent.onMouseUp(b)}this.dragCurrent=null;this.dragOvers=
{}},handleMouseMove:function(b){if(!this.dragCurrent)return true;if(Ext.isIE&&b.button!==0&&b.button!==1&&b.button!==2){this.stopEvent(b);return this.handleMouseUp(b)}if(!this.dragThreshMet){var c=Math.abs(this.startX-b.getPageX()),d=Math.abs(this.startY-b.getPageY());if(c>this.clickPixelThresh||d>this.clickPixelThresh)this.startDrag(this.startX,this.startY)}if(this.dragThreshMet){this.dragCurrent.b4Drag(b);this.dragCurrent.onDrag(b);this.dragCurrent.moveOnly||this.fireEvents(b,false)}this.stopEvent(b);
return true},fireEvents:function(b,c){var d=this.dragCurrent,e=b.getPoint(),g,h,i=[],j=[],k=[],m=[],p=[],o=[],s,l,n;if(!(!d||d.isLocked())){for(l in this.dragOvers){g=this.dragOvers[l];if(this.isTypeOfDD(g)){this.isOverTarget(e,g,this.mode)||k.push(g);j[l]=true;delete this.dragOvers[l]}}for(n in d.groups)if("string"==typeof n)for(l in this.ids[n]){g=this.ids[n][l];if(this.isTypeOfDD(g)&&(h=g.getEl())&&g.isTarget&&!g.isLocked()&&(g!=d||d.ignoreSelf===false)){if((g.zIndex=this.getZIndex(h))!==-1)s=
true;i.push(g)}}s&&i.sort(this.byZIndex);l=0;for(h=i.length;l<h;l++){g=i[l];if(this.isOverTarget(e,g,this.mode)){if(c)p.push(g);else{j[g.id]?m.push(g):o.push(g);this.dragOvers[g.id]=g}if(!this.notifyOccluded)break}}if(this.mode){if(k.length){d.b4DragOut(b,k);d.onDragOut(b,k)}o.length&&d.onDragEnter(b,o);if(m.length){d.b4DragOver(b,m);d.onDragOver(b,m)}if(p.length){d.b4DragDrop(b,p);d.onDragDrop(b,p)}}else{l=0;for(h=k.length;l<h;++l){d.b4DragOut(b,k[l].id);d.onDragOut(b,k[l].id)}l=0;for(h=o.length;l<
h;++l)d.onDragEnter(b,o[l].id);l=0;for(h=m.length;l<h;++l){d.b4DragOver(b,m[l].id);d.onDragOver(b,m[l].id)}l=0;for(h=p.length;l<h;++l){d.b4DragDrop(b,p[l].id);d.onDragDrop(b,p[l].id)}}c&&!p.length&&d.onInvalidDrop(b)}},getZIndex:function(b){var c=document.body,d,e=-1;for(b=Ext.getDom(b);b!==c;){if(!isNaN(d=Number(Ext.fly(b).getStyle("zIndex"))))e=d;b=b.parentNode}return e},byZIndex:function(b,c){return b.zIndex<c.zIndex},getBestMatch:function(b){var c=null,d=b.length;if(d==1)c=b[0];else for(var e=
0;e<d;++e){var g=b[e];if(g.cursorIsOver){c=g;break}else if(!c||c.overlap.getArea()<g.overlap.getArea())c=g}return c},refreshCache:function(b){for(var c in b)if("string"==typeof c)for(var d in this.ids[c]){var e=this.ids[c][d];if(this.isTypeOfDD(e)){var g=this.getLocation(e);if(g)this.locationCache[e.id]=g;else delete this.locationCache[e.id]}}},verifyEl:function(b){if(b){var c;if(Ext.isIE)try{c=b.offsetParent}catch(d){}else c=b.offsetParent;if(c)return true}return false},getLocation:function(b){if(!this.isTypeOfDD(b))return null;
var c=b.getEl(),d,e,g;try{d=Ext.lib.Dom.getXY(c)}catch(h){}if(!d)return null;e=d[0];g=e+c.offsetWidth;d=d[1];return new Ext.lib.Region(d-b.padding[0],g+b.padding[1],d+c.offsetHeight+b.padding[2],e-b.padding[3])},isOverTarget:function(b,c,d){var e=this.locationCache[c.id];if(!e||!this.useCache){e=this.getLocation(c);this.locationCache[c.id]=e}if(!e)return false;c.cursorIsOver=e.contains(b);var g=this.dragCurrent;if(!g||!g.getTargetCoord||!d&&!g.constrainX&&!g.constrainY)return c.cursorIsOver;c.overlap=
null;b=g.getTargetCoord(b.x,b.y);g=g.getDragEl();if(e=(new Ext.lib.Region(b.y,b.x+g.offsetWidth,b.y+g.offsetHeight,b.x)).intersect(e)){c.overlap=e;return d?true:c.cursorIsOver}else return false},_onUnload:function(){a.removeListener(document,"mouseup",this.handleMouseUp,this);a.removeListener(document,"mousemove",this.handleMouseMove,this);a.removeListener(window,"resize",this._onResize,this);Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=
null}this._execOnAll("unreg",[]);for(var b in this.elementCache)delete this.elementCache[b];this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(b){var c=this.elementCache[b];if(!c||!c.el)c=this.elementCache[b]=new this.ElementWrapper(Ext.getDom(b));return c},getElement:function(b){return Ext.getDom(b)},getCss:function(b){return(b=Ext.getDom(b))?b.style:null},ElementWrapper:function(b){this.id=(this.el=b||null)&&b.id;this.css=this.el&&b.style},getPosX:function(b){return Ext.lib.Dom.getX(b)},
getPosY:function(b){return Ext.lib.Dom.getY(b)},swapNode:function(b,c){if(b.swapNode)b.swapNode(c);else{var d=c.parentNode,e=c.nextSibling;if(e==b)d.insertBefore(b,c);else if(c==b.nextSibling)d.insertBefore(c,b);else{b.parentNode.replaceChild(c,b);d.insertBefore(b,e)}}},getScroll:function(){var b,c,d=document.documentElement,e=document.body;if(d&&(d.scrollTop||d.scrollLeft)){b=d.scrollTop;c=d.scrollLeft}else if(e){b=e.scrollTop;c=e.scrollLeft}return{top:b,left:c}},getStyle:function(b,c){return Ext.fly(b).getStyle(c)},
getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(b,c){var d=Ext.lib.Dom.getXY(c);Ext.lib.Dom.setXY(b,d)},numericSort:function(b,c){return b-c},_timeoutCount:0,_addListeners:function(){var b=Ext.dd.DDM;if(Ext.lib.Event&&document)b._onLoad();else if(!(b._timeoutCount>2E3)){setTimeout(b._addListeners,10);if(document&&document.body)b._timeoutCount+=1}},handleWasClicked:function(b,c){if(this.isHandle(c,b.id))return true;else for(var d=
b.parentNode;d;)if(this.isHandle(c,d.id))return true;else d=d.parentNode;return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(a,b,c){a&&this.init(a,b,c)};
Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(a,b){this.setDelta(a-this.startPageX,b-this.startPageY)},setDelta:function(a,b){this.deltaX=a;this.deltaY=b},setDragElPos:function(a,b){this.alignElWithMouse(this.getDragEl(),a,b)},alignElWithMouse:function(a,b,c){b=this.getTargetCoord(b,c);var d=a.dom?a:Ext.fly(a,"_dd");if(this.deltaSetXY)d.setLeftTop(b.x+this.deltaSetXY[0],b.y+this.deltaSetXY[1]);else{d.setXY([b.x,b.y]);c=d.getLeft(true);d=d.getTop(true);this.deltaSetXY=[c-b.x,
d-b.y]}this.cachePosition(b.x,b.y);this.autoScroll(b.x,b.y,a.offsetHeight,a.offsetWidth);return b},cachePosition:function(a,b){if(a){this.lastPageX=a;this.lastPageY=b}else{var c=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=c[0];this.lastPageY=c[1]}},autoScroll:function(a,b,c,d){if(this.scroll){var e=Ext.lib.Dom.getViewHeight(),g=Ext.lib.Dom.getViewWidth(),h=this.DDM.getScrollTop(),i=this.DDM.getScrollLeft();d=d+a;var j=e+h-b-this.deltaY,k=g+i-a-this.deltaX,m=document.all?80:30;c+b>e&&j<40&&window.scrollTo(i,
h+m);b<h&&h>0&&b-h<40&&window.scrollTo(i,h-m);d>g&&k<40&&window.scrollTo(i+m,h);a<i&&i>0&&a-i<40&&window.scrollTo(i-m,h)}},getTargetCoord:function(a,b){var c=a-this.deltaX,d=b-this.deltaY;if(this.constrainX){if(c<this.minX)c=this.minX;if(c>this.maxX)c=this.maxX}if(this.constrainY){if(d<this.minY)d=this.minY;if(d>this.maxY)d=this.maxY}c=this.getTick(c,this.xTicks);d=this.getTick(d,this.yTicks);return{x:c,y:d}},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,b,c){if(a){this.init(a,b,c);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";
Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var a=this,b=document.body;if(!b||!b.firstChild)setTimeout(function(){a.createFrame()},50);else{var c=this.getDragEl();if(!c){c=document.createElement("div");c.id=this.dragElId;var d=c.style;d.position="absolute";d.visibility="hidden";d.cursor="move";d.border="2px solid #aaa";d.zIndex=999;b.insertBefore(c,b.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(a,b){this.getEl();var c=this.getDragEl(),d=c.style;this._resizeProxy();this.centerFrame&&this.setDelta(Math.round(parseInt(d.width,10)/2),Math.round(parseInt(d.height,10)/2));this.setDragElPos(a,b);Ext.fly(c).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();a=a.getPageY();this.autoOffset(b,a);this.setDragElPos(b,a)},b4StartDrag:function(a,b){this.showFrame(a,b)},b4EndDrag:function(){Ext.fly(this.getDragEl()).hide()},endDrag:function(){var a=this.getEl(),b=this.getDragEl();b.style.visibility="";this.beforeMove();a.style.visibility="hidden";Ext.dd.DDM.moveToEl(a,b);b.style.visibility="hidden";a.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return"DDProxy "+
this.id}});Ext.dd.DDTarget=function(a,b,c){a&&this.initTarget(a,b,c)};
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);delete this.el},onMouseDown:function(a,b){if(this.fireEvent("mousedown",this,a)!==false&&this.onBeforeStart(a)!==false){this.startXY=this.lastXY=a.getXY();this.dragTarget=this.delegate?b:this.el.dom;this.preventDefault!==false&&a.preventDefault();Ext.getDoc().on({scope:this,mouseup:this.onMouseUp,mousemove:this.onMouseMove,selectstart:this.stopSelect});if(this.autoStart)this.timer=this.triggerStart.defer(this.autoStart===true?1E3:this.autoStart,this,[a])}},onMouseMove:function(a){var b=
Ext.isIE6||Ext.isIE7||Ext.isIE8;if(this.active&&b&&!a.browserEvent.button){a.preventDefault();this.onMouseUp(a)}else{a.preventDefault();b=a.getXY();var 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(a);else return;this.fireEvent("mousemove",this,a);this.onDrag(a);this.fireEvent("drag",this,a)}},onMouseUp:function(a){var b=Ext.getDoc(),c=this.active;b.un("mousemove",this.onMouseMove,this);b.un("mouseup",this.onMouseUp,
this);b.un("selectstart",this.stopSelect,this);a.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,a);if(c){this.onEnd(a);this.fireEvent("dragend",this,a)}},triggerStart:function(a){this.clearStart();this.active=true;this.onStart(a);this.fireEvent("dragstart",this,a)},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(a){a=this.getXY(a);var b=this.startXY;return[b[0]-a[0],b[1]-a[1]]},constrainModes:{point:function(a){if(!this.elRegion)this.elRegion=this.getDragCt().getRegion();var b=this.dragRegion;b.left=a[0];b.top=a[1];b.right=a[0];b.bottom=a[1];b.constrainTo(this.elRegion);return[b.left,
b.top]}}});
Ext.dd.ScrollManager=function(){var a=Ext.dd.DragDropMgr,b={},c=null,d={},e=function(){a.dragCurrent&&a.refreshCache(a.dragCurrent.groups)},g=function(){if(a.dragCurrent){var j=Ext.dd.ScrollManager,k=d.el.ddScrollConfig?d.el.ddScrollConfig.increment:j.increment;if(j.animate)d.el.scroll(d.dir,k,true,j.animDuration,e);else d.el.scroll(d.dir,k)&&e()}},h=function(){d.id&&clearInterval(d.id);d.id=0;d.el=null;d.dir=""},i=function(j,k){h();d.el=j;d.dir=k;var m=j.ddScrollConfig?j.ddScrollConfig.ddGroup:undefined,
p=j.ddScrollConfig&&j.ddScrollConfig.frequency?j.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;if(m===undefined||a.dragCurrent.ddGroup==m)d.id=setInterval(g,p)};a.fireEvents=a.fireEvents.createSequence(function(j,k){if(!(k||!a.dragCurrent)){var m=Ext.dd.ScrollManager;if(!c||c!=a.dragCurrent){c=a.dragCurrent;m.refreshCache()}var p=Ext.lib.Event.getXY(j);p=new Ext.lib.Point(p[0],p[1]);for(var o in b){var s=b[o],l=s._region,n=s.ddScrollConfig?s.ddScrollConfig:m;if(l&&l.contains(p)&&s.isScrollable())if(l.bottom-
p.y<=n.vthresh){d.el!=s&&i(s,"down");return}else if(l.right-p.x<=n.hthresh){d.el!=s&&i(s,"left");return}else if(p.y-l.top<=n.vthresh){d.el!=s&&i(s,"up");return}else if(p.x-l.left<=n.hthresh){d.el!=s&&i(s,"right");return}}h()}},a);a.stopDrag=a.stopDrag.createSequence(function(){c=null;h()},a);return{register:function(j){if(Ext.isArray(j))for(var k=0,m=j.length;k<m;k++)this.register(j[k]);else{j=Ext.get(j);b[j.id]=j}},unregister:function(j){if(Ext.isArray(j))for(var k=0,m=j.length;k<m;k++)this.unregister(j[k]);
else{j=Ext.get(j);delete b[j.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,ddGroup:undefined,refreshCache:function(){for(var j in b)if(typeof b[j]=="object")b[j]._region=b[j].getRegion()}}}();
Ext.dd.Registry=function(){var a={},b={},c=0,d=function(e,g){if(typeof e=="string")return e;var h=e.id;if(!h&&g!==false){h="extdd-"+ ++c;e.id=h}return h};return{register:function(e,g){g=g||{};if(typeof e=="string")e=document.getElementById(e);g.ddel=e;a[d(e)]=g;if(g.isHandle!==false)b[g.ddel.id]=g;if(g.handles)for(var h=g.handles,i=0,j=h.length;i<j;i++)b[d(h[i])]=g},unregister:function(e){e=d(e,false);var g=a[e];if(g){delete a[e];if(g.handles){e=g.handles;g=0;for(var h=e.length;g<h;g++)delete b[d(e[g],
false)]}}},getHandle:function(e){if(typeof e!="string")e=e.id;return b[e]},getHandleFromEvent:function(e){return(e=Ext.lib.Event.getTarget(e))?b[e.id]:null},getTarget:function(e){if(typeof e!="string")e=e.id;return a[e]},getTargetFromEvent:function(e){return(e=Ext.lib.Event.getTarget(e))?a[e.id]||b[e.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)}(a=
this.ghost.dom.firstChild)&&Ext.fly(a).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||
0.5,easing:"easeOut",xy:a,stopFx:true,callback:this.afterRepair,scope:this})}else this.afterRepair()},afterRepair:function(){this.hide(true);if(typeof this.callback=="function")this.callback.call(this.scope||this);this.scope=this.callback=null},destroy:function(){Ext.destroy(this.ghost,this.el)}};
Ext.dd.DragSource=function(a,b){this.el=Ext.get(a);if(!this.dragData)this.dragData={};Ext.apply(this,b);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(a,b){var c=Ext.dd.DragDropMgr.getDDById(b);this.cachedTarget=c;if(this.beforeDragEnter(c,a,b)!==false){c.isNotifyTarget?this.proxy.setStatus(c.notifyEnter(this,a,this.dragData)):this.proxy.setStatus(this.dropAllowed);this.afterDragEnter&&this.afterDragEnter(c,a,b)}},beforeDragEnter:function(){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,
arguments);this.proxy.sync()},onDragOver:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragOver(c,a,b)!==false){c.isNotifyTarget&&this.proxy.setStatus(c.notifyOver(this,a,this.dragData));this.afterDragOver&&this.afterDragOver(c,a,b)}},beforeDragOver:function(){return true},onDragOut:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragOut(c,a,b)!==false){c.isNotifyTarget&&c.notifyOut(this,a,this.dragData);this.proxy.reset();
this.afterDragOut&&this.afterDragOut(c,a,b)}this.cachedTarget=null},beforeDragOut:function(){return true},onDragDrop:function(a,b){var c=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(b);if(this.beforeDragDrop(c,a,b)!==false){if(c.isNotifyTarget)c.notifyDrop(this,a,this.dragData)?this.onValidDrop(c,a,b):this.onInvalidDrop(c,a,b);else this.onValidDrop(c,a,b);this.afterDragDrop&&this.afterDragDrop(c,a,b)}delete this.cachedTarget},beforeDragDrop:function(){return true},onValidDrop:function(a,b,c){this.hideProxy();
this.afterValidDrop&&this.afterValidDrop(a,b,c)},getRepairXY:function(){return this.el.getXY()},onInvalidDrop:function(a,b,c){this.beforeInvalidDrop(a,b,c);if(this.cachedTarget){this.cachedTarget.isNotifyTarget&&this.cachedTarget.notifyOut(this,b,this.dragData);this.cacheTarget=null}this.proxy.repair(this.getRepairXY(b,this.dragData),this.afterRepair,this);this.afterInvalidDrop&&this.afterInvalidDrop(b,c)},afterRepair:function(){if(Ext.enableFx)this.el.highlight(this.hlColor||"c3daf9");this.dragging=
false},beforeInvalidDrop:function(){return true},handleMouseDown:function(a){if(!this.dragging){var b=this.getDragData(a);if(b&&this.onBeforeDrag(b,a)!==false){this.dragData=b;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(a,b){var c=this.el.dom.cloneNode(true);
c.id=Ext.id();this.proxy.update(c);this.onStartDrag(a,b);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=Ext.extend(Ext.dd.DDTarget,{constructor:function(a,b){this.el=Ext.get(a);Ext.apply(this,b);this.containerScroll&&Ext.dd.ScrollManager.register(this.el);Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})},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},destroy:function(){Ext.dd.DropTarget.superclass.destroy.call(this);this.containerScroll&&Ext.dd.ScrollManager.unregister(this.el)}});
Ext.dd.DragZone=Ext.extend(Ext.dd.DragSource,{constructor:function(a,b){Ext.dd.DragZone.superclass.constructor.call(this,a,b);this.containerScroll&&Ext.dd.ScrollManager.register(this.el)},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(){if(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()},destroy:function(){Ext.dd.DragZone.superclass.destroy.call(this);this.containerScroll&&Ext.dd.ScrollManager.unregister(this.el)}});Ext.dd.DropZone=function(a,b){Ext.dd.DropZone.superclass.constructor.call(this,a,b)};
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(a,b,c){var d=this.getTargetFromEvent(b);if(!d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,
a,b,c);this.lastOverNode=null}return this.onContainerOver(a,b,c)}if(this.lastOverNode!=d){this.lastOverNode&&this.onNodeOut(this.lastOverNode,a,b,c);this.onNodeEnter(d,a,b,c);this.lastOverNode=d}return this.onNodeOver(d,a,b,c)},notifyOut:function(a,b,c){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,b,c);this.lastOverNode=null}},notifyDrop:function(a,b,c){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,a,b,c);this.lastOverNode=null}var d=this.getTargetFromEvent(b);return d?this.onNodeDrop(d,
a,b,c):this.onContainerDrop(a,b,c)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.Element.addMethods({initDD:function(a,b,c){a=new Ext.dd.DD(Ext.id(this.dom),a,b);return Ext.apply(a,c)},initDDProxy:function(a,b,c){a=new Ext.dd.DDProxy(Ext.id(this.dom),a,b);return Ext.apply(a,c)},initDDTarget:function(a,b,c){a=new Ext.dd.DDTarget(Ext.id(this.dom),a,b);return Ext.apply(a,c)}});
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(b){return Ext.data.Api.actions[b]?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(b){var c=[],d=this.actions,e;for(e in b)e in d||c.push(e);return!c.length?true:c},hasUniqueUrl:function(b,
c){var d=b.api[c]?b.api[c].url:null,e=true,g;for(g in b.api)if((e=g===c?true:b.api[g].url!=d?true:false)===false)break;return e},prepare:function(b){if(!b.api)b.api={};for(var c in this.actions){var d=this.actions[c];b.api[d]=b.api[d]||b.url||b.directFn;if(typeof b.api[d]=="string")b.api[d]={url:b.api[d],method:b.restful===true?Ext.data.Api.restActions[d]:undefined}}},restify:function(b){b.restful=true;for(var c in this.restActions)b.api[this.actions[c]].method||(b.api[this.actions[c]].method=this.restActions[c]);
b.onWrite=b.onWrite.createInterceptor(function(d,e,g,h){var i=new Ext.data.Response({action:d,raw:g});switch(g.status){case 200:return true;case 201:if(Ext.isEmpty(i.raw.responseText))i.success=true;else return true;break;case 204:i.success=true;i.data=null;break;default:return true}i.success===true?this.fireEvent("write",this,d,i.data,i,h,e.request.arg):this.fireEvent("exception",this,"remote",d,e,i,h);e.request.callback.call(e.request.scope,i.data,i,i.success);return false},b)}}}();
Ext.data.Response=function(a,b){Ext.apply(this,a,{raw:b})};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(a){a=parseFloat(String(a).replace(/,/g,""));return isNaN(a)?0:a},asInt:function(a){a=parseInt(String(a).replace(/,/g,
""),10);return isNaN(a)?0:a}};Ext.data.Record=function(a,b){this.id=b||b===0?b:Ext.data.Record.id(this);this.data=a||{}};Ext.data.Record.create=function(a){var b=Ext.extend(Ext.data.Record,{}),c=b.prototype;c.fields=new Ext.util.MixedCollection(false,function(g){return g.name});for(var d=0,e=a.length;d<e;d++)c.fields.add(new Ext.data.Field(a[d]));b.getField=function(g){return c.fields.get(g)};return b};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)){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(a){var b=this.modified,c;for(c in b)if(typeof b[c]!="function")this.data[c]=b[c];this.dirty=false;delete this.modified;this.editing=false;a!==true&&this.afterReject()},
commit:function(a){this.dirty=false;delete this.modified;this.editing=false;a!==true&&this.afterCommit()},getChanges:function(){var a=this.modified,b={},c;for(c in a)if(a.hasOwnProperty(c))b[c]=this.data[c];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 b=["field1"],c=!Ext.isArray(a[0]);if(!c)for(var d=2,e=a[0].length;d<=e;++d)b.push("field"+d);return new Ext.data.ArrayStore({fields:b,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(b){return b.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 if(this.autoLoad)this.load.defer(10,
this,[typeof this.autoLoad=="object"?this.autoLoad:undefined]);this.batchCounter=0;this.batches={}},buildWriter:function(a){var b=undefined;switch((a.format||"json").toLowerCase()){case "json":b=Ext.data.JsonWriter;break;case "xml":b=Ext.data.XmlWriter;break;default:b=Ext.data.JsonWriter}return new b(a)},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){var b,c,d;a=[].concat(a);if(!(a.length<1)){b=0;for(c=a.length;b<c;b++){d=a[b];d.join(this);if(d.dirty||d.phantom)this.modified.push(d)}b=this.data.length;this.data.addAll(a);this.snapshot&&this.snapshot.addAll(a);this.fireEvent("add",this,a,b)}},addSorted:function(a){this.insert(this.findInsertIndex(a),a)},doUpdate:function(a){var b=a.id;this.getById(b).join(null);this.data.replace(b,a);this.snapshot&&this.snapshot.replace(b,a);a.join(this);this.fireEvent("update",this,a,Ext.data.Record.COMMIT)},
remove:function(a){if(Ext.isArray(a))Ext.each(a,function(c){this.remove(c)},this);else{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(a){var b=[];this.each(function(c){b.push(c)});this.clearData();this.snapshot&&this.snapshot.clear();if(this.pruneModifiedRecords)this.modified=
[];a!==true&&this.fireEvent("clear",this,b)},onClear:function(a,b){Ext.each(b,function(c,d){this.destroyRecord(this,c,d)},this)},insert:function(a,b){var c,d,e;b=[].concat(b);c=0;for(d=b.length;c<d;c++){e=b[c];this.data.insert(a+c,e);e.join(this);if(e.dirty||e.phantom)this.modified.push(e)}this.snapshot&&this.snapshot.addAll(b);this.fireEvent("add",this,b,a)},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(a,b,c){if(c==Ext.data.Record.EDIT&&this.autoSave===true&&(!b.phantom||b.phantom&&b.isValid()))this.save()},createRecords:function(a,b){var c=this.modified,d=b.length,e,g;for(g=0;g<d;g++){e=b[g];if(e.phantom&&e.isValid()){e.markDirty();c.indexOf(e)==-1&&c.push(e)}}this.autoSave===true&&this.save()},destroyRecord:function(a,b,c){this.modified.indexOf(b)!=-1&&this.modified.remove(b);if(!b.phantom){this.removed.push(b);b.lastIndex=
c;this.autoSave===true&&this.save()}},execute:function(a,b,c,d){if(!Ext.data.Api.isAction(a))throw new Ext.data.Api.Error("execute",a);c=Ext.applyIf(c||{},{params:{}});d!==undefined&&this.addToBatch(d);var e=true;if(a==="read"){e=this.fireEvent("beforeload",this,c);Ext.applyIf(c.params,this.baseParams)}else{if(this.writer.listful===true&&this.restful!==true)b=Ext.isArray(b)?b:[b];else if(Ext.isArray(b)&&b.length==1)b=b.shift();if((e=this.fireEvent("beforewrite",this,a,b,c))!==false)this.writer.apply(c.params,
this.baseParams,a,b)}if(e!==false){if(this.writer&&this.proxy.url&&!this.proxy.restful&&!Ext.data.Api.hasUniqueUrl(this.proxy,a))c.params.xaction=a;this.proxy.request(Ext.data.Api.actions[a],b,c.params,this.reader,this.createCallback(a,b,d),this,c)}return e},save:function(){if(!this.writer)throw new Ext.data.Store.Error("writer-undefined");var a=[],b,c,d,e={},g;this.removed.length&&a.push(["destroy",this.removed]);b=[].concat(this.getModifiedRecords());if(b.length){c=[];for(g=b.length-1;g>=0;g--)if(b[g].phantom===
true){d=b.splice(g,1).shift();d.isValid()&&c.push(d)}else b[g].isValid()||b.splice(g,1);c.length&&a.push(["create",c]);b.length&&a.push(["update",b])}if(b=a.length){d=++this.batchCounter;for(g=0;g<b;++g){c=a[g];e[c[0]]=c[1]}if(this.fireEvent("beforesave",this,e)!==false){for(g=0;g<b;++g){c=a[g];this.doTransaction(c[0],c[1],d)}return d}}return-1},doTransaction:function(a,b,c){if(this.batch===false)for(var d=0,e=b.length;d<e;d++)try{this.execute(a,b[d],undefined,c)}catch(g){this.handleException(g)}else try{this.execute(a,
b,undefined,c)}catch(h){this.handleException(h)}},addToBatch:function(a){var b=this.batches,c=this.batchKey+a,d=b[c];d||(b[c]=d={id:a,count:0,data:{}});++d.count},removeFromBatch:function(a,b,c){var d=this.batches,e=this.batchKey+a,g=d[e],h;if(g){h=g.data[b]||[];g.data[b]=h.concat(c);if(g.count===1){c=g.data;delete d[e];this.fireEvent("save",this,a,c)}else--g.count}},createCallback:function(a,b,c){return a=="read"?this.loadRecords:function(d,e,g){this["on"+Ext.util.Format.capitalize(a)+"Records"](g,
b,[].concat(d));g===true&&this.fireEvent("write",this,a,d,e,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,c=a.length;b<c;b++)this.reMap(a[b]);else{delete this.data.map[a._phid];this.data.map[a.id]=a;this.data.keys.splice(this.data.keys.indexOf(a._phid),1,a.id);delete a._phid}},onCreateRecords:function(a,
b,c){if(a===true)try{this.reader.realize(b,c)}catch(d){this.handleException(d);Ext.isArray(b)&&this.onCreateRecords(a,b,c)}},onUpdateRecords:function(a,b,c){if(a===true)try{this.reader.update(b,c)}catch(d){this.handleException(d);Ext.isArray(b)&&this.onUpdateRecords(a,b,c)}},onDestroyRecords:function(a,b){b=b instanceof Ext.data.Record?[b]:[].concat(b);for(var c=0,d=b.length;c<d;c++)this.removed.splice(this.removed.indexOf(b[c]),1);if(a===false)for(c=b.length-1;c>=0;c--)this.insert(b[c].lastIndex,
b[c])},handleException:function(a){Ext.handleError(a)},reload:function(a){this.load(Ext.applyIf(a||{},this.lastOptions))},loadRecords:function(a,b,c){var d;if(this.isDestroyed!==true)if(!a||c===false){c!==false&&this.fireEvent("load",this,[],b);if(b.callback)b.callback.call(b.scope||this,[],b,false,a)}else{c=a.records;var e=a.totalRecords||c.length;if(!b||b.add!==true){if(this.pruneModifiedRecords)this.modified=[];a=0;for(d=c.length;a<d;a++)c[a].join(this);if(this.snapshot){this.data=this.snapshot;
delete this.snapshot}this.clearData();this.data.addAll(c);this.totalLength=e;this.applySort();this.fireEvent("datachanged",this)}else{var g=[],h,i=0;a=0;for(d=c.length;a<d;++a){h=c[a];if(this.indexOfId(h.id)>-1)this.doUpdate(h);else{g.push(h);++i}}this.totalLength=Math.max(e,this.data.length+i);this.add(g)}this.fireEvent("load",this,c,b);if(b.callback)b.callback.call(b.scope||this,c,b,true)}},loadData:function(a,b){this.loadRecords(this.reader.readRecords(a),{add:b},true)},getCount:function(){return this.data.length||
0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if((this.sortInfo||this.multiSortInfo)&&!this.remoteSort)this.sortData()},sortData:function(){var a=this.hasMultiSort?this.multiSortInfo:this.sortInfo,b=a.direction||"ASC",c=a.sorters,d=[];this.hasMultiSort||(c=[{direction:b,field:a.field}]);a=0;for(var e=c.length;a<e;a++)d.push(this.createSortFunction(c[a].field,c[a].direction));if(d.length!=0){var g=b.toUpperCase()=="DESC"?
-1:1;c=function(h,i){var j=d[0].call(this,h,i);if(d.length>1)for(var k=1,m=d.length;k<m;k++)j=j||d[k].call(this,h,i);return g*j};this.data.sort(b,c);this.snapshot&&this.snapshot!=this.data&&this.snapshot.sort(b,c)}},createSortFunction:function(a,b){b=b||"ASC";var c=b.toUpperCase()=="DESC"?-1:1,d=this.fields.get(a).sortType;return function(e,g){var h=d(e.data[a]),i=d(g.data[a]);return c*(h>i?1:h<i?-1:0)}},setDefaultSort:function(a,b){b=b?b.toUpperCase():"ASC";this.sortInfo={field:a,direction:b};this.sortToggle[a]=
b},sort:function(a,b){return Ext.isArray(a)?this.multiSort.call(this,a,b):this.singleSort(a,b)},singleSort:function(a,b){var c=this.fields.get(a);if(!c)return false;var d=c.name,e=this.sortInfo||null,g=this.sortToggle?this.sortToggle[d]:null;b||(b=e&&e.field==d?(this.sortToggle[d]||"ASC").toggle("ASC","DESC"):c.sortDir);this.sortToggle[d]=b;this.sortInfo={field:d,direction:b};this.hasMultiSort=false;if(this.remoteSort){if(!this.load(this.lastOptions)){if(g)this.sortToggle[d]=g;if(e)this.sortInfo=
e}}else{this.applySort();this.fireEvent("datachanged",this)}return true},multiSort:function(a,b){this.hasMultiSort=true;b=b||"ASC";if(this.multiSortInfo&&b==this.multiSortInfo.direction)b=b.toggle("ASC","DESC");this.multiSortInfo={sorters:a,direction:b};if(this.remoteSort)this.singleSort(a[0].field,a[0].direction);else{this.applySort();this.fireEvent("datachanged",this)}},each:function(a,b){this.data.each(a,b)},getModifiedRecords:function(){return this.modified},sum:function(a,b,c){var d=this.data.items,
e=0;b=b||0;c=c||c===0?c:d.length-1;for(b=b;b<=c;b++)e+=d[b].data[a]||0;return e},createFilterFn:function(a,b,c,d,e){if(Ext.isEmpty(b,false))return false;b=this.data.createValueMatcher(b,c,d,e);return function(g){return b.test(g.data[a])}},createMultipleFilterFn:function(a){return function(b){for(var c=true,d=0,e=a.length;d<e;d++){var g=a[d],h=g.fn;g=g.scope;c=c&&h.call(g,b)}return c}},filter:function(a,b,c,d,e){if(Ext.isObject(a))a=[a];if(Ext.isArray(a)){b=[];c=0;for(d=a.length;c<d;c++){e=a[c];var g=
e.fn,h=e.scope||this;Ext.isFunction(g)||(g=this.createFilterFn(e.property,e.value,e.anyMatch,e.caseSensitive,e.exactMatch));b.push({fn:g,scope:h})}a=this.createMultipleFilterFn(b)}else a=this.createFilterFn(a,b,c,d,e);return a?this.filterBy(a):this.clearFilter()},filterBy:function(a,b){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(a,b||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(a,b,c,d){return(a=this.createFilterFn(a,b,c,d))?this.queryBy(a):this.data.clone()},queryBy:function(a,b){return(this.snapshot||this.data).filterBy(a,b||this)},find:function(a,b,c,d,e){return(a=this.createFilterFn(a,b,d,e))?this.data.findIndexBy(a,null,c):-1},findExact:function(a,b,c){return this.data.findIndexBy(function(d){return d.get(a)===b},this,c)},findBy:function(a,b,c){return this.data.findIndexBy(a,
b,c)},collect:function(a,b,c){c=c===true&&this.snapshot?this.snapshot.items:this.data.items;for(var d,e,g=[],h={},i=0,j=c.length;i<j;i++){d=c[i].data[a];e=String(d);if((b||!Ext.isEmpty(d))&&!h[e]){h[e]=true;g[g.length]=d}}return g},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 a=this.modified.slice(0),b=a.length,c;for(c=0;c<b;c++)a[c].commit();this.modified=[];this.removed=[]},rejectChanges:function(){var a=this.modified.slice(0),b=this.removed.slice(0).reverse(),c=a.length,d=b.length,e;for(e=0;e<c;e++)a[e].reject();for(e=0;e<d;e++){this.insert(b[e].lastIndex||0,b[e]);b[e].reject()}this.modified=[];this.removed=[]},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 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 b=this.data.clone();this.data.add(a);this.applySort();a=this.data.indexOf(a);this.data=b;this.resumeEvents();return a},setBaseParam:function(a,
b){this.baseParams=this.baseParams||{};this.baseParams[a]=b}});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);a=Ext.data.Types;var b=this.sortType;if(this.type){if(Ext.isString(this.type))this.type=Ext.data.Types[this.type.toUpperCase()]||a.AUTO}else this.type=a.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,useNull:false,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC",
allowBlank:true});Ext.data.DataReader=function(a,b){this.meta=a;(this.recordType=Ext.isArray(b)?Ext.data.Record.create(b):b)&&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--)Ext.isArray(b)?this.realize(a.splice(c,1).shift(),b.splice(c,1).shift()):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();a.store.reMap(a)}},update:function(a,b){if(Ext.isArray(a))for(var c=a.length-1;c>=0;c--)Ext.isArray(b)?this.update(a.splice(c,1).shift(),b.splice(c,1).shift()):this.update(a.splice(c,1).shift(),b);else{if(Ext.isArray(b)&&b.length==1)b=b.shift();if(this.isData(b))a.data=Ext.apply(a.data,b);a.commit()}},extractData:function(a,b){var c=this instanceof Ext.data.JsonReader?"json":"node",d=[];if(this.isData(a)&&!(this instanceof Ext.data.XmlReader))a=
[a];d=this.recordType.prototype.fields;var e=d.items,g=d.length;d=[];if(b===true)for(var h=this.recordType,i=0;i<a.length;i++){var j=a[i],k=new h(this.extractValues(j,e,g),this.getId(j));k[c]=j;d.push(k)}else for(i=0;i<a.length;i++){c=this.extractValues(a[i],e,g);c[this.meta.idProperty]=this.getId(a[i]);d.push(c)}return d},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(a,b,c,d){var e=[],g=c+"Record";if(Ext.isArray(d))Ext.each(d,function(h){e.push(this[g](h))},this);else if(d instanceof Ext.data.Record)e=this[g](d);this.render(a,b,e)},render:Ext.emptyFn,updateRecord:Ext.emptyFn,createRecord:Ext.emptyFn,destroyRecord:Ext.emptyFn,toHash:function(a){var b=a.fields.map,c={},d=this.writeAllFields===false&&a.phantom===false?a.getChanges():a.data,e;Ext.iterate(d,function(g,h){if(e=b[g])c[e.mapping?
e.mapping:e.name]=h});if(a.phantom)a.fields.containsKey(this.meta.idProperty)&&Ext.isEmpty(a.data[this.meta.idProperty])&&delete c[this.meta.idProperty];else c[this.meta.idProperty]=a.id;return c},toArray:function(a){var b=[];Ext.iterate(a,function(c,d){b.push({name:c,value:d})},this);return b}};
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,b,c,d,e,g,h){if(!this.api[a]&&
!this.load)throw new Ext.data.DataProxy.Error("action-undefined",a);c=c||{};(a===Ext.data.Api.actions.read?this.fireEvent("beforeload",this,c):this.fireEvent("beforewrite",this,a,b,c)!==false)?this.doRequest.apply(this,arguments):e.call(g||this,null,h,false)},load:null,doRequest:function(a,b,c,d,e,g,h){this.load(c,d,e,g,h)},onRead:Ext.emptyFn,onWrite:Ext.emptyFn,buildUrl:function(a,b){b=b||null;var c=this.conn&&this.conn.url?this.conn.url:this.api[a]?this.api[a].url:this.url;if(!c)throw new Ext.data.Api.Error("invalid-url",
a);var d=null,e=c.match(/(.*)(\.json|\.xml|\.html)$/);if(e){d=e[2];c=e[1]}if((this.restful===true||this.prettyUrls===true)&&b instanceof Ext.data.Record&&!b.phantom)c+="/"+b.id;return d===null?c:c+d},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.ScriptTagProxy=function(a){Ext.apply(this,a);Ext.data.ScriptTagProxy.superclass.constructor.call(this,a);this.head=document.getElementsByTagName("head")[0]};
Ext.data.ScriptTagProxy.TRANS_ID=1E3;
Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:3E4,callbackParam:"callback",nocache:true,doRequest:function(a,b,c,d,e,g,h){var i=Ext.urlEncode(Ext.apply(c,this.extraParams)),j=this.buildUrl(a,b);if(!j)throw new Ext.data.Api.Error("invalid-url",j);j=Ext.urlAppend(j,i);if(this.nocache)j=Ext.urlAppend(j,"_dc="+(new Date).getTime());i=++Ext.data.ScriptTagProxy.TRANS_ID;c={id:i,action:a,cb:"stcCallback"+i,scriptId:"stcScript"+i,params:c,arg:h,url:j,callback:e,scope:g,reader:d};window[c.cb]=
this.createCallback(a,b,c);j+=String.format("&{0}={1}",this.callbackParam,c.cb);this.autoAbort!==false&&this.abort();c.timeoutId=this.handleFailure.defer(this.timeout,this,[c]);a=document.createElement("script");a.setAttribute("src",j);a.setAttribute("type","text/javascript");a.setAttribute("id",c.scriptId);this.head.appendChild(a);this.trans=c},createCallback:function(a,b,c){var d=this;return function(e){d.trans=false;d.destroyTrans(c,true);a===Ext.data.Api.actions.read?d.onRead.call(d,a,c,e):d.onWrite.call(d,
a,c,e,b)}},onRead:function(a,b,c){var d;try{d=b.reader.readRecords(c)}catch(e){this.fireEvent("loadexception",this,b,c,e);this.fireEvent("exception",this,"response",a,b,c,e);b.callback.call(b.scope||window,null,b.arg,false);return}if(d.success===false){this.fireEvent("loadexception",this,b,c);this.fireEvent("exception",this,"remote",a,b,c,null)}else this.fireEvent("load",this,c,b.arg);b.callback.call(b.scope||window,d,b.arg,d.success)},onWrite:function(a,b,c,d){var e=b.reader;try{var g=e.readResponse(a,
c)}catch(h){this.fireEvent("exception",this,"response",a,b,g,h);b.callback.call(b.scope||window,null,g,false);return}if(!g.success===true){this.fireEvent("exception",this,"remote",a,b,g,d);b.callback.call(b.scope||window,null,g,false)}else{this.fireEvent("write",this,a,g.data,g,d,b.arg);b.callback.call(b.scope||window,g.data,g,true)}},isLoading:function(){return this.trans?true:false},abort:function(){this.isLoading()&&this.destroyTrans(this.trans)},destroyTrans:function(a,b){this.head.removeChild(document.getElementById(a.scriptId));
clearTimeout(a.timeoutId);if(b){window[a.cb]=undefined;try{delete window[a.cb]}catch(c){}}else window[a.cb]=function(){window[a.cb]=undefined;try{delete window[a.cb]}catch(d){}}},handleFailure:function(a){this.trans=false;this.destroyTrans(a,false);a.action===Ext.data.Api.actions.read&&this.fireEvent("loadexception",this,null,a.arg);this.fireEvent("exception",this,"response",a.action,{response:null,options:a.arg});a.callback.call(a.scope||window,null,a.arg,false)},destroy:function(){this.abort();
Ext.data.ScriptTagProxy.superclass.destroy.call(this)}});Ext.data.HttpProxy=function(a){Ext.data.HttpProxy.superclass.constructor.call(this,a);this.conn=a;this.conn.url=null;this.useAjax=!a||!a.events;a=Ext.data.Api.actions;this.activeRequest={};for(var b in a)this.activeRequest[a[b]]=undefined};
Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},setUrl:function(a,b){this.conn.url=a;if(b===true){this.url=a;this.api=null;Ext.data.Api.prepare(this)}},doRequest:function(a,b,c,d,e,g,h){d={method:this.api[a]?this.api[a].method:undefined,request:{callback:e,scope:g,arg:h},reader:d,callback:this.createCallback(a,b),scope:this};if(c.jsonData)d.jsonData=c.jsonData;else if(c.xmlData)d.xmlData=c.xmlData;else d.params=c||{};this.conn.url=
this.buildUrl(a,b);if(this.useAjax){Ext.applyIf(d,this.conn);a==Ext.data.Api.actions.read&&this.activeRequest[a]&&Ext.Ajax.abort(this.activeRequest[a]);this.activeRequest[a]=Ext.Ajax.request(d)}else this.conn.request(d);this.conn.url=null},createCallback:function(a,b){return function(c,d,e){this.activeRequest[a]=undefined;if(d)a===Ext.data.Api.actions.read?this.onRead(a,c,e):this.onWrite(a,c,e,b);else{a===Ext.data.Api.actions.read&&this.fireEvent("loadexception",this,c,e);this.fireEvent("exception",
this,"response",a,c,e);c.request.callback.call(c.request.scope,null,c.request.arg,false)}}},onRead:function(a,b,c){var d;try{d=b.reader.read(c)}catch(e){this.fireEvent("loadexception",this,b,c,e);this.fireEvent("exception",this,"response",a,b,c,e);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}if(d.success===false){this.fireEvent("loadexception",this,b,c);c=b.reader.readResponse(a,c);this.fireEvent("exception",this,"remote",a,b,c,null)}else this.fireEvent("load",this,b,b.request.arg);
b.request.callback.call(b.request.scope,d,b.request.arg,d.success)},onWrite:function(a,b,c,d){var e=b.reader,g;try{g=e.readResponse(a,c)}catch(h){this.fireEvent("exception",this,"response",a,b,c,h);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}g.success===true?this.fireEvent("write",this,a,g.data,g,d,b.request.arg):this.fireEvent("exception",this,"remote",a,b,g,d);b.request.callback.call(b.request.scope,g.data,g,g.success)},destroy:function(){if(this.useAjax){if(this.activeRequest){var a=
Ext.data.Api.actions,b;for(b in a)this.activeRequest[a[b]]&&Ext.Ajax.abort(this.activeRequest[a[b]])}}else this.conn.abort();Ext.data.HttpProxy.superclass.destroy.call(this)}});Ext.data.MemoryProxy=function(a){var b={};b[Ext.data.Api.actions.read]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:b});this.data=a};
Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(a,b,c,d,e,g,h){var i;try{i=d.readRecords(this.data)}catch(j){this.fireEvent("loadexception",this,null,h,j);this.fireEvent("exception",this,"response",a,h,null,j);e.call(g,null,h,false);return}e.call(g,i,h,true)}});
Ext.data.Types=new function(){var a=Ext.data.SortTypes;Ext.apply(this,{stripRe:/[\$,%]/g,AUTO:{convert:function(b){return b},sortType:a.none,type:"auto"},STRING:{convert:function(b){return b===undefined||b===null?"":String(b)},sortType:a.asUCString,type:"string"},INT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?parseInt(String(b).replace(Ext.data.Types.stripRe,""),10):this.useNull?null:0},sortType:a.none,type:"int"},FLOAT:{convert:function(b){return b!==undefined&&b!==null&&b!==""?
parseFloat(String(b).replace(Ext.data.Types.stripRe,""),10):this.useNull?null:0},sortType:a.none,type:"float"},BOOL:{convert:function(b){return b===true||b==="true"||b==1},sortType:a.none,type:"bool"},DATE:{convert:function(b){var c=this.dateFormat;if(!b)return null;if(Ext.isDate(b))return b;if(c){if(c=="timestamp")return new Date(b*1E3);if(c=="time")return new Date(parseInt(b,10));return Date.parseDate(b,c)}return(b=Date.parse(b))?new Date(b):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,c){if(this.encode===true){Ext.apply(a,b);a[this.meta.root]=Ext.encode(c)}else{b=Ext.apply({},b);b[this.meta.root]=c;a.jsonData=b}},createRecord:function(a){return this.toHash(a)},updateRecord:function(a){return this.toHash(a)},destroyRecord:function(a){if(this.encodeDelete){var b={};b[this.meta.idProperty]=a.id;return b}else return a.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(a){a=Ext.decode(a.responseText);if(!a)throw{message:"JsonReader.read: Json object not found"};return this.readRecords(a)},readResponse:function(a,b){var c=b.responseText!==undefined?Ext.decode(b.responseText):b;if(!c)throw new Ext.data.JsonReader.Error("response");var d=this.getRoot(c),e=this.getSuccess(c);if(e&&a===Ext.data.Api.actions.create){var g=Ext.isDefined(d);if(g&&Ext.isEmpty(d))throw new Ext.data.JsonReader.Error("root-empty",
this.meta.root);else if(!g)throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root);}c=new Ext.data.Response({action:a,success:e,data:d?this.extractData(d,false):[],message:this.getMessage(c),raw:c});if(Ext.isEmpty(c.success))throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty);return c},readRecords:function(a){this.jsonData=a;a.metaData&&this.onMetaChange(a.metaData);var b=this.meta,c,d=this.getRoot(a),e=d.length,g=true;if(b.totalProperty){c=
parseInt(this.getTotal(a),10);isNaN(c)||(e=c)}if(b.successProperty){c=this.getSuccess(a);if(c===false||c==="false")g=false}return{success:g,records:this.extractData(d,true),totalRecords:e}},buildExtractors:function(){if(!this.ef){var a=this.meta,b=this.recordType.prototype.fields,c=b.items,d=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(h){return h};if(a.id||a.idProperty){var e=this.createAccessor(a.id||a.idProperty);this.getId=function(h){h=e(h);return h===undefined||h===""?null:h}}else this.getId=function(){return null};a=[];for(var g=0;g<d;g++){b=c[g];a.push(this.createAccessor(b.mapping!==undefined&&b.mapping!==null?b.mapping:b.name))}this.ef=a}},simpleAccess:function(a,b){return a[b]},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(d){return d[b]}}}(),extractValues:function(a,b,c){for(var d,e={},g=0;g<c;g++){d=b[g];var h=this.ef[g](a);e[d.name]=d.convert(h!==undefined?h:d.defaultValue,a)}return e}});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(a){this.arrayData=a;for(var b=this.meta,c=b?Ext.num(b.idIndex,b.id):null,d=this.recordType,e=d.prototype.fields,g=[],h=true,i,j=this.getRoot(a),k=0,m=j.length;k<m;k++){for(var p=j[k],o={},s=(c||c===0)&&p[c]!==undefined&&p[c]!==""?p[c]:null,l=0,n=e.length;l<n;l++){var r=e.items[l];i=r.mapping!==undefined&&r.mapping!==null?r.mapping:l;i=p[i]!==undefined?p[i]:r.defaultValue;i=r.convert(i,p);o[r.name]=i}i=new d(o,s);i.json=p;g[g.length]=
i}c=g.length;if(b.totalProperty){i=parseInt(this.getTotal(a),10);isNaN(i)||(c=i)}if(b.successProperty){i=this.getSuccess(a);if(i===false||i==="false")h=false}return{success:h,records:g,totalRecords:c}}});
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,b){if(this.expandData===true){for(var c=[],d=0,e=a.length;d<e;d++)c[c.length]=[a[d]];a=c}Ext.data.ArrayStore.superclass.loadData.call(this,a,b)}});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.XmlWriter=function(){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=typeof this.tpl==="string"?(new Ext.XTemplate(this.tpl)).compile():this.tpl.compile()};
Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><?xml version="{version}" encoding="{encoding}"?><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',
render:function(a,b,c){b=this.toArray(b);a.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:b.length>0||this.forceDocumentRoot===true?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:b,records:Ext.isArray(c[0])?c:[c]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(a){var b={};b[this.meta.idProperty]=a.id;return this.toArray(b)}});
Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};
Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){a=a.responseXML;if(!a)throw{message:"XmlReader.read: XML Document not available"};return this.readRecords(a)},readRecords:function(a){this.xmlData=a;var b=a.documentElement||a,c=Ext.DomQuery;a=0;var d=true;if(this.meta.totalProperty)a=this.getTotal(b,0);if(this.meta.successProperty)d=this.getSuccess(b);b=this.extractData(c.select(this.meta.record,b),true);return{success:d,records:b,totalRecords:a||b.length}},readResponse:function(a,
b){var c=Ext.DomQuery,d=b.responseXML,e=d.documentElement||d;c=new Ext.data.Response({action:a,success:this.getSuccess(e),message:this.getMessage(e),data:this.extractData(c.select(this.meta.record,e)||c.select(this.meta.root,e),false),raw:d});if(Ext.isEmpty(c.success))throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty);if(a===Ext.data.Api.actions.create)if((d=Ext.isDefined(c.data))&&Ext.isEmpty(c.data))throw new Ext.data.JsonReader.Error("root-empty",this.meta.root);
else if(!d)throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root);return c},getSuccess:function(){return true},buildExtractors:function(){if(!this.ef){var a=this.meta,b=this.recordType.prototype.fields,c=b.items,d=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=function(h){return!Ext.isEmpty(h[this.meta.record])?
h[this.meta.record]:h[this.meta.root]};if(a.idPath||a.idProperty){var e=this.createAccessor(a.idPath||a.idProperty);this.getId=function(h){h=e(h)||h.id;return h===undefined||h===""?null:h}}else this.getId=function(){return null};a=[];for(var g=0;g<d;g++){b=c[g];a.push(this.createAccessor(b.mapping!==undefined&&b.mapping!==null?b.mapping:b.name))}this.ef=a}},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b))return b;switch(b){case this.meta.totalProperty:return function(c,
d){return a.selectNumber(b,c,d)};case this.meta.successProperty:return function(c){c=a.selectValue(b,c,true);return c!==false&&c!=="false"};default:return function(c,d){return a.selectValue(b,c,d)}}}}(),extractValues:function(a,b,c){for(var d,e={},g=0;g<c;g++){d=b[g];var h=this.ef[g](a);e[d.name]=d.convert(h!==undefined?h:d.defaultValue,a)}return e}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});
Ext.reg("xmlstore",Ext.data.XmlStore);
Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=a||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var b=this.multiSortInfo.sorters,c=a.groupField||this.groupField,d=a.sortInfo||this.sortInfo,e=a.groupDir||this.groupDir;c&&b.push({field:c,direction:e});d&&b.push(d);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(a,b,c){c=c?String(c).toUpperCase()=="DESC"?"DESC":"ASC":this.groupDir;if(!(this.groupField==a&&this.groupDir==c&&!b)){b=this.multiSortInfo.sorters;b.length>0&&b[0].field==this.groupField&&b.shift();this.groupField=a;this.groupDir=
c;this.applyGroupField();var d=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(a,c);d.call(this)}else if(this.remoteGroup){this.on("load",d,this,{single:true});this.reload()}else{this.sort(b);d.call(this)}}},sort:function(a,b){if(this.remoteSort)return Ext.data.GroupingStore.superclass.sort.call(this,a,b);var c=[];if(Ext.isArray(a))c=a;else if(a==undefined)c=this.sortInfo?[this.sortInfo]:[];else{c=this.fields.get(a);if(!c)return false;var d=c.name,
e=this.sortInfo||null;b||(b=e&&e.field==d?(this.sortToggle[d]||"ASC").toggle("ASC","DESC"):c.sortDir);this.sortToggle[d]=b;this.sortInfo={field:d,direction:b};c=[this.sortInfo]}this.groupField&&c.unshift({direction:this.groupDir,field:this.groupField});return this.multiSort.call(this,c,b)},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.data.DirectProxy=function(a){Ext.apply(this,a);if(typeof this.paramOrder=="string")this.paramOrder=this.paramOrder.split(/[\s,|]/);Ext.data.DirectProxy.superclass.constructor.call(this,a)};
Ext.extend(Ext.data.DirectProxy,Ext.data.DataProxy,{paramOrder:undefined,paramsAsHash:true,directFn:undefined,doRequest:function(a,b,c,d,e,g,h){var i=[],j=this.api[a]||this.directFn;switch(a){case Ext.data.Api.actions.create:i.push(c.jsonData);break;case Ext.data.Api.actions.read:if(j.directCfg.method.len>0)if(this.paramOrder)for(var k=0,m=this.paramOrder.length;k<m;k++)i.push(c[this.paramOrder[k]]);else this.paramsAsHash&&i.push(c);break;case Ext.data.Api.actions.update:i.push(c.jsonData);break;
case Ext.data.Api.actions.destroy:i.push(c.jsonData)}i.push(this.createCallback(a,b,{params:c||{},request:{callback:e,scope:g,arg:h},reader:d}),this);j.apply(window,i)},createCallback:function(a,b,c){var d=this;return function(e,g){if(g.status)a===Ext.data.Api.actions.read?d.onRead(a,c,e,g):d.onWrite(a,c,e,g,b);else{a===Ext.data.Api.actions.read&&d.fireEvent("loadexception",d,c,g,null);d.fireEvent("exception",d,"remote",a,c,g,null);c.request.callback.call(c.request.scope,null,c.request.arg,false)}}},
onRead:function(a,b,c,d){var e;try{e=b.reader.readRecords(c)}catch(g){this.fireEvent("loadexception",this,b,d,g);this.fireEvent("exception",this,"response",a,b,d,g);b.request.callback.call(b.request.scope,null,b.request.arg,false);return}this.fireEvent("load",this,d,b.request.arg);b.request.callback.call(b.request.scope,e,b.request.arg,true)},onWrite:function(a,b,c,d,e){var g=b.reader.extractData(b.reader.getRoot(c),false),h=b.reader.getSuccess(c);(h=h!==false)?this.fireEvent("write",this,a,g,d,e,
b.request.arg):this.fireEvent("exception",this,"remote",a,b,c,e);b.request.callback.call(b.request.scope,g,d,h)}});
Ext.data.DirectStore=Ext.extend(Ext.data.Store,{constructor:function(a){a=Ext.apply({},{batchTransactions:false},a);Ext.data.DirectStore.superclass.constructor.call(this,Ext.apply(a,{proxy:Ext.isDefined(a.proxy)?a.proxy:new Ext.data.DirectProxy(Ext.copyTo({},a,"paramOrder,paramsAsHash,directFn,api")),reader:!Ext.isDefined(a.reader)&&a.fields?new Ext.data.JsonReader(Ext.copyTo({},a,"totalProperty,root,idProperty"),a.fields):a.reader}))}});Ext.reg("directstore",Ext.data.DirectStore);
Ext.Direct=Ext.extend(Ext.util.Observable,{exceptions:{TRANSPORT:"xhr",PARSE:"parse",LOGIN:"login",SERVER:"exception"},constructor:function(){this.addEvents("event","exception");this.transactions={};this.providers={}},addProvider:function(a){var b=arguments;if(b.length>1)for(var c=0,d=b.length;c<d;c++)this.addProvider(b[c]);else{a.events||(a=new Ext.Direct.PROVIDERS[a.type](a));a.id=a.id||Ext.id();this.providers[a.id]=a;a.on("data",this.onProviderData,this);a.on("exception",this.onProviderException,
this);a.isConnected()||a.connect();return a}},getProvider:function(a){return this.providers[a]},removeProvider:function(a){a=a.id?a:this.providers[a];a.un("data",this.onProviderData,this);a.un("exception",this.onProviderException,this);delete this.providers[a.id];return a},addTransaction:function(a){return this.transactions[a.tid]=a},removeTransaction:function(a){delete this.transactions[a.tid||a];return a},getTransaction:function(a){return this.transactions[a.tid||a]},onProviderData:function(a,b){if(Ext.isArray(b))for(var c=
0,d=b.length;c<d;c++)this.onProviderData(a,b[c]);else{if(b.name&&b.name!="event"&&b.name!="exception")this.fireEvent(b.name,b);else b.type=="exception"&&this.fireEvent("exception",b);this.fireEvent("event",b,a)}},createEvent:function(a,b){return new Ext.Direct.eventTypes[a.type](Ext.apply(a,b))}});Ext.Direct=new Ext.Direct;Ext.Direct.TID=1;Ext.Direct.PROVIDERS={};Ext.Direct.Transaction=function(a){Ext.apply(this,a);this.tid=++Ext.Direct.TID;this.retryCount=0};
Ext.Direct.Transaction.prototype={send:function(){this.provider.queueTransaction(this)},retry:function(){this.retryCount++;this.send()},getProvider:function(){return this.provider}};Ext.Direct.Event=function(a){Ext.apply(this,a)};Ext.Direct.Event.prototype={status:true,getData:function(){return this.data}};Ext.Direct.RemotingEvent=Ext.extend(Ext.Direct.Event,{type:"rpc",getTransaction:function(){return this.transaction||Ext.Direct.getTransaction(this.tid)}});
Ext.Direct.ExceptionEvent=Ext.extend(Ext.Direct.RemotingEvent,{status:false,type:"exception"});Ext.Direct.eventTypes={rpc:Ext.Direct.RemotingEvent,event:Ext.Direct.Event,exception:Ext.Direct.ExceptionEvent};Ext.direct.Provider=Ext.extend(Ext.util.Observable,{priority:1,constructor:function(a){Ext.apply(this,a);this.addEvents("connect","disconnect","data","exception");Ext.direct.Provider.superclass.constructor.call(this,a)},isConnected:function(){return false},connect:Ext.emptyFn,disconnect:Ext.emptyFn});
Ext.direct.JsonProvider=Ext.extend(Ext.direct.Provider,{parseResponse:function(a){if(!Ext.isEmpty(a.responseText)){if(typeof a.responseText=="object")return a.responseText;return Ext.decode(a.responseText)}return null},getEvents:function(a){var b=null;try{b=this.parseResponse(a)}catch(c){return[new Ext.Direct.ExceptionEvent({data:c,xhr:a,code:Ext.Direct.exceptions.PARSE,message:"Error parsing json response: \n\n "+b})]}a=[];if(Ext.isArray(b))for(var d=0,e=b.length;d<e;d++)a.push(Ext.Direct.createEvent(b[d]));
else a.push(Ext.Direct.createEvent(b));return a}});
Ext.direct.PollingProvider=Ext.extend(Ext.direct.JsonProvider,{priority:3,interval:3E3,constructor:function(a){Ext.direct.PollingProvider.superclass.constructor.call(this,a);this.addEvents("beforepoll","poll")},isConnected:function(){return!!this.pollTask},connect:function(){if(this.url&&!this.pollTask){this.pollTask=Ext.TaskMgr.start({run:function(){if(this.fireEvent("beforepoll",this)!==false)typeof this.url=="function"?this.url(this.baseParams):Ext.Ajax.request({url:this.url,callback:this.onData,
scope:this,params:this.baseParams})},interval:this.interval,scope:this});this.fireEvent("connect",this)}else if(!this.url)throw"Error initializing PollingProvider, no url configured.";},disconnect:function(){if(this.pollTask){Ext.TaskMgr.stop(this.pollTask);delete this.pollTask;this.fireEvent("disconnect",this)}},onData:function(a,b,c){if(b){a=this.getEvents(c);b=0;for(c=a.length;b<c;b++){var d=a[b];this.fireEvent("data",this,d)}}else{d=new Ext.Direct.ExceptionEvent({data:d,code:Ext.Direct.exceptions.TRANSPORT,
message:"Unable to connect to the server.",xhr:c});this.fireEvent("data",this,d)}}});Ext.Direct.PROVIDERS.polling=Ext.direct.PollingProvider;
Ext.direct.RemotingProvider=Ext.extend(Ext.direct.JsonProvider,{enableBuffer:10,maxRetries:1,timeout:undefined,constructor:function(a){Ext.direct.RemotingProvider.superclass.constructor.call(this,a);this.addEvents("beforecall","call");this.namespace=Ext.isString(this.namespace)?Ext.ns(this.namespace):this.namespace||window;this.transactions={};this.callBuffer=[]},initAPI:function(){var a=this.actions,b;for(b in a)for(var c=this.namespace[b]||(this.namespace[b]={}),d=a[b],e=0,g=d.length;e<g;e++){var h=
d[e];c[h.name]=this.createMethod(b,h)}},isConnected:function(){return!!this.connected},connect:function(){if(this.url){this.initAPI();this.connected=true;this.fireEvent("connect",this)}else if(!this.url)throw"Error initializing RemotingProvider, no url configured.";},disconnect:function(){if(this.connected){this.connected=false;this.fireEvent("disconnect",this)}},onData:function(a,b,c){if(b){c=this.getEvents(c);a=0;for(b=c.length;a<b;a++){var d=c[a],e=this.getTransaction(d);this.fireEvent("data",
this,d);if(e){this.doCallback(e,d,true);Ext.Direct.removeTransaction(e)}}}else{var g=[].concat(a.ts);a=0;for(b=g.length;a<b;a++)if((e=this.getTransaction(g[a]))&&e.retryCount<this.maxRetries)e.retry();else{d=new Ext.Direct.ExceptionEvent({data:d,transaction:e,code:Ext.Direct.exceptions.TRANSPORT,message:"Unable to connect to the server.",xhr:c});this.fireEvent("data",this,d);if(e){this.doCallback(e,d,false);Ext.Direct.removeTransaction(e)}}}},getCallData:function(a){return{action:a.action,method:a.method,
data:a.data,type:"rpc",tid:a.tid}},doSend:function(a){var b={url:this.url,callback:this.onData,scope:this,ts:a,timeout:this.timeout},c;if(Ext.isArray(a)){c=[];for(var d=0,e=a.length;d<e;d++)c.push(this.getCallData(a[d]))}else c=this.getCallData(a);if(this.enableUrlEncode){a={};a[Ext.isString(this.enableUrlEncode)?this.enableUrlEncode:"data"]=Ext.encode(c);b.params=a}else b.jsonData=c;Ext.Ajax.request(b)},combineAndSend:function(){var a=this.callBuffer.length;if(a>0){this.doSend(a==1?this.callBuffer[0]:
this.callBuffer);this.callBuffer=[]}},queueTransaction:function(a){if(a.form)this.processForm(a);else{this.callBuffer.push(a);if(this.enableBuffer){if(!this.callTask)this.callTask=new Ext.util.DelayedTask(this.combineAndSend,this);this.callTask.delay(Ext.isNumber(this.enableBuffer)?this.enableBuffer:10)}else this.combineAndSend()}},doCall:function(a,b,c){var d=null,e=c[b.len],g=c[b.len+1];if(b.len!==0)d=c.slice(0,b.len);a=new Ext.Direct.Transaction({provider:this,args:c,action:a,method:b.name,data:d,
cb:g&&Ext.isFunction(e)?e.createDelegate(g):e});if(this.fireEvent("beforecall",this,a,b)!==false){Ext.Direct.addTransaction(a);this.queueTransaction(a);this.fireEvent("call",this,a,b)}},doForm:function(a,b,c,d,e){e=new Ext.Direct.Transaction({provider:this,action:a,method:b.name,args:[c,d,e],cb:e&&Ext.isFunction(d)?d.createDelegate(e):d,isForm:true});if(this.fireEvent("beforecall",this,e,b)!==false){Ext.Direct.addTransaction(e);var g=String(c.getAttribute("enctype")).toLowerCase()=="multipart/form-data";
a={extTID:e.tid,extAction:a,extMethod:b.name,extType:"rpc",extUpload:String(g)};Ext.apply(e,{form:Ext.getDom(c),isUpload:g,params:d&&Ext.isObject(d.params)?Ext.apply(a,d.params):a});this.fireEvent("call",this,e,b);this.processForm(e)}},processForm:function(a){Ext.Ajax.request({url:this.url,params:a.params,callback:this.onData,scope:this,form:a.form,isUpload:a.isUpload,ts:a})},createMethod:function(a,b){var c;c=b.formHandler?function(d,e,g){this.doForm(a,b,d,e,g)}.createDelegate(this):function(){this.doCall(a,
b,Array.prototype.slice.call(arguments,0))}.createDelegate(this);c.directCfg={action:a,method:b};return c},getTransaction:function(a){return a&&a.tid?Ext.Direct.getTransaction(a.tid):null},doCallback:function(a,b){var c=b.status?"success":"failure";if(a&&a.cb){var d=a.cb,e=Ext.isDefined(b.result)?b.result:b.data;if(Ext.isFunction(d))d(e,b);else{Ext.callback(d[c],d.scope,[e,b]);Ext.callback(d.callback,d.scope,[e,b])}}}});Ext.Direct.PROVIDERS.remoting=Ext.direct.RemotingProvider;
Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.el=Ext.get(a);if(b&&b.wrap){b.resizeChild=this.el;this.el=this.el.wrap(typeof b.wrap=="object"?b.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=b.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(b.resizeChild.getPositioning());b.resizeChild.clearPositioning();if(!b.width||!b.height){var c=b.resizeChild.getSize();this.el.setSize(c.width,c.height)}if(b.pinned&&!b.adjustments)b.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,b);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}c=this.el.getStyle("position");c!="absolute"&&c!="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";
c=this.handles.split(/\s*?[,;]\s*?| /);for(var d=Ext.Resizable.positions,e=0,g=c.length;e<g;e++)if(c[e]&&d[c[e]]){var h=d[c[e]];this[h]=new Ext.Resizable.Handle(this,h,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)this.resizeChild=typeof this.resizeChild=="boolean"?Ext.get(this.el.dom.firstChild,true):Ext.get(this.resizeChild,true);if(this.adjustments==
"auto"){d=this.resizeChild;e=this.west;g=this.east;h=this.north;c=this.south;if(d&&(e||h)){d.position("relative");d.setLeft(e?e.el.getWidth():0);d.setTop(h?h.el.getHeight():0)}this.adjustments=[(g?-g.el.getWidth():0)+(e?-e.el.getWidth():0),(h?-h.el.getHeight():0)+(c?-c.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");this.width!==null&&this.height!==null?this.resizeTo(this.width,this.height):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:0.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(a,b){this.el.setSize(a,b);this.updateChildSize();this.fireEvent("resize",this,a,b,null)},startSizing:function(a,b){this.fireEvent("beforeresize",this,a);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",
b.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=a.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 c=Ext.get(this.constrainTo);this.resizeRegion=c.getRegion().adjust(c.getFrameWidth("t"),c.getFrameWidth("l"),-c.getFrameWidth("b"),-c.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(a){this.activeHandle=null;var b=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,b.width,b.height,a)},updateChildSize:function(){if(this.resizeChild){var a=this.el,b=this.resizeChild,c=
this.adjustments;if(a.dom.offsetWidth){var d=a.getSize(true);b.setSize(d.width+c[0],d.height+c[1])}Ext.isIE9m&&setTimeout(function(){if(a.dom.offsetWidth){var e=a.getSize(true);b.setSize(e.width+c[0],e.height+c[1])}},10)}},snap:function(a,b,c){if(!b||!a)return a;var d=a,e=a%b;if(e>0)d=e>b/2?a+(b-e):a-e;return Math.max(c,d)},resizeElement:function(){var a=this.proxy.getBox();this.updateBox?this.el.setBox(a,false,this.animate,this.duration,null,this.easing):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(a,b,c,d){if(a-b<c)b=a-c;else if(a-b>d)b=a-d;return b},onMouseMove:function(a){if(this.enabled&&this.activeHandle)try{if(!(this.resizeRegion&&!this.resizeRegion.contains(a.getPoint()))){var b=this.curSize||this.startBox,c=this.startBox.x,d=this.startBox.y,e=b.width,g=b.height;b=e;var h=
g,i=this.minWidth,j=this.minHeight,k=this.maxWidth,m=this.maxHeight,p=this.widthIncrement,o=this.heightIncrement,s=a.getXY(),l=-(this.startPoint[0]-Math.max(this.minX,s[0])),n=-(this.startPoint[1]-Math.max(this.minY,s[1])),r=this.activeHandle.position,q,t;switch(r){case "east":e+=l;e=Math.min(Math.max(i,e),k);break;case "south":g+=n;g=Math.min(Math.max(j,g),m);break;case "southeast":e+=l;g+=n;e=Math.min(Math.max(i,e),k);g=Math.min(Math.max(j,g),m);break;case "north":n=this.constrain(g,n,j,m);d+=n;
g-=n;break;case "west":l=this.constrain(e,l,i,k);c+=l;e-=l;break;case "northeast":e+=l;e=Math.min(Math.max(i,e),k);n=this.constrain(g,n,j,m);d+=n;g-=n;break;case "northwest":l=this.constrain(e,l,i,k);n=this.constrain(g,n,j,m);d+=n;g-=n;c+=l;e-=l;break;case "southwest":l=this.constrain(e,l,i,k);g+=n;g=Math.min(Math.max(j,g),m);c+=l;e-=l}var u=this.snap(e,p,i),v=this.snap(g,o,j);if(u!=e||v!=g){switch(r){case "northeast":d-=v-g;break;case "north":d-=v-g;break;case "southwest":c-=u-e;break;case "west":c-=
u-e;break;case "northwest":c-=u-e;d-=v-g}e=u;g=v}if(this.preserveRatio)switch(r){case "southeast":case "east":g=h*(e/b);g=Math.min(Math.max(j,g),m);e=b*(g/h);break;case "south":e=b*(g/h);e=Math.min(Math.max(i,e),k);g=h*(e/b);break;case "northeast":e=b*(g/h);e=Math.min(Math.max(i,e),k);g=h*(e/b);break;case "north":q=e;e=b*(g/h);e=Math.min(Math.max(i,e),k);g=h*(e/b);c+=(q-e)/2;break;case "southwest":g=h*(e/b);g=Math.min(Math.max(j,g),m);q=e;e=b*(g/h);c+=q-e;break;case "west":t=g;g=h*(e/b);g=Math.min(Math.max(j,
g),m);d+=(t-g)/2;q=e;e=b*(g/h);c+=q-e;break;case "northwest":q=e;t=g;g=h*(e/b);g=Math.min(Math.max(j,g),m);e=b*(g/h);d+=t-g;c+=q-e}this.proxy.setBounds(c,d,e,g);this.dynamic&&this.resizeElement()}}catch(z){}},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(a){Ext.destroy(this.dd,this.overlay,this.proxy);
this.proxy=this.overlay=null;var b=Ext.Resizable.positions,c;for(c in b)typeof b[c]!="function"&&this[b[c]]&&this[b[c]].destroy();if(a){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(a,b,c,d,e){if(!this.tpl){var g=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});g.compile();Ext.Resizable.Handle.prototype.tpl=g}this.position=b;this.rz=a;this.el=this.tpl.append(a.el.dom,[this.position],true);this.el.unselectable();d&&this.el.setOpacity(0);Ext.isEmpty(e)||this.el.addClass(e);this.el.on("mousedown",this.onMouseDown,this);c||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,showAnimDuration:0.25,hideAnimDuration:0.25,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(a,b){Ext.Window.superclass.onRender.call(this,a,b);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(a,b){this.activeGhost&&this.unghost();b.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.isIE9m&&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,c;if(Ext.isDefined(b)){a=Ext.isNumber(b)&&this.fbar?this.fbar.items.get(b):Ext.isString(b)?Ext.getCmp(b):b;b=a.getEl();c=Ext.getDom(this.container);if(b&&c)if(c!=document.body&&!Ext.lib.Region.getRegion(c).contains(Ext.lib.Region.getRegion(b.dom)))return}a=a||this.focusEl;a.focus.defer(10,a)},setAnimateTarget:function(a){this.animateTarget=a=Ext.get(a)},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||
this.y===undefined){var a=this.el.getAlignToXY(this.container,"c-c");a=this.el.translatePoints(a[0],a[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();this.animateTarget?this.animShow():this.afterShow();return this},afterShow:function(a){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);if(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(a&&(Ext.isIE||Ext.isWebKit)){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:this.showAnimDuration,opacity:0.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();
if(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(0.5);this.proxy.show();this.proxy.setBox(this.getBox(false));this.el.hide();this.proxy.shift(Ext.apply(this.animateTarget.getBox(),{callback:this.afterHide,scope:this,duration:this.hideAnimDuration,easing:"easeNone",opacity:0}))},onShow:Ext.emptyFn,
onHide:Ext.emptyFn,onWindowResize:function(){this.maximized&&this.fitContainer();if(this.modal){this.mask.setSize("100%","100%");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{a=this.getSize();a={right:-(a.width-100),bottom:-(a.height-25+this.el.getConstrainOffset())}}(a=
this.el.getConstrainToXY(this.container,true,a))&&this.setPosition(a[0],a[1])}},ghost:function(a){a=this.createGhost(a);var b=this.getBox(true);a.setLeftTop(b.x,b.y);a.setWidth(b.width);this.el.hide();return this.activeGhost=a},unghost:function(a,b){if(this.activeGhost){if(a!==false){this.el.show();this.focus.defer(10,this);Ext.isMac&&Ext.isGecko2&&this.cascade(this.setAutoScroll)}b!==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)this.hidden?this.doClose():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(a,b,c){a=this.el.getAlignToXY(a,b,c);this.setPagePosition(a[0],a[1]);return this},anchorTo:function(a,b,c,d){this.clearAnchor();this.anchorTarget={el:a,alignment:b,offsets:c};Ext.EventManager.onWindowResize(this.doAnchor,this);a=typeof d;if(a!="undefined")Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:a=="number"?d: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))if(!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=Ext.extend(Ext.dd.DD,{constructor: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},moveOnly:true,headerOffsets:[100,25],startDrag:function(){var a=this.win;this.proxy=a.ghost(a.initialConfig.cls);if(a.constrain!==false){var b=a.el.shadowOffset;this.constrainTo(a.container,{right:b,left:b,bottom:b})}else if(a.constrainHeader!==false){b=this.proxy.getSize();this.constrainTo(a.container,{right:-(b.width-
this.headerOffsets[0]),bottom:-(b.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,d=function(i,j){return!i._lastAccess||i._lastAccess<j._lastAccess?-1:1},e=function(){var i=b.length;if(i>0){b.sort(d);for(var j=b[0].manager.zseed,k=0;k<i;k++){var m=b[k];m&&!m.hidden&&m.setZIndex(j+k*10)}}h()},g=function(i){if(i!=c){c&&c.setActive(false);(c=i)&&i.setActive(true)}},h=function(){for(var i=b.length-1;i>=0;--i)if(!b[i].hidden){g(b[i]);return}g(null)};return{zseed:9E3,register:function(i){i.manager&&i.manager.unregister(i);i.manager=this;
a[i.id]=i;b.push(i);i.on("hide",h)},unregister:function(i){delete i.manager;delete a[i.id];i.un("hide",h);b.remove(i)},get:function(i){return typeof i=="object"?i:a[i]},bringToFront:function(i){i=this.get(i);if(i!=c){i._lastAccess=(new Date).getTime();e();return true}return false},sendToBack:function(i){i=this.get(i);i._lastAccess=-(new Date).getTime();e();return i},hideAll:function(){for(var i in a)a[i]&&typeof a[i]!="function"&&a[i].isVisible()&&a[i].hide()},getActive:function(){return c},getBy:function(i,
j){for(var k=[],m=b.length-1;m>=0;--m){var p=b[m];if(i.call(j||p,p)!==false)k.push(p)}return k},each:function(i,j){for(var k in a)if(a[k]&&typeof a[k]!="function")if(i.call(j||a[k],a[k])===false)break}}};Ext.WindowMgr=new Ext.WindowGroup;
Ext.MessageBox=function(){var a,b,c,d,e,g,h,i,j,k,m,p,o="",s="",l=["ok","yes","no","cancel"],n=function(t){k[t].blur();if(a.isVisible()){a.hide();r();Ext.callback(b.fn,b.scope||window,[t,m.dom.value,b],1)}},r=function(){b&&b.cls&&a.el.removeClass(b.cls);i.reset()},q=function(t){var u=0,v;if(!t){Ext.each(l,function(z){k[z].hide()});return u}a.footer.dom.style.display="";Ext.iterate(k,function(z,x){if(v=t[z]){x.show();x.setText(Ext.isString(v)?v:Ext.MessageBox.buttonText[z]);u+=x.getEl().getWidth()+
15}else x.hide()});return u};return{getDialog:function(t){if(!a){var u=[];k={};Ext.each(l,function(v){u.push(k[v]=new Ext.Button({text:this.buttonText[v],handler:n.createCallback(v),hideMode:"offsets"}))},this);a=new Ext.Window({autoCreate:true,title:t,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(){b&&b.buttons&&b.buttons.no&&
!b.buttons.cancel?n("no"):n("cancel")},fbar:new Ext.Toolbar({items:u,enableOverflow:false})});a.render(document.body);a.getEl().addClass("x-window-dlg");c=a.mask;d=a.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>'});j=Ext.get(d.dom.firstChild);t=d.dom.childNodes[1];e=Ext.get(t.firstChild);g=Ext.get(t.childNodes[2].firstChild);
g.enableDisplayMode();g.addKeyListener([10,13],function(){if(a.isVisible()&&b&&b.buttons)if(b.buttons.ok)n("ok");else b.buttons.yes&&n("yes")});h=Ext.get(t.childNodes[2].childNodes[1]);h.enableDisplayMode();i=new Ext.ProgressBar({renderTo:d});d.createChild({cls:"x-clear"})}return a},updateText:function(t){!a.isVisible()&&!b.width&&a.setSize(this.maxWidth,100);e.update(t?t+" ":"&#160;");var u=s!=""?j.getWidth()+j.getMargins("lr"):0,v=e.getWidth()+e.getMargins("lr"),z=a.getFrameWidth("lr"),x=a.body.getFrameWidth("lr");
v=Math.max(Math.min(b.width||u+v+z+x,b.maxWidth||this.maxWidth),Math.max(b.minWidth||this.minWidth,p||0));b.prompt===true&&m.setWidth(v-u-z-x);if(b.progress===true||b.wait===true)i.setSize(v-u-z-x);if(Ext.isIE9m&&v==p)v+=4;e.update(t||"&#160;");a.setSize(v,"auto").center();return this},updateProgress:function(t,u,v){i.updateProgress(t,u);v&&this.updateText(v);return this},isVisible:function(){return a&&a.isVisible()},hide:function(){var t=a?a.activeGhost:null;if(this.isVisible()||t){a.hide();r();
t&&a.unghost(false,false)}return this},show:function(t){this.isVisible()&&this.hide();b=t;var u=this.getDialog(b.title||"&#160;");u.setTitle(b.title||"&#160;");var v=b.closable!==false&&b.progress!==true&&b.wait!==true;u.tools.close.setDisplayed(v);m=g;b.prompt=b.prompt||(b.multiline?true:false);if(b.prompt)if(b.multiline){g.hide();h.show();h.setHeight(Ext.isNumber(b.multiline)?b.multiline:this.defaultTextHeight);m=h}else{g.show();h.hide()}else{g.hide();h.hide()}m.dom.value=b.value||"";if(b.prompt)u.focusEl=
m;else{t=b.buttons;var z=null;if(t&&t.ok)z=k.ok;else if(t&&t.yes)z=k.yes;if(z)u.focusEl=z}Ext.isDefined(b.iconCls)&&u.setIconClass(b.iconCls);this.setIcon(Ext.isDefined(b.icon)?b.icon:o);p=q(b.buttons);i.setVisible(b.progress===true||b.wait===true);this.updateProgress(0,b.progressText);this.updateText(b.msg);b.cls&&u.el.addClass(b.cls);u.proxyDrag=b.proxyDrag===true;u.modal=b.modal!==false;u.mask=b.modal!==false?c:false;if(!u.isVisible()){document.body.appendChild(a.el.dom);u.setAnimateTarget(b.animEl);
u.on("show",function(){v===true?u.keyMap.enable():u.keyMap.disable()},this,{single:true});u.show(b.animEl)}b.wait===true&&i.wait(b.waitConfig);return this},setIcon:function(t){if(a){o=undefined;if(t&&t!=""){j.removeClass("x-hidden");j.replaceClass(s,t);d.addClass("x-dlg-icon");s=t}else{j.replaceClass(s,"x-hidden");d.removeClass("x-dlg-icon");s=""}return this}else o=t},progress:function(t,u,v){this.show({title:t,msg:u,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:v});
return this},wait:function(t,u,v){this.show({title:u,msg:t,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:v});return this},alert:function(t,u,v,z){this.show({title:t,msg:u,buttons:this.OK,fn:v,scope:z,minWidth:this.minWidth});return this},confirm:function(t,u,v,z){this.show({title:t,msg:u,buttons:this.YESNO,fn:v,scope:z,icon:this.QUESTION,minWidth:this.minWidth});return this},prompt:function(t,u,v,z,x,A){this.show({title:t,msg:u,buttons:this.OKCANCEL,fn:v,
minWidth:this.minPromptWidth,scope:z,prompt:true,multiline:x,value:A});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=Ext.extend(Object,{constructor:function(a,b){this.panel=a;this.id=this.panel.id+"-ddproxy";Ext.apply(this,b)},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(this.panel.initialConfig.cls,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(a,b,c){this.hide();if(typeof b=="function")b.call(c||this)},moveProxy:function(a,b){this.proxy&&a.insertBefore(this.proxy.dom,b)}});
Ext.Panel.DD=Ext.extend(Ext.dd.DragSource,{constructor:function(a,b){this.panel=a;this.dragData={panel:a};this.proxy=new Ext.dd.PanelProxy(a,b);Ext.Panel.DD.superclass.constructor.call(this,a.el,b);var c=a.header,d=a.body;if(c){this.setHandleElId(c.id);d=a.header}d.setStyle("cursor","move");this.scroll=false},showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(){this.proxy.show()},b4MouseDown:function(a){var b=a.getPageX();a=a.getPageY();this.autoOffset(b,a)},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=Ext.extend(Ext.util.Observable,{constructor:function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)},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(a,b){this.state[a]=b;this.fireEvent("statechange",this,a,b)},decodeValue:function(a){var b=/^(a|n|d|b|s|o|e)\:(.*)$/.exec(unescape(a)),c,d;if(b&&b[1]){a=b[1];
b=b[2];switch(a){case "e":return null;case "n":return parseFloat(b);case "d":return new Date(Date.parse(b));case "b":return b=="1";case "a":c=[];b!=""&&Ext.each(b.split("^"),function(e){c.push(this.decodeValue(e))},this);return c;case "o":c={};b!=""&&Ext.each(b.split("^"),function(e){d=e.split("=");c[d[0]]=this.decodeValue(d[1])},this);return c;default:return b}}},encodeValue:function(a){var b="",c=0,d;if(a==null)return"e:1";else if(typeof a=="number")a="n:"+a;else if(typeof a=="boolean")a="b:"+(a?
"1":"0");else if(Ext.isDate(a))a="d:"+a.toGMTString();else if(Ext.isArray(a)){for(d=a.length;c<d;c++){b+=this.encodeValue(a[c]);if(c!=d-1)b+="^"}a="a:"+b}else if(typeof a=="object"){for(d in a)if(typeof a[d]!="function"&&a[d]!==undefined)b+=d+"="+this.encodeValue(a[d])+"^";a="o:"+b.substring(0,b.length-1)}else a="s:"+a;return escape(a)}});
Ext.state.Manager=function(){var a=new Ext.state.Provider;return{setProvider:function(b){a=b},get:function(b,c){return a.get(b,c)},set:function(b,c){a.set(b,c)},clear:function(b){a.clear(b)},getProvider:function(){return a}}}();
Ext.state.CookieProvider=Ext.extend(Ext.state.Provider,{constructor:function(a){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date((new Date).getTime()+6048E5);this.domain=null;this.secure=false;Ext.apply(this,a);this.state=this.readCookies()},set:function(a,b){if(typeof b=="undefined"||b===null)this.clear(a);else{this.setCookie(a,b);Ext.state.CookieProvider.superclass.set.call(this,a,b)}},clear:function(a){this.clearCookie(a);Ext.state.CookieProvider.superclass.clear.call(this,
a)},readCookies:function(){for(var a={},b=document.cookie+";",c=/\s?(.*?)=(.*?);/g,d,e;(d=c.exec(b))!=null;){e=d[1];d=d[2];if(e&&e.substring(0,3)=="ys-")a[e.substr(3)]=this.decodeValue(d)}return a},setCookie:function(a,b){document.cookie="ys-"+a+"="+this.encodeValue(b)+(this.expires==null?"":"; expires="+this.expires.toGMTString())+(this.path==null?"":"; path="+this.path)+(this.domain==null?"":"; domain="+this.domain)+(this.secure==true?"; secure":"")},clearCookie:function(a){document.cookie="ys-"+
a+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+(this.path==null?"":"; path="+this.path)+(this.domain==null?"":"; domain="+this.domain)+(this.secure==true?"; secure":"")}});
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});if(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(),b=this.store.getRange();a.update("");if(b.length<1){if(!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(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[c.length]=this.prepareData(a[d].data,
b+d,a[d]);return c},bufferRender:function(a,b){var c=document.createElement("div");this.tpl.overwrite(c,this.collectData(a,b));return Ext.query(this.itemSelector,c)},onUpdate:function(a,b){var c=this.store.indexOf(b);if(c>-1){var d=this.isSelected(c),e=this.all.elements[c],g=this.bufferRender([b],c)[0];this.all.replaceElement(c,g,true);if(d){this.selected.replaceElement(e,g);this.all.item(c).addClass(this.selectedClass)}this.updateIndexes(c,c)}},onAdd:function(a,b,c){if(this.all.getCount()===0)this.refresh();
else{a=this.bufferRender(b,c);b=this.all.elements;if(c<this.all.getCount()){this.all.item(c).insertSibling(a,"before",true);b.splice.apply(b,[c,0].concat(a))}else{this.all.last().insertSibling(a,"after",true);b.push.apply(b,a)}this.updateIndexes(c)}},onRemove:function(a,b,c){this.deselect(c);this.all.removeElement(c,true);this.updateIndexes(c);this.store.getCount()===0&&this.refresh()},refreshNode:function(a){this.onUpdate(this.store,this.store.getAt(a))},updateIndexes:function(a,b){var c=this.all.elements;
a=a||0;b=b||(b===0?0:c.length-1);for(var d=a;d<=b;d++)c[d].viewIndex=d},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)&&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()),c;if(b){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(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());b?this.fireEvent("contextmenu",this,this.indexOf(b),b,a):this.fireEvent("containercontextmenu",this,a)},onDblClick:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());b&&this.fireEvent("dblclick",
this,this.indexOf(b),b,a)},onMouseOver:function(a){var b=a.getTarget(this.itemSelector,this.getTemplateTarget());if(b&&b!==this.lastItem){this.lastItem=b;Ext.fly(b).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(b),b,a)}},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(a,b,
c){if(this.fireEvent("beforeclick",this,b,a,c)===false)return false;if(this.multiSelect){this.doMultiSelection(a,b,c);c.preventDefault()}else if(this.singleSelect){this.doSingleSelection(a,b,c);c.preventDefault()}return true},doSingleSelection:function(a,b,c){c.ctrlKey&&this.isSelected(b)?this.deselect(b):this.select(b,false)},doMultiSelection:function(a,b,c){if(c.shiftKey&&this.last!==false){a=this.last;this.selectRange(a,b,c.ctrlKey);this.last=a}else(c.ctrlKey||this.simpleSelect)&&this.isSelected(b)?
this.deselect(b):this.select(b,c.ctrlKey||c.shiftKey||this.simpleSelect)},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){for(var a=[],b=this.selected.elements,c=0,d=b.length;c<d;c++)a.push(b[c].viewIndex);return a},getSelectedRecords:function(){return this.getRecords(this.selected.elements)},getRecords:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b[b.length]=this.store.getAt(a[c].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(a,b,c){if(Ext.isArray(a)){b||this.clearSelections(true);b=0;for(var d=a.length;b<d;b++)this.select(a[b],true,true);c||this.fireEvent("selectionchange",this,this.selected.elements)}else{a=this.getNode(a);b||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;c||this.fireEvent("selectionchange",this,this.selected.elements)}}},selectRange:function(a,b,c){c||this.clearSelections(true);this.select(this.getNodes(a,b),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)return this.all.elements[this.store.indexOf(a)];return a},getNodes:function(a,b){var c=this.all.elements,d=[],e;a=a||0;b=!Ext.isDefined(b)?
Math.max(c.length-1,0):b;if(a<=b)for(e=a;e<=b&&c[e];e++)d.push(c[e]);else for(e=a;e>=b&&c[e];e--)d.push(c[e]);return d},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.list.ListView=Ext.extend(Ext.DataView,{itemSelector:"dl",selectedClass:"x-list-selected",overClass:"x-list-over",scrollOffset:undefined,columnResize:true,columnSort:true,maxColumnWidth:Ext.isIE9m?99:100,initComponent:function(){if(this.columnResize){this.colResizer=new Ext.list.ColumnResizer(this.colResizer);this.colResizer.init(this)}if(this.columnSort){this.colSorter=new Ext.list.Sorter(this.columnSort);this.colSorter.init(this)}if(!this.internalTpl)this.internalTpl=new Ext.XTemplate('<div class="x-list-header"><div class="x-list-header-inner">',
'<tpl for="columns">','<div style="width:{[values.width*100]}%;text-align:{align};"><em class="x-unselectable" unselectable="on" id="',this.id,'-xlhd-{#}">',"{header}","</em></div>","</tpl>",'<div class="x-clear"></div>',"</div></div>",'<div class="x-list-body"><div class="x-list-body-inner">',"</div></div>");if(!this.tpl)this.tpl=new Ext.XTemplate('<tpl for="rows">',"<dl>",'<tpl for="parent.columns">','<dt style="width:{[values.width*100]}%;text-align:{align};">','<em unselectable="on"<tpl if="cls"> class="{cls}</tpl>">',
"{[values.tpl.apply(parent)]}","</em></dt>","</tpl>",'<div class="x-clear"></div>',"</dl>","</tpl>");for(var a=this.columns,b=0,c=0,d=a.length,e=[],g=0;g<d;g++){var h=a[g];if(!h.isColumn){h.xtype=h.xtype?/^lv/.test(h.xtype)?h.xtype:"lv"+h.xtype:"lvcolumn";h=Ext.create(h)}if(h.width){b+=h.width*100;if(b>this.maxColumnWidth)h.width-=(b-this.maxColumnWidth)/100;c++}e.push(h)}a=this.columns=e;if(c<d){h=d-c;if(b<this.maxColumnWidth){b=(this.maxColumnWidth-b)/h/100;for(c=0;c<d;c++){h=a[c];if(!h.width)h.width=
b}}}Ext.list.ListView.superclass.initComponent.call(this)},onRender:function(){this.autoEl={cls:"x-list-wrap"};Ext.list.ListView.superclass.onRender.apply(this,arguments);this.internalTpl.overwrite(this.el,{columns:this.columns});this.innerBody=Ext.get(this.el.dom.childNodes[1].firstChild);this.innerHd=Ext.get(this.el.dom.firstChild.firstChild);if(this.hideHeaders)this.el.dom.firstChild.style.display="none"},getTemplateTarget:function(){return this.innerBody},collectData:function(){return{columns:this.columns,
rows:Ext.list.ListView.superclass.collectData.apply(this,arguments)}},verifyInternalSize:function(){this.lastSize&&this.onResize(this.lastSize.width,this.lastSize.height)},onResize:function(a,b){var c=this.innerBody.dom,d=this.innerHd.dom,e=a-Ext.num(this.scrollOffset,Ext.getScrollBarWidth())+"px",g;if(c){g=c.parentNode;if(Ext.isNumber(a))if(this.reserveScrollOffset||g.offsetWidth-g.clientWidth>10){c.style.width=e;d.style.width=e}else{c.style.width=a+"px";d.style.width=a+"px";setTimeout(function(){if(g.offsetWidth-
g.clientWidth>10){c.style.width=e;d.style.width=e}},10)}if(Ext.isNumber(b))g.style.height=Math.max(0,b-d.parentNode.offsetHeight)+"px"}},updateIndexes:function(){Ext.list.ListView.superclass.updateIndexes.apply(this,arguments);this.verifyInternalSize()},findHeaderIndex:function(a){a=a.dom||a;a=a.parentNode;for(var b=a.parentNode.childNodes,c=0,d;d=b[c];c++)if(d==a)return c;return-1},setHdWidths:function(){for(var a=this.innerHd.dom.getElementsByTagName("div"),b=0,c=this.columns,d=c.length;b<d;b++)a[b].style.width=
c[b].width*100+"%"}});Ext.reg("listview",Ext.list.ListView);Ext.ListView=Ext.list.ListView;Ext.list.Column=Ext.extend(Object,{isColumn:true,align:"left",header:"",width:null,cls:"",constructor:function(a){if(a.tpl){if(Ext.isString(a.tpl))a.tpl=new Ext.XTemplate(a.tpl)}else a.tpl=new Ext.XTemplate("{"+a.dataIndex+"}");Ext.apply(this,a)}});Ext.reg("lvcolumn",Ext.list.Column);
Ext.list.NumberColumn=Ext.extend(Ext.list.Column,{format:"0,000.00",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':number("'+(a.format||this.format)+'")}');Ext.list.NumberColumn.superclass.constructor.call(this,a)}});Ext.reg("lvnumbercolumn",Ext.list.NumberColumn);
Ext.list.DateColumn=Ext.extend(Ext.list.Column,{format:"m/d/Y",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+':date("'+(a.format||this.format)+'")}');Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvdatecolumn",Ext.list.DateColumn);
Ext.list.BooleanColumn=Ext.extend(Ext.list.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){a.tpl=a.tpl||new Ext.XTemplate("{"+a.dataIndex+":this.format}");var b=this.trueText,c=this.falseText,d=this.undefinedText;a.tpl.format=function(e){if(e===undefined)return d;if(!e||e==="false")return c;return b};Ext.list.DateColumn.superclass.constructor.call(this,a)}});Ext.reg("lvbooleancolumn",Ext.list.BooleanColumn);
Ext.list.ColumnResizer=Ext.extend(Ext.util.Observable,{minPct:0.05,constructor:function(a){Ext.apply(this,a);Ext.list.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),
tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(a){var b=a.getPageX();if(a=a.getTarget("em",3,true)){var c=a.getRegion(),d=a.dom.style,e=a.dom.parentNode;if(b-c.left<=5&&e!=e.parentNode.firstChild){this.activeHd=Ext.get(e.previousSibling.firstChild);d.cursor=Ext.isWebKit?"e-resize":"col-resize"}else if(c.right-b<=5&&e!=e.parentNode.lastChild.previousSibling){this.activeHd=a;d.cursor=Ext.isWebKit?"w-resize":"col-resize"}else{delete this.activeHd;
d.cursor=""}}},onBeforeStart:function(){this.dragHd=this.activeHd;return!!this.dragHd},onStart:function(){var a=this.view,b=this.dragHd,c=this.tracker.getXY()[0];this.proxy=a.el.createChild({cls:"x-list-resizer"});this.dragX=b.getX();this.headerIndex=a.findHeaderIndex(b);this.headersDisabled=a.disableHeaders;a.disableHeaders=true;this.proxy.setHeight(a.el.getHeight());this.proxy.setX(this.dragX);this.proxy.setWidth(c-this.dragX);this.setBoundaries()},setBoundaries:function(a){var b=this.view,c=this.headerIndex,
d=b.innerHd.getWidth();a=b.innerHd.getX();var e=Math.ceil(d*this.minPct),g=d-e;d=b.columns.length;b=b.innerHd.select("em",true);var h=e+a;a=g+a;if(d==2){this.minX=h;this.maxX=a}else{g=b.item(c+2);this.minX=b.item(c).getX()+e;this.maxX=g?g.getX()-e:a;if(c==0)this.minX=h;else if(c==d-2)this.maxX=a}},onDrag:function(){this.proxy.setWidth(this.tracker.getXY()[0].constrain(this.minX,this.maxX)-this.dragX)},onEnd:function(){var a=this.proxy.getWidth(),b=this.headerIndex,c=this.view,d=c.columns,e=c.innerHd.getWidth();
a=Math.ceil(a*c.maxColumnWidth/e)/100;var g=this.headersDisabled;e=d[b];b=d[b+1];d=e.width+b.width;this.proxy.remove();e.width=a;b.width=d-a;delete this.dragHd;c.setHdWidths();c.refresh();setTimeout(function(){c.disableHeaders=g},100)}});Ext.ListView.ColumnResizer=Ext.list.ColumnResizer;
Ext.list.Sorter=Ext.extend(Ext.util.Observable,{sortClasses:["sort-asc","sort-desc"],constructor:function(a){Ext.apply(this,a);Ext.list.Sorter.superclass.constructor.call(this)},init:function(a){this.view=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"click",this.onHdClick,this);a.innerHd.setStyle("cursor","pointer");a.mon(a.store,"datachanged",this.updateSortState,this);this.updateSortState.defer(10,this,[a.store])},updateSortState:function(a){if(a=a.getSortState()){this.sortState=
a;for(var b=this.view.columns,c=-1,d=0,e=b.length;d<e;d++)if(b[d].dataIndex==a.field){c=d;break}c!=-1&&this.updateSortIcon(c,a.direction)}},updateSortIcon:function(a,b){var c=this.sortClasses;this.view.innerHd.select("em").removeClass(c).item(a).addClass(c[b=="DESC"?1:0])},onHdClick:function(a){(a=a.getTarget("em",3))&&!this.view.disableHeaders&&this.view.store.sort(this.view.columns[this.view.findHeaderIndex(a)].dataIndex)}});Ext.ListView.Sorter=Ext.list.Sorter;
Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.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(a,b){Ext.TabPanel.superclass.onRender.call(this,a,b);if(this.plain){var c=
this.tabPosition=="top"?"header":"footer";this[c].addClass("x-tab-panel-"+c+"-plain")}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}});c.createChild({cls:"x-tab-strip-spacer"},this.tabPosition=="bottom"?this.stripWrap:null);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){c=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>");c.disableFormats=true;c.compile();Ext.TabPanel.prototype.itemTpl=c}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(a){var b=null,c=a.getTarget("li:not(.x-tab-edge)",
this.strip);if(c){b=this.getComponent(c.id.split(this.idDelimiter)[1]);if(b.disabled)return{close:null,item:null,el:null}}return{close:a.getTarget(".x-tab-strip-close",this.strip),item:b,el:c}},onStripMouseDown:function(a){if(a.button===0){a.preventDefault();a=this.findTargets(a);if(a.close){if(a.item.fireEvent("beforeclose",a.item)!==false){a.item.fireEvent("close",a.item);this.remove(a.item)}}else 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(a){a===true&&this.items.each(function(g){this.remove(g)},this);a=this.el.query(this.autoTabSelector);for(var b=0,c=a.length;b<c;b++){var d=a[b],e=d.getAttribute("title");d.removeAttribute("title");this.add({title:e,contentEl:d})}},initTab:function(a,b){var c=this.strip.dom.childNodes[b],d=this.getTemplateArgs(a);c=c?this.itemTpl.insertBefore(c,d):this.itemTpl.append(this.strip,d);var e=Ext.get(c);e.hover(function(){a.disabled||
e.addClass("x-tab-strip-over")},function(){e.removeClass("x-tab-strip-over")});if(a.tabTip)e.child("span.x-tab-strip-text",true).qtip=a.tabTip;a.tabEl=c;e.select("a").on("click",function(g){g.getPageX()||this.onStripMouseDown(g)},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){this.initTab(a,this.items.indexOf(a));this.delegateUpdates()}},onBeforeAdd:function(a){if(a.events?this.items.containsKey(a.getItemId())?a:null:this.items.get(a)){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)if(a=this.stack.next())this.setActiveTab(a);else this.items.getCount()>0?this.setActiveTab(0):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(a){(a=this.getTabEl(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;this.delegateUpdates()}},onItemIconChanged:function(a,b,c){if(a=this.getTabEl(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");this.delegateUpdates()}},getTabEl:function(a){return(a=this.getComponent(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);if(a=this.getTabEl(a)){a.style.display="";this.delegateUpdates()}},delegateUpdates:function(){var a=this.rendered;if(!this.suspendUpdates){this.resizeTabs&&a&&this.autoSizeTabs();this.enableTabScroll&&a&&this.autoScrollTabs()}},
autoSizeTabs:function(){var a=this.items.length,b=this[this.tabPosition!="bottom"?"header":"footer"].dom.clientWidth;if(!(!this.resizeTabs||a<1||!b)){this.lastTabWidth=a=Math.max(Math.min(Math.floor((b-4)/a)-this.tabMargin,this.tabWidth),this.minTabWidth);b=this.strip.query("li:not(.x-tab-edge)");for(var c=0,d=b.length;c<d;c++){var e=b[c],g=Ext.fly(e).child(".x-tab-strip-inner",true);g.style.width=a-(e.offsetWidth-g.offsetWidth)+"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)if(this.rendered){if(this.activeTab!=a){if(this.activeTab){var b=this.getTabEl(this.activeTab);b&&Ext.fly(b).removeClass("x-tab-strip-active")}if(this.activeTab=a){b=this.getTabEl(a);Ext.fly(b).addClass("x-tab-strip-active");this.stack.add(a);this.layout.setActiveItem(a);this.delegateUpdates();this.scrolling&&this.scrollToTab(a,this.animScroll)}this.fireEvent("tabchange",
this,a)}}else this.activeTab=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 a=this.items.length,b=this.pos.dom.clientWidth,c=this.stripWrap,d=c.dom,e=d.offsetWidth,g=this.getScrollPos(),h=this.edge.getOffsetsTo(this.stripWrap)[0]+g;if(!(!this.enableTabScroll||e<20))if(a==0||h<=b){d.scrollLeft=0;c.setWidth(b);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");
this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isWebKit){d.style.marginLeft="";d.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isWebKit){d.style.marginLeft="18px";d.style.marginRight="18px"}}b-=c.getMargins("lr");c.setWidth(b>20?b:20);if(!this.scrolling)if(this.scrollLeft){this.scrollLeft.show();this.scrollRight.show()}else this.createScrollers();this.scrolling=true;if(g>h-b)d.scrollLeft=h-b;else this.scrollToTab(this.activeTab,
false);this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var a=this.stripWrap.dom.offsetHeight,b=this.pos.insertFirst({cls:"x-tab-scroller-left"});b.setHeight(a);b.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(b,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=b;b=this.pos.insertFirst({cls:"x-tab-scroller-right"});b.setHeight(a);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(a,b){if(a){var c=this.getTabEl(a),d=this.getScrollPos(),e=this.getScrollArea(),g=Ext.fly(c).getOffsetsTo(this.stripWrap)[0]+d;c=g+c.offsetWidth;if(g<d)this.scrollTo(g,b);else c>d+e&&this.scrollTo(c-e,b)}},scrollTo:function(a,b){this.stripWrap.scrollTo("left",a,b?this.getScrollAnim():false);b||this.updateScrollButtons()},onWheel:function(a){var b=a.getWheelDelta()*this.wheelIncrement*
-1;a.stopEvent();a=this.getScrollPos();b=a+b;var c=this.getScrollWidth()-this.getScrollArea();b=Math.max(0,Math.min(c,b));b!=a&&this.scrollTo(b,false)},onScrollRight:function(){var a=this.getScrollWidth()-this.getScrollArea(),b=this.getScrollPos();a=Math.min(a,b+this.getScrollIncrement());a!=b&&this.scrollTo(a,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(b){for(var c=[],d=0,e=a.length;d<e;d++)a[d]!=b&&c.push(a[d]);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(){if(this.menu){if(Ext.isArray(this.menu))this.menu={items:this.menu};if(Ext.isObject(this.menu))this.menu.ownerCt=this;this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=
undefined}Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");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(a,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} x-unselectable" 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 c;c=this.getTemplateArgs();c=b?this.template.insertBefore(b,c,true):this.template.append(a,
c,true);this.btnEl=c.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(c,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(a,b){this.el=a;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex))b.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});this.repeat?this.mon(new Ext.util.ClickRepeater(a,Ext.isObject(this.repeat)?this.repeat:{}),"click",this.onRepeatClick,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.btnEl,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"))}}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){if(this.rendered)this.el[a?"addClass":"removeClass"]("x-btn-pressed");this.pressed=a;if(!b){this.fireEvent("toggle",this,a);if(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){if(!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()},onRepeatClick:function(a,b){this.onClick(b)},onClick:function(a){a&&a.preventDefault();if(a.button===0)if(!this.disabled){this.doToggle();
this.menu&&!this.hasVisibleMenu()&&!this.ignoreNextClick&&this.showMenu();this.fireEvent("click",this,a);if(this.handler)this.handler.call(this.scope||this,this,a)}},doToggle:function(){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed))this.toggle()},isMenuTriggerOver:function(a,b){return this.menu&&!b},isMenuTriggerOut:function(a,b){return this.menu&&!b},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(){function a(c,d){if(d)for(var e=b[c.toggleGroup],g=0,h=e.length;g<h;g++)e[g]!=c&&e[g].toggle(false)}var b={};return{register:function(c){if(c.toggleGroup){var d=b[c.toggleGroup];d||(d=b[c.toggleGroup]=[]);d.push(c);c.on("toggle",a)}},unregister:function(c){if(c.toggleGroup){var d=b[c.toggleGroup];if(d){d.remove(c);c.un("toggle",a)}}},getPressed:function(c){if(c=b[c])for(var d=0,e=c.length;d<e;d++)if(c[d].pressed===true)return c[d];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(a){if(this.arrowAlign!=
"bottom"){var b=this.el.child("em.x-btn-split");b=b.getRegion().right-b.getPadding("r");return a.getPageX()>b}else return a.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);if(this.arrowHandler)this.arrowHandler.call(this.scope||this,this,a)}else{this.doToggle();this.fireEvent("click",this,a);if(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(a){if(a&&this.showText===true){var b="";if(this.prependText)b+=this.prependText;b+=a.text;return b}},setActiveItem:function(a,b){Ext.isObject(a)||(a=this.menu.getComponent(a));if(a){if(this.rendered){var c=this.getItemText(a);c&&this.setText(c);this.setIconClass(a.iconCls)}else{this.text=this.getItemText(a);this.iconCls=a.iconCls}this.activeItem=a;a.checked||a.setChecked(true,b);this.forceIcon&&this.setIconClass(this.forceIcon);b||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(a,b){b&&this.setActiveItem(a)},toggleSelected:function(){var a=this.menu;a.render();a.hasLayout||a.doLayout();for(var b,c=1;c<this.itemCount;c++){b=(this.activeItem.itemIndex+c)%this.itemCount;b=a.items.itemAt(b);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,c){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),c);Ext.Toolbar.superclass.onRender.apply(this,
arguments)}},lookupComponent:function(b){if(Ext.isString(b)){b=b=="-"?new a.Separator:b==" "?new a.Spacer:b=="->"?new a.Fill: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(b){if(!Ext.isString(b)){b=Ext.Toolbar.superclass.applyDefaults.call(this,b);var c=this.internalDefaults;
if(b.events){Ext.applyIf(b.initialConfig,c);Ext.apply(b,c)}else Ext.applyIf(b,c)}return b},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(b){if(Ext.isArray(b)){for(var c=[],d=0,e=b.length;d<e;d++)c.push(this.addButton(b[d]));return c}return this.add(this.constructButton(b))},
addText:function(b){return this.addItem(new a.TextItem(b))},addDom:function(b){return this.add(new a.Item({autoEl:b}))},addField:function(b){return this.add(b)},insertButton:function(b,c){if(Ext.isArray(c)){for(var d=[],e=0,g=c.length;e<g;e++)d.push(this.insertButton(b+e,c[e]));return d}return Ext.Toolbar.superclass.insert.call(this,b,c)},trackMenu:function(b,c){if(this.trackMenus&&b.menu){var d=c?"mun":"mon";this[d](b,"menutriggerover",this.onButtonTriggerOver,this);this[d](b,"menushow",this.onButtonMenuShow,
this);this[d](b,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(b){return b.events?b:this.createComponent(b,b.split?"splitbutton":this.defaultType)},onAdd:function(b){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(b);this.disabled&&b.disable()},onRemove:function(b){Ext.Toolbar.superclass.onRemove.call(this);b==this.activeMenuBtn&&delete this.activeMenuBtn;this.trackMenu(b,true)},onDisable:function(){this.items.each(function(b){b.disable&&b.disable()})},onEnable:function(){this.items.each(function(b){b.enable&&
b.enable()})},onButtonTriggerOver:function(b){if(this.activeMenuBtn&&this.activeMenuBtn!=b){this.activeMenuBtn.hideMenu();b.showMenu();this.activeMenuBtn=b}},onButtonMenuShow:function(b){this.activeMenuBtn=b},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,c){this.el=b.createChild({tag:"span",
cls:"xtb-sep"},c)}});Ext.reg("tbseparator",a.Separator);a.Spacer=Ext.extend(a.Item,{onRender:function(b,c){this.el=b.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},c)}});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(b,c){this.autoEl={cls:"xtb-text",html:this.text||
""};a.TextItem.superclass.onRender.call(this,b,c)},setText:function(b){if(this.rendered)this.el.update(b);else this.text=b}});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)})();
Ext.ButtonGroup=Ext.extend(Ext.Panel,{baseCls:"x-btn-group",layout:"table",defaultType:"button",frame:true,internalDefaults:{removeMode:"container",hideParent:true},initComponent:function(){this.layoutConfig=this.layoutConfig||{};Ext.applyIf(this.layoutConfig,{columns:this.columns});this.title||this.addClass("x-btn-group-notitle");this.on("afterlayout",this.onAfterLayout,this);Ext.ButtonGroup.superclass.initComponent.call(this)},applyDefaults:function(a){a=Ext.ButtonGroup.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},onAfterLayout:function(){var a=this.body.getFrameWidth("lr")+this.body.dom.firstChild.offsetWidth;this.body.setWidth(a);this.el.setWidth(a+this.getFrameWidth())}});Ext.reg("buttongroup",Ext.ButtonGroup);
(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||[];this.items=this.prependButtons?c.concat(b):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 b=this.store.getCount();this.displayItem.setText(b==0?this.emptyMsg:String.format(this.displayMsg,
this.cursor+1,this.cursor+b,this.store.getTotalCount()))}},onLoad:function(b,c,d){if(this.rendered){b=this.getParams();this.cursor=d.params&&d.params[b.start]?d.params[b.start]:0;d=this.getPageData();b=d.activePage;c=d.pages;this.afterTextItem.setText(String.format(this.afterPageText,d.pages));this.inputItem.setValue(b);this.first.setDisabled(b==1);this.prev.setDisabled(b==1);this.next.setDisabled(b==c);this.last.setDisabled(b==c);this.refresh.enable();this.updateInfo();this.fireEvent("change",this,
d)}else this.dsLoaded=[b,c,d]},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b<this.pageSize?1:Math.ceil(b/this.pageSize)}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onLoadError:function(){this.rendered&&this.refresh.enable()},readPage:function(b){var c=this.inputItem.getValue(),d;if(!c||isNaN(d=parseInt(c,10))){this.inputItem.setValue(b.activePage);
return false}return d},onPagingFocus:function(){this.inputItem.select()},onPagingBlur:function(){this.inputItem.setValue(this.getPageData().activePage)},onPagingKeyDown:function(b,c){var d=c.getKey(),e=this.getPageData(),g;if(d==c.RETURN){c.stopEvent();g=this.readPage(e);if(g!==false){g=Math.min(Math.max(1,g),e.pages)-1;this.doLoad(g*this.pageSize)}}else if(d==c.HOME||d==c.END){c.stopEvent();g=d==c.HOME?1:e.pages;b.setValue(g)}else if(d==c.UP||d==c.PAGEUP||d==c.DOWN||d==c.PAGEDOWN){c.stopEvent();
if(g=this.readPage(e)){var h=c.shiftKey?10:1;if(d==c.DOWN||d==c.PAGEDOWN)h*=-1;g+=h;g>=1&g<=e.pages&&b.setValue(g)}}},getParams:function(){return this.paramNames||this.store.paramNames},beforeLoad:function(){this.rendered&&this.refresh&&this.refresh.disable()},doLoad:function(b){var c={},d=this.getParams();c[d.start]=b;c[d.limit]=this.pageSize;this.fireEvent("beforechange",this,c)!==false&&this.store.load({params:c})},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 b=this.store.getTotalCount(),c=b%this.pageSize;this.doLoad(c?b-c:b-this.pageSize)},doRefresh:function(){this.doLoad(this.cursor)},bindStore:function(b,c){var d;if(!c&&this.store){if(b!==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(!b)this.store=
null}if(b){b=Ext.StoreMgr.lookup(b);b.on({scope:this,beforeload:this.beforeLoad,load:this.onLoad,exception:this.onLoadError});d=true}this.store=b;d&&this.onLoad(b,null,{})},unbind:function(){this.bindStore(null)},bind:function(b){this.bindStore(b)},onDestroy:function(){this.bindStore(null);Ext.PagingToolbar.superclass.onDestroy.call(this)}})})();Ext.reg("paging",Ext.PagingToolbar);
Ext.History=function(){function a(){var j=location.href,k=j.indexOf("#");j=k>=0?j.substr(k+1):null;if(Ext.isGecko)j=decodeURIComponent(j);return j}function b(j){j=['<html><body><div id="state">',Ext.util.Format.htmlEncode(j),"</div></body></html>"].join("");try{var k=e.contentWindow.document;k.open();k.write(j);k.close();return true}catch(m){return false}}function c(){if(!e.contentWindow||!e.contentWindow.document)setTimeout(c,10);else{var j=e.contentWindow.document,k=j.getElementById("state"),m=
k?k.innerText:null,p=a();setInterval(function(){j=e.contentWindow.document;var o=(k=j.getElementById("state"))?k.innerText:null,s=a();if(o!==m){i=o=m=o;Ext.History.fireEvent("change",o);p=location.hash=m;g.value=i}else if(s!==p){p=s;b(s)}},50);h=true;Ext.History.fireEvent("ready",Ext.History)}}function d(){i=g.value?g.value:a();if(Ext.isIE)c();else{var j=a();setInterval(function(){var k=a();if(k!==j){i=k=j=k;Ext.History.fireEvent("change",k);g.value=i}},50);h=true;Ext.History.fireEvent("ready",Ext.History)}}
var e,g,h=false,i;return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(j,k){if(h)Ext.callback(j,k,[this]);else if(Ext.isReady){g=Ext.getDom(Ext.History.fieldId);if(Ext.isIE)e=Ext.getDom(Ext.History.iframeId);this.addEvents("ready","change");j&&this.on("ready",j,k,{single:true});d()}else Ext.onReady(function(){Ext.History.init(j,k)})},add:function(j,k){if(k!==false)if(this.getToken()==j)return true;if(Ext.isIE)return b(j);else{location.hash=j;return true}},back:function(){history.go(-1)},
forward:function(){history.go(1)},getToken:function(){return h?i:a()}}}();Ext.apply(Ext.History,new Ext.util.Observable);
Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title)this.elements+=",header"},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);this.closable&&this.addTool({id:"close",handler:this[this.closeAction],
scope:this})},showAt:function(a){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number"))this.doAutoWidth();if(this.constrainPosition)a=this.el.adjustForConstraints(a);this.setPagePosition(a[0],a[1])},doAutoWidth:function(a){a=a||0;var b=this.body.getTextWidth();if(this.title)b=Math.max(b,this.header.child("span").getTextWidth(this.title));b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+a;this.setWidth(b.constrain(this.minWidth,
this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(a,b){this.rendered||this.render(Ext.getBody());this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);
Ext.Tip.DD=function(a,b){Ext.apply(this,b);this.tip=a;Ext.Tip.DD.superclass.constructor.call(this,a.el.id,"WindowDD-"+a.id);this.setHandleElId(a.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(){this.tip.el.enableShadow(true)}});
Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5E3,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date;this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(a,b){Ext.ToolTip.superclass.onRender.call(this,a,b);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+
this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1).setVisibilityMode(Ext.Element.DISPLAY)},initTarget:function(a){if(a=Ext.get(a)){if(this.target){var b=Ext.get(this.target);this.mun(b,"mouseover",this.onTargetOver,this);this.mun(b,"mouseout",this.onTargetOut,this);this.mun(b,"mousemove",this.onMouseMove,this)}this.mon(a,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});
this.target=a}if(this.anchor)this.anchorTarget=this.target},onMouseMove:function(a){var b=this.delegate?a.getTarget(this.delegate):this.triggerElement=true;if(b){this.targetXY=a.getXY();if(b===this.triggerElement)!this.hidden&&this.trackMouse&&this.setPagePosition(this.getTargetXY());else{this.hide();this.lastActive=new Date(0);this.onTargetOver(a)}}else!this.closable&&this.isVisible()&&this.hide()},getTargetXY:function(){if(this.delegate)this.anchorTarget=this.triggerElement;if(this.anchor){this.targetCounter++;
var a=this.getOffsets(),b=this.anchorToTarget&&!this.trackMouse?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,c=Ext.lib.Dom.getViewWidth()-5,d=Ext.lib.Dom.getViewHeight()-5,e=document.documentElement,g=document.body,h=(e.scrollLeft||g.scrollLeft||0)+5;e=(e.scrollTop||g.scrollTop||0)+5;a=[b[0]+a[0],b[1]+a[1]];b=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(a[0]<h){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset)this.mouseOffset[0]*=
-1}this.anchor="left";return this.getTargetXY()}if(a[0]+b.width>c){if(this.anchorToTarget){this.defaultAlign="r-l";if(this.mouseOffset)this.mouseOffset[0]*=-1}this.anchor="right";return this.getTargetXY()}if(a[1]<e){if(this.anchorToTarget){this.defaultAlign="t-b";if(this.mouseOffset)this.mouseOffset[1]*=-1}this.anchor="top";return this.getTargetXY()}if(a[1]+b.height>d){if(this.anchorToTarget){this.defaultAlign="b-t";if(this.mouseOffset)this.mouseOffset[1]*=-1}this.anchor="bottom";return this.getTargetXY()}}this.anchorCls=
"x-tip-anchor-"+this.getAnchorPosition();this.anchorEl.addClass(this.anchorCls);this.targetCounter=0;return a}else{c=this.getMouseOffset();return[this.targetXY[0]+c[0],this.targetXY[1]+c[1]]}},getMouseOffset:function(){var a=this.anchor?[0,0]:[15,18];if(this.mouseOffset){a[0]+=this.mouseOffset[0];a[1]+=this.mouseOffset[1]}return a},getAnchorPosition:function(){if(this.anchor)this.tipAnchor=this.anchor.charAt(0);else{var a=this.defaultAlign.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!a)throw"AnchorTip.defaultAlign is invalid";
this.tipAnchor=a[1].charAt(0)}switch(this.tipAnchor){case "t":return"top";case "b":return"bottom";case "r":return"right"}return"left"},getAnchorAlign:function(){switch(this.anchor){case "top":return"tl-bl";case "left":return"tl-tr";case "right":return"tr-tl";default:return"bl-tl"}},getOffsets:function(){var a;a=this.getAnchorPosition().charAt(0);if(this.anchorToTarget&&!this.trackMouse)switch(a){case "t":a=[0,9];break;case "b":a=[0,-13];break;case "r":a=[-13,0];break;default:a=[9,0]}else switch(a){case "t":a=
[-15-this.anchorOffset,30];break;case "b":a=[-19-this.anchorOffset,-13-this.el.dom.offsetHeight];break;case "r":a=[-15-this.el.dom.offsetWidth,-13-this.anchorOffset];break;default:a=[25,-13-this.anchorOffset]}var b=this.getMouseOffset();a[0]+=b[0];a[1]+=b[1];return a},onTargetOver:function(a){if(!(this.disabled||a.within(this.target.dom,true))){var b=a.getTarget(this.delegate);if(b){this.triggerElement=b;this.clearTimer("hide");this.targetXY=a.getXY();this.delayShow()}}},delayShow:function(){if(this.hidden&&
!this.showTimer)if(this.lastActive.getElapsed()<this.quickShowInterval)this.show();else this.showTimer=this.show.defer(this.showDelay,this);else!this.hidden&&this.autoHide!==false&&this.show()},onTargetOut:function(a){if(!(this.disabled||a.within(this.target.dom,true))){this.clearTimer("show");this.autoHide!==false&&this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer)this.hideTimer=this.hide.defer(this.hideDelay,this)},hide:function(){this.clearTimer("dismiss");this.lastActive=
new Date;this.anchorEl&&this.anchorEl.hide();Ext.ToolTip.superclass.hide.call(this);delete this.triggerElement},show:function(){if(this.anchor){this.showAt([-1E3,-1E3]);this.origConstrainPosition=this.constrainPosition;this.constrainPosition=false;this.anchor=this.origAnchor}this.showAt(this.getTargetXY());if(this.anchor){this.anchorEl.show();this.syncAnchor();this.constrainPosition=this.origConstrainPosition}else this.anchorEl.hide()},showAt:function(a){this.lastActive=new Date;this.clearTimers();
Ext.ToolTip.superclass.showAt.call(this,a);if(this.dismissDelay&&this.autoHide!==false)this.dismissTimer=this.hide.defer(this.dismissDelay,this);if(this.anchor&&!this.anchorEl.isVisible()){this.syncAnchor();this.anchorEl.show()}else this.anchorEl.hide()},syncAnchor:function(){var a,b,c;switch(this.tipAnchor.charAt(0)){case "t":a="b";b="tl";c=[20+this.anchorOffset,2];break;case "r":a="l";b="tr";c=[-2,11+this.anchorOffset];break;case "b":a="t";b="bl";c=[20+this.anchorOffset,-2];break;default:a="r";
b="tl";c=[2,11+this.anchorOffset]}this.anchorEl.alignTo(this.el,a+"-"+b,c)},setPagePosition:function(a,b){Ext.ToolTip.superclass.setPagePosition.call(this,a,b);this.anchor&&this.syncAnchor()},clearTimer:function(a){a+="Timer";clearTimeout(this[a]);delete this[a]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);
Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(a){if(this.autoHide!==true&&!this.closable&&!a.within(this.el.dom)){this.disable();this.doEnable.defer(100,this)}},doEnable:function(){this.isDestroyed||this.enable()},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(a,b){if(this.constrainPosition){var c=this.targetXY[1],d=this.getSize().height;if(b<=c&&b+d>=c)b=c-d-5}return{x:a,y:b}},beforeDestroy:function(){this.clearTimers();Ext.destroy(this.anchorEl);
delete this.anchorEl;delete this.target;delete this.anchorTarget;delete this.triggerElement;Ext.ToolTip.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.getDoc().un("mousedown",this.onDocMouseDown,this);Ext.ToolTip.superclass.onDestroy.call(this)}});Ext.reg("tooltip",Ext.ToolTip);
Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign",anchor:"anchor"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(a){for(var b=Ext.isArray(a)?a:arguments,c=0,d=b.length;c<d;c++){var e=b[c],g=e.target;if(g)if(Ext.isArray(g))for(var h=0,i=g.length;h<
i;h++)this.targets[Ext.id(g[h])]=e;else this.targets[Ext.id(g)]=e}},unregister:function(a){delete this.targets[Ext.id(a)]},cancelShow:function(a){var b=this.activeTarget;a=Ext.get(a).dom;if(this.isVisible())b&&b.el==a&&this.hide();else b&&b.el==a&&this.clearTimer("show")},getTipCfg:function(a){var b=a.getTarget(),c;if(this.interceptTitles&&b.title&&Ext.isString(b.title)){c=b.title;b.qtip=c;b.removeAttribute("title");a.preventDefault()}else{a=this.tagConfig;c=b.qtip||Ext.fly(b).getAttribute(a.attribute,
a.namespace)}return c},onTargetOver:function(a){if(!this.disabled){this.targetXY=a.getXY();var b=a.getTarget();if(!(!b||b.nodeType!==1||b==document||b==document.body))if(this.activeTarget&&(b==this.activeTarget.el||Ext.fly(this.activeTarget.el).contains(b))){this.clearTimer("hide");this.show()}else if(b&&this.targets[b.id]){this.activeTarget=this.targets[b.id];this.activeTarget.el=b;if(this.anchor=this.activeTarget.anchor)this.anchorTarget=b;this.delayShow()}else{var c=Ext.fly(b),d=this.tagConfig,
e=d.namespace;if(a=this.getTipCfg(a)){var g=c.getAttribute(d.hide,e);this.activeTarget={el:b,text:a,width:c.getAttribute(d.width,e),autoHide:g!="user"&&g!=="false",title:c.getAttribute(d.title,e),cls:c.getAttribute(d.cls,e),align:c.getAttribute(d.align,e)};if(this.anchor=c.getAttribute(d.anchor,e))this.anchorTarget=b;this.delayShow()}}}},onTargetOut:function(a){if(!(this.activeTarget&&a.within(this.activeTarget.el)&&!this.getTipCfg(a))){this.clearTimer("show");this.autoHide!==false&&this.delayHide()}},
showAt:function(a){var b=this.activeTarget;if(b){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=b}if(b.width){this.setWidth(b.width);this.body.setWidth(this.adjustBodyWidth(b.width-this.getFrameWidth()));this.measureWidth=false}else this.measureWidth=true;this.setTitle(b.title||"");this.body.update(b.text);this.autoHide=b.autoHide;this.dismissDelay=b.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(b.cls){this.el.addClass(b.cls);
this.lastCls=b.cls}if(this.anchor)this.constrainPosition=false;else if(b.align){a=this.el.getAlignToXY(b.el,b.align);this.constrainPosition=false}else this.constrainPosition=true}Ext.QuickTip.superclass.showAt.call(this,a)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.reg("quicktip",Ext.QuickTip);
Ext.QuickTips=function(){var a,b=false;return{init:function(c){if(!a)if(Ext.isReady){a=new Ext.QuickTip({elements:"header,body",disabled:b});c!==false&&a.render(Ext.getBody())}else Ext.onReady(function(){Ext.QuickTips.init(c)})},ddDisable:function(){a&&!b&&a.disable()},ddEnable:function(){a&&!b&&a.enable()},enable:function(){a&&a.enable();b=false},disable:function(){a&&a.disable();b=true},isEnabled:function(){return a!==undefined&&!a.disabled},getQuickTip:function(){return a},register:function(){a.register.apply(a,
arguments)},unregister:function(){a.unregister.apply(a,arguments)},tips:function(){a.register.apply(a,arguments)}}}();Ext.slider.Tip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on({scope:this,dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy})},onSlide:function(a,b,c){this.show();this.body.update(this.getText(c));this.doAutoWidth();this.el.alignTo(c.el,"b-t?",this.offsets)},getText:function(a){return String(a.value)}});Ext.ux.SliderTip=Ext.slider.Tip;
Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel)this.eventModel=new Ext.tree.TreeEventModel(this);var a=this.loader;if(a){if(Ext.isObject(a)&&!a.load)a=new Ext.tree.TreeLoader(a)}else a=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod});this.loader=a;this.nodeHash=
{};if(this.root){a=this.root;delete this.root;this.setRootNode(a)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop",
"nodedrop","nodedragover");this.singleExpand&&this.on("beforeexpandnode",this.restrictExpand,this)},proxyNodeEvent:function(a,b,c,d,e,g,h){if(a=="collapse"||a=="expand"||a=="beforecollapse"||a=="beforeexpand"||a=="move"||a=="beforemove")a+="node";return this.fireEvent(a,b,c,d,e,g,h)},getRootNode:function(){return this.root},setRootNode:function(a){this.destroyRoot();a.render||(a=this.loader.createNode(a));this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);if(!this.rootVisible){var b=
a.attributes.uiProvider;a.ui=b?new b(a):new Ext.tree.RootTreeNodeUI(a)}if(this.innerCt){this.clearInnerCt();this.renderRoot()}return a},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render();this.rootVisible||this.root.renderChildren()},getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(a){var b=
a.parentNode;if(b){b.expandedChild&&b.expandedChild.parentNode==b&&b.expandedChild.collapse();b.expandedChild=a}},getChecked:function(a,b){b=b||this.root;var c=[];b.cascade(function(){if(this.attributes.checked)c.push(!a?this:a=="id"?this.id:this.attributes[a])});return c},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel)this.selModel=new Ext.tree.DefaultSelectionModel;
return this.selModel},expandPath:function(a,b,c){if(Ext.isEmpty(a))c&&c(false,undefined);else{b=b||"id";var d=a.split(this.pathSeparator),e=this.root;if(e.attributes[b]!=d[1])c&&c(false,null);else{var g=1,h=function(){if(++g==d.length)c&&c(true,e);else{var i=e.findChild(b,d[g]);if(i){e=i;i.expand(false,false,h)}else c&&c(false,e)}};e.expand(false,false,h)}}},selectPath:function(a,b,c){if(Ext.isEmpty(a))c&&c(false,undefined);else{b=b||"id";a=a.split(this.pathSeparator);var d=a.pop();if(a.length>1)this.expandPath(a.join(this.pathSeparator),
b,function(e,g){if(e&&g){var h=g.findChild(b,d);if(h){h.select();c&&c(true,h)}else c&&c(false,h)}else c&&c(false,h)});else{this.root.select();c&&c(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(a,b){Ext.tree.TreePanel.superclass.onRender.call(this,a,b);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);
this.containerScroll&&Ext.dd.ScrollManager.register(this.body);if((this.enableDD||this.enableDrop)&&!this.dropZone)this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true});if((this.enableDD||this.enableDrag)&&!this.dragZone)this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll});this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);
this.renderRoot()},beforeDestroy:function(){if(this.rendered){Ext.dd.ScrollManager.unregister(this.body);Ext.destroy(this.dropZone,this.dragZone)}this.destroyRoot();Ext.destroy(this.loader);this.nodeHash=this.root=this.loader=null;Ext.tree.TreePanel.superclass.beforeDestroy.call(this)},destroyRoot:function(){this.root&&this.root.destroy&&this.root.destroy(true)}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);
Ext.tree.TreeEventModel=function(a){this.tree=a;this.tree.on("render",this.initEvents,this)};
Ext.tree.TreeEventModel.prototype={initEvents:function(){var a=this.tree;a.trackMouseOver!==false&&a.mon(a.innerCt,{scope:this,mouseover:this.delegateOver,mouseout:this.delegateOut});a.mon(a.getTreeEl(),{scope:this,click:this.delegateClick,dblclick:this.delegateDblClick,contextmenu:this.delegateContextMenu})},getNode:function(a){if(a=a.getTarget(".x-tree-node-el",10))if(a=Ext.fly(a,"_treeEvents").getAttribute("tree-node-id","ext"))return this.tree.getNodeById(a);return null},getNodeTarget:function(a){var b=
a.getTarget(".x-tree-node-icon",1);b||(b=a.getTarget(".x-tree-node-el",6));return b},delegateOut:function(a,b){if(this.beforeEvent(a)){if(a.getTarget(".x-tree-ec-icon",1)){var c=this.getNode(a);this.onIconOut(a,c);c==this.lastEcOver&&delete this.lastEcOver}if((b=this.getNodeTarget(a))&&!a.within(b,true))this.onNodeOut(a,this.getNode(a))}},delegateOver:function(a){if(this.beforeEvent(a)){if(Ext.isGecko&&!this.trackingDoc){Ext.getBody().on("mouseover",this.trackExit,this);this.trackingDoc=true}if(this.lastEcOver){this.onIconOut(a,
this.lastEcOver);delete this.lastEcOver}if(a.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(a);this.onIconOver(a,this.lastEcOver)}this.getNodeTarget(a)&&this.onNodeOver(a,this.getNode(a))}},trackExit:function(a){if(this.lastOverNode){this.lastOverNode.ui&&!a.within(this.lastOverNode.ui.getEl())&&this.onNodeOut(a,this.lastOverNode);delete this.lastOverNode;Ext.getBody().un("mouseover",this.trackExit,this);this.trackingDoc=false}},delegateClick:function(a){if(this.beforeEvent(a))if(a.getTarget("input[type=checkbox]",
1))this.onCheckboxClick(a,this.getNode(a));else if(a.getTarget(".x-tree-ec-icon",1))this.onIconClick(a,this.getNode(a));else this.getNodeTarget(a)&&this.onNodeClick(a,this.getNode(a));else this.checkContainerEvent(a,"click")},delegateDblClick:function(a){if(this.beforeEvent(a))this.getNodeTarget(a)&&this.onNodeDblClick(a,this.getNode(a));else this.checkContainerEvent(a,"dblclick")},delegateContextMenu:function(a){if(this.beforeEvent(a))this.getNodeTarget(a)&&this.onNodeContextMenu(a,this.getNode(a));
else this.checkContainerEvent(a,"contextmenu")},checkContainerEvent:function(a,b){if(this.disabled){a.stopEvent();return false}this.onContainerEvent(a,b)},onContainerEvent:function(a,b){this.tree.fireEvent("container"+b,this.tree,a)},onNodeClick:function(a,b){b.ui.onClick(a)},onNodeOver:function(a,b){this.lastOverNode=b;b.ui.onOver(a)},onNodeOut:function(a,b){b.ui.onOut(a)},onIconOver:function(a,b){b.ui.addClass("x-tree-ec-over")},onIconOut:function(a,b){b.ui.removeClass("x-tree-ec-over")},onIconClick:function(a,
b){b.ui.ecClick(a)},onCheckboxClick:function(a,b){b.ui.onCheckChange(a)},onNodeDblClick:function(a,b){b.ui.onDblClick(a)},onNodeContextMenu:function(a,b){b.ui.onContextMenu(a)},beforeEvent:function(a){var b=this.getNode(a);if(this.disabled||!b||!b.ui){a.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};
Ext.tree.DefaultSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,a);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a){this.select(a)},select:function(a,b){if(!Ext.fly(a.ui.wrap).isVisible()&&b)return b.call(this,a);var c=this.selNode;if(a==
c)a.ui.onSelectedChange(true);else if(this.fireEvent("beforeselect",this,a,c)!==false){c&&c.ui&&c.ui.onSelectedChange(false);this.selNode=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,a,c)}return a},unselect:function(a,b){this.selNode==a&&this.clearSelections(b)},clearSelections:function(a){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;a!==true&&this.fireEvent("selectionchange",this,null)}return b},getSelectedNode:function(){return this.selNode},isSelected:function(a){return this.selNode==
a},selectPrevious:function(a){if(!(a=a||this.selNode||this.lastSelNode))return null;var b=a.previousSibling;if(b)if(!b.isExpanded()||b.childNodes.length<1)return this.select(b,this.selectPrevious);else{for(a=b.lastChild;a&&a.isExpanded()&&Ext.fly(a.ui.wrap).isVisible()&&a.childNodes.length>0;)a=a.lastChild;return this.select(a,this.selectPrevious)}else if(a.parentNode&&(this.tree.rootVisible||!a.parentNode.isRoot))return this.select(a.parentNode,this.selectPrevious);return null},selectNext:function(a){if(!(a=
a||this.selNode||this.lastSelNode))return null;if(a.firstChild&&a.isExpanded()&&Ext.fly(a.ui.wrap).isVisible())return this.select(a.firstChild,this.selectNext);else if(a.nextSibling)return this.select(a.nextSibling,this.selectNext);else if(a.parentNode){var b=null;a.parentNode.bubble(function(){if(this.nextSibling){b=this.getOwnerTree().selModel.select(this.nextSibling,this.selectNext);return false}});return b}return null},onKeyDown:function(a){var b=this.selNode||this.lastSelNode;if(b)switch(a.getKey()){case a.DOWN:a.stopEvent();
this.selectNext();break;case a.UP:a.stopEvent();this.selectPrevious();break;case a.RIGHT:a.preventDefault();if(b.hasChildNodes())if(b.isExpanded())b.firstChild&&this.select(b.firstChild,a);else b.expand();break;case a.LEFT:a.preventDefault();if(b.hasChildNodes()&&b.isExpanded())b.collapse();else if(b.parentNode&&(this.tree.rootVisible||b.parentNode!=this.tree.getRootNode()))this.select(b.parentNode,a)}}});
Ext.tree.MultiSelectionModel=Ext.extend(Ext.util.Observable,{constructor:function(a){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,a);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)},init:function(a){this.tree=a;a.mon(a.getTreeEl(),"keydown",this.onKeyDown,this);a.on("click",this.onNodeClick,this)},onNodeClick:function(a,b){b.ctrlKey&&this.isSelected(a)?this.unselect(a):this.select(a,b,b.ctrlKey)},select:function(a,b,c){c!==true&&this.clearSelections(true);
if(this.isSelected(a))return this.lastSelNode=a;this.selNodes.push(a);this.lastSelNode=this.selMap[a.id]=a;a.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return a},unselect:function(a){if(this.selMap[a.id]){a.ui.onSelectedChange(false);var b=this.selNodes.indexOf(a);b!=-1&&this.selNodes.splice(b,1);delete this.selMap[a.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(a){var b=this.selNodes;if(b.length>0){for(var c=0,d=b.length;c<
d;c++)b[c].ui.onSelectedChange(false);this.selNodes=[];this.selMap={};a!==true&&this.fireEvent("selectionchange",this,this.selNodes)}},isSelected:function(a){return this.selMap[a.id]?true:false},getSelectedNodes:function(){return this.selNodes.concat([])},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});
Ext.data.Tree=Ext.extend(Ext.util.Observable,{constructor:function(a){this.nodeHash={};this.root=null;a&&this.setRootNode(a);this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)},pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(a){this.root=a;a.ownerTree=this;a.isRoot=true;this.registerNode(a);return a},
getNodeById:function(a){return this.nodeHash[a]},registerNode:function(a){this.nodeHash[a.id]=a},unregisterNode:function(a){delete this.nodeHash[a.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});
Ext.data.Node=Ext.extend(Ext.util.Observable,{constructor:function(a){this.attributes=a||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"xnode-");this.attributes.id=this.id}this.childNodes=[];this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;
Ext.data.Node.superclass.constructor.call(this)},fireEvent:function(){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false)return false;var a=this.getOwnerTree();if(a)if(a.proxyNodeEvent.apply(a,arguments)===false)return false;return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(a){this.firstChild=a},setLastChild:function(a){this.lastChild=a},isLast:function(){return!this.parentNode?true:this.parentNode.lastChild==this},isFirst:function(){return!this.parentNode?
true:this.parentNode.firstChild==this},hasChildNodes:function(){return!this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(a){var b=false;if(Ext.isArray(a))b=a;else if(arguments.length>1)b=arguments;if(b)for(var c=0,d=b.length;c<d;c++)this.appendChild(b[c]);else{if(this.fireEvent("beforeappend",this.ownerTree,this,a)===false)return false;b=this.childNodes.length;if(c=a.parentNode){if(a.fireEvent("beforemove",
a.getOwnerTree(),a,c,this,b)===false)return false;c.removeChild(a)}b=this.childNodes.length;b===0&&this.setFirstChild(a);this.childNodes.push(a);a.parentNode=this;if(d=this.childNodes[b-1]){a.previousSibling=d;d.nextSibling=a}else a.previousSibling=null;a.nextSibling=null;this.setLastChild(a);a.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,a,b);c&&a.fireEvent("move",this.ownerTree,a,c,this,b);return a}},removeChild:function(a,b){var c=this.childNodes.indexOf(a);if(c==
-1)return false;if(this.fireEvent("beforeremove",this.ownerTree,this,a)===false)return false;this.childNodes.splice(c,1);if(a.previousSibling)a.previousSibling.nextSibling=a.nextSibling;if(a.nextSibling)a.nextSibling.previousSibling=a.previousSibling;this.firstChild==a&&this.setFirstChild(a.nextSibling);this.lastChild==a&&this.setLastChild(a.previousSibling);this.fireEvent("remove",this.ownerTree,this,a);b?a.destroy(true):a.clear();return a},clear:function(a){this.setOwnerTree(null,a);this.parentNode=
this.previousSibling=this.nextSibling=null;if(a)this.firstChild=this.lastChild=null},destroy:function(a){if(a===true){this.purgeListeners();this.clear(true);Ext.each(this.childNodes,function(b){b.destroy(true)});this.childNodes=null}else this.remove(true)},insertBefore:function(a,b){if(!b)return this.appendChild(a);if(a==b)return false;if(this.fireEvent("beforeinsert",this.ownerTree,this,a,b)===false)return false;var c=this.childNodes.indexOf(b),d=a.parentNode,e=c;d==this&&this.childNodes.indexOf(a)<
c&&e--;if(d){if(a.fireEvent("beforemove",a.getOwnerTree(),a,d,this,c,b)===false)return false;d.removeChild(a)}e===0&&this.setFirstChild(a);this.childNodes.splice(e,0,a);a.parentNode=this;if(c=this.childNodes[e-1]){a.previousSibling=c;c.nextSibling=a}else a.previousSibling=null;a.nextSibling=b;b.previousSibling=a;a.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,a,b);d&&a.fireEvent("move",this.ownerTree,a,d,this,e,b);return a},remove:function(a){this.parentNode&&this.parentNode.removeChild(this,
a);return this},removeAll:function(a){for(var b=this.childNodes,c;c=b[0];)this.removeChild(c,a);return this},item:function(a){return this.childNodes[a]},replaceChild:function(a,b){var c=b?b.nextSibling:null;this.removeChild(b);this.insertBefore(a,c);return b},indexOf:function(a){return this.childNodes.indexOf(a)},getOwnerTree:function(){if(!this.ownerTree)for(var a=this;a;){if(a.ownerTree){this.ownerTree=a.ownerTree;break}a=a.parentNode}return this.ownerTree},getDepth:function(){for(var a=0,b=this;b.parentNode;){++a;
b=b.parentNode}return a},setOwnerTree:function(a,b){if(a!=this.ownerTree){this.ownerTree&&this.ownerTree.unregisterNode(this);this.ownerTree=a;b!==true&&Ext.each(this.childNodes,function(c){c.setOwnerTree(a)});a&&a.registerNode(this)}},setId:function(a){if(a!==this.id){var b=this.ownerTree;b&&b.unregisterNode(this);this.id=this.attributes.id=a;b&&b.registerNode(this);this.onIdChange(a)}},onIdChange:Ext.emptyFn,getPath:function(a){a=a||"id";for(var b=this.parentNode,c=[this.attributes[a]];b;){c.unshift(b.attributes[a]);
b=b.parentNode}a=this.getOwnerTree().pathSeparator;return a+c.join(a)},bubble:function(a,b,c){for(var d=this;d;){if(a.apply(b||d,c||[d])===false)break;d=d.parentNode}},cascade:function(a,b,c){if(a.apply(b||this,c||[this])!==false)for(var d=this.childNodes,e=0,g=d.length;e<g;e++)d[e].cascade(a,b,c)},eachChild:function(a,b,c){for(var d=this.childNodes,e=0,g=d.length;e<g;e++)if(a.apply(b||d[e],c||[d[e]])===false)break},findChild:function(a,b,c){return this.findChildBy(function(){return this.attributes[a]==
b},null,c)},findChildBy:function(a,b,c){for(var d=this.childNodes,e=d.length,g=0,h;g<e;g++){h=d[g];if(a.call(b||h,h)===true)return h;else if(c){h=h.findChildBy(a,b,c);if(h!=null)return h}}return null},sort:function(a,b){var c=this.childNodes,d=c.length;if(d>0){c.sort(b?function(){a.apply(b,arguments)}:a);for(var e=0;e<d;e++){var g=c[e];g.previousSibling=c[e-1];g.nextSibling=c[e+1];e===0&&this.setFirstChild(g);e==d-1&&this.setLastChild(g)}}},contains:function(a){return a.isAncestor(this)},isAncestor:function(a){for(var b=
this.parentNode;b;){if(b==a)return true;b=b.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});
Ext.tree.TreeNode=Ext.extend(Ext.data.Node,{constructor:function(a){a=a||{};if(Ext.isString(a))a={text:a};this.rendered=this.childrenRendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,a);this.expanded=a.expanded===true;this.isTarget=a.isTarget!==false;this.draggable=a.draggable!==false&&a.allowDrag!==false;this.allowChildren=a.allowChildren!==false&&a.allowDrop!==false;this.text=a.text;this.disabled=a.disabled===true;this.hidden=a.hidden===true;this.addEvents("textchange","beforeexpand",
"beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","beforedblclick","dblclick","contextmenu","beforechildrenrendered");this.ui=new (this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI)(this)},preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var a;return this.loader||((a=this.getOwnerTree())&&a.loader?a.loader:this.loader=new Ext.tree.TreeLoader)},setFirstChild:function(a){var b=
this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,a);this.childrenRendered&&b&&a!=b&&b.renderIndent(true,true);this.rendered&&this.renderIndent(true,true)},setLastChild:function(a){var b=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,a);this.childrenRendered&&b&&a!=b&&b.renderIndent(true,true);this.rendered&&this.renderIndent(true,true)},appendChild:function(a){if(!a.render&&!Ext.isArray(a))a=this.getLoader().createNode(a);(a=Ext.tree.TreeNode.superclass.appendChild.call(this,
a))&&this.childrenRendered&&a.render();this.ui.updateExpandIcon();return a},removeChild:function(a,b){this.ownerTree.getSelectionModel().unselect(a);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(!b){var c=a.ui.rendered;c&&a.ui.remove();c&&this.childNodes.length<1?this.collapse(false,false):this.ui.updateExpandIcon();if(!this.firstChild&&!this.isHiddenRoot())this.childrenRendered=false}return a},insertBefore:function(a,b){a.render||(a=this.getLoader().createNode(a));var c=Ext.tree.TreeNode.superclass.insertBefore.call(this,
a,b);c&&b&&this.childrenRendered&&a.render();this.ui.updateExpandIcon();return c},setText:function(a){var b=this.text;this.text=this.attributes.text=a;this.rendered&&this.ui.onTextChange(this,a,b);this.fireEvent("textchange",this,a,b)},setIconCls:function(a){var b=this.attributes.iconCls;this.attributes.iconCls=a;this.rendered&&this.ui.onIconClsChange(this,a,b)},setTooltip:function(a,b){this.attributes.qtip=a;this.attributes.qtipTitle=b;this.rendered&&this.ui.onTipChange(this,a,b)},setIcon:function(a){this.attributes.icon=
a;this.rendered&&this.ui.onIconChange(this,a)},setHref:function(a,b){this.attributes.href=a;this.attributes.hrefTarget=b;this.rendered&&this.ui.onHrefChange(this,a,b)},setCls:function(a){var b=this.attributes.cls;this.attributes.cls=a;this.rendered&&this.ui.onClsChange(this,a,b)},select:function(){var a=this.getOwnerTree();a&&a.getSelectionModel().select(this)},unselect:function(a){var b=this.getOwnerTree();b&&b.getSelectionModel().unselect(this,a)},isSelected:function(){var a=this.getOwnerTree();
return a?a.getSelectionModel().isSelected(this):false},expand:function(a,b,c,d){if(this.expanded)this.runCallback(c,d||this,[this]);else{if(this.fireEvent("beforeexpand",this,a,b)===false)return;this.childrenRendered||this.renderChildren();this.expanded=true;if(!this.isHiddenRoot()&&this.getOwnerTree().animate&&b!==false||b){this.ui.animExpand(function(){this.fireEvent("expand",this);this.runCallback(c,d||this,[this]);a===true&&this.expandChildNodes(true,true)}.createDelegate(this));return}else{this.ui.expand();
this.fireEvent("expand",this);this.runCallback(c,d||this,[this])}}a===true&&this.expandChildNodes(true)},runCallback:function(a,b,c){Ext.isFunction(a)&&a.apply(b,c)},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(a,b,c,d){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,a,b)===false)return;this.expanded=false;if(this.getOwnerTree().animate&&b!==false||b){this.ui.animCollapse(function(){this.fireEvent("collapse",this);
this.runCallback(c,d||this,[this]);a===true&&this.collapseChildNodes(true)}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this);this.runCallback(c,d||this,[this])}}else this.expanded||this.runCallback(c,d||this,[this]);if(a===true){b=this.childNodes;for(var e=0,g=b.length;e<g;e++)b[e].collapse(true,false)}},delayedExpand:function(a){if(!this.expandProcId)this.expandProcId=this.expand.defer(a,this)},cancelExpand:function(){this.expandProcId&&clearTimeout(this.expandProcId);
this.expandProcId=false},toggle:function(){this.expanded?this.collapse():this.expand()},ensureVisible:function(a,b){var c=this.getOwnerTree();c.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var d=c.getNodeById(this.id);c.getTreeEl().scrollChildIntoView(d.ui.anchor);this.runCallback(a,b||this,[this])}.createDelegate(this))},expandChildNodes:function(a,b){var c=this.childNodes,d,e=c.length;for(d=0;d<e;d++)c[d].expand(a,b)},collapseChildNodes:function(a){for(var b=
this.childNodes,c=0,d=b.length;c<d;c++)b[c].collapse(a)},disable:function(){this.disabled=true;this.unselect();this.rendered&&this.ui.onDisableChange&&this.ui.onDisableChange(this,true);this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;this.rendered&&this.ui.onDisableChange&&this.ui.onDisableChange(this,false);this.fireEvent("disabledchange",this,false)},renderChildren:function(a){a!==false&&this.fireEvent("beforechildrenrendered",this);a=this.childNodes;for(var b=
0,c=a.length;b<c;b++)a[b].render(true);this.childrenRendered=true},sort:function(){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered)for(var a=this.childNodes,b=0,c=a.length;b<c;b++)a[b].render(true)},render:function(a){this.ui.render(a);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(a,b){if(b)this.ui.childIndent=null;this.ui.renderIndent();if(a===true&&
this.childrenRendered)for(var c=this.childNodes,d=0,e=c.length;d<e;d++)c[d].renderIndent(true,b)},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){this.expanded&&this.rendered&&this.renderChildren()},destroy:function(a){a===true&&this.unselect(true);Ext.tree.TreeNode.superclass.destroy.call(this,a);Ext.destroy(this.ui,this.loader);this.ui=this.loader=null},onIdChange:function(a){this.ui.onIdChange(a)}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;
Ext.tree.AsyncTreeNode=function(a){this.loaded=a&&a.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};
Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(a,b,c,d){if(this.loading){var e,g=function(){if(!this.loading){clearInterval(e);this.expand(a,b,c,d)}}.createDelegate(this);e=setInterval(g,200)}else{if(!this.loaded){if(this.fireEvent("beforeload",this)===false)return;this.loading=true;this.ui.beforeLoad(this);if(g=this.loader||this.attributes.loader||this.getOwnerTree().getLoader()){g.load(this,this.loadComplete.createDelegate(this,[a,b,c,d]),this);return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,
a,b,c,d)}},isLoading:function(){return this.loading},loadComplete:function(a,b,c,d){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(a,b,c,d)},isLoaded:function(){return this.loaded},hasChildNodes:function(){return!this.isLeaf()&&!this.loaded?true:Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)},reload:function(a,b){for(this.collapse(false,false);this.firstChild;)this.removeChild(this.firstChild).destroy();this.loaded=this.childrenRendered=
false;if(this.isHiddenRoot())this.expanded=false;this.expand(false,false,a,b)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;
Ext.tree.TreeNodeUI=Ext.extend(Object,{constructor:function(a){Ext.apply(this,{node:a,rendered:false,animating:false,wasLeaf:true,ecc:"x-tree-ec-icon x-tree-elbow",emptyIcon:Ext.BLANK_IMAGE_URL})},removeChild:function(a){this.rendered&&this.ctNode.removeChild(a.ui.getEl())},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(a,b){if(this.rendered)this.textNode.innerHTML=b},onIconClsChange:function(a,b,c){this.rendered&&
Ext.fly(this.iconNode).replaceClass(c,b)},onIconChange:function(a,b){if(this.rendered){var c=Ext.isEmpty(b);this.iconNode.src=c?this.emptyIcon:b;Ext.fly(this.iconNode)[c?"removeClass":"addClass"]("x-tree-node-inline-icon")}},onTipChange:function(a,b,c){if(this.rendered){a=Ext.isDefined(c);if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",b);a&&this.textNode.setAttributeNS("ext","qtitle",c)}else{this.textNode.setAttribute("ext:qtip",b);a&&this.textNode.setAttribute("ext:qtitle",
c)}}},onHrefChange:function(a,b,c){if(this.rendered){this.anchor.href=this.getHref(b);if(Ext.isDefined(c))this.anchor.target=c}},onClsChange:function(a,b,c){this.rendered&&Ext.fly(this.elNode).replaceClass(c,b)},onDisableChange:function(a,b){this.disabled=b;if(this.checkbox)this.checkbox.disabled=b;this[b?"addClass":"removeClass"]("x-tree-node-disabled")},onSelectedChange:function(a){if(a){this.focus();this.addClass("x-tree-selected")}else this.removeClass("x-tree-selected")},onMove:function(a,b,
c,d,e,g){this.childIndent=null;if(this.rendered)if(a=d.ui.getContainer()){(g=g?g.ui.getEl():null)?a.insertBefore(this.wrap,g):a.appendChild(this.wrap);this.node.renderIndent(true,c!=d)}else{this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},addClass:function(a){this.elNode&&Ext.fly(this.elNode).addClass(a)},removeClass:function(a){this.elNode&&Ext.fly(this.elNode).removeClass(a)},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},
fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);this.node.disabled&&this.onDisableChange(this.node,true);this.node.hidden&&this.hide();var a=this.node.getOwnerTree();if((a.enableDD||a.enableDrag||a.enableDrop)&&(!this.node.isRoot||a.rootVisible))Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},
hide:function(){this.node.hidden=true;if(this.wrap)this.wrap.style.display="none"},show:function(){this.node.hidden=false;if(this.wrap)this.wrap.style.display=""},onContextMenu:function(a){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){a.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,a)}},onClick:function(a){if(this.dropping)a.stopEvent();else if(this.fireEvent("beforeclick",this.node,a)!==false){var b=a.getTarget("a");if(!this.disabled&&
this.node.attributes.href&&b)this.fireEvent("click",this.node,a);else{b&&a.ctrlKey&&a.stopEvent();a.preventDefault();if(!this.disabled){this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()&&this.node.toggle();this.fireEvent("click",this.node,a)}}}else a.stopEvent()},onDblClick:function(a){a.preventDefault();if(!this.disabled)if(this.fireEvent("beforedblclick",this.node,a)!==false){this.checkbox&&this.toggleCheck();!this.animating&&this.node.isExpandable()&&this.node.toggle();
this.fireEvent("dblclick",this.node,a)}},onOver:function(){this.addClass("x-tree-node-over")},onOut:function(){this.removeClass("x-tree-node-over")},onCheckChange:function(){var a=this.checkbox.checked;this.checkbox.defaultChecked=a;this.node.attributes.checked=a;this.fireEvent("checkchange",this.node,a)},ecClick:function(){!this.animating&&this.node.isExpandable()&&this.node.toggle()},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),
50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(this.node.preventHScroll)try{var a=this.node.getOwnerTree().getTreeEl().dom,b=a.scrollLeft;this.anchor.focus();a.scrollLeft=b}catch(c){}else try{this.anchor.focus()}catch(d){}},toggleCheck:function(a){var b=this.checkbox;if(b){b.checked=a===undefined?!b.checked:a;this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(a){}},animExpand:function(a){var b=Ext.get(this.ctNode);b.stopFx();if(this.node.isExpandable()){this.animating=
true;this.updateExpandIcon();b.slideIn("t",{callback:function(){this.animating=false;Ext.callback(a)},scope:this,duration:this.node.ownerTree.duration||0.25})}else{this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(a)}},highlight:function(){var a=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(a.hlColor||"C3DAF9",{endColor:a.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(a){var b=Ext.get(this.ctNode);b.enableDisplayMode("block");
b.stopFx();this.animating=true;this.updateExpandIcon();b.slideOut("t",{callback:function(){this.animating=false;Ext.callback(a)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(a){a.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(a){var b=this.node,c=b.attributes,d=b.parentNode?
b.parentNode.ui.getContainer():b.ownerTree.innerCt.dom;if(this.rendered)a===true&&d.appendChild(this.wrap);else{this.rendered=true;this.renderElements(b,c,d,a);if(c.qtip)this.onTipChange(b,c.qtip,c.qtipTitle);else if(c.qtipCfg){c.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(c.qtipCfg)}this.initEvents();this.node.expanded||this.updateExpandIcon(true)}},renderElements:function(a,b,c,d){this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";var e=Ext.isBoolean(b.checked),g,
h=this.getHref(b.href);b=['<li class="x-tree-node"><div ext:tree-node-id="',a.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',b.cls,'" unselectable="on"><span class="x-tree-node-indent">',this.indentMarkup,'</span><img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" /><img alt="" src="',b.icon||this.emptyIcon,'" class="x-tree-node-icon',b.icon?" x-tree-node-inline-icon":"",b.iconCls?" "+b.iconCls:"",'" unselectable="on" />',e?'<input class="x-tree-node-cb" type="checkbox" '+
(b.checked?'checked="checked" />':"/>"):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',h,'" tabIndex="1" ',b.hrefTarget?' target="'+b.hrefTarget+'"':"",'><span unselectable="on">',a.text,'</span></a></div><ul class="x-tree-node-ct" style="display:none;"></ul></li>'].join("");this.wrap=d!==true&&a.nextSibling&&(g=a.nextSibling.ui.getEl())?Ext.DomHelper.insertHtml("beforeBegin",g,b):Ext.DomHelper.insertHtml("beforeEnd",c,b);this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];
a=this.elNode.childNodes;this.indentNode=a[0];this.ecNode=a[1];this.iconNode=a[2];c=3;if(e){this.checkbox=a[3];this.checkbox.defaultChecked=this.checkbox.checked;c++}this.anchor=a[c];this.textNode=a[c].firstChild},getHref:function(a){return Ext.isEmpty(a)?Ext.isGecko?"":"#":a},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var a=
this.node,b,c=a.isLast()?"x-tree-elbow-end":"x-tree-elbow";if(a.hasChildNodes()||a.attributes.expandable){if(a.expanded){c+="-minus";a="x-tree-node-collapsed";b="x-tree-node-expanded"}else{c+="-plus";a="x-tree-node-expanded";b="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=a||this.c2!=b){Ext.fly(this.elNode).replaceClass(a,b);this.c1=a;this.c2=b}}else if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-collapsed");
delete this.c1;delete this.c2;this.wasLeaf=true}c="x-tree-ec-icon "+c;if(this.ecc!=c)this.ecc=this.ecNode.className=c}},onIdChange:function(a){this.rendered&&this.elNode.setAttribute("ext:tree-node-id",a)},getChildIndent:function(){if(!this.childIndent){for(var a=[],b=this.node;b;){if(!b.isRoot||b.isRoot&&b.ownerTree.rootVisible)b.isLast()?a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-icon" />'):a.unshift('<img alt="" src="'+this.emptyIcon+'" class="x-tree-elbow-line" />');b=b.parentNode}this.childIndent=
a.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var a="",b=this.node.parentNode;if(b)a=b.ui.getChildIndent();if(this.indentMarkup!=a)this.indentMarkup=this.indentNode.innerHTML=a;this.updateExpandIcon()}},destroy:function(){this.elNode&&Ext.dd.Registry.unregister(this.elNode.id);Ext.each(["textnode","anchor","checkbox","indentNode","ecNode","iconNode","elNode","ctNode","wrap","holder"],function(a){if(this[a]){Ext.fly(this[a]).remove();delete this[a]}},this);delete this.node}});
Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var a=this.node.ownerTree.innerCt.dom;this.node.expanded=true;a.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=a.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});
Ext.tree.TreeLoader=function(a){this.baseParams={};Ext.apply(this,a);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this);if(Ext.isString(this.paramOrder))this.paramOrder=this.paramOrder.split(/[\s,|]/)};
Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,paramOrder:undefined,paramsAsHash:false,nodeParameter:"node",directFn:undefined,load:function(a,b,c){if(this.clearOnLoad)for(;a.firstChild;)a.removeChild(a.firstChild);if(this.doPreload(a))this.runCallback(b,c||a,[a]);else if(this.directFn||this.dataUrl||this.url)this.requestData(a,b,c||a)},doPreload:function(a){if(a.attributes.children){if(a.childNodes.length<1){var b=a.attributes.children;a.beginUpdate();for(var c=
0,d=b.length;c<d;c++){var e=a.appendChild(this.createNode(b[c]));this.preloadChildren&&this.doPreload(e)}a.endUpdate()}return true}return false},getParams:function(a){var b=Ext.apply({},this.baseParams),c=this.nodeParameter,d=this.paramOrder;c&&(b[c]=a.id);if(this.directFn){a=[a.id];if(d){if(c&&d.indexOf(c)>-1)a=[];c=0;for(var e=d.length;c<e;c++)a.push(b[d[c]])}else if(this.paramsAsHash)a=[b];return a}else return b},requestData:function(a,b,c){if(this.fireEvent("beforeload",this,a,b)!==false)if(this.directFn){var d=
this.getParams(a);d.push(this.processDirectResponse.createDelegate(this,[{callback:b,node:a,scope:c}],true));this.directFn.apply(window,d)}else this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:b,node:a,scope:c},params:this.getParams(a)});else this.runCallback(b,c||a,[])},processDirectResponse:function(a,b,c){b.status?this.handleResponse({responseData:Ext.isArray(a)?a:null,responseText:a,
argument:c}):this.handleFailure({argument:c})},runCallback:function(a,b,c){Ext.isFunction(a)&&a.apply(b,c)},isLoading:function(){return!!this.transId},abort:function(){this.isLoading()&&Ext.Ajax.abort(this.transId)},createNode:function(a){this.baseAttrs&&Ext.applyIf(a,this.baseAttrs);if(this.applyLoader!==false&&!a.loader)a.loader=this;if(Ext.isString(a.uiProvider))a.uiProvider=this.uiProviders[a.uiProvider]||eval(a.uiProvider);return a.nodeType?new Ext.tree.TreePanel.nodeTypes[a.nodeType](a):a.leaf?
new Ext.tree.TreeNode(a):new Ext.tree.AsyncTreeNode(a)},processResponse:function(a,b,c,d){var e=a.responseText;try{var g=a.responseData||Ext.decode(e);b.beginUpdate();e=0;for(var h=g.length;e<h;e++){var i=this.createNode(g[e]);i&&b.appendChild(i)}b.endUpdate();this.runCallback(c,d||b,[b])}catch(j){this.handleFailure(a)}},handleResponse:function(a){this.transId=false;var b=a.argument;this.processResponse(a,b.node,b.callback,b.scope);this.fireEvent("load",this,b.node,a)},handleFailure:function(a){this.transId=
false;var b=a.argument;this.fireEvent("loadexception",this,b.node,a);this.runCallback(b.callback,b.scope||b.node,[b.node])},destroy:function(){this.abort();this.purgeListeners()}});Ext.tree.TreeFilter=function(a,b){this.tree=a;this.filtered={};Ext.apply(this,b)};
Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(a,b,c){b=b||"text";var d;if(typeof a=="string"){var e=a.length;if(e==0&&this.clearBlank){this.clear();return}a=a.toLowerCase();d=function(g){return g.attributes[b].substr(0,e).toLowerCase()==a}}else if(a.exec)d=function(g){return a.test(g.attributes[b])};else throw"Illegal filter type, must be string or regex";this.filterBy(d,null,c)},filterBy:function(a,b,c){c=c||this.tree.root;this.autoClear&&
this.clear();var d=this.filtered,e=this.reverse;c.cascade(function(i){if(i==c)return true;if(d[i.id])return false;if(!a.call(b||i,i)||e){d[i.id]=i;i.ui.hide();return false}return true});if(this.remove)for(var g in d)if(typeof g!="function"){var h=d[g];h&&h.parentNode&&h.parentNode.removeChild(h)}},clear:function(){var a=this.filtered,b;for(b in a)if(typeof b!="function"){var c=a[b];c&&c.ui.show()}this.filtered={}}};
Ext.tree.TreeSorter=Ext.extend(Object,{constructor:function(a,b){Ext.apply(this,b);a.on({scope:this,beforechildrenrendered:this.doSort,append:this.updateSort,insert:this.updateSort,textchange:this.updateSortParent});var c=this.dir&&this.dir.toLowerCase()=="desc",d=this.property||"text",e=this.sortType,g=this.folderSort,h=this.caseSensitive===true,i=this.leafAttr||"leaf";if(Ext.isString(e))e=Ext.data.SortTypes[e];this.sortFn=function(j,k){var m=j.attributes,p=k.attributes;if(g){if(m[i]&&!p[i])return 1;
if(!m[i]&&p[i])return-1}m=m[d];p=p[d];m=e?e(m,j):h?m:m.toUpperCase();p=e?e(p,k):h?p:p.toUpperCase();if(m<p)return c?1:-1;else if(m>p)return c?-1:1;return 0}},doSort:function(a){a.sort(this.sortFn)},updateSort:function(a,b){b.childrenRendered&&this.doSort.defer(1,this,[b])},updateSortParent:function(a){(a=a.parentNode)&&a.childrenRendered&&this.doSort.defer(1,this,[a])}});
if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(a,b){this.allowParentInsert=b.allowParentInsert||false;this.allowContainerDrop=b.allowContainerDrop||false;this.appendOnly=b.appendOnly||false;Ext.tree.TreeDropZone.superclass.constructor.call(this,a.getTreeEl(),b);this.tree=a;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1E3,expandNode:function(a){a.hasChildNodes()&&!a.isExpanded()&&a.expand(false,null,
this.triggerCacheRefresh.createDelegate(this))},queueExpand:function(a){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[a])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(a,b,c,d,e){if(!a||!e)return false;var g=a.node,h=e.node;if(!(g&&g.isTarget&&b))return false;if(b=="append"&&g.allowChildren===false)return false;if((b=="above"||b=="below")&&g.parentNode&&g.parentNode.allowChildren===false)return false;
if(h&&(g==h||h.contains(g)))return false;a=this.dragOverData;a.tree=this.tree;a.target=g;a.data=e;a.point=b;a.source=c;a.rawEvent=d;a.dropNode=h;a.cancel=false;b=this.tree.fireEvent("nodedragover",a);return a.cancel===false&&b!==false},getDropPoint:function(a,b){var c=b.node;if(c.isRoot)return c.allowChildren!==false?"append":false;var d=b.ddel,e=Ext.lib.Dom.getY(d);d=e+d.offsetHeight;var g=Ext.lib.Event.getPageY(a),h=c.allowChildren===false||c.isLeaf();if(this.appendOnly||c.parentNode.allowChildren===
false)return h?false:"append";var i=false;this.allowParentInsert||(i=c.hasChildNodes()&&c.isExpanded());c=(d-e)/(h?2:3);return g>=e&&g<e+c?"above":!i&&(h||g>=d-c&&g<=d)?"below":"append"},onNodeEnter:function(){this.cancelExpand()},onContainerOver:function(a,b,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,node:this.tree.getRootNode()},"append",a,b,c))return this.dropAllowed;return this.dropNotAllowed},onNodeOver:function(a,b,c,d){var e=this.getDropPoint(c,
a,b),g=a.node;if(!this.expandProcId&&e=="append"&&g.hasChildNodes()&&!a.node.isExpanded())this.queueExpand(g);else e!="append"&&this.cancelExpand();g=this.dropNotAllowed;if(this.isValidDropPoint(a,e,b,c,d))if(e){b=a.ddel;if(e=="above"){g=a.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";a="x-tree-drag-insert-above"}else if(e=="below"){g=a.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";a="x-tree-drag-insert-below"}else{g="x-tree-drop-ok-append";a="x-tree-drag-append"}if(this.lastInsertClass!=
a){Ext.fly(b).replaceClass(this.lastInsertClass,a);this.lastInsertClass=a}}return g},onNodeOut:function(a){this.cancelExpand();this.removeDropIndicators(a)},onNodeDrop:function(a,b,c,d){var e=this.getDropPoint(c,a,b),g=a.node;g.ui.startDrop();if(!this.isValidDropPoint(a,e,b,c,d)){g.ui.endDrop();return false}a=d.node||(b.getTreeNode?b.getTreeNode(d,g,e,c):null);return this.processDrop(g,d,e,b,c,a)},onContainerDrop:function(a,b,c){if(this.allowContainerDrop&&this.isValidDropPoint({ddel:this.tree.getRootNode().ui.elNode,
node:this.tree.getRootNode()},"append",a,b,c)){var d=this.tree.getRootNode();d.ui.startDrop();var e=c.node||(a.getTreeNode?a.getTreeNode(c,d,"append",b):null);return this.processDrop(d,c,"append",a,b,e)}return false},processDrop:function(a,b,c,d,e,g){var h={tree:this.tree,target:a,data:b,point:c,source:d,rawEvent:e,dropNode:g,cancel:!g,dropStatus:false};if(this.tree.fireEvent("beforenodedrop",h)===false||h.cancel===true||!h.dropNode){a.ui.endDrop();return h.dropStatus}a=h.target;c=="append"&&!a.isExpanded()?
a.expand(false,null,function(){this.completeDrop(h)}.createDelegate(this)):this.completeDrop(h);return true},completeDrop:function(a){var b=a.dropNode,c=a.point,d=a.target;Ext.isArray(b)||(b=[b]);for(var e,g=0,h=b.length;g<h;g++){e=b[g];if(c=="above")d.parentNode.insertBefore(e,d);else c=="below"?d.parentNode.insertBefore(e,d.nextSibling):d.appendChild(e)}e.ui.focus();Ext.enableFx&&this.tree.hlDrop&&e.ui.highlight();d.ui.endDrop();this.tree.fireEvent("nodedrop",a)},afterNodeMoved:function(a,b,c,d,
e){if(Ext.enableFx&&this.tree.hlDrop){e.ui.focus();e.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,d,b,a,c)},getTree:function(){return this.tree},removeDropIndicators:function(a){if(a&&a.ddel){Ext.fly(a.ddel).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(){this.cancelExpand();return true},afterRepair:function(a){a&&Ext.enableFx&&a.node.ui.highlight();this.hideProxy()}})}
if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(a,b){Ext.tree.TreeDragZone.superclass.constructor.call(this,a.innerCt,b);this.tree=a};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(a){return(a=a.node)&&a.draggable&&!a.disabled},onInitDrag:function(a){var b=this.dragData;this.tree.getSelectionModel().select(b.node);this.tree.eventModel.disable();this.proxy.update("");b.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,
b.node,a)},getRepairXY:function(a,b){return b.node.ui.getDDRepairXY()},onEndDrag:function(a,b){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,a.node,b)},onValidDrop:function(a,b){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,a,b);this.hideProxy()},beforeInvalidDrop:function(){var a=this.tree.getSelectionModel();a.clearSelections();a.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop)Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||
"c3daf9");this.dragging=false}})}Ext.tree.TreeEditor=function(a,b,c){b=b||{};b=b.events?b:new Ext.form.TextField(b);Ext.tree.TreeEditor.superclass.constructor.call(this,b,c);this.tree=a;a.rendered?this.initEditor(a):a.on("render",this.initEditor,this)};
Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(a){a.on({scope:this,beforeclick:this.beforeNodeClick,dblclick:this.onNodeDblClick});this.on({scope:this,complete:this.updateNode,beforestartedit:this.fitToTree,specialkey:this.onSpecialKey});this.on("startedit",this.bindScroll,this,{delay:10})},fitToTree:function(a,b){var c=this.tree.getTreeEl().dom,d=b.dom;
if(c.scrollLeft>d.offsetLeft)c.scrollLeft=d.offsetLeft;this.setSize(Math.min(this.maxWidth,(c.clientWidth>20?c.clientWidth:c.offsetWidth)-Math.max(0,d.offsetLeft-c.scrollLeft)-5),"")},triggerEdit:function(a){this.completeEdit();if(a.attributes.editable!==false){this.editNode=a;this.tree.autoScroll&&Ext.fly(a.ui.getEl()).scrollIntoView(this.tree.body);var b=a.text||"";!Ext.isGecko&&Ext.isEmpty(a.text)&&a.setText("&#160;");this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[a.ui.textNode,b]);
return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(a,b){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(a)){b.stopEvent();return this.triggerEdit(a)}},onNodeDblClick:function(){clearTimeout(this.autoEditTimer)},updateNode:function(a,b){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(b)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);this.editNode&&this.editNode.ui.focus.defer(50,
this.editNode.ui)},onSpecialKey:function(a,b){var c=b.getKey();if(c==b.ESC){b.stopEvent();this.cancelEdit()}else if(c==b.ENTER&&!b.hasModifier()){b.stopEvent();this.completeEdit()}},onDestroy:function(){clearTimeout(this.autoEditTimer);Ext.tree.TreeEditor.superclass.onDestroy.call(this);var a=this.tree;a.un("beforeclick",this.beforeNodeClick,this);a.un("dblclick",this.onNodeDblClick,this)}});
var swfobject=function(){function a(){if(!Q){try{var w=A.getElementsByTagName("body")[0].appendChild(A.createElement("span"));w.parentNode.removeChild(w)}catch(y){return}Q=true;w=E.length;for(var C=0;C<w;C++)E[C]()}}function b(w){if(Q)w();else E[E.length]=w}function c(w){if(typeof x.addEventListener!=t)x.addEventListener("load",w,false);else if(typeof A.addEventListener!=t)A.addEventListener("load",w,false);else if(typeof x.attachEvent!=t)s(x,"onload",w);else if(typeof x.onload=="function"){var y=
x.onload;x.onload=function(){y();w()}}else x.onload=w}function d(){var w=A.getElementsByTagName("body")[0],y=A.createElement(u);y.setAttribute("type",v);var C=w.appendChild(y);if(C){var G=0;(function(){if(typeof C.GetVariable!=t){var H=C.GetVariable("$version");if(H){H=H.split(" ")[1].split(",");I.pv=[parseInt(H[0],10),parseInt(H[1],10),parseInt(H[2],10)]}}else if(G<10){G++;setTimeout(arguments.callee,10);return}w.removeChild(y);C=null;e()})()}else e()}function e(){var w=D.length;if(w>0)for(var y=
0;y<w;y++){var C=D[y].id,G=D[y].callbackFn,H={success:false,id:C};if(I.pv[0]>0){var O=o(C);if(O)if(l(D[y].swfVersion)&&!(I.wk&&I.wk<312)){r(C,true);if(G){H.success=true;H.ref=g(C);G(H)}}else if(D[y].expressInstall&&h()){H={};H.data=D[y].expressInstall;H.width=O.getAttribute("width")||"0";H.height=O.getAttribute("height")||"0";if(O.getAttribute("class"))H.styleclass=O.getAttribute("class");if(O.getAttribute("align"))H.align=O.getAttribute("align");var M={};O=O.getElementsByTagName("param");for(var R=
O.length,S=0;S<R;S++)if(O[S].getAttribute("name").toLowerCase()!="movie")M[O[S].getAttribute("name")]=O[S].getAttribute("value");i(H,M,C,G)}else{j(O);G&&G(H)}}else{r(C,true);if(G){if((C=g(C))&&typeof C.SetVariable!=t){H.success=true;H.ref=C}G(H)}}}}function g(w){var y=null;if((w=o(w))&&w.nodeName=="OBJECT")if(typeof w.SetVariable!=t)y=w;else if(w=w.getElementsByTagName(u)[0])y=w;return y}function h(){return!W&&l("6.0.65")&&(I.win||I.mac)&&!(I.wk&&I.wk<312)}function i(w,y,C,G){W=true;P=G||null;T={success:false,
id:C};var H=o(C);if(H){if(H.nodeName=="OBJECT"){J=k(H);L=null}else{J=H;L=C}w.id=z;if(typeof w.width==t||!/%$/.test(w.width)&&parseInt(w.width,10)<310)w.width="310";if(typeof w.height==t||!/%$/.test(w.height)&&parseInt(w.height,10)<137)w.height="137";A.title=A.title.slice(0,47)+" - Flash Player Installation";G=I.ie&&I.win?"ActiveX":"PlugIn";G="MMredirectURL="+x.location.toString().replace(/&/g,"%26")+"&MMplayerType="+G+"&MMdoctitle="+A.title;if(typeof y.flashvars!=t)y.flashvars+="&"+G;else y.flashvars=
G;if(I.ie&&I.win&&H.readyState!=4){G=A.createElement("div");C+="SWFObjectNew";G.setAttribute("id",C);H.parentNode.insertBefore(G,H);H.style.display="none";(function(){H.readyState==4?H.parentNode.removeChild(H):setTimeout(arguments.callee,10)})()}m(w,y,C)}}function j(w){if(I.ie&&I.win&&w.readyState!=4){var y=A.createElement("div");w.parentNode.insertBefore(y,w);y.parentNode.replaceChild(k(w),y);w.style.display="none";(function(){w.readyState==4?w.parentNode.removeChild(w):setTimeout(arguments.callee,
10)})()}else w.parentNode.replaceChild(k(w),w)}function k(w){var y=A.createElement("div");if(I.win&&I.ie)y.innerHTML=w.innerHTML;else if(w=w.getElementsByTagName(u)[0])if(w=w.childNodes)for(var C=w.length,G=0;G<C;G++)!(w[G].nodeType==1&&w[G].nodeName=="PARAM")&&w[G].nodeType!=8&&y.appendChild(w[G].cloneNode(true));return y}function m(w,y,C){var G,H=o(C);if(I.wk&&I.wk<312)return G;if(H){if(typeof w.id==t)w.id=C;if(I.ie&&I.win){var O="",M;for(M in w)if(w[M]!=Object.prototype[M])if(M.toLowerCase()==
"data")y.movie=w[M];else if(M.toLowerCase()=="styleclass")O+=' class="'+w[M]+'"';else if(M.toLowerCase()!="classid")O+=" "+M+'="'+w[M]+'"';M="";for(var R in y)if(y[R]!=Object.prototype[R])M+='<param name="'+R+'" value="'+y[R]+'" />';H.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+O+">"+M+"</object>";F[F.length]=w.id;G=o(w.id)}else{R=A.createElement(u);R.setAttribute("type",v);for(var S in w)if(w[S]!=Object.prototype[S])if(S.toLowerCase()=="styleclass")R.setAttribute("class",
w[S]);else S.toLowerCase()!="classid"&&R.setAttribute(S,w[S]);for(O in y)if(y[O]!=Object.prototype[O]&&O.toLowerCase()!="movie"){w=R;M=O;S=y[O];C=A.createElement("param");C.setAttribute("name",M);C.setAttribute("value",S);w.appendChild(C)}H.parentNode.replaceChild(R,H);G=R}}return G}function p(w){var y=o(w);if(y&&y.nodeName=="OBJECT")if(I.ie&&I.win){y.style.display="none";(function(){if(y.readyState==4){var C=o(w);if(C){for(var G in C)if(typeof C[G]=="function")C[G]=null;C.parentNode.removeChild(C)}}else setTimeout(arguments.callee,
10)})()}else y.parentNode.removeChild(y)}function o(w){var y=null;try{y=A.getElementById(w)}catch(C){}return y}function s(w,y,C){w.attachEvent(y,C);K[K.length]=[w,y,C]}function l(w){var y=I.pv;w=w.split(".");w[0]=parseInt(w[0],10);w[1]=parseInt(w[1],10)||0;w[2]=parseInt(w[2],10)||0;return y[0]>w[0]||y[0]==w[0]&&y[1]>w[1]||y[0]==w[0]&&y[1]==w[1]&&y[2]>=w[2]?true:false}function n(w,y,C,G){if(!(I.ie&&I.mac)){var H=A.getElementsByTagName("head")[0];if(H){C=C&&typeof C=="string"?C:"screen";if(G)ba=U=null;
if(!U||ba!=C){G=A.createElement("style");G.setAttribute("type","text/css");G.setAttribute("media",C);U=H.appendChild(G);if(I.ie&&I.win&&typeof A.styleSheets!=t&&A.styleSheets.length>0)U=A.styleSheets[A.styleSheets.length-1];ba=C}if(I.ie&&I.win)U&&typeof U.addRule==u&&U.addRule(w,y);else U&&typeof A.createTextNode!=t&&U.appendChild(A.createTextNode(w+" {"+y+"}"))}}}function r(w,y){if(ca){var C=y?"visible":"hidden";if(Q&&o(w))o(w).style.visibility=C;else n("#"+w,"visibility:"+C)}}function q(w){return/[\\\"<>\.;]/.exec(w)!=
null&&typeof encodeURIComponent!=t?encodeURIComponent(w):w}var t="undefined",u="object",v="application/x-shockwave-flash",z="SWFObjectExprInst",x=window,A=document,N=navigator,B=false,E=[function(){B?d():e()}],D=[],F=[],K=[],J,L,P,T,Q=false,W=false,U,ba,ca=true,I=function(){var w=typeof A.getElementById!=t&&typeof A.getElementsByTagName!=t&&typeof A.createElement!=t,y=N.userAgent.toLowerCase(),C=N.platform.toLowerCase(),G=C?/win/.test(C):/win/.test(y);C=C?/mac/.test(C):/mac/.test(y);y=/webkit/.test(y)?
parseFloat(y.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var H=!+"\u000b1",O=[0,0,0],M=null;if(typeof N.plugins!=t&&typeof N.plugins["Shockwave Flash"]==u){if((M=N.plugins["Shockwave Flash"].description)&&!(typeof N.mimeTypes!=t&&N.mimeTypes[v]&&!N.mimeTypes[v].enabledPlugin)){B=true;H=false;M=M.replace(/^.*\s+(\S+\s+\S+$)/,"$1");O[0]=parseInt(M.replace(/^(.*)\..*$/,"$1"),10);O[1]=parseInt(M.replace(/^.*\.(.*)\s.*$/,"$1"),10);O[2]=/[a-zA-Z]/.test(M)?parseInt(M.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),
10):0}}else if(typeof x.ActiveXObject!=t)try{var R=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(R)if(M=R.GetVariable("$version")){H=true;M=M.split(" ")[1].split(",");O=[parseInt(M[0],10),parseInt(M[1],10),parseInt(M[2],10)]}}catch(S){}return{w3:w,pv:O,wk:y,ie:H,win:G,mac:C}}();(function(){if(I.w3){if(typeof A.readyState!=t&&A.readyState=="complete"||typeof A.readyState==t&&(A.getElementsByTagName("body")[0]||A.body))a();if(!Q){typeof A.addEventListener!=t&&A.addEventListener("DOMContentLoaded",
a,false);if(I.ie&&I.win){A.attachEvent("onreadystatechange",function(){if(A.readyState=="complete"){A.detachEvent("onreadystatechange",arguments.callee);a()}});x==top&&function(){if(!Q){try{A.documentElement.doScroll("left")}catch(w){setTimeout(arguments.callee,0);return}a()}}()}I.wk&&function(){Q||(/loaded|complete/.test(A.readyState)?a():setTimeout(arguments.callee,0))}();c(a)}}})();(function(){I.ie&&I.win&&window.attachEvent("onunload",function(){for(var w=K.length,y=0;y<w;y++)K[y][0].detachEvent(K[y][1],
K[y][2]);w=F.length;for(y=0;y<w;y++)p(F[y]);for(var C in I)I[C]=null;I=null;for(var G in swfobject)swfobject[G]=null;swfobject=null;window.detachEvent("onunload",arguments.callee)})})();return{registerObject:function(w,y,C,G){if(I.w3&&w&&y){var H={};H.id=w;H.swfVersion=y;H.expressInstall=C;H.callbackFn=G;D[D.length]=H;r(w,false)}else G&&G({success:false,id:w})},getObjectById:function(w){if(I.w3)return g(w)},embedSWF:function(w,y,C,G,H,O,M,R,S,Y){var Z={success:false,id:y};if(I.w3&&!(I.wk&&I.wk<312)&&
w&&y&&C&&G&&H){r(y,false);b(function(){C+="";G+="";var X={};if(S&&typeof S===u)for(var V in S)X[V]=S[V];X.data=w;X.width=C;X.height=G;V={};if(R&&typeof R===u)for(var $ in R)V[$]=R[$];if(M&&typeof M===u)for(var aa in M)if(typeof V.flashvars!=t)V.flashvars+="&"+aa+"="+M[aa];else V.flashvars=aa+"="+M[aa];if(l(H)){$=m(X,V,y);X.id==y&&r(y,true);Z.success=true;Z.ref=$}else if(O&&h()){X.data=O;i(X,V,y,Y);return}else r(y,true);Y&&Y(Z)})}else Y&&Y(Z)},switchOffAutoHideShow:function(){ca=false},ua:I,getFlashPlayerVersion:function(){return{major:I.pv[0],
minor:I.pv[1],release:I.pv[2]}},hasFlashPlayerVersion:l,createSWF:function(w,y,C){if(I.w3)return m(w,y,C)},showExpressInstall:function(w,y,C,G){I.w3&&h()&&i(w,y,C,G)},removeSWF:function(w){I.w3&&p(w)},createCSS:function(w,y,C,G){I.w3&&n(w,y,C,G)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(w){var y=A.location.search||A.location.hash;if(y){if(/\?/.test(y))y=y.split("?")[1];if(w==null)return q(y);y=y.split("&");for(var C=0;C<y.length;C++)if(y[C].substring(0,y[C].indexOf("="))==w)return q(y[C].substring(y[C].indexOf("=")+
1))}return""},expressInstallCallback:function(){if(W){var w=o(z);if(w&&J){w.parentNode.replaceChild(J,w);if(L){r(L,true);if(I.ie&&I.win)J.style.display="block"}P&&P(T)}W=false}}}}();
Ext.FlashComponent=Ext.extend(Ext.BoxComponent,{flashVersion:"9.0.115",backgroundColor:"#ffffff",wmode:"opaque",flashVars:undefined,flashParams:undefined,url:undefined,swfId:undefined,swfWidth:"100%",swfHeight:"100%",expressInstall:false,initComponent:function(){this.flashId=++Ext.FlashComponent.ID_COUNTER;Ext.FlashComponent._instances[this.flashId]=this;Ext.FlashComponent.superclass.initComponent.call(this);this.addEvents("initialize")},onRender:function(){Ext.FlashComponent.superclass.onRender.apply(this,
arguments);var a=Ext.apply({allowScriptAccess:"always",bgcolor:this.backgroundColor,wmode:this.wmode},this.flashParams),b=Ext.apply({allowedDomain:document.location.hostname,YUISwfId:"yuiswf"+this.flashId,YUIBridgeCallback:"YAHOO.widget.SWF.eventHandler"},this.flashVars);new swfobject.embedSWF(this.url,this.id,this.swfWidth,this.swfHeight,this.flashVersion,this.expressInstall?Ext.FlashComponent.EXPRESS_INSTALL_URL:undefined,b,a);this.swf=Ext.getDom(this.id);this.el=Ext.get(this.swf)},getSwfId:function(){return this.swfId||
(this.swfId="extswf"+ ++Ext.Component.AUTO_ID)},getId:function(){return this.id||(this.id="extflashcmp"+ ++Ext.Component.AUTO_ID)},onFlashEvent:function(a){switch(a.type){case "swfReady":this.initSwf();return;case "log":return}a.component=this;this.fireEvent(a.type.toLowerCase().replace(/event$/,""),a)},initSwf:function(){this.onSwfReady(!!this.isInitialized);this.isInitialized=true;this.fireEvent("initialize",this)},beforeDestroy:function(){this.rendered&&swfobject.removeSWF(this.swf.id);delete Ext.FlashComponent._instances[this.flashId];
Ext.FlashComponent.superclass.beforeDestroy.call(this)},onSwfReady:Ext.emptyFn});Ext.FlashComponent.EXPRESS_INSTALL_URL="http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf";Ext.FlashComponent._instances={};Ext.FlashComponent.ID_COUNTER=0;Ext.reg("flash",Ext.FlashComponent);Ext.FlashEventProxy={onEvent:function(a,b){var c=a.replace("yuiswf","");(c=Ext.FlashComponent._instances[c])?c.onFlashEvent(b):arguments.callee.defer(100,this,[a,b])}};
(function(){var a=Ext.ns("YAHOO.widget.SWF"),b=a.eventHandler,c=Ext.FlashEventProxy;a.eventHandler=b?function(d,e){b.apply(a,arguments);c.onEvent(d,e)}:c.onEvent})();
Ext.chart.Chart=Ext.extend(Ext.FlashComponent,{refreshBuffer:100,chartStyle:{padding:10,animationEnabled:true,font:{name:"Tahoma",color:4473924,size:11},dataTip:{padding:5,border:{color:10075112,size:1},background:{color:14346230,alpha:0.9},font:{name:"Tahoma",color:1393291,size:10,bold:true}}},extraStyle:null,seriesStyles:null,disableCaching:Ext.isIE||Ext.isOpera,disableCacheParam:"_dc",initComponent:function(){Ext.chart.Chart.superclass.initComponent.call(this);if(!this.url)this.url=Ext.chart.Chart.CHART_URL;
if(this.disableCaching)this.url=Ext.urlAppend(this.url,String.format("{0}={1}",this.disableCacheParam,(new Date).getTime()));this.addEvents("itemmouseover","itemmouseout","itemclick","itemdoubleclick","itemdragstart","itemdrag","itemdragend","beforerefresh","refresh");this.store=Ext.StoreMgr.lookup(this.store)},setStyle:function(a,b){this.swf.setStyle(a,Ext.encode(b))},setStyles:function(a){this.swf.setStyles(Ext.encode(a))},setSeriesStyles:function(a){this.seriesStyles=a;var b=[];Ext.each(a,function(c){b.push(Ext.encode(c))});
this.swf.setSeriesStyles(b)},setCategoryNames:function(a){this.swf.setCategoryNames(a)},setLegendRenderer:function(a,b){b=b||this;this.removeFnProxy(this.legendFnName);this.legendFnName=this.createFnProxy(function(c){return a.call(b,c)});this.swf.setLegendLabelFunction(this.legendFnName)},setTipRenderer:function(a,b){var c=this;b=b||c;c.removeFnProxy(c.tipFnName);c.tipFnName=c.createFnProxy(function(d,e,g){d=c.store.getAt(e);return a.call(b,c,d,e,g)});c.swf.setDataTipFunction(c.tipFnName)},setSeries:function(a){this.series=
a;this.refresh()},bindStore:function(a,b){if(!b&&this.store)if(a!==this.store&&this.store.autoDestroy)this.store.destroy();else{this.store.un("datachanged",this.refresh,this);this.store.un("add",this.delayRefresh,this);this.store.un("remove",this.delayRefresh,this);this.store.un("update",this.delayRefresh,this);this.store.un("clear",this.refresh,this)}if(a){a=Ext.StoreMgr.lookup(a);a.on({scope:this,datachanged:this.refresh,add:this.delayRefresh,remove:this.delayRefresh,update:this.delayRefresh,clear:this.refresh})}(this.store=
a)&&!b&&this.refresh()},onSwfReady:function(a){Ext.chart.Chart.superclass.onSwfReady.call(this,a);var b;this.swf.setType(this.type);this.chartStyle&&this.setStyles(Ext.apply({},this.extraStyle,this.chartStyle));this.categoryNames&&this.setCategoryNames(this.categoryNames);if(this.tipRenderer){b=this.getFunctionRef(this.tipRenderer);this.setTipRenderer(b.fn,b.scope)}if(this.legendRenderer){b=this.getFunctionRef(this.legendRenderer);this.setLegendRenderer(b.fn,b.scope)}a||this.bindStore(this.store,
true);this.refresh.defer(10,this)},delayRefresh:function(){if(!this.refreshTask)this.refreshTask=new Ext.util.DelayedTask(this.refresh,this);this.refreshTask.delay(this.refreshBuffer)},refresh:function(){if(this.fireEvent("beforerefresh",this)!==false){for(var a=[],b=this.store.data.items,c=0,d=b.length;c<d;c++)a[c]=b[c].data;b=[];c=0;d=null;var e=0;if(this.series){c=this.series.length;for(e=0;e<c;e++){d=this.series[e];var g={},h;for(h in d)if(h=="style"&&d.style!==null)g.style=Ext.encode(d.style);
else g[h]=d[h];b.push(g)}}if(c>0)for(e=0;e<c;e++){d=b[e];if(!d.type)d.type=this.type;d.dataProvider=a}else b.push({type:this.type,dataProvider:a});this.swf.setDataProvider(b);this.seriesStyles&&this.setSeriesStyles(this.seriesStyles);this.fireEvent("refresh",this)}},createFnProxy:function(a){var b="extFnProxy"+ ++Ext.chart.Chart.PROXY_FN_ID;Ext.chart.Chart.proxyFunction[b]=a;return"Ext.chart.Chart.proxyFunction."+b},removeFnProxy:function(a){if(!Ext.isEmpty(a)){a=a.replace("Ext.chart.Chart.proxyFunction.",
"");delete Ext.chart.Chart.proxyFunction[a]}},getFunctionRef:function(a){return Ext.isFunction(a)?{fn:a,scope:this}:{fn:a.fn,scope:a.scope||this}},onDestroy:function(){this.refreshTask&&this.refreshTask.cancel&&this.refreshTask.cancel();Ext.chart.Chart.superclass.onDestroy.call(this);this.bindStore(null);this.removeFnProxy(this.tipFnName);this.removeFnProxy(this.legendFnName)}});Ext.reg("chart",Ext.chart.Chart);Ext.chart.Chart.PROXY_FN_ID=0;Ext.chart.Chart.proxyFunction={};
Ext.chart.Chart.CHART_URL="http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf";Ext.chart.PieChart=Ext.extend(Ext.chart.Chart,{type:"pie",onSwfReady:function(a){Ext.chart.PieChart.superclass.onSwfReady.call(this,a);this.setDataField(this.dataField);this.setCategoryField(this.categoryField)},setDataField:function(a){this.dataField=a;this.swf.setDataField(a)},setCategoryField:function(a){this.categoryField=a;this.swf.setCategoryField(a)}});Ext.reg("piechart",Ext.chart.PieChart);
Ext.chart.CartesianChart=Ext.extend(Ext.chart.Chart,{onSwfReady:function(a){Ext.chart.CartesianChart.superclass.onSwfReady.call(this,a);this.labelFn=[];this.xField&&this.setXField(this.xField);this.yField&&this.setYField(this.yField);this.xAxis&&this.setXAxis(this.xAxis);this.xAxes&&this.setXAxes(this.xAxes);this.yAxis&&this.setYAxis(this.yAxis);this.yAxes&&this.setYAxes(this.yAxes);Ext.isDefined(this.constrainViewport)&&this.swf.setConstrainViewport(this.constrainViewport)},setXField:function(a){this.xField=
a;this.swf.setHorizontalField(a)},setYField:function(a){this.yField=a;this.swf.setVerticalField(a)},setXAxis:function(a){this.xAxis=this.createAxis("xAxis",a);this.swf.setHorizontalAxis(this.xAxis)},setXAxes:function(a){for(var b,c=0;c<a.length;c++){b=this.createAxis("xAxis"+c,a[c]);this.swf.setHorizontalAxis(b)}},setYAxis:function(a){this.yAxis=this.createAxis("yAxis",a);this.swf.setVerticalAxis(this.yAxis)},setYAxes:function(a){for(var b,c=0;c<a.length;c++){b=this.createAxis("yAxis"+c,a[c]);this.swf.setVerticalAxis(b)}},
createAxis:function(a,b){var c=Ext.apply({},b),d,e;if(this[a]){e=this[a].labelFunction;this.removeFnProxy(e);this.labelFn.remove(e)}if(c.labelRenderer){d=this.getFunctionRef(c.labelRenderer);c.labelFunction=this.createFnProxy(function(g){return d.fn.call(d.scope,g)});delete c.labelRenderer;this.labelFn.push(c.labelFunction)}if(a.indexOf("xAxis")>-1&&c.position=="left")c.position="bottom";return c},onDestroy:function(){Ext.chart.CartesianChart.superclass.onDestroy.call(this);Ext.each(this.labelFn,
function(a){this.removeFnProxy(a)},this)}});Ext.reg("cartesianchart",Ext.chart.CartesianChart);Ext.chart.LineChart=Ext.extend(Ext.chart.CartesianChart,{type:"line"});Ext.reg("linechart",Ext.chart.LineChart);Ext.chart.ColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"column"});Ext.reg("columnchart",Ext.chart.ColumnChart);Ext.chart.StackedColumnChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackcolumn"});Ext.reg("stackedcolumnchart",Ext.chart.StackedColumnChart);
Ext.chart.BarChart=Ext.extend(Ext.chart.CartesianChart,{type:"bar"});Ext.reg("barchart",Ext.chart.BarChart);Ext.chart.StackedBarChart=Ext.extend(Ext.chart.CartesianChart,{type:"stackbar"});Ext.reg("stackedbarchart",Ext.chart.StackedBarChart);Ext.chart.Axis=function(a){Ext.apply(this,a)};Ext.chart.Axis.prototype={type:null,orientation:"horizontal",reverse:false,labelFunction:null,hideOverlappingLabels:true,labelSpacing:2};
Ext.chart.NumericAxis=Ext.extend(Ext.chart.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Ext.chart.TimeAxis=Ext.extend(Ext.chart.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});
Ext.chart.CategoryAxis=Ext.extend(Ext.chart.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});Ext.chart.Series=function(a){Ext.apply(this,a)};Ext.chart.Series.prototype={type:null,displayName:null};Ext.chart.CartesianSeries=Ext.extend(Ext.chart.Series,{xField:null,yField:null,showInLegend:true,axis:"primary"});Ext.chart.ColumnSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"column"});Ext.chart.LineSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"line"});
Ext.chart.BarSeries=Ext.extend(Ext.chart.CartesianSeries,{type:"bar"});Ext.chart.PieSeries=Ext.extend(Ext.chart.Series,{type:"pie",dataField:null,categoryField:null});
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:15E3,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,b){a||(a=Ext.getBody());var c={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"}]};this.el=this.floating?new Ext.Layer({shadow:this.shadow,dh:c,constrain:false,parentEl:a,zindex:this.zIndex}):a.createChild(c);Ext.menu.Menu.superclass.onRender.call(this,a,b);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(a){if((a=a.getTarget(".x-menu-list-item",this.ul,true))&&a.menuItemId)return this.items.get(a.menuItemId)},onClick:function(a){var b=this.findTargetItem(a);
if(b)if(b.isFormField)this.setActiveItem(b);else if(b instanceof Ext.menu.BaseItem)if(b.menu&&this.ignoreParentClicks){b.expandMenu();a.preventDefault()}else if(b.onClick){b.onClick(a);this.fireEvent("click",this,b,a)}},setActiveItem:function(a,b){if(a!=this.activeItem){this.deactivateActive();(this.activeItem=a).isFormField?a.focus():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(a,b){for(var c=this.items,d=a,e=c.length;d>=0&&d<e;d+=b){var g=c.get(d);if(g.isVisible()&&!g.disabled&&(g.canActivate||g.isFormField)){this.setActiveItem(g,false);return g}}return false},onMouseOver:function(a){var b=this.findTargetItem(a);b&&b.canActivate&&!b.disabled&&this.setActiveItem(b,true);this.over=true;this.fireEvent("mouseover",this,a,b)},onMouseOut:function(a){var b=this.findTargetItem(a);if(b)if(b==this.activeItem&&b.shouldDeactivate&&b.shouldDeactivate(a)){this.activeItem.deactivate();
delete this.activeItem}this.over=false;this.fireEvent("mouseout",this,a,b)},onScroll:function(a,b){a&&a.stopEvent();var c=this.ul.dom,d=Ext.fly(b).is(".x-menu-scroller-top");c.scrollTop+=this.scrollIncrement*(d?-1:1);if(d?c.scrollTop<=0:c.scrollTop+this.activeMax>=c.scrollHeight)this.onScrollerOut(null,b)},onScrollerIn:function(a,b){var c=this.ul.dom;if(Ext.fly(b).is(".x-menu-scroller-top")?c.scrollTop>0:c.scrollTop+this.activeMax<c.scrollHeight)Ext.fly(b).addClass(["x-menu-item-active","x-menu-scroller-active"])},
onScrollerOut:function(a,b){Ext.fly(b).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(a,b,c){if(this.floating){this.parentMenu=c;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(a,b||this.defaultAlign,this.defaultOffsets),c)}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.isIE9m){this.fireEvent("autosize",this);Ext.isIE8||this.el.repaint()}this.hidden=false;this.focus();this.fireEvent("show",this)}},constrainScroll:function(a){var b,c=this.ul.setHeight("auto").getHeight(),d=a,e,g;if(this.floating){g=Ext.fly(this.el.dom.parentNode);b=g.getScroll().top;g=g.getViewSize().height;e=a-b;b=this.maxHeight?this.maxHeight:
g-e;if(c>g){b=g;d=a-e}else if(b<c){d=a-(c-b);b=c}}else b=this.getHeight();if(this.maxHeight)b=Math.min(this.maxHeight,b);if(c>b&&b>0){this.activeMax=b-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(c);this.el.select(".x-menu-scroller").setDisplayed("none")}this.ul.dom.scrollTop=0;return d},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)a.floating?a.hide(true):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){a.ownerCt=this;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 a=this.parentMenu;a&&a.activeChild==this&&delete a.activeChild;delete this.parentMenu;Ext.menu.Menu.superclass.onDestroy.call(this);Ext.menu.MenuMgr.unregister(this);this.keyNav&&this.keyNav.disable();(a=this.scroller)&&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 a(c,d){d.tryActivate(d.items.indexOf(d.activeItem)-1,-1)||d.tryActivate(d.items.length-1,-1)}function b(c,d){d.tryActivate(d.items.indexOf(d.activeItem)+1,1)||d.tryActivate(0,1)}return{constructor:function(c){Ext.menu.MenuNav.superclass.constructor.call(this,c.el);this.scope=this.menu=c},doRelay:function(c,d){var e=c.getKey();if(this.menu.activeItem&&this.menu.activeItem.isFormField&&e!=c.TAB)return false;if(!this.menu.activeItem&&c.isNavKeyPress()&&
e!=c.SPACE&&e!=c.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,c,this.menu)},tab:function(c,d){c.stopEvent();c.shiftKey?a(c,d):b(c,d)},up:a,down:b,right:function(c,d){d.activeItem&&d.activeItem.expandMenu(true)},left:function(c,d){d.hide();d.parentMenu&&d.parentMenu.activeItem&&d.parentMenu.activeItem.activate()},enter:function(c,d){if(d.activeItem){c.stopPropagation();d.activeItem.onClick(c);d.fireEvent("click",this,d.activeItem);return true}}}}());
Ext.menu.MenuMgr=function(){function a(){if(i&&i.length>0){i.clone().each(function(o){o.hide()});return true}return false}function b(o){i.remove(o);if(i.length<1){j.disable();Ext.getDoc().un("mousedown",g);m=false}}function c(o){var s=i.last();p=new Date;i.add(o);if(!m){j.enable();Ext.getDoc().on("mousedown",g);m=true}if(o.parentMenu){o.getEl().setZIndex(parseInt(o.parentMenu.getEl().getStyle("z-index"),10)+3);o.parentMenu.activeChild=o}else s&&!s.isDestroyed&&s.isVisible()&&o.getEl().setZIndex(parseInt(s.getEl().getStyle("z-index"),
10)+3)}function d(o){o.activeChild&&o.activeChild.hide();if(o.autoHideTimer){clearTimeout(o.autoHideTimer);delete o.autoHideTimer}}function e(o){var s=o.parentMenu;if(!s&&!o.allowOtherMenus)a();else s&&s.activeChild&&s.activeChild.hide()}function g(o){p.getElapsed()>50&&i.length>0&&!o.getTarget(".x-menu")&&a()}var h,i,j,k={},m=false,p=new Date;return{hideAll:function(){return a()},register:function(o){if(!h){h={};i=new Ext.util.MixedCollection;j=Ext.getDoc().addKeyListener(27,a);j.disable()}h[o.id]=
o;o.on({beforehide:d,hide:b,beforeshow:e,show:c})},get:function(o){if(typeof o=="string"){if(!h)return null;return h[o]}else return o.events?o:typeof o.length=="number"?new Ext.menu.Menu({items:o}):Ext.create(o,"menu")},unregister:function(o){delete h[o.id];o.un("beforehide",d);o.un("hide",b);o.un("beforeshow",e);o.un("show",c)},registerCheckable:function(o){var s=o.group;if(s){k[s]||(k[s]=[]);k[s].push(o)}},unregisterCheckable:function(o){var s=o.group;s&&k[s].remove(o)},onCheckChange:function(o,
s){if(o.group&&s)for(var l=k[o.group],n=0,r=l.length,q;n<r;n++){q=l[n];q!=o&&q.setChecked(false)}},getCheckedItem:function(o){if(o=k[o])for(var s=0,l=o.length;s<l;s++)if(o[s].checked)return o[s];return null},setCheckedItem:function(o,s){var l=k[o];if(l)for(var n=0,r=l.length;n<r;n++)l[n].id==s&&l[n].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){!this.disabled&&this.fireEvent("click",this,a)!==false&&this.parentMenu&&this.parentMenu.fireEvent("itemclick",this,a)!==false?this.handleClick(a):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)this.clickHideDelayTimer=a.hide.defer(this.clickHideDelay,a,[true]);else a.deactivateActive()},
beforeDestroy:function(){clearTimeout(this.clickHideDelayTimer);Ext.menu.BaseItem.superclass.beforeDestroy.call(this)},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(a){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML="&#160;";this.el=b;a.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,altText:"",hideDelay:200,ctype:"Ext.menu.Item",initComponent:function(){Ext.menu.Item.superclass.initComponent.call(this);if(this.menu){if(Ext.isArray(this.menu))this.menu={items:this.menu};if(Ext.isObject(this.menu))this.menu.ownerCt=this;this.menu=Ext.menu.MenuMgr.get(this.menu);this.menu.ownerCt=undefined}},onRender:function(a,b){if(!this.itemTpl)this.itemTpl=Ext.menu.Item.prototype.itemTpl=new Ext.XTemplate('<a id="{id}" class="{cls} x-unselectable" hidefocus="true" unselectable="on" href="{href}"',
'<tpl if="hrefTarget">',' target="{hrefTarget}"',"</tpl>",">",'<img alt="{altText}" src="{icon}" class="x-menu-item-icon {iconCls}"/>','<span class="x-menu-item-text">{text}</span>',"</a>");var c=this.getTemplateArgs();this.el=b?this.itemTpl.insertBefore(b,c,true):this.itemTpl.append(a,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,
a,b)},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;",altText:this.altText||""}},setText:function(a){this.text=a||"&#160;";if(this.rendered){this.textEl.update(this.text);this.parentMenu.layout.doAutoSize()}},setIconClass:function(a){var b=this.iconCls;this.iconCls=a;this.rendered&&
this.iconEl.replaceClass(b,this.iconCls)},beforeDestroy:function(){clearTimeout(this.showTimer);clearTimeout(this.hideTimer);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;this.menu.over?this.parentMenu.setActiveItem(this,false):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,b){var c=b===true;if(this.checked!=a&&(c||this.fireEvent("beforecheckchange",this,a)!==false)){Ext.menu.MenuMgr.onCheckChange(this,a);if(this.container)this.container[a?"addClass":"removeClass"]("x-menu-item-checked");this.checked=a;c||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.menu.DateMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,pickerId:null,cls:"x-date-menu",initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);if(this.strict=Ext.isIE7&&Ext.isStrict)this.on("show",this.onShow,this,{single:true,delay:20});Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.applyIf({internalRender:this.strict||!Ext.isIE9m,ctCls:"x-menu-date-item",id:this.pickerId},this.initialConfig))});this.picker.purgeListeners();
Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler)this.on("select",this.handler,this.scope||this)},menuHide:function(){this.hideOnClick&&this.hide(true)},onBeforeShow:function(){this.picker&&this.picker.hideMonthPicker(true)},onShow:function(){var a=this.picker.getEl();a.setWidth(a.getWidth())}});Ext.reg("datemenu",Ext.menu.DateMenu);
Ext.menu.ColorMenu=Ext.extend(Ext.menu.Menu,{enableScrolling:false,hideOnClick:true,cls:"x-color-menu",paletteId:null,initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(Ext.applyIf({id:this.paletteId},this.initialConfig))});this.palette.purgeListeners();Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler)this.on("select",this.handler,this.scope||
this)},menuHide:function(){this.hideOnClick&&this.hide(true)}});Ext.reg("colormenu",Ext.menu.ColorMenu);
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(a,b){if(!this.el){var c=this.getAutoCreate();if(!c.name)c.name=this.name||this.id;if(this.inputType)c.type=this.inputType;this.autoEl=c}Ext.form.Field.superclass.onRender.call(this,a,b);this.submitValue===false&&this.el.dom.removeAttribute("name");if(c=this.el.dom.type){if(c=="password")c="text";this.el.addClass("x-form-"+
c)}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.getKeyEvent(),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;if(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;a=this.validateValue(this.processValue(this.getRawValue()),a);this.preventMark=b;return a},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(a){return a},
validateValue:function(a){a=this.getErrors(a)[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 b=this.getMessageHandler();if(b)b.mark(this,a);else if(this.msgTarget){this.el.addClass(this.invalidClass);if(b=Ext.getDom(this.msgTarget)){b.innerHTML=a;b.style.display=this.msgDisplay}}}this.setActiveError(a)},
clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var a=this.getMessageHandler();if(a)a.clear(this);else if(this.msgTarget){this.el.removeClass(this.invalidClass);if(a=Ext.getDom(this.msgTarget)){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,b){a.el.addClass(a.invalidClass);if(!a.errorEl){var c=a.getErrorCt();if(!c){a.el.dom.title=b;return}a.errorEl=c.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(b);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,b){a.el.addClass(a.invalidClass);if(!a.errorIcon){var c=a.getErrorCt();if(!c){a.el.dom.title=b;return}a.errorIcon=c.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=b;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()}if(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(a){if(this.stripCharsRe){var b=a.replace(this.stripCharsRe,"");if(b!==a){this.setRawValue(b);return b}}return a},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,b;if(this.emptyText){if(a.dom.value==this.emptyText){this.setRawValue("");b=true}a.removeClass(this.emptyClass)}if(this.selectOnFocus||b)a.dom.select()},postBlur:function(){this.applyEmptyText()},filterKeys:function(a){if(!a.ctrlKey){var b=a.getKey();if(!(Ext.isGecko&&(a.isNavKeyPress()||b==a.BACKSPACE||b==a.DELETE&&a.button==-1))){b=String.fromCharCode(a.getCharCode());!Ext.isGecko&&a.isSpecialKey()&&!b||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=Ext.isDefined(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);if(!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){c=Ext.form.VTypes;c[this.vtype](a,this)||b.push(this.vtypeText||c[this.vtype+"Text"])}this.regex&&!this.regex.test(a)&&b.push(this.regexText);return b},selectText:function(a,b){var c=this.getRawValue(),d=false;if(c.length>
0){a=a===undefined?0:a;b=b===undefined?c.length:b;d=this.el.dom;if(d.setSelectionRange)d.setSelectionRange(a,b);else if(d.createTextRange){d=d.createTextRange();d.moveStart("character",a);d.moveEnd("character",b-c.length);d.select()}d=Ext.isGecko||Ext.isOpera}else d=true;d&&this.focus()},autoSize:function(){if(this.grow&&this.rendered){if(!this.metrics)this.metrics=Ext.util.TextMetrics.createInstance(this.el);var a=this.el.dom.value,b=document.createElement("div");b.appendChild(document.createTextNode(a));
a=b.innerHTML;Ext.removeNode(b);a+="&#160;";a=Math.min(this.growMax,Math.max(this.metrics.getWidth(a)+10,this.growMin));this.el.setWidth(a);this.fireEvent("autosize",this,a)}},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,b){Ext.form.TriggerField.superclass.onResize.call(this,a,b);var c=this.getTriggerWidth();Ext.isNumber(a)&&this.el.setWidth(a-c);this.wrap.setWidth(this.el.getWidth()+
c)},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(a,b){this.doc=Ext.isIE?Ext.getBody():Ext.getDoc();Ext.form.TriggerField.superclass.onRender.call(this,a,b);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,
alt:"",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=
false;this.el.removeClass("x-trigger-noedit");this.mun(this.el,"click",this.onTriggerClick,this)}else{this.el.dom.readOnly=true;this.el.addClass("x-trigger-noedit");this.mon(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(a,b){b.getKey()==b.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.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,alt:"",cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(a){return this.triggers[a]},afterRender:function(){Ext.form.TwinTriggerField.superclass.afterRender.call(this);
for(var a=this.triggers,b=0,c=a.length;b<c;++b)this["hideTrigger"+(b+1)]&&a[b].hide()},initTrigger:function(){var a=this.trigger.select(".x-form-trigger",true),b=this;a.each(function(c,d,e){var g="Trigger"+(e+1);c.hide=function(){var h=b.wrap.getWidth();this.dom.style.display="none";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+g]=true};c.show=function(){var h=b.wrap.getWidth();this.dom.style.display="";b.el.setWidth(h-b.trigger.getWidth());b["hidden"+g]=false};this.mon(c,"click",this["on"+g+"Click"],
this,{preventDefault:true});c.addClassOnOver("x-form-trigger-over");c.addClassOnClick("x-form-trigger-click")},this);this.triggers=a.elements},getTriggerWidth:function(){var a=0;Ext.each(this.triggers,function(b,c){var d="Trigger"+(c+1),e=b.getWidth();a+=e===0&&!this["hidden"+d]?this.defaultTriggerWidth:e},this);return a},onDestroy:function(){Ext.destroy(this.triggers);Ext.form.TwinTriggerField.superclass.onDestroy.call(this)},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});
Ext.reg("trigger",Ext.form.TriggerField);Ext.reg("twintrigger",Ext.form.TwinTriggerField);
Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1E3,growAppend:"&#160;\n&#160;",enterIsSpecial:false,preventScrollbars:false,onRender:function(a,b){if(!this.el)this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"};Ext.form.TextArea.superclass.onRender.call(this,a,b);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){if(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},filterValidation:function(a){if(!a.isNavKeyPress()||!this.enterIsSpecial&&a.keyCode==a.ENTER)this.validationTask.delay(this.validationDelay)},autoSize:function(){if(this.grow&&this.textSizeEl){var a=
Ext.util.Format.htmlEncode(this.el.dom.value),b=this.textSizeEl;Ext.fly(b).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 />")}b.innerHTML=a;a=Math.min(this.growMax,Math.max(b.offsetHeight,this.growMin));if(a!=this.lastHeight){this.lastHeight=a;this.el.setHeight(a);this.fireEvent("autosize",this,a)}}}});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",autoStripChars:false,initEvents:function(){var a=this.baseChars+"";if(this.allowDecimals)a+=this.decimalSeparator;
if(this.allowNegative)a+="-";a=Ext.escapeRe(a);this.maskRe=RegExp("["+a+"]");if(this.autoStripChars)this.stripCharsRe=RegExp("[^"+a+"]","gi");Ext.form.NumberField.superclass.initEvents.call(this)},getErrors:function(a){var b=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);a=Ext.isDefined(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=this.fixPrecision(a);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(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|n-j|n/j",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,startDay:0,defaultAutoCreate:{tag:"input",
type:"text",size:"10",autocomplete:"off"},initTime:"12",initTimeFormat:"H",safeParse:function(a,b){if(Date.formatContainsHourInfo(b))return Date.parseDate(a,b);else{var c=Date.parseDate(a+" "+this.initTime,b+" "+this.initTimeFormat);if(c)return c.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,b=a.length-1,c="(?:";Ext.each(a,function(d,e){c+=Ext.isDate(d)?"^"+Ext.escapeRe(d.dateFormat(this.format))+"$":a[e];if(e!=b)c+="|"},this);this.disabledDatesRE=RegExp(c+")")}},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 c=a;a=this.parseDate(a);if(!a){b.push(String.format(this.invalidText,c,this.format));return b}c=a.getTime();this.minValue&&c<this.minValue.clearTime().getTime()&&b.push(String.format(this.minText,this.formatDate(this.minValue)));this.maxValue&&c>this.maxValue.clearTime().getTime()&&b.push(String.format(this.maxText,this.formatDate(this.maxValue)));if(this.disabledDays){c=a.getDay();for(var d=0;d<this.disabledDays.length;d++)if(c===
this.disabledDays[d]){b.push(this.disabledDaysText);break}}c=this.formatDate(a);this.disabledDatesRE&&this.disabledDatesRE.test(c)&&b.push(String.format(this.disabledDatesText,c));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 b=this.safeParse(a,this.format),c=this.altFormats,d=this.altFormatsArray;if(!b&&c){d=d||c.split("|");c=0;for(var e=d.length;c<e&&!b;c++)b=this.safeParse(a,d[c])}return b},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){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,startDay:this.startDay,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(a,b){this.setValue(b);this.fireEvent("select",this,b);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.DisplayField=Ext.extend(Ext.form.Field,{validationEvent:false,validateOnBlur:false,defaultAutoCreate:{tag:"div"},fieldClass:"x-form-display-field",htmlEncode:false,initEvents:Ext.emptyFn,isValid:function(){return true},validate:function(){return true},getRawValue:function(){var a=this.rendered?this.el.dom.innerHTML:Ext.value(this.value,"");if(a===this.emptyText)a="";if(this.htmlEncode)a=Ext.util.Format.htmlDecode(a);return a},getValue:function(){return this.getRawValue()},getName:function(){return this.name},
setRawValue:function(a){if(this.htmlEncode)a=Ext.util.Format.htmlEncode(a);return this.rendered?this.el.dom.innerHTML=Ext.isEmpty(a)?"":a:this.value=a},setValue:function(a){this.setRawValue(a);return this}});Ext.reg("displayfield",Ext.form.DisplayField);
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 a=Ext.getDom(this.transform);if(!this.hiddenName)this.hiddenName=a.name;if(!this.store){this.mode="local";for(var b=[],c=a.options,d=0,e=c.length;d<e;d++){var g=c[d],h=(g.hasAttribute?g.hasAttribute("value"):g.getAttributeNode("value").specified)?
g.value:g.text;if(g.selected&&Ext.isEmpty(this.value,true))this.value=h;b.push([h,g.text])}this.store=new Ext.data.ArrayStore({idIndex:0,fields:["value","text"],data:b,autoDestroy:true});this.valueField="value";this.displayField="text"}a.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(a,this.autoCreate||this.defaultAutoCreate);this.render(this.el.parentNode,a)}Ext.removeNode(a)}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(a,b){if(this.hiddenName&&!Ext.isDefined(this.submitValue))this.submitValue=false;Ext.form.ComboBox.superclass.onRender.call(this,a,b);if(this.hiddenName)this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",
name:this.hiddenName,id:this.hiddenId||Ext.id()},"before",true);Ext.isGecko&&this.el.dom.setAttribute("autocomplete","off");this.lazyInit?this.on("focus",this.initList,this,{single:true}):this.initList()},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},getZIndex:function(a){a=a||Ext.getDom(this.getListParent()||Ext.getBody());(a=parseInt(Ext.fly(a).getStyle("z-index"),10))||(a=this.getParentZIndex());return(a||12E3)+5},initList:function(){if(!this.list){var a=Ext.getDom(this.getListParent()||Ext.getBody());this.list=new Ext.Layer({parentEl:a,shadow:this.shadow,cls:["x-combo-list",this.listClass].join(" "),constrain:false,zindex:this.getZIndex(a)});a=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setSize(a,
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:"x-combo-list-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:"x-combo-list-inner"});this.mon(this.innerList,"mouseover",this.onViewOver,this);this.mon(this.innerList,"mousemove",this.onViewMove,this);this.innerList.setWidth(a-this.list.getFrameWidth("lr"));
if(this.pageSize){this.footer=this.list.createChild({cls:"x-combo-list-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="x-combo-list-item">{'+this.displayField+"}</div></tpl>";this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||".x-combo-list-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(b,c,d){this.maxHeight=d-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=c;this.innerList.setWidth(c-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(){this.clearFilterOnReset&&this.mode=="local"&&this.store.clearFilter();Ext.form.ComboBox.superclass.reset.call(this)},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.inKeyMode=
true;this.selectNext()}else this.onTriggerClick()},enter:function(){this.onViewClick()},esc:function(){this.collapse()},tab:function(){this.forceSelection===true?this.collapse():this.onViewClick(false);return true},scope:this,doRelay:function(a,b,c){if(c=="down"||this.scope.isExpanded()){var d=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if((Ext.isIE9&&Ext.isStrict||Ext.isIE10p||!Ext.isIE)&&Ext.EventManager.useKeydown)this.scope.fireKey(a);return d}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(a){if(!Ext.isDefined(this.listWidth)){a=Math.max(a,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){this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1}},onLoad:function(){if(this.hasFocus)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 a=this.store.getAt(0).data[this.displayField],b=a.length,c=this.getRawValue().length;if(c!=b){this.setRawValue(a);
this.selectText(c,a.length)}}},assertValue:function(){var a=this.getRawValue(),b;if(this.valueField&&Ext.isDefined(this.value))b=this.findRecord(this.valueField,this.value);if(!b||b.get(this.displayField)!=a)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&&this.valueField){if(this.value==a)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(){return this.valueField?Ext.isDefined(this.value)?this.value:"":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(a){var b=a;if(this.valueField){var c=this.findRecord(this.valueField,a);if(c)b=c.data[this.displayField];else if(Ext.isDefined(this.valueNotFoundText))b=this.valueNotFoundText}this.lastSelectionText=b;if(this.hiddenField)this.hiddenField.value=Ext.value(a,"");Ext.form.ComboBox.superclass.setValue.call(this,b);this.value=a;return this},findRecord:function(a,b){var c;this.store.getCount()>0&&this.store.each(function(d){if(d.data[a]==
b){c=d;return false}});return c},onViewMove:function(){this.inKeyMode=false},onViewOver:function(a,b){if(!this.inKeyMode){var c=this.view.findItemFromChild(b);c&&this.select(this.view.indexOf(c),false)}},onViewClick:function(a){var b=this.view.getSelectedIndexes()[0],c=this.store.getAt(b);c?this.onSelect(c,b):this.collapse();a!==false&&this.el.focus()},restrictHeight:function(){this.innerList.dom.style.height="";var a=this.innerList.dom,b=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:
0)+this.assetHeight;a=Math.max(a.clientHeight,a.offsetHeight,a.scrollHeight);var c=this.getPosition()[1]-Ext.getBody().getScroll().top,d=Ext.lib.Dom.getViewHeight()-c-this.getSize().height;a=Math.min(a,Math.max(c,d,this.minHeight||0)-this.list.shadowOffset-b-5,this.maxHeight);this.innerList.setHeight(a);this.list.beginUpdate();this.list.setHeight(a+b);this.list.alignTo.apply(this.list,[this.el].concat(this.listAlign));this.list.endUpdate()},isExpanded:function(){return this.list&&this.list.isVisible()},
selectByValue:function(a,b){if(!Ext.isEmpty(a,true)){var c=this.findRecord(this.valueField||this.displayField,a);if(c){this.select(this.store.indexOf(c),b);return true}}return false},select:function(a,b){this.selectedIndex=a;this.view.select(a);if(b!==false){var c=this.view.getNode(a);c&&this.innerList.scrollChildIntoView(c,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(){if(this.store.getCount()>
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;b?this.store.clearFilter():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={},b=this.store.paramNames;if(this.pageSize){a[b.start]=0;a[b.limit]=this.pageSize}return a},collapse:function(){if(this.isExpanded()){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)){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));this.list.setZIndex(this.getZIndex());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)){if(this.isExpanded())this.collapse();else{this.onFocus({});this.triggerAction=="all"?this.doQuery(this.allQuery,true):this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);
Ext.form.Checkbox=Ext.extend(Ext.form.Field,{focusClass:undefined,fieldClass:"x-form-field",checked:false,boxLabel:"&#160;",defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},actionMode:"wrap",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);!this.boxLabel&&!this.fieldLabel&&this.el.alignTo(this.wrap,"c-c")},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);
this.mon(this.el,{scope:this,click:this.onClick,change:this.onClick})},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,onRender:function(a,b){Ext.form.Checkbox.superclass.onRender.call(this,a,b);if(this.inputValue!==undefined)this.el.dom.value=this.inputValue;this.wrap=this.el.wrap({cls:"x-form-check-wrap"});this.boxLabel&&this.wrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel});if(this.checked)this.setValue(true);else this.checked=this.el.dom.checked;Ext.isIEQuirks&&
this.wrap.repaint();this.resizeEl=this.positionEl=this.wrap},onDestroy:function(){Ext.destroy(this.wrap);Ext.form.Checkbox.superclass.onDestroy.call(this)},initValue:function(){this.originalValue=this.getValue()},getValue:function(){if(this.rendered)return this.el.dom.checked;return this.checked},onClick:function(){this.el.dom.checked!=this.checked&&this.setValue(this.el.dom.checked)},setValue:function(a){var b=this.checked,c=this.inputValue;this.checked=a===false?false:a===true||a==="true"||a=="1"||
(c?a==c:String(a).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked}if(b!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler)this.handler.call(this.scope||this,this,this.checked)}return this}});Ext.reg("checkbox",Ext.form.Checkbox);
Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",initComponent:function(){this.addEvents("change");this.on("change",this.validate,this);Ext.form.CheckboxGroup.superclass.initComponent.call(this)},onRender:function(a,b){if(!this.el){var c={autoEl:{id:this.id},cls:this.groupCls,layout:"column",renderTo:a,bufferResize:false},d={xtype:"container",
defaultType:this.defaultType,layout:"form",defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(c,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e=0,g=this.items.length;e<g;e++)Ext.applyIf(this.items[e],d)}else{var h,i=[];if(typeof this.columns=="string")this.columns=this.items.length;if(!Ext.isArray(this.columns)){h=[];for(e=0;e<this.columns;e++)h.push(100/this.columns*0.01);this.columns=h}h=this.columns.length;for(e=0;e<h;e++){g=
Ext.apply({items:[]},d);g[this.columns[e]<=1?"columnWidth":"width"]=this.columns[e];if(this.defaults)g.defaults=Ext.apply(g.defaults||{},this.defaults);i.push(g)}if(this.vertical){d=Math.ceil(this.items.length/h);var j=0;e=0;for(g=this.items.length;e<g;e++){e>0&&e%d==0&&j++;if(this.items[e].fieldLabel)this.items[e].hideLabel=false;i[j].items.push(this.items[e])}}else{e=0;for(g=this.items.length;e<g;e++){d=e%h;if(this.items[e].fieldLabel)this.items[e].hideLabel=false;i[d].items.push(this.items[e])}}Ext.apply(c,
{layoutConfig:{columns:h},items:i})}this.panel=new Ext.Container(c);this.panel.ownerCt=this;this.el=this.panel.getEl();if(this.forId&&this.itemCls)(c=this.el.up(this.itemCls).child("label",true))&&c.setAttribute("htmlFor",this.forId);c=this.panel.findBy(function(k){return k.isFormField},this);this.items=new Ext.util.MixedCollection;this.items.addAll(c)}Ext.form.CheckboxGroup.superclass.onRender.call(this,a,b)},initValue:function(){if(this.value){this.setValue.apply(this,this.buffered?this.value:[this.value]);
delete this.buffered;delete this.value}},afterRender:function(){Ext.form.CheckboxGroup.superclass.afterRender.call(this);this.eachItem(function(a){a.on("check",this.fireChecked,this);a.inGroup=true})},doLayout:function(){if(this.rendered){this.panel.forceLayout=this.ownerCt.forceLayout;this.panel.doLayout()}},fireChecked:function(){var a=[];this.eachItem(function(b){b.checked&&a.push(b)});this.fireEvent("change",this,a)},getErrors:function(){var a=Ext.form.CheckboxGroup.superclass.getErrors.apply(this,
arguments);if(!this.allowBlank){var b=true;this.eachItem(function(c){if(c.checked)return b=false});b&&a.push(this.blankText)}return a},isDirty:function(){if(this.disabled||!this.rendered)return false;var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},setReadOnly:function(a){this.rendered&&this.eachItem(function(b){b.setReadOnly(a)});this.readOnly=a},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})},
onResize:function(a,b){this.panel.setSize(a,b);this.panel.doLayout()},reset:function(){if(this.originalValue){this.eachItem(function(a){if(a.setValue){a.setValue(false);a.originalValue=a.getValue()}});this.resetOriginal=true;this.setValue(this.originalValue);delete this.resetOriginal}else this.eachItem(function(a){a.reset&&a.reset()});(function(){this.clearInvalid()}).defer(50,this)},setValue:function(){if(this.rendered)this.onSetValue.apply(this,arguments);else{this.buffered=true;this.value=arguments}return this},
onSetValue:function(a,b){if(arguments.length==1)if(Ext.isArray(a))Ext.each(a,function(e,g){if(Ext.isObject(e)&&e.setValue){e.setValue(true);if(this.resetOriginal===true)e.originalValue=e.getValue()}else{var h=this.items.itemAt(g);h&&h.setValue(e)}},this);else if(Ext.isObject(a))for(var c in a){var d=this.getBox(c);d&&d.setValue(a[c])}else this.setValueForItem(a);else(d=this.getBox(a))&&d.setValue(b)},beforeDestroy:function(){Ext.destroy(this.panel);this.rendered||Ext.destroy(this.items);Ext.form.CheckboxGroup.superclass.beforeDestroy.call(this)},
setValueForItem:function(a){a=String(a).split(",");this.eachItem(function(b){a.indexOf(b.inputValue)>-1&&b.setValue(true)})},getBox:function(a){var b=null;this.eachItem(function(c){if(a==c||c.dataIndex==a||c.id==a||c.getName()==a){b=c;return false}});return b},getValue:function(){var a=[];this.eachItem(function(b){b.checked&&a.push(b)});return a},eachItem:function(a,b){if(this.items&&this.items.each)this.items.each(a,b||this)},getRawValue:Ext.emptyFn,setRawValue:Ext.emptyFn});
Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);
Ext.form.CompositeField=Ext.extend(Ext.form.Field,{defaultMargins:"0 5 0 0",skipLastItemMargin:true,isComposite:true,combineErrors:true,labelConnector:", ",initComponent:function(){for(var a=[],b=this.items,c,d=0,e=b.length;d<e;d++){c=b[d];if(!Ext.isEmpty(c.ref))c.ref="../"+c.ref;a.push(c.fieldLabel);Ext.applyIf(c,this.defaults);d==e-1&&this.skipLastItemMargin||Ext.applyIf(c,{margins:this.defaultMargins})}this.fieldLabel=this.fieldLabel||this.buildLabel(a);this.fieldErrors=new Ext.util.MixedCollection(true,
function(g){return g.field});this.fieldErrors.on({scope:this,add:this.updateInvalidMark,remove:this.updateInvalidMark,replace:this.updateInvalidMark});Ext.form.CompositeField.superclass.initComponent.apply(this,arguments);this.innerCt=new Ext.Container({layout:"hbox",items:this.items,cls:"x-form-composite",defaultMargins:"0 3 0 0",ownerCt:this});delete this.innerCt.ownerCt;a=this.innerCt.findBy(function(g){return g.isFormField},this);this.items=new Ext.util.MixedCollection;this.items.addAll(a)},onRender:function(a){if(!this.el){var b=
this.innerCt;b.render(a);this.innerCt.ownerCt=this;this.el=b.getEl();this.combineErrors&&this.eachItem(function(c){Ext.apply(c,{markInvalid:this.onFieldMarkInvalid.createDelegate(this,[c],0),clearInvalid:this.onFieldClearInvalid.createDelegate(this,[c],0)})});(b=this.el.parent().parent().child("label",true))&&b.setAttribute("for",this.items.items[0].id)}Ext.form.CompositeField.superclass.onRender.apply(this,arguments)},onFieldMarkInvalid:function(a,b){var c=a.getName();this.fieldErrors.replace(c,
{field:c,errorName:a.fieldLabel||c,error:b});a.preventMark||a.el.addClass(a.invalidClass)},onFieldClearInvalid:function(a){this.fieldErrors.removeKey(a.getName());a.el.removeClass(a.invalidClass)},updateInvalidMark:function(){var a=Ext.isIE6&&Ext.isStrict;if(this.fieldErrors.length==0){this.clearInvalid();a&&this.clearInvalid.defer(50,this)}else{var b=this.buildCombinedErrorMessage(this.fieldErrors.items);this.sortErrors();this.markInvalid(b);a&&this.markInvalid(b)}},validateValue:function(a,b){var c=
true;this.eachItem(function(d){d.isValid(b)||(c=false)});return c},buildCombinedErrorMessage:function(a){for(var b=[],c,d=0,e=a.length;d<e;d++){c=a[d];b.push(String.format("{0}: {1}",c.errorName,c.error))}return b.join("<br />")},sortErrors:function(){var a=this.items;this.fieldErrors.sort("ASC",function(b,c){var d=function(g){return function(h){return h.getName()==g}},e=a.findIndexBy(d(b.field));d=a.findIndexBy(d(c.field));return e<d?-1:1})},reset:function(){this.eachItem(function(a){a.reset()});
(function(){this.clearInvalid()}).defer(50,this)},clearInvalidChildren:function(){this.eachItem(function(a){a.clearInvalid()})},buildLabel:function(a){return Ext.clean(a).join(this.labelConnector)},isDirty:function(){if(this.disabled||!this.rendered)return false;var a=false;this.eachItem(function(b){if(b.isDirty()){a=true;return false}});return a},eachItem:function(a,b){if(this.items&&this.items.each)this.items.each(a,b||this)},onResize:function(a,b){var c=this.innerCt;this.rendered&&c.rendered&&
c.setSize(a,b);Ext.form.CompositeField.superclass.onResize.apply(this,arguments)},doLayout:function(a,b){if(this.rendered){var c=this.innerCt;c.forceLayout=this.ownerCt.forceLayout;c.doLayout(a,b)}},beforeDestroy:function(){Ext.destroy(this.innerCt);Ext.form.CompositeField.superclass.beforeDestroy.call(this)},setReadOnly:function(a){if(a==undefined)a=true;a=!!a;this.rendered&&this.eachItem(function(b){b.setReadOnly(a)});this.readOnly=a},onShow:function(){Ext.form.CompositeField.superclass.onShow.call(this);
this.doLayout()},onDisable:function(){this.eachItem(function(a){a.disable()})},onEnable:function(){this.eachItem(function(a){a.enable()})}});Ext.reg("compositefield",Ext.form.CompositeField);
Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,getGroupValue:function(){var a=(this.el.up("form")||Ext.getBody()).child('input[name="'+this.el.dom.name+'"]:checked',true);return a?a.value:null},setValue:function(a){var b;if(typeof a=="boolean")Ext.form.Radio.superclass.setValue.call(this,a);else if(this.rendered){b=this.getCheckEl();(a=b.child('input[name="'+this.el.dom.name+'"][value="'+a+'"]',true))&&Ext.getCmp(a.id).setValue(true)}if(this.rendered&&
this.checked){b=b||this.getCheckEl();b=this.getCheckEl().select('input[name="'+this.el.dom.name+'"]');b.each(function(c){c.dom.id!=this.id&&Ext.getCmp(c.dom.id).setValue(false)},this)}return this},getCheckEl:function(){if(this.inGroup)return this.el.up(".x-form-radio-group");return this.el.up("form")||Ext.getBody()}});Ext.reg("radio",Ext.form.Radio);
Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group",getValue:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});return a},onSetValue:function(a,b){if(arguments.length>1){var c=this.getBox(a);if(c){c.setValue(b);c.checked&&this.eachItem(function(d){d!==c&&d.setValue(false)})}}else this.setValueForItem(a)},setValueForItem:function(a){a=String(a).split(",")[0];
this.eachItem(function(b){b.setValue(a==b.inputValue)})},fireChecked:function(){if(!this.checkTask)this.checkTask=new Ext.util.DelayedTask(this.bufferChecked,this);this.checkTask.delay(10)},bufferChecked:function(){var a=null;this.eachItem(function(b){if(b.checked){a=b;return false}});this.fireEvent("change",this,a)},onDestroy:function(){if(this.checkTask){this.checkTask.cancel();this.checkTask=null}Ext.form.RadioGroup.superclass.onDestroy.call(this)}});Ext.reg("radiogroup",Ext.form.RadioGroup);
Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",shouldLayout:false,onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);
Ext.form.BasicForm=Ext.extend(Ext.util.Observable,{constructor:function(a,b){Ext.apply(this,b);if(Ext.isString(this.paramOrder))this.paramOrder=this.paramOrder.split(/[\s,|]/);this.items=new Ext.util.MixedCollection(false,function(c){return c.getItemId()});this.addEvents("beforeaction","actionfailed","actioncomplete");a&&this.initEl(a);Ext.form.BasicForm.superclass.constructor.call(this)},timeout:30,paramOrder:undefined,paramsAsHash:false,waitTitle:"Please Wait...",activeAction:null,trackResetOnLoad:false,
initEl:function(a){this.el=Ext.get(a);this.id=this.el.id||Ext.id();this.standardSubmit||this.el.on("submit",this.onSubmit,this);this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(a){a.stopEvent()},destroy:function(a){if(a!==true){this.items.each(function(b){Ext.destroy(b)});Ext.destroy(this.el)}this.items.clear();this.purgeListeners()},isValid:function(){var a=true;this.items.each(function(b){b.validate()||(a=false)});return a},isDirty:function(){var a=false;this.items.each(function(b){if(b.isDirty()){a=
true;return false}});return a},doAction:function(a,b){if(Ext.isString(a))a=new Ext.form.Action.ACTION_TYPES[a](this,b);if(this.fireEvent("beforeaction",this,a)!==false){this.beforeAction(a);a.run.defer(100,a)}return this},submit:function(a){a=a||{};if(this.standardSubmit){if(a=a.clientValidation===false||this.isValid()){var b=this.el.dom;if(this.url&&Ext.isEmpty(b.action))b.action=this.url;b.submit()}return a}this.doAction(String.format("{0}submit",this.api?"direct":""),a);return this},load:function(a){this.doAction(String.format("{0}load",
this.api?"direct":""),a);return this},updateRecord:function(a){a.beginEdit();var b,c;a.fields.each(function(d){if(b=this.findField(d.name)){c=b.getValue();if(Ext.type(c)!==false&&c.getGroupValue)c=c.getGroupValue();else if(b.eachItem){c=[];b.eachItem(function(e){c.push(e.getValue())})}a.set(d.name,c)}},this);a.endEdit();return this},loadRecord:function(a){this.setValues(a.data);return this},beforeAction:function(a){this.items.each(function(b){b.isFormField&&b.syncValue&&b.syncValue()});a=a.options;
if(a.waitMsg)if(this.waitMsgTarget===true)this.el.mask(a.waitMsg,"x-mask-loading");else if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(a.waitMsg,"x-mask-loading")}else Ext.MessageBox.wait(a.waitMsg,a.waitTitle||this.waitTitle)},afterAction:function(a,b){this.activeAction=null;var c=a.options;if(c.waitMsg)if(this.waitMsgTarget===true)this.el.unmask();else if(this.waitMsgTarget)this.waitMsgTarget.unmask();else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}if(b){c.reset&&
this.reset();Ext.callback(c.success,c.scope,[this,a]);this.fireEvent("actioncomplete",this,a)}else{Ext.callback(c.failure,c.scope,[this,a]);this.fireEvent("actionfailed",this,a)}},findField:function(a){var b=this.items.get(a);if(!Ext.isObject(b)){var c=function(d){if(d.isFormField)if(d.dataIndex==a||d.id==a||d.getName()==a){b=d;return false}else if(d.isComposite)return d.items.each(c);else if(d instanceof Ext.form.CheckboxGroup&&d.rendered)return d.eachItem(c)};this.items.each(c)}return b||null},
markInvalid:function(a){if(Ext.isArray(a))for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.findField(d.id);e&&e.markInvalid(d.msg)}else for(c in a)if(!Ext.isFunction(a[c])&&(b=this.findField(c)))b.markInvalid(a[c]);return this},setValues:function(a){if(Ext.isArray(a))for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.findField(d.id);if(e){e.setValue(d.value);if(this.trackResetOnLoad)e.originalValue=e.getValue()}}else for(c in a)if(!Ext.isFunction(a[c])&&(b=this.findField(c))){b.setValue(a[c]);if(this.trackResetOnLoad)b.originalValue=
b.getValue()}return this},getValues:function(a){var b=Ext.lib.Ajax.serializeForm(this.el.dom);if(a===true)return b;return Ext.urlDecode(b)},getFieldValues:function(a){var b={},c,d,e;this.items.each(function(g){if(!g.disabled&&(a!==true||g.isDirty())){c=g.getName();d=b[c];e=g.getValue();if(Ext.isDefined(d))if(Ext.isArray(d))b[c].push(e);else b[c]=[d,e];else b[c]=e}});return b},clearInvalid:function(){this.items.each(function(a){a.clearInvalid()});return this},reset:function(){this.items.each(function(a){a.reset()});
return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(a){this.items.remove(a);return this},cleanDestroyed:function(){this.items.filterBy(function(a){return!!a.isDestroyed}).each(this.remove,this)},render:function(){this.items.each(function(a){a.isFormField&&!a.rendered&&document.getElementById(a.id)&&a.applyToMarkup(a.id)});return this},applyToFields:function(a){this.items.each(function(b){Ext.apply(b,a)});return this},applyIfToFields:function(a){this.items.each(function(b){Ext.applyIf(b,
a)});return this},callFieldMethod:function(a,b){b=b||[];this.items.each(function(c){Ext.isFunction(c[a])&&c[a].apply(c,b)});return this}});Ext.BasicForm=Ext.form.BasicForm;
Ext.FormPanel=Ext.extend(Ext.Panel,{minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();Ext.FormPanel.superclass.initComponent.call(this);this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload)this.bodyCfg.enctype="multipart/form-data";this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},
createForm:function(){var a=Ext.applyIf({listeners:{}},this.initialConfig);return new Ext.form.BasicForm(null,a)},initFields:function(){var a=this.form,b=this,c=function(d){if(b.isField(d))a.add(d);else if(d.findBy&&d!=b){b.applySettings(d);d.items&&d.items.each&&d.items.each(c,this)}};this.items.each(c,this)},applySettings:function(a){var b=a.ownerCt;Ext.applyIf(a,{labelAlign:b.labelAlign,labelWidth:b.labelWidth,itemCls:b.itemCls})},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},
onRender:function(a,b){this.initFields();Ext.FormPanel.superclass.onRender.call(this,a,b);this.form.initEl(this.body)},beforeDestroy:function(){this.stopMonitoring();this.form.destroy(true);Ext.FormPanel.superclass.beforeDestroy.call(this)},isField:function(a){return!!a.setValue&&!!a.getValue&&!!a.markInvalid&&!!a.clearInvalid},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.on({scope:this,add:this.onAddEvent,remove:this.onRemoveEvent});this.monitorValid&&this.startMonitoring()},
onAdd:function(a){Ext.FormPanel.superclass.onAdd.call(this,a);this.processAdd(a)},onAddEvent:function(a,b){a!==this&&this.processAdd(b)},processAdd:function(a){if(this.isField(a))this.form.add(a);else if(a.findBy){this.applySettings(a);this.form.add.apply(this.form,a.findBy(this.isField))}},onRemove:function(a){Ext.FormPanel.superclass.onRemove.call(this,a);this.processRemove(a)},onRemoveEvent:function(a,b){a!==this&&this.processRemove(b)},processRemove:function(a){if(!this.destroying)if(this.isField(a))this.form.remove(a);
else if(a.findBy){Ext.each(a.findBy(this.isField),this.form.remove,this.form);this.form.cleanDestroyed()}},startMonitoring:function(){if(!this.validTask){this.validTask=new Ext.util.TaskRunner;this.validTask.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){if(this.validTask){this.validTask.stopAll();this.validTask=null}},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);this.form&&
this.form.items.each(function(){this.disable()})},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);this.form&&this.form.items.each(function(){this.enable()})},bindHandler:function(){var a=true;this.form.items.each(function(g){if(!g.isValid(true))return a=false});if(this.fbar)for(var b=this.fbar.items.items,c=0,d=b.length;c<d;c++){var e=b[c];e.formBind===true&&e.disabled===a&&e.setDisabled(!a)}this.fireEvent("clientvalidation",this,a)}});Ext.reg("form",Ext.FormPanel);
Ext.form.FormPanel=Ext.FormPanel;
Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(a,b){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle)this.el.appendChild(document.createElement("legend")).className=this.baseCls+"-header"}Ext.form.FieldSet.superclass.onRender.call(this,a,b);if(this.checkboxToggle){this.checkbox=this.header.insertFirst(typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",
type:"checkbox",name:this.checkboxName||this.id+"-checkbox"});this.checkbox.dom.checked=!this.collapsed;this.mon(this.checkbox,"click",this.onCheckClick,this)}},onCollapse:function(a,b){if(this.checkbox)this.checkbox.dom.checked=false;Ext.form.FieldSet.superclass.onCollapse.call(this,a,b)},onExpand:function(a,b){if(this.checkbox)this.checkbox.dom.checked=true;Ext.form.FieldSet.superclass.onExpand.call(this,a,b)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()}});
Ext.reg("fieldset",Ext.form.FieldSet);
Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",defaultValue:Ext.isOpera||Ext.isIE6?"&#160;":"&#8203;",actionMode:"wrap",validationEvent:false,deferHeight:true,initialized:false,
activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange");Ext.form.HtmlEditor.superclass.initComponent.call(this)},createFontOptions:function(){for(var a=[],b=this.fontFamilies,c,d,e=0,g=b.length;e<g;e++){c=b[e];d=c.toLowerCase();a.push('<option value="',d,'" style="font-family:',
c,';"',this.defaultFont==d?' selected="true">':">",c,"</option>")}return a.join("")},createToolbar:function(a){function b(g,h,i){return{itemId:g,cls:"x-btn-icon",iconCls:"x-edit-"+g,enableToggle:h!==false,scope:a,handler:i||a.relayBtnCmd,clickEvent:"mousedown",tooltip:d?a.buttonTips[g]||undefined:undefined,overflowText:a.buttonTips[g].title||undefined,tabIndex:-1}}var c=[],d=Ext.QuickTips&&Ext.QuickTips.isEnabled();if(this.enableFont&&!Ext.isSafari2){var e=new Ext.Toolbar.Item({autoEl:{tag:"select",
cls:"x-font-select",html:this.createFontOptions()}});c.push(e,"-")}this.enableFormat&&c.push(b("bold"),b("italic"),b("underline"));this.enableFontSize&&c.push("-",b("increasefontsize",false,this.adjustFont),b("decreasefontsize",false,this.adjustFont));if(this.enableColors)c.push("-",{itemId:"forecolor",cls:"x-btn-icon",iconCls:"x-edit-forecolor",clickEvent:"mousedown",tooltip:d?a.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,
value:"000000",plain:true,listeners:{scope:this,select:function(g,h){this.execCmd("forecolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon",iconCls:"x-edit-backcolor",clickEvent:"mousedown",tooltip:d?a.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,listeners:{scope:this,select:function(g,h){if(Ext.isGecko){this.execCmd("useCSS",false);
this.execCmd("hilitecolor",h);this.execCmd("useCSS",true)}else this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isWebKit||Ext.isIE?"#"+h:h);this.deferFocus()}},clickEvent:"mousedown"})});this.enableAlignments&&c.push("-",b("justifyleft"),b("justifycenter"),b("justifyright"));if(!Ext.isSafari2){this.enableLinks&&c.push("-",b("createlink",false,this.createLink));this.enableLists&&c.push("-",b("insertorderedlist"),b("insertunorderedlist"));this.enableSourceEdit&&c.push("-",b("sourceedit",true,
function(){this.toggleSourceEdit(!this.sourceEditMode)}))}c=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild,items:c});if(e){this.fontSelect=e.el;this.mon(this.fontSelect,"change",function(){this.relayCmd("fontname",this.fontSelect.dom.value);this.deferFocus()},this)}this.mon(c.el,"click",function(g){g.preventDefault()});this.tb=c;this.tb.doLayout()},onDisable:function(){this.wrap.mask();Ext.form.HtmlEditor.superclass.onDisable.call(this)},onEnable:function(){this.wrap.unmask();Ext.form.HtmlEditor.superclass.onEnable.call(this)},
setReadOnly:function(a){Ext.form.HtmlEditor.superclass.setReadOnly.call(this,a);if(this.initialized){if(Ext.isIE)this.getEditorBody().contentEditable=!a;else this.setDesignMode(!a);var b=this.getEditorBody();if(b)b.style.cursor=this.readOnly?"default":"text";this.disableItems(a)}},getDocMarkup:function(){var a=Ext.fly(this.iframe).getHeight()-this.iframePad*2;return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body></body></html>',
this.iframePad,a)},getEditorBody:function(){var a=this.getDoc();return a.body||a.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:this.iframe.contentDocument||this.getWin().document},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(a,b){Ext.form.HtmlEditor.superclass.onRender.call(this,a,b);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");Ext.isIE&&this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;");
this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.disableItems(true);this.tb.doLayout();this.createIFrame();if(!this.width){var c=this.el.getSize();this.setSize(c.width,this.height||c.height)}this.resizeEl=this.positionEl=this.wrap},createIFrame:function(){var a=document.createElement("iframe");a.name=Ext.id();a.frameBorder="0";a.style.overflow="auto";a.src=Ext.SSL_SECURE_URL;this.wrap.dom.appendChild(a);this.iframe=a;this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,
scope:this,interval:100})},initFrame:function(){Ext.TaskMgr.stop(this.monitorTask);var a=this.getDoc();this.win=this.getWin();a.open();a.write(this.getDocMarkup());a.close();this.readyTask={run:function(){var b=this.getDoc();if(b.body||b.readyState=="complete"){Ext.TaskMgr.stop(this.readyTask);this.setDesignMode(true);this.initEditor.defer(10,this)}},interval:10,duration:1E4,scope:this};Ext.TaskMgr.start(this.readyTask)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var a=this.getDoc();
if(a)if(!a.editorInitialized||this.getDesignMode()!="on")this.initFrame()}},setDesignMode:function(a){var b=this.getDoc();if(b){if(this.readOnly)a=false;b.designMode=/on|true/i.test(String(a).toLowerCase())?"on":"off"}},getDesignMode:function(){var a=this.getDoc();if(!a)return"";return String(a.designMode).toLowerCase()},disableItems:function(a){if(this.fontSelect)this.fontSelect.dom.disabled=a;this.tb.items.each(function(b){b.getItemId()!="sourceedit"&&b.setDisabled(a)})},onResize:function(a,b){Ext.form.HtmlEditor.superclass.onResize.apply(this,
arguments);if(this.el&&this.iframe){if(Ext.isNumber(a)){var c=a-this.wrap.getFrameWidth("lr");this.el.setWidth(c);this.tb.setWidth(c);this.iframe.style.width=Math.max(c,0)+"px"}if(Ext.isNumber(b)){c=b-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(c);this.iframe.style.height=Math.max(c,0)+"px";var d=this.getEditorBody();if(d)d.style.height=Math.max(c-this.iframePad*2,0)+"px"}}},toggleSourceEdit:function(a){if(a===undefined)a=!this.sourceEditMode;this.sourceEditMode=a===true;
a=this.tb.getComponent("sourceedit");if(a.pressed!==this.sourceEditMode){a.toggle(this.sourceEditMode);if(!a.xtbHidden)return}if(this.sourceEditMode){this.previousSize=this.getSize();a=Ext.get(this.iframe).getHeight();this.disableItems(true);this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();this.el.dom.style.height=a+"px"}else{a=parseInt(this.el.dom.style.height,10);this.initialized&&this.disableItems(this.readOnly);
this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();this.setSize(this.previousSize);delete this.previousSize;this.iframe.style.height=a+"px"}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var a=prompt(this.createLinkText,this.defaultLinkValue);a&&a!="http://"&&this.relayCmd("createlink",a)},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,
setValue:function(a){Ext.form.HtmlEditor.superclass.setValue.call(this,a);this.pushValue();return this},cleanHtml:function(a){a=String(a);if(Ext.isWebKit)a=a.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"");if(a.charCodeAt(0)==this.defaultValue.replace(/\D/g,""))a=a.substring(1);return a},syncValue:function(){if(this.initialized){var a=this.getEditorBody(),b=a.innerHTML;if(Ext.isWebKit)if((a=a.getAttribute("style").match(/text-align:(.*?);/i))&&a[1])b='<div style="'+a[0]+'">'+
b+"</div>";b=this.cleanHtml(b);if(this.fireEvent("beforesync",this,b)!==false){this.el.dom.value=b;this.fireEvent("sync",this,b)}}},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var a=this.el.dom.value;if(!this.activated&&a.length<1)a=this.defaultValue;if(this.fireEvent("beforepush",this,a)!==false){this.getEditorBody().innerHTML=a;if(Ext.isGecko){this.setDesignMode(false);
this.setDesignMode(true)}this.fireEvent("push",this,a)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){this.win&&!this.sourceEditMode?this.win.focus():this.el.focus()},initEditor:function(){try{var a=this.getEditorBody(),b=this.el.getStyles("font-size","font-family","background-image","background-repeat","background-color","color"),c,d;b["background-attachment"]="fixed";a.bgProperties="fixed";Ext.DomHelper.applyStyles(a,b);if(c=this.getDoc())try{Ext.EventManager.removeAll(c)}catch(e){}d=
this.onEditorEvent.createDelegate(this);Ext.EventManager.on(c,{mousedown:d,dblclick:d,click:d,keyup:d,buffer:100});Ext.isGecko&&Ext.EventManager.on(c,"keypress",this.applyCommand,this);if(Ext.isIE||Ext.isWebKit||Ext.isOpera)Ext.EventManager.on(c,"keydown",this.fixKeys,this);Ext.EventManager.on(window,"unload",this.beforeDestroy,this);this.initialized=c.editorInitialized=true;this.pushValue();this.setReadOnly(this.readOnly);this.fireEvent("initialize",this)}catch(g){}},beforeDestroy:function(){this.monitorTask&&
Ext.TaskMgr.stop(this.monitorTask);this.readyTask&&Ext.TaskMgr.stop(this.readyTask);if(this.rendered){Ext.destroy(this.tb);var a=this.getDoc();Ext.EventManager.removeFromSpecialCache(a);if(a)try{Ext.EventManager.removeAll(a);for(var b in a)delete a[b]}catch(c){}if(this.wrap){this.wrap.dom.innerHTML="";this.wrap.remove()}}Ext.form.HtmlEditor.superclass.beforeDestroy.call(this)},onFirstFocus:function(){var a;this.activated=true;this.disableItems(this.readOnly);if(Ext.isGecko){this.win.focus();a=this.win.getSelection();
if(a.focusNode&&!this.getValue().length){a=a.getRangeAt(0);a.selectNodeContents(this.getEditorBody());a.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(b){}}this.fireEvent("activate",this)},adjustFont:function(a){a=a.getItemId()=="increasefontsize"?1:-1;var b=this.getDoc();b=parseInt(b.queryCommandValue("FontSize")||2,10);if(Ext.isSafari&&!Ext.isSafari2||Ext.isChrome||Ext.isAir){b=b<=10?1+a:b<=13?2+a:b<=16?3+a:b<=18?4+a:b<=24?5+a:6+a;b=b.constrain(1,
6)}else{if(Ext.isSafari)a*=2;b=Math.max(1,b+a)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",b)},onEditorEvent:function(){this.updateToolbar()},updateToolbar:function(){if(!this.readOnly)if(this.activated){var a=this.tb.items.map,b=this.getDoc();if(this.enableFont&&!Ext.isSafari2){var c=(b.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(c!=this.fontSelect.dom.value)this.fontSelect.dom.value=c}if(this.enableFormat){a.bold.toggle(b.queryCommandState("bold"));a.italic.toggle(b.queryCommandState("italic"));
a.underline.toggle(b.queryCommandState("underline"))}if(this.enableAlignments){a.justifyleft.toggle(b.queryCommandState("justifyleft"));a.justifycenter.toggle(b.queryCommandState("justifycenter"));a.justifyright.toggle(b.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){a.insertorderedlist.toggle(b.queryCommandState("insertorderedlist"));a.insertunorderedlist.toggle(b.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()}else this.onFirstFocus()},
relayBtnCmd:function(a){this.relayCmd(a.getItemId())},relayCmd:function(a,b){(function(){this.focus();this.execCmd(a,b);this.updateToolbar()}).defer(10,this)},execCmd:function(a,b){this.getDoc().execCommand(a,false,b===undefined?null:b);this.syncValue()},applyCommand:function(a){if(a.ctrlKey){var b=a.getCharCode(),c;if(b>0){b=String.fromCharCode(b);switch(b){case "b":c="bold";break;case "i":c="italic";break;case "u":c="underline"}if(c){this.win.focus();this.execCmd(c);this.deferFocus();a.preventDefault()}}}},
insertAtCursor:function(a){if(this.activated)if(Ext.isIE){this.win.focus();var b=this.getDoc().selection.createRange();if(b){b.pasteHTML(a);this.syncValue();this.deferFocus()}}else{this.win.focus();this.execCmd("InsertHTML",a);this.deferFocus()}},fixKeys:function(){if(Ext.isIE)return function(a){var b=a.getKey(),c=this.getDoc();if(b==a.TAB){a.stopEvent();if(b=c.selection.createRange()){b.collapse(true);b.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else if(b==a.ENTER)if(b=c.selection.createRange()){c=
b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){a.stopEvent();b.pasteHTML("<br />");b.collapse(false);b.select()}}};else if(Ext.isOpera)return function(a){if(a.getKey()==a.TAB){a.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}};else if(Ext.isWebKit)return function(a){var b=a.getKey();if(b==a.TAB){a.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}else if(b==a.ENTER){a.stopEvent();this.execCmd("InsertHtml","<br /><br />");this.deferFocus()}}}(),
getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},
backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},
insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);
Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:undefined,maxValue:undefined,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H|gi a|hi a|giA|hiA|gi A|hi A",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initDateFormat:"j/n/Y",initComponent:function(){Ext.isDefined(this.minValue)&&
this.setMinValue(this.minValue,true);Ext.isDefined(this.maxValue)&&this.setMaxValue(this.maxValue,true);this.store||this.generateStore(true);Ext.form.TimeField.superclass.initComponent.call(this)},setMinValue:function(a,b){this.setLimit(a,true,b);return this},setMaxValue:function(a,b){this.setLimit(a,false,b);return this},generateStore:function(a){for(var b=this.minValue||(new Date(this.initDate)).clearTime(),c=this.maxValue||(new Date(this.initDate)).clearTime().add("mi",1439),d=[];b<=c;){d.push(b.dateFormat(this.format));
b=b.add("mi",this.increment)}this.bindStore(d,a)},setLimit:function(a,b,c){var d;if(Ext.isString(a))d=this.parseDate(a);else if(Ext.isDate(a))d=a;if(d){a=(new Date(this.initDate)).clearTime();a.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds());this[b?"minValue":"maxValue"]=a;c||this.generateStore()}},getValue:function(){return this.formatDate(this.parseDate(Ext.form.TimeField.superclass.getValue.call(this)))||""},setValue:function(a){return Ext.form.TimeField.superclass.setValue.call(this,
this.formatDate(this.parseDate(a)))},validateValue:Ext.form.DateField.prototype.validateValue,formatDate:Ext.form.DateField.prototype.formatDate,parseDate:function(a){if(!a||Ext.isDate(a))return a;var b=this.initDate+" ",c=this.initDateFormat+" ",d=Date.parseDate(b+a,c+this.format),e=this.altFormats;if(!d&&e){if(!this.altFormatsArray)this.altFormatsArray=e.split("|");e=0;for(var g=this.altFormatsArray,h=g.length;e<h&&!d;e++)d=Date.parseDate(b+a,c+g[e])}return d}});Ext.reg("timefield",Ext.form.TimeField);
Ext.form.SliderField=Ext.extend(Ext.form.Field,{useTips:true,tipText:null,actionMode:"wrap",initComponent:function(){var a=Ext.copyTo({id:this.id+"-slider"},this.initialConfig,["vertical","minValue","maxValue","decimalPrecision","keyIncrement","increment","clickToChange","animate"]);if(this.useTips)a.plugins=[new Ext.slider.Tip(this.tipText?{getText:this.tipText}:{})];this.slider=new Ext.Slider(a);Ext.form.SliderField.superclass.initComponent.call(this)},onRender:function(a,b){this.autoCreate={id:this.id,
name:this.name,type:"hidden",tag:"input"};Ext.form.SliderField.superclass.onRender.call(this,a,b);this.resizeEl=this.positionEl=this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.slider.render(this.wrap)},onResize:function(a,b,c,d){Ext.form.SliderField.superclass.onResize.call(this,a,b,c,d);this.slider.setSize(a,b)},initEvents:function(){Ext.form.SliderField.superclass.initEvents.call(this);this.slider.on("change",this.onChange,this)},onChange:function(a,b){this.setValue(b,undefined,true)},onEnable:function(){Ext.form.SliderField.superclass.onEnable.call(this);
this.slider.enable()},onDisable:function(){Ext.form.SliderField.superclass.onDisable.call(this);this.slider.disable()},beforeDestroy:function(){Ext.destroy(this.slider);Ext.form.SliderField.superclass.beforeDestroy.call(this)},alignErrorIcon:function(){this.errorIcon.alignTo(this.slider.el,"tl-tr",[2,0])},setMinValue:function(a){this.slider.setMinValue(a);return this},setMaxValue:function(a){this.slider.setMaxValue(a);return this},setValue:function(a,b,c){c||this.slider.setValue(a,b);return Ext.form.SliderField.superclass.setValue.call(this,
this.slider.getValue())},getValue:function(){return this.slider.getValue()}});Ext.reg("sliderfield",Ext.form.SliderField);
Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(a,b){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,a,b)},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.form.Action=function(a,b){this.form=a;this.options=b||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";
Ext.form.Action.prototype={type:"default",run:function(){},success:function(){},handleResponse:function(){},failure:function(a){this.response=a;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(a){this.response=a;if(!a.responseText&&!a.responseXML)return true;return this.result=this.handleResponse(a)},decodeResponse:function(a){try{return Ext.decode(a.responseText)}catch(b){return false}},getUrl:function(a){var b=this.options.url||this.form.url||
this.form.el.dom.action;if(a)if(a=this.getParams())b=Ext.urlAppend(b,a);return b},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var a=this.form.baseParams,b=this.options.params;if(b)if(typeof b=="object")b=Ext.urlEncode(Ext.applyIf(b,a));else{if(typeof b=="string"&&a)b+="&"+Ext.urlEncode(a)}else if(a)b=Ext.urlEncode(a);return b},createCallback:function(a){a=a||{};return{success:this.success,failure:this.failure,
scope:this,timeout:a.timeout*1E3||this.form.timeout*1E3,upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(a,b){Ext.form.Action.Submit.superclass.constructor.call(this,a,b)};
Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var a=this.options,b=this.getMethod(),c=b=="GET";if(a.clientValidation===false||this.form.isValid()){if(a.submitEmptyText===false){var d=[],e=function(g){if(g.el.getValue()==g.emptyText){d.push(g);g.el.dom.value=""}g.isComposite&&g.rendered&&g.items.each(e)};this.form.items.each(e)}Ext.Ajax.request(Ext.apply(this.createCallback(a),{form:this.form.el.dom,url:this.getUrl(c),method:b,headers:a.headers,params:!c?this.getParams():
null,isUpload:this.form.fileUpload}));a.submitEmptyText===false&&Ext.each(d,function(g){g.applyEmptyText&&g.applyEmptyText()})}else if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}},success:function(a){a=this.processResponse(a);if(a===true||a.success)this.form.afterAction(this,true);else{a.errors&&this.form.markInvalid(a.errors);this.failureType=Ext.form.Action.SERVER_INVALID;this.form.afterAction(this,false)}},handleResponse:function(a){if(this.form.errorReader){a=
this.form.errorReader.read(a);var b=[];if(a.records)for(var c=0,d=a.records.length;c<d;c++)b[c]=a.records[c].data;if(b.length<1)b=null;return{success:a.success,errors:b}}return this.decodeResponse(a)}});Ext.form.Action.Load=function(a,b){Ext.form.Action.Load.superclass.constructor.call(this,a,b);this.reader=this.form.reader};
Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(a){a=this.processResponse(a);if(a===true||!a.success||!a.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false)}else{this.form.clearInvalid();this.form.setValues(a.data);this.form.afterAction(this,true)}},handleResponse:function(a){if(this.form.reader){a=
this.form.reader.read(a);return{success:a.success,data:a.records&&a.records[0]?a.records[0].data:null}}return this.decodeResponse(a)}});
Ext.form.Action.DirectLoad=Ext.extend(Ext.form.Action.Load,{constructor:function(a,b){Ext.form.Action.DirectLoad.superclass.constructor.call(this,a,b)},type:"directload",run:function(){var a=this.getParams();a.push(this.success,this);this.form.api.load.apply(window,a)},getParams:function(){var a=[],b={};Ext.apply(b,this.options.params,this.form.baseParams);var c=this.form.paramOrder;if(c)for(var d=0,e=c.length;d<e;d++)a.push(b[c[d]]);else this.form.paramsAsHash&&a.push(b);return a},processResponse:function(a){return this.result=
a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER)a={};Ext.form.Action.DirectLoad.superclass.success.call(this,a)}});
Ext.form.Action.DirectSubmit=Ext.extend(Ext.form.Action.Submit,{constructor:function(a,b){Ext.form.Action.DirectSubmit.superclass.constructor.call(this,a,b)},type:"directsubmit",run:function(){var a=this.options;if(a.clientValidation===false||this.form.isValid()){this.success.params=this.getParams();this.form.api.submit(this.form.el.dom,this.success,this)}else if(a.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}},getParams:function(){var a=
{};Ext.apply(a,this.options.params,this.form.baseParams);return a},processResponse:function(a){return this.result=a},success:function(a,b){if(b.type==Ext.Direct.exceptions.SERVER)a={};Ext.form.Action.DirectSubmit.superclass.success.call(this,a)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit,directload:Ext.form.Action.DirectLoad,directsubmit:Ext.form.Action.DirectSubmit};
Ext.form.VTypes=function(){var a=/^[a-zA-Z_]+$/,b=/^[a-zA-Z0-9_]+$/,c=/^(\w+)([\-+.\'][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/,d=/(((^https?)|(^ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(e){return c.test(e)},emailText:'This field should be an e-mail address in the format "user@example.com"',emailMask:/[a-z0-9_\.\-\+\'@]/i,url:function(e){return d.test(e)},urlText:'This field should be a URL in the format "http://www.example.com"',
alpha:function(e){return a.test(e)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(e){return b.test(e)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();
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.autoWidth=this.autoScroll=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 a=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(a,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(a,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);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(a){var b=this.colModel,c=a.columns,d=this.store,e,g,h;if(c)for(var i=0,j=c.length;i<j;i++){e=c[i];if(g=b.getColumnById(e.id)){h=b.getIndexById(e.id);b.setState(h,{hidden:e.hidden,width:e.width,sortable:g.sortable,editable:g.editable});
h!=i&&b.moveColumn(h,i)}}if(d){if(e=a.sort)d[d.remoteSort?"setDefaultSort":"sort"](e.field,e.direction);e=a.group;if(d.groupBy)e?d.groupBy(e):d.clearGrouping()}a=Ext.apply({},a);delete a.columns;delete a.sort;Ext.grid.GridPanel.superclass.applyState.call(this,a)},getState:function(){var a={columns:[]},b=this.store,c;c=0;for(var d;d=this.colModel.config[c];c++){a.columns[c]={id:d.id,width:d.width};if(d.hidden)a.columns[c].hidden=true}if(b){if(c=b.getSortState())a.sort=c;if(b.getGroupState)if(b=b.getGroupState())a.group=
b}return a},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var a=this.view;this.on("bodyresize",a.layout,a);a.layout(true);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(a,b,c,d,e){var g=this.colModel,h=g.getColumnCount(),i=this.store.getCount(),j=true;if(c<0){if(b<0){a--;j=false}for(;a>=0;){j||(b=h-1);for(j=false;b>=
0;){if(d.call(e||this,a,b,g)===true)return[a,b];b--}a--}}else{if(b>=h){a++;j=false}for(;a<i;){j||(b=0);for(j=false;b<h;){if(d.call(e||this,a,b,g)===true)return[a,b];b++}a++}}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?this.selModel.getCount():1;return String.format(this.ddText,a,a==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);
Ext.grid.PivotGrid=Ext.extend(Ext.grid.GridPanel,{aggregator:"sum",renderer:undefined,initComponent:function(){Ext.grid.PivotGrid.superclass.initComponent.apply(this,arguments);this.initAxes();this.enableColumnResize=false;this.viewConfig=Ext.apply(this.viewConfig||{},{forceFit:true});this.colModel=new Ext.grid.ColumnModel({})},getAggregator:function(){return typeof this.aggregator=="string"?Ext.grid.PivotAggregatorMgr.types[this.aggregator]:this.aggregator},setAggregator:function(a){this.aggregator=
a},setMeasure:function(a){this.measure=a},setLeftAxis:function(a,b){this.leftAxis=a;b&&this.view.refresh()},setTopAxis:function(a,b){this.topAxis=a;b&&this.view.refresh()},initAxes:function(){var a=Ext.grid.PivotAxis;this.leftAxis instanceof a||this.setLeftAxis(new a({orientation:"vertical",dimensions:this.leftAxis||[],store:this.store}));this.topAxis instanceof a||this.setTopAxis(new a({orientation:"horizontal",dimensions:this.topAxis||[],store:this.store}))},extractData:function(){var a=this.store.data.items,
b=a.length,c=[],d,e,g,h;if(b==0)return[];var i=this.leftAxis.getTuples(),j=i.length,k=this.topAxis.getTuples(),m=k.length,p=this.getAggregator();for(e=0;e<b;e++){d=a[e];for(g=0;g<j;g++){c[g]=c[g]||[];if(i[g].matcher(d)===true)for(h=0;h<m;h++){c[g][h]=c[g][h]||[];k[h].matcher(d)&&c[g][h].push(d)}}}a=c.length;for(e=0;e<a;e++){g=c[e];b=g.length;for(g=0;g<b;g++)c[e][g]=p(c[e][g],this.measure)}return c},getView:function(){if(!this.view)this.view=new Ext.grid.PivotGridView(this.viewConfig);return this.view}});
Ext.reg("pivotgrid",Ext.grid.PivotGrid);Ext.grid.PivotAggregatorMgr=new Ext.AbstractManager;Ext.grid.PivotAggregatorMgr.registerType("sum",function(a,b){var c=a.length,d=0,e;for(e=0;e<c;e++)d+=a[e].get(b);return d});Ext.grid.PivotAggregatorMgr.registerType("avg",function(a,b){var c=a.length,d=0,e;for(e=0;e<c;e++)d+=a[e].get(b);return d/c||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("min",function(a,b){var c=[],d=a.length,e;for(e=0;e<d;e++)c.push(a[e].get(b));return Math.min.apply(this,c)||"n/a"});
Ext.grid.PivotAggregatorMgr.registerType("max",function(a,b){var c=[],d=a.length,e;for(e=0;e<d;e++)c.push(a[e].get(b));return Math.max.apply(this,c)||"n/a"});Ext.grid.PivotAggregatorMgr.registerType("count",function(a){return a.length});
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",hideSortIcons:false,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,headerMenuOpenCls:"x-grid3-hd-menu-open",rowOverCls:"x-grid3-row-over",constructor:function(a){Ext.apply(this,a);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)},masterTpl: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>"),headerTpl:new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
"<thead>",'<tr class="x-grid3-hd-row">{cells}</tr>',"</thead>","</table>"),bodyTpl:new Ext.Template("{rows}"),cellTpl: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} x-unselectable" unselectable="on" {attr}>{value}</div>',"</td>"),initTemplates:function(){var a=this.templates||{},b,c;b=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 alt="" class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td>");var d=['<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>"].join("");Ext.applyIf(a,{hcell:b,cell:this.cellTpl,body:this.bodyTpl,header:this.headerTpl,master:this.masterTpl,row:new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">'+d+"</div>"),rowInner:new Ext.Template(d)});for(c in a)if((b=a[c])&&Ext.isFunction(b.compile)&&!b.compiled){b.disableFormats=true;b.compile()}this.templates=a;this.colRe=/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,b=Ext.get(this.grid.getGridEl().dom.firstChild),c=new a(b.child("div.x-grid3-viewport")),d=new a(c.child("div.x-grid3-header")),e=new a(c.child("div.x-grid3-scroller"));this.grid.hideHeaders&&d.setDisplayed(false);this.forceFit&&e.setStyle("overflow-x","hidden");Ext.apply(this,{el:b,mainWrap:c,scroller:e,mainHd:d,innerHd:d.child("div.x-grid3-header-inner").dom,mainBody:new a(a.fly(e).child("div.x-grid3-body")),
focusEl:new a(a.fly(e).child("a")),resizeMarker:new a(b.child("div.x-grid3-resize-marker")),resizeProxy:new a(b.child("div.x-grid3-resize-proxy"))});this.focusEl.swallowEvent("click",true)},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(a,b){var c=this.findCell(a),d;if(c){d=this.fly(c).hasClass(b);if(!b||d)return this.getCellIndex(c)}return false},
getCellIndex:function(a){if(a)if((a=a.className.match(this.colRe))&&a[1])return this.cm.getIndexById(a[1]);return false},findHeaderCell:function(a){return(a=this.findCell(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(a){return(a=this.findRow(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(a,b){return Ext.fly(this.getRow(a)).query(this.cellSelector)[b]},getHeaderCell:function(a){return this.mainHd.dom.getElementsByTagName("td")[a]},addRowClass:function(a,b){var c=this.getRow(a);c&&this.fly(c).addClass(b)},removeRowClass:function(a,b){var c=this.getRow(a);c&&this.fly(c).removeClass(b)},removeRow:function(a){Ext.removeNode(this.getRow(a));this.syncFocusEl(a)},
removeRows:function(a,b){var c=this.mainBody.dom,d;for(d=a;d<=b;d++)Ext.removeNode(c.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(){var a=this.scroller.dom;a.scrollTop=0;a.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.scroller.dom;this.grid.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},
syncHeaderScroll:function(){var a=this.innerHd,b=this.scroller.dom.scrollLeft;a.scrollLeft=b;a.scrollLeft=b},updateSortIcon:function(a,b){var c=this.sortClasses,d=c[b=="DESC"?1:0];this.mainHd.select("td").removeClass(c).item(a).addClass(d)},updateAllColumnWidths:function(){var a=this.getTotalWidth(),b=this.cm.getColumnCount(),c=this.getRows(),d=c.length,e=[],g,h,i;for(h=0;h<b;h++){e[h]=this.getColumnWidth(h);this.getHeaderCell(h).style.width=e[h]}this.updateHeaderWidth();for(h=0;h<d;h++){g=c[h];g.style.width=
a;if(g=g.firstChild){g.style.width=a;g=g.rows[0];for(i=0;i<b;i++)g.childNodes[i].style.width=e[i]}}this.onAllColumnWidthsUpdated(e,a)},updateColumnWidth:function(a){var b=this.getColumnWidth(a),c=this.getTotalWidth(),d=this.getHeaderCell(a),e=this.getRows(),g=e.length,h,i;this.updateHeaderWidth();d.style.width=b;for(h=0;h<g;h++){d=e[h];i=d.firstChild;d.style.width=c;if(i){i.style.width=c;i.rows[0].childNodes[a].style.width=b}}this.onColumnWidthUpdated(a,b,c)},updateColumnHidden:function(a,b){var c=
this.getTotalWidth(),d=b?"none":"",e=this.getHeaderCell(a),g=this.getRows(),h=g.length,i;this.updateHeaderWidth();e.style.display=d;for(e=0;e<h;e++){i=g[e];i.style.width=c;if(i=i.firstChild){i.style.width=c;i.rows[0].childNodes[a].style.display=d}}this.onColumnHiddenUpdated(a,b,c);delete this.lastViewWidth;this.layout()},doRender:function(a,b,c,d,e,g){var h=this.templates,i=h.cell;h=h.row;var j=e-1,k=[],m=[],p={tstyle:"width:"+this.getTotalWidth()+";"},o={},s=b.length,l,n,r,q,t;for(q=0;q<s;q++){n=
b[q];m=[];t=q+d;for(r=0;r<e;r++){l=a[r];o.id=l.id;o.css=r===0?"x-grid3-cell-first ":r==j?"x-grid3-cell-last ":"";o.attr=o.cellAttr="";o.style=l.style;o.value=l.renderer.call(l.scope,n.data[l.name],o,n,t,r,c);if(Ext.isEmpty(o.value))o.value="&#160;";if(this.markDirty&&n.dirty&&typeof n.modified[l.name]!="undefined")o.css+=" x-grid3-dirty-cell";m[m.length]=i.apply(o)}l=[];if(g&&(t+1)%2===0)l[0]="x-grid3-row-alt";if(n.dirty)l[1]=" x-grid3-dirty-row";p.cols=e;if(this.getRowClass)l[2]=this.getRowClass(n,
t,p,c);p.alt=l.join(" ");p.cells=m.join("");k[k.length]=h.apply(p)}return k.join("")},processRows:function(a,b){if(!(!this.ds||this.ds.getCount()<1)){var c=this.getRows(),d=c.length,e,g;b=b||!this.grid.stripeRows;a=a||0;for(g=0;g<d;g++)if(e=c[g]){e.rowIndex=g;if(!b){e.className=e.className.replace(this.rowClsRe," ");if((g+1)%2===0)e.className+=" x-grid3-row-alt"}}a===0&&Ext.fly(c[0]).addClass(this.firstRowCls);Ext.fly(c[d-1]).addClass(this.lastRowCls)}},afterRender:function(){if(this.ds&&this.cm){this.mainBody.dom.innerHTML=
this.renderBody()||"&#160;";this.processRows(0,true);this.deferEmptyText!==true&&this.applyEmptyText();this.grid.fireEvent("viewready",this.grid)}},afterRenderUI:function(){var a=this.grid;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:"sortSep",xtype:"menuseparator"},{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()},
renderUI:function(){var a=this.templates;return a.master.apply({body:a.body.apply({rows:"&#160;"}),header:this.renderHeaders(),ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"})},processEvent:function(a,b){var c=b.getTarget(),d=this.grid,e=this.findHeaderIndex(c),g;d.fireEvent(a,b);if(e!==false)d.fireEvent("header"+a,d,e,b);else{e=this.findRowIndex(c);if(e!==false){g=this.findCellIndex(c);if(g!==false){c=d.colModel.getColumnAt(g);if(d.fireEvent("cell"+a,d,e,g,b)!==
false)if(!c||c.processEvent&&c.processEvent(a,b,d,e,g)!==false)d.fireEvent("row"+a,d,e,b)}else d.fireEvent("row"+a,d,e,b)!==false&&this.findRowBody(c)&&d.fireEvent("rowbody"+a,d,e,b)}else d.fireEvent("container"+a,d,b)}},layout:function(a){if(this.mainBody){var b=this.grid,c=b.getGridEl().getSize(true),d=c.width;c=c.height;var e=this.scroller,g;if(!(d<20||c<20)){if(b.autoHeight){b=e.dom.style;b.overflow="visible";if(Ext.isWebKit)b.position="static"}else{this.el.setSize(d,c);g=this.mainHd.getHeight();
g=c-g;e.setSize(d,g);if(this.innerHd)this.innerHd.style.width=d+"px"}if(this.forceFit||a===true&&this.autoFill){if(this.lastViewWidth!=d){this.fitColumns(false,false);this.lastViewWidth=d}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(d,g)}}},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(){var a=this.cm,b=this.templates,c=b.hcell,d={},e=a.getColumnCount(),g=e-1,h=[],i;for(i=0;i<e;i++){d=i==0?"x-grid3-cell-first ":i==g?"x-grid3-cell-last ":"";d={id:a.getColumnId(i),value:a.getColumnHeader(i)||"",style:this.getColumnStyle(i,
true),css:d,tooltip:this.getColumnTooltip(i)};if(a.config[i].align=="right")d.istyle="padding-right: 16px;";else delete d.istyle;h[i]=c.apply(d)}return b.header.apply({cells:h.join(""),tstyle:String.format("width: {0};",this.getTotalWidth())})},getColumnTooltip:function(a){if(a=this.cm.getColumnTooltip(a))return Ext.QuickTips.isEnabled()?'ext:qtip="'+a+'"':'title="'+a+'"';return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders();
this.updateHeaderWidth(false)},updateHeaderWidth:function(a){var b=this.innerHd.firstChild,c=this.getTotalWidth();b.style.width=this.getOffsetWidth();b.firstChild.style.width=c;if(a!==false)this.mainBody.dom.style.width=c},focusRow:function(a){this.focusCell(a,0,false)},focusCell:function(a,b,c){this.syncFocusEl(this.ensureVisible(a,b,c));a=this.focusEl;Ext.isGecko?a.focus():a.focus.defer(1,a)},resolveCell:function(a,b,c){if(!Ext.isNumber(a))a=a.rowIndex;if(!this.ds)return null;if(a<0||a>=this.ds.getCount())return null;
b=b!==undefined?b:0;var d=this.getRow(a),e=this.cm,g=e.getColumnCount(),h;if(!(c===false&&b===0)){for(;b<g&&e.isHidden(b);)b++;h=this.getCell(a,b)}return{row:d,cell:h}},getResolvedXY:function(a){if(!a)return null;var b=a.cell;a=a.row;return b?Ext.fly(b).getXY():[this.el.getX(),Ext.fly(a).getY()]},syncFocusEl:function(a,b,c){var d=a;if(!Ext.isArray(d)){a=Math.min(a,Math.max(0,this.getRows().length-1));if(isNaN(a))return;d=this.getResolvedXY(this.resolveCell(a,b,c))}this.focusEl.setXY(d||this.scroller.getXY())},
ensureVisible:function(a,b,c){a=this.resolveCell(a,b,c);if(!a||!a.row)return null;var d=a.row,e=a.cell;b=this.scroller.dom;for(var g=d,h=0,i=this.el.dom;g&&g!=i;){h+=g.offsetTop;g=g.offsetParent}h-=this.mainHd.dom.offsetHeight;i=parseInt(b.scrollTop,10);d=h+d.offsetHeight;g=b.clientHeight;var j=i+g;if(h<i)b.scrollTop=h;else if(d>j)b.scrollTop=d-g;if(c!==false){c=parseInt(e.offsetLeft,10);e=c+e.offsetWidth;h=parseInt(b.scrollLeft,10);i=h+b.clientWidth;if(c<h)b.scrollLeft=c;else if(e>i)b.scrollLeft=
e-b.clientWidth}return this.getResolvedXY(a)},insertRows:function(a,b,c,d){a=a.getCount()-1;if(!d&&b===0&&c>=a){this.fireEvent("beforerowsinserted",this,b,c);this.refresh();this.fireEvent("rowsinserted",this,b,c)}else{d||this.fireEvent("beforerowsinserted",this,b,c);var e=this.renderRows(b,c),g=this.getRow(b);if(g){b===0&&Ext.fly(this.getRow(0)).removeClass(this.firstRowCls);Ext.DomHelper.insertHtml("beforeBegin",g,e)}else{(g=this.getRow(a-1))&&Ext.fly(g).removeClass(this.lastRowCls);Ext.DomHelper.insertHtml("beforeEnd",
this.mainBody.dom,e)}if(d){if(b===0||b>=a)Ext.fly(this.getRow(b)).addClass(b===0?this.firstRowCls:this.lastRowCls)}else{this.processRows(b);this.fireEvent("rowsinserted",this,b,c)}}this.syncFocusEl(b)},deleteRows:function(a,b,c){if(a.getRowCount()<1)this.refresh();else{this.fireEvent("beforerowsdeleted",this,b,c);this.removeRows(b,c);this.processRows(b);this.fireEvent("rowsdeleted",this,b,c)}},getColumnStyle:function(a,b){var c=this.cm,d=c.config,e=b?"":d[a].css||"";d=d[a].align;e+=String.format("width: {0};",
this.getColumnWidth(a));if(c.isHidden(a))e+="display: none; ";if(d)e+=String.format("text-align: {0};",d);return e},getColumnWidth:function(a){a=this.cm.getColumnWidth(a);var b=this.borderWidth;return Ext.isNumber(a)?Ext.isBorderBox?a+"px":Math.max(a-b,0)+"px":a},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(a,b,c){var d=this.grid;b=this.cm;var e=b.getTotalWidth(false),g=this.getGridInnerWidth(),h=g-e;e=[];var i=0,j=0,k,m;if(g<20||h===0)return false;h=b.getColumnCount(true);
var p=b.getColumnCount(false),o=h-(Ext.isNumber(c)?1:0);if(o===0){o=1;c=undefined}for(m=0;m<p;m++)if(!b.isFixed(m)&&m!==c){k=b.getColumnWidth(m);e.push(m,k);if(!b.isHidden(m)){i=m;j+=k}}for(j=(g-b.getTotalWidth())/j;e.length;){k=e.pop();m=e.pop();b.setColumnWidth(m,Math.max(d.minColumnWidth,Math.floor(k+k*j)),true)}e=b.getTotalWidth(false);if(e>g){c=o==h?i:c;g=Math.max(1,b.getColumnWidth(c)-(e-g));b.setColumnWidth(c,g,true)}a!==true&&this.updateAllColumnWidths();return true},autoExpand:function(a){var b=
this.grid,c=this.cm,d=this.getGridInnerWidth(),e=c.getTotalWidth(false),g=b.autoExpandColumn;if(!this.userResized&&g)if(d!=e){g=c.getIndexById(g);var h=c.getColumnWidth(g);b=Math.min(Math.max(d-e+h,b.autoExpandMin),b.autoExpandMax);if(h!=b){c.setColumnWidth(g,b,true);a!==true&&this.updateColumnWidth(g,b)}}},getGridInnerWidth:function(){return this.grid.getGridEl().getWidth(true)-this.getScrollOffset()},getColumnData:function(){var a=[],b=this.cm,c=b.getColumnCount(),d=this.ds.fields,e,g;for(e=0;e<
c;e++){g=b.getDataIndex(e);a[e]={name:Ext.isDefined(g)?g:d.get(e)?d.get(e).name:undefined,renderer:b.getRenderer(e),scope:b.getRendererScope(e),id:b.getColumnId(e),style:this.getColumnStyle(e)}}return a},renderRows:function(a,b){var c=this.grid,d=c.store,e=c.stripeRows;c=c.colModel.getColumnCount();var g=d.getCount();if(g<1)return"";a=a||0;b=Ext.isDefined(b)?b:g-1;g=d.getRange(a,b);return this.doRender(this.getColumnData(),g,d,a,c,e)},renderBody:function(){return this.templates.body.apply({rows:this.renderRows()||
"&#160;"})},refreshRow:function(a){var b=this.ds,c=this.cm.getColumnCount(),d=this.getColumnData(),e=c-1,g=["x-grid3-row"],h={tstyle:String.format("width: {0};",this.getTotalWidth())},i=[],j=this.templates.cell,k,m,p,o;if(Ext.isNumber(a)){k=a;a=b.getAt(k)}else k=b.indexOf(a);if(!(!a||k<0)){for(o=0;o<c;o++){m=d[o];p=o==0?"x-grid3-cell-first":o==e?"x-grid3-cell-last ":"";p={id:m.id,style:m.style,css:p,attr:"",cellAttr:""};p.value=m.renderer.call(m.scope,a.data[m.name],p,a,k,o,b);if(Ext.isEmpty(p.value))p.value=
"&#160;";if(this.markDirty&&a.dirty&&typeof a.modified[m.name]!="undefined")p.css+=" x-grid3-dirty-cell";i[o]=j.apply(p)}d=this.getRow(k);d.className="";this.grid.stripeRows&&(k+1)%2===0&&g.push("x-grid3-row-alt");if(this.getRowClass){h.cols=c;g.push(this.getRowClass(a,k,h,b))}this.fly(d).addClass(g).setStyle(h.tstyle);h.cells=i.join("");d.innerHTML=this.templates.rowInner.apply(h);this.fireEvent("rowupdated",this,k,a)}},refresh:function(a){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);
this.mainBody.update(this.renderBody()).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){if(!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);b!=-1&&this.updateSortIcon(b,a.direction)}},clearHeaderSortState:function(){if(this.sortState){this.grid.fireEvent("sortchange",this.grid,null);this.mainHd.select("td").removeClass(this.sortClasses);delete this.sortState}},destroy:function(){var a=this.grid,b=a.getGridEl(),c=this.dragZone,d=this.splitZone,e=this.columnDrag,g=this.columnDrop,h=this.scrollToTopTask,i;h&&h.cancel&&h.cancel();
Ext.destroyMembers(this,"colMenu","hmenu");this.initData(null,null);this.purgeListeners();Ext.fly(this.innerHd).un("click",this.handleHdDown,this);if(a.enableColumnMove){h=e.dragData;i=e.proxy;Ext.destroy(e.el,i.ghost,i.el,g.el,g.proxyTop,g.proxyBottom,h.ddel,h.header);i.anim&&Ext.destroy(i.anim);delete i.ghost;delete h.ddel;delete h.header;e.destroy();delete Ext.dd.DDM.locationCache[e.id];delete e._domRef;delete g.proxyTop;delete g.proxyBottom;g.destroy();delete Ext.dd.DDM.locationCache["gridHeader"+
b.id];delete g._domRef;delete Ext.dd.DDM.ids[g.ddGroup]}if(d){d.destroy();delete d._domRef;delete Ext.dd.DDM.ids["gridSplitters"+b.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._flyweight,c,d);delete a.container;c&&c.destroy();Ext.dd.DDM.currentTarget=null;delete Ext.dd.DDM.locationCache[b.id];Ext.EventManager.removeResizeListener(this.onWindowResize,
this)},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var a=this.grid.ownerCt;a&&a.getLayout()&&a.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders();this.updateHeaderSortState()},this,{single:true})}else if(this.forceFit)this.fitColumns(true,false);else this.grid.autoExpandColumn&&this.autoExpand(true);this.grid.getGridEl().dom.innerHTML=this.renderUI();this.afterRenderUI()},initData:function(a,b){if(this.ds){var c=this.ds;c.un("add",this.onAdd,this);c.un("load",
this.onLoad,this);c.un("clear",this.onClear,this);c.un("remove",this.onRemove,this);c.un("update",this.onUpdate,this);c.un("datachanged",this.onDataChange,this);c!==a&&c.autoDestroy&&c.destroy()}a&&a.on({scope:this,load:this.onLoad,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.onClear,datachanged:this.onDataChange});if(this.cm){c=this.cm;c.un("configchange",this.onColConfigChange,this);c.un("widthchange",this.onColWidthChange,this);c.un("headerchange",this.onHeaderChange,this);
c.un("hiddenchange",this.onHiddenChange,this);c.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.ds=a;this.cm=b},onDataChange:function(){this.refresh(true);this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(a,b){this.refreshRow(b)},
onAdd:function(a,b,c){this.insertRows(a,c,c+(b.length-1))},onRemove:function(a,b,c,d){d!==true&&this.fireEvent("beforerowremoved",this,c,b);this.removeRow(c);if(d!==true){this.processRows(c);this.applyEmptyText();this.fireEvent("rowremoved",this,c,b)}},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(a,b,c){this.updateColumnWidth(b,c)},onHeaderChange:function(){this.updateHeaders()},
onHiddenChange:function(a,b,c){this.updateColumnHidden(b,c)},onColumnMove:function(a,b,c){this.indexMap=null;this.refresh(true);this.restoreScroll(this.getScrollState());this.afterMove(c);this.grid.fireEvent("columnmove",b,c)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(a){a.on("headerclick",this.onHeaderClick,this)},initEvents:Ext.emptyFn,onHeaderClick:function(a,b){if(!(this.headersDisabled||!this.cm.isSortable(b))){a.stopEditing(true);
a.store.sort(this.cm.getDataIndex(b))}},onRowOver:function(a,b){var c=this.findRowIndex(b);c!==false&&this.addRowClass(c,this.rowOverCls)},onRowOut:function(a,b){var c=this.findRowIndex(b);c!==false&&!a.within(this.getRow(c),true)&&this.removeRowClass(c,this.rowOverCls)},onRowSelect:function(a){this.addRowClass(a,this.selectedRowClass)},onRowDeselect:function(a){this.removeRowClass(a,this.selectedRowClass)},onCellSelect:function(a,b){var c=this.getCell(a,b);c&&this.fly(c).addClass("x-grid3-cell-selected")},
onCellDeselect:function(a,b){var c=this.getCell(a,b);c&&this.fly(c).removeClass("x-grid3-cell-selected")},handleWheel:function(a){a.stopPropagation()},onColumnSplitterMoved:function(a,b){this.userResized=true;this.grid.colModel.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)},beforeColMenuShow:function(){var a=this.cm,b=a.getColumnCount(),c=this.colMenu,
d;c.removeAll();for(d=0;d<b;d++)a.config[d].hideable!==false&&c.add(new Ext.menu.CheckItem({text:a.getColumnHeader(d),itemId:"col-"+a.getColumnId(d),checked:!a.isHidden(d),disabled:a.config[d].hideable===false,hideOnClick:false}))},handleHdMenuClick:function(a){var b=this.ds,c=this.cm.getDataIndex(this.hdCtxIndex);switch(a.getItemId()){case "asc":b.sort(c,"ASC");break;case "desc":b.sort(c,"DESC");break;default:this.handleHdMenuClickDefault(a)}return true},handleHdMenuClickDefault:function(a){var b=
this.cm,c=a.getItemId();c=b.getIndexById(c.substr(4));if(c!=-1)a.checked&&b.getColumnsBy(this.isHideableColumn,this).length<=1?this.onDenyColumnHide():b.setHidden(c,a.checked)},handleHdDown:function(a,b){if(Ext.fly(b).hasClass("x-grid3-hd-btn")){a.stopEvent();var c=this.cm,d=this.findHeaderCell(b),e=this.getCellIndex(d);c=c.isSortable(e);var g=this.hmenu,h=g.items,i=this.headerMenuOpenCls;this.hdCtxIndex=e;Ext.fly(d).addClass(i);if(this.hideSortIcons){h.get("asc").setVisible(c);h.get("desc").setVisible(c);
(e=h.get("sortSep"))&&e.setVisible(c)}else{h.get("asc").setDisabled(!c);h.get("desc").setDisabled(!c)}g.on("hide",function(){Ext.fly(d).removeClass(i)},this,{single:true});g.show(b,"tl-bl?")}},handleHdMove:function(a){var b=this.findHeaderCell(this.activeHdRef);if(b&&!this.headersDisabled){var c=this.splitHandleWidth||5,d=this.activeHdRegion;b=b.style;var e=this.cm,g="";a=a.getPageX();if(this.grid.enableColumnResize!==false){var h=this.activeHdIndex,i=this.getPreviousVisible(h);h=e.isResizable(h);
e=i&&e.isResizable(i);i=d.right-a<=(!this.activeHdBtn?c:2);if(a-d.left<=c&&e)g=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize";else if(i&&h)g=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize"}b.cursor=g}},getPreviousVisible:function(a){for(;a>0;){if(!this.cm.isHidden(a-1))return a;a--}},handleHdOver:function(a,b){var c=this.findHeaderCell(b);if(c&&!this.headersDisabled){var d=this.fly(c);this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(c);this.activeHdRegion=d.getRegion();if(!this.isMenuDisabled(this.activeHdIndex,
d)){d.addClass("x-grid3-hd-over");if(this.activeHdBtn=d.child(".x-grid3-hd-btn"))this.activeHdBtn.dom.style.height=c.firstChild.offsetHeight-1+"px"}}},handleHdOut:function(a,b){var c=this.findHeaderCell(b);if(c&&(!Ext.isIE9m||!a.within(c,true))){this.activeHdRef=null;this.fly(c).removeClass("x-grid3-hd-over");c.style.cursor=""}},isMenuDisabled:function(a){return this.cm.isMenuDisabled(a)},hasRows:function(){var a=this.mainBody.dom.firstChild;return a&&a.nodeType==1&&a.className!="x-grid-empty"},isHideableColumn:function(a){return!a.hidden},
bind:function(a,b){this.initData(a,b)}});
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,b){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);c=this.cm.getColumnWidth(this.cellIndex);c=Math.max(c-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1E3);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1E3;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,b)},allowHeaderDrag:function(){return true},handleMouseDown:function(a){var b=
this.view.findHeaderCell(a.getTarget());if(b&&this.allowHeaderDrag(a)){var c=this.view.fly(b).getXY()[0],d=a.getXY()[0],e=b.offsetWidth,g=false;if(d-c<=this.hw)g=-1;else if(c+e-d<=this.hw)g=0;if(g!==false){this.cm=this.grid.colModel;c=this.view.getCellIndex(b);if(g==-1){if(c+g<0)return;for(;this.cm.isHidden(c+g);){--g;if(c+g<0)return}}this.cellIndex=c+g;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(a)}},endDrag:function(a){this.marker.hide();var b=this.view;a=Math.max(this.minX,a.getPageX())-this.startPos;var c=this.dragHeadersDisabled;b.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+a);setTimeout(function(){b.headersDisabled=c},50)},autoOffset:function(){this.setDelta(0,0)}});
Ext.grid.PivotGridView=Ext.extend(Ext.grid.GridView,{colHeaderCellCls:"grid-hd-group-cell",title:"",getColumnHeaders:function(){return this.grid.topAxis.buildHeaders()},getRowHeaders:function(){return this.grid.leftAxis.buildHeaders()},renderRows:function(a,b){var c=this.grid,d=c.extractData(),e=d.length,g=this.templates;c=c.renderer;var h=typeof c=="function",i=this.getCellCls,j=typeof i=="function",k=g.cell;g=g.row;var m=[],p={},o="width:"+this.getGridInnerWidth()+"px;",s,l,n,r;Ext.isDefined(b);
for(n=0;n<e;n++){r=d[n];l=r.length;s=[];for(var q=0;q<l;q++){p.id=n+"-"+q;p.css=q===0?"x-grid3-cell-first ":q==l-1?"x-grid3-cell-last ":"";p.attr=p.cellAttr="";p.value=r[q];if(Ext.isEmpty(p.value))p.value="&#160;";if(h)p.value=c(p.value);if(j)p.css+=i(p.value)+" ";s[s.length]=k.apply(p)}m[m.length]=g.apply({tstyle:o,cols:l,cells:s.join(""),alt:""})}return m.join("")},masterTpl:new Ext.Template('<div class="x-grid3 x-pivotgrid" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header">',
'<div class="x-grid3-header-title"><span>{title}</span></div>','<div class="x-grid3-header-inner">','<div class="x-grid3-header-offset" style="{ostyle}"></div>',"</div>",'<div class="x-clear"></div>',"</div>",'<div class="x-grid3-scroller">','<div class="x-grid3-row-headers"></div>','<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>"),initTemplates:function(){Ext.grid.PivotGridView.superclass.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell)a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} '+this.colHeaderCellCls+'" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id} x-unselectable" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}","</div>","</td>");this.templates=
a;this.hrowRe=/ux-grid-hd-group-row-(\d+)/},initElements:function(){Ext.grid.PivotGridView.superclass.initElements.apply(this,arguments);this.rowHeadersEl=new Ext.Element(this.scroller.child("div.x-grid3-row-headers"));this.headerTitleEl=new Ext.Element(this.mainHd.child("div.x-grid3-header-title"))},getGridInnerWidth:function(){return Ext.grid.PivotGridView.superclass.getGridInnerWidth.apply(this,arguments)-this.getTotalRowHeaderWidth()},getTotalRowHeaderWidth:function(){var a=this.getRowHeaders(),
b=a.length,c=0,d;for(d=0;d<b;d++)c+=a[d].width;return c},getTotalColumnHeaderHeight:function(){return this.getColumnHeaders().length*21},getCellIndex:function(a){if(a){a=a.className.match(this.colRe);var b;if(a&&(b=a[1]))return parseInt(b.split("-")[1],10)}return false},renderUI:function(){var a=this.templates,b=this.getGridInnerWidth();return a.master.apply({body:a.body.apply({rows:"&#160;"}),ostyle:"width:"+b+"px",bstyle:"width:"+b+"px"})},onLayout:function(a){Ext.grid.PivotGridView.superclass.onLayout.apply(this,
arguments);a=this.getGridInnerWidth();this.resizeColumnHeaders(a);this.resizeAllRows(a)},refresh:function(a){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);this.mainBody.update(this.renderBody()).setWidth(this.getGridInnerWidth());if(a===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},renderHeaders:Ext.emptyFn,fitColumns:Ext.emptyFn,resizeColumnHeaders:function(a){var b=this.grid.topAxis;
b.rendered&&b.el.setWidth(a)},resizeRowHeaders:function(){var a=this.getTotalRowHeaderWidth(),b=String.format("margin-left: {0}px;",a);this.rowHeadersEl.setWidth(a);this.mainBody.applyStyles(b);Ext.fly(this.innerHd).applyStyles(b);this.headerTitleEl.setWidth(a);this.headerTitleEl.setHeight(this.getTotalColumnHeaderHeight())},resizeAllRows:function(a){var b=this.getRows(),c=b.length,d;for(d=0;d<c;d++){Ext.fly(b[d]).setWidth(a);Ext.fly(b[d]).child("table").setWidth(a)}},updateHeaders:function(){this.renderGroupRowHeaders();
this.renderGroupColumnHeaders()},renderGroupRowHeaders:function(){var a=this.grid.leftAxis;this.resizeRowHeaders();a.rendered=false;a.render(this.rowHeadersEl);this.setTitle(this.title)},setTitle:function(a){this.headerTitleEl.child("span").dom.innerHTML=a},renderGroupColumnHeaders:function(){var a=this.grid.topAxis;a.rendered=false;a.render(this.innerHd.firstChild)},isMenuDisabled:function(){return true}});
Ext.grid.PivotAxis=Ext.extend(Ext.Component,{orientation:"horizontal",defaultHeaderWidth:80,paddingWidth:7,setDimensions:function(a){this.dimensions=a},onRender:function(a){var b=this.orientation=="horizontal"?this.renderHorizontalRows():this.renderVerticalRows();this.el=Ext.DomHelper.overwrite(a.dom,{tag:"table",cn:b},true)},renderHorizontalRows:function(){var a=this.buildHeaders(),b=a.length,c=[],d,e,g,h,i;for(h=0;h<b;h++){d=[];e=a[h].items;g=e.length;for(i=0;i<g;i++)d.push({tag:"td",html:e[i].header,
colspan:e[i].span});c[h]={tag:"tr",cn:d}}return c},renderVerticalRows:function(){var a=this.buildHeaders(),b=a.length,c=[],d=[],e,g,h,i,j,k;for(j=0;j<b;j++){g=a[j];i=g.width||80;e=g.items.length;for(k=0;k<e;k++){h=g.items[k];c[h.start]=c[h.start]||[];c[h.start].push({tag:"td",html:h.header,rowspan:h.span,width:Ext.isBorderBox?i:i-this.paddingWidth})}}e=c.length;for(j=0;j<e;j++)d[j]={tag:"tr",cn:c[j]};return d},getTuples:function(){var a=new Ext.data.Store({});a.data=this.store.data.clone();a.fields=
this.store.fields;var b=[],c=this.dimensions,d=c.length,e;for(e=0;e<d;e++)b.push({field:c[e].dataIndex,direction:c[e].direction||"ASC"});a.sort(b);b=a.data.items;c=[];var g=[],h,i,j,k;d=b.length;for(e=0;e<d;e++){i=this.getRecordInfo(b[e]);j=i.data;h="";for(k in j)h+=j[k]+"---";if(c.indexOf(h)==-1){c.push(h);g.push(i)}}a.destroy();return g},getRecordInfo:function(a){var b=this.dimensions,c=b.length,d={},e,g;for(g=0;g<c;g++){e=b[g];e=e.dataIndex;d[e]=a.get(e)}return{data:d,matcher:function(h){return function(i){for(var j in h)if(i.get(j)!=
h[j])return false;return true}}(d)}},buildHeaders:function(){var a=this.getTuples(),b=a.length,c=this.dimensions,d,e=c.length,g=[],h,i,j,k,m,p,o,s,l,n;for(l=0;l<e;l++){d=c[l];i=[];for(n=p=m=0;n<b;n++){h=a[n];o=n==b-1;j=h.data[d.dataIndex];s=k!=undefined&&k!=j;if(l>0&&n>0)s=s||h.data[c[l-1].dataIndex]!=a[n-1].data[c[l-1].dataIndex];if(s){i.push({header:k,span:m,start:p});p+=m;m=0}if(o){i.push({header:j,span:m+1,start:p});p+=m;m=0}k=j;m++}g.push({items:i,width:d.width||this.defaultHeaderWidth});k=undefined}return g}});
Ext.grid.HeaderDragZone=Ext.extend(Ext.dd.DragZone,{maxDragWidth:120,constructor:function(a,b,c){this.grid=a;this.view=a.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,b);if(c){this.setHandleElId(Ext.id(b));this.setOuterHandleElId(Ext.id(c))}this.scroll=false},getDragData:function(a){if(a=this.view.findHeaderCell(Ext.lib.Event.getTarget(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 a=this.view,b=this.dragHeadersDisabled;setTimeout(function(){a.headersDisabled=b},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(a){a=this.view.findCellIndex(Ext.lib.Event.getTarget(a));if(a!==false)return this.view.getHeaderCell(a)},nextVisible:function(a){var b=this.view,c=this.grid.colModel;for(a=a.nextSibling;a;){if(!c.isHidden(b.getCellIndex(a)))return a;a=a.nextSibling}return null},prevVisible:function(a){var b=this.view,c=this.grid.colModel;for(a=a.prevSibling;a;){if(!c.isHidden(b.getCellIndex(a)))return a;a=a.prevSibling}return null},
positionIndicator:function(a,b,c){c=Ext.lib.Event.getPageX(c);var d=Ext.lib.Dom.getRegion(b.firstChild);a=d.top+this.proxyOffsets[1];if(d.right-c<=(d.right-d.left)/2){c=d.right+this.view.borderWidth;d="after"}else{c=d.left;d="before"}if(this.grid.colModel.isFixed(this.view.getCellIndex(b)))return false;c+=this.proxyOffsets[0];this.proxyTop.setLeftTop(c,a);this.proxyTop.show();if(!this.bottomOffset)this.bottomOffset=this.view.mainHd.getHeight();this.proxyBottom.setLeftTop(c,a+this.proxyTop.dom.offsetHeight+
this.bottomOffset);this.proxyBottom.show();return d},onNodeEnter:function(a,b,c,d){d.header!=a&&this.positionIndicator(d.header,a,c)},onNodeOver:function(a,b,c,d){b=false;if(d.header!=a)b=this.positionIndicator(d.header,a,c);if(!b){this.proxyTop.hide();this.proxyBottom.hide()}return b?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(a,b,c,d){d=d.header;if(d!=a){b=this.grid.colModel;c=Ext.lib.Event.getPageX(c);var e=Ext.lib.Dom.getRegion(a.firstChild);
c=e.right-c<=(e.right-e.left)/2?"after":"before";d=this.view.getCellIndex(d);a=this.view.getCellIndex(a);c=="after"&&a++;d<a&&a--;b.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,b){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());
var c=this.cm.getColumnWidth(this.cellIndex);c=Math.max(c-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(c,1E3);this.setYConstraint(0,0);this.minX=a-c;this.maxX=a+1E3;this.startPos=a;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,a,b)},handleMouseDown:function(a){var b=this.fly(Ext.EventObject.setEvent(a).getTarget());if(b.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(b.dom);this.split=b.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(a){this.view.headersDisabled=false;a=Math.max(this.minX,Ext.lib.Event.getPageX(a))-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";this.preventDefault=true};
Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(a){var b=Ext.lib.Event.getTarget(a),c,d=this.view.findRowIndex(b),e;if(d!==false){c=this.grid.selModel;if(c.getSelectedCell){b=this.view.findCellIndex(b);e=c.getSelectedCell();if(!e||e[0]!==d||e[1]!==b)c.handleMouseDown(this.grid,d,b,a);if(this.grid.dragCell){a=c.getSelectedCell();if(!this.grid.hasOwnProperty("ddText"))this.grid.ddText="{0} selected cell{1}"}else a=[this.grid.store.getAt(d)]}else{if(!c.isSelected(d)||
a.hasModifier())c.handleMouseDown(this.grid,d,a);a=c.getSelections()}return{grid:this.grid,ddel:this.ddel,rowIndex:d,selections:a}}return false},onInitDrag:function(){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(a,b){var c,d,e;if(!b){delete this.totalWidth;
c=0;for(e=this.config.length;c<e;c++){d=this.config[c];d.setEditor&&d.setEditor(null)}}this.defaults=Ext.apply({width:this.defaultWidth,sortable:this.defaultSortable},this.defaults);this.config=a;this.lookup={};c=0;for(e=a.length;c<e;c++){d=Ext.applyIf(a[c],this.defaults);if(Ext.isEmpty(d.id))d.id=c;if(!d.isColumn){d=new Ext.grid.Column.types[d.xtype||"gridcolumn"](d);a[c]=d}this.lookup[d.id]=d}b||this.fireEvent("configchange",this)},getColumnById:function(a){return this.lookup[a]},getIndexById:function(a){for(var b=
0,c=this.config.length;b<c;b++)if(this.config[b].id==a)return b;return-1},moveColumn:function(a,b){var c=this.config,d=c[a];c.splice(a,1);c.splice(b,0,d);this.dataMap=null;this.fireEvent("columnmoved",this,a,b)},getColumnCount:function(a){var b=this.config.length,c=0;if(a===true){for(a=0;a<b;a++)this.isHidden(a)||c++;return c}return b},getColumnsBy:function(a,b){var c=this.config,d=c.length,e=[],g,h;for(g=0;g<d;g++){h=c[g];if(a.call(b||this,h,g)===true)e[e.length]=h}return e},isSortable:function(a){return!!this.config[a].sortable},
isMenuDisabled:function(a){return!!this.config[a].menuDisabled},getRenderer:function(a){return this.config[a].renderer||Ext.grid.ColumnModel.defaultRenderer},getRendererScope:function(a){return this.config[a].scope},setRenderer:function(a,b){this.config[a].renderer=b},getColumnWidth:function(a){a=this.config[a].width;if(typeof a!="number")a=this.defaultWidth;return a},setColumnWidth:function(a,b,c){this.config[a].width=b;this.totalWidth=null;c||this.fireEvent("widthchange",this,a,b)},getTotalWidth:function(a){if(!this.totalWidth)for(var b=
this.totalWidth=0,c=this.config.length;b<c;b++)if(a||!this.isHidden(b))this.totalWidth+=this.getColumnWidth(b);return this.totalWidth},getColumnHeader:function(a){return this.config[a].header},setColumnHeader:function(a,b){this.config[a].header=b;this.fireEvent("headerchange",this,a,b)},getColumnTooltip:function(a){return this.config[a].tooltip},setColumnTooltip:function(a,b){this.config[a].tooltip=b},getDataIndex:function(a){return this.config[a].dataIndex},setDataIndex:function(a,b){this.config[a].dataIndex=
b},findColumnIndex:function(a){for(var b=this.config,c=0,d=b.length;c<d;c++)if(b[c].dataIndex==a)return c;return-1},isCellEditable:function(a){a=this.config[a];var b=a.editable;return!!(b||!Ext.isDefined(b)&&a.editor)},getCellEditor:function(a,b){return this.config[a].getCellEditor(b)},setEditable:function(a,b){this.config[a].editable=b},isHidden:function(a){return!!this.config[a].hidden},isFixed:function(a){return!!this.config[a].fixed},isResizable:function(a){return a>=0&&this.config[a].resizable!==
false&&this.config[a].fixed!==true},setHidden:function(a,b){var c=this.config[a];if(c.hidden!==b){c.hidden=b;this.totalWidth=null;this.fireEvent("hiddenchange",this,a,b)}},setEditor:function(a,b){this.config[a].setEditor(b)},destroy:function(){for(var a=this.config.length,b=0;b<a;b++)this.config[b].destroy();delete this.config;delete this.lookup;this.purgeListeners()},setState:function(a,b){b=Ext.applyIf(b,this.defaults);Ext.apply(this.config[a],b)}});
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 a=this.grid;if(a){a=a.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(b){return b.id});this.lastActive=this.last=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:this.onKeyPress,down:this.onKeyPress,scope:this});this.grid.getView().on({scope:this,refresh:this.onRefresh,rowupdated:this.onRowUpdated,rowremoved:this.onRemove})},onKeyPress:function(a,b){var c=b=="up",d=c?"selectPrevious":"selectNext";c=c?-1:1;if(!a.shiftKey||this.singleSelect)this[d](false);else if(this.last!==false&&this.lastActive!==false){d=this.last;this.selectRange(this.last,this.lastActive+c);this.grid.getView().focusRow(this.lastActive);
if(d!==false)this.last=d}else this.selectFirstRow()},onRefresh:function(){var a=this.grid.store,b=this.getSelections(),c=0,d=b.length,e;this.silent=true;for(this.clearSelections(true);c<d;c++){e=b[c];if((e=a.indexOfId(e.id))!=-1)this.selectRow(e,true)}b.length!=this.selections.getCount()&&this.fireEvent("selectionchange",this);this.silent=false},onRemove:function(a,b,c){this.selections.remove(c)!==false&&this.fireEvent("selectionchange",this)},onRowUpdated:function(a,b,c){this.isSelected(c)&&a.onRowSelect(b)},
selectRecords:function(a,b){b||this.clearSelections();for(var c=this.grid.store,d=0,e=a.length;d<e;d++)this.selectRow(c.indexOf(a[d]),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(a,b){for(var c=this.getSelections(),d=0,e=c.length;d<e;d++)if(a.call(b||this,c[d],d)===false)return false;return true},clearSelections:function(a){if(!this.isLocked()){if(a!==
true){var b=this.grid.store;a=this.selections;a.each(function(c){this.deselectRow(b.indexOfId(c.id))},this);a.clear()}else this.selections.clear();this.last=false}},selectAll:function(){if(!this.isLocked()){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){return(a=Ext.isNumber(a)?this.grid.store.getAt(a):a)&&this.selections.key(a.id)?true:false},isIdSelected:function(a){return this.selections.key(a)?
true:false},handleMouseDown:function(a,b,c){if(!(c.button!==0||this.isLocked())){a=this.grid.getView();if(c.shiftKey&&!this.singleSelect&&this.last!==false){var d=this.last;this.selectRange(d,b,c.ctrlKey);this.last=d;a.focusRow(b)}else{d=this.isSelected(b);if(c.ctrlKey&&d)this.deselectRow(b);else if(!d||this.getCount()>1){this.selectRow(b,c.ctrlKey||c.shiftKey);a.focusRow(b)}}}},selectRows:function(a,b){b||this.clearSelections();for(var c=0,d=a.length;c<d;c++)this.selectRow(a[c],true)},selectRange:function(a,
b,c){if(!this.isLocked()){c||this.clearSelections();if(a<=b)for(a=a;a<=b;a++)this.selectRow(a,true);else for(a=a;a>=b;a--)this.selectRow(a,true)}},deselectRange:function(a,b,c){if(!this.isLocked())for(a=a;a<=b;a++)this.deselectRow(a,c)},selectRow:function(a,b,c){if(!(this.isLocked()||a<0||a>=this.grid.store.getCount()||b&&this.isSelected(a))){var d=this.grid.store.getAt(a);if(d&&this.fireEvent("beforerowselect",this,a,b,d)!==false){if(!b||this.singleSelect)this.clearSelections();this.selections.add(d);
this.last=this.lastActive=a;c||this.grid.getView().onRowSelect(a);if(!this.silent){this.fireEvent("rowselect",this,a,d);this.fireEvent("selectionchange",this)}}}},deselectRow:function(a,b){if(!this.isLocked()){if(this.last==a)this.last=false;if(this.lastActive==a)this.lastActive=false;var c=this.grid.store.getAt(a);if(c){this.selections.remove(c);b||this.grid.getView().onRowDeselect(a);this.fireEvent("rowdeselect",this,a,c);this.fireEvent("selectionchange",this)}}},acceptsNav:function(a,b,c){return!c.isHidden(b)&&
c.isCellEditable(b,a)},onEditorKey:function(a,b){var c=b.getKey(),d,e=this.grid,g=e.lastEdit,h=e.activeEditor,i=b.shiftKey;if(c==b.TAB){b.stopEvent();h.completeEdit();d=i?e.walkCells(h.row,h.col-1,-1,this.acceptsNav,this):e.walkCells(h.row,h.col+1,1,this.acceptsNav,this)}else if(c==b.ENTER)if(this.moveEditorOnEnter!==false)d=i?e.walkCells(g.row-1,g.col,-1,this.acceptsNav,this):e.walkCells(g.row+1,g.col,1,this.acceptsNav,this);if(d){c=d[0];d=d[1];this.onEditorSelect(c,g.row);if(e.isEditor&&e.editing)(g=
e.activeEditor)&&g.field.triggerBlur&&g.field.triggerBlur();e.startEditing(c,d)}},onEditorSelect:function(a,b){b!=a&&this.selectRow(a)},destroy:function(){Ext.destroy(this.rowNav);this.rowNav=null;Ext.grid.RowSelectionModel.superclass.destroy.call(this)}});
Ext.grid.Column=Ext.extend(Ext.util.Observable,{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;a=this.editor;delete this.editor;this.setEditor(a);this.addEvents("click","contextmenu","dblclick","mousedown");Ext.grid.Column.superclass.constructor.call(this)},processEvent:function(a,b,c,
d){return this.fireEvent(a,this,c,d,b)},destroy:function(){this.setEditor&&this.setEditor(null);this.purgeListeners()},renderer:function(a){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){a.isXType||(a=Ext.create(a,"textfield"));this.editor=a}},getCellEditor:function(a){if(a=this.getEditor(a))if(!a.startEdit){if(!a.gridEditor)a.gridEditor=
new Ext.grid.GridEditor(a);a=a.gridEditor}return a}});Ext.grid.BooleanColumn=Ext.extend(Ext.grid.Column,{trueText:"true",falseText:"false",undefinedText:"&#160;",constructor:function(a){Ext.grid.BooleanColumn.superclass.constructor.call(this,a);var b=this.trueText,c=this.falseText,d=this.undefinedText;this.renderer=function(e){if(e===undefined)return d;if(!e||e==="false")return c;return b}}});
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(a){Ext.grid.TemplateColumn.superclass.constructor.call(this,a);var b=!Ext.isPrimitive(this.tpl)&&this.tpl.compile?this.tpl:new Ext.XTemplate(this.tpl);this.renderer=function(c,d,e){return b.apply(e.data)};this.tpl=b}});
Ext.grid.ActionColumn=Ext.extend(Ext.grid.Column,{header:"&#160;",actionIdRe:/x-action-col-(\d+)/,altText:"",constructor:function(a){var b=this,c=a.items||(b.items=[b]),d=c.length,e,g;Ext.grid.ActionColumn.superclass.constructor.call(b,a);b.renderer=function(h,i){h=Ext.isFunction(a.renderer)?a.renderer.apply(this,arguments)||"":"";i.css+=" x-action-col-cell";for(e=0;e<d;e++){g=c[e];h+='<img alt="'+(g.altText||b.altText)+'" src="'+(g.icon||Ext.BLANK_IMAGE_URL)+'" class="x-action-col-icon x-action-col-'+
String(e)+" "+(g.iconCls||"")+" "+(Ext.isFunction(g.getClass)?g.getClass.apply(g.scope||this.scope||this,arguments):"")+'"'+(g.tooltip?' ext:qtip="'+g.tooltip+'"':"")+" />"}return h}},destroy:function(){delete this.items;delete this.renderer;return Ext.grid.ActionColumn.superclass.destroy.apply(this,arguments)},processEvent:function(a,b,c,d,e){var g=b.getTarget().className.match(this.actionIdRe),h,i;if(g&&(h=this.items[parseInt(g[1],10)]))if(a=="click")(i=h.handler||this.handler)&&i.call(h.scope||
this.scope||this,c,d,e,h,b);else if(a=="mousedown"&&h.stopSelection!==false)return false;return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}});Ext.grid.Column.types={gridcolumn:Ext.grid.Column,booleancolumn:Ext.grid.BooleanColumn,numbercolumn:Ext.grid.NumberColumn,datecolumn:Ext.grid.DateColumn,templatecolumn:Ext.grid.TemplateColumn,actioncolumn:Ext.grid.ActionColumn};
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(a,b,c,d){if(this.rowspan)b.cellAttr='rowspan="'+this.rowspan+'"';return d+1}});
Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,hideable:false,dataIndex:"",id:"checker",isColumn:true,constructor:function(){Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this,arguments);if(this.checkOnly)this.handleMouseDown=Ext.emptyFn},initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){Ext.fly(this.grid.getView().innerHd).on("mousedown",
this.onHdMouseDown,this)},this)},processEvent:function(a,b){if(a=="mousedown"){this.onMouseDown(b,b.getTarget());return false}else return Ext.grid.Column.prototype.processEvent.apply(this,arguments)},onMouseDown:function(a,b){if(a.button===0&&b.className=="x-grid3-row-checker"){a.stopEvent();var c=a.getTarget(".x-grid3-row");if(c){c=c.rowIndex;if(this.isSelected(c))this.deselectRow(c);else{this.selectRow(c,true);this.grid.getView().focusRow(c)}}}},onHdMouseDown:function(a,b){if(b.className=="x-grid3-hd-checker"){a.stopEvent();
var c=Ext.fly(b.parentNode);if(c.hasClass("x-grid3-hd-checker-on")){c.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{c.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(){return'<div class="x-grid3-row-checker">&#160;</div>'},onEditorSelect:function(a,b){b!=a&&!this.checkOnly&&this.selectRow(a)}});
Ext.grid.CellSelectionModel=Ext.extend(Ext.grid.AbstractSelectionModel,{constructor:function(a){Ext.apply(this,a);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)},initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.on(Ext.EventManager.getKeyEvent(),this.handleKeyDown,this);this.grid.getView().on({scope:this,refresh:this.onViewChange,rowupdated:this.onRowUpdated,beforerowremoved:this.clearSelections,
beforerowsinserted:this.clearSelections});this.grid.isEditor&&this.grid.on("beforeedit",this.beforeEdit,this)},beforeEdit:function(a){this.select(a.row,a.column,false,true,a.record)},onRowUpdated:function(a,b,c){this.selection&&this.selection.record==c&&a.onCellSelect(b,this.selection.cell[1])},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(a){var b=this.selection;if(b){a!==true&&this.grid.view.onCellDeselect(b.cell[0],
b.cell[1]);this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(a,b,c,d){d.button!==0||this.isLocked()||this.select(b,c)},select:function(a,b,c,d,e){if(this.fireEvent("beforecellselect",this,a,b)!==false){this.clearSelections();e=e||this.grid.store.getAt(a);this.selection={record:e,cell:[a,b]};if(!c){c=this.grid.getView();c.onCellSelect(a,b);d!==true&&c.focusCell(a,b)}this.fireEvent("cellselect",this,a,
b);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(a,b,c){return!c.isHidden(b)},onEditorKey:function(a,b){b.getKey()==b.TAB&&this.handleKeyDown(b)},handleKeyDown:function(a){if(a.isNavKeyPress()){var b=a.getKey(),c=this.grid,d=this.selection,e=this,g=function(j,k,m){return c.walkCells(j,k,m,c.isEditor&&c.editing?e.acceptsNav:e.isSelectable,e)},h,i;switch(b){case a.ESC:case a.PAGE_UP:case a.PAGE_DOWN:break;default:a.stopEvent()}if(d){h=d.cell;d=h[0];h=h[1];switch(b){case a.TAB:i=
a.shiftKey?g(d,h-1,-1):g(d,h+1,1);break;case a.DOWN:i=g(d+1,h,1);break;case a.UP:i=g(d-1,h,-1);break;case a.RIGHT:i=g(d,h+1,1);break;case a.LEFT:i=g(d,h-1,-1);break;case a.ENTER:if(c.isEditor&&!c.editing){c.startEditing(d,h);return}}if(i){d=i[0];h=i[1];this.select(d,h);if(c.isEditor&&c.editing){(a=c.activeEditor)&&a.field.triggerBlur&&a.field.triggerBlur();c.startEditing(d,h)}}}else(h=g(0,0,1))&&this.select(h[0],h[1])}},acceptsNav:function(a,b,c){return!c.isHidden(b)&&c.isCellEditable(b,a)}});
Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,forceValidation:false,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel)this.selModel=new Ext.grid.CellSelectionModel;this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.getGridEl().on("mousewheel",
this.stopEditing.createDelegate(this,[true]),this);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1)this.on("cellclick",this.onCellDblClick,this);else{var a=this.getView();this.clicksToEdit=="auto"&&a.mainBody&&a.mainBody.on("mousedown",this.onAutoEditClick,this);this.on("celldblclick",this.onCellDblClick,this)}},onResize:function(){Ext.grid.EditorGridPanel.superclass.onResize.apply(this,arguments);var a=this.activeEditor;this.editing&&a&&a.realign(true)},onCellDblClick:function(a,
b,c){this.startEditing(b,c)},onAutoEditClick:function(a,b){if(a.button===0){var c=this.view.findRowIndex(b),d=this.view.findCellIndex(b);if(c!==false&&d!==false){this.stopEditing();if(this.selModel.getSelectedCell){var e=this.selModel.getSelectedCell();e&&e[0]===c&&e[1]===d&&this.startEditing(c,d)}else this.selModel.isSelected(c)&&this.startEditing(c,d)}}},onEditComplete:function(a,b,c){this.editing=false;this.lastActiveEditor=this.activeEditor;this.activeEditor=null;var d=a.record,e=this.colModel.getDataIndex(a.col);
b=this.postEditValue(b,c,d,e);if(this.forceValidation===true||String(b)!==String(c)){var g={grid:this,record:d,field:e,originalValue:c,value:b,row:a.row,column:a.col,cancel:false};if(this.fireEvent("validateedit",g)!==false&&!g.cancel&&String(b)!==String(c)){d.set(e,g.value);delete g.cancel;this.fireEvent("afteredit",g)}}this.view.focusCell(a.row,a.col)},startEditing:function(a,b){this.stopEditing();if(this.colModel.isCellEditable(b,a)){this.view.ensureVisible(a,b,true);var c=this.store.getAt(a),
d=this.colModel.getDataIndex(b),e={grid:this,record:c,field:d,value:c.data[d],row:a,column:b,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var g=this.colModel.getCellEditor(b,a);if(g){if(!g.rendered){g.parentEl=this.view.getEditorParent(g);g.on({scope:this,render:{fn:function(h){h.field.focus(false,true)},single:true,scope:this},specialkey:function(h,i){this.getSelectionModel().onEditorKey(h,i)},complete:this.onEditComplete,canceledit:this.stopEditing.createDelegate(this,
[true])})}Ext.apply(g,{row:a,col:b,record:c});this.lastEdit={row:a,col:b};this.activeEditor=g;if(g.field.isXType("checkbox")){g.allowBlur=false;this.setupCheckbox(g.field)}g.selectSameEditor=this.activeEditor==this.lastActiveEditor;c=this.preEditValue(c,d);g.startEdit(this.view.getCell(a,b).firstChild,Ext.isDefined(c)?c:"");(function(){delete g.selectSameEditor}).defer(50)}}}},setupCheckbox:function(a){var b=this,c=function(){a.el.on("click",b.onCheckClick,b,{single:true})};a.rendered?c():a.on("render",
c,null,{single:true})},onCheckClick:function(){var a=this.activeEditor;a.allowBlur=true;a.field.focus(false,10)},preEditValue:function(a,b){var c=a.data[b];return this.autoEncode&&Ext.isString(c)?Ext.util.Format.htmlDecode(c):c},postEditValue:function(a){return this.autoEncode&&Ext.isString(a)?Ext.util.Format.htmlEncode(a):a},stopEditing:function(a){if(this.editing){var b=this.lastActiveEditor=this.activeEditor;if(b){b[a===true?"cancelEdit":"completeEdit"]();this.view.focusCell(b.row,b.col)}this.activeEditor=
null}this.editing=false}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(a,b){Ext.grid.GridEditor.superclass.constructor.call(this,a,b);a.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);
Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);b&&this.setSource(b);Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(a){this.source=a;this.store.removeAll();var b=[],c;for(c in a)this.isEditableValue(a[c])&&b.push(new Ext.grid.PropertyRecord({name:c,value:a[c]},c));this.store.loadRecords({records:b},{},true)},onUpdate:function(a,
b,c){if(c==Ext.data.Record.EDIT){a=b.data.value;c=b.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,b.id,a,c)!==false){this.source[b.id]=a;b.commit();this.grid.fireEvent("propertychange",this.source,b.id,a,c)}else b.reject()}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(a,b,c){var d=this.getRec(a);if(d){d.set("value",b);this.source[a]=b}else if(c){this.source[a]=b;d=new Ext.grid.PropertyRecord({name:a,
value:b},a);this.store.add(d)}},remove:function(a){var b=this.getRec(a);if(b){this.store.remove(b);delete this.source[a]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});
Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(a,b){var c=Ext.grid,d=Ext.form;this.grid=a;c.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var e=new d.Field({autoCreate:{tag:"select",
children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new c.GridEditor(new d.DateField({selectOnFocus:true})),string:new c.GridEditor(new d.TextField({selectOnFocus:true})),number:new c.GridEditor(new d.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new c.GridEditor(e,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);
this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(a,b,c){var d=this.grid.customRenderers[c.get("name")];if(d)return d.apply(this,arguments);d=a;if(Ext.isDate(a))d=this.renderDate(a);
else if(typeof a=="boolean")d=this.renderBool(a);return Ext.util.Format.htmlEncode(d)},getPropertyName:function(a){var b=this.grid.propertyNames;return b&&b[a]?b[a]:a},getCellEditor:function(a,b){var c=this.store.getProperty(b),d=c.data.name;c=c.data.value;if(this.grid.customEditors[d])return this.grid.customEditors[d];return Ext.isDate(c)?this.editors.date:typeof c=="number"?this.editors.number:typeof c=="boolean"?this.editors["boolean"]:this.editors.string},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);
this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(a){for(var b in a)Ext.destroy(a[b])}});
Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var a=new Ext.grid.PropertyStore(this);this.propStore=a;var b=new Ext.grid.PropertyColumnModel(this,a);a.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");
this.cm=b;this.ds=a.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(c,d,e){if(e===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);this.source&&this.setSource(this.source)},setSource:function(a){this.propStore.setSource(a)},
getSource:function(){return this.propStore.getSource()},setProperty:function(a,b,c){this.propStore.setValue(a,b,c)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);
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",cancelEditOnToggle:true,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(a,b,c){if(this.canGroup()&&!this.ignoreAdd){var d=this.getScrollState();this.fireEvent("beforerowsinserted",a,c,c+(b.length-1));this.refresh();this.restoreScroll(d);this.fireEvent("rowsinserted",a,c,c+(b.length-1))}else this.canGroup()||Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)},onRemove:function(a,b){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var c=document.getElementById(b._groupId);c&&c.childNodes[1].childNodes.length<
1&&Ext.removeNode(c);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,b=this.hmenu.items,c=this.cm.config[this.hdCtxIndex].groupable===false;if(a=b.get("groupBy"))a.setDisabled(c);if(a=b.get("showGroups")){a.setDisabled(c);a.setChecked(this.canGroup(),true)}},renderUI:function(){var a=Ext.grid.GroupingView.superclass.renderUI.call(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)}return a},processEvent:function(a,b){Ext.grid.GroupingView.superclass.processEvent.call(this,a,b);var c=b.getTarget(".x-grid-group-hd",this.mainBody);
if(c){var d=this.getGroupField(),e=this.getPrefix(d);e=c.id.substring(e.length);var g=RegExp("gp-"+Ext.escapeRe(d)+"--hd");if((e=e.substr(0,e.length-3))||g.test(c.id))this.grid.fireEvent("group"+a,this.grid,d,e,b);a=="mousedown"&&b.button==0&&this.toggleGroup(c.parentNode)}},onGroupByClick:function(){var a=this.grid;this.enableGrouping=true;a.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));a.fireEvent("groupchange",a,a.store.getGroupState());this.beforeMenuShow();this.refresh()},onShowGroupsClick:function(a,
b){if(this.enableGrouping=b)this.onGroupByClick();else{this.grid.store.clearGrouping();this.grid.fireEvent("groupchange",this,null)}},toggleRowIndex:function(a,b){if(this.canGroup()){var c=this.getRow(a);c&&this.toggleGroup(this.findGroup(c),b)}},toggleGroup:function(a,b){var c=Ext.get(a),d=Ext.util.Format.htmlEncode(c.id);b=Ext.isDefined(b)?b:c.hasClass("x-grid-group-collapsed");if(this.state[d]!==b){this.cancelEditOnToggle!==false&&this.grid.stopEditing(true);this.state[d]=b;c[b?"removeClass":"addClass"]("x-grid-group-collapsed")}},
toggleAllGroups:function(a){for(var b=this.getGroups(),c=0,d=b.length;c<d;c++)this.toggleGroup(b[c],a)},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},getGroup:function(a,b,c,d,e,g){var h=this.cm.config[e];a=c?c.call(h.scope,a,{},b,d,e,g):String(a);if(a===""||a==="&#160;")a=h.emptyGroupText||this.emptyGroupText;return a},getGroupField:function(){return this.grid.store.getGroupState()},afterRender:function(){if(this.ds&&this.cm){Ext.grid.GroupingView.superclass.afterRender.call(this);
this.grid.deferRowRender&&this.updateGroupWidths()}},afterRenderUI:function(){Ext.grid.GroupingView.superclass.afterRenderUI.call(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)}},
renderRows:function(){var a=this.getGroupField(),b=!!a;if(this.hideGroupedColumn){var c=this.cm.findColumnIndex(a),d=Ext.isDefined(this.lastGroupField);if(!b&&d){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else if(b&&!d){this.lastGroupField=a;this.cm.setHidden(c,true)}else if(b&&d&&a!==this.lastGroupField){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);this.lastGroupField=
a;this.cm.setHidden(c,true)}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(a,b,c,d,e,g){if(b.length<1)return"";if(!this.canGroup()||this.isUpdating)return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments);var h=this.getGroupField(),i=this.cm.findColumnIndex(h),j,k="width:"+this.getTotalWidth()+";";j=this.cm.config[i];var m=j.groupRenderer||j.renderer,p=this.showGroupName?(j.groupName||j.header)+": ":"",o=[],s,l,n,r;l=0;for(n=b.length;l<n;l++){var q=
d+l,t=b[l],u=t.data[h];j=this.getGroup(u,t,m,q,i,c);if(!s||s.group!=j){r=this.constructId(u,h,i);this.state[r]=!(Ext.isDefined(this.state[r])?!this.state[r]:this.startCollapsed);s={group:j,gvalue:u,text:p+j,groupId:r,startRow:q,rs:[t],cls:this.state[r]?"":"x-grid-group-collapsed",style:k};o.push(s)}else s.rs.push(t);t._groupId=r}h=[];l=0;for(n=o.length;l<n;l++){j=o[l];this.doGroupStart(h,j,a,c,e);h[h.length]=Ext.grid.GroupingView.superclass.doRender.call(this,a,j.rs,c,j.startRow,e,g);this.doGroupEnd(h,
j,a,c,e)}return h.join("")},getGroupId:function(a){var b=this.getGroupField();return this.constructId(a,b,this.cm.findColumnIndex(b))},constructId:function(a,b,c){var d=this.cm.config[c];d=d.groupRenderer||d.renderer;a=this.groupMode=="value"?a:this.getGroup(a,{data:{}},d,0,c,this.ds);return this.getPrefix(b)+Ext.util.Format.htmlEncode(a)},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 a=[],b=this.getGroups(),c,d=0,e=b.length,g,h;d<e;++d)if(c=b[d].childNodes[1]){c=c.childNodes;g=0;for(h=c.length;g<h;++g)a[a.length]=c[g]}return a},updateGroupWidths:function(){if(this.canGroup()&&this.hasRows())for(var a=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.getScrollOffset())+"px",
b=this.getGroups(),c=0,d=b.length;c<d;c++)b[c].firstChild.style.width=a},onColumnWidthUpdated:function(a,b,c){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,a,b,c);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(a,b){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,a,b);this.updateGroupWidths()},onColumnHiddenUpdated:function(a,b,c){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,a,b,c);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},
onBeforeRowSelect:function(a,b){this.toggleRowIndex(b,true)}});Ext.grid.GroupingView.GROUP_ID=1E3;
