jQuery(function ($) {
	$(document).ready(function() {
	$('div#compte').hide();
	$('div#classement').hide();
	$('div#interractif').hide();
	$('div#serveur').hide();
// On définit l'opacité des span à '0' au chargement de la page, ce qui les fait disparaitre
		$("ul#menu span").css("opacity","0");

		$("ul#menu span").hover(function () {
			// On anime le survol en faisant apparaitre le span, opacité à '1' et transition lente (slow)
			$(this).stop().animate({
				opacity: 0.9
			}, {duration:300});
			var theclass = $(this).parent('a').attr('class');
			$("#" + theclass).fadeIn();
  		},
		
		// On définit le comportement quand on quitte la zone
		function () {
			// On anime le span en lui rendant son opactié à '0'
			$(this).stop().animate({
				opacity: 0
			}, {duration:300});
			var theclass = $(this).parent('a').attr('class');
			$("#" + theclass).fadeOut({duration: 800});
		}
		);
		
		$("#compte").hover(function() {
		  $("ul#menu span").add('#compte').stop();
		  $("ul#menu span.compte").add('#compte').animate({opacity:0.9});
	  },
	  function() {
	    $("ul#menu span").animate({
			  opacity: 0
			},{duration:300});
			$(".smenu").css("z-index:0");
			$(".smenu").fadeOut({duration: 800});
	  });
	  
		$("#interractif").hover(function() {
		  $("ul#menu span").add('#interractif').stop();
		  $("ul#menu span.interractif").add('#interractif').animate({opacity:0.9});
	  },
	  function() {
	    $("ul#menu span").animate({
			  opacity: 0
			}, {duration:300});
			$(".smenu").css("z-index:0");
			$(".smenu").fadeOut({duration: 800});
	  });
	  
		$("#serveur").hover(function() {
		  $("ul#menu span").add('#serveur').stop();
		  $("ul#menu span.serveur").add('#serveur').animate({opacity:0.9});
	  },
	  function() {
	    $("ul#menu span").animate({
			  opacity: 0
			}, {duration:300});
			$(".smenu").css("z-index:0");
			$(".smenu").fadeOut({duration: 800});
	  });
	  
	  
		$("#classement").hover(function() {
		  $("ul#menu span").add('#classement').stop();
		  $("ul#menu span.classement").add('#classement').animate({opacity:0.9});
	  },
	  function() {
	    $("ul#menu span").animate({
			  opacity: 0
			}, {duration:300});
			$(".smenu").css("z-index:0");
			$(".smenu").fadeOut({duration: 800});
	  });

	$('a.fancy').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'autoDimensions'    : true
  });
	  
	$('a.fancydw').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'hideOnContentClick': false,
  'autoDimensions'    : false,
  'centerOnScroll' : true,  
  'showCloseButton' : true,
  'hideOnOverlayClick' : true,
  'padding': 0,
  'width' : 950, 
  'height' : 850
  //'onClosed' : function() { window.location = window.location.pathname }
  });
  
	$('a.fancypopuppass').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'hideOnContentClick': false,
  'autoDimensions'    : true,
  'centerOnScroll' : true,  
  'showCloseButton' : true,
  'hideOnOverlayClick' : true,
  'padding': 0,
  'width' : 450, 
  'height' : 450
  });
  
	$('a.fancypopupperso').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'hideOnContentClick': false,
  'autoDimensions'    : true,
  'centerOnScroll' : true,  
  'showCloseButton' : true,
  'hideOnOverlayClick' : true,
  'padding': 0,
  'width' : 600, 
  'height' : 650
  });
  
	$('a.fancyrec').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'hideOnContentClick': false,
  'autoDimensions'    : true,
  'centerOnScroll' : true,  
  'showCloseButton' : true,
  'hideOnOverlayClick' : true,
  'padding': 0,
  'width' : 600, 
  'height' : 700
  });
  
	$('a.fancymap').fancybox({
  'overlayShow': true,
  'overlayOpacity': 0.8,
  'overlayColor' :  '#000',
  'easingIn' : 'elastic',
  'hideOnContentClick': false,
  'autoDimensions'    : true,
  'centerOnScroll' : true,  
  'showCloseButton' : true,
  'hideOnOverlayClick' : true,
  'padding': 0,
  'width' : 966, 
  'height' : 732
  });
	
  
$('#createAccount').submit(function() {
    if ($('input:checkbox', this).is(':checked')) {
        // everything's fine...
    } else {
        alert('Merci d\'accepter les conditions d\'utilisation');
        return false;
    }
});

$(function () {

$('.anythingSlider').anythingSlider({
    easing: "swing",        // Anything other than "linear" or "swing" requires the easing plugin
    autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
    delay: 9000,                    // How long between slide transitions in AutoPlay mode
    startStopped: false,            // If autoPlay is on, this can force it to start stopped
    animationTime: 500,             // How long the slide transition takes
    hashTags: true,                 // Should links change the hashtag in the URL?
    buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
	  pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
	  startText: "Go",             // Start text
    stopText: "Stop"               // Stop text
});

});

														

});
});
