/*
 * script to load expandable content
 * 
 */
var expandable_content_prefix="/news-content/";
var post_to_highlight=0;
$(document).ready(function(){
	$.ajaxSetup({cache:false});
	$("a.readMore").click(function(){
		var post_id = $(this).attr("rel");
		$("#posts .details").css('display', 'block');
		$("#posts .details .cont").html("loading...");
		$("#posts .details .cont").load(expandable_content_prefix,{id:post_id,ajax:1});
		highlightPost(post_id)
		return false;
	});
	$("#close").click(function() {
		$(".post .image").fadeTo(500, 1);
		$("#posts .details").css('display', 'none');
		return false;
	});
	
	
	if (post_to_highlight) highlightPost(post_to_highlight);
	
	
});
function highlightPost(post_id) {
	$(".post .image").fadeTo(500, 0.1);
	$(".post .image-"+post_id).stop().fadeTo(500, 1);
//$(".post-"+post_id).remove();
	$(".wrapperPosts").prepend($(".post2-"+post_id));

}

