$(document).ready(function(){
	/* Animation du menu  */
	$("#menu2 li a").wrapInner( '<span class="out"></span>' );
	
	$("#menu2 li a").each(function() {
		$( '<span class="over">' +  $(this).text() + '</span>' ).appendTo( this );
	});

	$("#menu2 li a").hover(function() {
		$(".out",	this).stop().animate({'top':	'45px'},200); 
		$(".over",	this).stop().animate({'top':	'0px'},200); 

	}, function() {
		$(".out",	this).stop().animate({'top':	'0px'},200); 
		$(".over",	this).stop().animate({'top':	'-45px'},200);
	});


/* Affichage et animation des stats google */
$("#statsPageviews").hide();
$("#statsVisits").hide();
$("#statsPageviewsText").hide();
$("#statsVisitsText").hide();
rotateMetrics();

function rotateMetrics(){
	$("#statsPageviewsText").slideDown("slow");
	$("#statsPageviews").slideDown("slow", function(){
		setTimeout(function(){
			$("#statsPageviewsText").slideUp("slow");
			$("#statsPageviews").slideUp("slow", function(){
				$("#statsVisitsText").slideDown("slow");
				$("#statsVisits").slideDown("slow", function(){
					setTimeout(function() {
						$("#statsVisitsText").slideUp("slow");
						$("#statsVisits").slideUp("slow", function() {
							rotateMetrics();
						});
					}, 3000);
				});
			});
		}, 3000);
	});
}

});

/* test */
function affichePage(page){
	$.post(page,function(data){
		document.getElementById("contenu").innerHTML=data;
	});
}
