/**
 * @author mickael
 */



 $(document).ready(function() {
 	
	$("#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"})
			}})
		})
	
});


