function expandWallReactions(head_post_id,nb_of_reactions){
  $.get(
			'/ajax/gateway.php',
			{
				task: 'expandWallReactions',
				head_post_id:head_post_id,
				nb_of_reactions:nb_of_reactions
			},
			function(data){
			  $('#post_'+head_post_id).replaceWith(data);
			}
	);
}

function expandWallPosts(nb_of_posts){
  $.get("/ajax/gateway.php",
			{
				task: 'expandWallPosts',
				nb_of_posts:nb_of_posts
			},
			function(data){
			  $('#wall_wrapper').replaceWith(data);
			}
	);
}

$('.write_new_reaction').live('click',function(){
 
})


$('.reaction_textarea').live('keydown',function(){
  $(this).val($(this).val().replace('\n',' '));
  var length = $(this).val().length;
  var id = $(this).attr('id').replace('new_reaction_','');
  var allowed = max_message_length-length;
  
  if(length > max_message_length)
    $(this).val($(this).val().substring(0,max_message_length));
  
  if(allowed <= 0)
    allowed = 0;
 
  $('#chars_left_'+id).html(allowed+' '+chars_label);
})

function initScrollHeight(scrollHeight) {	
	$(window).scrollTop(scrollHeight);  // reset scroll height (to before post)
}








