$(document).ready( function() {
	var txt = $("#view-more-text").html();
	var newtxt = "";
	if(vmtxtlim) {
		var txtspli = txt.split(" ");
		if(txtspli.length > vmtxtlim) {
			for(var i=0; i < vmtxtlim; i++) {
				newtxt += txtspli[i] + " ";
			}
			newtxt += "... <span class='readmore' style='cursor: pointer;'>read more</span>";
			document.getElementById("view-more-text").innerHTML=newtxt;
		}
	}
	
	$(".readmore").click( function() {
		var txtspli = txt.split(" ");
		newtxt = "";
		for(var i=0; i < txtspli.length; i++) {
			newtxt += txtspli[i] + " ";
		}
		document.getElementById("view-more-text").innerHTML=newtxt;
		//$("#view-more-text").html();
	});
});
