/* * Affichage d'un contenu suivant *  * @copyright	egzakt.com * * @version 	2007/06/05 * @package		EDU-083 * @author 		Emilie */function bloc_deroulant(objet) {		objet.next().slideToggle("normal");	objet.toggleClass("selected");	objet.parent().toggleClass("bloc_deroulant_selected");	return false;}$(function() {	$(".zone_deroulante").hide();		$("a.lien_deroulant").click(		function(){			return bloc_deroulant($(this));		}	);		// 1er mois de la liste d'événements déjà ouvert	$("a#mois_0").next().show();	$("a#mois_0").toggleClass("selected");	$("a#mois_0").parent().toggleClass("bloc_deroulant_selected");});/* * Autoriser seulement des chiffres *  * @copyright	egzakt.com * @version 	2008/10/28 * @author 		Emilie */function champ_numerique(e) {	// 48 à 58 = 0 à 9	// 96 à 105 = 0 à 9 du numpad	// 8 = backspace	// 9 = tab	// 37 = fleche gauche	// 39 = fleche droite	// 46 = delete		key = e.which ? e.which : e.keyCode			if (!(((key >= 48) && (key <= 58)) || ((key >= 96) && (key <= 105)) || (key == 8) || (key == 9) || (key == 37) || (key == 39) || (key == 46))) {		return false;	}}/* * Autoriser seulement des chiffres et le point *  * @copyright	egzakt.com * @version 	2008/10/28 * @author 		Emilie */function champ_montant(e) {	// 48 à 58 = 0 à 9	// 96 à 105 = 0 à 9 du numpad	// 8 = backspace	// 9 = tab	// 37 = fleche gauche	// 39 = fleche droite	// 46 = delete	// 190 = point	// 110 = point du numpad (windows)		key = e.which ? e.which : e.keyCode;	if (!(((key >= 48) && (key <= 58)) || ((key >= 96) && (key <= 105)) || (key == 8) || (key == 9) || (key == 37) || (key == 39) || (key == 46) || (key == 190) || (key == 110))) {		return false;	}}/* * Ajout d'une entreprise dans le carnet de voyage */function carnet_ajout(objet) {	ajax_entreprise_id = objet.attr("rel");	$.ajax({		url: url_carnet_ajout + ajax_entreprise_id,		success: function(){						// Enlever le bouton d'ajout			$("#carnet_ajout_" + ajax_entreprise_id).hide();			$("#carnet_present_" + ajax_entreprise_id).show();			// +1 du nombre d'items sur le bouton			$nb_entreprises = $("#btn_carnet .nombre").html();			$nb_entreprises++;			$("#btn_carnet .nombre").html($nb_entreprises);			if ($nb_entreprises > 1) {				$("#btn_carnet .pluriel").css("display","inline");			}		}	});	return false;}/* * Supprimer une entreprise du carnet de voyage */function carnet_supprimer(objet) {	ajax_entreprise_id = objet.attr("rel");	$.ajax({		url: url_carnet_supprimer + ajax_entreprise_id,		success: function(){						// Cacher la fiche			$("#fiche_" + ajax_entreprise_id).fadeOut();				// -1 du nombre d'items sur le bouton			$nb_entreprises = $("#btn_carnet .nombre").html();			$nb_entreprises--;						// On met le zéro en string sinon il ne s'affiche pas			if ($nb_entreprises == 0) {				$nb_entreprises = "0";			}						$("#btn_carnet .nombre").html($nb_entreprises);			if ($nb_entreprises < 2) {				$("#btn_carnet .pluriel").css("display","none");			}		}	});	return false;}
