$(document).ready(function() 
{
	hs.graphicsDir = './lib/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.wrapperClassName = 'borderless floating-caption';
	hs.fadeInOut = true;
	hs.dimmingOpacity = .75;
	hs.showCredits = false;

	$(".pasliresuite").hide(); 
	$(".off").hide(); 
	$(".element").hide(); 
	$(".element2").hide();
	$(".elementie").hide(); 
	$(".on").show(); 
	$('.toggler').click(function() 
	{
		if($(this).next(".element:visible").length == 0)
		{
			
			$(".element").slideUp("normal"); 
			$(".liresuite",this).hide(500);
			$(".pasliresuite",this).show(500);
			$(this).next(".element").slideDown("normal"); 

		}
		else
		{
			$(".liresuite",this).show(500);
			$(".pasliresuite",this).hide(500);
			$(".element").slideUp("normal");

		}
		return false;
		
	}); 
	//TOGGLER 2 
	$('.toggler2').click(function() 
	{
		if($(this).next(".element2:visible").length == 0)
		{
			
			$(".element2").slideUp("normal"); 
			$(".liresuite",this).hide(500);
			$(".pasliresuite",this).show(500);
			$(this).next(".element2").slideDown("normal"); 

		}
		else
		{
			$(".liresuite",this).show(500);
			$(".pasliresuite",this).hide(500);
			$(".element2").slideUp("normal");

		}
		return false;
		
	}); 
	$('.togglerie').click(function() 
	{
		if($(this).next(".elementie:visible").length == 0)
		{
			
			$(".elementie").slideUp("normal"); 
			$(".liresuite",this).hide(500);
			$(".pasliresuite",this).show(500);
			$(this).next(".elementie").slideDown("normal"); 
			
		}
		else
		{
			$(".liresuite",this).show(500);
			$(".pasliresuite",this).hide(500);
			$(".elementie").slideUp("normal");
			
		}
		return false;
		
	});

	
	window.onload = function () {
	   $('.diaporama2').cycle(
		{
			fx:     'fade', 
			speed:   1000, 
			timeout: 3000
		});
	   $('.diaporama').cycle(
		{
			/*fx:     'scrollHorz', 
			speed:   4000, 
			timeout: 2000,*/
			fx:     'fade', 
			speed:   1000, 
			timeout: 3000, 
			after: function(){ $('.titreImageHeader2').hide(); $('.' + $(this).attr("id")).show();}
		});
		$('.diaporamacom').cycle({
			fx:   'shuffle', 
			shuffle: { 
			left:  560 
			}, 
			next:   '#nextcom', 
			prev:   '#prevcom',
			timeout: 0, 
			speed:   500
		});
		
		
		$("#next2").hide();
		$("#prev2").hide();
		$('.diaporama').hover(function(){
			$("#next2").show(500);
			$("#prev2").show(500);
 
		});
		$('.general').hover(function(){
			$("#next2").hide(200);
			$("#prev2").hide(200);
 
		});
		$('.diaporama img').show();
	}
});

