var tabGroups = new Array(); function GetE(elementId) { return document.getElementById(elementId) ; } function ShowE(element, isVisible) { if (typeof(element) == 'string') element = GetE(element) ; element.style.display = isVisible ? '' : 'none' ; } function my_changeTab(tabGroupName, tabCode, invoker) { var el = tabGroups[tabGroupName]['elements']; if (!el) return; for (var i = 0; i < el.length; i++) { if (el[i].name) ShowE('tab-' + el[i].name, (tabCode == el[i].name)); } var liTags = document.getElementById(tabGroupName).getElementsByTagName('LI'); for (var i = 0; i < liTags.length; i++) if (el[i]) liTags[i].className = el[i].className; else liTags[i].className = ''; invoker.parentNode.className = tabGroups[tabGroupName]['selectedClassName']; invoker.blur(); return false; } function createTabGroup(tabGroupName, selectedClassName) { tabGroups[tabGroupName] = new Array(); tabGroups[tabGroupName]['elements'] = new Array(); tabGroups[tabGroupName]['selectedClassName'] = new String(selectedClassName); } function addTab(tabGroupName, tabName, tabClass) { if (typeof tabClass == 'undefined') tabClass = ''; if (tabName) tabGroups[tabGroupName]['elements'].push({name: tabName, className: tabClass}); else tabGroups[tabGroupName]['elements'].push({name: '', className: tabClass}); }