// use the jQuery alternative for flashembed.domReady
$(document).ready(function() {	
						   
						   
	//menu effect
	$('#menu a').mouseover(function() {
	  	$(this).parent().find('span').fadeIn(200);
	});	   
	$('#menu li').mouseout(function() {
	  	$(this).parent().find('span').fadeOut(200);
	});	

		
	// Flash home
	$("#close").click(function() {
		// same as in previous example
		$("#flash2").hide();	
		$(this).hide();	
		$("#home").fadeIn(1100);	
	});
	
	//
	$(".bloc p").mouseover(function() {		
	  	$(this).parent().css({
    	opacity: 1 });	
	});	   
	$(".bloc p").mouseout(function() {
	  	$(this).parent().css({
    	opacity: 0.9 });	
	});	
	
	//Slide home
	$(".slidetabs").tabs(".images > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
	
		// start from the beginning after the last tab
		rotate: true
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();
	
	//Slide uniforme
	$(".menu_slide").tabs(".tenues > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
	
		// start from the beginning after the last tab
		rotate: true
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();

	//MENU_VERTICAL_SLIDE_UNIFORMES
	//Get our elements for faster access and set overlay width
	var div = $('div.menu_slide'),
		ul = $('ul#menu_list'),
		ulPadding = 40;
	
	//Get menu width
	var divHeight = div.height();

	//Remove scrollbars	
	div.css({overflow: 'hidden'});
	
	//Find last image container
	var lastLi = ul.find('li:last-child');
	
	//When user move mouse over menu
	div.mousemove(function(e){
		//As images are loaded ul width increases,
		//so we recalculate it each time
		var ulHeight = lastLi[0].offsetTop + lastLi.outerHeight() + ulPadding;	
		var top = (e.pageY - div.offset().top) * (ulHeight-divHeight) / divHeight;
		div.scrollTop(top);
	});
	
	//Slide uniforme
	$(".thumb_slide").tabs(".tenues > div", {
	
		// enable "cross-fading" effect
		effect: 'fade',
		fadeOutSpeed: "slow",
	
		// start from the beginning after the last tab
		rotate: true
	
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();
	

	
	//MENU_HORIZONTAL_SLIDE_UNIFORMES
//Get our elements for faster access and set overlay width
	var div_H = $('div.thumb_slide'),
		ul_H = $('#thumb_list'),
		ulPadding_H = $('#thumb_list').width()/100;
	//Get menu width
	var divWidth_H = div_H.width();

	//Remove scrollbars	
	div_H.css({overflow: 'hidden'});
	
	//Find last image container
	var lastLi_H = ul_H.find('li:last-child');
	
	//When user move mouse over menu
	div_H.mousemove(function(e){
		//As images are loaded ul width increases,
		//so we recalculate it each time
		
		var ulWidth = lastLi_H[0].offsetLeft + lastLi_H.outerWidth() + ulPadding_H;
		
		
		var left = (e.pageX - div_H.offset().left) * (ulWidth-divWidth_H) / divWidth_H;
	
		div_H.scrollLeft(left);
		
	});
});





