Index: modules/overlay/overlay-child.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.css,v
retrieving revision 1.6
diff -u -p -F '^f' -r1.6 overlay-child.css
--- modules/overlay/overlay-child.css	28 Jul 2010 01:26:00 -0000	1.6
+++ modules/overlay/overlay-child.css	31 Oct 2010 07:02:20 -0000
@@ -7,6 +7,8 @@ html.js {
 html.js body {
   background: transparent !important;
   padding: 20px 0;
+  margin-left: 0;
+  margin-right: 0;
 }
 
 #overlay {
@@ -138,3 +140,35 @@ html.js body {
 * html #overlay-close:hover {
   position: absolute;
 }
+
+/**
+ * Disable message.
+ *
+ * Hide the message about disabling the overlay from all users when JavaScript
+ * is disabled. Without JavaScript, the overlay won't open, so there is nothing
+ * to disable.
+ */
+#overlay-disable-message {
+  display: none;
+  margin: -20px auto 20px;
+  width: 80%;
+}
+html.js #overlay-disable-message {
+  display: block;
+}
+.overlay-message-column {
+  display: inline;
+  float: left;
+  position: relative;
+}
+.overlay-profile-link-wrapper {
+  width: 80%;
+}
+.overlay-dismiss-message-wrapper {
+  width: 20%;
+}
+.overlay-disable-message-focused a {
+  padding: 1.2em 1em 1em 1em;
+  display: block;
+  height: 100%;
+}
Index: modules/overlay/overlay-child.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.js,v
retrieving revision 1.10
diff -u -p -F '^f' -r1.10 overlay-child.js
--- modules/overlay/overlay-child.js	8 Jul 2010 12:20:23 -0000	1.10
+++ modules/overlay/overlay-child.js	31 Oct 2010 07:02:20 -0000
@@ -57,6 +57,19 @@ Drupal.behaviors.overlayChild = {
 
     // Attach child related behaviors to the iframe document.
     Drupal.overlayChild.attachBehaviors(context, settings);
+    
+    // There are two links within the message that informs people about the
+    // overlay and how to disable it. Make sure both links are visible when
+    // either one has focus and add a class to the wrapper for styling purposes.
+    $('#overlay-disable-message', context)
+      .focusin(function () {
+        $(this).addClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).removeClass('element-invisible');
+      })
+      .focusout(function () {
+        $(this).removeClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).addClass('element-invisible');
+      });
   }
 };
 
Index: modules/overlay/overlay-parent.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.css,v
retrieving revision 1.15
diff -u -p -F '^f' -r1.15 overlay-parent.css
--- modules/overlay/overlay-parent.css	8 Jun 2010 05:16:29 -0000	1.15
+++ modules/overlay/overlay-parent.css	31 Oct 2010 07:02:20 -0000
@@ -46,3 +46,33 @@ html.overlay-open .displace-bottom {
 {
   position: absolute;
 }
+
+/**
+ * Disable message.
+ *
+ * Hide the message about disabling the overlay from all users when JavaScript
+ * is disabled. Without JavaScript, the overlay won't open, so there is nothing
+ * to disable.
+ */
+#overlay-disable-message {
+  display: none;
+}
+html.js #overlay-disable-message {
+  display: block;
+}
+.overlay-message-column {
+  display: inline;
+  float: left;
+  position: relative;
+}
+.overlay-profile-link-wrapper {
+  width: 80%;
+}
+.overlay-dismiss-message-wrapper {
+  width: 20%;
+}
+.overlay-disable-message-focused a {
+  padding: 1.2em 1em 1em 1em;
+  display: block;
+  height: 100%;
+}
Index: modules/overlay/overlay-parent.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v
retrieving revision 1.56
diff -u -p -F '^f' -r1.56 overlay-parent.js
--- modules/overlay/overlay-parent.js	30 Oct 2010 03:44:37 -0000	1.56
+++ modules/overlay/overlay-parent.js	31 Oct 2010 07:02:20 -0000
@@ -29,6 +29,19 @@ Drupal.behaviors.overlayParent = {
       // scripts to bind their own handlers to links and also to prevent
       // overlay's handling.
       .bind('click.drupal-overlay mouseup.drupal-overlay', $.proxy(Drupal.overlay, 'eventhandlerOverrideLink'));
+
+    // There are two links within the message that informs people about the
+    // overlay and how to disable it. Make sure both links are visible when
+    // either one has focus and add a class to the wrapper for styling purposes.
+    $('#overlay-disable-message', context)
+      .focusin(function () {
+        $(this).addClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).removeClass('element-invisible');
+      })
+      .focusout(function () {
+        $(this).removeClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).addClass('element-invisible');
+      });
   }
 };
 
Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.31
diff -u -p -F '^f' -r1.31 overlay.module
--- modules/overlay/overlay.module	31 Aug 2010 15:04:09 -0000	1.31
+++ modules/overlay/overlay.module	31 Oct 2010 07:02:20 -0000
@@ -30,10 +30,29 @@ function overlay_menu() {
     'access arguments' => array('access overlay'),
     'type' => MENU_CALLBACK,
   );
+  $items['overlay/dismiss-message'] = array(
+    'title' => '',
+    'page callback' => 'overlay_user_dismiss_message',
+    'access arguments' => array('access overlay'),
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
 /**
+ * Implements hook_admin_paths().
+ */
+function overlay_admin_paths() {
+  $paths = array(
+    // This is marked as an administrative path so that if it is visited from
+    // within the overlay, the user will stay within the overlay while the
+    // callback is being processed.
+    'overlay/dismiss-message' => TRUE,
+  );
+  return $paths;
+}
+
+/**
  * Implements hook_permission().
  */
 function overlay_permission() {
@@ -254,10 +273,109 @@ function overlay_page_alter(&$page) {
     }
   }
 
-  if (overlay_get_mode() == 'child') {
+  $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())) {
+    $page['page_top']['disable_overlay'] = $message;
+  }
+}
+
+/**
+ * Menu callback; dismisses the overlay accessibility message for this user.
+ */
+function overlay_user_dismiss_message() {
+  global $user;
+  // It's unlikely, but possible that "access overlay" permission is granted to
+  // the anonymous role. In this case, we do not display the message to disable
+  // the overlay, so there is nothing to dismiss. Also, protect against
+  // cross-site request forgeries by validating a token.
+  if (empty($user->uid) || !isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'overlay')) {
+    return MENU_ACCESS_DENIED;
+  }
+  else {
+    user_save(user_load($user->uid), array('data' => array('overlay_message_dismissed' => 1)));
+    drupal_set_message(t('The message has been dismissed. You can change your overlay settings at any time by visiting your profile page.'));
+    // Destination is normally given. Go to the user profile as a fallback.
+    drupal_goto('user/' . $user->uid . '/edit');
+  }
+}
+
+/**
+ * Returns a renderable array representing a message for disabling the overlay.
+ *
+ * If the current user can access the overlay and has not previously indicated
+ * that this message should be dismissed, this function returns a message
+ * containing a link to disable the overlay. Nothing is returned for anonymous
+ * users, because the links control per-user settings. Therefore, because some
+ * screen readers are unable to properly read overlay contents, site builders
+ * are discouraged from granting the "access overlay" permission to the
+ * anonymous role. See http://drupal.org/node/896364.
+ */
+function _overlay_disable_message() {
+  global $user;
+
+  if (!empty($user->uid) && empty($user->data['overlay_message_dismissed']) && (!isset($user->data['overlay']) || $user->data['overlay']) && user_access('access overlay')) {
+    $build = array(
+      // Wrap the two links in a container and add a heading for screen reader
+      // users.
+      '#prefix' => '<div id="overlay-disable-message" class="clearfix"><h3 class="element-invisible">' . t('Options for the administrative overlay') . '</h3>',
+      '#suffix' => '</div>',
+      '#weight' => -99,
+      // Link to the user's profile page, where the overlay can be disabled.
+      'profile_link' => array(
+        '#type' => 'link',
+        '#prefix' => '<div class="overlay-message-column overlay-profile-link-wrapper">',
+        '#suffix' => '</div>',
+        '#title' => t('If you have problems accessing administrative pages on this site, disable the overlay on your profile page.'),
+        '#href' => 'user/' . $user->uid . '/edit',
+        '#options' => array(
+          'query' => drupal_get_destination(),
+          'fragment' => 'edit-overlay-control',
+          'attributes' => array(
+            'id' => 'overlay-profile-link',
+            // Prevent the target page from being opened in the overlay, and make
+            // this link visible to screen reader users and keyboard users only.
+            'class' => array('overlay-exclude', 'element-invisible', 'element-focusable'),
+          ),
+        ),
+      ),
+      // Link to a menu callback that allows this message to be permanently
+      // dismissed for the current user.
+      'dismiss_message_link' => array(
+        '#type' => 'link',
+        '#prefix' => '<div class="overlay-message-column overlay-dismiss-message-wrapper">',
+        '#suffix' => '</div>',
+        '#title' => t('Dismiss this message.'),
+        '#href' => 'overlay/dismiss-message',
+        '#options' => array(
+          'query' => drupal_get_destination() + array(
+            // Add a token to protect against cross-site request forgeries.
+            'token' => drupal_get_token('overlay'),
+          ),
+          'attributes' => array(
+            'id' => 'overlay-dismiss-message',
+            // Make this link visible to screen reader users and keyboard users
+            // only.
+            'class' => array('element-invisible', 'element-focusable'),
+          ),
+        ),
+      )
+    );
+
+    // If this message is being displayed outside the overlay, prevent the
+    // "dismiss" link from opening inside the overlay.
+    if (!path_is_admin(current_path())) {
+      $build['dismiss_message_link']['#options']['attributes']['class'][] = 'overlay-exclude';
+    }
+  }
+  else {
+    $build = array();
+  }
+
+  return $build;
 }
 
 /**
@@ -324,9 +442,9 @@ function overlay_preprocess_maintenance_
  * @see overlay.tpl.php
  */
 function template_preprocess_overlay(&$variables) {
-  $variables['tabs']              = menu_primary_local_tasks();
-  $variables['title']             = drupal_get_title();
-
+  $variables['tabs'] = menu_primary_local_tasks();
+  $variables['title'] = drupal_get_title();
+  $variables['disable_overlay'] = _overlay_disable_message();
   $variables['content_attributes_array']['class'][] = 'clearfix';
 }
 
Index: modules/overlay/overlay.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.tpl.php,v
retrieving revision 1.4
diff -u -p -F '^f' -r1.4 overlay.tpl.php
--- modules/overlay/overlay.tpl.php	16 Sep 2010 19:47:45 -0000	1.4
+++ modules/overlay/overlay.tpl.php	31 Oct 2010 07:02:20 -0000
@@ -21,6 +21,7 @@
  */
 ?>
 
+<?php print render($disable_overlay); ?>
 <div id="overlay" <?php print $attributes; ?>>
   <div id="overlay-titlebar" class="clearfix">
     <div id="overlay-title-wrapper" class="clearfix">
Index: modules/system/system.theme.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.theme.css,v
retrieving revision 1.3
diff -u -p -F '^f' -r1.3 system.theme.css
--- modules/system/system.theme.css	27 Sep 2010 01:12:45 -0000	1.3
+++ modules/system/system.theme.css	31 Oct 2010 07:02:22 -0000
@@ -159,6 +159,39 @@ input.form-radio {
 }
 
 /**
+ * Disable overlay message.
+ */
+#overlay-disable-message a {
+  color: #000;
+}
+.overlay-profile-link-wrapper a {
+  background-color: #a2cceb;
+}
+#overlay-disable-message,
+.overlay-dismiss-message-wrapper a {
+  background-color: #59A0D8;
+}
+/* Inside the overlay */
+.overlay #overlay-disable-message {
+  -moz-border-radius: 0 0 4px 4px;
+  -webkit-border-top-left-radius: 0;
+  -webkit-border-top-right-radius: 0;
+  -webkit-border-bottom-left-radius: 4px;
+  -webkit-border-bottom-right-radius: 4px;
+  border-radius: 0 0 4px 4px;
+}
+.overlay .overlay-profile-link-wrapper a {
+  -moz-border-radius-bottomleft: 4px;
+  -webkit-border-bottom-left-radius: 4px;
+  border-radius-bottomleft: 4px;
+}
+.overlay .overlay-dismiss-message-wrapper a {
+  -moz-border-radius-bottomright: 4px;
+  -webkit-border-bottom-right-radius: 4px;
+  border-radius-bottomright: 4px;
+}
+
+/**
  * Autocomplete.
  *
  * @see autocomplete.js
