Index: modules/overlay/overlay-child.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.js,v
retrieving revision 1.11
diff -u -r1.11 overlay-child.js
--- modules/overlay/overlay-child.js	6 Nov 2010 00:18:24 -0000	1.11
+++ modules/overlay/overlay-child.js	16 Dec 2010 13:48:09 -0000
@@ -133,6 +133,8 @@
   var dots = '';
 
   $(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () {
+    $(document.documentElement).addClass('overlay-loading');
+    
     $title = $('#overlay-title').text(text);
     var id = setInterval(function () {
       dots = (dots.length > 10) ? '' : dots + '.';
@@ -155,23 +157,6 @@
 };
 
 /**
- * If the shortcut add/delete button exists, move it to the overlay titlebar.
- */
-Drupal.overlayChild.behaviors.shortcutAddLink = function (context, settings) {
-  // Remove any existing shortcut button markup from the titlebar.
-  $('#overlay-titlebar').find('.add-or-remove-shortcuts').remove();
-  // If the shortcut add/delete button exists, move it to the titlebar.
-  var $addToShortcuts = $('.add-or-remove-shortcuts');
-  if ($addToShortcuts.length) {
-    $addToShortcuts.insertAfter('#overlay-title');
-  }
-
-  $(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () {
-    $('#overlay-titlebar').find('.add-or-remove-shortcuts').remove();
-  });
-};
-
-/**
  * Use displacement from parent window.
  */
 Drupal.overlayChild.behaviors.alterTableHeaderOffset = function (context, settings) {
Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.34
diff -u -r1.34 overlay.module
--- modules/overlay/overlay.module	30 Nov 2010 17:16:37 -0000	1.34
+++ modules/overlay/overlay.module	16 Dec 2010 13:48:09 -0000
@@ -277,11 +277,7 @@
   }
 
   $mode = overlay_get_mode();
-  if ($mode == 'child') {
-    // Add the overlay wrapper before the html wrapper.
-    array_unshift($page['#theme_wrappers'], 'overlay');
-  }
-  elseif ($mode == 'parent' && ($message = overlay_disable_message())) {
+  if ($mode == 'parent' && ($message = overlay_disable_message())) {
     $page['page_top']['disable_overlay'] = $message;
   }
 }
@@ -458,29 +454,6 @@
 }
 
 /**
- * Preprocesses template variables for overlay.tpl.php
- *
- * @see overlay.tpl.php
- */
-function template_preprocess_overlay(&$variables) {
-  $variables['tabs'] = menu_primary_local_tasks();
-  $variables['title'] = drupal_get_title();
-  $variables['disable_overlay'] = overlay_disable_message();
-  $variables['content_attributes_array']['class'][] = 'clearfix';
-}
-
-/**
- * Processes variables for overlay.tpl.php
- *
- * @see template_preprocess_overlay()
- * @see overlay.tpl.php
- */
-function template_process_overlay(&$variables) {
-  // Place the rendered HTML for the page body into a top level variable.
-  $variables['page'] = $variables['page']['#children'];
-}
-
-/**
  * Implements hook_preprocess_page().
  *
  * Hide tabs inside the overlay.
@@ -489,7 +462,19 @@
  */
 function overlay_preprocess_page(&$variables) {
   if (overlay_get_mode() == 'child') {
-    unset($variables['tabs']['#primary']);
+    $variables += array(
+      'overlay_disable_message' => overlay_disable_message(),
+      'overlay_title'           => drupal_get_title(),
+      'overlay_tabs'            => menu_primary_local_tasks(),
+      'overlay_secondary_tabs'  => menu_secondary_local_tasks(),
+    );
+
+    // Make sure we use overlay.tpl.php instead of page.tpl.php.
+    foreach ($variables['theme_hook_suggestions'] as &$suggestion) {
+      $suggestion = 'overlay__' . $suggestion;
+    }
+    array_unshift($variables['theme_hook_suggestions'], 'overlay');
+
   }
 }
 
Index: modules/overlay/overlay-child.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.css,v
retrieving revision 1.7
diff -u -r1.7 overlay-child.css
--- modules/overlay/overlay-child.css	6 Nov 2010 00:18:24 -0000	1.7
+++ modules/overlay/overlay-child.css	16 Dec 2010 13:48:09 -0000
@@ -31,7 +31,7 @@
   background: #fff;
   clear: both;
   color: #000;
-  padding: .5em 1em;
+  padding: 26px 2.5em;
   position: relative;
 }
 
@@ -125,12 +125,27 @@
   color: #000;
 }
 
+#overlay-breadcrumb {
+
+}
+#overlay-secondary-tabs {
+  position: absolute;
+  top: 26px;
+  right: 2.5em;
+}
+#overlay-action-links {
+  clear: both;
+}
+
 /**
  * Add to shortcuts link
  */
 #overlay-titlebar .add-or-remove-shortcuts {
   padding-top: 0.9em;
 }
+.overlay-loading #overlay-titlebar .add-or-remove-shortcuts {
+  display: none;
+}
 
 /**
  * IE6 shows elements with position:fixed as position:static so replace
Index: modules/overlay/overlay.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.tpl.php,v
retrieving revision 1.5
diff -u -r1.5 overlay.tpl.php
--- modules/overlay/overlay.tpl.php	6 Nov 2010 00:18:24 -0000	1.5
+++ modules/overlay/overlay.tpl.php	16 Dec 2010 13:48:09 -0000
@@ -5,34 +5,46 @@
  * @file
  * Default theme implementation to display a page in the overlay.
  *
- * Available variables:
- * - $title: the (sanitized) title of the page.
- * - $page: The rendered page content.
- * - $tabs (array): Tabs linking to any sub-pages beneath the current page
- *   (e.g., the view and edit tabs when displaying a node).
- *
- * Helper variables:
- * - $classes_array: Array of html class attribute values. It is flattened
- *   into a string within the variable $classes.
+ * Overlay variables:
+ * - $overlay_disable_message:
+ * - $overlay_title: the (sanitized) title of the page.
+ * - $overlay_tabs (array): Tabs linking to any sub-pages beneath the current
+ *   page (e.g., the view and edit tabs when displaying a node).
  *
  * @see template_preprocess()
- * @see template_preprocess_overlay()
+ * @see template_preprocess_page()
+ * @see overlay_preprocess_page()
  * @see template_process()
+ * @see system/page.tpl.php
  */
 ?>
 
-<?php print render($disable_overlay); ?>
+<?php print render($overlay_disable_message); ?>
 <div id="overlay" <?php print $attributes; ?>>
   <div id="overlay-titlebar" class="clearfix">
     <div id="overlay-title-wrapper" class="clearfix">
-      <h1 id="overlay-title"<?php print $title_attributes; ?>><?php print $title; ?></h1>
+      <a id="main-content"></a>
+      <?php print render($title_prefix); ?>
+      <h1 id="overlay-title"<?php print $title_attributes; ?>><?php print $overlay_title; ?></h1>
+        <?php print render($title_suffix); ?>
     </div>
     <div id="overlay-close-wrapper">
       <a id="overlay-close" href="#" class="overlay-close"><span class="element-invisible"><?php print t('Close overlay'); ?></span></a>
     </div>
-    <?php if ($tabs): ?><h2 class="element-invisible"><?php print t('Primary tabs'); ?></h2><ul id="overlay-tabs"><?php print render($tabs); ?></ul><?php endif; ?>
+    <?php if ($overlay_tabs): ?><h2 class="element-invisible"><?php print t('Primary tabs'); ?></h2><ul id="overlay-tabs"><?php print render($overlay_tabs); ?></ul><?php endif; ?>
   </div>
-  <div id="overlay-content"<?php print $content_attributes; ?>>
-    <?php print $page; ?>
+  <div id="overlay-content" class="clearfix">
+    <?php if ($breadcrumb): ?>
+      <div id="overlay-breadcrumb"><?php print $breadcrumb; ?></div>
+    <?php endif; ?>
+
+    <?php if ($overlay_secondary_tabs): ?><h2 class="element-invisible"><?php print t('Secondary tabs'); ?></h2><ul id="overlay-secondary-tabs" class="tabs secondary"><?php print render($overlay_secondary_tabs); ?></ul><?php endif; ?>
+
+    <?php print $messages; ?>
+
+    <?php print render($page['help']); ?>
+    <?php if ($action_links): ?><ul id="overlay-action-links" class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
+    <?php print render($page['content']); ?>
+    <?php print $feed_icons; ?>
   </div>
 </div>
Index: themes/bartik/css/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/bartik/css/style.css,v
retrieving revision 1.49
diff -u -r1.49 style.css
--- themes/bartik/css/style.css	14 Dec 2010 19:53:14 -0000	1.49
+++ themes/bartik/css/style.css	16 Dec 2010 13:48:10 -0000
@@ -1517,32 +1517,15 @@
 
 /* ---------- Overlay layout styles ----------- */
 
-.overlay #main,
-.overlay #content {
-  width: auto;
-  float: none;
-}
-.overlay #page {
-  padding: 0 2em;
-}
-.overlay #skip-link,
-.overlay .region-page-top,
-.overlay #header,
-.overlay #page-title,
-.overlay #featured,
-.overlay #sidebar-first,
-.overlay #triptych-wrapper,
-.overlay #footer-wrapper {
-  display: none;
-}
-.overlay-processed .field-type-image {
-  display: block;
-  float: none;
-}
 .overlay #messages {
   width: auto;
 }
 
+#overlay-secondary-tabs {
+  border: 0;
+  margin: 0;
+}
+
 /* ---------- Poll ----------- */
 
 .node .poll {
Index: themes/seven/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/style.css,v
retrieving revision 1.84
diff -u -r1.84 style.css
--- themes/seven/style.css	23 Nov 2010 01:58:21 -0000	1.84
+++ themes/seven/style.css	16 Dec 2010 13:48:10 -0000
@@ -872,24 +872,6 @@
 }
 
 /* Overlay theming */
-.overlay #branding {
-  background-color: #fff;
-  padding-top: 15px;
-}
-.overlay #branding h1.page-title,
-.overlay #left,
-.overlay #footer {
-  display: none;
-}
-.overlay #page {
-  margin: 0;
-  padding: 0 20px;
-}
-.overlay #branding div.breadcrumb {
-  float: left;
-  position: relative;
-  z-index: 10;
-}
 #overlay-tabs {
   bottom: -1px;
   font-size: 1.54em;
@@ -899,12 +881,12 @@
 #overlay-tabs li {
   margin: 0 -2px;
 }
-.overlay ul.secondary {
-  background: transparent none;
-  margin: -2.4em 0 0.3em 0;
+#overlay-breadcrumb {
+  font-size: 0.846em;
+  padding-bottom: 5px;
 }
-.overlay #content {
-  padding: 0;
+#overlay-secondary-tabs {
+  background: transparent none;
 }
 h1#overlay-title {
   font-weight: normal;
Index: themes/garland/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/style.css,v
retrieving revision 1.87
diff -u -r1.87 style.css
--- themes/garland/style.css	30 Oct 2010 03:52:14 -0000	1.87
+++ themes/garland/style.css	16 Dec 2010 13:48:10 -0000
@@ -629,12 +629,12 @@
   background: url("images/body.png") repeat-x scroll 50% -58px #edf5fa;
   color: #fff;
 }
+#overlay-secondary-tabs {
+  position: static;
+}
 #overlay-content {
   padding: 1px;
 }
-#overlay-content #header {
-  display: none;
-}
 #overlay-content #wrapper {
   background-position: 50% -80px;
 }
Index: themes/garland/overlay.tpl.php
===================================================================
RCS file: themes/garland/overlay.tpl.php
diff -N themes/garland/overlay.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ themes/garland/overlay.tpl.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,54 @@
+<?php
+// $Id: overlay.tpl.php,v 1.4 2010/09/16 19:47:45 dries Exp $
+
+/**
+ * @file
+ * Default theme implementation to display a page in the overlay.
+ *
+ * Overlay variables:
+ * - $overlay_title: the (sanitized) title of the page.
+ * - $overlay_tabs (array): Tabs linking to any sub-pages beneath the current
+ *   page (e.g., the view and edit tabs when displaying a node).
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_page()
+ * @see overlay_preprocess_page()
+ * @see template_process()
+ * @see system/page.tpl.php
+ */
+?>
+
+<div id="overlay" <?php print $attributes; ?>>
+  <div id="overlay-titlebar" class="clearfix">
+    <div id="overlay-title-wrapper" class="clearfix">
+      <a id="main-content"></a>
+      <?php print render($title_prefix); ?>
+      <h1 id="overlay-title"><?php print $overlay_title; ?></h1>
+      <?php print render($title_suffix); ?>
+    </div>
+    <div id="overlay-close-wrapper">
+      <a id="overlay-close" href="#" class="overlay-close"><span class="element-invisible"><?php print t('Close overlay'); ?></span></a>
+    </div>
+    <?php if ($overlay_tabs): ?><ul id="overlay-tabs"><?php print render($overlay_tabs); ?></ul><?php endif; ?>
+  </div>
+  <div id="overlay-content" class="clearfix">
+    <div id="wrapper">
+      <div id="container" class="clearfix">
+        <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
+          <?php if ($breadcrumb): ?>
+            <div id="overlay-breadcrumb"><?php print $breadcrumb; ?></div>
+          <?php endif; ?>
+
+          <?php if ($overlay_secondary_tabs): ?><ul id="overlay-secondary-tabs" class="tabs secondary"><?php print render($overlay_secondary_tabs); ?></ul><?php endif; ?>
+
+          <?php print $messages; ?>
+
+          <?php print render($page['help']); ?>
+          <?php if ($action_links): ?><ul id="overlay-action-links" class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
+          <?php print render($page['content']); ?>
+          <?php print $feed_icons; ?>
+        </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->
+      </div> <!-- /#container -->
+    </div> <!-- /#wrapper -->
+  </div>
+</div>
