/*
 * jQuery Hellip plugin
 * Version 0.1  (02/03/2009)
 * @requires jQuery v1.1.1+
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */


(function($) {
	$.fn.hellip = function(options) {
		var opts = $.extend({}, $.fn.hellip.defaults, options);
		return this.each(function() {
			var o = $.meta ? $.extend({}, opts, $(this).data()) : opts;
			var allText = $(this).text();
			var startText = allText.slice(0, o.limit).replace(/\w+$/,'');
			
			$(this).html(startText + '&hellip;');
			if (o.title) {
				$(this).attr('title', allText);
			}
	    });
	}

	$.fn.hellip.defaults = {
		limit: 100,
		title: true
	};
})(jQuery);
