var Ajax = false;

//Função: Identificar o Componente
function AjaxRequest()
{
    Ajax = false;
    if(window.XMLHttpRequest) // mozilla
    {
        Ajax = new XMLHttpRequest();
    }
    else if(window.ActiveXObject) // ie
    {
        try
        {
            Ajax = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
            try
            {
                Ajax = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e)
            {}
        }
    }
}

//Função: Requisição do Ajax
function ExeAjax(pagina,local)
{
	document.getElementById(local).innerHTML = '<img src=img/ajaxloader.gif border=0>';
    AjaxRequest();
	Ajax.onreadystatechange = function(){
		if(Ajax.readyState==4)
		{
			if(Ajax.status==200)
			{ 
				if(local != ''){
					document.getElementById(local).innerHTML = Ajax.responseText;
				}
			}
		}
	};
    Ajax.open('GET', pagina, true);
	Ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	Ajax.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
	Ajax.setRequestHeader("Pragma", "no-cache");
    Ajax.send(null);
}