$(function() {
	// grab all news stories and see if need truncating	
	var d = $(".description");
	for (var i=0; i<d.length; i++){
		if( $(d[i]).height() > 110 ) {
			// truncate text box
			$(d[i]).css("height", "110px");
			$(d[i]).css("overflow", "hidden");	    
		    // add button
		    $(d[i]).next(".expand-text").css("display", "block");
		}
	}
	
	// bind click
	$(".expand-text").toggle(function () {
		$(this).html('<a href="#">[Close text]</a>').prev().css("height", "auto").css("display", "none").fadeIn('slow', function() {
			// recalc scroll
			$('.scroll-pane').jScrollPane({dragMinHeight:20, dragMaxHeight:20});
		});
	}, function() {
		$(this).html('<a href="#">Read more&hellip;</a>').prev().css("height", "110px").css("display", "none").fadeIn('slow', function() {
			// recalc scroll
			$('.scroll-pane').jScrollPane({dragMinHeight:20, dragMaxHeight:20});
		});
	});
	
});
