diff -U3 -r -N --exclude=CVS 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-04 15:05:26.000000000 +1000
@@ -754,7 +754,8 @@
   // Set up items array, including default "Navigation" menu.
   $_menu['items'] = array(
     0 => array('path' => '', 'title' => '', 'type' => MENU_IS_ROOT),
-    1 => array('pid' => 0, 'path' => '', 'title' => t('Navigation'), 'weight' => -50, 'access' => TRUE, 'type' => MENU_IS_ROOT | MENU_VISIBLE_IN_TREE)
+    1 => array('pid' => 0, 'path' => '', 'title' => t('Navigation'), 'weight' => -50, 'access' => TRUE, 'type' => MENU_IS_ROOT | MENU_VISIBLE_IN_TREE),
+    2 => array('pid' => 0, 'path' => '', 'title' => t('Primary navigation'), 'weight' => -100, 'access' => TRUE, 'type' => MENU_IS_ROOT | MENU_VISIBLE_IN_TREE)
     );
 
   // Build a sequential list of all menu items.
diff -U3 -r -N --exclude=CVS 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-03 22:59:00.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 -N --exclude=CVS 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-03 23:28:58.000000000 +1000
@@ -546,6 +546,39 @@
   border-bottom: 4px solid #999;
 }
 
+/* navigation */
+
+ul.level-1 {
+  list-style-type: none;
+  text-align: right;
+}
+
+ul.level-1 li, ul.level-2 li {
+  margin: 0;
+  padding: 0;
+  display: block;
+  float: right;
+  text-align: center;
+}
+
+ul.level-1 li a, ul.level-2 li a {
+  background-color: #fff;
+  margin: 5px 0 0 10px;
+  padding: 0 5px;
+  display: block;
+}
+
+ul.level-1 li a.active, ul.level-1 li a:hover, ul.level-2 li a.active, ul.level-2 li a:hover {
+ text-decoration: underline;
+}
+
+ul.level-2 {
+  clear: both;
+  list-style-type: none;
+  text-align: right;
+}
+
+
 /*
 ** Autocomplete styles
 */
diff -U3 -r -N --exclude=CVS drupal.bak/modules/primary_links.module drupal/modules/primary_links.module
--- drupal.bak/modules/primary_links.module	1970-01-01 10:00:00.000000000 +1000
+++ drupal/modules/primary_links.module	2005-10-04 15:04:11.000000000 +1000
@@ -0,0 +1,145 @@
+<?php
+/**
+ * Implementation of hook_help().
+ */
+function primary_links_help($section) {
+  switch ($section) {
+    case 'admin/modules#description':
+      return t('This module provides some menu APIs that can be used in a theme');
+  }
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function primary_links_menu($may_cache) {
+  if($may_cache) {
+    $items[] = array('path' =>'admin/menu/primary',
+                     'title'=>t('Primary links'),
+                     'callback'=>'primary_links_config',
+                     'access'=> user_access('administer menu'),
+                     'type'=>MENU_LOCAL_TASK);
+  }
+  return $items;
+}
+
+/**
+ * Configuration page.
+ */
+function primary_links_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, becuase 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 menu items'), 'menu_primary_menu', variable_get('menu_primary_menu', 0), $options, t('Choose a container for primary menu items.'), FALSE, $attributes = NULL);
+        $output .= form_submit(t('Submit'));
+        $output = form($output);
+      }
+      else {
+        variable_set('menu_primary_menu', 0);
+        drupal_set_message(t('You have only one container. The primary items are automatically set to use that container.'));
+      }
+      break;
+  }
+
+  print theme('page', $output);
+}
+
+ /**
+ * Generate the horizontal menu. Often referred to as primary and secondary links.
+ *
+ * @param $pid
+ *   The menu ID where to render from. All children of this menu item will be rendered, 
+ *   but the item itself will be omitted.
+ *   defaults to NULL, meaning it will use the settings from menu.
+ * @param $start_level
+ *   provide the number of levels under the pid you want to show your items. 
+ *   For example, if you want to show the secondary items somewhere else, you call
+ *   theme_tabs_menu_tree with a $start_level 2. 
+  * @param $end_level
+ *   provide the number of levels under the pid you want to show children of your items. 
+ *   For example, if you want to show the secondary and tertiary items somewhere else, you call
+ *   theme_tabs_menu_tree with a $start_level 2 and $end_level 3; Provide 'inf' if you want to show all items.
+ *   If you want only onle level , say level 2, give $start_level = 1  and $end_level = 1.
+ * @param $show_empty
+ *   can be 'TRUE' or 'FALSE'
+ *   used to render an empty secondary link tab, if therre are no secondary items.
+ *   if no empty tab is rendered, it is very difficult to design the page in a consistant
+ *   way. Defaults to 'TRUE'
+ *
+ * @ingroup themeable
+ */
+ 
+function theme_tabs_menu_tree($pid = NULL, $start_level = 1, $end_level = 2, $show_empty = TRUE) {
+  $menu = menu_get_menu();
+
+  if (!$pid) {
+    $pid = variable_get('menu_primary_menu', 1);
+  }
+  else {
+// ?is this comment still relevant?
+// we are dealing with a second row of primary tabs.
+    static $active_level;
+  }
+
+  if (!$active_level) {
+    $active_level = 1;
+  }
+
+  while ($stop == FALSE) {
+    $stop = TRUE;
+
+    foreach ($menu['visible'][$pid]['children'] as $mid) {
+      if (count($menu['visible'][$mid]['children'])) {
+        if (menu_in_active_trail($mid)) {
+          $pid = $mid;
+          $style = 'expanded';
+        }
+        else {
+          $style = 'collapsed';
+        }
+      }
+      else {
+        if (menu_in_active_trail($mid)) {
+          $style = 'leaf active';
+        }
+        else {
+          $style = 'leaf';
+        }
+      }
+      if ($active_level <= $end_level && $active_level >= $start_level) {
+        $tabs .= "\t\t<li class=\"$style level-$active_level\">". menu_item_link($mid) ."</li>\n";
+      }
+    }
+    if ($active_level <= $end_level && $active_level >= $start_level && ($show_empty || $tabs)) {
+      $output .= "<ul class=\"primary level-$active_level\">\n $tabs </ul>\n";
+    }
+
+    if ($end_level != 'inf' || $active_level > $end_level) {
+      $stop = TRUE;
+    }
+    else {
+      $stop = FALSE;
+    }
+
+    $active_level ++;
+  }
+
+  return $output;
+}
+
+?>
diff -U3 -r -N --exclude=CVS 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-03 23:04:27.000000000 +1000
@@ -36,7 +36,9 @@
       <p>If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.</p>
       <p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>.  Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs.  A good crontab line to run the cron script once every hour would be:
       <pre>     00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>
-      Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment variables will not be set correctly and features may not work as expected.</p>", array('%base_url' => $base_url, '%cron-link' => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", '%lynx' => 'http://lynx.browser.org', '%wget' => 'http://www.gnu.org/software/wget/wget.html' ));
+      Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment variables will not be set correctly and features may not work as expected.</p>
+      <h3><a id=\"navigation\">Primary navigation</a></h3>
+      Your can edit your site's primary navigation menu, on the <a href=\"%edit\">menu page</a> (requires the menu module to be <a href=\"%enable\">enabled</a>).",array('%base_url' => $base_url, '%cron-link' => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", '%lynx' => 'http://lynx.browser.org', '%wget' => 'http://www.gnu.org/software/wget/wget.html','%enable'=>url('admin/modules'),'%edit'=>url('admin/menu')));
     case 'admin/modules#description':
       return t('Handles general site configuration for administrators.');
   }
@@ -762,46 +764,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 +782,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 -N --exclude=CVS 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-03 23:05:39.000000000 +1000
@@ -18,8 +18,7 @@
       <?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 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 ?>" />
@@ -48,6 +47,7 @@
         <?php print $messages ?>
 
         <?php print $content; ?>
+        <?php print $sidebar_inside; ?>
       </div>
     </td>
     <?php if ($sidebar_right) { ?><td id="sidebar-right">
diff -U3 -r -N --exclude=CVS 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-03 23:09:40.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,7 @@
 
   $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_tree');
 
   $output .= " <table id=\"content\">\n";
   $output .= "  <tr>\n";
diff -U3 -r -N --exclude=CVS 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-03 23:14:27.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,13 @@
     'messages'            => theme('status_messages'),
     'mission'             => $mission,
     'onload_attributes'   => theme('onload_attribute'),
-    'primary_links'       => theme_get_setting('primary_links'),
+    'primary_navigation'  => theme('tabs_menu_tree'),
     '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 -N --exclude=CVS 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-04 14:05:51.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_tree', NULL, 1, 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_tree', NULL, 2, 2, FALSE) ?>
     </td>
     <td  width="25%"  align="center" valign="middle">
       <?php if ($search_box): ?>