jQuery.fn.accordionQuizz = function(accordion){ 	
  	jQuery('#'+accordion+' input[@type=radio], #'+accordion+' label').each(function()
  	{      
			jQuery(this).removeAttr('checked');                                     //remove checked attribute in case of autofill
		})    
		.click(function()
		{
        var rank = jQuery('#accordion p').index(this.parentNode);
        jQuery('#accordion').activate(rank+1);                                  //open next row after click on a radio button
  		  length_checked = jQuery('#accordion input[@type=radio][@checked]').length;
  		  length_accordion = jQuery('#accordion p').length;
  		  bar_number = length_accordion-length_checked;
  		  jQuery('#progress_bar').css('background-image', 'url(img/barre_'+bar_number+'.gif)'); //switch progress bar image
  		  if(length_checked == length_accordion) jQuery('#accordion').submit();                     //submit form when finished
		}); 
	                                          
};
