$(document).ready(
		function() {
			$('#agenda-admin table a').tooltip({ 
			    track: true, 
			    delay: 0, 
			    showURL: false, 
			    opacity: 1, 
			    fixPNG: true, 
			    showBody: " - ", 
			    extraClass: "pretty", 
			    top: 15, 
			    left: -120
			}) ;
			$('#agenda-admin .colorbox').colorbox();
			$('#agenda tbody tr td a').tooltip({ 
			    track: true, 
			    delay: 0, 
			    showURL: false, 
			    opacity: 1, 
			    fixPNG: true, 
			    showBody: " - ", 
			    extraClass: "pretty", 
			    top: 15, 
			    left: -120
			}) ;
			$('#agenda .colorbox').colorbox();
		}
);

function agenda( mois, annee ) {
	$('#agenda').html('<div class="center"><img src="' + _root_html_img + '/chargement.gif" alt="Chargement..." title="Chargement..." /></div>') ;
	// Si les paramètres ne sont pas passés, on laisse la classe php s'en charger
	if( mois == null )
		mois = 0 ;
	if( annee == null )
		annee = 0 ;
	
	$.post(
		_root_html + '/ajax/agenda.ajax.php' ,
		{ m : mois, y : annee } ,
		function( data ) {
			$('#agenda').fadeOut(
				'fast' ,
				function() {
					if( data == "\nErreur" )
						$( this ).html( '<div align="center" style="color: red;">Erreur</div>' ) ;
					else
						$( this ).html( data ) ;
					
					$( this ).fadeIn() ;
					$('#agenda tbody tr td a').tooltip({ 
					    track: true, 
					    delay: 0, 
					    showURL: false, 
					    opacity: 1, 
					    fixPNG: true, 
					    showBody: " - ", 
					    extraClass: "pretty", 
					    top: 15, 
					    left: -120
					}) ;
					$('#agenda .colorbox').colorbox();
				}
			);
		} ,
		'html'
	);
	// On retourne faux pour ne pas recharger la page
	return false;
}
