Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 7878)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 7879)
@@ -41,4 +41,5 @@
 var ec_selected_action          = '-1';
 var maintenant                  = new Date();
+var validity_date               = new Date();
 var ec_JS_message               = new Array();
 var ec_duplic_codes             = new Array();
@@ -54,5 +55,4 @@
     ec_lists['comment']         = new Array();
 var d                           = document;
-var validity_date               = maintenant;
 
 function de(ec_id) {
@@ -726,5 +726,5 @@
   tp.setMilliseconds(0);
   tp.setSeconds(0);
-  maintenant = tp;
+  maintenant.setTime(tp.getTime());
   tp.setTime(maintenant.getTime() + 120000); // PHP will not allow that
   // [date & time] is less than [one minute more than current [date & time]].
@@ -737,5 +737,5 @@
   ec_get_validity();
   if (Number(validity_date.getTime()) < Number(tp.getTime()))
-   validity_date = tp;
+   validity_date.setTime(tp.getTime());
   ec_set_validity();
 }
@@ -743,4 +743,6 @@
 function ec_mark_now() {
   maintenant = new Date();
+  maintenant.setMilliseconds(0);
+  maintenant.setSeconds(0);
   validity_date.setTime(maintenant.getTime() + 120000); // See two minutes
    // explanation in function ec_validity_check_min
@@ -788,5 +790,7 @@
   var tp = new Date();
   var ts = 0;
-  maintenant = tp;
+  tp.setMilliseconds(0);
+  tp.setSeconds(0);
+  maintenant.setTime(tp.getTime());
   tp.setTime(maintenant.getTime() + 120000); // See two minutes
    // explanation in function ec_validity_check_min
@@ -799,4 +803,14 @@
   ec_set_validity();
   ec_validity_check_min();
+}
+
+function ec_check_validity_on() {
+  $('.ec_valid_ctl').attr('disabled', !ec_validity_on);
+  $('img.ui-datepicker-trigger').css(
+    'display', (ec_validity_on) ? 'inline' : 'none'
+  );
+  $('#ec_tmp_img').css(
+    'display', (ec_validity_on) ? 'none' : 'inline'
+  );
 }
 
@@ -850,4 +864,12 @@
    null, "#ec_min_date_id", null);
   $(document).ready(function(){
+    maintenant = new Date();
+    maintenant.setMilliseconds(0);
+    maintenant.setSeconds(0);
+    validity_date.setTime(maintenant.getTime());
+    ec_check_validity_on();
+    $('#ec_tmp_img').attr(
+      'src', $('img.ui-datepicker-trigger:first').attr('src')
+    );
     $('.ui-datepicker').click(function(){
       ec_validity_check_min();
@@ -859,4 +881,12 @@
       'backgroundColor', $('#content').css('backgroundColor')
     );
+    $('#ec_validity_sel_day').css(
+      'color', $('#content').css('color')
+    );
+    $('.ec_valid_ctl').attr('disabled', 'disabled');
+    $('#ec_valid_date_on_id').change(function(){
+      ec_validity_on = $(this).attr('checked');
+      ec_check_validity_on();
+    });
   });
   
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 7878)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 7879)
@@ -315,7 +315,9 @@
     <!--
       Next steps:
-        _ check if initialize validity date with JS is doable ;   DONE
-        _ check if ' onchange = "ec_update_ts();" ' can be used ; DONE
-        _ implement JS ; DONE
+        _ check if initialize validity date with JS is doable;   DONE
+        _ check if ' onchange = "ec_update_ts();" ' can be used; DONE
+        _ implement JS:
+          _ tick checkboxes when necessary;
+          _ throw proper information when submitting form.
         _ implement PHP ;
         _ commit, and drink a pint!
@@ -336,7 +338,7 @@
             </label>
           </p>
-          <p style = "text-align:left;{* padding:0.5em; border:1px solid #666666; *}">
-            <input type = "text" id = "ec_validity_sel_day" style = "text-align:right; border:none;" disabled = "disabled">&nbsp;
-            <select id = "ec_validity_day_id" name = "ec_validity_day" class = "ec_datepicker">
+          <p style = "text-align:left;">
+            <input type = "text" id = "ec_validity_sel_day" style = "text-align:right; border:none; cursor:default;" disabled = "disabled">&nbsp;
+            <select id = "ec_validity_day_id" name = "ec_validity_day" class = "ec_valid_ctl ec_datepicker">
               <option value = "0">--</option>
               {section name=day start=1 loop=32}
@@ -346,19 +348,20 @@
               {/section}
             </select>
-            <select id = "ec_validity_month_id" name = "ec_validity_month" class = "ec_datepicker">
+            <select id = "ec_validity_month_id" name = "ec_validity_month" class = "ec_valid_ctl ec_datepicker">
               {html_options options=$month_list}
             </select>
             <input id = "ec_validity_year_id" name = "ec_validity_year" type = "text" size = "4"
-             maxlength = "4" style = "text-align:right; " class = "ec_datepicker">
-            <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" class = "ec_datepicker"
+             maxlength = "4" style = "text-align:right; " class = "ec_valid_ctl ec_datepicker">
+            <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" class = "ec_valid_ctl ec_datepicker"
              size = "5" maxlength = "5" title = "{'Hours field tooltip'|@translate}" style = "text-align:right; ">
             <input id = "ec_linked_date_id" name = "ec_linked_date_id" type = "hidden" size = "10" disabled = "disabled">
+            <img id = "ec_tmp_img" class = "ui-datepicker-trigger" src = "{$EVNTCATS_URLS.ROOT}icon/tmp.png" alt = "" title = "" style = "display:none;">
           </p>
           <p style = "text-align:left;">
             <input id = "ec_date_today_btn_id" type = "button" value = "{'Now + 2 mn'|@translate}"
-             class = "submit" title = "{'Now button tooltip'|@translate}" onclick = "ec_mark_now();">&nbsp;—&nbsp;
+             class = "ec_valid_ctl submit" title = "{'Now button tooltip'|@translate}" onclick = "ec_mark_now();">&nbsp;—&nbsp;
             <input id = "ec_set_time_to_btn_id" type = "button" value = "{'Set time to'|@translate}"
-             class = "submit" onclick = "ec_valid_set_time_to(document.getElementById('ec_set_time_to_id').selectedIndex);">&nbsp;
-            <select id = "ec_set_time_to_id" name = "ec_set_time_to" onchange = "ec_valid_set_time_to(this.selectedIndex);">
+             class = "ec_valid_ctl submit" onclick = "ec_valid_set_time_to(document.getElementById('ec_set_time_to_id').selectedIndex);">&nbsp;
+            <select id = "ec_set_time_to_id" name = "ec_set_time_to" onchange = "ec_valid_set_time_to(this.selectedIndex);" class = "ec_valid_ctl">
               {section name=time start=0 loop=24}
                 <option label = "{if strlen($smarty.section.time.index) lt 2}0{/if}{$smarty.section.time.index}:00" value = "{$smarty.section.time.index}">
@@ -369,8 +372,8 @@
           </p>
           <p style = "text-align:left;">
-            <input id = "ec_date_add_btn_id" type = "button" value = "{'Add'|@translate}" title = "{'Add button tooltip'|@translate}" class = "submit"
+            <input id = "ec_date_add_btn_id" type = "button" value = "{'Add'|@translate}" title = "{'Add button tooltip'|@translate}" class = "ec_valid_ctl submit"
              onclick = "ec_add_time(document.getElementById('ec_date_add_val_id').value, document.getElementById('ec_date_add_kind_id').selectedIndex);">&nbsp;
-            <input id = "ec_date_add_val_id" type = "text" size = "5" maxlength = "5" value = "" style = "text-align:right;">&nbsp;
-            <select id = "ec_date_add_kind_id" name = "ec_date_add_kind">
+            <input id = "ec_date_add_val_id" type = "text" size = "5" maxlength = "5" value = "" style = "text-align:right;" class = "ec_valid_ctl">&nbsp;
+            <select id = "ec_date_add_kind_id" name = "ec_date_add_kind" class = "ec_valid_ctl">
               <option label = "{'Minutes'|@translate}" value = "minutes">{'Minutes'|@translate}</option>
               <option label = "{'Hours'|@translate}"   value = "hours"  >{'Hours'|@translate}</option>
@@ -393,5 +396,5 @@
                   <li style = "margin-bottom:0;">
                     <label for = "ec_notify_user_id">
-                      <input type = "checkbox" name = "ec_notify_user" id = "ec_notify_user_id">
+                      <input type = "checkbox" name = "ec_notify_user" id = "ec_notify_user_id" class = "ec_valid_ctl">
                       {'The user'|@translate}
                     </label>
@@ -399,5 +402,5 @@
                   <li style = "margin-bottom:0;">
                     <label for = "ec_notify_webm_id">
-                      <input type = "checkbox" name = "ec_notify_webm" id = "ec_notify_webm_id">
+                      <input type = "checkbox" name = "ec_notify_webm" id = "ec_notify_webm_id" class = "ec_valid_ctl">
                       {'The webmaster'|@translate}
                     </label>
@@ -405,5 +408,5 @@
                   <li style = "margin-bottom:0;">
                     <label for = "ec_notify_admins_id">
-                      <input type = "checkbox" name = "ec_notify_admins" id = "ec_notify_admins_id">
+                      <input type = "checkbox" name = "ec_notify_admins" id = "ec_notify_admins_id" class = "ec_valid_ctl">
                       {'All administrators'|@translate}
                     </label>
@@ -449,5 +452,5 @@
                   <li style = "margin-bottom:0;">
                     <label for = "ec_date_unknown_0_id">
-                      <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id">
+                      <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id" class = "ec_valid_ctl">
                       {'Home'|@translate}
                     </label>
@@ -455,5 +458,5 @@
                   <li style = "margin-bottom:0;">
                     <label for = "ec_date_unknown_1_id">
-                      <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id">
+                      <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id" class = "ec_valid_ctl">
                       {'Access denied'|@translate}
                     </label>
@@ -461,8 +464,8 @@
                   {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
                   <li {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {else} style = "margin-bottom:0;" {/if} >
-                    <label class = "ec_date_block" for = "ec_date_in_up_aps_id">
-                      <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id">
+                    <label for = "ec_date_in_up_aps_id">
+                      <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id" class = "ec_valid_ctl">
                       {'Additional Page'|@translate}<br>
-                      <select class = "categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >
+                      <select class = "ec_valid_ctl categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >
                         {html_options options = $ec_lists.add_pages}
                       </select>
