$(function()
{
	var newsContainer = $("#newsContainer");
	var newsItem = $("#newsItem");
	var newsAutoHeight = newsItem.height();
	
	if (newsAutoHeight > 305)
	{
		// add more button
		newsContainer.append("<span id='clickForMore'> ...click for more</span>");
		// set fixed height / overflow hidden / bottom padding
		newsItem.css({ height:"305px", overflow:"hidden", paddingBottom:"20px" });
		// get the new fixed height
		var newsFixedHeight = newsItem.height();
		
		var clickForMore = $("#clickForMore");
		
		clickForMore.toggle(
			function()
			{
				newsItem.animate({ height: newsAutoHeight }, 800, function() { newsItem.css('height', 'auto'); });
				clickForMore.text(" ...click for less");
			},
			function()
			{
				newsItem.animate({ height: newsFixedHeight }, 800, function() { newsItem.css('height', newsFixedHeight); });
				clickForMore.text(" ...click for more");
			}
		);
	}
}
);
