$(document).ready(function() {

$(".vote").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var votes = $(".votes").attr("id");
var dataString = 'nid='+ id ;
if (name=='up')
{

$.ajax({
type: "GET",
url: "http://www.housemd.info.pl/modules/news/vote.php?option=up",
data: dataString,
cache: false,
success: function(msg) {
	if(msg == 'OK') {
	votes = parseInt(votes) + 1;
	$('.votes').html(votes);
  }
  }
});

}
else
{
 
$.ajax({
type: "GET",
url: "http://www.housemd.info.pl/modules/news/vote.php?option=down",
data: dataString,
cache: false,
success: function(msg) {
  if(msg == 'OK') {
	votes = parseInt(votes) - 1;
	$('.votes').html(votes);
  }
  }


});

}

return false;
});
});
