function toggleTab(activeTab, activeSectionId) {
	if (document.getElementById) {
		var allTabs = activeTab.parentNode;
		var activeSection = document.getElementById(activeSectionId);
		var allSections = activeSection.parentNode;
		
		// loop through tabs and change them to off state
		for (i=0; i<allTabs.childNodes.length; i++) {
			if (allTabs.childNodes[i].nodeName == activeTab.nodeName ) {
				setElementClass(allTabs.childNodes[i], "offTab");
			}
		}
		// loop through sections and change them to off state
		for (i=0; i<allSections.childNodes.length; i++) {
			if (allSections.childNodes[i].nodeName == activeSection.nodeName ) {
				setElementClass(allSections.childNodes[i], "offSection");
			}
		}
		
		// turn on the active tab and section		
		setElementClass(activeTab, "currentTab");
		setElementClass(activeSection, "currentSection");	
	}
}

function setElementClass(element, classValue) {
	if (element.setAttribute("class", classValue)) {
		element.setAttribute("class", classValue);
	} else if (element.setAttribute("className", classValue)) {
		element.setAttribute("className", classValue);
	}
}

