/*


Instructions:
1) Set numberOfTabs to the number of tabs desired.

2) Set tabName to the tab DIV ID being used in the HTML.
Note: In this example "tabcontent" is used. The DIVs are then ID'd as:
tabcontent1, tabcontent2, etc.

(If more than one set of tab needed pass the tabname to the function default value is "tabcontent") - Added by Siddiq

3) In the HTML file: Add onLoad="dhtmlTabs(1);"
Note: The numerical argument for dhtmlTabs, when called onLoad, is the default tab 
that is "on". To have another tab default to "on", simply change that parameter.

4) Note: The DIVs on the HTML page must be nested inside a table to avoid a known
bug with the Mozilla generation of browsers, to which Netscape and Firefox belong.

*/

//DHTML Tab function
// Get No Of tabs in the page
function getNoOfTabs(tabName) {
	var count = 0;
	for (i = 0; i < document.getElementsByTagName("div").length; i++){
		divIdName = tabName+eval(i+1);
		if (document.getElementById(divIdName)!= null) { 
			if (document.getElementById(divIdName).id == divIdName)	count = count + 1;
		}
	}
	return count;
}

function dhtmlTabs(activeTab,tabName) {
	if ('undefined' == typeof(tabName))
		tabName = "tabcontent";

	numberOfTabs = getNoOfTabs(tabName);
	
    //DO NOT MODIFY BELOW THIS LINE
    if (document.getElementById) {
        for (i = 1; i < numberOfTabs + 1; i++) {
            if (i != activeTab) {
                document.getElementById(tabName + i).style.display = "none";
            }
        }
        document.getElementById(tabName + activeTab).style.display = "block";
    }
}

