jQuery resets checkboxes values
<p>I have this big jQuery function that creates checkboxes in a page and assign different colors to each checkbox when the checkbox is checked.</p>

<pre><code>function initializeCheckboxes() {
  //This changes visual state of checkboxes when you click them, and binds the event to optionsCheckboxClicked function
  var color_codes=[];
  color_codes['green']='#79A13E';
  color_codes['bordeaux']='#A74A5B';
  color_codes['red']='#CC0000';
  color_codes['orange']='#FF6600';
  color_codes['violet']='#660066';
  color_codes['pink']='#FA218C';
  jQuery('div.form_box input.checkbox').parent().unbind('click');
  jQuery('div.form_box input.checkbox').parent().click(function (){
    aCheckboxButton=this;
    if (jQuery(aCheckboxButton).attr('checked')) {
      jQuery(aCheckboxButton).removeAttr('checked');
      jQuery(aCheckboxButton).attr('class','span_checkbox');
      jQuery(aCheckboxButton).find('input').removeAttr('checked');
      jQuery(aCheckboxButton).parent().find('label').removeClass('label_checked');
      jQuery('div.form_box span.span_checkbox.disabled').attr('class','span_checkbox');
      jQuery('div.form_box label.input_text.disabled').attr('class','input_text');
      }
    else {
      total_checked=jQuery(aCheckboxButton).parent().parent().parent().find('label.input_text.label_checked').length;
      if (total_checked&lt;6)
        {
        if (total_checked==5) {
          jQuery.each(jQuery('div.form_box input.checkbox'), function(i,v) {
            if(jQuery(v).attr('checked')) return;
            jQuery(v).parent().parent().find('span').attr('class','span_checkbox disabled');
            jQuery(v).parent().parent().find('label.input_text').attr('class','input_text disabled');
            });
          }
        jQuery(aCheckboxButton).find('input').attr('checked',true);
        jQuery(aCheckboxButton).parent().find('label.input_text').attr('class','input_text label_checked');
        colors=['span_checkbox_green','span_checkbox_bordeaux','span_checkbox_red','span_checkbox_orange','span_checkbox_violet','span_checkbox_pink'];
        jQuery.each(colors, function(i,v){
          if (jQuery(aCheckboxButton).parent().parent().parent().find('span.'+v).length==0) {
            jQuery(aCheckboxButton).attr('class',v);
            jQuery(aCheckboxButton).attr('checked',true);
            optionsCheckboxClicked(aCheckboxButton,color_codes[v.substring(14)]);
            return false;
            }
          });
        } else {
        jQuery(aCheckboxButton).find('input').removeAttr('checked');
        }
      }
    });
}
</code></pre>

<p>The problem is, I need to create a function that will RESET all the checkboxes when it's called. Somthing like resetCheckboxes(). So it will clear all the values the jQuery has in its memory.</p>

<p>I am not a javascript coder, so can you help me please?</p>
