if (jQuery) {
	(function($) {
        $(document).ready(function() {
			$('#votingform').submit(function() {
				var $this = $(this);
				if ( $this.find('.radio:checked').length == 0) {
					alert('Не выбран вариант ответа!');
					return false;
				}

				$.ajax({
					type: $this.attr('method'),
					url: $this.attr('action'),
					data: $this.serialize() + '&ajax=1&index=1',
					beforeSend: function() {
						$this.addClass('ajax');
					},
					success: function(html) {
						$this.removeClass('ajax');
						$this.parent().html(html);
					}
				});
				return false;
			});
		});
	})(jQuery);
}