/* *** ATENÇÃO ***
Os códigos fontes apresentados neste website,
são de propriedade intelectual da Locomotiv em co-autoria com a PS estúdio.
A cópia integral ou parcial desta obra resultará em penas previstas na lei nº9610 de proteção aos direitos autorais */

function ajaxInit() {
var req;

try {
 req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
 try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
 } catch(ex) {
  try {
   req = new XMLHttpRequest();
  } catch(exc) {
   alert("Esse browser não tem recursos para uso do Ajax");
   req = null;
  }
 }
}

return req;
}
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=[]
ifila=0
function ajaxHTML(id,url){
    document.getElementById(id).innerHTML="<p>"+
                                          "Carregando...</p>"
    fila[fila.length]=[id,url]
    if((ifila+1)==fila.length)ajaxRun()
}

function ajaxRun(){
    xmlhttp.open("GET",fila[ifila][1],true);
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            retorno=unescape(xmlhttp.responseText.replace(/\+/g," "))
            document.getElementById(fila[ifila][0]).innerHTML=retorno
            ifila++
            if(ifila<fila.length)setTimeout("ajaxRun()",20)
        }
    }	
    xmlhttp.send(null)
}
