(function($)
{$.fn.infobulle=function(options)
{var defaults={width:200,text:"Ceci est une infobulle",opacity:0.8,bgcolor:"#000",color:"#FFF",speed:"slow",position:"right"};var options=$.extend(defaults,options);var date=new Date()
var date=date.getTime();var notification="\t"+'<div class=\"infobulle-bulle\" id=\"'+date+'\">'+"\r\n"+"\t\t"+'<div class="infobulle-close">(X)</div>'+"\r\n"+"\t\t"+'<div class="infobulle-text">'+options.text+'</div>'+"\r\n"+"\t"+'</div>'+"\r\n";if($(this).find(".infobulle:first").length<1)
{var divinfobulle='<div class=\"infobulle\"></div>'+"\r\n";$(this).append(divinfobulle);$(this).find(".infobulle:first").css(options.position,"5px");var closeall="\t"+'<div class=\"infobulle-closeall\">Tout Fermer (X)</div>'+"\r\n";$(this).find(".infobulle:first").append(closeall);}
if($(this).find(".infobulle-bulle").length>0)
$(this).find(".infobulle-closeall:first").show(options.speed);$(this).find(".infobulle-closeall:first").before(notification);$("#"+date).width(options.width);$("#"+date).css('opacity',options.opacity);$("#"+date).css('background-color',options.bgcolor);$("#"+date).css('color',options.color);$("#"+date+" .infobulle-text").width(options.width-25);$(""+date).css('-moz-border-radius','5px');$("#"+date).show(options.speed);$(".infobulle-close").click(function()
{$(this).parent().hide(options.speed);$(this).parent().queue(function(){$(this).remove();$(this).dequeue();});if($(this).parent().parent().find(".infobulle-bulle").length<3)
{$(this).parent().parent().hide(options.speed);$(this).parent().parent().queue(function(){$(this).remove();$(this).dequeue();});}});$(".infobulle-closeall").click(function()
{$(this).parent().find(".infobulle-bulle").each(function()
{$(this).hide(options.speed);$(this).queue(function(){$(this).remove();$(this).dequeue();});});$(this).parent().hide(options.speed);$(this).parent().queue(function(){$(this).remove();$(this).dequeue();});});return this;};})(jQuery);

