var animation_in_progress = false;

function showCategory(id)
{
	//Check if the specified category is already selected	
	if(	$('.category-heading.active').attr('id') == 'category_label_'+id )
	{
		return;
	}

	//set session-wide category selection
	$.ajax({url: '/do/do-ajax.pbs?action=setcat&cat='+id})

	//unhighlight old label and highlight the new one
	$('.category-heading.active').removeClass('active');
	
	//fold the active category
	$('#news-accordion div.active ul').animate({ height: '0'}, 1000);
	//unfold the specified category
	$('#category_'+id+' ul').animate({ height: '329px'}, 1000);
	
	//set the corresponding classes
	$('#news-accordion div.active').removeClass('active');
	$('#category_'+id).addClass('active'); 
	$('#category_label_'+id).addClass('active');
	
}
