	$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute

		//Full Caption Sliding (Hidden to Visible)
		$('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
		});
		
	
	
		});




function anim()
{
//si on est à la troisième position (0+400+400=800px)
if($('#flamme').css('opacity')=='0.3')
{
//on revient à zéro
$('#flamme').animate({opacity: '1'}, 400)
} 
else
{
//on revient à zéro
$('#flamme').animate({opacity: '0.3'}, 400)
} 
}

$(document).ready(function()
{

	
setInterval('anim();',600);

	

function fire()
{

		
		$('.boxgrid.captionfull').mouseover(function(){
			$(".cover").animate({top:'160px'},{queue:false,duration:160});
		});
		
			
		$('.boxgrid.captionfull').mouseout(function(){
				$(".cover").animate({top:'260px'},{queue:false,duration:160});
		}); 
				
		
}


		$('p.btn a').click(function() {
				$('p.btn').removeClass("actif");
				var id = $(this).attr('id');
				var cat = $(this).attr('class');
				var lien = $(this).parent();
				
				
				$.ajax({
					url: 'galerie.php',
					type: 'POST',
					data: 'id=' + id + '&cat=' + cat,
					
					 success: function(data) {
						$('#galerie').html(data);
						$(lien).addClass("actif");
						$('html, body').animate({scrollTop:680}, 'slow');
				 		$(".scrollable").scrollable();
						$(".popup").fancybox({
							'width'				: 700,
							'height'			: '95%',
							'autoScale'			: false,
							'transitionIn'		: 'none',
							'transitionOut'		: 'none',
							'type'				: 'iframe'
						});
								
		//Full Caption Sliding (Hidden to Visible)
		$('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
		});

						 }
				});
			
				return false;
			});
			


  });
	


				 
				 
	


