Geoloc and other fixes
[platal.git] / templates / profile / adresses.tpl
index 833d716..9d6f176 100644 (file)
@@ -107,6 +107,29 @@ function addTel(id)
   Ajax.update_html(tel + i, 'profile/ajax/tel/' + id + '/' + i);
 }
 
+function validGeoloc(id, pref)
+{
+  document.getElementById(id + '_geoloc').style.display = 'none';
+  document.getElementById(id + '_geoloc_error').style.display = 'none';
+  document.getElementById(id + '_geoloc_valid').style.display = 'none';
+  document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
+  document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
+  attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
+              function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+  document.forms.prof_annu[pref + "[text]"].className = '';
+}
+
+function validAddress(id, pref)
+{
+  document.getElementById(id + '_geoloc').style.display = 'none';
+  document.getElementById(id + '_geoloc_error').style.display = 'none';
+  document.getElementById(id + '_geoloc_valid').style.display = 'none';
+  document.forms.prof_annu[pref + "[parsevalid]"].value = "0";
+  attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
+              function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+  document.forms.prof_annu[pref + "[text]"].className = '';
+}
+
 {/literal}
 //]]></script>
 
@@ -116,7 +139,7 @@ function addTel(id)
 </div>
 {/foreach}
 {if $addresses|@count eq 0}
-<div id="addresses_0">
+<div id="addresses_0_cont">
 {include file="profile/adresses.address.tpl" i=0 adr=0}
 </div>
 {/if}