//JS functions in a php file //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii // form tab // create a parent div, which will contain the tabs (child divs). // Call this function to show one tab and hide all oters. //------------------- function doTab($pDivId, $showDiv, $tabClass ) //------------------- { //alert ("top of doTab") // pDivId is the ID of the div which is the immediate parent to the tab divs // showDiv is the ID of the child div, we want to show // tabClass is the class of all div in this set of tabs // all other divs, that are children of pDiv, in tabClass are to be hidden var pDivId = $pDivId; var showDiv = $showDiv; var tabClass = $tabClass; var pDivNode = document.getElementById(pDivId); // get list of ALL child divs inside pDiv var divList = pDivNode.getElementsByTagName("div"); var i = 0; var thisDiv; var thisDivId; var divFound = 0; for (i = 0; i < divList.length; i++) { thisDiv = divList[i]; thisDivId = thisDiv.id; thisDivClass= thisDiv.className; //alert ("className=" + thisDivClass); //alert ("for i=" + i + " divId=" + thisDivId); if ( thisDivClass == tabClass ) { thisDiv.style.display = "none"; } if ( thisDivId == showDiv && thisDivClass == tabClass && divFound == 0 ) { divFound = 1; // alert (thisDivId + " == " + showDiv + " i=" + i); thisDiv.style.display = ""; } } //end for //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii //iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii } //end doTab