function fsWrite(psId, psText)
{
	var lsTxt;
	if (document.getElementById)
	{
		x = document.getElementById(psId);
		lsTxt = x.innerHTML;
		x.innerHTML = '';
		x.innerHTML = psText;
	}
	else if (document.all)
	{
		x = document.all[psId];
		lsTxt = x.innerHTML;
		x.innerHTML = psText;
	}
	else if (document.layers)
	{
		x = document.layers[psId];
		text2 = '<P CLASS="testclass">' + psText + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
	return lsTxt;
}

function fvHandleHttpResponse() { 
    if (goHttp.readyState == 4) { 
       if (goHttp.status == 200) { 
          if (goHttp.responseText.indexOf('invalid') == -1) {
			  if (giOlder == -1) {
			  	giOlder = fsWrite(gsDivAjax, goHttp.responseText);
			  } else {
				fsWrite(gsDivAjax, goHttp.responseText);
			  }
             gbEnProceso = false;
          }
       }
    }
}

function getHTTPObject() {
    var loXmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
       try {
          loXmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          try {
             loXmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) { loXmlhttp = false; }
       }
    @else
    loXmlhttp = false;
    @end @*/
    if (!loXmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          loXmlhttp = new XMLHttpRequest();
       } catch (e) { alert("error"); loXmlhttp = false; }
    }
    return loXmlhttp;
}

var gbEnProceso = false; // lo usamos para ver si hay un proceso activo
var giOlder = -1;
var goHttp = getHTTPObject(); // Creamos el objeto XMLHttpRequest
var gsDivAjax =  '';
