function activate(menuitem,div)
{
	//get an array of all the elements in the document
	var elementArray = [];
	if (typeof document.all != "undefined")
	{
		elementArray = document.all;
	}
	else
	{
		elementArray = document.getElementsByTagName("*");
	}	
	
	//get an array of all the elements in the document with the class active
	var matchedArray = [];
	for (var i = 0; i < elementArray.length; i++)
	{
		if (hasClass(elementArray[i], 'active'))
		{
			matchedArray[matchedArray.length] = elementArray[i];
		}
	}
	
	//now remove all active class
	for (var i = 0; i < matchedArray.length; i++)
	{
		if (hasClass(matchedArray[i], 'active'))
		{
			removeClass(matchedArray[i],'active');				
		}
	}
	var activeMenuItem = document.getElementById(menuitem);
	addClass(activeMenuItem,'active');
	
	/*****************************************************/	
	
	//get an array of all the elements in the document with the class content
	var matchedArray = [];
	for (var i = 0; i < elementArray.length; i++)
	{
		if (hasClass(elementArray[i], 'content'))
		{
			matchedArray[matchedArray.length] = elementArray[i];
		}
	}
	
	//now add hidden class, if it is not yet hidden
	for (var i = 0; i < matchedArray.length; i++)
	{
		if (!hasClass(matchedArray[i], 'hidden'))
		{
			addClass(matchedArray[i],'hidden');				
		}
	}
	
	var contentDiv = document.getElementById(div);
	removeClass(contentDiv,'hidden');
	addClass(contentDiv,'show');	
}


function hasClass(target, theClass)
{	
	var pattern = new RegExp("(^| )" + theClass + "( |$)");
	if (pattern.test(target.className))
	{
		return true;			
	}		
	return false;
}

function addClass(target, theClass)
{
	if (!hasClass(target, theClass))
	{
		if (target.className == "")
		{
			target.className = theClass;
		}
		else
		{
			target.className += " " + theClass;
		}
	}
}

function removeClass(target, theClass)
{
	var pattern = new RegExp("(^| )" + theClass + "( |$)");
	target.className = target.className.replace(pattern, "$1");
	target.className = target.className.replace(/ $/, "");
};
