Index: event_all_day.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/contrib/event_all_day/event_all_day.js,v
retrieving revision 1.1
diff -u -p -r1.1 event_all_day.js
--- event_all_day.js	12 Feb 2006 19:05:52 -0000	1.1
+++ event_all_day.js	1 May 2006 17:18:57 -0000
@@ -1,40 +1,33 @@
 if (isJsEnabled()) {
   addLoadEvent(eventAllDayAutoAttach);
+  var eventalldaydata;
 }
 
 function eventAllDayAutoAttach() {
-  eventAllDayDetermine();
-  document.getElementById("edit-start_minute_all_day").onclick = function() {
-    if (document.getElementById("edit-start_minute_all_day").checked) {
+  $('edit-start_minute_all_day').onclick = function() {
+    if ($('edit-start_minute_all_day').checked) {
       EventAllDayYes();
     }
     else {
       EventAllDayNo();
     }
-    
-  }
-}
-
-function eventAllDayDetermine() {
-  if (  
-    document.getElementById("edit-end_hour").value==23 &&
-    document.getElementById("edit-end_minute").value==59 &&
-    document.getElementById("edit-start_hour").value==0  &&
-    document.getElementById("edit-start_minute").value==0) {
-      EventAllDayYes();
-      document.getElementById("edit-start_minute_all_day").checked = true;
   }
+  eventalldaydata = $('event_all_day_data').value.split('|');
 }
 
 function EventAllDayYes() {
-  document.getElementById("edit-end_hour").value=23;
-  document.getElementById("edit-end_minute").value=59
-  document.getElementById("edit-start_hour").value=0;
-  document.getElementById("edit-start_minute").value=0;
+  $('edit-end_hour').value=eventalldaydata[1];
+  $('edit-end_minute').value=59
+  $('edit-start_hour').value=eventalldaydata[0];
+  $('edit-start_minute').value=0;
+  if (eventalldaydata[2] == '12h') {
+    document.getElementsByName('edit[end_ampm]')[1].checked = true;
+    document.getElementsByName('edit[start_ampm]')[0].checked = true;
+  }
   var divs = document.getElementsByTagName('div');
   for (var i = 0; div = divs[i]; i++) {
     if (div && hasClass(div, 'time')) {
-      div.setAttribute('style', 'display: none;');
+      div.style.display = 'none';
     }
   }
 }
@@ -43,7 +36,7 @@ function EventAllDayNo() {
   var divs = document.getElementsByTagName('div');
   for (var i = 0; div = divs[i]; i++) {
     if (div && hasClass(div, 'time')) {
-      div.removeAttribute('style');
+      div.style.display = null;
     }
   }
 }
Index: event_all_day.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/contrib/event_all_day/event_all_day.module,v
retrieving revision 1.2
diff -u -p -r1.2 event_all_day.module
--- event_all_day.module	27 Apr 2006 04:36:21 -0000	1.2
+++ event_all_day.module	1 May 2006 17:18:57 -0000
@@ -13,16 +13,45 @@ function event_all_day_help($section) {
 function event_all_day_form_alter($form_id, &$form) {
   $type = (isset($form['type']) && isset($form['type']['#value'])) ? $form['type']['#value'] : NULL;
   if ($form_id == $type .'_node_form' && variable_get('event_nodeapi_'. $type, 'never') != 'never') {
+    
+    if (variable_get('event_ampm', '0')) {
+      $hours = array('low' => 0, 'high' => 11);
+      $am_pms = array('am' => t('am'), 'pm' => t('pm'));
+    }
+    else {
+      $hours = array('low' => 0, 'high' => 23);
+    }
+    
+    if ($edit['end_hour'] == $hours['high'] &&
+        $edit['end_minute'] == 59 &&
+        $edit['start_hour'] == $hours['low'] &&
+        $edit['start_minute'] == 0 &&
+        ((isset($am_pms) &&
+        $edit['end_ampm'] == $am_pms['pm'] &&
+        $edit['start_ampm'] == $am_pms['am'])
+        || !isset($am_pms))) {
+      $allday = true;
+      $form['event_end']['date']['end_hour']['#prefix'] = '</div><div class="time" style="display: none;">';
+      $form['event_start']['date']['start_hour']['#prefix'] = '</div><div class="time" style="display: none;">';
+    }
+    else {
+      $allday = false;
+    }
+    
+    $data = $hours['low'] . '|' . $hours['high'] . (isset($am_pms) ? '|12h' : '|24h');
+    
+    $form['event_all_day_data'] = array('#type' => 'hidden', '#value' => $data, '#id' => 'event_all_day_data');
+    
     // add all day checkbox
     $form['start_minute_all_day'] = array(
       '#type' => 'checkbox',
       '#title' => t('All day'),
       '#default_value' => 0,
-      '#weight' => -14,
+      '#weight' => -13,
+      '#value' => $allday,
     );
     
     $path = drupal_get_path('module', 'event_all_day');
     drupal_add_js($path . '/event_all_day.js');
-    // theme_add_style($path . '/event_all_day.css');
   }
-}
+}
\ No newline at end of file
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/event/contrib/event_all_day/README.txt,v
retrieving revision 1.1
diff -u -p -r1.1 README.txt
--- README.txt	12 Feb 2006 19:05:52 -0000	1.1
+++ README.txt	1 May 2006 17:18:57 -0000
@@ -2,11 +2,9 @@ Description
 -----------------
 Adds an 'all day' checkbox to the event form. When checked, the time fields are hidden and set to midnight.
 
-TODO
------------------
-When showing the edit form, javascript decides to hide the fields if both are at midnight. This could be done in php which would
-save a minor flicker after page renders.
+This version supports 12 hour time notation and initially hides the elements via PHP, avoiding any flicker.
 
-Author
+Authors
 -----------------
-Moshe Weitzman <weitzman AT tejasa DOT com>
\ No newline at end of file
+Moshe Weitzman <weitzman AT tejasa DOT com>
+Mark Janssen <mark DOT drupal AT deepaquila DOT com>
\ No newline at end of file
