$(function() {
	$(".plus").click(function()
	{
		var id = $(this).attr("id").slice(1);
		var name = $(this).attr("name");
		var dataString = 'id='+ id ;
		var parent = $(this);
		
		if (name=='plus')
		{
			$(this).fadeIn(200);
			$.ajax({
				type: "POST",
				url: "up_vote.php",
				data: dataString,
				cache: false,
				
				success: function(html)
				{
					parent.html(html);
					location.reload();
				}
			});
		}
		return false;
	});
	$(".minus").click(function(){
		
		var id = $(this).attr("id").slice(1);
		var name = $(this).attr("name");
		var dataString = 'id='+ id ;
		var parent = $(this);
		if(name=="minus")
		{
			$(this).fadeIn(200);
			$.ajax({
				type: "POST",
				url: "down_vote.php",
				data: dataString,
				cache: false,
				
				success: function(html)
				{
					parent.html(html);
					location.reload();
				}
			});
			return false;
		}	
	});
});
