function dccovergo(){
	$.post("articleDCJz",{aid:dczhi},callback)
}
function callback(date){
   var diggs = date.split(',');
				var sDown = parseInt(diggs[1]);//下跌
				var sCenter = parseInt(diggs[2]);
				var sTotal = parseInt(diggs[3]);//总数
				var sUp = sTotal-sDown-sCenter;//上涨
				if(sTotal==0){sTotal=1; }
				var spUp=(sUp/sTotal)*100;
				spUp=Math.round(spUp*10)/10;
				var spCenter=(sCenter/sTotal)*100;
				spCenter=Math.round(spCenter*10)/10;
				var spDown=100-spUp-spCenter;
				if(sDown==0){spDown=0; }
				spDown=Math.round(spDown*10)/10;
				if(sCenter==0){spCenter=0; }
				spCenter=Math.round(spCenter*10)/10;
					$("#s1").html(sUp);
					$("#sp1").html(spUp+'%');
					$("#s2").html(sDown);
					$("#sp2").html(spDown+'%');
					$("#s3").html(sCenter);
					$("#sp3").html(spCenter+'%');
					document.getElementById("eimg1").style.width=parseInt((sUp/sTotal)*90)+"px";
					document.getElementById("eimg2").style.width=parseInt((sDown/sTotal)*90)+"px";
					document.getElementById("eimg3").style.width=parseInt((sCenter/sTotal)*90)+"px";
}

$(document).ready(function(){
	$("#mark0").click(function(){
		if($.cookie(dczhi)==null){
		$("#s1").html(parseInt($("#s1").html())+1);
		$.cookie(dczhi,0,{ expires:1});
		$.post("articleDC",{aid:dczhi,good:1,bad:0,center:0},callback)
    }else{
       alert("您已经投过票了！");
    }
});
$("#mark1").click(function(){
	if($.cookie(dczhi)==null){
		$("#s2").html(parseInt($("#s2").html())+1);
		$.cookie(dczhi,0,{ expires:1});
		$.post("articleDC",{aid:dczhi,good:0,bad:1,center:0},callback)
    }else{
       alert("您已经投过票了！");
    }
});
$("#mark2").click(function(){
	if($.cookie(dczhi)==null){
		$("#s3").html(parseInt($("#s3").html())+1);
		$.cookie(dczhi,0,{ expires:1});
		$.post("articleDC",{aid:dczhi,good:0,bad:0,center:1},callback)
    }else{
       alert("您已经投过票了！");
    }
});
   		
});

