var text='';
var visibleText = '';

function revealArticle(){
	//$('#homepage-article').html(text+'&nbsp;<a href="#" onclick="javascript:revealArticle();return false;">read less...</a>');
	$('#homepage-article').html(text);
	$('#homepage-article').slideUp("fast");
	$('#homepage-article').slideDown("slow");
}

/*
$(document).ready(function() {	
	var cutoff = 520;
	text = $('#homepage-article').html();
	if(text){
		var rest = text.substring(cutoff);
		if (text.length > 100) {
		  var period = rest.indexOf('.');
		  var space = rest.indexOf(' ');
		  cutoff += Math.max(Math.min(period, space), 0);
		}
		// Assign the rest again, because we recalculated the cutoff
		rest = text.substring(cutoff);
		visibleText = $('#homepage-article').html().substring(0, cutoff);
		
		$('#homepage-article').html(visibleText+'&nbsp;<a href="#" onclick="javascript:revealArticle();return false;">read more...</a>');
	}	
});	
*/
