$(function() {
	function do_vote(mark) {
		var data = {
			content_vote_type: content_vote_type,
			content_vote_id: content_vote_id,
			content_vote_mark: mark,
			ajax: 1
		}
		$('#jq_content_vote_loading').show();
		$('#jq_content_vote_thanks').hide();
		$.post(prefix + '/content_vote/', data, function (data, textStatus) {
			if (textStatus == "success") {
				if (data === true) {
					$('#jq_content_vote_thanks').show();
				} else {
					alert('Communication error. Please try again.');
				}
			} else {
				alert('Communication error. Please try again.');
			}
			$('#jq_content_vote_loading').hide();
		}, "json");
	}
	$('#jq_content_vote_submit').hide();
	$('#content_vote').show();
	$('#content_vote_answer_yes').click(function() { do_vote(1); });
	$('#content_vote_answer_no').click(function() { do_vote(0); });
});