	jQuery.fn.animLoading = function()
	{
	
		var container = $(this);
	
		if($('#loading').length == 0)
		{
			var loader = document.createElement('div');
			$(loader).appendTo('body')
			.attr({id:'loading'})
			.css({
				position:'absolute',
				opacity:'0.8',
				backgroundColor:'#000',
				zIndex:'1000'
			})
			.html('<img src="/img/style/pictos/ajax-loader.gif"/>')
			.children('img')
			.css({position:'absolute',border:'solid 1px #fff'});
			
			$(loader).hide();
		}

		
		var _img = $("#loading").children('img');
		$("#loading").bind("ajaxSend", function(){
				
			//
			var cur_position = container.offset();
			
			//css de l'image de loading
			_img.css({
				left:(container.width()+10)/2 - _img.width() / 2,
				top:(container.height()+10)/2 - _img.height() / 2
			});
			
			//css du conteneur de loading
			$(this).css({
				left:cur_position.left,
				top:cur_position.top,
				width:container.width()+10,
				height:container.height()+10
			})
			.show();
   				
		}).bind("ajaxComplete", function(){
   				$(this).hide();
 			});
}		