(function($) {
	
	$.fn.lava_myfonts = function(options) {
		
		$(this).each(function(){
		
			// traigo las cosas del CSS; y el texto en cuestion
			texto = $(this).text();
	
			// hago un extend
			settings = jQuery.extend({
				fuente:				$(this).css("font-family"),
				tamano: 			parseInt($(this).css("font-size")),
				ancho: 				parseInt($(this).css("width")),
				color: 				($(this).css("color")).replace("#",""),
				backgroundcolor: 	($(this).css("background-color")).replace("#",""),
				lineheight: 		parseInt($(this).css("line-height")),
				texttransform:		$(this).css("text-transform")
			}, options);
			
			if(isNaN(settings.ancho)) {
				settings.ancho = $(this).width();
			}

			settings.ancho = Math.round((settings.ancho)*1.47);
	
			// reemplazo el texto por la imagen
			$(this).html("<img src='lava_myfonts.php?texto="+texto+"&font="+settings.fuente+"&font-size="+settings.tamano+"&width="+settings.ancho+"&color="+settings.color+"&backgroundcolor="+settings.backgroundcolor+"&line-height="+settings.lineheight+"&texttransform="+settings.texttransform+"' alt='"+texto+"' />");		
		
		});
		
	}
	
})(jQuery);