
jQuery(document).ready(function($) {
// 89.241.154.172
	resetTitleHeights();
});


function resetTitleHeights() {
	(function($) {
		$('.post .title').each(function(index) {
			var maxlines = 2;
			var lh = $(this).css('line-height').replace(/px$/i,'');
			var maxh = lh*maxlines;
			var h = $(this).height();
			if (h>maxh) {
				var title = $(this).text();
				var wordlist = title.split(' ');
				var wlsz = wordlist.length;
				var ttitle = '';
				var endstr = '...';
				wordlist.pop();
				for (var i=1; i<wlsz; i++) {
					ttitle = wordlist.join(' ');
					ttitle = ttitle + endstr;
					$(this).find('a').text(ttitle);
					h = $(this).height();
					if (h>maxh) {
						wordlist.pop();
					} else {
						break;
					}
				}
			}
		})
	})(jQuery);
}



