Index: misc/tableheader.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tableheader.js,v
retrieving revision 1.29
diff -u -r1.29 tableheader.js
--- misc/tableheader.js	18 Dec 2009 08:17:26 -0000	1.29
+++ misc/tableheader.js	6 Apr 2010 12:45:58 -0000
@@ -73,8 +73,8 @@
       // Check the previous anchor to see if we need to scroll to make room for the header.
       // Get the height of the header table and scroll up that amount.
       if (prevAnchor != location.hash) {
-        if (location.hash != '') {
-          var scrollLocation = $('td' + location.hash).offset().top - $(e).height();
+        if (location.hash != '' && $('td' + location.hash, e.table).length) {
+          var scrollLocation = $('td' + location.hash, e.table).offset().top - $(e).height();
           $('body, html').scrollTop(scrollLocation);
         }
         prevAnchor = location.hash;
Index: modules/toolbar/toolbar.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.js,v
retrieving revision 1.16
diff -u -r1.16 toolbar.js
--- modules/toolbar/toolbar.js	4 Apr 2010 20:27:08 -0000	1.16
+++ modules/toolbar/toolbar.js	6 Apr 2010 12:45:58 -0000
@@ -20,6 +20,14 @@
       $(window).triggerHandler('resize.overlay-event');
       return false;
     });
+
+    $(window)
+      // Ensure the toolbar doesn't hide content when named anchor is clicked.
+      .bind('hashchange.drupal-toolbar', Drupal.toolbar.hashchange)
+      // Trigger the hashchange handler once, after the page is loaded, to
+      // handle hash in original page request.
+      .triggerHandler('hashchange.drupal-toolbar');
+
   }
 };
 
@@ -95,6 +103,20 @@
   }
 };
 
+/**
+ * Adjust scrolltop so toolbar doesn't hide content when URL includes hash.
+ */
+Drupal.toolbar.hashchange = function (event) {
+  if (window.location.hash != '') {
+    $anchor = $(window.location.hash);
+    if ($anchor.length) {
+      var scrollLocation = $anchor.offset().top - Drupal.toolbar.height();
+      $(window).scrollTop(scrollLocation);
+    }
+  }
+};
+
+
 Drupal.toolbar.height = function() {
   var height = $('#toolbar').outerHeight();
   // In IE, Shadow filter adds some extra height, so we need to remove it from
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.36
diff -u -r1.36 toolbar.module
--- modules/toolbar/toolbar.module	4 Apr 2010 17:11:20 -0000	1.36
+++ modules/toolbar/toolbar.module	6 Apr 2010 12:45:58 -0000
@@ -176,6 +176,7 @@
       'js' => array(
         $module_path . '/toolbar.js',
         array('data' => 'misc/jquery.cookie.js', 'weight' => JS_LIBRARY + 2),
+        array('data' => 'misc/jquery.ba-bbq.js', 'weight' => JS_LIBRARY + 2),
         array(
           'data' => array('tableHeaderOffset' => 'Drupal.toolbar.height'),
           'type' => 'setting'
