var http;
var idControl;
var http2;
var idControl2;

function enviaQuery1(id,archivo,id2,archivo2)
{
http=getXmlHttpObject();
http.open("GET",archivo,true);
http2=getXmlHttpObject2();
http2.open("GET",archivo2,true);
idControl=id;
idControl2=id2;
http.onreadystatechange=handleHttpResponse;
http.send(null);
http2.onreadystatechange=handleHttpResponse2;
http2.send(null);
}
function getXmlHttpObject()
{
	var xmlhttp;
	try
	{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlhttp=new XMLHttpRequest();
			}
			catch(e)
			{
				xmlhttp=false;
				alert('error');
			}
		}
	}
	return xmlhttp;
}

function getXmlHttpObject2()
{
	var xmlhttp;
	try
	{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlhttp=new XMLHttpRequest();
			}
			catch(e)
			{
				xmlhttp=false;
				alert('error');
			}
		}
	}
	return xmlhttp;
}


function handleHttpResponse()
{
	if(http.readyState==1)
	   {
        document.getElementById(idControl).innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class='carga'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cargando...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>";
        //modificamos el estilo de la div, mostrando una imagen de fondo
         document.getElementById(idControl).style.background = "url('../images/loading.gif') no-repeat"; 
		}
	else
		if(http.readyState==4)
		{
			results=http.responseText;
			document.getElementById(idControl).style.background = "url('') no-repeat"; 
			document.getElementById(idControl).innerHTML=results;
		}
}


function handleHttpResponse2()
{
	if(http2.readyState==1)
	   {
        document.getElementById(idControl2).innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cargando...";
        //modificamos el estilo de la div, mostrando una imagen de fondo
         document.getElementById(idControl2).style.background = "url('../images/loading.gif') no-repeat"; 
		}
	else
		if(http2.readyState==4)
		{
			results=http2.responseText;
			document.getElementById(idControl2).style.background = "url('') no-repeat"; 
			document.getElementById(idControl2).innerHTML=results;
		}
}
