function smartTabSwitch(tabId, totalTabs, familyId, navType, funcOnClick) {

	//why so complex? (spans etc) Because FF doesn't support innerText

	if (navType == 1) {
		onBgCol = '#888888';
		offBgCol = '#f2f2f2';
	} else {
		onBgCol = '#fafafa';
		offBgCol = '#eaeaea';
	}

	(obj = document.getElementById(familyId+tabId)).style.borderBottom = "none";
	obj.innerHTML = "<span style='cursor: default;' id="+familyId+tabId+"Link>"+document.getElementById(familyId+tabId+'Link').innerHTML+"</span>";
	obj.style.backgroundColor = onBgCol;
	if (navType == 1) obj.style.color = '#ffffff';
	document.getElementById(familyId+tabId+'Div').style.display = 'block';

	for (r=0; r<totalTabs; r++) {
		if (r != tabId - 1) {
			obj = document.getElementById(familyId+(r+1));
			obj.style.borderBottom = "solid 1px #"+eval("smartNavBorderCol_"+familyId);
			obj.style.backgroundColor = offBgCol;
			if (navType == 1) { obj.style.border = 'solid 1px #aaaaaa'; obj.style.borderBottom = 'none'; }
			obj.innerHTML = "<a onMouseOver=\"this.style.textDecoration = 'underline'\" onMouseOut=\"this.style.textDecoration = 'none'\" id='"+familyId+(r+1)+"Link' style='color: #777777; text-decoration: none;' href=\"javascript:smartTabSwitch("+(r+1)+", "+totalTabs+", '"+familyId+"', "+navType+")\">"+document.getElementById(familyId+(r+1)+'Link').innerHTML+"</a>";
			document.getElementById(familyId+(r+1)+'Div').style.display = 'none';
		}
	}
	
	if (funcOnClick) eval(funcOnClick+"()");
	
}
