var a;
function tabberObj(b){var c;this.div=null;this.classMain="tabber";this.classMainLive="tabberlive";this.classTab="tabbertab";this.classTabDefault="tabbertabdefault";this.classNav="tabbernav";this.classTabHide="tabbertabhide";this.classNavActive="tabberactive";this.titleElements=["h2","h3","h4","h5","h6"];this.removeTitle=this.titleElementsStripHTML=true;this.addLinkId=false;this.linkIdFormat="<tabberid>nav<tabnumberone>";for(c in b)this[c]=b[c];this.REclassMain=new RegExp("\\b"+this.classMain+"\\b",
"gi");this.REclassMainLive=new RegExp("\\b"+this.classMainLive+"\\b","gi");this.REclassTab=new RegExp("\\b"+this.classTab+"\\b","gi");this.REclassTabDefault=new RegExp("\\b"+this.classTabDefault+"\\b","gi");this.REclassTabHide=new RegExp("\\b"+this.classTabHide+"\\b","gi");this.tabs=[];if(this.div){this.init(this.div);this.div=null}}a=tabberObj.prototype;
a.init=function(b){var c,d,e,f,i=0,g,h;if(!document.getElementsByTagName)return false;if(b.id)this.id=b.id;this.tabs.length=0;c=b.childNodes;for(d=0;d<c.length;d++)if(c[d].className&&c[d].className.match(this.REclassTab)){f={};f.div=c[d];this.tabs[this.tabs.length]=f;if(c[d].className.match(this.REclassTabDefault))i=this.tabs.length-1}c=document.createElement("ul");c.className=this.classNav;for(d=0;d<this.tabs.length;d++){f=this.tabs[d];f.headingText=f.div.title;if(this.removeTitle)f.div.title="";
if(!f.headingText)for(e=0;e<this.titleElements.length;e++)if(g=f.div.getElementsByTagName(this.titleElements[e])[0]){f.headingText=g.innerHTML;if(this.titleElementsStripHTML){f.headingText.replace(/<br>/gi," ");f.headingText=f.headingText.replace(/<[^>]+>/g,"")}break}if(!f.headingText)f.headingText=d+1;e=document.createElement("li");f.li=e;g=document.createElement("a");g.appendChild(document.createTextNode(f.headingText));g.href="javascript:void(null);";g.title=f.headingText;g.onclick=this.navClick;
g.tabber=this;g.tabberIndex=d;if(this.addLinkId&&this.linkIdFormat){h=this.linkIdFormat;h=h.replace(/<tabberid>/gi,this.id);h=h.replace(/<tabnumberzero>/gi,d);h=h.replace(/<tabnumberone>/gi,d+1);h=h.replace(/<tabtitle>/gi,f.headingText.replace(/[^a-zA-Z0-9\-]/gi,""));g.id=h}e.appendChild(g);c.appendChild(e)}b.insertBefore(c,b.firstChild);b.className=b.className.replace(this.REclassMain,this.classMainLive);this.tabShow(i);typeof this.onLoad=="function"&&this.onLoad({tabber:this});return this};
a.navClick=function(b){var c,d,e;c=this;if(!c.tabber)return false;d=c.tabber;e=c.tabberIndex;c.blur();if(typeof d.onClick=="function"){c={tabber:d,index:e,event:b};if(!b)c.event=window.event;b=d.onClick(c);if(b===false)return false}d.tabShow(e);return false};a.tabHideAll=function(){var b;for(b=0;b<this.tabs.length;b++)this.tabHide(b)};
a.tabHide=function(b){var c;if(!this.tabs[b])return false;c=this.tabs[b].div;c.className.match(this.REclassTabHide)||(c.className+=" "+this.classTabHide);this.navClearActive(b);return this};a.tabShow=function(b){var c;if(!this.tabs[b])return false;this.tabHideAll();c=this.tabs[b].div;c.className=c.className.replace(this.REclassTabHide,"");this.navSetActive(b);typeof this.onTabDisplay=="function"&&this.onTabDisplay({tabber:this,index:b});return this};
a.navSetActive=function(b){this.tabs[b].li.className=this.classNavActive;return this};a.navClearActive=function(b){this.tabs[b].li.className="";return this};function tabberAutomatic(b){var c,d,e;b||(b={});c=new tabberObj(b);d=document.getElementsByTagName("div");for(e=0;e<d.length;e++)if(d[e].className&&d[e].className.match(c.REclassMain)){b.div=d[e];d[e].tabber=new tabberObj(b)}return this}
function tabberAutomaticOnLoad(b){var c;b||(b={});c=window.onload;window.onload=typeof window.onload!="function"?function(){tabberAutomatic(b)}:function(){c();tabberAutomatic(b)}}if(typeof tabberOptions=="undefined")tabberAutomaticOnLoad();else tabberOptions.manualStartup||tabberAutomaticOnLoad(tabberOptions);