function TabbedPane(D){if(!isComaptible()||D==null){return }this.element=D;this.element.tabPane=this;this.element.className="tabbed-pane-ctrl "+this.element.className;this.pages=[];this.activeIndex=null;var A=0;this.activeIndex=A;this.tabRow=document.createElement("div");this.tabRow.className="tab-row";D.insertBefore(this.tabRow,D.firstChild);var C=D.childNodes;for(var B=0;B<C.length;B++){if(C[B].nodeType==1&&C[B].className=="tab-page"){this.addTab(C[B])}}}TabbedPane.prototype.addTab=function(A){if(!isComaptible()){return }if(A.tabPage==this){return A.tabPage}var C=this.pages.length;var B=this.pages[C]=new TabPage(A,this,C);B.tabPane=this;this.tabRow.appendChild(B.tab);if(C==this.activeIndex){B.show()}else{B.hide()}return B};function TabPage(F,C,A){if(!isComaptible()||F==null){return }this.element=F;this.element.tabPage=this;this.index=A;var E=F.childNodes;for(var D=0;D<E.length;D++){if(E[D].nodeType==1&&E[D].className=="tab"){this.tab=E[D];break}}var B=document.createElement("A");this.aElement=B;
B.onclick=function(){return false};B.href="#";while(this.tab.hasChildNodes()){B.appendChild(this.tab.firstChild)}this.tab.appendChild(B);var G=this;this.tab.onclick=function(){G.activate()};this.tab.onmouseover=function(){TabbedPane.handleOver(G)};this.tab.onmouseout=function(){TabbedPane.handleOut(G)}}TabPage.prototype.show=function(){var B=this.tab;var A=B.className+" selected";A=A.replace(/ +/g," ");B.className=A;this.element.style.display="block"};TabPage.prototype.hide=function(){var B=this.tab;var A=B.className;A=A.replace(/ selected/g,"");B.className=A;this.element.style.display="none"};TabPage.prototype.activate=function(){this.tabPane.setActiveIndex(this.index)};TabbedPane.handleOver=function(A){var C=A.tab;var B=C.className+" hover";B=B.replace(/ +/g," ");C.className=B};TabbedPane.handleOut=function(A){var C=A.tab;var B=C.className;B=B.replace(/ hover/g,"");C.className=B};TabbedPane.prototype.setActiveIndex=function(A){if(this.activeIndex!=A){if(this.activeIndex!=null&&this.pages[this.activeIndex]!=null){this.pages[this.activeIndex].hide()
}this.activeIndex=A;this.pages[this.activeIndex].show()}};function isComaptible(){if(typeof isComaptible.state!="undefined"){return isComaptible.state}var A=/msie 5\.[56789]/i.test(navigator.userAgent);isComaptible.state=(typeof document.implementation!="undefined"&&document.implementation.hasFeature("html","1.0")||A);if(A){document._getElementsByTagName=document.getElementsByTagName;document.getElementsByTagName=function(B){if(B=="*"){return document.all}else{return document._getElementsByTagName(B)}}}return isComaptible.state}