$(document).ready(function() {

	$("#poll-submit").click(function() {
		var pid = /[0-9]+/.exec($('#poll input:radio:checked').attr('name'))[0];
		var aid = $('#poll input:radio:checked').val();
		if ($('#poll input:radio:checked')) {
			$.ajax({
				type: "POST",
				url: "/script/poll.php",
				data: { aid: aid, pid: pid, action: "vote" },
			});
		$('#poll').replaceWith('<h3>Thank you for your input</h3>');
		}
		return false;
	});

});

