
function criaXMLHttpRequest()
{
var XMLHTTPREQUEST_IE = new Array(
  "Msxml2.XMLHTTP.6.0",
  "Msxml2.XMLHTTP.5.0",
  "Msxml2.XMLHTTP.4.0",
  "Msxml2.XMLHTTP.3.0",
  "Msxml2.XMLHTTP",
  "Microsoft.XMLHTTP"
);
  var oXMLhttp = null;

  // Cria o HttpRequest para o respectivo navegador.
  if (window.XMLHttpRequest != null)
    oXMLhttp = new window.XMLHttpRequest();
  else if (window.ActiveXObject != null)
  {
    // Percorre no IE a procura do objeto ActiveX na biblioteca mais recente
    var bCriado = false;
    for (var ind = 0;
         ind < XMLHTTPREQUEST_IE.length && ! bCriado; ind++)		
    {
      try
      {
        oXMLhttp = new ActiveXObject(XMLHTTPREQUEST_IE[ind]);
        bCriado = true;
      }
      catch (ex)
      {}
    }
  }

  // Tratamento de erro caso não encontre nenhum.
  if (oXMLhttp == null)
    alert("Falha no HttpRequest():\n\n"
      + "Objeto XMLHttpRequest não foi criado.");

  // Retorna o objeto instanciado ou não
  return oXMLhttp;
}

//#########################################################################



function requisicao(){
   if(window.XMLHttpRequest){
      req = new XMLHttpRequest();
   }else if(window.ActiveXObject){
      req = new ActiveXObject("Microsoft.XMLHTTP");
   }

   return req;
}

function atualiza(nome_div,url){
   document.getElementById(nome_div).innerHTML = "<BR><BR><BR><BR><BR><BR><BR><BR><BR><p align=center><b><font face=Verdana><font color=#006699 size=4>Carregando...</font></font></b></p><p align=center><img src=images/carregan.gif></p>";
   req = requisicao();
   req.open("GET", url, true);
   req.onreadystatechange = function(){
       if(req.readyState == 4){
           if(req.status == 200){
            var texto = req.responseText
            document.getElementById(nome_div).innerHTML = texto
           }
       }
   }
   req.send(null);
}


function mostra(pri,sec) {
var d = document.getElementById(pri);
var f = document.getElementById(sec);
if (d.style.display=='none') {
 d.style.display='';
 f.src='images/browser_omniweb.png';
} else {
 d.style.display='none'
 f.src='images/browser_omniweb.png'
}
}




