function criaCarregando(){

	var carregando 	= document.getElementById('carregando');
		carregando.style.display = 'block';
		document.getElementById('baseConteudo').style.display = 'none';
}

function destroiCarregando(){

	var carregando 	= document.getElementById('carregando');
		carregando.style.display = 'none';
		document.getElementById('baseConteudo').style.display = 'block';
}
	
	
var http = createRequestObject();

	function createRequestObject() {
		var xmlhttp;
		
		try { 
			
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
		}
		
		catch(e) {
	    
			try { 
			
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			catch(f) { 
			
				xmlhttp=null;
			}
	  	}
		
		if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
			
			xmlhttp=new XMLHttpRequest();
		}
		
		return  xmlhttp;
	}	
	


  function carregaPagina(url) {
	var url = url;		
  	var loading;

	try{
		http.open('GET', url, true);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		
			criaCarregando();
			http.onreadystatechange = respostaPagina;
		
		http.send(null);
	}
	 
  	catch(e){}
  	finally{}
	
  }

  function respostaPagina() {
	try{
		if((http.readyState == 4) && (http.status == 200)){
			 
			var response = http.responseText;
			var area = 'baseConteudo';
			
				document.getElementById(area).innerHTML = response;
				destroiCarregando();
				 teste();
				
			  }
			 
		 }
	 
		catch(e){
			alert('Erro de requisição!');
		}
		
		finally{}
  }
