--- taxonomy_super_select/taxonomy_super_select.module	Thu Jan 22 00:44:22 2009
+++ taxonomy_super_select/taxonomy_super_select.module	Wed Jul 07 15:56:02 2010
@@ -47,6 +47,14 @@
         '#weight'         => 0,
         '#description'    => t('Leaving this disabled forces users to select dangling child terms. Useful for grouping terms with descriptive parent terms that are not themselves needed for display.'),
       );
+	  $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['collapse'] = array(
+        '#type'           => 'checkbox',
+        '#title'          => t('Collapse fieldset by default'),
+        '#default_value'  => ($tss ? $tss['collapse'] : array()),
+        '#return_value'   => 1,
+        '#weight'         => 0,
+        '#description'    => t('Enabling this the fieldset containing the terms will be collapsed upon load.'),
+      );
 
       if (module_exists('taxonomy_image')) {
         $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['image'] = array(
@@ -147,7 +155,15 @@
     case 'fieldset':
       // In this section, $term is actually the vocabulary.
       // Automatically expand required vocabs or if the parent term is selected
-      $collapsed = ($required OR $term->parent_value) ? FALSE : TRUE;
+      $tss = variable_get('taxonomy_super_select_vid_'. $vid, 0);
+			// On vocab edit page you may choose to collapse the fieldset by default.
+			// If you want that to be the only rule choose Option 1 (comment Option 2).
+			// If you want it to be overridden by required vocabs uncomment Option 1
+			// and enable Option 2 by uncommenting.
+			$collapsed = $tss['collapse']; # Option 1
+			//$collapsed = ($required OR $term->parent_value) ? FALSE : $tss['collapse']; # Option 2
+			
+			
       if ($term->help) {
         $help = '<div class="taxonomy-super-select-help">'. $term->help .'</div>';
       }
@@ -312,8 +328,9 @@
   if (count($form['settings']['tss']['taxonomy_super_select_vid_'. $vid])) {
       $tostore = array(
         'types' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['types']['#value'],
-       'parents' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['parents']['#value'],
+        'parents' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['parents']['#value'],
         'image' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['image']['#value'],
+				'collapse' => $form['settings']['tss']['taxonomy_super_select_vid_'. $vid]['collapse']['#value'],
       );
     variable_set('taxonomy_super_select_vid_'. $vid, $tostore);    
   }
