function show(name, menuid)
{
	allheadings = getElementsByClass('category_heading', $('merch_item_desc'));
	for (var headloop = 0; headloop < allheadings.length; headloop++)
	{
		allheadings[headloop].style.display = "none";	
	}
	if ($("heading" + name) != false)
	{
		$("heading" + name).style.display = "block";
	}
	
	
	allcats = getElementsByClass('full_category_listing', $('merch_item_desc'));
	for (var loop = 0; loop <allcats.length; loop++)
	{
		allcats[loop].style.display = "none";
	}	
	if ($(name) != false)
	{
		$(name).style.display = "block";
		$('no_items').style.display = "none";
	}else
	{
		$('no_items').style.display = "block";		
	}
	
	
	allarrows = getElementsByClass('merch_arrow', $('middle_merch_verticalmenu'));
	for (var arrowloop = 0; arrowloop <allarrows.length; arrowloop++)
	{
		allarrows[arrowloop].style.visibility = "hidden";
	}	
	$("img" + name).style.visibility = "visible";
	
}

function image_select(imageid,pic,level)
{
	//for each pic we show, we have to test that the other pics exist 
	//before we try to hide them, or set the background color.
	if (pic == 1)
	{
		$(level + '_' + imageid + '_1').style.display = "block";
		$('but_' + level + '_' + imageid + '_1').style.backgroundColor = "white";
		$('but_' + level + '_' + imageid + '_1').style.padding = "4px";
		$('but_' + level + '_' + imageid + '_1').style.border = "1px solid black";
		
		if ($(level + '_' + imageid + '_2') != null)
		{
			$(level + '_' + imageid + '_2').style.display = "none";	
			$('but_' + level + '_' + imageid + '_2').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_2').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_2').style.border = "none";			
		}
		
		if ($(level + '_' + imageid + '_3') != null)
		{
			$(level + '_' + imageid + '_3').style.display = "none";
			$('but_' + level + '_' + imageid + '_3').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_3').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_3').style.border = "none";						
		}
		
	}
	else if (pic == 2)
	{
		if ($(level + '_' + imageid + '_1') != null)
		{
			$(level + '_' + imageid + '_1').style.display = "none";
			$('but_' + level + '_' + imageid + '_1').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_1').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_1').style.border = "none";						
		}
				
		$(level + '_' + imageid + '_2').style.display = "block";	
		$('but_' + level + '_' + imageid + '_2').style.backgroundColor = "white";
		$('but_' + level + '_' + imageid + '_2').style.padding = "4px";
		$('but_' + level + '_' + imageid + '_2').style.border = "1px solid black";		
		
		if ($(level + '_' + imageid + '_3') != null)
		{				
			$(level + '_' + imageid + '_3').style.display = "none";				
			$('but_' + level + '_' + imageid + '_3').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_3').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_3').style.border = "none";						
		}
	}else if (pic == 3)
	{
		if ($(level + '_' + imageid + '_1') != null)
		{
			$(level + '_' + imageid + '_1').style.display = "none";
			$('but_' + level + '_' + imageid + '_1').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_1').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_1').style.border = "none";						
		}
		
		if ($(level + '_' + imageid + '_2') != null)
		{		
			$(level + '_' + imageid + '_2').style.display = "none";	
			$('but_' + level + '_' + imageid + '_2').style.backgroundColor = "transparent";
			$('but_' + level + '_' + imageid + '_2').style.padding = "0px";
			$('but_' + level + '_' + imageid + '_2').style.border = "none";						
		}
				
		$(level + '_' + imageid + '_3').style.display = "block";
		$('but_' + level + '_' + imageid + '_3').style.backgroundColor = "white";
		$('but_' + level + '_' + imageid + '_3').style.padding = "4px";
		$('but_' + level + '_' + imageid + '_3').style.border = "1px solid black";		
	}
}
