
$(document).ready(function() {

	nombre= Math.floor(Math.random() * 4)+1;

	chargerConseil(nombre);


	$("div#boutons-themes img").click(
		function(){
			var $type = $(this).attr("id");
			chargerConseil($type);
		}
	);
	
});

function chargerConseil($type) {
	$("div#boutons-themes img[src*=on.png]").each(
		function(){
			$(this).attr("src",$(this).attr("src").replace("on.png"	,"off.png"));
		}
	);
			
	$("div#boutons-themes img#"+$type).attr("src",$("div#boutons-themes img#"+$type).attr("src").replace("off.png"	,"on.png"));


	$("#conseil").hide();
	$("#loading-conseil").show();
	
	$("#conseil").load("/Ajax/HomeConseilsPage",{page:$type},
		function(){ 
			$("#loading-conseil").hide(); 
			$("#conseil").show(); 
		}
	);  
}




