jQuery.fn.muRadioButton = function()
{
	// convert all the checkboxs over to jediisam.
	$(":radio", this).each(function()
	{
		var radio = this;
		var label = $("label[for='"+$(radio).attr("id")+"']");

		if (radio.checked)	// Initial state check
		{
			label.addClass("checked");
		}

		// clicking on label selects the radio button
		$(label).click( function()
		{
			$(this).setRadioButton();
			return false;
		});

		$(label).hover(
			function() { $(this).addClass("over"); },
			function() { $(this).removeClass("over"); }

		);

		// Hide the radio button
		$(this).hide();
	});
}

jQuery.fn.setRadioButton = function()
{
	// me is the lable
	var me = $(this);
	// get my radio button
	var radioButton = $(":radio[id='"+me.attr("for")+"']")[0];

	// unselect all the radio buttons which belong to my group
	$.unsetRadioButtonGroup(radioButton.name);

	// make me the one
	me.addClass("checked");
	radioButton.click();
}

jQuery.fn.unsetRadioButton = function()
{
	var me = $(this);
	me.removeClass("checked");
	var radioButton = $(":radio[id='"+me.attr("for")+"']")[0];
	radioButton.checked = false;
}

jQuery.unsetRadioButtonGroup = function(groupName)
{
	// select all the radio buttons which have the name="groupName" attribute
	$(":radio[name='"+groupName+"']").each(function()
	{
		// select the label
		var label = $("label[for='"+$(this).attr("id")+"']");
		// removed the checked class
		label.removeClass("checked");
		this.checked = false;
	});
}
