function ajaxInit(){

var xmlhttp;

try{
xmlhttp=new XMLHttpRequest();
}catch(ee){
try{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp=false;
}
}
}

return xmlhttp;
}
function mostrando(valor){
ajax = ajaxInit();
if(valor==1){
	link='mostaetapa.php';
	} else {
	link='naomostaetapa.php';	
		
	}



if(ajax){
ajax.open('GET',link ,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==4){

if(ajax.status==200){


document.getElementById("mostrass").innerHTML=ajax.responseText;

}
}
}
}
ajax.send(null);

}






// mostra ou não estados brasileiros
function mostraestado(valorestado){
ajax = ajaxInit();

if(valorestado==1){
	link='mostaestados.php';
	} else {
	link='naomostaestados.php';	
		
	}

if(ajax){
ajax.open('GET',link ,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==4){

if(ajax.status==200){


document.getElementById("mostrandoestados").innerHTML=ajax.responseText;

}
}
}
}
ajax.send(null);

}




// mostra ou não cidades1
function mostracidades1(valor){
ajax = ajaxInit();


	link='mostracidades1.php?estado='+valor;	


if(ajax){
ajax.open('GET',link ,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==4){

if(ajax.status==200){


document.getElementById("divcidade").innerHTML=ajax.responseText;

}
}
}
}
ajax.send(null);

}

// mostra cpf cadastrado no sistema
function cpfcadastrastra(){
ajax = ajaxInit();

link='cpfcadastrastra.php?buscando='+document.getElementById("cpf").value;

if(ajax){
ajax.open('GET',link ,true);
ajax.onreadystatechange=function(){
if(ajax.readyState==4){

if(ajax.status==200){


document.getElementById("mostracpf").innerHTML=ajax.responseText;

}
}
}
}
ajax.send(null);

}

