var buttonPoll = function (o_form) 
{
	var a_o_options = {};

	var init = function()
	{		
		o_form.find('div.choices label').each(function(i, o)
		{
			add(o);
		});

		o_form.find('input[type=submit]').css('display', 'none');
		
	};
	
	var add = function(o_label)
	{
		var o_option = {};
		o_option.text = $(o_label).text();
		o_option.radio = $(o_label).find('input');

		a_o_options[o_option.text] = o_option;

		$(o_label).after( setupButton(o_option) );
		$(o_label).css('display', 'none');
	};

	var setupButton = function(o_option)
	{
		var o_button = $('<div>')
							.html(o_option.text)
							.addClass('poll-button')
							.click(function() {
								selectButton(o_option.text);
							});
		return o_button;
	};

	var selectButton = function(s_selected)
	{
		$.each(a_o_options, function(s_id, o_option) 
		{
			if(s_id == s_selected)
			{
				$(o_option.radio).attr('checked', true);
			}
			else
			{
				$(o_option.radio).attr('checked', false);
			}
		});

		$(o_form).submit();		
	};

	init();
}
