$(function(){
$("a.vote_up").click(function(){
 //get the id
 the_id = $(this).attr('id');
 
 // show the spinner
 //$(this).parent().html("<img src='images/spinner.gif'/>");
 
 //fadeout the vote-count 
 $("span#votes_count_up"+the_id).fadeOut("slow");
 
 //the main ajax request
  $.ajax({
   type: "POST",
   data: "voteaction=vote_up&votedid="+$(this).attr("id"),
   url: "viewtopic.php",
   success: function(msg)
   {
    $("span#votes_count_up"+the_id).html(msg);
    //fadein the vote count
    $("span#votes_count_up"+the_id).fadeIn();
    //remove the spinner
    //$("span#vote_buttons"+the_id).remove();
   }
  });
 });

$("a.vote_down").click(function(){
 //get the id
 the_id = $(this).attr('id');
 
 // show the spinner
 //$(this).parent().html("<img src='images/spinner.gif'/>");
 
 //fadeout the vote-count 
 $("span#votes_count_down"+the_id).fadeOut("slow");
 
 //the main ajax request
  $.ajax({
   type: "POST",
   data: "voteaction=vote_down&votedid="+$(this).attr("id"),
   url: "viewtopic.php",
   success: function(msg)
   {
    $("span#votes_count_down"+the_id).html(msg);
    //fadein the vote count
	$("span#votes_count_down"+the_id).fadeIn();
    //remove the spinner
    //$("span#vote_buttons"+the_id).remove();
   }
  });
 }); 
 
});
