Index: misc/vertical-tabs.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/vertical-tabs.js,v
retrieving revision 1.13
diff -u -r1.13 vertical-tabs.js
--- misc/vertical-tabs.js	28 Apr 2010 20:25:21 -0000	1.13
+++ misc/vertical-tabs.js	22 Jul 2010 20:37:51 -0000
@@ -49,7 +49,14 @@
       $('> li:last', tab_list).addClass('last');
 
       if (!tab_focus) {
-        tab_focus = $('> .vertical-tabs-pane:first', this);
+        // If the current URL has a fragment and one of the tabs contains an
+        // element that matches the URL fragment, activate that tab.
+        if (window.location.hash && $(window.location.hash, this).length) {
+          tab_focus = $(window.location.hash, this).closest('.vertical-tabs-pane');
+        }
+        else {
+          tab_focus = $('> .vertical-tabs-pane:first', this);
+        }
       }
       if (tab_focus.length) {
         tab_focus.data('verticalTab').focus();
