// Documento JavaScript
// Esta función cargará las paginas
function getXMLObject(url,id_contenido) //XML OBJECT
{
	var xmlHttp = false;
	try
	{
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP") // For Old Microsoft Browsers
	}
		catch (E)
		{
			try
			{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP") // For Microsoft IE 6.0+
			}
					catch (e2)
					{
						xmlHttp = false // No Browser accepts the XMLHTTP Object then false
					}
		}
			if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
			{
				xmlHttp = new XMLHttpRequest(); //For Mozilla, Opera Browsers
			}
//return xmlHttp; // Mandatory Statement returning the ajax object created
//} 

    xmlHttp.onreadystatechange = function ()
    {
        // función de respuesta
        cargarpagina (xmlHttp,id_contenido);
    }
    xmlHttp.open ('GET', url, true); // asignamos los métodos open y send
    xmlHttp.send (null);
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina (xmlHttp,id_contenido)
{
	
    if (xmlHttp.readyState == 4 )
    document.getElementById (id_contenido).innerHTML = xmlHttp.responseText;

}

