// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {

	// choose text for the show/hide link - can contain HTML (e.g. an image)
	var showText = '[+] Voir';
	var hideText = '[-] Cacher';
	var showText2 = '[+] Lire la suite';
	var hideText2 = '[-] Masquer';
	
	$('.toggle')
		.hide()
		// append show/hide links to the element directly preceding the element with a class of "toggle"
		.prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
	$('.toggle2')
		.hide()
		// append show/hide links to the element directly preceding the element with a class of "toggle"
		.prev().append(' <a href="#" class="toggleLink2">'+showText2+'</a>');
		
	// capture clicks on the toggle links
	$('a.toggleLink').click(function() {
		var $parent = $(this).parent().next('.toggle');
		
		// change the link depending on whether the element is shown or hidden
		$(this).html( $parent.css('display') == 'none' ? hideText:showText);
		
		// toggle the display - uncomment the next line for a basic "accordion" style
		//$('.toggle').hide();$('a.toggleLink').html(showText);
		$parent.toggle('slow');
		
		return false; // return false so any link destination is not followed
	});
	$('a.toggleLink2').click(function() {
		var $parent = $(this).parent().next('.toggle2');
		
		// change the link depending on whether the element is shown or hidden
		$(this).html( $parent.css('display') == 'none' ? hideText2:showText2);
		
		// toggle the display - uncomment the next line for a basic "accordion" style
		//$('.toggle').hide();$('a.toggleLink').html(showText);
		$parent.toggle('slow');
		
		return false; // return false so any link destination is not followed
	});
});
