(function ($) {

    $.fn.showMessage = function (type, message) {
        var $this = this;
        var message_code = hashCode(message);
        if ($this.find('.alert[data-id=' + message_code + ']').length == 0) {
            $this.append('<div class="alert alert-' + type + '" data-id="' + message_code + '" ><strong>' + message + '</strong></div>').fadeIn();
            setTimeout(function () {
                $('.alert[data-id=' + message_code + ']').fadeOut(500).remove();
            }, 2500);
        }
    }

    function hashCode(s) {
        return s.split("").reduce(function (a, b) {
            a = ((a << 5) - a) + b.charCodeAt(0);
            return a & a
        }, 0);
    }


})(jQuery);