/**

How to structure the markup:

.toggle-container
	a.toggle-trigger-show-all
	a.toggle-trigger-hide-all
	h4 a.toggle-trigger
	.toggle-target (.toggle-initially-hidden)

The only thing to watch out for, is how to "findTargetFromTrigger".

**/


$(function() {

	$('.toggle-initially-hidden').hide();
		
	$('.toggle-trigger-show-all').click(function() {
		var $container = $(this).closest('.toggle-container');
		$container.find('.toggle-target').slideDown('fast');
		return false;
	});
	
	$('.toggle-trigger-hide-all').click(function() {
		var $container = $(this).closest('.toggle-container');
		$container.find('.toggle-target').slideUp('fast');
		return false;
	});
	
	$('.toggle-trigger').click(function() {
		var $target = findTargetFromTrigger($(this));
		$target.slideToggle();
		return false;
	});
	
	function findTargetFromTrigger($t) {
		// The markup suggests we should go up two parents,  then down to the first UL
		return $t.parent().parent().find('ul:first');
	}

});