jQuery(document).ready(function() {

	// choose text for the show/hide link - can contain HTML (e.g. an image)
	var showText='<li>Show Comments</li>';
	var hideText='<li>Hide Comments</li>';

	// initialise the visibility check
	var is_visible = false;

	// append show/hide links to the element directly preceding the element with a class of "toggle"
	jQuery('.toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');

	// hide all of the elements with a class of 'toggle'
	jQuery('.toggle').hide();

	// capture clicks on the toggle links
	jQuery('a.toggleLink').click(function() {

		// switch visibility
		is_visible = !is_visible;

		// change the link depending on whether the element is shown or hidden
		jQuery(this).html( (!is_visible) ? showText : hideText);

		// toggle the display - uncomment the next line for a basic "accordion" style
		//jQuery('.toggle').hide();jQuery('a.toggleLink').html(showText);
		jQuery(this).parent().next('.toggle').slideToggle('slow');

		// return false so any link destination is not followed
		return false;
	
	});
});

jQuery(document).ready(function() {

	// choose text for the show/hide link - can contain HTML (e.g. an image)
	var showText='Add a Comment';
	var hideText='Cancel Comment';

	// initialise the visibility check
	var is_visible = false;

	// append show/hide links to the element directly preceding the element with a class of "toggle"
	jQuery('.toggle2').prev().append(' <a href="#" class="toggleLink2">'+showText+'</a>');

	// hide all of the elements with a class of 'toggle'
	jQuery('.toggle2').hide();

		
	// capture clicks on the toggle links
	jQuery('a.toggleLink2').click(function() {

		// switch visibility
		is_visible = !is_visible;

		// change the link depending on whether the element is shown or hidden
		jQuery(this).html( (!is_visible) ? showText : hideText);

		// toggle the display - uncomment the next line for a basic "accordion" style
		//jQuery('.toggle2').hide();jQuery('a.toggleLink2').html(showText);
		jQuery(this).parent().next('.toggle2').slideToggle('slow');

		// return false so any link destination is not followed
		return false;
	
	});
});

jQuery(document).ready(function() {

	// choose text for the show/hide link - can contain HTML (e.g. an image)
	var showText='Add/Reply to a Comment';
	var hideText='Cancel Comment';

	// initialise the visibility check
	var is_visible = false;

	// append show/hide links to the element directly preceding the element with a class of "toggle"
	jQuery('.toggle3').prev().append(' <a href="#" class="toggleLink3">'+showText+'</a>');

	// hide all of the elements with a class of 'toggle'
	jQuery('.toggle3').hide();

	// capture clicks on the toggle links
	jQuery('a.toggleLink3').click(function() {

		// switch visibility
		is_visible = !is_visible;

		// change the link depending on whether the element is shown or hidden
		jQuery(this).html( (!is_visible) ? showText : hideText);

		// toggle the display - uncomment the next line for a basic "accordion" style
		//jQuery('.toggle2').hide();jQuery('a.toggleLink2').html(showText);
		jQuery(this).parent().next('.toggle3').slideToggle('slow');

		// return false so any link destination is not followed
		return false;
	
	});
});
