var tabTabs = new Array(); var tabPanels = new Array(); function navClick(a){ hideAllPanels(); hideAllTabs(); showPanel(a.id); showTab(a.id); } function showPanel(a){ id = "panel"+a; for (i = 0; i < tabPanels.length; i++) { if(tabPanels[i].id == id){ tabPanels[i].className='xx'; } } } function showThisTab(node) { if(xx = document.getElementById("on1")){ xx.removeNode(true) } if(xx = document.getElementById("on2")){ xx.removeNode(true) } td = document.createElement("td"); td.setAttribute("width","21"); td.setAttribute("id","on1"); img = document.createElement("img"); img.setAttribute("src", "/"+dbRepID+"/tab_corner_left.gif"); td.appendChild(img); node.insertAdjacentElement("beforeBegin",td); td = document.createElement("td"); td.setAttribute("width","21"); td.setAttribute("id","on2"); img = document.createElement("img"); img.setAttribute("src", "/"+dbRepID+"/tab_corner_right.gif"); td.appendChild(img); node.insertAdjacentElement("afterEnd",td); node.firstChild.className = "TABon" node.className = "TABonCell"; } function showTab(a){ showThisTab(tabTabs[a.substr(3)]); } function hideAllPanels(){ for (i = 0; i < tabPanels.length; i++) { tabPanels[i].className='TABContentHide'; } } function hideAllTabs(){ for (i = 0; i < tabTabs.length; i++) { hideTabs(tabTabs[i]); } } function hideTabs(node) { node.className='TABoffCell'; node.firstChild.className = "TABoff" } function setActive(){ hideAllPanels(); hideAllTabs(); showPanel('tab0'); showTab('tab0'); } function initTabs(){ elms = document.getElementsByTagName("*"); for (i=0; i < elms.length; i++) { switch(elms[i].className){ case 'tabWrapper': tabTabs[tabTabs.length] = elms[i]; break; case 'tabContentHide': tabPanels[tabPanels.length] = elms[i]; break; } } if(tabTabs.length != 0){ setActive(); } }