// JavaScript Document

//INITILIALISATION DES SCRIPTS UTILISANT JQUERY

//Placer dans la fonction init tous les scripts qui doivent Ãªtre initalisÃ©s lorsque le dom est ready
function init() {
     // Ajouter une classe alternative pour les rangées impaires de tableau de contenu (typo3)
	if ( $("table").length ){
	  $("table").each(function() {
	    /*if ($(this).is('table') && $(this).find('thead').length == 0) {
              // No 'thead' section
              $(this).prepend("<thead></thead>"); // add thead
              $(this).find('tbody tr:first').remove().appendTo($(this).find('thead') ); // remove first row from tbody, add it to thead
            }*/
            $(this).find("tbody > tr:odd").addClass("odd");
	  });
	}
}

function comportementPopUp (objAct, popUp) {
	    //alert('comportementPopUp')
        $(popUp).fadeOut(0);
		$(objAct).hover(function() {
			//$('body').append('ho:');
			// if the element is currently being animated (to fadeOut)...
		 	if ($(popUp).is(':animated')) {
				//$('body').append('isanim<br/>');
				// ...stop the current animation, and fade it to 1 from current position
				$(popUp).stop().fadeTo(500, 1);
			} else {
				//$('body').append('isnot<br/>');
				$(popUp).fadeIn(500);
			}
			return false
		}, function () {
			//$('body').append('notho:');
			if ($(popUp).is(':animated')) {
				//$('body').append('isanim<br/>');
				$(popUp).stop().fadeTo(500, 0);
			} else {
				//$('body').append('isnot<br/>');
				$(popUp).fadeOut(500);
			}
			return false
		});
}

$(document).ready(function() {init();});

