/**
 * @author mickael
 */



 $(document).ready(function() {
	 $(".meta_description").css('display','none');
	 
	 $("#products").tabs("div.description", {event:'mouseover'});
	 
	$("#contact").validate({
   rules: {
      nom: "required",
      prenom: "required",
	  mail: "required",
	  telephone: "required",
	  message: "required"
      
   },
   messages: {
    nom:"<span style='color:red;'>obligatoire</div>",
    prenom:"<span style='color:red;'>obligatoire</div>",
	mail:"<span style='color:red;'>obligatoire</div>",
	telephone:"<span style='color:red;'>obligatoire</div>",
	message:"<span style='color:red;'>obligatoire</div>"
 }
});
	
 	 $.easing.bouncy = function (x, t, b, c, d) { 
    var s = 1.70158; 
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
} 
$.tools.tooltip.addEffect("bouncy", 
 
    // opening animation 
    function(done) { 
        this.getTip().animate({top: '+=15'}, 500, 'bouncy', done).show(); 
    }, 
 
    // closing animation 
    function(done) { 
        this.getTip().animate({top: '-=15'}, 500, 'bouncy', function()  { 
            $(this).hide(); 
            done.call(); 
        }); 
    } 
);

	$(".lightbox[rel]").overlay();



	$(".tips img[title]").tooltip({tip: '#tip', effect: 'bouncy'}); 

	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:5000,
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});

$(".boutton").button({ icons: {primary:'ui-icon-link'} });
$(".envoyer").button({ icons: {primary:'ui-icon-key'} });
$(".envoyer_formulaire").button({ icons: {primary:'ui-icon-extlink'} });
	
	$("#flowpanes").scrollable({size: 1}).circular().mousewheel(400).navigator({ 
        navi: "#flowtabs", 
        naviItem: 'a', 
        activeClass: 'current' 
    }); 
	
	

});

$(function(){



	$('#menu_du_site li')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 77px)"}, {duration:700})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 77px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "0 0px"})
			}})
		})
		
		/*PREMIER APPZAR*/
		/*
		$('#index1').mouseover(function(){
				$('#index1').animate({backgroundPosition:"(0 -110px)",lineHeight:"250px",fontSize:25},300);
				
				$('#index_right').animate({backgroundColor:'#85829D'},300);
				$('#index_right div').animate({opacity:0},300, function() {
				$('#index_right div').empty();
				$('#index_right div').prepend($('.index1').text());
				$('#index_right div').animate({opacity:1},300);
				$('#index_right').animate({backgroundColor:'white'},300);
			  });
		}).mouseout(function(){
			
			$('#index1').animate({backgroundPosition:"(0 0px)",lineHeight:"160px",fontSize:20},300);
			
		  });
	
	$('#index2').mouseover(function(){
		$('#index2').animate({backgroundPosition:"(0 -100px)",lineHeight:"250px",fontSize:25},300);
		
		$('#index_right').animate({backgroundColor:'#85829D'},300);
		$('#index_right div').animate({opacity:0},300, function() {
		$('#index_right div').empty();
		$('#index_right div').prepend($('.index2').text());
		$('#index_right div').animate({opacity:1},300);
		$('#index_right').animate({backgroundColor:'white'},300);
	  });
}).mouseout(function(){
	
	$('#index2').animate({backgroundPosition:"(0 0px)",lineHeight:"160px",fontSize:20},300);
	
  });
	$('#index3').mouseover(function(){
		$('#index3').animate({backgroundPosition:"(0 -90px)",lineHeight:"250px",fontSize:25},300);
		
		$('#index_right').animate({backgroundColor:'#85829D'},300);
		$('#index_right div').animate({opacity:0},300, function() {
		$('#index_right div').empty();
		$('#index_right div').prepend($('.index3').text());
		$('#index_right div').animate({opacity:1},300);
		$('#index_right').animate({backgroundColor:'white'},300);
	  });
}).mouseout(function(){
	
	$('#index3').animate({backgroundPosition:"(0 0px)",lineHeight:"160px",fontSize:20},300);
	
  });
	$('#index4').mouseover(function(){
		$('#index4').animate({backgroundPosition:"(0 -105px)",lineHeight:"250px",fontSize:25},300);
		
		$('#index_right').animate({backgroundColor:'#85829D'},300);
		$('#index_right div').animate({opacity:0},300, function() {
		$('#index_right div').empty();
		$('#index_right div').prepend($('.index4').text());
		$('#index_right div').animate({opacity:1},300);
		$('#index_right').animate({backgroundColor:'white'},300);
	  });
}).mouseout(function(){
	
	$('#index4').animate({backgroundPosition:"(0 0px)",lineHeight:"160px",fontSize:20},300);
	
  });
	*/	
	});

