Index: dhtml_menu.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dhtml_menu/dhtml_menu.admin.inc,v
retrieving revision 1.7
diff -u -p -r1.7 dhtml_menu.admin.inc
--- dhtml_menu.admin.inc	5 Nov 2008 17:50:55 -0000	1.7
+++ dhtml_menu.admin.inc	9 Nov 2008 22:04:50 -0000
@@ -77,7 +77,40 @@ function dhtml_menu_settings(&$form_stat
     ),
     '#default_value' => variable_get('dhtml_menu_children', 'none'),
   );
-  
+
+  $form['dhtml_menu_disabled'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Menus without DHTML'),
+    '#options' => dhtml_menu_menus(),
+    '#default_value' => variable_get('dhtml_menu_disabled', array()),
+    '#description' => t('DHTML will be used for all menus by default, but can be switched off for specific menus.'),
+  );
+
   return system_settings_form($form);
 }
 
+/**
+ * Build human-readable menu names for book menus.
+ * This fetches the title of the book outline's root node. Titles are cached for performance.
+ */
+function dhtml_menu_menus() {
+  $titles = cache_get('dhtml_book_titles');
+  $titles = isset($titles->data) ? $titles->data : array();
+
+  $menu_internal = menu_get_names();
+
+  foreach ($menu_internal as $key) {
+    if (preg_match('/book-toc-([0-9]+)/', $key, $match)) {
+      if (!isset($titles[$match[1]])) {
+        $node = node_load($match[1]);
+        $titles[$match[1]] = $node->title;
+      }
+      $menus[$key] = t('Book: %title', array('%title' => $titles[$match[1]]));
+    }
+    else $menus[$key] = $key;
+  }
+
+  cache_set('dhtml_book_titles', $titles);
+  return $menus;
+}
+
Index: dhtml_menu.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dhtml_menu/dhtml_menu.js,v
retrieving revision 1.23
diff -u -p -r1.23 dhtml_menu.js
--- dhtml_menu.js	7 Nov 2008 15:40:24 -0000	1.23
+++ dhtml_menu.js	9 Nov 2008 22:04:51 -0000
@@ -38,7 +38,7 @@ Drupal.behaviors.dhtmlMenu = {
      * only the latter element, so we must use siblings() to get 
      * back to the link element. 
      */
-    $('ul.menu li:not(.leaf)').each(function() {
+    $('ul.menu li:not(.leaf,.no-dhtml)').each(function() {
       if (nav == 'pseudo-child') {
         var ul = $(this).find('ul:first');
         if (ul.length) {
Index: dhtml_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dhtml_menu/dhtml_menu.module,v
retrieving revision 1.33
diff -u -p -r1.33 dhtml_menu.module
--- dhtml_menu.module	7 Nov 2008 15:40:24 -0000	1.33
+++ dhtml_menu.module	9 Nov 2008 22:04:51 -0000
@@ -38,9 +38,18 @@ function dhtml_menu_init() {
  * follow the recursion of menu_tree_output().
  */
 function dhtml_menu_theme_menu_item_link($link) {
+  static $disabled;
+  if (!isset($disabled)) {
+    $disabled = variable_get('dhtml_menu_disabled', array());
+  }
+
+  if (isset($link['menu_name']) && !empty($disabled[$link['menu_name']])) {
+    $link['dhtml_disabled'] = TRUE;
+  }
+
   // The ID is the mlid or a stripped form of the link path. It just must be unique.
   $id = isset($link['mlid']) ? $link['mlid'] : preg_replace('/[^a-z0-9]/', '0', $link['href']);
-  
+
   if (!isset($link['localized_options']) || !is_array($link['localized_options'])) $link['localized_options'] = array('attributes' => '');
   $link['localized_options']['attributes']['id'] = "menu-". $id;
 
@@ -68,6 +77,16 @@ function dhtml_menu_theme_menu_item($lin
    */
   $stack = _dhtml_menu_stack();
 
+  // Move to the last element in the stack (the current item).
+  end($stack);
+  
+  // If this item should not have DHTML, then return to the "parent" function.
+  $current = current($stack);
+  if (!empty($current['dhtml_disabled'])) {
+    $extra_class .= ' no-dhtml ';
+    return theme_menu_item($link, $has_children, $menu, $in_active_trail, $extra_class);
+  }
+  
   // If there are children, but they were not loaded...
   if ($has_children && !$menu) {
     // Load the tree below the current position.
@@ -78,12 +97,9 @@ function dhtml_menu_theme_menu_item($lin
     if (!$menu) $has_children = FALSE; // Sanitize tree.
   }
 
-  // Move to the last element in the stack (the current item).
-  end($stack);
-
-  // If this item can expand, and is neither saved as open nor in the active trail, close it.
+  // If the current item can expand, and is neither saved as open nor in the active trail, close it.
   if ($menu && !($in_active_trail || in_array(substr(key($stack), 5), $cookie))) {
-    $extra_class .= ' collapsed start-collapsed';
+    $extra_class .= ' collapsed start-collapsed ';
   }
 
   return theme_menu_item($link, $has_children, $menu, $in_active_trail, $extra_class);
