<!--
/*
<script src="/js/xml.js" type="text/javascript"></script>
<script type="text/javascript">

var ejemplo;
function xml_procesa_ejemplo() { xml_procesa('ejemplo'); }

function xml_devuelve_ejemplo(valor)
{
	document.getElementById(div_id).innerHTML = valor;
}
function xml_cargando_ejemplo()
{
	document.getElementById(div_id).innerHTML = '<div class="cargando">cargando...</div>';
}
xml_leer('archivo.php', 'ejemplo');
</script>

**********************************************
******** DESARROLLADO POR SRTK.COM ***********
**********************************************
*/

function xml_error(mensaje)
{
	alert('Error: ' + mensaje);
}
function xml_leer(url, nombre_variable, metodo) {
	if (metodo != 'POST') metodo = 'GET';
	var cadena;
	cadena = 'xml_cargando_'+nombre_variable+'(); if (window.XMLHttpRequest) { '+nombre_variable+' = new XMLHttpRequest(); '+nombre_variable+'.onreadystatechange = xml_procesa_'+nombre_variable+'; '+nombre_variable+'.open("'+metodo+'", url, true); ';
	if (metodo == 'POST') cadena = cadena + nombre_variable + '.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ';
	cadena = cadena + nombre_variable+'.send(null);     } else if (window.ActiveXObject) { isIE = true; try { '+nombre_variable+' = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { '+nombre_variable+' = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { '+nombre_variable+' = false; } } if ('+nombre_variable+') { '+nombre_variable+'.onreadystatechange = xml_procesa_'+nombre_variable+'; '+nombre_variable+'.open("GET", url, true); '+nombre_variable+'.send(); } } ';
	eval(cadena);
}

function xml_procesa(nombre_variable)
{
    eval('if ('+nombre_variable+'.readyState==4) { if ('+nombre_variable+'.status==200) { muestraDocumento(nombre_variable); }  else { xml_error("Problemas para cargar el documento solicitado:" + '+nombre_variable+'.statusText); } } ');
}

function muestraDocumento(nombre_variable)
{
	eval('var doc = '+nombre_variable+'.responseText; xml_devuelve_'+nombre_variable+'(doc);');
}
-->






