try{    xmlhttp = new XMLHttpRequest();}catch(ee){    try{        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");    }catch(e){        try{            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");        }catch(E){            xmlhttp = false;        }    }}function query(url){ 	window.scroll(0,0);	load = document.getElementById("transAjax");	load.innerHTML = "";	load.style.backgroundColor = '#fff';	load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		url = url + ".php"	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){	     		load.style.backgroundColor = '#fff';				load.innerHTML = "";		        load.innerHTML = xmlhttp.responseText;			   		    }	}	 xmlhttp.send(null)}function queryContato(codim){ 	window.scroll(0,0);	load = document.getElementById("transAjax");	load.innerHTML = "";	load.style.backgroundColor = '#fff';	load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		url = "contato.php?codim="+codim;	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){	     		load.style.backgroundColor = '#fff';				load.innerHTML = "";		        load.innerHTML = xmlhttp.responseText;			   		    }	}	 xmlhttp.send(null)}function queryd(url,codim){ 	window.scroll(0,0);	load = document.getElementById("transAjax");	load.innerHTML = "";	load.style.backgroundColor = '#fff';	load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		url = url;	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){	     		load.style.backgroundColor = '#fff';				load.innerHTML = "";		        load.innerHTML = xmlhttp.responseText;				//load.innerHTML += "<div id=\"divPfotos\" style=\"border:1px solid #333\"></div>";								//queryfeed()					    }	}	 xmlhttp.send(null)	}function queryfeed(){	qload = document.getElementById("qfeed");    qload.innerHTML = '<center><img src="images/load.gif"><br><br>carregando news...</center>';		url = "feeds/feeds.php";	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        qload.innerHTML = xmlhttp.responseText;				qload.innerHTML += " &nbsp;&nbsp; <a class=\"link\" href=\"javascript:query('feeds/feeds.php?limite=20')\">...mais</a>";	    }	}	 xmlhttp.send(null)}function querywelcome(url){ 	window.scroll(0,0);	load = document.getElementById("transAjax");	load.innerHTML = "";	load.style.backgroundColor = '#fff';	load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		url = url + ".php"	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){	     		load.style.backgroundColor = '#fff';				load.innerHTML = "";		        load.innerHTML = xmlhttp.responseText;				//queryfeed();	    }		  	}	 xmlhttp.send(null)}function printObj(elm,cor){	obj = document.getElementById(elm);	obj.style.backgroundColor = '#ded';}function LoadTipo(){ window.scroll(0,320) div_load_tipo = document.getElementById("div_tipo"); div_load_tipo.innerHTML = "<p>carregando...</p>";  if(document.formbusca.listafins[document.formbusca.listafins.selectedIndex].value == 0){	document.getElementById("div_bairros").innerHTML = "";	document.getElementById("div_cidades").innerHTML = "";	document.getElementById("div_imoveis").innerHTML = "";	document.getElementById("div_tipo").innerHTML = "";    document.getElementById("div_preco").innerHTML = "";		return false;}	document.getElementById("div_bairros").innerHTML = "";	document.getElementById("div_cidades").innerHTML = "";	document.getElementById("div_imoveis").innerHTML = "";	document.getElementById("div_preco").innerHTML = "";		url = "loadtipos.php";	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        div_load_tipo.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)	}function LoadCidade(){   div_load_cidade = document.getElementById("div_cidades");   document.getElementById("div_cidades").innerHTML = "<p>carregando...</p>";   	     		  if(document.formbusca.listatipos[document.formbusca.listatipos.selectedIndex].value == 0){	document.getElementById("div_bairros").innerHTML = "";	document.getElementById("div_cidades").innerHTML = "";	document.getElementById("div_imoveis").innerHTML = "";	document.getElementById("div_preco").innerHTML = "";	//document.getElementById("div_tipo").innerHTML = "";	return false;}	document.getElementById("div_bairros").innerHTML = "";	//document.getElementById("div_cidades").innerHTML = "";	document.getElementById("div_imoveis").innerHTML = "";		url = "loadcidades.php";	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        div_load_cidade.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)	}function LoadBairros(){	document.getElementById("div_imoveis").innerHTML = "";	document.getElementById("div_bairros").innerHTML = "<p>carregando...</p>";	 	div_load_bairro = document.getElementById("div_bairros");	cidade = document.formbusca.listacidades[document.formbusca.listacidades.selectedIndex].value;			if(cidade == 0){	 div_load_bairro.innerHTML ="";	 return false;	 }		url = "loadbairros.php?cidade="+cidade;		xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        div_load_bairro.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)	}function LoadPreco(){	document.getElementById("div_imoveis").innerHTML = "";	document.getElementById("div_preco").innerHTML = "<p>carregando...</p>";	 	div_load_preco = document.getElementById("div_preco");		url = "loadpreco.php";		xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        div_load_preco.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)	}function LoadImoveis(){ 	div_load_imoveis = document.getElementById("div_imoveis");	div_load_imoveis.innerHTML = "<p style=\"font:bold 12px verdana; color:red\"> &nbsp;  &nbsp;  carregando os imóveis da base de dados, por favor aguarde...</p>";		         	div_load_bairro = document.getElementById("div_bairros"); 	cidade = document.formbusca.listacidades[document.formbusca.listacidades.selectedIndex].id; 	cidade_cod = document.formbusca.listacidades[document.formbusca.listacidades.selectedIndex].value;	bairro = document.formbusca.listabairros[document.formbusca.listabairros.selectedIndex].value;	fins   = document.formbusca.listafins[document.formbusca.listafins.selectedIndex].value;	tipo   = document.formbusca.listatipos[document.formbusca.listatipos.selectedIndex].value;	if(bairro == 0 || fins == 0){	 LoadBairros()	 return false;	 }	 	 window.scroll(0,250)	 	nav = navigator.appName;    if(nav == "Microsoft Internet Explorer"){nav = "IE";}else{nav = "NS";}		url = "loadimoveis.php?cidade="+cidade+"&cidade_cod="+cidade_cod+"&bairro="+bairro+"&fins="+fins+"&tipo="+tipo+"&nav="+nav;		xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        div_load_imoveis.innerHTML = xmlhttp.responseText;		        document.news.email.focus();	    }	}	 xmlhttp.send(null)	}resp = "";isflag = 0;function setValueEquente(valor){ resp = valor; }function responderEnquete(){		if(resp == ""){		alert('Por favor, escolha uma resposta!')		isflag = 1;	}	else{	isflag =0;	}	if(isflag ==0){	xload = document.getElementById("enquete");	xload.innerHTML = '<div style="margin-top:90px; text-align:center;"><img src="images/load.gif"><p> carregando...</p></div>';				url = "votoenquete.php?resposta="+resp;		xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        xload.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)   }}function cadastraEmail(){// NEWS		email = document.news.email.value;		if(email == ""){alert('por favor, preencha o campo e-mail!'); return false;}	if(email.indexOf("@") == -1){alert('por favor, informe um e-mail válido!'); return false;}	if(email.indexOf(".") == -1){alert('por favor, informe um e-mail válido!'); return false;}		xload = document.getElementById("feeds");	xload.innerHTML = '<div style="margin-top:90px; text-align:center;"><img src="images/load.gif"><p> carregando...</p></div>';				url = "cadastraEmailNews.php?email="+email;		xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		        xload.innerHTML = xmlhttp.responseText;				alert('Para Adicionar ou Remover seu e-mail \nda lista basta digitá-lo pressionar ok')	    }	}	 xmlhttp.send(null)}function cadastraImovel(){	tipo       = document.cadastraim.tipo[document.cadastraim.tipo.selectedIndex].value;	dorms      = document.cadastraim.dorms[document.cadastraim.dorms.selectedIndex].value;	suites     = document.cadastraim.suites[document.cadastraim.suites.selectedIndex].value;	vagas      = document.cadastraim.vagas[document.cadastraim.vagas.selectedIndex].value;	cidade     = document.cadastraim.cidade.value;	bairro     = document.cadastraim.bairro.value;	nome       = document.cadastraim.nome.value;	telefone   = document.cadastraim.telefone.value;	email      = document.cadastraim.email.value;		 if(tipo == "" || cidade == "" || telefone == "" || dorms == "" || bairro == "" || nome == "" ){		alert('Por Favor, preencha os campos!')	}	else{ 			load = document.getElementById("transAjax");			load.innerHTML = "";			load.style.height = '590px'			load.style.backgroundColor = '#fff';			load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';						url = "mail/enviaCadastroIm.php?tipo="+tipo+"&dorms="+dorms+"&suites="+suites+"&vagas="+vagas+"&cidade="+cidade+"&bairro="+bairro+"&nome="+nome+"&telefone="+telefone+"&email="+email;							xmlhttp.open("GET", url, true);			xmlhttp.onreadystatechange=function() {			    if (xmlhttp.readyState==4){			     		load.style.backgroundColor = '#fff';				        load.innerHTML = xmlhttp.responseText;						window.scroll(0,0)					   				    }			}			 xmlhttp.send(null)	 }}function corretorV(){	tipo       = document.cadastraim.tipo[document.cadastraim.tipo.selectedIndex].value;	dorms      = document.cadastraim.dorms[document.cadastraim.dorms.selectedIndex].value;	suites     = document.cadastraim.suites[document.cadastraim.suites.selectedIndex].value;	vagas      = document.cadastraim.vagas[document.cadastraim.vagas.selectedIndex].value;	cidade     = document.cadastraim.cidade.value;	bairro     = document.cadastraim.bairro.value;	nome       = document.cadastraim.nome.value;	telefone   = document.cadastraim.telefone.value;	email      = document.cadastraim.email.value;	valor      = document.cadastraim.valor.value;		if(tipo == "" || cidade == "" || telefone == "" || dorms == "" ){		alert('Por Favor, preencha os campos!')	}	else{ 	 	load = document.getElementById("transAjax");		load.innerHTML = "";		load.style.height = '590px'		load.style.backgroundColor = '#fff';		load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';				url = "mail/enviaCorretorv.php?valor="+valor+"&tipo="+tipo+"&dorms="+dorms+"&suites="+suites+"&vagas="+vagas+"&cidade="+cidade+"&bairro="+bairro+"&nome="+nome+"&telefone="+telefone+"&email="+email;				xmlhttp.open("GET", url, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){		     		load.style.backgroundColor = '#fff';			        load.innerHTML = xmlhttp.responseText;					window.scroll(0,0)		    }		}		 xmlhttp.send(null)  }}function ibusca(){	tipo           = document.busca.itipo[document.busca.itipo.selectedIndex].value;	fins           = document.busca.ifim[document.busca.ifim.selectedIndex].value;	cidade     	   = document.busca.icidade[document.busca.icidade.selectedIndex].id;	cidade_cod     = document.busca.icidade[document.busca.icidade.selectedIndex].value;		if(tipo == "."){		alert('escolha o tipo de imóvel!'); 		document.busca.itipo.focus(); 		return false;	}			if(fins == "."){alert('escolha a finalidade do imóvel!'); document.busca.ifim.focus(); return false;}	if(cidade_cod == "."){alert('escolha a cidade desejada!'); document.busca.icidade.focus(); return false;}	window.scroll(0,220); 	load = document.getElementById("transAjax");	load.innerHTML = "";	//load.style.height = '590px'	load.style.backgroundColor = '#fff';	load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		nav = navigator.appName;    if(nav == "Microsoft Internet Explorer"){nav = "IE";}else{nav = "NS";}				url = "ibuscaresult.php?tipo="+tipo+"&cidade="+cidade+"&cidade_cod="+cidade_cod+"&fins="+fins+"&nav="+nav;	xmlhttp.open("GET", url, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){				load.innerHTML = "";				load.style.backgroundColor = '#fff';		        load.innerHTML = xmlhttp.responseText;	    }	}	 xmlhttp.send(null)    return false;}function climatempo(){	uf       = document.clima.uf[document.clima.uf.selectedIndex].value;	cidade        = document.clima.cidade.value;		if(cidade == ""){alert('digite o nome da cidade sem acentos!'); return false;}		cidade = cidade.toLowerCase();		window.scroll(0,250)	 	load = document.getElementById("imageclima");		img = "<img src=http://selos.climatempo.com.br/"+uf+"-"+cidade+".gif border=0 id=\"imgresult\">";		url = "http://selos.climatempo.com.br/"+uf+"-"+cidade+".gif";		load.innerHTML = "<ul id=\"title\"> <p>Parece um bom dia para encontrar seu imóvel!</p>"+img+"</ul>";}function climatempo2(){	uf       = document.clima.uf[document.clima.uf.selectedIndex].value;	cidade        = document.clima.cidade.value;		if(cidade == ""){alert('digite o nome da cidade sem acentos!'); return false;}		window.scroll(0,250)	 	load = document.getElementById("imageclima");		img = "<img src=http://selos.climatempo.com.br/"+uf+"-"+cidade+".gif border=0 id=\"imgresult\">";		url = "http://selos.climatempo.com.br/"+uf+"-"+cidade+".gif";		xmlhttp.open("GET", url, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){				if(xmlhttp.responseText != "GIF87az"){					alert('cidade não localizada! \n\ndigite o nome da cidade:\n- sem acentos\n- sem espaços\n- sem carecteres especiais\n- verifique o estado')				}				else{					load.innerHTML = "<ul id=\"title\"> <p>Parece um bom dia para encontrar seu imóvel!</p>"+img+"</ul>";				}		    }		}		 xmlhttp.send(null)}function contato(){	nome 	  	 = document.contato.nome.value; 	telefone  	 = document.contato.telefone.value;	email 	  	 = document.contato.email.value;	endereco  	 = document.contato.endereco.value;	numero	  	 = document.contato.numero.value;	bairro    	 = document.contato.bairro.value;	cep       	 = document.contato.cep.value;	cidade     	 = document.contato.cidade.value;	uf     	     = document.contato.uf.value;	comentarios	 = document.contato.comentarios.value;	if(document.contato.codim.value != ""){		codim	 = document.contato.codim.value;	}else{	  codim = 0;	}		if(nome == "" || telefone == "" || email == "" || comentarios == ""){		alert('Atenção !!! \n\nOs Campos abaixo são de preenchimento obrigatório.\n\n* Nome\n* Telefone\n* Mensagem')	}	else{				load = document.getElementById("transAjax");		load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		nav = navigator.appName;		if(nav == "Microsoft Internet Explorer"){nav = "IE";}else{nav = "NS";}		url = "enviaContato.php?nome="+nome+"&codim="+codim+"&telefone="+telefone+"&email="+email+"&endereco="+endereco+"&numero="+numero+"&bairro="+bairro+"&cep="+cep+"&cidade="+cidade+"&uf="+uf+"&comentarios="+comentarios+"&nav="+nav;				xmlhttp.open("GET", url, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){				load.innerHTML = xmlhttp.responseText;		    }		}		 xmlhttp.send(null)		}  }function detalhes(codim){	urld = "?codim="+codim;    window.location.href = urld; }  function descript(codim){		load = document.getElementById("transAjax");		load.innerHTML = "";		load.innerHTML = '<div id="loader"><img src="images/load.gif"><br>carregando...</div>';		url = "detalhes.php?codim="+codim;		xmlhttp.open("GET", url, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){				load.innerHTML = "";				load.innerHTML = xmlhttp.responseText;		    }		}		 xmlhttp.send(null)	}function simulador(banco){	caixa = "http://www1.caixa.gov.br/casa/simulador/asp/FrmEntrada.asp?CodTabela=2&TipoModalidade=2";    banespa = "http://www.santanderbanespa.com.br/portal/gsb/script/templates/GCMRequest.do?page=496&entryID=592";    nossacaixa = "http://www.nossacaixa.com.br/imobiliario/imofp001.htm";	boston = "http://www.bankboston.com.br/voce/cred_imobiliario/simulacao.asp";	santander = "http://www.santanderbanespa.com.br/portal/gsb/script/templates/GCMRequest.do?page=496&entryID=592";	bradesco = "http://www.shopcredit.com.br/shopcredit/br/stsm/stsmcredimobsimulador0.asp?layout=F&retorno=simulado";	real = "https://wwws.bancoreal.com.br/sim/Scripts/engine_sim.dll?OPERA=sci.ar.Simulacao&ORI=1";	itau = "https://ww3.itau.com.br/imobline/pre/simuladores/index.aspx?IDENT_bkl=pre&IMOB_tipobkl=";	unibanco = "http://www1.unibanco.com.br/asp/pfisica/simuladores/imobiliario/asp/default.asp";       switch(banco){		case 'banespa': window.open(banespa,'new','')		break;				case 'caixa': window.open(caixa,'new','')		break;				case 'nossacaixa': window.open(nossacaixa,'new','')		break;				case 'boston': window.open(boston,'new','')		break;				case 'santander': window.open(santander,'new','')		break;						case 'bradesco': window.open(bradesco,'new','')		break;						case 'real': window.open(real,'new','')		break;						case 'itau': window.open(itau,'new','')		break;				case 'unibanco': window.open(unibanco,'new','')		break;				    }}function jober(){ nome = document.jobs.nome.value; cpf = document.jobs.cpf.value; nasc = document.jobs.aniversario.value; telefone = document.jobs.telefone.value; email = document.jobs.email.value; empresa = document.jobs.empresa.value; if(nome == "" || cpf == "" || nasc == "" || telefone == "" ){	alert('Por Favor, preencha os campos!') } else{	 load = document.getElementById("transAjax");	 load.innerHTML = '<div id="loader"><br /><img src="images/load.gif"><br>carregando...</div>';	 	 window.scroll(0,0);	 pagejobs = "mail/enviajobs.php?nome="+nome+"&cpf="+cpf+"&nasc="+nasc+"&telefone="+telefone+"&empresa="+empresa+"&email="+email;	 		xmlhttp.open("GET", pagejobs, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){			     load.innerHTML = xmlhttp.responseText;		    }		}		 xmlhttp.send(null)  }}function ampliafoto(img){	amp = document.getElementById("fotoamp");	amp.innerHTML = '<div id="loader"><br /><img src="images/load.gif"><br>carregando...</div>';	 	amp = document.getElementById("fotoamp");	nimage = '<img src="'+img+'" width="400" height="400">';	amp.innerHTML = nimage;	window.scroll(0,590)}function fwamigo(codim){	obj = document.getElementById("fwamigo");	if(obj.style.visibility != 'visible'){		obj.style.visibility = 'visible';		obj.style.display = 'block';	}else{	  obj.style.visibility = 'hidden'	  obj.innerHTML = "";	  obj.style.display = 'none';	}	page = "fwamigo.php?codim="+codim;	xmlhttp.open("GET", page, true);	xmlhttp.onreadystatechange=function() {	    if (xmlhttp.readyState==4){		     obj.innerHTML = xmlhttp.responseText;		    }	}	 xmlhttp.send(null);		}function fwsend(codim){	obj = document.getElementById("fwamigo");	amigo = document.fw.amigo.value;	email = document.fw.email.value; 	if(amigo == "" || email == ""){		alert('Por favor, preencha os campos!')	}		if(amigo.indexOf("@") == -1 || email.indexOf("@") == -1){	  alert('Por favor, digte um e-mail válido');	}	else{		page = "mail/fwamigo.php?send=ok&amigo="+amigo+"&email="+email+"&codIM="+codim;		obj.innerHTML = "<p>&nbsp;</p>";	    obj.innerHTML += "<Br><p>Enviando, por favor aguarde...</p>";				xmlhttp.open("GET", page, true);		xmlhttp.onreadystatechange=function() {		    if (xmlhttp.readyState==4){			     obj.innerHTML = xmlhttp.responseText;			    }		}		 xmlhttp.send(null);	}}function favoritos(codim,cidade,valor,site,sitenome){	 desc = sitenome + " - Imóvel cód. " + codim + " em " +cidade+ " por " +valor+ "!"; 	 url = site + "?codim="+codim;	 window.external.AddFavorite(url,desc)	}