function carrega(pagina, target, tipo){
	try{
    xmlhttp = new XMLHttpRequest();
	}catch(ee){
		try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(E){
				xmlhttp = false;
			}
		}
	}
    var conteudo=document.getElementById(target)
   /* if (tipo=='value'){
	  conteudo.value='carregando...'
	}
	else{
	  conteudo.innerHTML='<span align="left" class="tx"><!--<img src="images/loading.gif">-->carregando...</span>'
	}*/
	
	//coisinah de carregando
	document.getElementById('carregando').style.display = "block";
	
    atual=pagina
    xmlhttp.open("GET",pagina,true);
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            var texto=xmlhttp.responseText
			texto=unescape(texto)
            //Exibe o texto no div [target]
            var conteudo=document.getElementById(target)
            if (tipo=='value'){
			  conteudo.value=texto
			}
			else{
			  conteudo.innerHTML=texto
			}
			//coisinah de carregando
			document.getElementById('carregando').style.display = "none";
        }
    }



xmlhttp.send(null)
}

