<!-------------------------------------------------------------------------------------------------->
<!-- Funciones para manejo de Ajax. ---------------------------------------------------------------->
<!-- Allan Naranjo R. ------------------------------------------------------------------------------>
<!-- 2006-07-04 ------------------------------------------------------------------------------------>
<!-------------------------------------------------------------------------------------------------->
  function SetContainerHTML(id,html,processScripts) {
    mydiv = document.getElementById(id);
    mydiv.innerHTML = html;
    if(processScripts!=false) {
      var elementos = mydiv.getElementsByTagName('script');
	  var ii = 0;
      for(ii=0;ii<elementos.length;ii++) {
        var elemento = elementos[ii];
        nuevoScript = document.createElement('script');
        nuevoScript.text = elemento.innerHTML;
        nuevoScript.type = 'text/javascript';
        if(elemento.src!=null && elemento.src.length>0) {
		  nuevoScript.src = elemento.src;
	    }
        elemento.parentNode.replaceChild(nuevoScript,elemento);
      }
    }
  }
<!-------------------------------------------------------------------------------------------------->
<!-- Funciones para manejo de Ajax. ---------------------------------------------------------------->
<!-- Allan Naranjo R. ------------------------------------------------------------------------------>
<!-- 2006-07-04 ------------------------------------------------------------------------------------>
<!-------------------------------------------------------------------------------------------------->
  function xmlhttp_get(area,pagina,parametros) {
	var resultado = '';
	var v_tipo = '';
    if (pagina=="") {
	  alert("Debe indicar la pagina que será llamada...");
	  return false;
	}
	if (parametros=="") {
	  enviar = null;
	} else {
	  enviar = "?" + parametros;
	}
    var xmlhttp=false;
    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
      // JScript gives us Conditional compilation, we can cope with old IE versions.
      // and security blocked creation of the objects.
      try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
        try {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
          xmlhttp = false;
        }
      }
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	  try {
		xmlhttp = new XMLHttpRequest();
	  } catch (e) {
		xmlhttp=false;
	  }
    }
    if (!xmlhttp && window.createRequest) {
	  try {
	    xmlhttp = window.createRequest();
	  } catch (e) {
        xmlhttp=false;
	  }
    }
	if (area=='') {
      v_tipo = false;
	} else {
      v_tipo = true;
	}
	xmlhttp.open("GET", pagina+enviar, v_tipo);
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
        if (xmlhttp.status==200) {
	      if (area=='') {
			resultado = xmlhttp.responseText;
		  } else {
	        SetContainerHTML(area, xmlhttp.responseText, true);
		  }
        } else
		  if (xmlhttp.status==404)
		    alert("La página solicitada no existe: "+pagina)
          else
		    alert("Status is "+xmlhttp.status)
      }
    }
	xmlhttp.send(null);
	return resultado;
  }
<!-------------------------------------------------------------------------------------------------->
<!-- Ejecuta buscador ------------------------------------------------------------------------------>
<!-------------------------------------------------------------------------------------------------->
  function f_datos() {
    map.clearOverlays() 
	var chk = 0;
    for (i=0;i<document.form_buscador.tipo_anuncio.length;i++) {
	  if (document.form_buscador.tipo_anuncio[i].checked) {
	    chk = document.form_buscador.tipo_anuncio[i].value;
	  }
	}
    xmlhttp_get('xmlhttp_datos','prp_cargador.php');
    xmlhttp_get('xmlhttp_datos','detalle.php',
	                            'provincia='      + document.form_buscador.provincia.value      + '&' +
	                            'canton='         + document.form_buscador.canton.value         + '&' +
								'precio1='        + document.form_buscador.precio1.value        + '&' +
								'precio2='        + document.form_buscador.precio2.value        + '&' +
	                            'tipo_propiedad=' + document.form_buscador.tipo_propiedad.value + '&' +
	                            'tipo_anuncio='   + chk);
  }
