function xpand(xref){
	//hide the other tabs
	$('.expand-content:not(#' + xref + ')')
		.slideUp('fast', function(){$('.expand-content#' + xref).slideDown('fast');});
		
	
	
	//clear highlight from previous title
	$('.expand a:not(#' + xref + ')').removeClass('selected');
	
	//highlight current title
	$('.expand a[href=#' + xref + ']').addClass('selected');
}

$(document).ready(function() {
	
	$('.expand-content').hide();
	
	$(".expand a").click(function(){
		
		xref = $(this).attr("href").split('#')[1];
		
		xpand(xref);
		
		
		return false;
		
	});
	
	$("a.expand-all").click(function(){
		if ($(this).hasClass('selected')) {
			$(this).removeClass('selected');
			$('.expand-content').hide();
			$(this).text('Expand All');
		} else {
			$(this).addClass('selected');
			$('.expand-content').show();
			$(this).text('Collapse All');
		}
	});
});
