+function prepareType(i)
+{
+ fillType(document.forms.prof_annu["edus[" + i + "][degreeid]"], document.forms.prof_annu["edus[" + i + "][eduid]"].selectedIndex - 1);
+ selectType(document.forms.prof_annu["edus[" + i + "][degreeid]"], document.forms.prof_annu["edu_" + i + "_tmp"].value);
+}
+
+function addSearchName()
+{
+ var i = 0;
+ while (document.getElementById('search_name_' + i) != null) {
+ i++;
+ }
+ $('#add_search_name').before('<div id="search_name_' + i + '" style="padding:2px" class="center"></div>');
+ Ajax.update_html('search_name_' + i, 'profile/ajax/searchname/' + i,function(){
+ $('#search_name_'+i+' input')[1].focus();
+ });
+}
+
+function removeSearchName(i)
+{
+ if (document.getElementById('search_name_'+i+'_new') != null) {
+ $('#search_name_'+i).remove();
+ } else {
+ removeObject('search_name_'+i, 'search_name['+i+']');
+ }
+}
+
+function delNationality(i)
+{
+ $('#nationalite' + i).hide().find('select').val('');
+}
+
+function addNationality()
+{
+ var i = 0;
+ if ($('#nationalite2').find('select').val() == "") {
+ i = 2;
+ } else if ($('#nationalite3').find('select').val() == "") {
+ i = 3;
+ }
+ if ((i == 2) || (i == 3)) {
+ $('#nationalite' + i).show();
+ }
+}
+
+function addNetworking()
+{
+ var i = 0;
+ var nws = 'networking_';
+ while (document.getElementById(nws + i) != null) {
+ i++;
+ }
+ var namefirst = '';
+ var html = '<tr id="networking_' + i + '">'
+ + ' <td colspan="2">'
+ + ' <div style="float: left; width: 200px;">'
+ + ' <span class="flags">'
+ + ' <input type="checkbox" name="networking[' + i + '][pub]"/>'
+ + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
+ + ' </span> '
+ + ' <select id="networking_type_' + i + '" name="networking[' + i + '][type]" onchange="javascript:updateNetworking(' + i + ');">';
+ for (nw in nw_list) {
+ if (namefirst == '') {
+ namefirst = nw;
+ }
+ html += ' <option value="' + nw_list[nw] + '">' + nw + '</option>';
+ }
+ html += '</select>'
+ + ' <input type="hidden" id="networking_name_' + i + '" name="networking[' + i + '][name]" value="' + namefirst + '"/>'
+ + ' </div>'
+ + ' <div style="float: left">'
+ + ' <input type="text" name="networking[' + i + '][address]" value="" size="30"/>'
+ + ' <a href="javascript:removeNetworking(' + i + ')">'
+ + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
+ + ' </a>'
+ + ' </div>'
+ + ' </td>'
+ + '</tr>';
+
+ $('#networking').before(html);
+}
+
+function removeNetworking(id)
+{
+ $('#networking_' + id).remove();
+}