function showText(div){ 	
	$(div).parent().children(".text").removeClass("oneline");
	$(div).html("(hide)");
	$(div).click(function(){
  	hideText(div)
  }); 
}
function hideText(div){ 
	$(div).parent().children(".text").addClass("oneline");
	$(div).html("(...)");
	$(div).click(function(){
  	showText(div)
  }); 
}
$(document).ready(function(){
//hide the all of the element with class msg_body
	$(".activity").each(function (i) {
		if (this.offsetHeight > 18) { 
			$(this).children('.text').addClass("oneline");
			$(this).children('.show_link').removeClass("hidden");
		}    
	});

	
	//toggle the componenet with class msg_body
	$(".show_link").each(function(i){
		$(this).click(function(){
			showText(this)
		});
	});
});