function CodLocalidad()
{ 
var localidad,localidad1;
try
{
ajax3 = new XMLHttpRequest();
}
catch (error)
{
try
{
ajax3 = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (error)
{
ajax3 = null;
return false;
}
}         
ajax3.open("GET", "/codlocalidad_process.php?id_provincia=" + document.getElementById('formavanzada').provincia.value);
ajax3.onreadystatechange=function(){
if (ajax3.readyState==4) {       
localidad=ajax3.responseText;	 
localidad=localidad.replace(" ", "");
DatosZonaPostal(localidad);
} 
}
ajax3.send("");
}
function CaracProv()
{
try
{
ajax4 = new XMLHttpRequest();
}
catch (error)
{
try
{
ajax4 = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (error)
{
ajax4 = null;
return false;
}
}         
ajax4.open("GET", "/caracprov_process.php?id_provincia=" + document.getElementById('formavanzada').provincia.value);
ajax4.onreadystatechange=function() {
if (ajax4.readyState==4)
{
document.getElementById('Caracprov_select_cell').innerHTML =ajax4.responseText;
} 
}
ajax4.send("");	
}
function DatosLocalidad()
{
try
{
ajax = new XMLHttpRequest();
}
catch (error)
{
try
{
ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (error)
{
ajax = null;
return false;
}
}     
ajax.open("GET", "/localidad_avanzada.php?id_provincia=" + document.getElementById('formavanzada').provincia.value);
ajax.onreadystatechange=function(){ 
if (ajax.readyState==4){     
document.getElementById('Localidad_select_cell').innerHTML =ajax.responseText;     
}
}
ajax.send(null);
}
function ChangeProvincia(id_provincia)
{
DatosLocalidad();
CodLocalidad(); 
CaracProv();
}
function ChangeLocalidad(localidad)
{
DatosZonaPostal(localidad);
}
function DatosZonaPostal(cod_municipio)
{
try
{
ajax1 = new XMLHttpRequest();
}
catch (error)
{
try
{
ajax1 = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (error)
{
ajax1 = null;
return false;
}
}
ajax1.open("GET", "/zonapostal_avanzada.php?id_provincia=" + document.getElementById('formavanzada').provincia.value + "&id_municipio=" + cod_municipio);
ajax1.onreadystatechange=function(){
if (ajax1.readyState==4){
document.getElementById('ZonaPostal_select_cell').innerHTML =ajax1.responseText;           
}
}
ajax1.send(null);
}
