rem: Ext.TabPanel=function(A,B){this.el=Ext.get(A,true);if(B){if(typeof B=="boolean"){this.tabPosition=B?"bottom":"top"}else{Ext.apply(this,B)}}if(this.tabPosition=="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-bottom")}this.stripWrap=Ext.get(this.createStrip(this.el.dom),true);this.stripEl=Ext.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Ext.get(this.stripWrap.dom.firstChild.firstChild,true);if(Ext.isIE){Ext.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden")}if(this.tabPosition!="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top")}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true});Ext.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;Ext.TabPanel.superclass.constructor.call(this)};Ext.extend(Ext.TabPanel,Ext.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,addTab:function(E,D,C,A){var B=new Ext.TabPanelItem(this,E,D,A);this.addTabItem(B);if(C){B.setContent(C)}return B},getTab:function(A){return this.items[A]},hideTab:function(B){var A=this.items[B];if(!A.isHidden()){A.setHidden(true);this.hiddenCount++;this.autoSizeTabs()}},unhideTab:function(B){var A=this.items[B];if(A.isHidden()){A.setHidden(false);this.hiddenCount--;this.autoSizeTabs()}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);if(this.resizeTabs){A.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs()}else{A.autoSize()}},removeTab:function(E){var A=this.items;var C=A[E];if(!C){return }var B=A.indexOf(C);if(this.active==C&&A.length>1){var D=this.getNextAvailable(B);if(D){D.activate()}}this.stripEl.dom.removeChild(C.pnode.dom);if(C.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(C.bodyEl.dom)}A.splice(B,1);delete this.items[C.id];C.fireEvent("close",C);C.purgeListeners();this.autoSizeTabs()},getNextAvailable:function(D){var A=this.items;var B=D;while(B<A.length){var C=A[++B];if(C&&!C.isHidden()){return C}}B=D;while(B>=0){var C=A[--B];if(C&&!C.isHidden()){return C}}return null},disableTab:function(B){var A=this.items[B];if(A&&this.active!=A){A.disable()}},enableTab:function(B){var A=this.items[B];A.enable()},activate:function(C){var A=this.items[C];if(!A){return null}if(A==this.active||A.disabled){return A}var B={};this.fireEvent("beforetabchange",this,B,A);if(B.cancel!==true&&!A.disabled){if(this.active){this.active.hide()}this.active=this.items[C];this.active.show();this.fireEvent("tabchange",this,this.active)}return A},getActiveTab:function(){return this.active},syncHeight:function(B){var A=(B||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var D=this.bodyEl.getMargins();var C=A-(this.stripWrap.getHeight()||0)-(D.top+D.bottom);this.bodyEl.setHeight(C);return C},onResize:function(){if(this.monitorResize){this.autoSizeTabs()}},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.autoSizeTabs()},autoSizeTabs:function(){var E=this.items.length;var B=E-this.hiddenCount;if(!this.resizeTabs||E<1||B<1||this.updating){return }var C=Math.max(this.el.getWidth()-this.cpad,10);var F=Math.floor(C/B);var A=this.stripBody;if(A.getWidth()>C){var D=this.items;this.setTabWidth(Math.max(F,this.minTabWidth)-2);if(F<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(F,this.preferredTabWidth)-2)}}},getCount:function(){return this.items.length},setTabWidth:function(C){this.currentTabWidth=C;for(var B=0,A=this.items.length;B<A;B++){if(!this.items[B].isHidden()){this.items[B].setWidth(C)}}},destroy:function(C){Ext.EventManager.removeResizeListener(this.onResize,this);for(var B=0,A=this.items.length;B<A;B++){this.items[B].purgeListeners()}if(C===true){this.el.update("");this.el.remove()}}});Ext.TabPanelItem=function(D,F,C,B){this.tabPanel=D;this.id=F;this.disabled=false;this.text=C;this.loaded=false;this.closable=B;this.bodyEl=Ext.get(D.createItemBody(D.bodyEl.dom,F));this.bodyEl.setVisibilityMode(Ext.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var A=D.createStripElements(D.stripEl.dom,C,B);this.el=Ext.get(A.el,true);this.inner=Ext.get(A.inner,true);this.textEl=Ext.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Ext.get(A.el.parentNode,true);this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(B){var E=Ext.get(A.close,true);E.dom.title=this.closeText;E.addClassOnOver("close-over");E.on("click",this.closeClick,this)}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Ext.TabPanelItem.superclass.constructor.call(this)};Ext.extend(Ext.TabPanelItem,Ext.util.Observable,{purgeListeners:function(){Ext.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners()},show:function(){this.pnode.addClass("on");this.showAction();if(Ext.isOpera){this.tabPanel.stripWrap.repaint()}this.fireEvent("activate",this.tabPanel,this)},isActive:function(){return this.tabPanel.getActiveTab()==this},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this)},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px")},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show()},setTooltip:function(A){if(Ext.QuickTips&&Ext.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute("title")}else{this.textEl.dom.title=A}},onTabClick:function(A){A.preventDefault();this.tabPanel.activate(this.id)},onTabMouseDown:function(A){A.preventDefault();this.tabPanel.activate(this.id)},getWidth:function(){return this.inner.getWidth()},setWidth:function(B){var A=B-this.pnode.getPadding("lr");this.inner.setWidth(A);this.textEl.setWidth(A-this.inner.getPadding("lr"));this.pnode.setWidth(B)},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"")},isHidden:function(){return this.hidden},getText:function(){return this.text},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"))},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize()}},activate:function(){this.tabPanel.activate(this.id)},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled")}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled")},setContent:function(B,A){this.bodyEl.update(B,A)},getUpdateManager:function(){return this.bodyEl.getUpdateManager()},setUrl:function(A,C,B){if(this.refreshDelegate){this.un("activate",this.refreshDelegate)}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,C,B]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager()},_handleRefresh:function(A,D,C){if(!C||!this.loaded){var B=this.bodyEl.getUpdateManager();B.update(A,D,this._setLoaded.createDelegate(this))}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate()}},_setLoaded:function(){this.loaded=true},closeClick:function(A){var B={};A.stopEvent();this.fireEvent("beforeclose",this,B);if(B.cancel!==true){this.tabPanel.removeTab(this.id)}},closeText:"Close this tab"});Ext.TabPanel.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B};Ext.TabPanel.prototype.createStripList=function(A){A.innerHTML="<div class=\"x-tabs-strip-wrap\"><table class=\"x-tabs-strip\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr></tr></tbody></table></div>";return A.firstChild.firstChild.firstChild.firstChild};Ext.TabPanel.prototype.createBody=function(B){var A=document.createElement("div");Ext.id(A,"tab-body");Ext.fly(A).addClass("x-tabs-body");B.appendChild(A);return A};Ext.TabPanel.prototype.createItemBody=function(B,C){var A=Ext.getDom(C);if(!A){A=document.createElement("div");A.id=C}Ext.fly(A).addClass("x-tabs-item-body");B.insertBefore(A,B.firstChild);return A};Ext.TabPanel.prototype.createStripElements=function(D,F,C){var G=document.createElement("td");D.appendChild(G);if(C){G.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Ext.Template("<a href=\"#\" class=\"x-tabs-right\"><span class=\"x-tabs-left\"><em class=\"x-tabs-inner\">"+"<span unselectable=\"on\""+(this.disableTooltips?"":" title=\"{text}\"")+" class=\"x-tabs-text\">{text}</span>"+"<div unselectable=\"on\" class=\"close-icon\">&#160;</div></em></span></a>")}var B=this.closeTpl.overwrite(G,{"text":F});var E=B.getElementsByTagName("div")[0];var A=B.getElementsByTagName("em")[0];return{"el":B,"close":E,"inner":A}}else{if(!this.tabTpl){this.tabTpl=new Ext.Template("<a href=\"#\" class=\"x-tabs-right\"><span class=\"x-tabs-left\"><em class=\"x-tabs-inner\">"+"<span unselectable=\"on\""+(this.disableTooltips?"":" title=\"{text}\"")+" class=\"x-tabs-text\">{text}</span></em></span></a>")}var B=this.tabTpl.overwrite(G,{"text":F});var A=B.getElementsByTagName("em")[0];return{"el":B,"inner":A}}}; 
add: Ext.TabPanel=Ext.extend(Ext.Panel,{monitorResize:true,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",itemCls:"x-tab-item",activeTab:null,tabMargin:2,plain:false,wheelIncrement:20,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({deferredRender:this.deferredRender}));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()},render:function(){Ext.TabPanel.superclass.render.apply(this,arguments);if(this.activeTab!==undefined){var A=this.activeTab;delete this.activeTab;this.setActiveTab(A)}},onRender:function(C,A){Ext.TabPanel.superclass.onRender.call(this,C,A);if(this.plain){var E=this.tabPosition=="top"?"header":"footer";this[E].addClass("x-tab-panel-"+E+"-plain")}var B=this[this.stripTarget];this.stripWrap=B.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});this.stripSpacer=B.createChild({cls:"x-tab-strip-spacer"});this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge"});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var D=new Ext.Template("<li class=\"{cls}\" id=\"{id}\"><a class=\"x-tab-strip-close\" onclick=\"return false;\"></a>","<a class=\"x-tab-right\" href=\"#\" onclick=\"return false;\"><em class=\"x-tab-left\">","<span class=\"x-tab-strip-inner\"><span class=\"x-tab-strip-text {iconCls}\">{text}</span></span>","</em></a></li>");D.disableFormats=true;D.compile();Ext.TabPanel.prototype.itemTpl=D}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.on("add",this.onAdd,this);this.on("remove",this.onRemove,this);this.strip.on("mousedown",this.onStripMouseDown,this);this.strip.on("click",this.onStripClick,this);this.strip.on("contextmenu",this.onStripContextMenu,this);if(this.enableTabScroll){this.strip.on("mousewheel",this.onWheel,this)}},findTargets:function(C){var B=null;var A=C.getTarget("li",this.strip);if(A){B=this.getComponent(A.id.split("__")[1]);if(B.disabled){return{close:null,item:null,el:null}}}return{close:C.getTarget(".x-tab-strip-close",this.strip),item:B,el:A}},onStripMouseDown:function(B){B.preventDefault();if(B.button!=0){return }var A=this.findTargets(B);if(A.close){this.remove(A.item);return }if(A.item&&A.item!=this.activeTab){this.setActiveTab(A.item)}},onStripClick:function(B){var A=this.findTargets(B);if(!A.close&&A.item&&A.item!=this.activeTab){this.setActiveTab(A.item)}},onStripContextMenu:function(B){B.preventDefault();var A=this.findTargets(B);if(A.item){this.fireEvent("contextmenu",this,A.item,B)}},readTabs:function(D){if(D===true){this.items.each(function(G){this.remove(G)},this)}var C=this.el.query(this.autoTabSelector);for(var B=0,A=C.length;B<A;B++){var E=C[B];var F=E.getAttribute("title");E.removeAttribute("title");this.add({title:F,el:E})}},initTab:function(D,B){var E=this.strip.dom.childNodes[B];var A=D.closable?"x-tab-strip-closable":"";if(D.disabled){A+=" x-item-disabled"}if(D.iconCls){A+=" x-tab-with-icon"}var F={id:this.id+"__"+D.getItemId(),text:D.title,cls:A,iconCls:D.iconCls||""};var C=E?this.itemTpl.insertBefore(E,F):this.itemTpl.append(this.strip,F);Ext.fly(C).addClassOnOver("x-tab-strip-over");if(D.tabTip){Ext.fly(C).child("span.x-tab-strip-text",true).qtip=D.tabTip}D.on("disable",this.onItemDisabled,this);D.on("enable",this.onItemEnabled,this);D.on("titlechange",this.onItemTitleChanged,this);D.on("beforeshow",this.onBeforeShowItem,this)},onAdd:function(C,B,A){this.initTab(B,A);if(this.items.getCount()==1){this.syncSize()}this.delegateUpdates()},onBeforeAdd:function(B){var A=B.events?(this.items.containsKey(B.getItemId())?B:null):this.items.get(B);if(A){this.setActiveTab(B);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var C=B.elements;B.elements=C?C.replace(",header",""):C;B.border=(B.border===true)},onRemove:function(C,B){Ext.removeNode(this.getTabEl(B));this.stack.remove(B);if(B==this.activeTab){var A=this.stack.next();if(A){this.setActiveTab(A)}else{this.setActiveTab(0)}}this.delegateUpdates()},onBeforeShowItem:function(A){if(A!=this.activeTab){this.setActiveTab(A);return false}},onItemDisabled:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).addClass("x-item-disabled")}this.stack.remove(B)},onItemEnabled:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).removeClass("x-item-disabled")}},onItemTitleChanged:function(B){var A=this.getTabEl(B);if(A){Ext.fly(A).child("span.x-tab-strip-text",true).innerHTML=B.title}},getTabEl:function(A){return document.getElementById(this.id+"__"+A.getItemId())},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(B){B=this.getComponent(B);var A=this.getTabEl(B);if(A){A.style.display="none";this.delegateUpdates()}},unhideTabStripItem:function(B){B=this.getComponent(B);var A=this.getTabEl(B);if(A){A.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return }if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var G=this.items.length;var B=this.tabPosition!="bottom"?"header":"footer";var C=this[B].dom.offsetWidth;var A=this[B].dom.clientWidth;if(!this.resizeTabs||G<1||!A){return }var I=Math.max(Math.min(Math.floor((A-4)/G)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=I;var K=this.stripWrap.dom.getElementsByTagName("li");for(var E=0,H=K.length-1;E<H;E++){var J=K[E];var L=J.childNodes[1].firstChild.firstChild;var F=J.offsetWidth;var D=L.offsetWidth;L.style.width=(I-(F-D))+"px"}},adjustBodyWidth:function(A){if(this.header){this.header.setWidth(A)}if(this.footer){this.footer.setWidth(A)}return A},setActiveTab:function(C){C=this.getComponent(C);if(!C||this.fireEvent("beforetabchange",this,C,this.activeTab)===false){return }if(!this.rendered){this.activeTab=C;return }if(this.activeTab!=C){if(this.activeTab){var A=this.getTabEl(this.activeTab);if(A){Ext.fly(A).removeClass("x-tab-strip-active")}this.activeTab.fireEvent("deactivate",this.activeTab)}var B=this.getTabEl(C);Ext.fly(B).addClass("x-tab-strip-active");this.activeTab=C;this.stack.add(C);this.layout.setActiveItem(C);if(this.layoutOnTabChange&&C.doLayout){C.doLayout()}if(this.scrolling){this.scrollToTab(C,this.animScroll)}C.fireEvent("activate",C);this.fireEvent("tabchange",this,C)}},getActiveTab:function(){return this.activeTab||null},getItem:function(A){return this.getComponent(A)},autoScrollTabs:function(){var F=this.items.length;var D=this.header.dom.offsetWidth;var C=this.header.dom.clientWidth;var E=this.stripWrap;var B=E.dom.offsetWidth;var G=this.getScrollPos();var A=this.edge.getOffsetsTo(this.stripWrap)[0]+G;if(!this.enableTabScroll||F<1||B<20){return }if(A<=C){E.dom.scrollLeft=0;E.setWidth(C);if(this.scrolling){this.scrolling=false;this.header.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide()}}else{if(!this.scrolling){this.header.addClass("x-tab-scrolling")}C-=E.getMargins("lr");E.setWidth(C>20?C:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(G>(A-C)){E.dom.scrollLeft=A-C}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){var C=this.stripWrap.dom.offsetHeight;var A=this.header.insertFirst({cls:"x-tab-scroller-left"});A.setHeight(C);A.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(A,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=A;var B=this.header.insertFirst({cls:"x-tab-scroller-right"});B.setHeight(C);B.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(B,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=B},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(E,A){if(!E){return }var C=this.getTabEl(E);var G=this.getScrollPos(),D=this.getScrollArea();var F=Ext.fly(C).getOffsetsTo(this.stripWrap)[0]+G;var B=F+C.offsetWidth;if(F<G){this.scrollTo(F,A)}else{if(B>(G+D)){this.scrollTo(B-D,A)}}},scrollTo:function(B,A){this.stripWrap.scrollTo("left",B,A?this.getScrollAnim():false);if(!A){this.updateScrollButtons()}},onWheel:function(D){var E=D.getWheelDelta()*this.wheelIncrement*-1;D.stopEvent();var F=this.getScrollPos();var C=F+E;var A=this.getScrollWidth()-this.getScrollArea();var B=Math.max(0,Math.min(A,C));if(B!=F){this.scrollTo(B,false)}},onScrollRight:function(){var A=this.getScrollWidth()-this.getScrollArea();var C=this.getScrollPos();var B=Math.min(A,C+this.getScrollIncrement());if(B!=C){this.scrollTo(B,this.animScroll)}},onScrollLeft:function(){var B=this.getScrollPos();var A=Math.max(0,B-this.getScrollIncrement());if(A!=B){this.scrollTo(A,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")}});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);if(A.length>10){A.shift()}},remove:function(E){var D=[];for(var C=0,B=A.length;C<B;C++){if(A[C]!=E){D.push(A[C])}}A=D},next:function(){return A.pop()}}}; 
context: Ext.TabPanel=function(A,B){this.el=Ext.get(A,true);if(B){if(typeof B=="boolean"){this.tabPosition=B?"bottom":"top"}else{Ext.apply(this,B)}}if(this.tabPosition=="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-bottom")}this.stripWrap=Ext.get(this.createStrip(this.el.dom),true);this.stripEl=Ext.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Ext.get(this.stripWrap.dom.firstChild.firstChild,true);if(Ext.isIE){Ext.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden")}if(this.tabPosition!="bottom"){this.bodyEl=Ext.get(this.createBody(this.el.dom));this.el.addClass("x-tabs-top")}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true});Ext.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;Ext.TabPanel.superclass.constructor.call(this)};Ext.extend(Ext.TabPanel,Ext.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,addTab:function(E,D,C,A){var B=new Ext.TabPanelItem(this,E,D,A);this.addTabItem(B);if(C){B.setContent(C)}return B},getTab:function(A){return this.items[A]},hideTab:function(B){var A=this.items[B];if(!A.isHidden()){A.setHidden(true);this.hiddenCount++;this.autoSizeTabs()}},unhideTab:function(B){var A=this.items[B];if(A.isHidden()){A.setHidden(false);this.hiddenCount--;this.autoSizeTabs()}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);if(this.resizeTabs){A.setWidth(this.currentTabWidth||this.preferredTabWidth);this.autoSizeTabs()}else{A.autoSize()}},removeTab:function(E){var A=this.items;var C=A[E];if(!C){return }var B=A.indexOf(C);if(this.active==C&&A.length>1){var D=this.getNextAvailable(B);if(D){D.activate()}}this.stripEl.dom.removeChild(C.pnode.dom);if(C.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(C.bodyEl.dom)}A.splice(B,1);delete this.items[C.id];C.fireEvent("close",C);C.purgeListeners();this.autoSizeTabs()},getNextAvailable:function(D){var A=this.items;var B=D;while(B<A.length){var C=A[++B];if(C&&!C.isHidden()){return C}}B=D;while(B>=0){var C=A[--B];if(C&&!C.isHidden()){return C}}return null},disableTab:function(B){var A=this.items[B];if(A&&this.active!=A){A.disable()}},enableTab:function(B){var A=this.items[B];A.enable()},activate:function(C){var A=this.items[C];if(!A){return null}if(A==this.active||A.disabled){return A}var B={};this.fireEvent("beforetabchange",this,B,A);if(B.cancel!==true&&!A.disabled){if(this.active){this.active.hide()}this.active=this.items[C];this.active.show();this.fireEvent("tabchange",this,this.active)}return A},getActiveTab:function(){return this.active},syncHeight:function(B){var A=(B||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var D=this.bodyEl.getMargins();var C=A-(this.stripWrap.getHeight()||0)-(D.top+D.bottom);this.bodyEl.setHeight(C);return C},onResize:function(){if(this.monitorResize){this.autoSizeTabs()}},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.autoSizeTabs()},autoSizeTabs:function(){var E=this.items.length;var B=E-this.hiddenCount;if(!this.resizeTabs||E<1||B<1||this.updating){return }var C=Math.max(this.el.getWidth()-this.cpad,10);var F=Math.floor(C/B);var A=this.stripBody;if(A.getWidth()>C){var D=this.items;this.setTabWidth(Math.max(F,this.minTabWidth)-2);if(F<this.minTabWidth){}}else{if(this.currentTabWidth<this.preferredTabWidth){this.setTabWidth(Math.min(F,this.preferredTabWidth)-2)}}},getCount:function(){return this.items.length},setTabWidth:function(C){this.currentTabWidth=C;for(var B=0,A=this.items.length;B<A;B++){if(!this.items[B].isHidden()){this.items[B].setWidth(C)}}},destroy:function(C){Ext.EventManager.removeResizeListener(this.onResize,this);for(var B=0,A=this.items.length;B<A;B++){this.items[B].purgeListeners()}if(C===true){this.el.update("");this.el.remove()}}});Ext.TabPanelItem=function(D,F,C,B){this.tabPanel=D;this.id=F;this.disabled=false;this.text=C;this.loaded=false;this.closable=B;this.bodyEl=Ext.get(D.createItemBody(D.bodyEl.dom,F));this.bodyEl.setVisibilityMode(Ext.Element.VISIBILITY);this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");this.hideAction();var A=D.createStripElements(D.stripEl.dom,C,B);this.el=Ext.get(A.el,true);this.inner=Ext.get(A.inner,true);this.textEl=Ext.get(this.el.dom.firstChild.firstChild.firstChild,true);this.pnode=Ext.get(A.el.parentNode,true);this.el.on("mousedown",this.onTabMouseDown,this);this.el.on("click",this.onTabClick,this);if(B){var E=Ext.get(A.close,true);E.dom.title=this.closeText;E.addClassOnOver("close-over");E.on("click",this.closeClick,this)}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Ext.TabPanelItem.superclass.constructor.call(this)};Ext.extend(Ext.TabPanelItem,Ext.util.Observable,{purgeListeners:function(){Ext.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners()},show:function(){this.pnode.addClass("on");this.showAction();if(Ext.isOpera){this.tabPanel.stripWrap.repaint()}this.fireEvent("activate",this.tabPanel,this)},isActive:function(){return this.tabPanel.getActiveTab()==this},hide:function(){this.pnode.removeClass("on");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this)},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px")},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show()},setTooltip:function(A){if(Ext.QuickTips&&Ext.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute("title")}else{this.textEl.dom.title=A}},onTabClick:function(A){A.preventDefault();this.tabPanel.activate(this.id)},onTabMouseDown:function(A){A.preventDefault();this.tabPanel.activate(this.id)},getWidth:function(){return this.inner.getWidth()},setWidth:function(B){var A=B-this.pnode.getPadding("lr");this.inner.setWidth(A);this.textEl.setWidth(A-this.inner.getPadding("lr"));this.pnode.setWidth(B)},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"")},isHidden:function(){return this.hidden},getText:function(){return this.text},autoSize:function(){this.textEl.setWidth(1);this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"))},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);if(!this.tabPanel.resizeTabs){this.autoSize()}},activate:function(){this.tabPanel.activate(this.id)},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled")}},enable:function(){this.disabled=false;this.pnode.removeClass("disabled")},setContent:function(B,A){this.bodyEl.update(B,A)},getUpdateManager:function(){return this.bodyEl.getUpdateManager()},setUrl:function(A,C,B){if(this.refreshDelegate){this.un("activate",this.refreshDelegate)}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,C,B]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager()},_handleRefresh:function(A,D,C){if(!C||!this.loaded){var B=this.bodyEl.getUpdateManager();B.update(A,D,this._setLoaded.createDelegate(this))}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate()}},_setLoaded:function(){this.loaded=true},closeClick:function(A){var B={};A.stopEvent();this.fireEvent("beforeclose",this,B);if(B.cancel!==true){this.tabPanel.removeTab(this.id)}},closeText:"Close this tab"});Ext.TabPanel.prototype.createStrip=function(A){var B=document.createElement("div");B.className="x-tabs-wrap";A.appendChild(B);return B};Ext.TabPanel.prototype.createStripList=function(A){A.innerHTML="<div class=\"x-tabs-strip-wrap\"><table class=\"x-tabs-strip\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr></tr></tbody></table></div>";return A.firstChild.firstChild.firstChild.firstChild};Ext.TabPanel.prototype.createBody=function(B){var A=document.createElement("div");Ext.id(A,"tab-body");Ext.fly(A).addClass("x-tabs-body");B.appendChild(A);return A};Ext.TabPanel.prototype.createItemBody=function(B,C){var A=Ext.getDom(C);if(!A){A=document.createElement("div");A.id=C}Ext.fly(A).addClass("x-tabs-item-body");B.insertBefore(A,B.firstChild);return A};Ext.TabPanel.prototype.createStripElements=function(D,F,C){var G=document.createElement("td");D.appendChild(G);if(C){G.className="x-tabs-closable";if(!this.closeTpl){this.closeTpl=new Ext.Template("<a href=\"#\" class=\"x-tabs-right\"><span class=\"x-tabs-left\"><em class=\"x-tabs-inner\">"+"<span unselectable=\"on\""+(this.disableTooltips?"":" title=\"{text}\"")+" class=\"x-tabs-text\">{text}</span>"+"<div unselectable=\"on\" class=\"close-icon\">&#160;</div></em></span></a>")}var B=this.closeTpl.overwrite(G,{"text":F});var E=B.getElementsByTagName("div")[0];var A=B.getElementsByTagName("em")[0];return{"el":B,"close":E,"inner":A}}else{if(!this.tabTpl){this.tabTpl=new Ext.Template("<a href=\"#\" class=\"x-tabs-right\"><span class=\"x-tabs-left\"><em class=\"x-tabs-inner\">"+"<span unselectable=\"on\""+(this.disableTooltips?"":" title=\"{text}\"")+" class=\"x-tabs-text\">{text}</span></em></span></a>")}var B=this.tabTpl.overwrite(G,{"text":F});var A=B.getElementsByTagName("em")[0];return{"el":B,"inner":A}}};
meta: 2891	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2891/d109eea1e59fbb030ac98e95f181f72da9611a48/ext-all.js/buggy/gemma-web/src/main/webapp/scripts/ext/ext-all.js