function simple_tooltip(target_items, name)
{
 
 	$( target_items ).each( function( i )
	{
		$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
		var my_tooltip = $("#"+name+i);
		
		$(this).removeAttr("title").mouseover(function()
		{
				my_tooltip.css({opacity:0.8, display:"none"}).fadeIn(0);
		})
		
		.mousemove(function(kmouse){
				my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
		})
		
		.mouseout(function(){
				my_tooltip.fadeOut(0);				  
		});
	});
}


function ajax_galeria()
{

	
	$('#mi_galeria img').each(function(){
		
		var alt = $(this).attr('id');
   		$(this).click(function () 
		{ 
			
			$("#galeria_contenido").empty();
			$("#galeria_contenido").append('<center> <img src="/img/loading.gif" /> </center> ');
			
			//alert( alt );
			//$("#galeria_contenido").empty();
			
			
			
			$.ajax({
   				type: 	"POST",
   				url: 	"/get_gallery.php",
   				data: 	"id=" + alt,
   				success: function( msg )
				{
     				//alert( "Data Saved: " + msg );
					$("#galeria_contenido").empty();
					$("#galeria_contenido").append( msg );
					
					$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
				    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
				}
			});					
					
					
   				}
 			});			
			
			

			
    	});
			
	});

}




