// text substring
// maxLength -- maximum alowed length. If > than substring to maxLength and add '...'
// obj - objects where we should check text to substring
function textSubstring(maxLength, obj){
	var currentLength;
	var html;
	$(obj).each(function(){
		currentLength = $(this).html().length;
		if(currentLength > maxLength){
			html = $(this).html();
			html = html.substr(0, maxLength - 3);
			html += '...';
			$(this).html(html);
		}
	});
}
