function setupLabel() {
	
	var item = $(this);
	var name = item.attr('name').replace('[]','');

	$('input[name^='+name+']').each(function(){
		$("label[for='"+$(this).attr('id')+"']").removeClass('r_on');
		$("label[for='"+$(this).attr('id')+"']").removeClass('c_on');
	});
	
	$('.radio input[name^='+name+']:checked').each(function(){ 
		$("label[for='"+$(this).attr('id')+"']").addClass('r_on');
	});
	
	
	$('.checkbox input[name^='+name+']:checked').each(function(){ 
		console.log($(this).attr('id'));
		$("label[for='"+$(this).attr('id')+"']").addClass('c_on');
	});
	
};
$(document).ready(function(){
	$('.checkbox input, .radio input').change(setupLabel);
	$('.checkbox input:checked, .radio input:checked').change();
});
