function pre_ajout_pays() {
	document.getElementById("nouveau_pays").style.display="block";
	document.getElementById("nouveau_pays_nom").focus();	
}

function ajout_pays()
{ 
    var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
     }
 
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) 
			{
				
				/*var retour = xhr.responseText.split("%");
			
				
				for (var i=0;i<1000;i++) {
					if ((document.getElementById('sel_ct_local2'+i))&&(retour[1]!='')) {
						var j = document.getElementById('sel_ct_local2'+i).options.length;
						var z = document.getElementById('nouveau_pays_nom').value;
						document.getElementById('sel_ct_local2'+i).options[j] = new Option(retour[1],retour[1]);
					}	
					
				//document.getElementById('nouveau_pays').innerHMTL += "=> "; 
				
				
				}*/
				window.location.reload();
			}
         }
    }; 
    
    var pays_nom = document.getElementById('nouveau_pays_nom').value;
    pays_nom = pays_nom.replace("'","%");
    var gde_zone = document.getElementById('gde_zone').value;

   xhr.open( "POST", "ajout_pays.php",  true); 
    xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
   xhr.send("pays_nom="+pays_nom+"&gde_zone="+gde_zone); 
} 