$(document).ready(function()
{
	
	
	
	$(".adresse-tourisme").hide();
	








$('.voir-adresse').toggle(function() {
 $(this).parent('p').next('.adresse-tourisme').slideDown();
  return false;

}, function() {
 $(this).parent('p').next('.adresse-tourisme').slideUp();
 return false;
});








	$('html[id!="homepage"] #font').hover(
  function () {
   $(this).animate({opacity:1});
  }, 
  function () {
   $(this).animate({opacity:0.5});
  }
);

	
	$("#album a").fancybox();
	
	 // zebrure dans les tableaux
	$("#contenu tr:nth-child(odd)").addClass("zebra");	


// header fixe jusqu'à 540px

var windw = this;

$.fn.followTo = function ( pos ) {
    var $this = this,
        $window = $(windw);
    
    $window.scroll(function(e){
        if ($window.scrollTop() > pos) {
            $this.css({
                position: 'absolute',
                top: pos
            });
        } else {
            $this.css({
                position: 'fixed',
                top: 0
            });
        }
    });
};

$('#entete').followTo(540);



// header fixe jusqu'à 540px

	
	Galleria.loadTheme('/galleria/themes/classic/galleria.classic.min.js');


	 
	 
	 
	 
	  $('#book').galleria({
		    data_source: data,
        thumbnails: false,
		autoplay: true,
		imageCrop: 'height',
		fullscreenCrop: 'height',
		transition: 'slide',
		initialTransition: false,
		debug: false,
		preload:1
    });
	
	$('.tournesponsors').cycle();
	
	
	 
	
	function tadel(){
	var monscroll = $('html').offset();
			
			if(monscroll.top==0){
	 $('html[id!="homepage"], html[id!="homepage"] body').animate({scrollTop:540}, 'slow');	
	 
	
			} 
			
			$('#book').data('galleria').unbind();	
		
	}
	
	    $('#book').data('galleria').bind("loadfinish", function(e) {
			
			
			setTimeout(tadel, 1000);
			
			
});

});
