$(document).ready(function () {
	var left = $("#menu-left").height()+85;
	//var div = $("#bloc-centre").attr("name");
	var centre = $("#calendar").height();
	
	/*alert("Right : "+$("#right").height());
	alert("Centre : "+centre);
	alert("Left : "+left);*/
	if( centre > $("#right").height() && centre > left ){
		$("#footer").css("margin-top",centre+209);
	}
	else
	{
		if( $("#right").height() > left ){
			$("#footer").css("margin-top",($("#right").height()-centre)+5);
		}
		else{
			$("#footer").css("margin-top",(left-centre)-10);
		}
	}
		
	$("#center-left ul li, #center-right ul li").prepend("<img src=\"img/marqueur-liste-microsoft.gif\" />");
	
	$("#recherche img").mousedown(function () {
		$(this).attr("src","img/btn-ok-recherche-over.gif");
	});
	
	$("#recherche img").mouseup(function () {
		$(this).attr("src","img/btn-ok-recherche-out.gif");
	});
	
	$("#recherche img").live("click", function(){
		document.recherche.submit("recherche.html");
	});
	
	$("#recherche img").hover(function () {
		$(this).css("cursor","pointer");
	});
	
	$("#recherche img").click(function () {
		document.frm_recherche.submit();
	});
	
	$(".calendrier_previous").hover(function () {
		$(this).css("cursor","pointer");
	});
	
	$(".calendrier_previous").click(function () {
		changer_panneau_previous();
	});
	
	$(".calendrier_next").hover(function () {
		$(this).css("cursor","pointer");
	});
	
	$(".calendrier_next").click(function () {
		changer_panneau_next();
	});
});

function aller_a(){
	window.open("http://"+document.frm_footer.autre_site.value); 
}

function changer_panneau_next(){
	var panneau = $("#panneau").val();
	if( panneau != 3 ){
		$(".panneau"+panneau).css("display","none");
		panneau++;
		$(".panneau"+panneau).css("display","block");
		$("#panneau").val(panneau);
	}
}
function changer_panneau_previous(){
	var panneau = $("#panneau").val();
	if( panneau != 1 ){
		$(".panneau"+panneau).css("display","none");
		panneau--;
		$(".panneau"+panneau).css("display","block");
		$("#panneau").val(panneau);
	}
}

