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

