/**
 * Changes the mouse over state of the specified button.
 * 
 * @param the button for which to change the state.
 * @param the name of the state to set the button to.
 */
function button_state(button, state)
{
	button.id = button.id.replace(/_(on|off)/, "_" + state);
	
	return true;
}

/**
 * Changes whether submenu items are shown selected or not.
 * 
 * @param the submenu item that is to be shown in a different
 *        selected state.
 * @param whether to show the submenu item as selected or not.
 * @return true
 */
function select_submenu(menu_item, show_selected)
{
	var selector;
	var result = false;
	
	if (document.getElementById)
	{
		selector = document.getElementById(menu_item.id.replace(/item/i, 'selector'));
	}
	else if (document.all)
	{
		selector = document.all[menu_item.id.replace(/item/i, 'selector')];
	}
	
	if (menu_item.className.match(/highlight$/i))
	{
		menu_item.className = 'submenu_item';
		if (selector)
		{
			selector.className = 'whitespace';
			result = true;
		}
	}
	else
	{
		menu_item.className = 'submenu_highlight';
		if (selector)
		{
			selector.className = 'purplespace';
			result = true;
		}
	}
	
	return result;
}
