var READY_STATE_COMPLETE=4;
var peticion_http = null;
function inicializa_xhr() {
  if (window.XMLHttpRequest) {
    return new XMLHttpRequest(); 
  } else if (window.ActiveXObject) {
    return new ActiveXObject("Microsoft.XMLHTTP");}}
function CallProcess(aUrl,aXmlParams){
 peticion_http = inicializa_xhr();
 if(peticion_http) {
  peticion_http.onreadystatechange = procesaRespuesta;
  peticion_http.open("POST", aUrl, true);
  peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  peticion_http.send(aXmlParams);}}
function procesaRespuesta() {
 if(peticion_http.readyState == READY_STATE_COMPLETE){
  if (peticion_http.status == 200){
   if (peticion_http.responseText != ""){if (peticion_http.responseText == "ok") window.location=window.location; else alert(peticion_http.responseText);}}}}
function getInfo(aUrl,aXmlParams){
 peticion_http = inicializa_xhr();
 if(peticion_http) {
  peticion_http.onreadystatechange = rgetInfo;
  peticion_http.open("POST", aUrl, true);
  peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  peticion_http.send(aXmlParams);}}
function rgetInfo() {
 if(peticion_http.readyState == READY_STATE_COMPLETE){
  if (peticion_http.status == 200){
   if (peticion_http.responseText != ""){if (peticion_http.responseText.indexOf("_Error_") >= 0) alert(peticion_http.responseText); else gestRespuesta(peticion_http.responseText);}}}}
function getInfoXML(aUrl,aXmlParams){
 peticion_http = inicializa_xhr();
 if(peticion_http) {
  peticion_http.onreadystatechange = rgetInfoXML;
  peticion_http.open("POST", aUrl, true);
  peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  peticion_http.send(aXmlParams);}}
function rgetInfoXML() {
 if(peticion_http.readyState == READY_STATE_COMPLETE){
  if (peticion_http.status == 200){
   if (peticion_http.responseText != ""){if (peticion_http.responseText.indexOf("_Error_") >= 0) alert(peticion_http.responseText); else gestXMLRespuesta(peticion_http.responseText);}}}}
function gestXMLRespuesta(Value){
 alert(Value);
 try{
  lDoc=new ActiveXObject("Microsoft.XMLDOM");
  lDoc.async="false";
  lDoc.loadXML(Value);
 }catch(e){
  try{
   parser=new DOMParser();
   lDoc=parser.parseFromString(Value,"text/xml");
  }catch(e){alert("no se puede cargar el contenido");}
 }
 lDoc=lDoc.childNodes[0];
 if (lDoc.childNodes.length > 0){
  for (i = 0; i < lDoc.childNodes.length; i++){
   for (j = 0; j < lDoc.childNodes[i].childNodes.length; j++){
    try{
     alert(lDoc.childNodes[i].childNodes[j].childNodes[0].nodeValue);
     Object(lDoc.childNodes[i].childNodes[j].nodeName).value=lDoc.childNodes[i].childNodes[j].childNodes[0].nodeValue;
    }catch(e){}
   }
  }
 }
}