// Documento JavaScript
// Esta función cargará las paginasfunction 

function getHTTP()
{
if (window.XMLHttpRequest)
    return new XMLHttpRequest ();

else if (window.ActiveXObject)
    {

        try
         {
            return new ActiveXObject ("Msxml2.XMLHTTP");
         }
        catch (e)
        {
            // en caso que sea una versión antigua
            try
            {
                return new ActiveXObject ("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
        }
    }
     else  
	 {
		return null;
	 }
}

// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtmlfunction
function cargarpagina (http,idC){
	
    if (http.readyState == 4 && (http.status == 200 || window.location.href.indexOf ("http") == - 1))
		document.getElementById (idC).innerHTML = http.responseText;
	
}

function getDocument(url,id_contenedor)
{
	var http=getHTTP();
	http.onreadystatechange =function(){
		cargarpagina(http,id_contenedor)
		};	 
    http.open ('GET', url, true);
    http.send (null);
}

function hidekeywords()
{
	document.getElementById("mykeywords").innerHTML ="";
}

function Azar(lmtInfe, lmtSup) 
{
	return Math.floor(Math.random() * (lmtSup- lmtInfe+1) + lmtInfe);
}

function getPromo()
{
	var n=Azar(1,TotalIndexes);
	if (n<1 || n>TotalIndexes)n=1;
	return IndexBase + n + '.htm'
}