// JavaScript Document

function pidePagina(idControl,archivo)
{
var http;

    http=getXmlHttpObject();
    http.open("GET",archivo,true);
    http.onreadystatechange=function(){ handleHttpResponse(http,idControl) };
    http.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 handleHttpResponse(http2,idControl2)
{
    if (http2.readyState == 4 )
    {
        results = http2.responseText;
		if(idControl2){
			document.getElementById(idControl2).innerHTML = results;
		}
    }
	else
	{
		if(idControl2){
			document.getElementById(idControl2).innerHTML = "Cargando...";
		}
	}
}





