//JQUERY DOCUMENT
//EXCERPT CONTENT TEXT

$(function(){
	
	//Réduit le texte ayant la classe "lienReduction" ou "toogleText" et ajoute une lien en dessous
	$(".toggleText").hide().after('<a class="toggleLink" href="#" id="maximizeText">Read more</a>');
	
	//Fonction Toggle sur le clic du lien
	$(".toggleLink").click(function(){
		$(".toggleText").slideToggle("slow");
		var LinkStr = $(".toggleLink").html();
		if(LinkStr == "Read more"){
			$(".toggleLink").html("Reduce");
			$(this).attr({id: "minimizeText"});
		}else{
			$(".toggleLink").html("Read more");
			$(this).attr({id: "maximizeText"});
		}
		
		return false;
	});
	
	// Menu Accordéon
	var arraySection = new Array();
	arraySection[""] = -1;
	arraySection["section-explorer"] = 0;
	arraySection["section-travailler"] = 1;
	arraySection["section-vivre"] = 2;
	var section = $('#principal').attr('class');
	$('#principal')
	$("#menu_principal").accordion({
		active:arraySection[section],
		autoHeight:true,
		collapsible:false,
		header:'h1',
		animated: 'bounceslide',
		event:'mouseover'
	});
	
	$('#facebook').tooltip({
		tip: ".tooltip",
		position: "center right",
		direction: "right"
	});
	
	// Fancybox
	$("div#duos a").fancybox({
		'centerOnScroll': false,
		'imageScale': false,
		'hideOnContentClick': false,
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayShow': true,
		'overlayOpacity': 0.8
	});
	$("a#inline").fancybox({
		'centerOnScroll': false,
		'imageScale': false,
		'hideOnContentClick': false,
		'overlayShow': true,
		'overlayOpacity': 0.8,
		'zoomSpeedIn': 500,
		'zoomSpeedOut': 500,
		'easingIn': 'easeOutCubic',
		'easingOut': 'easeOutCubic'
	});
	
});