// JavaScript Document

//INITILIALISATION DES SCRIPTS UTILISANT JQUERY

//Placer dans la fonction init tous les scripts exécutés au chargement
function init() {
    // Ajouter une classe alternative pour les rangées impaires de tableau de contenu (typo3)
	if ( jQuery("table").length ){
	  jQuery("table").each(function() {
	    if (jQuery(this).is('table') && jQuery(this).find('thead').length == 0) {
              // No 'thead' section
              jQuery(this).prepend("<thead></thead>"); // add thead
              jQuery(this).find('tbody tr:first').remove().appendTo(jQuery(this).find('thead') ); // remove first row from tbody, add it to thead
            }
            jQuery(this).find("tbody tr:odd").addClass("odd");
	  });
	}
}

function comportementPopUp (objAct, popUp) {
	jQuery(popUp).fadeOut(0);
		jQuery(objAct).hover(function() {
			// if the element is currently being animated (to fadeOut)...
		 	if (jQuery(popUp).is(':animated')) {
				// ...stop the current animation, and fade it to 1 from current position
				jQuery(popUp).stop().fadeTo(500, 1);
			} else {
				jQuery(popUp).fadeIn(500);
			}
			return false
		}, function () {
			if (jQuery(popUp).is(':animated')) {
				jQuery(popUp).stop().fadeTo(500, 0);
			} else {
				jQuery(popUp).fadeOut(500);
			}
			return false
		});
}

jQuery(document).ready(function() {init();});

