/*
 * customTabs.js v1.2 (created: 2007/08/16, updated: 2007/12/07)
 * 
 * Company: Statusfirm
 * Coded by: Chesley Brown
 * Contact: c.brown@statusfirm.com
 * 
 * ***Description***
 * Used for creating custom tabs quickly
 * ******
 * 
 * *****Requires*****
 * jquery.js (unless useEffects is set to false) (tested with v1.2)
 * ******
 * 
 */
function classSwitchTabs() { this.useEffects = true; this.tabLock = false; this.effectsDuration = 400; this.startTabID = 'tab01'; this.previousTabID = ''; this.bodyIDExt = '_tabbody'; this.headerIDExt = '_tabheader'; this.headerClassName = ''; this.headerSelectedClassName = 'current'; this.switchTabs = switchTabs; this.showTab = showTab; this.onload = onloadSwitchTabs;}
function onloadSwitchTabs(startTabID) { if (startTabID != null) { this.startTabID = startTabID;}
var self = this; $().ready(function() { document.getElementById(self.startTabID + self.headerIDExt).className = self.headerSelectedClassName; document.getElementById(self.startTabID + self.bodyIDExt).style.display = 'block';});}
function switchTabs(currentTabID) { if (document.getElementById(currentTabID + this.bodyIDExt).style.display != 'display' && this.tabLock == false) { this.tabLock = true; var self = this; if (this.previousTabID != '') { document.getElementById(this.previousTabID + this.headerIDExt).className = this.headerClassName; document.getElementById(currentTabID + this.headerIDExt).className = this.headerSelectedClassName; if (this.useEffects == true) { $('#' + this.previousTabID + this.bodyIDExt).slideUp(this.effectsDuration); setTimeout( function() { self.showTab(currentTabID);}, (this.effectsDuration));} else { document.getElementById(this.previousTabID + this.bodyIDExt).style.display = 'none'; this.showTab(currentTabID);}
}
else { document.getElementById(this.startTabID + this.headerIDExt).className = this.headerClassName; document.getElementById(currentTabID + this.headerIDExt).className = this.headerSelectedClassName; if (this.useEffects == true) { $('#' + this.startTabID + this.bodyIDExt).slideUp(this.effectsDuration); setTimeout( function() { self.showTab(currentTabID);}, (this.effectsDuration));} else { document.getElementById(this.startTabID + this.bodyIDExt).style.display = 'none'; this.showTab(currentTabID);}
}
}
}
function showTab(currentTabID) { var self = this; if (this.useEffects == true) { $("#" + currentTabID + this.bodyIDExt).slideDown(this.effectsDuration);} else { document.getElementById(currentTabID + this.bodyIDExt).style.display = 'block';}
this.previousTabID = currentTabID; if (this.useEffects == true) { setTimeout( function() { self.tabLock = false;}, (this.effectsDuration));} else { this.tabLock = false;}
}