(function (a) {
    a.fn.truncatable = function (e) {
        var c = { limit: 100, more: "...", less: !1, hideText: "[read less]" }, e = a.extend(c, e); return this.each(function (b) {
            var f = a(this).html().length; if (f > c.limit) {
                a(this).html().substr(c.limit).substr(0, 1); for (var e = RegExp(/^\s+$/), d = c.limit; d < f; d++) {
                    var g = a(this).html().substr(0, d), h = a(this).html().substr(d), g = g.slice(-1); e.test(g) && (h = '<span class="hiddenText_' + b + '" style="display:none">' + h + "</span>", d -= 1, a("<a>").attr("class", "more_" + b + ""), a(this).html(a(this).html().substr(0,
d)).append('<a class="more_' + b + '" href="javascript:void(0)">' + c.more + "<a/> " + h), a("a.more_" + b).bind("click", function () { a("span.hiddenText_" + b).show(); a("a.more_" + b).hide(); !0 == c.less && (a("span.hiddenText_" + b).append('<a class="hide_' + b + '" href="" title="' + c.hideText + '">' + c.hideText + "</a>"), a("a.hide_" + b).bind("click", function () { a(".hiddenText_" + b).hide(); a(".more_" + b).show(); a(".hide_" + b).empty(); return !1;
}));
}), d = f);
                                                             } 
            } 
        });
    };
})(jQuery);
