

function test()
{
	alert("This is a test");
}

function changeBenefit(containerId, elementId)
{
	var elements = document.getElementById(containerId).getElementsByTagName('div');
	var displayNo = -1;
	for(var count = 0; count < elements.length; count++)
	{
		//alert(elements[count].id);
		if(elements[count].id == 'benefit_'+elementId)
		{			
			displayNo = count;
		}
		else
		{
			elements[count].style.display = 'none';
		}
	}
	
	if(displayNo != -1)
	{
		elements[displayNo].style.display = '';
	}
}




function openNewWindow(url)
{
	if(url == null || url.length == 0)
		return;
		
	myRef = window.open(url,'mywin', 'left=20,top=20,width=800,height=600,toolbar=yes,resizable=yes,scrollbars=yes');
	myRef.focus();
}

function switchMenu(obj) 
{
	alert('switchMenu!');
	var el = document.getElementById(obj);
	alert(el);
//	el.style.block = 'none';
//	el.style.visibility = 'hidden';
	el.style.block = (el.style.display != 'inline') ? 'inline' : 'none';
	alert('finished');
}

function toggleblocks (postid) 
{
	var whichpost = document.getElementById(postid);
	if (whichpost.className=="expandblock") 
	{
		whichpost.className="collapseblock";
	}
	else 
	{
		whichpost.className="expandblock";
	}
} 

function issearchok()
{
	var searchText = document.forms.searchForm.searchText.value;
	var brandValue = document.forms.searchForm.brand.selectedIndex;
//	alert('brand value:'+brandValue);
	if(searchText.length == 0 && brandValue == 0)
	{
//		alert('nothing set');
		return false;
	}
	else
	{
		document.forms.searchForm.submit();
		return true;
	}
}