function gebi(id){
	return document.getElementById(id)
}

function polling_mini_vote(polling_id, answer_id, container_id) {
	$.ajax({
		type: "GET",
		url: '/polling/vote/',
		data: {'polling_id': polling_id, 'answer_id': answer_id},
		dataType: "json",
		success: function(resp) {
			if (resp.status) {
				$('#'+container_id).html(resp.html)
			}
			if (resp.error) {
				alert(resp.error);
			}
		}
	});
}

function polling_mini_get_answers(polling_id, container_id) {
	$.ajax({
		type: "POST",
		url: '/polling/get_answers/',
		data: {'polling_id': polling_id},
		dataType: "html",
		success: function(html) {
			$('#'+container_id).html(html)
		}
	});
}

function polling_mini_get_results(polling_id, container_id) {
	$.ajax({
		type: "POST",
		url: '/polling/get_results/',
		data: {'polling_id': polling_id},
		dataType: "html",
		success: function(html) {
			$('#'+container_id).html(html)
		}
	});
}

function calendar_month_change(year, month, today, container_id) {
	$.ajax({
		type: "GET",
		url: '/calendar/',
		data: {'year': year, 'month': month, 'today': today},
		dataType: "html",
		success: function(html) {
			$('#'+container_id).html(html)
		}
	});
}
