function flip_arrow(bid, elt_id)
{
	if(!open_arrows[bid][elt_id])
	{
		open_arrows[bid][elt_id] = true;			
		
		//Was the arrow originally open? If so, we are returning it to its original state.
		if(orig_open_arrows[bid][elt_id])
			MM_swapImgRestore(elt_id);
			
		//Not originally open? We're initiating a swap.
		else
			MM_swapImage(elt_id,'','/modules/StaticContent/pnimages/pub_open_arrow.gif',1);
	}
	else
	{
		open_arrows[bid][elt_id] = false;
	
		//Was the arrow originally open? If so, we starting an image swap (to close).
		if(orig_open_arrows[bid][elt_id])
			MM_swapImage(elt_id,'','/modules/StaticContent/pnimages/pub_closed_arrow.gif',1);

		//Not originally open? We're finishing a swap.
		else
			MM_swapImgRestore(elt_id);
	}
}

//Toggles the display of the children nav rows of parent_scid
function toggle_display(bid, parent_scid)
{
	if(open_arrows[bid]["nav_arrow_" + parent_scid])
		new_value = "block";
	else
		new_value = "none";
		
	for(scid in children_of[bid][parent_scid])
		set_display(bid, scid, new_value);
	
	return true;

}

function set_display(bid, scid, new_value)
{
	elt_id = "nav_row_" + scid;
	elt = document.getElementById(elt_id);

	if(elt)
	{
		setStyleById(elt_id, "display", new_value)
		arrow_open = open_arrows[bid]["nav_arrow_" + scid];
		
		//Only proceed with changing the childrens' display values
		//if EITHER their new value should be 'none' (hiding) OR their new value is 'block' and
		//the parent element's display arrow is set to be open. For elements for which the display 
		//arrow is set closed, we want to display the element but not its children.
		if((new_value == "block" && arrow_open)
			|| new_value == "none")
		{
			for(child_scid in children_of[bid][scid])
			{				
				child_elt_id = "nav_row_" + child_scid;
				set_display(bid, child_scid, new_value);
			}
		}
		
//			alert(debugStr);
	}
	else
		return true;
}