var tabbgimagepath = "" ; var tabbgimagetype = "" ; var debug = false ; function slider (tab) { var tabname = gettabgroupname (tab.id) ; if (tabname == '') { alert ("no tabname for tab [" + tab.id + "]") ; return ; } var index = 1 ; while (true) { var tabtitle = document.getelementbyid (tabname + '_' + index) ; if (tabtitle == undefined) break ; deontabtitle (tabtitle , tabname) ; var tabcontent = document.getelementbyid (tabname + '_' + index + '_content') ; if (tabcontent != undefined) tabcontent.style.display = "none" ; index ++ ; } if (debug) alert ("find " + (index - 1) + " tab title(s) for tabname [" + tabname + "]") ; ontabtitle (tab , tabname) ; var tabcontent = document.getelementbyid (tab.id + '_content') ; if (tabcontent != undefined) tabcontent.style.display = "block" ; var tabheader = document.getelementbyid (tabname + "_header") ; if (tabheader != undefined) { tabheader.classname = "tabheader_" + tab.id ; } } function slider1 (tab) { var tabname = gettabgroupname (tab.id) ; if (tabname == '') { alert ("no tabname for tab [" + tab.id + "]") ; return ; } var index = 1 ; while (true) { var tabtitle = document.getelementbyid (tabname + '_' + index) ; if (tabtitle == undefined) break ; deontabtitle (tabtitle , tabname) ; var tabcontent = document.getelementbyid (tabname + '_' + index + '_content') ; if (tabcontent != undefined) tabcontent.style.display = "none" ; index ++ ; } if (debug) alert ("find " + (index - 1) + " tab title(s) for tabname [" + tabname + "]") ; ontabtitle (tab , tabname) ; var tabcontent = document.getelementbyid (tab.id + '_content') ; if (tabcontent != undefined) tabcontent.style.display = "block" ; var tabheader = document.getelementbyid (tabname + "_header") ; if (tabheader != undefined) { tabheader.classname = "tabheader_" + tab.id ; } } function gettabgroupname (tabid) { if (tabid == '' || tabid == undefined) { alert ("tabid is null! [" + tabid + "]") ; return ; } var i = tabid.lastindexof ('_') ; if (i <= 1) return '' ; return tabid.substr (0 , i) ; } function deontabtitle (tab , tabname) { tab.classname = tabname + "_off" ; } function ontabtitle (tab , tabname) { tab.classname = tabname + "_on" ; }