Index: ahah_helper/ahah_helper.module
===================================================================
--- ahah_helper/ahah_helper.module	(revision 2569)
+++ ahah_helper/ahah_helper.module	(working copy)
@@ -193,12 +193,20 @@
   // Get the JS settings so we can merge them.
   $javascript = drupal_add_js(NULL, NULL, 'header');
   $settings = call_user_func_array('array_merge_recursive', $javascript['setting']);
-
+  
+  // create settings array to be passed out via JSON
+  $ahah_settings = array('ahah' => $settings['ahah']);
+  // need to take into account date_popup settings as well if there are any 
+  // date form fields.
+  if (!empty($settings['datePopup'])) {
+  	$ahah_settings['datePopup'] = $settings['datePopup'];
+  } 
+  
   drupal_json(array(
     'status'   => TRUE,
     'data'     => theme('status_messages') . drupal_render($form_item),
-    'settings' => array('ahah' => $settings['ahah']),
-  ));
+    'settings' => $ahah_settings,
+  ));  
 }
 
 
