var Spry;if(!Spry){Spry={};}if(!Spry.Widget){Spry.Widget={};}Spry.Widget.TabbedPanels=function(A,C){this.element=this.getElement(A);this.defaultTab=0;this.bindings=[];this.tabSelectedClass="TabbedPanelsTabSelected";this.tabHoverClass="TabbedPanelsTabHover";this.tabFocusedClass="TabbedPanelsTabFocused";this.panelVisibleClass="TabbedPanelsContentVisible";this.focusElement=null;this.hasFocus=false;this.currentTabIndex=0;this.enableKeyboardNavigation=true;Spry.Widget.TabbedPanels.setOptions(this,C);if(typeof (this.defaultTab)=="number"){if(this.defaultTab<0){this.defaultTab=0;}else{var B=this.getTabbedPanelCount();if(this.defaultTab>=B){this.defaultTab=(B>1)?(B-1):0;}}this.defaultTab=this.getTabs()[this.defaultTab];}if(this.defaultTab){this.defaultTab=this.getElement(this.defaultTab);}this.attachBehaviors();};Spry.Widget.TabbedPanels.prototype.getElement=function(A){if(A&&typeof A=="string"){return document.getElementById(A);}return A;};Spry.Widget.TabbedPanels.prototype.getElementChildren=function(B){var A=[];var C=B.firstChild;while(C){if(C.nodeType==1){A.push(C);}C=C.nextSibling;}return A;};Spry.Widget.TabbedPanels.prototype.addClassName=function(B,A){if(!B||!A||(B.className&&B.className.search(new RegExp("\\b"+A+"\\b"))!=-1)){return ;}B.className+=(B.className?" ":"")+A;};Spry.Widget.TabbedPanels.prototype.removeClassName=function(B,A){if(!B||!A||(B.className&&B.className.search(new RegExp("\\b"+A+"\\b"))==-1)){return ;}B.className=B.className.replace(new RegExp("\\s*\\b"+A+"\\b","g"),"");};Spry.Widget.TabbedPanels.setOptions=function(D,C,A){if(!C){return ;}for(var B in C){if(A&&C[B]==undefined){continue;}D[B]=C[B];}};Spry.Widget.TabbedPanels.prototype.getTabGroup=function(){if(this.element){var A=this.getElementChildren(this.element);if(A.length){return A[0];}}return null;};Spry.Widget.TabbedPanels.prototype.getTabs=function(){var A=[];var B=this.getTabGroup();if(B){A=this.getElementChildren(B);}return A;};Spry.Widget.TabbedPanels.prototype.getContentPanelGroup=function(){if(this.element){var A=this.getElementChildren(this.element);if(A.length>1){return A[1];}}return null;};Spry.Widget.TabbedPanels.prototype.getContentPanels=function(){var A=[];var B=this.getContentPanelGroup();if(B){A=this.getElementChildren(B);}return A;};Spry.Widget.TabbedPanels.prototype.getIndex=function(C,A){C=this.getElement(C);if(C&&A&&A.length){for(var B=0;B=this.getTabbedPanelCount()){return ;}var E=this.getTabs();var C=this.getContentPanels();var A=Math.max(E.length,C.length);for(var D=0;D