Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4111)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4112)
@@ -2,9 +2,9 @@
 
 var ec_avoid_infinite_loop      = true;
-var ec_avoid_infinite_loop2     = true;
+var ec_is_creation              = true;
+var ec_chk_nover_cat            = true;
 var ec_flag1                    = false;
 var ec_flag2                    = false;
 var ec_dont_check               = false;
-var ec_is_creation              = true;
 var ec_err                      = '';
 var ec_selected_img             = '';
@@ -30,4 +30,15 @@
 var ec_JS_message               = new Array();
 var ec_duplic_codes             = new Array();
+var ec_lists                    = new Array();
+    ec_lists['user_id']         = new Array();
+    ec_lists['action']          = new Array();
+    ec_lists['arg1']            = new Array();
+    ec_lists['arg2']            = new Array();
+    ec_lists['forced']          = new Array();
+var d                           = document;
+
+function de(ec_id) {
+  return document.getElementById(ec_id);
+}
 
 function ec_check_exist_value(ec_id, ec_val) {
@@ -41,22 +52,17 @@
 function ec_mark_entry(ec_id) {
   var i = 0;
-  var t = new Array();
-  var r = /,/g;
-  if (ec_id == '-1') {
-    ec_avoid_infinite_loop2 = false;
-    ec_init();
-    ec_avoid_infinite_loop2 = true;
-  }
-  else {
-    document.getElementById('ec_act2_id').value = ec_id;
-    t = document.getElementById('ec_in_up_entry_list_id').options[
-     document.getElementById('ec_in_up_entry_list_id').selectedIndex
-    ].label.split(r);
-// t[0] : user_id ; t[1] : action ; t[2] : arg1 ; t[3] : arg2 ; t[4] : forced
-    if (ec_check_exist_value('ec_in_up_usr_list_id', t[0])) {
+  if (ec_id == '-1') de('ec_in_up_entry_list_id').selectedIndex = '-1';
+  else {
+    de('ec_act2_id').value = ec_id;
+    if (
+      ec_check_exist_value('ec_in_up_usr_list_id', ec_lists['user_id'][ec_id])
+    ) {
       ec_selected_user = 'ec_sel_user_old';
-      ec_selected_old_user = t[0];
-      if (t[2] != '' && t[1].lastIndexOf('ec_ok') != -1) i++;
-      if (t[3] != '') { i++; i++; }
+      ec_selected_old_user = ec_lists['user_id'][ec_id];
+      if (
+        ec_lists['arg1'][ec_id] != '' &&
+        ec_lists['action'][ec_id].lastIndexOf('ec_ok') != -1
+      ) i++;
+      if (ec_lists['arg2'][ec_id] != '') { i++; i++; }
       switch (i) {
         case 0: // Home
@@ -65,28 +71,28 @@
         case 1: // Category
           ec_selected_action = 'ec_input_action_cat';
-          ec_selected_cat = (ec_check_exist_value('ec_in_up_cats_id', t[2])) ?
-           t[2] : '-1';
+          ec_selected_cat = (ec_check_exist_value('ec_in_up_cats_id',
+           ec_lists['arg1'][ec_id])) ? ec_lists['arg1'][ec_id] : '-1';
         break;
         case 2: // Additionnal Page
           ec_selected_action = 'ec_input_action_add_p';
-          ec_selected_cat = (ec_check_exist_value('ec_in_up_aps_id', t[3])) ?
-           t[3] : '-1';
+          ec_selected_cat = (ec_check_exist_value('ec_in_up_aps_id',
+           ec_lists['arg2'][ec_id])) ? ec_lists['arg2'][ec_id] : '-1';
         break;
         case 3: // Image
           ec_selected_action = 'ec_input_action_img';
-          ec_selected_cat = (ec_check_exist_value('ec_in_up_cats_id', t[2])) ?
-           t[2] : '-1';
-          ec_selected_img = t[3];
-        break;
-      }
-      document.getElementById('ec_in_up_forced_id').checked =
-       (t[4] == 'true') ? 'checked' : '';
+          ec_selected_cat = (ec_check_exist_value('ec_in_up_cats_id',
+           ec_lists['arg1'][ec_id])) ? ec_lists['arg1'][ec_id] : '-1';
+          ec_selected_img = ec_lists['arg2'][ec_id];
+        break;
+      }
+      de('ec_in_up_forced_id').checked =
+       (ec_lists['forced'][ec_id] == 'true') ? 'checked' : '';
       ec_mark_action(ec_selected_action);
     }
     else {
       ec_selected_user = 'ec_sel_user_none';
-      document.getElementById('ec_in_up_forced_id').checked = '';
-      if (ec_check_exist_value('ec_in_up_aps_id', t[3])) {
-        ec_selected_AP = t[3];
+      de('ec_in_up_forced_id').checked = '';
+      if (ec_check_exist_value('ec_in_up_aps_id', ec_lists['arg2'][ec_id])) {
+        ec_selected_AP = ec_lists['arg2'][ec_id];
         ec_mark_action('ec_input_action_add_p');
       }
@@ -100,11 +106,11 @@
 function ec_mark_code(ec_id) {
   if (ec_id == '-1') {
-    document.getElementById('ec_sel_code_old').checked = 'checked';
-    document.getElementById('ec_sel_code_old').checked = '';
+    de('ec_sel_code_old').checked = 'checked';
+    de('ec_sel_code_old').checked = '';
   }
   else {
     if (ec_flag2 ||
-     !(document.getElementById('ec_sel_code_old').disabled == 'disabled' ||
-     document.getElementById('ec_sel_code_old').disabled == true)
+     !(de('ec_sel_code_old').disabled == 'disabled' ||
+     de('ec_sel_code_old').disabled == true)
     ) {
       var t1 = '';
@@ -114,35 +120,35 @@
       }
       else ec_selected_code = ec_id;
-      document.getElementById(ec_selected_code).checked = 'checked';
+      de(ec_selected_code).checked = 'checked';
       switch (ec_selected_code) {
         case 'ec_sel_code_new':
-          document.getElementById('ec_act1_id').value = 'create';
-          document.getElementById('ec_in_up_code_list_id').value = '-1';
-          document.getElementById('ec_in_up_code_id').value = ec_new_code_text;
-          document.getElementById('ec_act2_id').value = '-1';
+          de('ec_act1_id').value = 'create';
+          de('ec_in_up_code_list_id').selectedIndex = '-1';
+          de('ec_in_up_code_id').value = ec_new_code_text;
+          de('ec_act2_id').value = '-1';
         break;
         case 'ec_sel_code_old':
-          document.getElementById('ec_act1_id').value =
+          de('ec_act1_id').value =
            'duplicate_entry_submit';
-          document.getElementById('ec_act2_id').value =
+          de('ec_act2_id').value =
            ec_selected_old_code;
-          document.getElementById('ec_in_up_code_list_id').value =
+          de('ec_in_up_code_list_id').value =
            ec_selected_old_code;
-          document.getElementById('ec_in_up_code_id').value = '';
+          de('ec_in_up_code_id').value = '';
           t1 = 'disabled';
           ec_selected_old_user =
-           document.ec_new_code.ec_in_up_code_list.options[
-            document.ec_new_code.ec_in_up_code_list.selectedIndex
+           d.ec_new_code.ec_in_up_code_list.options[
+            d.ec_new_code.ec_in_up_code_list.selectedIndex
            ].label;
-          document.getElementById('ec_in_up_usr_list_id').value = ec_selected_old_user;
+          de('ec_in_up_usr_list_id').value = ec_selected_old_user;
           ec_mark_user('ec_sel_user_old');
         break;
       }
-      document.getElementById('ec_sel_user_new').disabled       = t1;
-      document.getElementById('ec_submit_gen_user_id').disabled = t1;
-      document.getElementById('ec_in_up_usr_txt_id').disabled   = t1;
-      document.getElementById('ec_in_up_psd_txt_id').disabled   = t1;
-      document.getElementById('ec_sel_user_old').disabled       = t1;
-      document.getElementById('ec_in_up_usr_list_id').disabled  = t1;
+      de('ec_sel_user_new').disabled       = t1;
+      de('ec_submit_gen_user_id').disabled = t1;
+      de('ec_in_up_usr_txt_id').disabled   = t1;
+      de('ec_in_up_psd_txt_id').disabled   = t1;
+      de('ec_sel_user_old').disabled       = t1;
+      de('ec_in_up_usr_list_id').disabled  = t1;
     }
   }
@@ -151,18 +157,20 @@
 function ec_mark_user(ec_id) {
   if (ec_id == '-1') {
-    document.getElementById('ec_sel_user_old').checked = 'checked';
-    document.getElementById('ec_sel_user_old').checked = '';
+    de('ec_sel_user_old').checked = 'checked';
+    de('ec_sel_user_old').checked = '';
   }
   else {
     if (
      !ec_is_creation &&
-     document.getElementById('ec_in_up_entry_list_id').value == '-1'
+     de('ec_in_up_entry_list_id').selectedIndex == '-1'
     ) {
       alert(ec_JS_message['ec_act_entry_miss']);
+      de('ec_in_up_usr_list_id').selectedIndex = '-1';
+      d.ec_new_code.ec_in_up_entry_list.focus();
       return false;
     }
     else if (ec_flag1 ||
-     !(document.getElementById('ec_sel_user_old').disabled == 'disabled' ||
-     document.getElementById('ec_sel_user_old').disabled == true)
+     !(de('ec_sel_user_old').disabled == 'disabled' ||
+     de('ec_sel_user_old').disabled == true)
     ) {
       if (ec_id == 'ec_sel_user_old' && ec_selected_old_user == '-1') {
@@ -172,5 +180,5 @@
       }
       else ec_selected_user = ec_id;
-      document.getElementById(ec_selected_user).checked = 'checked';
+      de(ec_selected_user).checked = 'checked';
       switch (ec_selected_user) {
         case 'ec_sel_user_none': // None
@@ -178,23 +186,23 @@
            (ec_ap_ok && (ec_selected_action != 'ec_input_action_refused')) ?
            'ec_input_action_add_p' : 'ec_input_action_refused';
-          document.getElementById('ec_in_up_usr_txt_id').value = '';
-          document.getElementById('ec_in_up_psd_txt_id').value = '';
-          document.getElementById('ec_in_up_usr_list_id').value = '-1';
+          de('ec_in_up_usr_txt_id').value = '';
+          de('ec_in_up_psd_txt_id').value = '';
+          de('ec_in_up_usr_list_id').selectedIndex = '-1';
         break;
         case 'ec_sel_user_new': // New user
           if (ec_selected_action == 'ec_input_action_refused')
            ec_selected_action = 'ec_input_action_home';
-          document.getElementById('ec_in_up_usr_txt_id').value =
+          de('ec_in_up_usr_txt_id').value =
            ec_new_user_text;
-          document.getElementById('ec_in_up_psd_txt_id').value =
+          de('ec_in_up_psd_txt_id').value =
            ec_new_psd_text;
-          document.getElementById('ec_in_up_usr_list_id').value = '-1';
+          de('ec_in_up_usr_list_id').selectedIndex = '-1';
         break;
         case 'ec_sel_user_old': // "Old" user
           if (ec_selected_action == 'ec_input_action_refused')
            ec_selected_action = 'ec_input_action_home';
-          document.getElementById('ec_in_up_usr_txt_id').value = '';
-          document.getElementById('ec_in_up_psd_txt_id').value = '';
-          document.getElementById('ec_in_up_usr_list_id').value =
+          de('ec_in_up_usr_txt_id').value = '';
+          de('ec_in_up_psd_txt_id').value = '';
+          de('ec_in_up_usr_list_id').value =
            ec_selected_old_user;
         break;
@@ -213,40 +221,52 @@
 function ec_mark_action(ec_id) {
   if (ec_id == '' || ec_id == '-1') {
-    document.getElementById('ec_input_action_home').checked = 'checked';
-    document.getElementById('ec_input_action_home').checked = '';
+    de('ec_input_action_home').checked = 'checked';
+    de('ec_input_action_home').checked = '';
   }
   else {
     if (
      !ec_is_creation &&
-     document.getElementById('ec_in_up_entry_list_id').value == '-1'
+     de('ec_in_up_entry_list_id').selectedIndex == '-1'
     ) {
       alert(ec_JS_message['ec_act_entry_miss']);
+      de('ec_in_up_aps_id').selectedIndex = '-1';
+      de('ec_in_up_cats_id').selectedIndex = '-1';
+      de('ec_in_up_imgs_id').value = '';
+      d.ec_new_code.ec_in_up_entry_list.focus();
       return false;
     }
     else if (
-      !(document.getElementById(ec_id).disabled == 'disabled' ||
-      document.getElementById(ec_id).disabled == true)
+      !(de(ec_id).disabled == 'disabled' ||
+      de(ec_id).disabled == true)
     ) {
-      ec_selected_action = ec_id;
-      document.getElementById(ec_selected_action).checked = 'checked';
+      if (
+        ec_chk_nover_cat &&
+        ec_id == 'ec_input_action_cat' &&
+        de('ec_in_up_imgs_id').value != ''
+      ) {
+        ec_selected_action = 'ec_input_action_img';
+        ec_selected_cat    = de('ec_in_up_cats_id').value;
+      }
+      else ec_selected_action = ec_id;
+      de(ec_selected_action).checked = 'checked';
       switch (ec_selected_action) {
         case 'ec_input_action_add_p': // Additional Page
-          document.getElementById('ec_in_up_aps_id').value = ec_selected_AP;
-          document.getElementById('ec_in_up_cats_id').value = '-1';
-          document.getElementById('ec_in_up_imgs_id').value = '';
-          document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+          de('ec_in_up_aps_id').value = ec_selected_AP;
+          de('ec_in_up_cats_id').selectedIndex = '-1';
+          de('ec_in_up_imgs_id').value = '';
+          de('ec_in_up_imgs_warn').innerHTML = '';
         break;
         case 'ec_input_action_cat': // Category
-          document.getElementById('ec_in_up_aps_id').value = '-1';
-          document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
-          document.getElementById('ec_in_up_imgs_id').value = '';
+          de('ec_in_up_aps_id').selectedIndex = '-1';
+          de('ec_in_up_cats_id').value = ec_selected_cat;
+          de('ec_in_up_imgs_id').value = '';
           ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
            'ec_sel_user_old' : ec_selected_user;
-          document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+          de('ec_in_up_imgs_warn').innerHTML = '';
         break;
         case 'ec_input_action_img': // Image
-          document.getElementById('ec_in_up_aps_id').value = '-1';
-          document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
-          document.getElementById('ec_in_up_imgs_id').value = ec_selected_img;
+          de('ec_in_up_aps_id').selectedIndex = '-1';
+          de('ec_in_up_cats_id').value = ec_selected_cat;
+          de('ec_in_up_imgs_id').value = ec_selected_img;
           ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
            'ec_sel_user_old' : ec_selected_user;
@@ -254,17 +274,17 @@
         break;
         case 'ec_input_action_home': // Home
-          document.getElementById('ec_in_up_aps_id').value = '-1';
-          document.getElementById('ec_in_up_cats_id').value = '-1';
-          document.getElementById('ec_in_up_imgs_id').value = '';
-          document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+          de('ec_in_up_aps_id').selectedIndex = '-1';
+          de('ec_in_up_cats_id').selectedIndex = '-1';
+          de('ec_in_up_imgs_id').value = '';
+          de('ec_in_up_imgs_warn').innerHTML = '';
           ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
            'ec_sel_user_old' : ec_selected_user;
         break;
         case 'ec_input_action_refused': // Access denied
-          document.getElementById('ec_in_up_aps_id').value = '-1';
-          document.getElementById('ec_in_up_cats_id').value = '-1';
-          document.getElementById('ec_in_up_imgs_id').value = '';
+          de('ec_in_up_aps_id').selectedIndex = '-1';
+          de('ec_in_up_cats_id').selectedIndex = '-1';
+          de('ec_in_up_imgs_id').value = '';
           ec_selected_user = 'ec_sel_user_none';
-          document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
+          de('ec_in_up_imgs_warn').innerHTML = '';
         break;
       }
@@ -281,10 +301,10 @@
 
 function ec_mark_forced() {
-  document.getElementById('ec_style_forced_id').innerHTML =
-    (document.getElementById('ec_in_up_forced_id').checked != '') ?
+  de('ec_style_forced_id').innerHTML =
+    (de('ec_in_up_forced_id').checked == '') ?
+     ec_up_code_lbl_forced_txt
+    :
      '<span style = "font-weight:bold; color:red;">' +
      ec_up_code_lbl_forced_txt + '</span>'
-    :
-     ec_up_code_lbl_forced_txt
   ;
 }
@@ -382,6 +402,6 @@
       case 'ec_input_action_add_p': // Additional Page
         ec_new_user_text = ec_reg_ap.exec(
-         document.ec_new_code.ec_in_up_aps.options[
-          document.ec_new_code.ec_in_up_aps.selectedIndex
+         d.ec_new_code.ec_in_up_aps.options[
+          d.ec_new_code.ec_in_up_aps.selectedIndex
          ].label
         );
@@ -389,11 +409,11 @@
       case 'ec_input_action_cat': // Category
       case 'ec_input_action_img': // Image
-        ec_cat_sel = document.ec_new_code.ec_in_up_cat.options[
-          document.ec_new_code.ec_in_up_cat.selectedIndex
+        ec_cat_sel = d.ec_new_code.ec_in_up_cat.options[
+          d.ec_new_code.ec_in_up_cat.selectedIndex
          ].label;
         ec_new_user_text = (ec_reg_cat2.test(ec_cat_sel)) ?
          ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
       if (ec_selected_action == 'ec_input_action_img') {
-        ec_new_user_text +=  '_' + document.ec_new_code.ec_in_up_imgs_id.value;
+        ec_new_user_text +=  '_' + d.ec_new_code.ec_in_up_imgs_id.value;
       }
       break;
@@ -420,13 +440,13 @@
 
 function ec_check_img_text() {
-  if (isNaN(document.getElementById('ec_in_up_imgs_id').value)) {
+  if (isNaN(de('ec_in_up_imgs_id').value)) {
     alert(ec_JS_message['ec_act_img_miss']);
     ec_selected_img = '';
-    document.getElementById('ec_in_up_imgs_id').value = '';
-  }
-  else {
-    document.getElementById('ec_in_up_imgs_warn').innerHTML = (
-     document.getElementById('ec_in_up_imgs_id').value != '' &&
-     document.getElementById('ec_in_up_cats_id').value == '-1'
+    de('ec_in_up_imgs_id').value = '';
+  }
+  else {
+    de('ec_in_up_imgs_warn').innerHTML = (
+     de('ec_in_up_imgs_id').value != '' &&
+     de('ec_in_up_cats_id').selectedIndex == '-1'
     ) ? ec_JS_message['ec_act_cat_miss'] : '';
   }
@@ -434,6 +454,6 @@
 
 function ec_check_pwd_text() {
-  document.getElementById('ec_in_up_pwd_warn').innerHTML = (
-   document.getElementById('ec_in_up_psd_txt_id').value == ec_old_new_psd_text
+  de('ec_in_up_pwd_warn').innerHTML = (
+   de('ec_in_up_psd_txt_id').value == ec_old_new_psd_text
    && ec_old_new_psd_text != ''
    && ec_selected_user == 'ec_sel_user_new'
@@ -442,5 +462,5 @@
 
 function ec_check_code_text() {
-  var t    = document.getElementById('ec_in_up_code_id').value;
+  var t    = de('ec_in_up_code_id').value;
   var treg = /^[a-zA-Z0-9_-]{4,32}$/
   if (t == '' || treg.test(t) || t == NULL) {
@@ -450,5 +470,5 @@
     alert(ec_JS_message['ec_submit_code_bad']);
     ec_new_code_text = '';
-    document.getElementById('ec_in_up_code_id').value = '';
+    de('ec_in_up_code_id').value = '';
   }
 }
@@ -460,12 +480,12 @@
   if (ec_is_creation) {
     if ((
-      document.getElementById('ec_sel_code_new').checked != '' &&
-      document.getElementById('ec_in_up_code_id').value == ''
+      de('ec_sel_code_new').checked != '' &&
+      de('ec_in_up_code_id').value == ''
       ) || (
-      document.getElementById('ec_sel_code_old').checked != '' &&
-      document.getElementById('ec_in_up_code_list_id').value == '-1'
+      de('ec_sel_code_old').checked != '' &&
+      de('ec_in_up_code_list_id').selectedIndex == '-1'
       ) || (
-      document.getElementById('ec_sel_code_old').checked == '' &&
-      document.getElementById('ec_sel_code_new').checked == ''
+      de('ec_sel_code_old').checked == '' &&
+      de('ec_sel_code_new').checked == ''
       )
     ) {
@@ -475,12 +495,12 @@
   }
   else {
-    t1 = (document.getElementById('ec_sel_user_none').checked == '');
-    t2 = (document.getElementById('ec_input_action_refused').checked == '');
+    t1 = (de('ec_sel_user_none').checked == '');
+    t2 = (de('ec_input_action_refused').checked == '');
     if (
       !t1 && ((
-          document.getElementById('ec_input_action_add_p').checked != '' &&
-          document.ec_new_code.ec_in_up_aps.selectedIndex < 1
+          de('ec_input_action_add_p').checked != '' &&
+          d.ec_new_code.ec_in_up_aps.selectedIndex < 1
         ) || (
-        document.getElementById('ec_input_action_add_p').checked == '' &&
+        de('ec_input_action_add_p').checked == '' &&
         t2
         )
@@ -490,5 +510,5 @@
       return false;
     }
-    if (document.getElementById('ec_in_up_entry_list_id').selectedIndex ==0) {
+    if (de('ec_in_up_entry_list_id').selectedIndex ==0) {
       alert(ec_JS_message['ec_act_entry_miss']);
       return false;
@@ -496,12 +516,12 @@
   }
   if ((
-    document.getElementById('ec_sel_user_new').checked != '' &&
-    document.getElementById('ec_in_up_usr_txt_id').value == ''
+    de('ec_sel_user_new').checked != '' &&
+    de('ec_in_up_usr_txt_id').value == ''
     ) || (
-    document.getElementById('ec_sel_user_old').checked != '' &&
-    document.ec_new_code.ec_in_up_usr_list.value == '-1'
+    de('ec_sel_user_old').checked != '' &&
+    d.ec_new_code.ec_in_up_usr_list.selectedIndex == '-1'
     ) || (
-    document.getElementById('ec_sel_user_new').checked == '' &&
-    document.getElementById('ec_sel_user_old').checked == '' &&
+    de('ec_sel_user_new').checked == '' &&
+    de('ec_sel_user_old').checked == '' &&
     t1
     )
@@ -511,14 +531,14 @@
   }
   if (
-    document.ec_new_code.ec_in_up_aps.selectedIndex < 1 &&
-    document.ec_new_code.ec_in_up_cat.selectedIndex < 1 && (
-      document.getElementById('ec_in_up_imgs_id').value == '' || (
-        document.getElementById('ec_in_up_imgs_id').value != '' && (
-          isNaN(document.getElementById('ec_in_up_imgs_id').value) ||
-          document.ec_new_code.ec_in_up_cat.selectedIndex < 1
+    d.ec_new_code.ec_in_up_aps.selectedIndex < 1 &&
+    d.ec_new_code.ec_in_up_cat.selectedIndex < 1 && (
+      de('ec_in_up_imgs_id').value == '' || (
+        de('ec_in_up_imgs_id').value != '' && (
+          isNaN(de('ec_in_up_imgs_id').value) ||
+          d.ec_new_code.ec_in_up_cat.selectedIndex < 1
         )
       )
     ) &&
-    document.getElementById('ec_input_action_home').checked == '' &&
+    de('ec_input_action_home').checked == '' &&
     t2
   ) {
@@ -527,5 +547,5 @@
   }
   if ((!ec_is_creation && !t1) ||
-    document.getElementById('ec_in_up_forced_id').checked != ''
+    de('ec_in_up_forced_id').checked != ''
   ) return confirm(ec_JS_message['ec_confirm_del_other']);
   return true;
@@ -545,8 +565,8 @@
 
 function ec_mark_type(ec_id) {
-  document.getElementById('ec_act1_id').value = ec_id;
-  document.getElementById('ec_act2_id').value = '-1';
+  de('ec_act1_id').value = ec_id;
+  de('ec_act2_id').value = '-1';
   ec_dont_check = true;
-  document.forms['ec_new_code'].submit();
+  d.ec_new_code.submit();
 }
 
@@ -556,5 +576,4 @@
 
 function ec_init() {
-  var d = document;
   ec_err                = '';
   ec_selected_action    = '';
@@ -573,24 +592,21 @@
   ec_selected_user      = '-1';
   ec_selected_code      = '-1';
-  d.getElementById('ec_style_forced_id').innerHTML        =
-   ec_up_code_lbl_forced_txt;
-  d.getElementById('ec_act1_id').value                    =
-   ec_default_action;
-  d.getElementById('ec_in_up_usr_txt_id').value           = '';
-  d.getElementById('ec_in_up_psd_txt_id').value           = '';
-  d.getElementById('ec_in_up_pwd_warn').innerHTML         = '';
-  d.getElementById('ec_in_up_aps_id').value               = '-1';
-  d.getElementById('ec_in_up_cats_id').value              = '-1';
-  d.getElementById('ec_in_up_imgs_id').value              = '';
-  d.getElementById('ec_in_up_imgs_warn').innerHTML        = '';
-  d.getElementById('ec_input_action_home').checked        = 'checked';
-  d.getElementById('ec_input_action_home').checked        = '';
+  de('ec_style_forced_id').innerHTML              = ec_up_code_lbl_forced_txt;
+  de('ec_act1_id').value                          = ec_default_action;
+  de('ec_in_up_usr_txt_id').value                 = '';
+  de('ec_in_up_psd_txt_id').value                 = '';
+  de('ec_in_up_pwd_warn').innerHTML               = '';
+  de('ec_in_up_aps_id').selectedIndex             = '-1';
+  de('ec_in_up_cats_id').selectedIndex            = '-1';
+  de('ec_in_up_imgs_id').value                    = '';
+  de('ec_in_up_imgs_warn').innerHTML              = '';
+  de('ec_input_action_home').checked              = 'checked';
+  de('ec_input_action_home').checked              = '';
   
   if (ec_is_creation) { // Entry creation
-    d.getElementById('ec_in_up_auto_code_length_id').value=
-     ec_auto_code_digits_nb;
-    d.getElementById('ec_in_up_code_id').value            = '';
-    d.getElementById('ec_sel_code_old').checked           = 'checked';
-    d.getElementById('ec_sel_user_old').checked           = 'checked';
+    de('ec_in_up_auto_code_length_id').value= ec_auto_code_digits_nb;
+    de('ec_in_up_code_id').value                  = '';
+    de('ec_sel_code_old').checked                 = 'checked';
+    de('ec_sel_user_old').checked                 = 'checked';
     if (
       ec_default_action == 'create' ||
@@ -598,102 +614,102 @@
       ec_default_action == 'duplicate_entry_submit'
     ) {                                             // Create entry from blank
-      d.getElementById('ec_in_up_usr_list_id').value      = '-1';
-      d.getElementById('ec_in_up_code_list_id').value     = '-1';
-      d.getElementById('ec_sel_code_old').checked         = '';
-      d.getElementById('ec_sel_user_old').checked         = '';
-      d.getElementById('ec_submit_gen_full_auto_id').disabled = '';
-      d.getElementById('ec_submit_gen_code_id').disabled  = '';
-      d.getElementById('ec_in_up_auto_code_length_id').disabled = '';
-      d.getElementById('ec_in_up_code_id').disabled       = '';
-      d.getElementById('ec_sel_code_new').disabled        = '';
-      d.getElementById('ec_sel_code_old').disabled        = '';
-      d.getElementById('ec_in_up_code_list_id').disabled  = '';
-      d.getElementById('ec_sel_user_new').disabled        = '';
-      d.getElementById('ec_submit_gen_user_id').disabled  = '';
-      d.getElementById('ec_in_up_usr_txt_id').disabled    = '';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = '';
-      d.getElementById('ec_sel_user_old').disabled        = '';
-      d.getElementById('ec_in_up_usr_list_id').disabled   = '';
-      d.getElementById('ec_in_up_forced_id').disabled     = '';
+      de('ec_in_up_usr_list_id').selectedIndex    = '-1';
+      de('ec_in_up_code_list_id').selectedIndex   = '-1';
+      de('ec_sel_code_old').checked               = '';
+      de('ec_sel_user_old').checked               = '';
+      de('ec_submit_gen_full_auto_id').disabled   = '';
+      de('ec_submit_gen_code_id').disabled        = '';
+      de('ec_in_up_auto_code_length_id').disabled = '';
+      de('ec_in_up_code_id').disabled             = '';
+      de('ec_sel_code_new').disabled              = '';
+      de('ec_sel_code_old').disabled              = '';
+      de('ec_in_up_code_list_id').disabled        = '';
+      de('ec_sel_user_new').disabled              = '';
+      de('ec_submit_gen_user_id').disabled        = '';
+      de('ec_in_up_usr_txt_id').disabled          = '';
+      de('ec_in_up_psd_txt_id').disabled          = '';
+      de('ec_sel_user_old').disabled              = '';
+      de('ec_in_up_usr_list_id').disabled         = '';
+      de('ec_in_up_forced_id').disabled           = '';
     }
     else {                                          // Duplicate entry
-      d.getElementById('ec_act1_id').value                =
-       'duplicate_entry_submit';
-      d.getElementById('ec_in_up_code_list_id').value     =
-       ec_default_entry;
-      d.getElementById('ec_submit_gen_full_auto_id').disabled =
-       'disabled';
-      d.getElementById('ec_submit_gen_code_id').disabled  = 'disabled';
-      d.getElementById('ec_in_up_auto_code_length_id').disabled =
-       'disabled';
-      d.getElementById('ec_in_up_code_id').disabled       = 'disabled';
-      d.getElementById('ec_sel_code_new').disabled        = 'disabled';
-      d.getElementById('ec_sel_code_old').disabled        = 'disabled';
-      d.getElementById('ec_in_up_code_list_id').disabled  = 'disabled';
-      d.getElementById('ec_sel_user_new').disabled        = 'disabled';
-      d.getElementById('ec_submit_gen_user_id').disabled  = 'disabled';
-      d.getElementById('ec_in_up_usr_txt_id').disabled    = 'disabled';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = 'disabled';
-      d.getElementById('ec_sel_user_old').disabled        = 'disabled';
-      d.getElementById('ec_in_up_usr_list_id').disabled   = 'disabled';
-      d.getElementById('ec_in_up_forced_id').disabled     = 'disabled';
+      de('ec_act1_id').value                      = 'duplicate_entry_submit';
+   /* if (ec_default_entry == '-1') 
+       de('ec_in_up_code_list_id').selectedIndex  = '-1';
+      else
+       de('ec_in_up_code_list_id').value          = ec_default_entry; */
+      de('ec_submit_gen_full_auto_id').disabled   = 'disabled';
+      de('ec_submit_gen_code_id').disabled        = 'disabled';
+      de('ec_in_up_auto_code_length_id').disabled = 'disabled';
+      de('ec_in_up_code_id').disabled             = 'disabled';
+      de('ec_sel_code_new').disabled              = 'disabled';
+      de('ec_sel_code_old').disabled              = 'disabled';
+      de('ec_in_up_code_list_id').disabled        = 'disabled';
+      de('ec_sel_user_new').disabled              = 'disabled';
+      de('ec_submit_gen_user_id').disabled        = 'disabled';
+      de('ec_in_up_usr_txt_id').disabled          = 'disabled';
+      de('ec_in_up_psd_txt_id').disabled          = 'disabled';
+      de('ec_sel_user_old').disabled              = 'disabled';
+      de('ec_in_up_usr_list_id').disabled         = 'disabled';
+      de('ec_in_up_forced_id').disabled           = 'disabled';
       ec_selected_old_code = ec_duplic_codes[ec_default_entry];
+      ec_selected_code     = ec_selected_old_code;
       ec_flag2 = true;
       ec_mark_code('ec_sel_code_old');
       ec_flag2 = false;
     }
-    ec_default_action                                     = 'create_ask';
+    ec_default_action                             = 'create_ask';
   }
   else { // Entry modification
-    d.getElementById('ec_sel_user_none').checked          = 'checked';
-    d.getElementById('ec_in_up_forced_id').checked        = '';
-    d.getElementById('ec_act1_id').value         =
-     'modify_entry_submit';
+    de('ec_sel_user_none').checked                = 'checked';
+    de('ec_in_up_forced_id').checked              = '';
+    de('ec_act1_id').value                        = 'modify_entry_submit';
     if (
       ec_default_action == 'modify_entry_ask' ||
       ec_default_action == 'modify_entry_submit'
     ) {                                             // Modify entry
-      d.getElementById('ec_in_up_entry_list_id').disabled = '';
-      d.getElementById('ec_sel_user_none').checked        = '';
-      d.getElementById('ec_in_up_entry_list_id').value    = ec_default_entry;
-      d.getElementById('ec_in_up_usr_list_id').value      = '-1';
-      d.getElementById('ec_sel_user_none').disabled       = '';
-      d.getElementById('ec_sel_user_new').disabled        = '';
-      d.getElementById('ec_sel_user_old').disabled        = '';
-      d.getElementById('ec_submit_gen_user_id').disabled  = '';
-      d.getElementById('ec_in_up_usr_txt_id').disabled    = '';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = '';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = '';
-      d.getElementById('ec_in_up_usr_list_id').disabled   = '';
-      d.getElementById('ec_in_up_forced_id').disabled     = '';
-      d.getElementById('ec_input_action_cat').disabled    = '';
-      d.getElementById('ec_in_up_cats_id').disabled       = '';
-      d.getElementById('ec_input_action_img').disabled    = '';
-      d.getElementById('ec_in_up_imgs_id').disabled       = '';
-      d.getElementById('ec_input_action_home').disabled   = '';
-      if (ec_avoid_infinite_loop2) ec_mark_entry(ec_default_entry);
-      ec_default_entry                                    = '-1';
+      de('ec_in_up_entry_list_id').disabled       = '';
+      de('ec_sel_user_none').checked              = '';
+      de('ec_in_up_usr_list_id').selectedIndex    = '-1';
+      de('ec_sel_user_none').disabled             = '';
+      de('ec_sel_user_new').disabled              = '';
+      de('ec_sel_user_old').disabled              = '';
+      de('ec_submit_gen_user_id').disabled        = '';
+      de('ec_in_up_usr_txt_id').disabled          = '';
+      de('ec_in_up_psd_txt_id').disabled          = '';
+      de('ec_in_up_psd_txt_id').disabled          = '';
+      de('ec_in_up_usr_list_id').disabled         = '';
+      de('ec_in_up_forced_id').disabled           = '';
+      de('ec_input_action_cat').disabled          = '';
+      de('ec_in_up_cats_id').disabled             = '';
+      de('ec_input_action_img').disabled          = '';
+      de('ec_in_up_imgs_id').disabled             = '';
+      de('ec_input_action_home').disabled         = '';
+      ec_mark_entry(ec_default_entry);
+      ec_default_entry                            = '-1';
     }
     else {                                          // Outdate entry
-      d.getElementById('ec_in_up_entry_list_id').disabled = 'disabled';
-      d.getElementById('ec_sel_user_none').disabled       = 'disabled';
-      d.getElementById('ec_sel_user_new').disabled        = 'disabled';
-      d.getElementById('ec_sel_user_old').disabled        = 'disabled';
-      d.getElementById('ec_submit_gen_user_id').disabled  = 'disabled';
-      d.getElementById('ec_in_up_usr_txt_id').disabled    = 'disabled';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = 'disabled';
-      d.getElementById('ec_in_up_psd_txt_id').disabled    = 'disabled';
-      d.getElementById('ec_in_up_usr_list_id').disabled   = 'disabled';
-      d.getElementById('ec_in_up_forced_id').disabled     = 'disabled';
-      d.getElementById('ec_input_action_cat').disabled    = 'disabled';
-      d.getElementById('ec_in_up_cats_id').disabled       = 'disabled';
-      d.getElementById('ec_input_action_img').disabled    = 'disabled';
-      d.getElementById('ec_in_up_imgs_id').disabled       = 'disabled';
-      d.getElementById('ec_input_action_home').disabled   = 'disabled';
-      d.getElementById('ec_in_up_entry_list_id').value    =
-       ec_default_entry;
-    }
-    ec_default_action                                     =
-     'modify_entry_ask';
-  }
-}
+      de('ec_in_up_entry_list_id').disabled       = 'disabled';
+      de('ec_sel_user_none').disabled             = 'disabled';
+      de('ec_sel_user_new').disabled              = 'disabled';
+      de('ec_sel_user_old').disabled              = 'disabled';
+      de('ec_submit_gen_user_id').disabled        = 'disabled';
+      de('ec_in_up_usr_txt_id').disabled          = 'disabled';
+      de('ec_in_up_psd_txt_id').disabled          = 'disabled';
+      de('ec_in_up_psd_txt_id').disabled          = 'disabled';
+      de('ec_in_up_usr_list_id').disabled         = 'disabled';
+      de('ec_in_up_forced_id').disabled           = 'disabled';
+      de('ec_input_action_cat').disabled          = 'disabled';
+      de('ec_in_up_cats_id').disabled             = 'disabled';
+      de('ec_input_action_img').disabled          = 'disabled';
+      de('ec_in_up_imgs_id').disabled             = 'disabled';
+      de('ec_input_action_home').disabled         = 'disabled';
+      if (ec_default_entry == '-1') 
+       de('ec_in_up_entry_list_id').selectedIndex = '-1';
+      else
+       de('ec_in_up_entry_list_id').value         = ec_default_entry;
+    }
+    ec_default_action                             = 'modify_entry_ask';
+  }
+  return false;
+}
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4111)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4112)
@@ -31,5 +31,5 @@
       <label for = "ec_page_type_create" {if $ec_hidden_when_no_code == ''} onclick = "ec_mark_type('create_ask');" {/if}>
         {if $ec_hidden_when_no_code == ''}
-          <input type = "radio" id = "ec_page_type_create" onclick = "ec_mark_type('create');" {if $ec_is_creation} checked = "checked" {/if} />
+          <input type = "radio" id = "ec_page_type_create" {* onclick = "ec_mark_type('create_ask');" *} {if $ec_is_creation} checked = "checked" {/if} />
         {/if}
         <span {if $ec_is_creation and $ec_hidden_when_no_code == ''} style = "text-decoration:underline;" {/if}>{'ec_new_entry_title'|@translate}</span>
@@ -41,5 +41,5 @@
       </a>
       <label for = "ec_page_type_modify" onclick = "ec_mark_type('modify_entry_ask');" {$ec_hidden_when_no_code}>
-        <input type = "radio" id = "ec_page_type_modify" onclick = "ec_mark_type('modify_entry_ask');" {if !$ec_is_creation} checked = "checked" {/if} />
+        <input type = "radio" id = "ec_page_type_modify" {* onclick = "ec_mark_type('modify_entry_ask');" *} {if !$ec_is_creation} checked = "checked" {/if} />
         <span {if !$ec_is_creation} style = "text-decoration:underline;" {/if}>{'ec_modify_entry_title'|@translate}</span>
       </label>
@@ -70,10 +70,8 @@
             {* <!-- New code (to create) --> *}
             <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
-              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new"
-               id = "ec_sel_code_new" onclick = "ec_mark_code('ec_sel_code_new');"
-              />
+              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new" id = "ec_sel_code_new"/>
               {'ec_up_code_lbl_code_new'|@translate}
             </label>
-            &nbsp;
+            <span {$ec_hidden_when_no_code} >&nbsp;</span>
             <label for = "ec_in_up_code_id" style = "margin:0;">
               <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
@@ -107,7 +105,5 @@
             {* <!-- Known code --> *}
             <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
-              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code}
-                value = "old" id = "ec_sel_code_old" onclick = "ec_mark_code('ec_sel_code_old');"
-              />
+              <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code} value = "old" id = "ec_sel_code_old" />
               {'ec_up_code_lbl_code_old'|@translate}
             </label>
@@ -115,5 +111,4 @@
              onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code}
             >
-              <option label = "------------" value = "-1">------------</option>
               {foreach from=$ec_lists.duplicable_codes.codes key=ec_key item=ec_val}
                 <option label = "{$ec_val.user_id}" value = "{$ec_val.id}">{$ec_key}</option>
@@ -128,9 +123,6 @@
             {* <!-- Entry choice --> *}
             <select name = "ec_in_up_entry_list" id = "ec_in_up_entry_list_id" onchange = "ec_mark_entry(this.value);">
-              <option value = "-1" label = "">------------</option>
               {foreach from=$ec_lists.ec_table item=ec_val}
-                <option value = "{$ec_val.id}" label = "{$ec_val.user_id},{$ec_val.action},{$ec_val.arg1},{$ec_val.arg2},{$ec_val.forced}">
-                  {$ec_val.id} : {$ec_val.code}
-                </option>
+                <option value = "{$ec_val.id}">{$ec_val.id} : {$ec_val.code}</option>
               {/foreach}
             </select>
@@ -149,5 +141,5 @@
             {* <!-- None --> *}
             <label onclick = "return ec_mark_user('ec_sel_user_none');">
-              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none" onclick = "return ec_mark_user('ec_sel_user_none');" />
+              <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none" />
               {'ec_up_code_lbl_user_none'|@translate}
             </label><br>
@@ -158,22 +150,22 @@
           {* <!-- New user (to create) --> *}
           <label for = "ec_in_up_usr_txt_id" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
-            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new"
-             id = "ec_sel_user_new" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user}
-            />
+            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new" id = "ec_sel_user_new" {$ec_hidden_when_no_user} />
             {'ec_up_code_lbl_user_new'|@translate}
           </label>
-          &nbsp;
-          <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
-           id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
-          /><br>
+          <span {$ec_hidden_when_no_user} >&nbsp;</span>
+          <label for = "ec_in_up_code_id" style = "margin:0;">
+            <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
+             id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
+            />
+          </label><br>
           <ul><li>
-            <label class = "ec_block">{'ec_new_user_name'|@translate}<br>
+            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_name'|@translate}<br>
               <input type = "text" name = "ec_in_up_usr_txt" id = "ec_in_up_usr_txt_id" maxlength = "32"
-               size = "20" onclick = "return ec_mark_user('ec_sel_user_new');" onblur = "ec_new_user_text = this.value;"
-              />
-            </label>
-            <label class = "ec_block">{'ec_new_user_pswd'|@translate}<br>
+               size = "20" onblur = "ec_new_user_text = this.value;"
+              />
+            </label>
+            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_pswd'|@translate}<br>
               <input type = "text" name = "ec_in_up_psd_txt" id = "ec_in_up_psd_txt_id" maxlength = "32"
-               size = "20" onclick = "return ec_mark_user('ec_sel_user_new');" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
+               size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
               />
             </label>
@@ -188,13 +180,8 @@
           {* <!-- Known user --> *}
           <label for = "ec_in_up_usr_list_id" onclick = "return ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
-            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user}
-             value = "old" id = "ec_sel_user_old" onclick = "return ec_mark_user('ec_sel_user_old');"
-            />
+            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user} value = "old" id = "ec_sel_user_old" />
             {'ec_up_code_lbl_user_old'|@translate}
           </label>
-          <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id"
-           onchange = "ec_change_user_list(this.value);" {$ec_hidden_when_no_user}
-          >
-            <option label = "------------" value = "-1" {$ec_hidden_when_no_user} >------------</option>
+          <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onchange = "ec_change_user_list(this.value);" {$ec_hidden_when_no_user} >
             {foreach from=$ec_lists.user_ids key=ec_key item=ec_val}
               <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
@@ -210,6 +197,6 @@
         <span style = "font-weight:bold;">{'ec_up_code_lbl_action'|@translate}</span><br>
         <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
-          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id" onclick = "ec_mark_forced();">
-          <span id = "ec_style_forced_id"></span>
+          <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id">
+          <span id = "ec_style_forced_id">&nbsp;</span>
         </label>
       </td>
@@ -220,12 +207,7 @@
          {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {/if}
         >
-          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id"
-           onclick = "return ec_mark_action('ec_input_action_add_p');"
-          />
+          <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id" />
           {'ec_up_code_lbl_aps'|@translate}<br>
-          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id"
-           onclick = "return ec_mark_action('ec_input_action_add_p');" onchange = "ec_selected_AP = this.value;"
-          >
-            <option label = "------------" value = "-1" style = "display:none;">------------</option>
+          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
             {html_options options=$ec_lists.add_pages}
           </select>
@@ -235,11 +217,8 @@
         <label class = "ec_block" for = "ec_in_up_cats_id" onclick = "return ec_mark_action('ec_input_action_cat');">
           <input type = "radio" name = "ec_input_action" value = "cat" id = "ec_input_action_cat" for = "ec_in_up_cats_id"
-           onclick = "return ec_mark_action('ec_input_action_cat');"
+            onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;"
           />
-          {'ec_up_code_lbl_cats'|@translate}<br>
-          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id"
-           onclick = "return ec_mark_action('ec_input_action_cat');" onchange = "ec_selected_cat = this.value;"
-          >
-            <option label = "------------" value = "-1" style = "display:none;">------------</option>
+          <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'ec_up_code_lbl_cats'|@translate}</span><br>
+          <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id" onchange = "ec_selected_cat = this.value;">
             {html_options options=$ec_lists.categories}
           </select>
@@ -248,7 +227,5 @@
         {* <!-- Image --> *}
         <label class = "ec_block" for = "ec_in_up_imgs_id" onclick = "return ec_mark_action('ec_input_action_img');">
-          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id"
-           onclick = "return ec_mark_action('ec_input_action_img');"
-          />
+          <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id" />
           {'ec_up_code_lbl_img'|@translate}<br>
           <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
@@ -260,7 +237,5 @@
         {* <!-- Index page --> *}
         <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_home');">
-          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home"
-           onclick = "return ec_mark_action('ec_input_action_home');"
-          />
+          <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home" />
           {'ec_up_code_lbl_home'|@translate}
         </label>
@@ -269,7 +244,5 @@
         {if !$ec_is_creation}
           <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_refused');">
-            <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused"
-             onclick = "return ec_mark_action('ec_input_action_refused');"
-            />
+            <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused" />
             {'ec_up_code_lbl_refused'|@translate}
           </label>
@@ -280,5 +253,5 @@
   <p>
     <input class = "submit" type = "submit" value = "{'Submit'|@translate}"/>
-    <input class = "submit" type = "reset" value = "{'Reset'|@translate}" onclick = "ec_init();"/>
+    <input class = "submit" type = "submit" value = "{'Reset'|@translate}" onclick = "return ec_init();"/>
   </p>
 </form>
@@ -287,23 +260,33 @@
 <script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
 <script type = "text/javascript"><!--
-  ec_is_creation                         = {if $ec_is_creation}true{else}false{/if};
-  ec_up_code_lbl_forced_txt              = "{'ec_up_code_lbl_forced'|@translate}";
-  ec_JS_message['ec_gen_user_act_miss']  = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']       = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_img_miss']       = "{'ec_act_img_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']        = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_entry_miss']     = "{'ec_act_entry_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_confirm_del_other']  = "{'ec_confirm_del_other'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']   = "{'ec_up_code_lbl_home'|@translate}";
-  ec_JS_message['ec_submit_code_miss']   = "{'ec_submit_code_miss'|@translate}";
-  ec_JS_message['ec_submit_user_miss']   = "{'ec_submit_user_miss'|@translate}";
-  ec_JS_message['ec_submit_action_miss'] = "{'ec_submit_action_miss'|@translate}";
-  ec_JS_message['ec_submit_code_bad']    = "{'ec_submit_code_bad'|@translate}";
-  ec_default_action                      = "{$ec_default_action}";
-  ec_default_entry                       = "{$ec_default_entry}";
-  ec_auto_code_digits_nb                 = "{$ec_def_auto_code_dg_nb}";
-  {foreach from=$ec_lists.duplicable_codes.ids key=ec_key item=ec_val}
-    ec_duplic_codes[{$ec_key}] = {$ec_val};
-  {/foreach}
+  ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
+  ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
+  ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_cat_miss']        = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_img_miss']        = "{'ec_act_img_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_new_pwd_gen']         = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_entry_miss']      = "{'ec_act_entry_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_confirm_del_other']   = "{'ec_confirm_del_other'|@translate|@escape:javascript}";
+  ec_JS_message['ec_up_code_lbl_home']    = "{'ec_up_code_lbl_home'|@translate}";
+  ec_JS_message['ec_submit_code_miss']    = "{'ec_submit_code_miss'|@translate}";
+  ec_JS_message['ec_submit_user_miss']    = "{'ec_submit_user_miss'|@translate}";
+  ec_JS_message['ec_submit_action_miss']  = "{'ec_submit_action_miss'|@translate}";
+  ec_JS_message['ec_submit_code_bad']     = "{'ec_submit_code_bad'|@translate}";
+  ec_default_action                       = "{$ec_default_action}";
+  ec_default_entry                        = "{$ec_default_entry}";
+  ec_auto_code_digits_nb                  = "{$ec_def_auto_code_dg_nb}";
+  {if $ec_is_creation}
+    {foreach from=$ec_lists.duplicable_codes.ids key=ec_key item=ec_val}
+      ec_duplic_codes[{$ec_key}] = {$ec_val};
+    {/foreach}
+  {else}
+    {foreach from=$ec_lists.ec_table item=ec_val}
+      ec_lists['user_id']['{$ec_val.id}'] = "{$ec_val.user_id}";
+      ec_lists['action']['{$ec_val.id}']  = "{$ec_val.action}";
+      ec_lists['arg1']['{$ec_val.id}']    = "{$ec_val.arg1}";
+      ec_lists['arg2']['{$ec_val.id}']    = "{$ec_val.arg2}";
+      ec_lists['forced']['{$ec_val.id}']  = "{$ec_val.forced}";
+    {/foreach}
+  {/if}
   ec_init();
 //--></script>
