function ajaxInit() {
var req;
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(ex) {
try {
req = new XMLHttpRequest();
}
catch(exc) {
alert("Esse browser não tem recursos para uso do Ajax");
req = null;
}
}
}
return req;
}
function Mostra(PAGINA) {
ajax = ajaxInit();
if(ajax) {
ajax.open("GET", "ajax.php?Mostra=" + PAGINA, true);
ajax.onreadystatechange = function() {
var dinamico = document.getElementById("AreaCidades");
dinamico.innerHTML="Carregando...";
if(ajax.readyState == 4) {
if(ajax.status == 200) {
var texto=ajax.responseText;
// var dinamico = document.getElementById("dinamico");
dinamico.innerHTML=texto;
}
else {
alert(ajax.statusText);
}
}
}
ajax.send(null);
}
}


if (xmlhttp.status==200)
{ 
respostaServicoSolicitado=xmlhttp.responseText;
//Exibe a resposta do servidor no local desejado
document.getElementById(idDestino).innerHTML=respostaServicoSolicitado;
if (ancora!='')
{
document.location.hash = ancora;
}
}