$(document).ready(function() {

$('.hover_auto').mouseover(function() { this.src = this.src.replace('_normal', '_hover'); });
$('.hover_auto').mouseout(function() { this.src = this.src.replace('_hover', '_normal'); });

$('.hover_auto').each(function() {$('#load_images_hover').append('<img src="'+this.src.replace('_normal', '_hover')+'" alt="" />');});

$('a, img').each(function() {
var toolTipBool = false; // Permet d'éviter de tooltip une variable null

if ($('.txt', this).html()) toolTipBool = true;
else if ($(this).attr('title')) { // On créé le div s'il n'est pas présent ; le div a la priorité sur le title
$(this).append('<div class=\'txt\'><b>'+$(this).attr('title')+'</b></div>');
toolTipBool = true;
}

// Puis on affiche le div présent dans tous les cas
if (toolTipBool) { $(this).tooltip({
    track: true, 
    delay: 0, 
    showURL: false, 
    fade: 250,
    bodyHandler: function() { 
        return $('.txt', this).html();
    }
});

} });



/*
	{
		className: 'toolTips',
		position: 'mouse',
		delay: 0,
		//onShow: function() { $('.toolTips').css('marginLeft', '20px'); },
	}
	*/
$('#button_passez_commande, #button_passez_commande_hover_arrow').hover(function() {$('#button_passez_commande_hover_arrow').stop(true).animate({backgroundPosition:'0px 0px'}, 200); $('#button_passez_commande_hover_txt').stop().fadeTo(250, 1); }, function() { $('#button_passez_commande_hover_arrow').stop(true).animate({backgroundPosition:'0px 33px'}, 500); $('#button_passez_commande_hover_txt').stop().fadeTo(250, 0);});

$('.pack_callTxt').hover(function() { $(this).css('height', '372px'); $('#pack_txt_'+this.id).stop(true, true).slideDown(300); },function()  { $(this).css('height', '90px'); $('#pack_txt_'+this.id).stop(true, true).slideUp(200); });

$('.pack_txt').hover(function() { $(this).stop(true, true).slideDown(300); },function()  { $(this).stop(true, true).slideUp(200); });

});
