$(document).ready(
	function(){
		$(".gallery a").clouds();
	}	
);
(function($){
	
	jQuery.fn.extend({
		clouds: function(){
			return this.each(function(){					
				
				var container = $(this);
				var title = container.attr("title");
				container.attr("title","");
				
				$("<div class='cloud'></div>").insertAfter(container);
				container.next('.cloud').html(title);
				
				container.mousemove(function(e){
           			$(this).next(".cloud").show();
            		$(this).next(".cloud").css({'top': e.pageY + 5, left: e.pageX + 8});
       			});
       			
       			container.mouseout(function(){
          			$(this).next(".cloud").show().hide();
       			})
							 				
			})
		}
	})
})(jQuery)
