Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.727
diff -u -r1.727 system.module
--- modules/system/system.module	20 Jul 2009 18:51:34 -0000	1.727
+++ modules/system/system.module	25 Jul 2009 07:41:43 -0000
@@ -1345,7 +1345,6 @@
   }
 }
 
-
 /**
  * Implement MODULE_preprocess_HOOK().
  */
@@ -1836,6 +1835,7 @@
         'highlight' => 'Highlighted content',
         'help' => 'Help',
         'page_top' => 'Page top',
+        'page_bottom' => 'Page bottom',
       ),
       'description' => '',
       'features' => array(
@@ -2015,6 +2015,7 @@
   // Remove page-top from the blocks UI since it is reserved for modules to
   // populate from outside the blocks system.
   $info['regions_hidden'][] = 'page_top';
+  $info['regions_hidden'][] = 'page_bottom';
 }
 
 /**
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.50
diff -u -r1.50 system.api.php
--- modules/system/system.api.php	23 Jul 2009 21:20:16 -0000	1.50
+++ modules/system/system.api.php	25 Jul 2009 07:41:42 -0000
@@ -161,26 +161,6 @@
 }
 
 /**
- * Insert closing HTML.
- *
- * This hook enables modules to insert HTML just before the \</body\> closing
- * tag of web pages. This is useful for adding JavaScript code to the footer
- * and for outputting debug information. It is not possible to add JavaScript
- * to the header at this point, and developers wishing to do so should use
- * hook_init() instead.
- *
- * @param $main
- *   Whether the current page is the front page of the site.
- * @return
- *   The HTML to be inserted.
- */
-function hook_footer($main = 0) {
-  if (variable_get('dev_query', 0)) {
-    return '<div style="clear:both;">' . devel_query_table() . '</div>';
-  }
-}
-
-/**
  * Perform necessary alterations to the JavaScript before it is presented on
  * the page.
  *
Index: modules/system/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v
retrieving revision 1.24
diff -u -r1.24 page.tpl.php
--- modules/system/page.tpl.php	4 Jul 2009 05:21:15 -0000	1.24
+++ modules/system/page.tpl.php	25 Jul 2009 07:41:41 -0000
@@ -197,7 +197,7 @@
 
   </div></div> <!-- /#page, /#page-wrapper -->
 
-  <?php print $closure; ?>
+  <?php print $page_bottom; ?>
 
 </body>
 </html>
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.940
diff -u -r1.940 common.inc
--- includes/common.inc	23 Jul 2009 21:20:16 -0000	1.940
+++ includes/common.inc	25 Jul 2009 07:41:40 -0000
@@ -4150,9 +4150,6 @@
     'more_link' => array(
       'arguments' => array('url' => NULL, 'title' => NULL)
     ),
-    'closure' => array(
-      'arguments' => array('main' => 0),
-    ),
     'blocks' => array(
       'arguments' => array('region' => NULL),
     ),
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.499
diff -u -r1.499 theme.inc
--- includes/theme.inc	15 Jul 2009 17:40:17 -0000	1.499
+++ includes/theme.inc	25 Jul 2009 07:41:41 -0000
@@ -1703,20 +1703,6 @@
 }
 
 /**
- * Execute hook_footer() which is run at the end of the page right before the
- * close of the body tag.
- *
- * @param $main (optional)
- *   Whether the current page is the front page of the site.
- * @return
- *   A string containing the results of the hook_footer() calls.
- */
-function theme_closure($main = 0) {
-  $footer = module_invoke_all('footer', $main);
-  return implode("\n", $footer) . drupal_get_js('footer');
-}
-
-/**
  * Format a username.
  *
  * @param $object
@@ -1950,8 +1936,6 @@
   // using an associated GRDDL profile.
   $variables['rdf_namespaces']    = drupal_get_rdf_namespaces();
   $variables['grddl_profile']     = 'http://ns.inria.fr/grddl/rdfa/';
-  // Closure should be filled last.
-  $variables['closure']           = theme('closure');
 
   if ($node = menu_get_object()) {
     $variables['node'] = $node;
@@ -2009,6 +1993,8 @@
   foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) {
     $variables[$region_key] = drupal_render($variables['page'][$region_key]);
   }
+  // Append javascript to $page_bottom
+  $variables['page_bottom'] .= drupal_get_js('footer');
 
   $variables['head']    = drupal_get_html_head();
   $variables['css']     = drupal_add_css();
Index: themes/garland/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v
retrieving revision 1.28
diff -u -r1.28 page.tpl.php
--- themes/garland/page.tpl.php	4 Jul 2009 05:21:15 -0000	1.28
+++ themes/garland/page.tpl.php	25 Jul 2009 07:41:43 -0000
@@ -75,6 +75,6 @@
     </div> <!-- /#container -->
   </div> <!-- /#wrapper -->
 
-  <?php print $closure ?>
+  <?php print $page_bottom; ?>
   </body>
 </html>
