/*********
Interact S.A - www.interact.lu
Olivier percebois-Garve - opercebois at interact dot lu
based on http://kawika.org/jquery/cssCheckbox/

this script allows the customization of radio buttons through css class

*********/
jQuery.fn.cssRadio = function () {
	jQuery("input[@type='radio'] + label", this)
		.each( function(){
			//if ( jQuery(this).prev()[0].checked )
			//jQuery(this).addClass("radio_checked");
			if ( jQuery(this).prev()[0].checked ) jQuery(this).prev()[0].checked = !jQuery(this).prev()[0].checked;
		})
		.hover( 
			function() { jQuery(this).addClass("radio_over"); },
			function() { jQuery(this).removeClass("radio_over"); }
		)
		.click( function() {
		  if (!jQuery(this).prev()[0].checked)  notChecked = true;
		  jQuery(this).siblings("input[@type='radio']").each(function(){
		                                                        if (jQuery(this)[0].checked){
		                                                          jQuery(this).next().removeClass("radio_checked");
		                                                          jQuery(this)[0].checked = false;
		                                                        }
		                                                      });
		  if (notChecked) {
		    jQuery(this).prev()[0].checked = !jQuery(this).prev()[0].checked;
		    jQuery(this).addClass("radio_checked");
		  }
		})
		.prev().hide();
}