jQuery.fn.waterMark = function(settings) {
  settings = jQuery.extend({
    fondo: '',
	texto: 'AMPLIAR',
    fontsize: '1em',
	ancho: 220,
	alto: 43,
    zIndex: 10,
	color: '#ffffff'
  }, settings);
  return this.each(function() {
    //var position = $(this).position();
    //var height = $(this).height();
    //var width = $(this).width();
	$(this).parent().css("position", "relative");
	//alert(position.left);
	if(settings.fondo != ""){
		$("<img src='"+settings.fondo+"' />").css({		
			width: settings.ancho+"px",
			height: settings.alto+"px",
			lineHeight: settings.alto+"px",
			top: '0px',
			left: '0px',
			position: 'absolute',
			cursor: 'pointer',
			opacity: 0.8,
			border: '0px',
			zIndex: settings.zIndex
	    }).appendTo($(this))
	}
	if(settings.texto != ""){
		if(settings.texto == "title"){
			texto = $(this).attr("title");
			align = "left";
			izq = "80px";
		}
		else {
			texto = settings.texto;
			align = "center";
			izq = "";
		}	
		$("<span>"+texto+"</span>").css({		
			width: settings.ancho+"px",
			height: settings.alto+"px",
			lineHeight: settings.alto+"px",
			fontSize: settings.fontsize,
			textAlign: align,
			paddingLeft: izq,
			color: settings.color,
			top: '0px',
			left: '0px',
			position: 'absolute',
			cursor: 'pointer',
			background: 'none',
			opacity: 0.8,
			border: '0px',
			zIndex: settings.zIndex+1
	    }).appendTo($(this))
	}	
  });
};
