/*$(document).ready(function() {
	// find the div.fade elements and hook the hover event
	$('.fadeThis').hover(function() {
		// on hovering over find the element we want to fade *up*
		var fade = $('> .hover', this);
 
		// if the element is currently being animated (to fadeOut)...
		if (fade.is(':animated')) {
			// ...stop the current animation, and fade it to 1 from current position
			fade.stop().fadeTo(500, 1);
		} else {
			fade.fadeIn(500);
		}
	}, function () {
		var fade = $('> .hover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(500, 0);
		} else {
			fade.fadeOut(500);
		}
	});
 
	// get rid of the text
	$('.fadeThis > .hover').empty();
})*/



( function($) {
    $.fn.fading_mio = function(opciones_user){
        // Ponemos la variable de opciones antes de la iteración (each) para ahorrar recursos
        opc = $.extend( $.fn.fading_mio.opc_default, opciones_user );
        // Devuelvo la lista de objetos jQuery
        return this.each( function(){
			var fade = $('> .'+opc.classHover, this);
			
			if(opc.evento=='over'){				
				if (fade.is(':animated')) {
				fade.stop().fadeTo(opc.tiempo, 1);
				} else {
					fade.fadeIn(opc.tiempo);
				}				
			}else{
				if (fade.is(':animated')) {
				fade.stop().fadeTo(opc.tiempo, 0);
				} else {
					fade.fadeOut(opc.tiempo);
				}
			}
			
			
			$('.' +opc.capaPadre+' > .'+opc.classHover).empty();
        });

    };

    $.fn.fading_mio.opc_default = {
		evento : '',
		classHover : "---",
		tiempo : 500,
		capaPadre :''
    };


})(jQuery);



