/** article */
(function ($, LOGA) {

$(document).ready(function() {
	$.getJSON(GV.URL.GET_COUNT, function(data) {
		if(data.data == 1) {
			$('#view_count').text(data.info.view);
			$('#review_count').text(data.info.review);
			$('#support_count').text(data.info.support);
			$('#oppose_count').text(data.info.oppose);
		}
	});
});

$('#a_support').one('click', function() {
	$.getJSON(GV.URL.SUPPORT, function(data) {
		if(data.data == 1) {
			$('#support_count').text(parseInt($('#support_count').text()) + 1);
		}
		$('#a_support,#a_oppose').addClass('disabled').unbind();
		$('#a_support').addClass('active');
		$('#a_support_tip').text(data.info);
	});
});
$('#a_oppose').one('click', function() {
	$.getJSON(GV.URL.OPPOSE, function(data) {
		if(data.data == 1) {
			$('#oppose_count').text(parseInt($('#oppose_count').text()) + 1);
		}
		$('#a_support,#a_oppose').addClass('disabled').unbind();
		$('#a_oppose').addClass('active');
		$('#a_oppose_tip').text(data.info);
	});
});

})(jQuery, LOGA);
