Merge branch 'platal-0.10.0'
[platal.git] / htdocs / javascript / profile.js
index 4c7d01f..067845a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -47,7 +47,7 @@ function wizPage_onLoad(id)
             updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']',
                              document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value);
         }
-        registerEnterpriseAutocomplete(-1);
+        setTimeout('registerEnterpriseAutocomplete(-1)', 100);
         break;
     }
 }
@@ -189,8 +189,7 @@ function validGeoloc(id, pref)
     document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
     document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
     document.forms.prof_annu[pref + "[cityid]"].value = document.forms.prof_annu[pref + "[geoloc_cityid]"].value;
-    attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
-                function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+    $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
     document.forms.prof_annu[pref + "[text]"].className = '';
 }
 
@@ -200,8 +199,7 @@ function validAddress(id, pref)
     document.getElementById(id + '_geoloc_error').style.display = 'none';
     document.getElementById(id + '_geoloc_valid').style.display = 'none';
     document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
-    attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
-                function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+    $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
     document.forms.prof_annu[pref + "[text]"].className = '';
 }
 
@@ -465,7 +463,7 @@ function updateSecteur()
           +  '  <img src="images/icons/add.gif" alt="" title="Ajouter ce secteur" />'
           +  '</a>' + data;
           document.getElementById('ss_secteur_sel').innerHTML = data;
-          attachEvent(document.forms.prof_annu['jobs[-1][ss_secteur]'], 'change', updateSSecteur);
+          $(document.forms.prof_annu['jobs[-1][ss_secteur]']).change(updateSSecteur);
           });
 }