Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.21
diff -u -r1.21 overlay.module
--- modules/overlay/overlay.module	11 Jun 2010 12:30:30 -0000	1.21
+++ modules/overlay/overlay.module	11 Jun 2010 15:56:35 -0000
@@ -66,9 +66,6 @@
  * @see overlay_set_mode()
  */
 function overlay_init() {
-  // @todo: custom_theme does not exist anymore.
-  global $custom_theme;
-
   $mode = overlay_get_mode();
 
   // Only act if the user has access to the overlay and a mode was not already
@@ -87,13 +84,7 @@
       if (!path_is_admin($current_path)) {
         overlay_close_dialog($current_path);
       }
-      // If system module did not switch the theme yet (i.e. this is not an
-      // admin page, per se), we should switch the theme here.
-      $admin_theme = variable_get('admin_theme', 0);
-      if ($custom_theme != $admin_theme) {
-        $custom_theme = $admin_theme;
-        drupal_add_css(drupal_get_path('module', 'system') . '/admin.css');
-      }
+
       // Indicate that we are viewing an overlay child page.
       overlay_set_mode('child');
 
Index: modules/overlay/overlay.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.api.php,v
retrieving revision 1.1
diff -u -r1.1 overlay.api.php
--- modules/overlay/overlay.api.php	2 Dec 2009 07:28:22 -0000	1.1
+++ modules/overlay/overlay.api.php	11 Jun 2010 15:56:35 -0000
@@ -32,13 +32,8 @@
  * within the confines of the overlay.
  */
 function hook_overlay_child_initialize() {
-  // Use a different theme for content administration pages.
-  if (arg(0) == 'admin' && arg(1) == 'content') {
-    if ($theme = variable_get('content_administration_pages_theme', FALSE)) {
-      global $custom_theme;
-      $custom_theme = $theme;
-    }
-  }
+  // Add our custom JavaScript.
+  drupal_add_js(drupal_get_path('module', 'hook') . '/hook-overlay-child.js');
 }
 
 /**
