function getHTTPObject() {
var xmlhttp;

try {
 if (window.XMLHttpRequest) {
  xmlhttp = new XMLHttpRequest();

  if (xmlhttp.readyState == null) {
   xmlhttp.readyState = 1;
   xmlhttp.addEventListener("load", function () {
   xmlhttp.readyState = 4;

   if (typeof xmlhttp.onReadyStateChange == "function")
    xmlhttp.onReadyStateChange();
   }, false);
  }

  return xmlhttp;
 }

 if (window.ActiveXObject) {
  var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];

  for (var i = 0; i < prefixes.length; i++) {
   try {
    xmlhttp = new ActiveXObject(prefixes[i] + ".XmlHttp");
    return xmlhttp;
   } catch (ex) {};
  }
 }
} catch (ex) {}

// alert("Não foi encontrado ActiveXObject em seu navegado.\nCaso tenha dificuldade em visualizar o site, entre em contato com a central de atendimento");
}

var xmlhttp = getHTTPObject();

function envia_dados( site, string, local ){

    //Exibe mouse de espera
	document.getElementById(local).style.cursor = "wait";

    //Abre a url
    xmlhttp.open("GET", site + string, true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto = xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            // texto=unescape(texto)

            //Exibe o texto no div conteúdo
			if (local != ''){
	            var conteudo=document.getElementById(local)
				document.getElementById(local).style.cursor = "default";
    	        conteudo.innerHTML = texto;
			}
        }
    }
    xmlhttp.send(null)
}

function pop_up(URL,nome,formato){
	window.open(URL,nome,formato)
}