$(document).ready(
	
	function (){
		$("div.loading").hide();
		$("a.barre").removeAttr("href");
		var host_root  = "http://"+window.location.hostname+"/";
		var page_link = $("#page_link").html();
		var data = "chargement...";
			
		$("a.barre").click(function(){
			if($(this).parent("div").attr("class")=="on"){
				//var link_to = $(this).attr('title');
				var link_to = $(this).attr('title');
				//location.href = host_root+"index.php?page="+link_to;
				location.href = link_to;
			}else{
				$(this).parent("div").SlideOutRight("slow", function(){
					$(this).attr("class","on");
					$(this).SlideInRight("slow", function(){
						//var link_to = $(this).children("a.barre").attr('title');
						//location.href = host_root+"index.php?page="+link_to;
						var link_to = $(this).children("a.barre").attr('title');
						location.href = link_to;
					});
				});
				$("div.on").SlideOutRight("slow", function(){
					$(this).attr("class","off");
					$(this).SlideInRight("slow");
				});
			}
		})
		
		$("div.off").children("a.barre").hover(
			function(){
				if($(this).parent("div").attr("class")=="off")$(this).parent("div").attr("class", "hover");
			}, 
			function(){
				if($(this).parent("div").attr("class")=="hover")$(this).parent("div").attr("class", "off");			
			}
		)
})