$(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});}
		
		
	/*-------------image de fond---------*/
	
	$(document).bgStretcher({
		images: ['gifs/fond.jpg'],
		imageWidth: 1200, imageHeight: 1032, resizeAnimate: false, resizeProportionally:false, nextSlideDelay:7000
	});
	
	
	/*-------------Animation footer---------*/
	
	$('#footer').css({'height':'5px'});
	$('#btnFooter').click(function() { 
		if($('#footer').height()<6) {
   			$('#footer').stop().animate({ 'height': '148px' }, 250);
			$('#btnFooter').html('Masquer la navigation');
			$('#btnFooter').css({'backgroundImage':'url(gifs/btn-footer-out.png)'});
		}
		else {
   			$('#footer').stop().animate({ 'height': '5px' }, 250);
			$('#btnFooter').html('Afficher la navigation');
			$('#btnFooter').css({'backgroundImage':'url(gifs/btn-footer.png)'});
		}
  		return false;
   	});
	
	function replaceElement() {
		var b=$('body').height();
		var c=$('#container').height();
		if(b>c) {
			var h=(b-255)+'px';
			$('#container').css({'minHeight':h});
		}
	}
	
	replaceElement();
	
	$(window).resize(function() {
		replaceElement();						  
	});
	
	/*-------------Animation t�moignages---------*/
	
	$('.titre-question').click(function(){
		$(this).parent().find('.text-question').stop(1,1).slideToggle('slow');
	});
	
	/*-------------Animation logo---------*/
	$('#logo-hover').css('opacity','0');
	$('#logo-diapo').hover(function() { //mouse in
   		$(this).find('#logo').stop().animate({ opacity: '0' }, 250);
		$(this).find('#logo-hover').animate({ opacity: '1' }, 250);
  	}, function() { //mouse out
    	$(this).find('#logo').stop().animate({ opacity: '1' }, 250);
		$(this).find('#logo-hover').animate({ opacity: '0' }, 250);
   	});
	
		
});


      

