/*AJAX*/
var xmlhttp
var id
function carregar(arquivo,identificador)
{
id = identificador;

//exibe a mensagem carregando
var loading=document.getElementById(identificador)
    loading.innerHTML='<div class="carregando">Carregando...</div>'

// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  xmlhttp.onreadystatechange=xmlhttpChange
  xmlhttp.open("GET",arquivo,true)
  xmlhttp.send(null)
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=xmlhttpChange
    xmlhttp.open("GET",arquivo,true)
    xmlhttp.send()
    }
  }
}

function xmlhttpChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
  {
  var resultado;
  resultado = xmlhttp.responseText;
  resultado = resultado.replace(/\+/g,' '); //substitui o + por um espaço
  /*resultado = unescape(resultado); //desfaz a função urlencode */
  document.getElementById(id).innerHTML=resultado;
  }
  else
  {
  alert("Problem retrieving data:" + xmlhttp.statusText)
  }
  }
}


