// getElementsByClass function courtesy of anyexample.com
function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}

// resume tab functionality - show and hide content divs, change class of tab links
function showTab(divID, linkID, tabbedContentClass, tabLinkClass) {
	var theDiv = document.getElementById(divID);
	var tab = document.getElementById(linkID);
	var otherDivs = getElementsByClass(tabbedContentClass);
	var otherTabs = getElementsByClass(tabLinkClass);

	// display the div, hide unwanted divs
	for( $i = 0; $i < otherDivs.length; $i++ )  {
		otherDivs[$i].style.display = "none";
	}
	theDiv.style.display = "block";
	
	// change the active tab, make sure the others aren't active
	for( $i = 0; $i < otherTabs.length; $i++ ) {
		otherTabs[$i].removeAttribute("class");	
	}
	tab.setAttribute("class", tabLinkClass);
}