var allPageTags = new Array();

function swaptabs(theTab)
	{
	for (var x = 1; x++; x <= 7)
		{
		if (theTab == x)
			{
			doSEWC("table" + x,"display","inline","none");
			// eval("document.tab" + x + ".style.backgroundcolor = '#FFFFFF'");
			}
		else
			{
			doSEWC("table" + x,"display","none","inline");
			// doSEWC("table" + x,"display","inline","none");
			// eval("document.tab" + x + ".style.backgroundcolor = '#D9ECD9'");
			}
		}
	}

function doSEWC(theTab,theGroup,thestyle,theaction,theopposite)
	{
	//Populate the array with all the page tags
	var allPageTags=document.getElementsByTagName("*");
	//Cycle through the tags using a for loop

	for (i=0; i<allPageTags.length; i++)
	   {
		//Pick out the tags with our class name

		if (allPageTags[i].className.indexOf(theGroup) == 0)
			{
			// alert(allPageTags[i].className);
			//Manipulate this in whatever way you want

			if (allPageTags[i].className == theGroup + theTab)
				{
				eval("allPageTags[i].style." + thestyle + "='" + theaction + "'");
				}
			else
				{
				eval("allPageTags[i].style." + thestyle + "='" + theopposite + "'");
				}
			}
		}
	for (x = 1; x <= 7; x++)
		{
		if (x == parseInt(theTab))
			{
			document.getElementById('tab_' + x.toString()).bgColor='#CCCCCC'; 
			}
		else
			{
			document.getElementById('tab_' + x.toString()).bgColor='#FFFFFF'; 
			}
		}
	}
