/*tabs.js is a file used to manage the user tabs in the website admin pages.
code was moved here to make it easier to integrate this design with new admin pages*/

function ActiveTab(strTabName)
	{

	var tdList=document.getElementsByTagName("td");

	for(var i=0;i < tdList.length;i++)
		{
		if(tdList[i].className == 'currenttabSeparateL')
			{
			tdList[i].setAttribute("class","tabSeparateL");
			}
		if(tdList[i].className == 'currenttabSeparateR')
			{
			tdList[i].setAttribute("class","tabSeparateR");
			}
		}

	var thList=document.getElementsByTagName("th");

	for(var i=0;i < thList.length;i++)
		{
		if(thList[i].className == 'currenttab')
			{
			thList[i].setAttribute("class","tab");
			}
		}

	var divList = document.getElementsByTagName("div");

	for(i=0;i < divList.length;i++)
		{
		if(divList[i].className == 'adminTabPages')
			{
			hideDiv(divList[i].id);
			}
		}

	if(document.getElementById(strTabName + 'TabL') != null)
		{
		document.getElementById(strTabName + 'TabL').setAttribute("class","currenttabSeparateL");
		}
	if(document.getElementById(strTabName + 'Tab') != null)
		{
		document.getElementById(strTabName + 'Tab').setAttribute("class","currenttab");
		}
	if(document.getElementById(strTabName + 'TabR') != null)
		{
		document.getElementById(strTabName + 'TabR').setAttribute("class","currenttabSeparateR");
		}

	showDiv(strTabName);

	document.getElementById('CurrentTabName').value = strTabName;
	}


function showDiv(showElement)
	{
	document.getElementById(showElement).style.display = 'block';
	}
function hideDiv(hideElement)
	{
	document.getElementById(hideElement).style.display = 'none';
	}