// JavaScript Document

function nuevoAjax() {
	
    var xmlhttp;


      if (window.XMLHttpRequest)
    {
        // Si es Mozilla, Safari etc
        xmlhttp = new XMLHttpRequest ();
    } else if (window.ActiveXObject)
    {
        // pero si es IE
        try 
        {
            xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            // en caso que sea una versión antigua
            try
            {
                xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
        }
    } 

    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

function cargarLoader(){
	var loader = '<table width="95%"  align="center" cellpadding="0" cellspacing="0"><tr> <td class="txt-blanco">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="plantillas/principal/imagenes/cargando.gif" width="28" align="middle" />&nbsp;&nbsp;&nbsp;CARGANDO...</td></tr></table>';
	document.getElementById("loader").innerHTML = loader;
	document.getElementById("loader").style.position = "absolute";
	document.getElementById("loader").style.left = "350px";
	document.getElementById("loader").style.top = "400px";
	document.getElementById("loader").style.width = "289px";
	document.getElementById("loader").style.height = "54px";
}

function descargarLoader(){
	var loader = '';
	document.getElementById("loader").innerHTML = loader;
	document.getElementById("loader").style.position = "absolute";
	document.getElementById("loader").style.left = "0";
	document.getElementById("loader").style.top = "0";
	document.getElementById("loader").style.width = "0";
	document.getElementById("loader").style.height = "0";
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = nuevoAjax(); // Creamos el objeto XMLHttpRequest



