OpenAjax = function (){   
    try{   
        xmlhttp = new XMLHttpRequest();   
    }catch(ee){   
        try{   
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");   
        }catch(e){   
            try{   
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");   
            }catch(E){   
                xmlhttp = false;   
            }   
        }   
    }   
}  

//Fila de conexões
fila=[]
ifila=0

//Carrega via XMLHTTP a url recebida e coloca seu valor
//no objeto com o id recebido
function ajaxGet(url,id){
    //Carregando...
    //document.getElementById(id).innerHTML="<span class='carregando'>Carregando...</span>"
    //Adiciona à fila
    fila[fila.length]=[id,url + "?rnd" + Math.random()]
    //Se não há conexões pendentes, executa
    if((ifila+1)==fila.length)ajaxHTML()
}

ajaxHTML = function(){   
  
    //divInsereResposta = document.getElementById( divRetorno );   
       
    OpenAjax(); 
    xmlhttp.abort();   
    xmlhttp.open("GET", fila[ifila][1] ,true);   
    //+"&rnd"+ Math.random()
    //xmlhttp.setRequestHeader("Content-Type", "text/html; charset=iso-8859-1");   
    xmlhttp.onreadystatechange = function() {  
    		
            if( xmlhttp.readyState == 4 ){   

					//var valorRetorno            = xmlhttp.responseText;   
                	//divInsereResposta.innerHTML = valorRetorno; 
					
					retorno=unescape(xmlhttp.responseText.replace(/\+/g," "))
					document.getElementById(fila[ifila][0]).innerHTML=retorno
					
					ifila++
		            if(ifila<fila.length)setTimeout("ajaxHTML()",20)

            }   
    }   
    //loading(false, divRetorno);
    xmlhttp.send( null );   
  
}  