function openAjax() {
	var ajax;
	try {
		ajax = new XMLHttpRequest();
	} catch(ee) {
		try {
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				ajax = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(E) {
				ajax = false;
			}
		}
	}
	return ajax;
}


function integracao(tipo) {
	var ajax = openAjax(); // ajax (pode ser qualquer variavel)
	
	ajax.open ('Get','busc_integracao.php?tipos='+ tipo, true); 	
	ajax.onreadystatechange = function () {		
		var conteudo = document.getElementById('apre_integracao');		
		//andamento
		if (ajax.readyState == 1) {
			// Hora atual
			conteudo.innerHTML='Carregando ...';			
		}//if		
		//verifica o status da aquisição no caso 4 é completa
		if (ajax.readyState == 4){
			conteudo.innerHTML='CARREGADO !!!';		
			//verifica o codigo http enviado pelo servidor web no caso 200 = ok
			if (ajax.status == 200){			
				//conteudo.innerHTML='Pagina encontrada';
			document.getElementById('apre_integracao').innerHTML=ajax.responseText;			
			}//if		
		}//if	
	}// ajax
	ajax.send(null);
}//function fo_pag
