$(document).ready(function() {


var allow_rating = 1;
$('.top').live('click',function() {
if(allow_rating == 1){
var id = this.id;
id = id.replace('topid', "");

$.ajax({
   type: "POST",
   url: "vt.php",
   data: "id="+id+"&vote=1",
   dataType: "html",
  success: function(data){
  
if(data == '0'){
 var votes = $('#vtop'+id).html();
votes = votes.replace('(', "");
votes = votes.replace(')', "");
votes++;
$('#vtop'+id).html('<b>( '+votes+' )</b>');
}
  $('#topid'+id).removeClass('cus top');
  $('#flopid'+id).removeClass('cus flop');

   }
   
 });



 }
           
      
});
$('.flop').live('click', function() {
if(allow_rating == 1){
var id = this.id;
id = id.replace('flopid', "");
$.ajax({
   type: "POST",
   url: "vt.php",
   data: "id="+id+"&vote=0",
   dataType: "html",
  success: function(data){
  
if(data == '0'){
 var votes = $('#vflop'+id).html();
votes = votes.replace('(', "");
votes = votes.replace(')', "");
votes++;
$('#vflop'+id).html('<b>( '+votes+' )</b>');
}
  $('#topid'+id).removeClass('cus top');
  $('#flopid'+id).removeClass('cus flop');

   }
   
 });
           
      }
});





});
