function tabberObj(_1){
var _2;
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.titleElementsStripHTML=true;
this.removeTitle=true;
this.addLinkId=false;
this.linkIdFormat="<tabberid>nav<tabnumberone>";
for(_2 in _1){
this[_2]=_1[_2];
}
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=new Array();
if(this.div){
this.init(this.div);
this.div=null;
}
}
tabberObj.prototype.init=function(e){
var _4,i,i2,t,_8=0,_9,_a,_b,_c,_d;
if(!document.getElementsByTagName){
return false;
}
if(e.id){
this.id=e.id;
}
this.tabs.length=0;
_4=e.childNodes;
for(i=0;i<_4.length;i++){
if(_4[i].className&&_4[i].className.match(this.REclassTab)){
t=new Object();
t.div=_4[i];
this.tabs[this.tabs.length]=t;
if(_4[i].className.match(this.REclassTabDefault)){
_8=this.tabs.length-1;
}
}
}
_9=document.createElement("ul");
_9.className=this.classNav;
for(i=0;i<this.tabs.length;i++){
t=this.tabs[i];
t.headingText=t.div.title;
if(this.removeTitle){
t.div.title="";
}
if(!t.headingText){
for(i2=0;i2<this.titleElements.length;i2++){
_d=t.div.getElementsByTagName(this.titleElements[i2])[0];
if(_d){
t.headingText=_d.innerHTML;
if(this.titleElementsStripHTML){
t.headingText.replace(/<br>/gi," ");
t.headingText=t.headingText.replace(/<[^>]+>/g,"");
}
break;
}
}
}
if(!t.headingText){
t.headingText=i+1;
}
_a=document.createElement("li");
t.li=_a;
_b=document.createElement("a");
_b.appendChild(document.createTextNode(t.headingText));
_b.href="javascript:void(null);";
_b.title=t.headingText;
_b.onclick=this.navClick;
_b.tabber=this;
_b.tabberIndex=i;
if(this.addLinkId&&this.linkIdFormat){
_c=this.linkIdFormat;
_c=_c.replace(/<tabberid>/gi,this.id);
_c=_c.replace(/<tabnumberzero>/gi,i);
_c=_c.replace(/<tabnumberone>/gi,i+1);
_c=_c.replace(/<tabtitle>/gi,t.headingText.replace(/[^a-zA-Z0-9\-]/gi,""));
_b.id=_c;
}
_a.appendChild(_b);
_9.appendChild(_a);
}
e.insertBefore(_9,e.firstChild);
e.className=e.className.replace(this.REclassMain,this.classMainLive);
this.tabShow(_8);
if(typeof this.onLoad=="function"){
this.onLoad({tabber:this});
}
return this;
};
tabberObj.prototype.navClick=function(_e){
var _f,a,_11,_12,_13;
a=this;
if(!a.tabber){
return false;
}
_11=a.tabber;
_12=a.tabberIndex;
a.blur();
if(typeof _11.onClick=="function"){
_13={"tabber":_11,"index":_12,"event":_e};
if(!_e){
_13.event=window.event;
}
_f=_11.onClick(_13);
if(_f===false){
return false;
}
}
_11.tabShow(_12);
return false;
};
tabberObj.prototype.tabHideAll=function(){
var i;
for(i=0;i<this.tabs.length;i++){
this.tabHide(i);
}
};
tabberObj.prototype.tabHide=function(_15){
var div;
if(!this.tabs[_15]){
return false;
}
div=this.tabs[_15].div;
if(!div.className.match(this.REclassTabHide)){
div.className+=" "+this.classTabHide;
}
this.navClearActive(_15);
return this;
};
tabberObj.prototype.tabShow=function(_17){
var div;
if(!this.tabs[_17]){
return false;
}
this.tabHideAll();
div=this.tabs[_17].div;
div.className=div.className.replace(this.REclassTabHide,"");
this.navSetActive(_17);
if(typeof this.onTabDisplay=="function"){
this.onTabDisplay({"tabber":this,"index":_17});
}
return this;
};
tabberObj.prototype.navSetActive=function(_19){
this.tabs[_19].li.className=this.classNavActive;
return this;
};
tabberObj.prototype.navClearActive=function(_1a){
this.tabs[_1a].li.className="";
return this;
};
function tabberAutomatic(_1b){
var _1c,_1d,i;
if(!_1b){
_1b={};
}
_1c=new tabberObj(_1b);
_1d=document.getElementsByTagName("div");
for(i=0;i<_1d.length;i++){
if(_1d[i].className&&_1d[i].className.match(_1c.REclassMain)){
_1b.div=_1d[i];
_1d[i].tabber=new tabberObj(_1b);
}
}
return this;
}
function tabberAutomaticOnLoad(_1f){
var _20;
if(!_1f){
_1f={};
}
_20=window.onload;
if(typeof window.onload!="function"){
window.onload=function(){
tabberAutomatic(_1f);
};
}else{
window.onload=function(){
_20();
tabberAutomatic(_1f);
};
}
}
if(typeof tabberOptions=="undefined"){
tabberAutomaticOnLoad();
}else{
if(!tabberOptions["manualStartup"]){
tabberAutomaticOnLoad(tabberOptions);
}
}

