	function afficheplan()
	{
		$("#planGoogle").css({visibility:"visible"});	
		
	}
		$("#planGoogle").live("mouseout",function()
				{
					$(this).css("visibility","hidden");	
				});	
	
		$(function() {
            $('div.gallery img').slidingGallery();

        });
		var t;
		function avancetouseul()
		{
			

				$.galleryUtility.slideLeft();
				t = setTimeout("avancetouseul()",3000);	
		
			
		}
         $(document).ready(function() {setTimeout("avancetouseul()",1000); });


	function affichesmenu()
	{
		$("#sous_menu").fadeIn("slow");		
		
	}

	function affiche_bloc_agence(id)
	{
			$(".bloc_info_agence").each(
				function()
				{
					if (  $(this).css("display") == "block" )
					{
						$(this).slideUp("fast");	
					}

				});
			
			
			if (  $("#"+id).css("display") == "block" )
			{
				$("#"+id).slideUp("fast");	
			}
			else
			{
				
				$("#"+id).slideDown("fast");		
			}
		
	}

		

	var delay_montant = 250;
	var delay_descendant = 250;



	$(document).ready(function() {
	



			$(".bloc_agence_haut").click(function(){
				
				$(this).parent(".bloc_agence").parent(".bloc_info_agence").slideUp("fast");	
				
				});
		
	
		

		
	
		
		
		if(document.getElementById('gallery')){		
		slideShow();		
		}
			$(".bloc1").hover(
				function(){
					
					if ( $(this).children(".image1").children(".texte_fond_noir1").css("marginTop") == "-90px" )
					{
						 
						 $(this).children(".image1").children(".texte_fond_noir1").animate( {marginTop:"-301px",height:"286px", paddingTop:"15px"},delay_montant);
						 $(this).children(".image1").children(".texte_fond_noir1").children("p").fadeIn("fast");
						
					}
				},				  
				function(){
	
						 $(this).children(".image1").children(".texte_fond_noir1").animate( {marginTop:"-90px",height:"85px", paddingTop:"4px"},delay_descendant);
						 $(this).children(".image1").children(".texte_fond_noir1").children("p").fadeOut("fast");
						
				}
			);
			
			$("#sous_menu").hover(
				function(){
					
					
				},				  
				function(){
					//$(this).fadeOut("fast");

						
				}
			);	
			
			$("#bloc3").hover(
				function(){
					
						$("#sous_menu").fadeOut("fast");
					
				}
			);
			$("#bloc1").hover(
				function(){
				 
						$("#sous_menu").fadeOut("fast");
					
				}
			);		
				
		
	});
	
	
function slideShow() {

	//Set the opacity of all images to 0
	$('#gallery a').css({opacity: 0.0});
	
	//Get the first image and display it (set it to full opacity)
	$('#gallery a:first').css({opacity: 1.0});
	

	
	//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('gallery()',3000);
	
}

function gallery() {
	
	//if no IMGs have the show class, grab the first image
	var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));

	//Get next image, if it reached the end of the slideshow, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));	
	
	//Get next image caption
	var caption = next.find('img').attr('rel');	
	
	//Set the fade in effect for the next image, show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);

	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	
	//Set the opacity to 0 and height to 1px
	$('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });	
	
	//Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect
	$('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );
	
	//Display the content
	$('#gallery .content').html(caption);
	
	
}		
	
