//Tenta criar o objeto xmlHTTP
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function ajaxHTML(id,url){

    //Obtém o objeto HTML
    objetoHTML=document.getElementById(id)

    //Exibe "Carregando..."
    objetoHTML.innerHTML="<br><br><br><br><br><br><center><img src='img/carregando.gif'/></center>"

    //Abre a conexão
    xmlhttp.open("GET",url);

    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra o HTML recebido
            retorno=unescape(xmlhttp.responseText.replace(/\+/g," "))
            objetoHTML.innerHTML=retorno
        }
    }

    //Executa
    xmlhttp.send(null)
}
