$(document).ready(function(){

	//On cache tout
	$("#window img").hide();
	$("#aboutus").css("visibility","hidden");
	
	//On determine l'element a afficher
	var url		=	document.location.href.split("#");
	if(url[1]){var current = '#'+url[1];}
	else{var current = '#img1';}	
	//alert(current);
	
	
	
	//On affiche
	document.location.href = current;
	
	if(current=='#aboutus'){
		$("#aboutus").css("visibility","visible");
	}
	else{$("#aboutus").css("visibility","hidden");}
	
	$(current).show();

	
	//Lors d'un passage souris
	$(".imgb").hover(function(){

  		//On cache l'element
    	$(current).hide();
		$("#aboutus").css("visibility","hidden");
		//On recupere l'image a afficher
		var img = $(this).attr('href').split("#");
		if(img[1]){current= '#'+img[1];}
		else{current = '#img1';}
		
		//On affiche
		document.location.href = current;
		$(current).show();
		return false;
    	},function () {});
    	
   
   	//Lors d'un clic bouton
	$(".small").click(function(){

  		//On cache l'element
    	$(current).hide();
   
		//On recupere l'element a afficher
		var img = $(this).attr('href').split("#");
		if(img[1]){current= '#'+img[1];}
		else{current = '#img1';}
		
		//On affiche
		document.location.href = current;
		$(current).show();
		return false;
    	});
    	

	//Lors d'un clic map/au
	$("#clickmap").click(function(){

  		//On cache l'element
    	$(current).hide();
		$("#aboutus").css("visibility","hidden");
		
		//On affiche
		document.location.href = "#map";
		$("#map").show();
		return false;
    });



	//Lors d'un clic map/au
	$("#clickaboutus").click(function(){

  		//On cache l'element
    	$(current).hide();
   		$("#aboutus").css("visibility","visible");
		
		//On affiche
		document.location.href = "#aboutus";
		$("#aboutus").show();
		return false;
    });
    
    

});


