var g_entries = {};

jQuery(document).ready(function() {

	jQuery('.story_class').each( function () {
		g_entries[this.id] = {
			height : jQuery(this).height()
		};
	});
	
	//var old_height = jQuery('#story_6').height();
	jQuery('.story_class').css('height','153px');
	
	jQuery('.read_more').toggle( // toggle the click action of the div
		// Position Closed -> Open It
		function () { 
			//alert(jQuery(this).prev().attr("id"));
			// swap the class and change the HTML
			jQuery(this).html("Collapse Story") 
			
			//Get the 
			var elem_id = jQuery(this).prev().attr("id");
			
			jQuery(this).prev().animate({
				height: g_entries[elem_id].height + 'px'
			}, 600);
		},
		// Position Open -> Close It
		function () { 
			// swap the class and change the html
			jQuery(this).html("Read More") 
				// select the pre and animate it closed
				jQuery(this).prev().animate({
					height: '153px'
				}, 600);
		}
	);
});

function getSize() {
	var elems = document.getElementsByClassName('story_class');
	
	for (var elem in elems)	 {
		alert(elem.id);
		//Store the information for this player
		g_entries[elem.id] = {
				height : elem.style.height
		};
		alert(elem.style.height);
	}
}