diff --git a/includes/ajax.inc b/includes/ajax.inc
index 05416af..c5ee8af 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -3,6 +3,9 @@
 // Set this so we can tell that the file has been included at some point.
 define('CTOOLS_AJAX_INCLUDED', 1);
 
+// Default value for running the ctools_ajax_page_preprocess() function.
+define('CTOOLS_AJAX_PAGE_PREPROCESS', 1);
+
 /**
  * @file
  * Utilize the CTools AJAX responder.
@@ -588,6 +591,11 @@ function ctools_ajax_associate_url_to_element(&$form, &$form_element, $dest, $ty
 }
 
 function ctools_ajax_page_preprocess(&$variables) {
+  // See if we will be running this hook.
+  if (!variable_get('ctools_ajax_page_preprocess', CTOOLS_AJAX_PAGE_PREPROCESS)) {
+    return;
+  }
+
   $js_files = $css_files = array();
   ctools_process_js_files($js_files, 'header');
   ctools_process_js_files($js_files, 'footer');
