<!-------------------------------------------------------------------------------------------------->
<!-- 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_datos1() {
  xmlhttp_get('xmlhttp_datos','carrusel1.html');
  }
   function f_datos2() {
  xmlhttp_get('xmlhttp_datos','carrusel2.html');
  }
   function f_datos3() {
    xmlhttp_get('xmlhttp_datos','carrusel3.html');
  }
   function f_datos4() {
    xmlhttp_get('xmlhttp_datos','carrusel4.html');
  }
   