// Ventana modal centrada y con transparencia, tiempo y contenido configurable
$.fn.mAlert = function(opciones) {
    var opcs = $.extend({}, $.fn.mAlert.defaults, opciones);
    this.each(function() {
        var elem = $(this);
        if (opcs.html != '') elem.html(opcs.html);
        /*elem.css('top', (($(window).height() - elem.outerHeight()) / 2 + $(window).scrollTop()) + 'px');
        elem.css('left', (($(window).width() - elem.outerWidth()) / 2 + $(window).scrollLeft()) + 'px');*/
        elem.css('top', ($(window).scrollTop() + 10) + 'px');
        elem.css('left', (($(window).width() - elem.outerWidth() - 10) + $(window).scrollLeft()) + 'px');
        elem.css('z-index', 10000);        
        elem.fadeIn("fast");
        if (opcs.pausa > 0) {
            elem.delay(opcs.pausa).fadeOut("fast");
        }
        $(window).bind("click", function() {
           elem.stop().fadeOut("fast");
           $(this).unbind("click");
        });
    });
};

$.fn.mAlert.defaults = {  
     pausa: '1500',
     html: ''
};
