$(document).ready(function() {
	//document.getElementById('NL_box').innerHTML="<span>Inscrivez-vous</span> � notre lettre d'information";
	$("a.thickbox, a[rel='lightbox']").fancybox({'hideOnContentClick': false,imageScale : true}); 
	$("a#box_ami").fancybox({frameWidth : 300,frameHeight : 200}); 
	if(document.all){$("a#box_fav").click(function(){window.external.AddFavorite(location.href, document.title);});
	}else{$("a#box_fav").fancybox({'hideOnContentClick': true,frameWidth : 400,frameHeight : 100});}
			
	
		
	/*-------------animation logo---------*/
	
	$('#logo').hover(function() { //mouse in
		$(this).stop().animate({ opacity: '0.5' }, 250);
	}, function() { //mouse out
    	$(this).stop().animate({ opacity: '1' }, 250);
   	});
	
	
	/*-------------Footer animate ---------*/
	$('#navigation_frame, .black').hide();
	
	
	$(window).bind('scroll',function(){ 
		var t=window.scrollY;
		
		$('#navigation_frame').css('top',t+100);
												  
	});
	
	$('#navigation').click(function() { 
		$('.black').stop(1,1).fadeIn(1100);
		$('#navigation_frame').stop(1,1).fadeIn(1000);
	});
	
	$('#btnFooter').click(function() { 
		$('.black').stop(1,1).fadeIn(1100);
		$('#navigation_frame').stop(1,1).fadeIn(1000);
	});
	
	$('.black').click(function() { 
		$(this).stop(1,1).fadeOut(2000);
		$('#navigation_frame').stop(1,1).fadeOut(1100);
	});
	
	$('.close').click(function() { 
		$('.black').stop(1,1).fadeOut(2000);
		$('#navigation_frame').stop(1,1).fadeOut(1100);
	});
	
	/*-------------Newsletter ---------*/
	$('#input_newsletter').val('Votre adresse mail');
	
	
	/*-------------nom bouteille ---------*/
	
	
	
	var nbAncetre = $('.histoire').length;
	
	
	
	$('.histoire').click(function() {
		var histoire = $(this).attr('id');
		
		var tab_id = histoire.split('-');
    	var id = tab_id[tab_id.length-1]; //permet de récupérer le chiffre
		
		$('.info-histoire').css('display','none');
		$('#infos'+id).css('display','block');
		
		//// etat selected
		 $('.histoire div.none').removeClass('DisplayBlock');
		
		$(this).find('div.none').addClass('DisplayBlock');
		 
	
	
	});
	
	
	$('.histoire div.none').css('display','none');
	
	$('.histoire').hover(function() { 
		
		$(this).find('div.none').css('display','block');
	}, function() {
		$('.histoire div.none').css('display','none');
		
				  
			
	});
	
	
	
	
	
	

});


      

