function webServ_telform(tel, urlDom)
{
//value_session_telform = document.create_account.session_telform.value;
        // The full path to the proxy
        var url = urlDom + '&Tel='+tel;
		//var url = urlDom;
        // Create xmlhttprequest object
        var xmlhttp = null;
        if (window.XMLHttpRequest) {
                xmlhttp = new XMLHttpRequest();
                //make sure that Browser supports overrideMimeType
                if ( typeof xmlhttp.overrideMimeType != 'undefined') { xmlhttp.overrideMimeType('text/xml'); }
        } else if (window.ActiveXObject) {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }  else {
                alert('Perhaps your browser does not support xmlhttprequests?');
        }
        // Create an HTTP GET request
        xmlhttp.open('GET', url, true);


        // Set the callback function
        xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4) {
              var valSplit = xmlhttp.responseText.split('#');
              //alert(valSplit[0]);
              if (valSplit[0] == '1') {
                  document.getElementById("msg_telform").style.display = "block";
            	  //Nom : simple textbox
            	  $('#'+form_nom)[0].value = valSplit[2];
            	  //Prénom : simple textbox
            	  $('#'+form_prenom)[0].value = valSplit[3];
            	  //Raison Sociale
            	  $('#'+form_societe)[0].value = valSplit[4];

				  var regExpBeginning = /^\s+/;
				  var regExpEnd = /\s+$/; 
				  var adresse = valSplit[7] + ' ' + valSplit[8] + ' ' + valSplit[6] + ' ' + valSplit[9] + "\n" + valSplit[10] + ' ' + valSplit[11] + ' ' + valSplit[12];
            	  $('#'+form_adresse)[0].value = adresse.replace(regExpBeginning, "").replace(regExpEnd, "");

            	  // Le code postal
            	  $('#'+form_cp)[0].value = valSplit[13];
            	  // La ville
            	  $('#'+form_ville)[0].value = valSplit[14];
            	  // Le Pays
            	  //document.create_account.Pays.value = valSplit[15];
            	  // Le telephone
            	   $('#'+form_tel)[0].value = valSplit[16];
            	   // Type utilisateur
            	  //document.create_account.TypeUtilisateur.value = valSplit[17];
            	  // Siret
            	  //document.create_account.Siret.value = valSplit[18];
            	  // NAF
            	  //document.create_account.CodeNaf.value = valSplit[19];
            	  //Sécurité
            	  //document.create_account.Referer.value = valSplit[20];
              }
                }
            };
            // Make the actual request
            xmlhttp.send(null);
}

function validatePhone(phone)
    {
        return phone.replace(/\D/g,"");
    }

function isTel() {
  value_tel = $('#'+tel).value;
  tel = validatePhone(value_tel);
  length_tel = tel.length;
  if ( length_tel >= 10 )
  {
     webServ_telform(tel);
  }
}
