$(document).ready(function(){
/*	$(".element_index")
		.livequery(function() { // Comportement de bouton vers le billet associé.
			$(this).click(function(){
				var idefix = $(this).attr('id'); 
				//$('#input_test').val(idefix);
				num = idefix.substring(14,idefix.length);/*
				$(".billet").each(function(){
					if ($(this).css("display") == "block") {
						$(this).slideUp(1500);
					}
				});*//*
				$("#bloc_billet .billet:visible").slideUp(1000);
				$("#billet_"+num).slideDown(1000);
				$("num_mod_billet").val(num);
			});
	});
*/	
	$('.element_index') 
    	.livequery(function() { // Comportement de hover.
			$(this).hover(function(){
				$(this).addClass("element_index_hover");
					},function(){
				$(this).removeClass("element_index_hover");
			});
    });
		
	$("#index_recent")
		.livequery(function() { // Comportement de bouton faisant défiler l'index vers le haut.
			$(this).click(function(){
				for (i=1; i<=3; i++){ //alert ($("#colonne_index .element_index:first").prev().attr('id'));
					if ($("#colonne_index .element_index:first").prev().attr('id') != "index_recent") {
						$("#colonne_index .element_index:first").prev().removeClass('element_index_cache');
						$("#colonne_index .element_index:first").prev().addClass('element_index');
						$("#colonne_index .element_index:first").slideDown(1000);
						$("#colonne_index .element_index:last").addClass('element_index_cache');
						$("#colonne_index .element_index:last").removeClass('element_index');
						$("#colonne_index .element_index:last").next().slideUp(1000);
					} else {}
				}
			});
	});
		
	$("#index_ancien")
		.livequery(function() { // Comportement de bouton faisant défiler l'index vers le bas.
			$(this).click(function(){
				for (i=1; i<=3; i++){
					if ($("#colonne_index .element_index:last").next().attr('id') != "index_ancien") {
						$("#colonne_index .element_index:first").slideUp(1000);
						$("#colonne_index .element_index:first").addClass('element_index_cache');
						$("#colonne_index .element_index:first").removeClass('element_index');
						$("#colonne_index .element_index:last").next().removeClass('element_index_cache');
						$("#colonne_index .element_index:last").next().slideDown(1000);
						$("#colonne_index .element_index:last").next().addClass('element_index'); 
					} else {}
				}
			});
	});
		
	$("#index_full")
		.livequery(function() { // Comportement de bouton faisant défiler l'index vers le bas.
			$(this).click(function(){ 
					if ($(this).html() == "<b>Voir tout</b>") {
						$("#colonne_index .element_index_cache").addClass("element_index"); 
						$("#colonne_index .element_index_cache").show(); 
						$(this).html("<b>Voir moins</b>");
					} else {						
						$("#colonne_index .element_index_cache").fadeOut(1500); 
						$(this).html("<b>Voir tout</b>");
					}
			});
	});
		
});	

	
	
