diff -U3 -r drupal.bak/includes/menu.inc drupal/includes/menu.inc
--- drupal.bak/includes/menu.inc	2005-09-19 03:03:26.000000000 +1000
+++ drupal/includes/menu.inc	2005-10-05 21:14:46.000000000 +1000
@@ -82,6 +82,7 @@
 define('MENU_IS_LOCAL_TASK', 0x0080);
 define('MENU_EXPANDED', 0x0100);
 define('MENU_LINKS_TO_PARENT', 0x0200);
+define('MENU_DISPLAYS_AS_ROW', 0x0400);
 
 /**
  * @} End of "Menu flags".
@@ -703,6 +704,75 @@
 }
 
 /**
+ * Generate a horizontal menu. Often referred to as primary and secondary links.
+ *
+ * @param $pid
+ *   The menu ID to render. Children of this menu item will be rendered, 
+ *   but the item itself will be omitted.
+ *   Defaults to NULL, meaning it will use the menu_primary_menu setting.
+ * @param $start_level
+ *   The number of levels under the pid you want to render.
+ *   If you want to render the secondary items, set this to 2 and this 
+ *  will skip the first (primary) level and give you level 2.
+ * @param $show_empty
+ *   can be 'TRUE' or 'FALSE'
+ *   If TRUE, render an empty link tab, even if there are no items.
+ *   Some themes break if an empty string is returned.
+ *
+ * @ingroup themeable
+ */
+function theme_tabs_menu_row($pid = NULL, $start_level = 1, $show_empty = TRUE) {
+  $menu = menu_get_menu();
+
+  if (!$pid) {
+    $pid = variable_get('menu_primary_menu', 1);
+  }
+
+  // dig into the menu tree to find the pid on the active trail start_level levels deep
+  for ($this_level = 1; $this_level < $start_level && $pid ; $this_level++) {
+    // set up a flag so we know if we found the active trail
+    $found_active = 0;
+    // for each child of pid
+    foreach ($menu['visible'][$pid]['children'] as $mid) {
+      // if we're on the active trail
+      if (menu_in_active_trail($mid)) {
+        // if this item has children
+        if (count($menu['visible'][$mid]['children'])) {
+	  // set this as $pid and continue digging
+          $pid = $mid;
+          $found_active = 1;
+        }
+      }
+    }
+    // bail out if the active trail ends before we dig deep enough
+    // This can happen if the tree is not deep enough or if the 
+    // current node is not a child of the menu we're traversing
+    if (!$found_active) {
+      $pid = NULL;
+    }
+  }
+
+  // create a ul for the sub-menu $pid
+  $tabs = '';
+  if ($pid) {
+    // we already know this $pid has children from the above search
+    foreach ($menu['visible'][$pid]['children'] as $mid) {
+      $style = "leaf";
+      if (menu_in_active_trail($mid)) {
+        $style .= " active";
+      }
+      $style .= " level-$this_level";
+      $tabs .= "<li class=\"$style\">" . menu_item_link($mid) . "</li>\n";
+    }
+  }
+  if ($show_empty || $tabs) {
+    $output .= "<ul class=\"primary level-$this_level\">\n$tabs</ul>\n";
+  }
+
+  return $output;
+}
+
+/**
  * @} End of "defgroup menu".
  */
 
diff -U3 -r drupal.bak/includes/theme.inc drupal/includes/theme.inc
--- drupal.bak/includes/theme.inc	2005-09-30 11:27:16.000000000 +1000
+++ drupal/includes/theme.inc	2005-10-05 20:31:34.000000000 +1000
@@ -212,8 +212,6 @@
  */
 function theme_get_settings($key = NULL) {
   $defaults = array(
-    'primary_links'                 =>  array(),
-    'secondary_links'               =>  array(),
     'mission'                       =>  '',
     'default_logo'                  =>  1,
     'logo_path'                     =>  '',
@@ -225,8 +223,6 @@
     'toggle_search'                 =>  1,
     'toggle_slogan'                 =>  0,
     'toggle_mission'                =>  1,
-    'toggle_primary_links'          =>  1,
-    'toggle_secondary_links'        =>  1,
     'toggle_node_user_picture'      =>  0,
     'toggle_comment_user_picture'   =>  0,
   );
@@ -306,40 +302,6 @@
         $settings['favicon'] = $settings['favicon_path'];
       }
     }
-
-    foreach (array('primary', 'secondary') as $type) {
-      // Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format.
-      $value = $settings[$type . '_links'];
-
-      // Clear out existing (internal) values
-      $settings[$type .'_links'] = array();
-
-      // Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
-      $count = variable_get($type . '_link_count', 5);
-      $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
-
-      if ($settings['toggle_' . $type . '_links']) {
-        for ($i =0; $i < $count; $i++) {
-          unset($attributes);
-          if (!empty($value['text'][$i])) {
-            if (!empty($value['description'][$i])) {
-              $attributes['title'] = $value['description'][$i];
-            }
-            $text = $value['text'][$i];
-            $link = $value['link'][$i];
-            if (substr($link, 0, 7) == 'http://') {
-              $settings[$type .'_links'][] = '<a href="'. check_url($link) .'"'. drupal_attributes($attributes) .'>'. check_plain($text) .'</a>';
-            }
-            else {
-              $settings[$type .'_links'][] = l($text, $link, $attributes);
-            }
-          }
-        }
-        if ($settings[$type .'_links'] == array()) {
-          $settings[$type .'_links'] = array(l(t('edit %type links', array('%type' => $type)),'admin/themes/settings'));
-        }
-      }
-    }
   }
 
   return isset($settings[$setting_name]) ? $settings[$setting_name] : NULL;
diff -U3 -r drupal.bak/misc/drupal.css drupal/misc/drupal.css
--- drupal.bak/misc/drupal.css	2005-09-08 06:56:00.000000000 +1000
+++ drupal/misc/drupal.css	2005-10-05 15:49:02.000000000 +1000
@@ -546,6 +546,56 @@
   border-bottom: 4px solid #999;
 }
 
+/* primary/secondary navigation */
+ul.level-1 {
+  border-collapse: collapse;
+  padding: 0 0 0 1em;
+  white-space: nowrap;
+  list-style: none;
+  margin: 5px;
+  height: auto;
+  line-height: normal;
+  border-bottom: 1px solid #bbb;
+}
+ul.level-1 li {
+  display: inline;
+}
+ul.level-1 li a {
+  background-color: #ddd;
+  border-color: #bbb;
+  border-width: 1px;
+  border-style: solid solid none solid;
+  height: auto;
+  margin-right: 0.5em;
+  padding: 0 1em;
+  text-decoration: none;
+}
+ul.level-1 li.active a {
+  background-color: #fff;
+  border: 1px solid #bbb;
+  border-bottom: #fff 1px solid;
+}
+ul.level-1 li a:hover {
+  background-color: #eee;
+  border-color: #ccc;
+  border-bottom-color: #eee;
+}
+ul.level-2 {
+  border-bottom: 1px solid #bbb;
+  padding: 0.5em 0em 0em 1em;
+  margin: 5px;
+}
+ul.level-2 li {
+  display: inline;
+}
+ul.level-2 a {
+  padding: 0;
+  text-decoration: none;
+}
+ul.level-2 a.active {
+  border-bottom: 4px solid #999;
+}
+
 /*
 ** Autocomplete styles
 */
diff -U3 -r drupal.bak/modules/menu.module drupal/modules/menu.module
--- drupal.bak/modules/menu.module	2005-09-28 08:34:40.000000000 +1000
+++ drupal/modules/menu.module	2005-10-05 21:22:29.000000000 +1000
@@ -47,6 +47,11 @@
       'callback' => 'menu_reset',
       'access' => user_access('administer menu'),
       'type' => MENU_LOCAL_TASK);
+
+    $items[] = array('path' =>'admin/settings/menus',
+      'title'=>t('menus'),
+      'callback'=>'menu_config',
+      'access'=> user_access('administer menu'));
   }
 
   return $items;
@@ -65,7 +70,46 @@
       return t('<p>Enter the name for your new menu. Remember to enable the newly created block in the %blocks administration page.</p>', array('%blocks' => l(t('blocks'), 'admin/block')));
     case 'admin/menu/item/add':
       return t('<p>Enter the title, path, position and the weight for your new menu item.</p>');
+    case 'admin/settings/menu':
+      return t('<p>Customize the menu settings.</p>');
+  }
+}
+
+
+/**
+ * Settings page.
+ */
+function menu_config() {
+  $op = $_POST['op'];
+  $edit = $_POST['edit'];
+  $output = '';
+
+  switch ($op) {
+    case t('Submit'):
+      variable_set('menu_primary_menu', $edit['menu_primary_menu']);
+      drupal_set_message(t('primary menu saved'));
+      //no break, because we want to show the form again.
+    default:
+      $menu = menu_get_menu();
+      $header = array(t('Menu item'), t('Expanded'), array('data' => t('Operations'), 'colspan' => '3'));
+      $output = '';
+
+      foreach ($menu['items'][0]['children'] as $mid) {
+        $options[$mid] = $menu['items'][$mid]['title'];
+      }
+      if(count($options) > 1) {
+        $output .= form_radios(t('primary links'), 'menu_primary_menu', variable_get('menu_primary_menu', 0), $options, t('Choose the menu from which the primary links will be generated.'), FALSE, $attributes = NULL);
+        $output .= form_submit(t('Submit'));
+        $output = form($output);
+      }
+      else {
+        variable_set('menu_primary_menu', 0);
+        drupal_set_message(t('The primary links will be generated from the Navigation menu.'));
+      }
+      break;
   }
+
+  print theme('page', $output);
 }
 
 /**
@@ -85,8 +129,14 @@
     return $blocks;
   }
   else if ($op == 'view') {
-    $data['subject'] = $menu['items'][$delta]['title'];
-    $data['content'] = '<div class="menu">'. theme('menu_tree', $delta) .'</div>' ;
+    if ($menu['items'][$delta][type] & MENU_DISPLAYS_AS_ROW) {
+      $data['subject'] = '';
+      $data['content'] = '<div class="menu">'. theme('tabs_menu_row', $delta) .'</div>' ;
+    }
+    else {
+      $data['subject'] = $menu['items'][$delta]['title'];
+      $data['content'] = '<div class="menu">'. theme('menu_tree', $delta) .'</div>' ;
+    }
     return $data;
   }
 }
@@ -306,6 +356,7 @@
   $form .= form_textfield(t('Title'), 'title', $edit['title'], 60, 128, t('The name of the menu.'), NULL, TRUE);
 
   if ($edit['pid'] == 0) {
+    $form .= form_checkbox(t('Horizontal'), 'horizontal', 1, ($edit['type'] & MENU_DISPLAYS_AS_ROW), t('If checked, when being displayed in a block the menu will be drawn as a row instead of a column.'));
     // Display a limited set of fields for menus (not items).
     $form .= form_hidden('path', '');
     $form .= form_hidden('pid', 0);
@@ -380,6 +431,13 @@
     $edit['type'] &= ~MENU_EXPANDED;
   }
 
+  if ($edit['horizontal']) {
+    $edit['type'] |= MENU_DISPLAYS_AS_ROW;
+  }
+  else {
+    $edit['type'] &= ~MENU_DISPLAYS_AS_ROW;
+  }
+
   if ($edit['mid']) {
     db_query("UPDATE {menu} SET pid = %d, path = '%s', title = '%s', description = '%s', weight = %d, type = %d WHERE mid = %d", $edit['pid'], $edit['path'], $edit['title'], $edit['description'], $edit['weight'], $edit['type'] | MENU_MODIFIED_BY_ADMIN, $edit['mid']);
     drupal_set_message(t('The menu item %title has been updated.', array('%title' => theme('placeholder', $edit['title']))));
@@ -573,3 +631,4 @@
   db_query("DELETE FROM {menu} WHERE path = 'node/%s'", $node->nid);
 }
 
+?>
diff -U3 -r drupal.bak/modules/system.module drupal/modules/system.module
--- drupal.bak/modules/system.module	2005-09-18 20:37:57.000000000 +1000
+++ drupal/modules/system.module	2005-10-05 21:28:20.000000000 +1000
@@ -762,46 +762,6 @@
 
   // System wide only settings.
   if (!$key) {
-    // Menu settings
-
-    $header = array(t('link text'), t('url'), t('description'));
-    foreach (array('Primary', 'Secondary') as $utype) {
-      $group = '';
-      $rows = array();
-
-      // Use $utype field , and strtolower() it to get the type field.. to avoid issues with ucfirst() and unicode.
-      $type = drupal_strtolower($utype);
-      $value = $settings[$type . '_links'];
-      if (!is_array($value)) {
-        $value = array();
-      }
-
-      // Increment the link count, if the user has requested more links.
-      if (variable_get($type . '_links_more', false)) {
-        variable_del($type . '_links_more');
-        variable_set($type . '_link_count', variable_get($type . '_link_count', 5) + 5);
-      }
-
-      // Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
-      $count = variable_get($type . '_link_count', 5);
-      $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
-      if (variable_get($type . '_link_count', 5) != $count) {
-        variable_set($type . '_link_count', $count);
-      }
-
-      for ($i = 0; $i < $count; $i++) {
-        $row = array();
-        foreach (array('text', 'link', 'description') as $field) {
-          $row[] = form_textfield('', $var . '][' . $type . '_links][' . $field . '][' . $i, $value[$field][$i], 15, 90);
-        }
-        $rows[] = $row;
-      }
-
-      $group .= form_item('', theme("table", $header, $rows), t('You can specify your _TYPE_ links here, one link per line.<br /> The link text field is the text you want to link.<br /> The url field is the location the link points to.<br /> The description field is an optional description of where the link points.', array('_TYPE_' => $type)));
-      $group .= form_checkbox(t('I need more _TYPE_ links.', array('_TYPE_' => $type)), $type . '_links_more', 1, FALSE, t('Checking this box will give you 5 additional _TYPE_ links.', array('_TYPE_' => $type)));
-      $form .= form_group(t('_TYPE_ link settings', array('_TYPE_' => $utype)), $group);
-    }
-
     // Toggle node display.
     $node_types = module_invoke('node', 'get_types');
     if ($node_types) {
@@ -820,8 +780,6 @@
     'toggle_name'                 => t('Site name'),
     'toggle_slogan'               => t('Site slogan'),
     'toggle_mission'              => t('Mission statement'),
-    'toggle_primary_links'        => t('Primary links'),
-    'toggle_secondary_links'      => t('Secondary links'),
     'toggle_node_user_picture'    => t('User pictures in posts'),
     'toggle_comment_user_picture' => t('User pictures in comments'),
     'toggle_search'               => t('Search box'),
diff -U3 -r drupal.bak/themes/bluemarine/page.tpl.php drupal/themes/bluemarine/page.tpl.php
--- drupal.bak/themes/bluemarine/page.tpl.php	2005-08-25 01:28:53.000000000 +1000
+++ drupal/themes/bluemarine/page.tpl.php	2005-10-05 21:08:26.000000000 +1000
@@ -18,8 +18,8 @@
       <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
     </td>
     <td id="menu">
-      <?php if ($secondary_links) { ?><div id="secondary"><?php print theme('links', $secondary_links) ?></div><?php } ?>
-      <?php if ($primary_links) { ?><div id="primary"><?php print theme('links', $primary_links) ?></div><?php } ?>
+      <?php print $primary_navigation ?>
+      <?php print $secondary_navigation ?>
       <?php if ($search_box) { ?><form action="<?php print $search_url ?>" method="post">
         <div id="search">
           <input class="form-text" type="text" size="15" value="" name="edit[keys]" alt="<?php print $search_description ?>" />
diff -U3 -r drupal.bak/themes/bluemarine/style.css drupal/themes/bluemarine/style.css
--- drupal.bak/themes/bluemarine/style.css	2005-09-03 05:18:14.000000000 +1000
+++ drupal/themes/bluemarine/style.css	2005-10-05 20:33:05.000000000 +1000
@@ -92,7 +92,7 @@
 #menu {
   padding: 0.5em 0.5em 0 0.5em;
   text-align: right;
-  vertical-align: middle;
+  vertical-align: top;
 }
 #primary {
   font-size: 1.0em;
@@ -223,6 +223,10 @@
 .block .title {
   margin-bottom: .25em;
 }
+#footer .block.block-menu {
+  border-bottom: 0px;
+  margin-bottom: 0em;
+}
 .box .title {
   font-size: 1.1em;
 }
diff -U3 -r drupal.bak/themes/chameleon/chameleon.theme drupal/themes/chameleon/chameleon.theme
--- drupal.bak/themes/chameleon/chameleon.theme	2005-08-17 04:06:18.000000000 +1000
+++ drupal/themes/chameleon/chameleon.theme	2005-10-05 16:29:55.000000000 +1000
@@ -11,9 +11,7 @@
        'logo',
        'toggle_favicon',
        'toggle_name',
-       'toggle_slogan',
-       'toggle_primary_links',
-       'toggle_secondary_links');
+       'toggle_slogan');
 }
 
 function chameleon_regions() {
@@ -55,18 +53,8 @@
 
   $output .= "</div>\n";
 
-  $primary_links = theme('links', theme_get_setting('primary_links'));
-  $secondary_links = theme('links', theme_get_setting('secondary_links'));
-  if ($primary_links || $secondary_links) {
-    $output .= ' <div class="navlinks">';
-    if ($primary_links) {
-      $output .= '<div class="primary">'. $primary_links .'</div>';
-    }
-    if ($secondary_links) {
-      $output .= '<div class="secondary">'. $secondary_links .'</div>';
-    }
-    $output .= " </div>\n";
-  }
+  $output .= theme('tabs_menu_row', NULL, 1);
+  $output .= theme('tabs_menu_row', NULL, 2, FALSE);
 
   $output .= " <table id=\"content\">\n";
   $output .= "  <tr>\n";
diff -U3 -r drupal.bak/themes/engines/phptemplate/phptemplate.engine drupal/themes/engines/phptemplate/phptemplate.engine
--- drupal.bak/themes/engines/phptemplate/phptemplate.engine	2005-09-09 15:32:31.000000000 +1000
+++ drupal/themes/engines/phptemplate/phptemplate.engine	2005-10-05 16:30:23.000000000 +1000
@@ -126,9 +126,7 @@
     'toggle_mission',
     'toggle_name',
     'toggle_node_user_picture',
-    'toggle_primary_links',
     'toggle_search',
-    'toggle_secondary_links',
     'toggle_slogan'
   );
 }
@@ -196,14 +194,14 @@
     'messages'            => theme('status_messages'),
     'mission'             => $mission,
     'onload_attributes'   => theme('onload_attribute'),
-    'primary_links'       => theme_get_setting('primary_links'),
+    'primary_navigation'  => theme('tabs_menu_row', NULL, 1, FALSE),
+    'secondary_navigation'=> theme('tabs_menu_row', NULL, 2, FALSE),
     'site_name'           => (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''),
     'site_slogan'         => (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : ''),
     'search_box'          => theme_get_setting('toggle_search'),
     'search_button_text'  => t('search'),
     'search_description'  => t('Enter the terms you wish to search for.'),
     'search_url'          => url('search'),
-    'secondary_links'     => theme_get_setting('secondary_links'),
     'sidebar_left'        => $sidebar_left,
     'sidebar_right'       => $sidebar_right,
     'styles'              => theme_get_styles(),
diff -U3 -r drupal.bak/themes/pushbutton/page.tpl.php drupal/themes/pushbutton/page.tpl.php
--- drupal.bak/themes/pushbutton/page.tpl.php	2005-08-17 04:06:18.000000000 +1000
+++ drupal/themes/pushbutton/page.tpl.php	2005-10-05 20:58:27.000000000 +1000
@@ -34,7 +34,7 @@
     </td>
 
     <td class="primary-links" width="70%" align="center" valign="middle">
-      <?php print theme('links', $primary_links) ?>
+      <?php print theme('tabs_menu_row', NULL, 1, FALSE) ?>
     </td>
   </tr>
 </table>
@@ -42,7 +42,7 @@
 <table id="secondary-menu" summary="Navigation elements." border="0" cellpadding="0" cellspacing="0" width="100%">
   <tr>
     <td class="secondary-links" width="75%"  align="center" valign="middle">
-      <?php print theme('links', $secondary_links) ?>
+      <?php print theme('tabs_menu_row', NULL, 2, TRUE) ?>
     </td>
     <td  width="25%"  align="center" valign="middle">
       <?php if ($search_box): ?>
@@ -108,21 +108,9 @@
 
 <table id="footer-menu" summary="Navigation elements." border="0" cellpadding="0" cellspacing="0" width="100%">
   <tr>
-    <td align="center" valign="middle">
-    <?php if (is_array($primary_links)) : ?>
-      <div class="primary-links">
-        <?php foreach ($primary_links as $link): ?>
-          <?php print $link?> |
-        <?php endforeach; ?>
-      </div>
-    <?php endif; ?>
-    <?php if (is_array($secondary_links)) : ?>
-      <div class="secondary-links">
-        <?php foreach ($secondary_links as $link): ?>
-          <?php print $link?> |
-        <?php endforeach; ?>
-      </div>
-    <?php endif; ?>
+    <td class="secondary-links" width="70%" align="center" valign="middle">
+      <?php print theme('tabs_menu_row', NULL, 1, FALSE) ?>
+      <?php print theme('tabs_menu_row', NULL, 2, FALSE) ?>
     </td>
   </tr>
 </table>
diff -U3 -r drupal.bak/themes/pushbutton/style.css drupal/themes/pushbutton/style.css
--- drupal.bak/themes/pushbutton/style.css	2005-09-03 05:18:14.000000000 +1000
+++ drupal/themes/pushbutton/style.css	2005-10-05 21:05:00.000000000 +1000
@@ -104,6 +104,9 @@
 .primary-links a:hover {
   color: #000;
 }
+.primary-links li a.active {
+  color: #333;
+}
 #primary-menu .primary-links   {
   background: transparent url(header-b.jpg) left top no-repeat;
   font-size: 0.79em;
@@ -118,12 +121,15 @@
   border-bottom: 3px solid #69c;
 }
 .secondary-links, .secondary-links a:link, .secondary-links a:visited  {
-  color: #e4e9eb;
+  color: #369;
 }
 .secondary-links a:hover {
-  color: #fff;
+  color: #000;
   text-decoration: underline;
 }
+.secondary-links li a.active {
+  color: #333;
+}
 #secondary-menu .secondary-links {
   font-size: 0.85em;
 }
@@ -319,17 +325,6 @@
   padding: 5px;
   font-size: 0.75em;
 }
-#footer-menu .primary-links, #footer-menu a:link, #footer-menu a:visited  {
-  color: #e4e9eb;
-}
-#footer-menu a:hover  {
-  color: #fff;
-  text-decoration: underline;
-}
-#footer-menu .primary-links h1, #footer-menu .primary-links h2, #footer-menu .primary-links h3 {
-  font-size: 1.3em;
-  color: #e4e9eb;
-}
 /*
 ** Common declarations for child classes of node, comment, block, box, etc.
 ** If you want any of them styled differently for a specific parent, add
@@ -397,6 +392,11 @@
 .block {
   margin-bottom: 1.5em;
 }
+#footer-message .block.block-menu .title h3 {
+  border-bottom: 0px;
+  padding: 0px;
+  background: transparent;
+}
 .box .title {
   font-size: 1.1em;
 }
