Index: modules/overlay/overlay-parent.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v
retrieving revision 1.12
diff -u -r1.12 overlay-parent.js
--- modules/overlay/overlay-parent.js	6 Jan 2010 04:03:39 -0000	1.12
+++ modules/overlay/overlay-parent.js	6 Jan 2010 11:40:25 -0000
@@ -465,7 +465,7 @@
       if (!$target.size()) {
         $target = self.$iframeDocument;
       }
-      setTimeout(function () { $target.focus(); }, 10);
+      $target.focus();
       return false;
     }
   });
@@ -476,16 +476,16 @@
     if (event.keyCode) {
       if (event.keyCode == $.ui.keyCode.TAB) {
         if (event.shiftKey && event.target == $firstTabbable.get(0)) {
-          setTimeout(function () { $closeButton.focus(); }, 10);
+          $closeButton.focus();
           return false;
         }
         else if (!event.shiftKey && event.target == $lastTabbable.get(0)) {
-          setTimeout(function () { $closeButton.focus(); }, 10);
+          $closeButton.focus();
           return false;
         }
       }
       else if (event.keyCode == $.ui.keyCode.ESCAPE) {
-        setTimeout(function () { self.close(); }, 10);
+        self.close();
         return false;
       }
     }
@@ -496,11 +496,9 @@
   // close button of the dialog (default).
   $(document).bind('keydown.overlay-event', function (event) {
     if (event.keyCode && event.keyCode == $.ui.keyCode.TAB) {
-      setTimeout(function () {
-        if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
+      if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
           $closeButton.focus();
-        }
-      }, 10);
+      }
       return false;
     }
   });
Index: modules/overlay/overlay-child.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.js,v
retrieving revision 1.4
diff -u -r1.4 overlay-child.js
--- modules/overlay/overlay-child.js	6 Jan 2010 04:03:39 -0000	1.4
+++ modules/overlay/overlay-child.js	6 Jan 2010 11:40:25 -0000
@@ -31,8 +31,8 @@
     // may have decided to tell us the parent window to close the popup dialog.
     if (settings.closeOverlay) {
       parent.Drupal.overlay.bindChild(window, true);
-      // Close the child window from a separate thread because the current
-      // one is busy processing Drupal behaviors.
+      // Use setTimeout to close the child window from a separate thread,
+      // because the current one is busy processing Drupal behaviors.
       setTimeout(function () {
         // We need to store the parent variable locally because it will
         // disappear as soon as we close the iframe.
