/* * As variáveis abaixo devem sempre estar declaradas no javascript do site em desenvolvimento, pois são esperadas pelos serviços Spaic */ // Série usada nos imóveis gcSpaSrImv = "2011015157"; // Série usada para inquilinos e proprietários gcSpaSrInqPro = "2050901199"; // Nome do container principal da página (aquele que contém todo o conteúdo) gcSpaIDCtnBase = "wrapper"; // Nome do container onde os resultados das pesquisas serão exibidos gcSpaIDCtn = "column_w530"; // Código executado ao clicar no botão pesquisar da pesquisa lateral gcSpaImvExPesqLat = ""; // Código executado ao fechar a pesquisa lateral gcSpaImvFePesqLat = ""; // Usuário e senha do proprietário gcSpaProUsu = ""; gcSpaProSen = ""; // Usuário e senha do inquilino gcSpaInqUsu = ""; gcSpaInqSen = ""; gcIDCtn = "cnt_pesq" // Foto exibida no banner oFotosBanner = carregaFotosBanner(); nFotoBanner = 0; function carregaPagina() { doBanner(); doPesqLat(); } function criaAjax() { var xmlhttp; try { xmlhttp = new XMLHttpRequest(); } catch (ie1) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (ie2) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { xmlhttp = false; } } } return xmlhttp; } function carregaFotosBanner() { oAjax = criaAjax(); if (oAjax) { cURL = "banner_fotos.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { return eval("(" + oAjax.responseText + ")"); } } } return null; } function doBanner() { cHTML = '
' + '
' + '' + '
' + '
' + '
' + '
30 anos de tradição no mercado imobiliário
' + '

' + 'A A.Pinheiro busca atender as necessidades de seus clientes no setor imobiliário, usando meios modernos e eficazes, com ' + 'muito profissionalismo e ética.
Visamos manter um ambiente agradável, respeitoso, com dedicação ao que nos é confiado.' + '

' + '
' + '
'; oBanner = document.getElementById("templatemo_banner"); oBanner.innerHTML = cHTML; setInterval("mudaFotoBanner()", 4000); } function mudaFotoBanner() { nFotoBanner ++; if (nFotoBanner >= oFotosBanner.fotos.length) { nFotoBanner = 0; } oImg = document.getElementById("foto_banner"); oImg.src = oFotosBanner.fotos[nFotoBanner].nome; } function exibeDetImv(cTipC, nCod) { spaImvExibeDetalhe(nCod, null, cTipC, gcSpaSrImv, true); } function doPesqLat() { oAjax = criaAjax(); if (oAjax) { // Aqui podemos passar o parâmetro tc caso o cliente use só um dos tipos (Venda ou Locação) cURL = "spa_query.php?tp=2<=1&sr=" + gcSpaSrImv + "&depup=1"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doNav(nOpc) { // Fecha menu de serviços ao clicar document.getElementById("menuServ").style.display = "none"; // Usado para posicionar a página na área de conteúdo quando uma opção é escolhida location.href = "#c"; if (nOpc == 1) { doEmpresa(); } else if (nOpc == 2) { doPesqAv(); } else if (nOpc == 3) { doProprietarios(); } else if (nOpc == 4) { doInquilinos(); } else if (nOpc == 5) { doLocalizacao(); } else if (nOpc == 6) { doFale(); } else if (nOpc == 7) { doJuridico(); } else if (nOpc == 8) { doImobiliario(); } else if (nOpc == 9) { doSeguros(); } else if (nOpc == 10) { doAnuncie(); } else if (nOpc == 11) { doDocsLoc(); } } function doEmpresa() { oAjax = criaAjax(); if (oAjax) { cURL = "empresa.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doPesqAv() { oAjax = criaAjax(); if (oAjax) { // Aqui podemos passar o parâmetro tc caso o cliente use só um dos tipos (Venda ou Locação) cURL = "spa_query.php?tp=2&atpa=1&sr=" + gcSpaSrImv + "&depup=1"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doProprietarios() { oAjax = criaAjax(); if (oAjax) { cURL = "spa_query.php?tp=7&sr=" + gcSpaSrInqPro; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; document.getElementById("spa-pro-usuario").focus(); cNav = navigator.userAgent; lMSIE = (cNav.indexOf("MSIE") != -1); if (lMSIE) { document.getElementById("spa-pro-usuario").focus(); } } } } } function doInquilinos() { oAjax = criaAjax(); if (oAjax) { cURL = "spa_query.php?tp=11&sr=" + gcSpaSrInqPro; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; document.getElementById("spa-inq-usuario").focus(); cNav = navigator.userAgent; lMSIE = (cNav.indexOf("MSIE") != -1); if (lMSIE) { document.getElementById("spa-inq-usuario").focus(); } } } } } function doLocalizacao() { oAjax = criaAjax(); if (oAjax) { cURL = "localizacao.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doFale() { oAjax = criaAjax(); if (oAjax) { cURL = "fale.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; document.getElementById("nome").focus(); cNav = navigator.userAgent; lMSIE = (cNav.indexOf("MSIE") != -1); if (lMSIE) { document.getElementById("nome").focus(); } } } } } function envioFale() { oID = document.getElementById("cod"); oNome = document.getElementById("nome"); oEMail = document.getElementById("email"); oDDDFone = document.getElementById("ddd_fone"); oNumFone = document.getElementById("num_fone"); oDDDCel = document.getElementById("ddd_cel"); oNumCel = document.getElementById("num_cel"); oObs = document.getElementById("obs"); /* * Expressões regulares para validação dos campos */ oERNome = /\D{3,}/; oEREMail = /.+@{1}.+\.+.+/; oERDDDFone = /\d{2,}/; oERNumFone = /\d{2,4}-{0,1}\d{4}.*/; if (!oNome.value.match(oERNome)) { window.alert("Informe seu nome por favor."); oNome.select(); oNome.focus(); return; } if (oDDDFone.value.length > 0) { if (!oDDDFone.value.match(oERDDDFone)) { window.alert("O DDD deve conter apenas dígitos (pelo menos 2)."); oDDDFone.select(); oDDDFone.focus(); return; } } if (oNumFone.value.length > 0) { if (!oNumFone.value.match(oERNumFone)) { window.alert("O número do telefone informado não é válido."); oNumFone.select(); oNumFone.focus(); return; } } if (oDDDCel.value.length > 0) { if (!oDDDCel.value.match(oERDDDFone)) { window.alert("O DDD deve conter apenas dígitos (pelo menos 2)."); oDDDCel.select(); oDDDCel.focus(); return; } } if (oNumCel.value.length > 0) { if (!oNumCel.value.match(oERNumFone)) { window.alert("O número do celular informado não é válido."); oNumCel.select(); oNumCel.focus(); return; } } if (oEMail.value.length > 0) { if (!oEMail.value.match(oEREMail)) { window.alert("O e-mail informado não é válido."); oEMail.select(); oEMail.focus(); return; } } if (oEMail.value.length == 0 && oNumFone.value.length == 0 && oNumCel.value.length == 0) { window.alert("Preencha pelo menos uma forma de contato (e-mail ou telefone)."); return; } if (oObs.value.length == 0) { window.alert("Informe o assunto por favor."); return; } //window.alert("Mensagem enviada com sucesso. Obrigado."); oAjax = criaAjax(); if (oAjax) { /* cURL = "spa_query.php?tp=17&sr=" + gcSpaSrImv; oAjax.open('GET',cURL,false); oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { cImbMail = oAjax.responseText; oAjax = criaAjax(); if (oAjax) { cURL = "e-mail.php?nm=" + oNome.value + "&em=" + oEMail.value + "&df=" + oDDDFone.value + "&nf=" + oNumFone.value + "&dc=" + oDDDCel.value + "&nc=" + oNumCel.value + "&obs=" + oObs.value + "&ei=" + cImbMail + "&sr=" + gcSpaSrImv; oAjax.open('GET',cURL,false); oAjax.send(null); if (oAjax.readyState == 4 && oAjax.status == 200) { if (oAjax.responseText == "OK") { window.alert("Mensagem enviada com sucesso. Obrigado."); } } } } } */ cURL = "spa_query.php?tp=18&sr=" + gcSpaSrImv + "&nm=" + escape(oNome.value) + "&em=" + escape(oEMail.value) + "&df=" + escape(oDDDFone.value) + "&nf=" + escape(oNumFone.value) + "&dc=" + escape(oDDDCel.value) + "&nc=" + escape(oNumCel.value) + "&obs=" + escape(oObs.value); oAjax.open('GET',cURL,false); oAjax.send(null); if (oAjax.readyState == 4 && oAjax.status == 200) { if (oAjax.responseText.indexOf("*OK*") != -1) { window.alert("Mensagem enviada com sucesso. Obrigado."); } } } } function menuOver() { document.getElementById("menuServ").style.display = "block"; } function menuOut() { document.getElementById("menuServ").style.display = "none"; } function doJuridico() { oAjax = criaAjax(); if (oAjax) { cURL = "juridico.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doImobiliario() { oAjax = criaAjax(); if (oAjax) { cURL = "imobiliario.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doSeguros() { oAjax = criaAjax(); if (oAjax) { cURL = "seguros.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doAnuncie() { oAjax = criaAjax(); if (oAjax) { cURL = "anuncie.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function doDocsLoc() { oAjax = criaAjax(); if (oAjax) { cURL = "docs_loc.php"; oAjax.open('GET',cURL,false); // false = síncrona oAjax.send(null); if (oAjax.readyState == 4) { if (oAjax.status == 200) { oDiv = document.getElementById(gcSpaIDCtn); oDiv.innerHTML = oAjax.responseText; } } } } function envioSeguros() { oTpSeg = document.getElementById("tp_seg"); oNome = document.getElementById("nome"); oEnder = document.getElementById("endereco"); oBairro = document.getElementById("bairro"); oCidade = document.getElementById("cidade"); oUF = document.getElementById("uf"); oFone = document.getElementById("fone"); oEMail = document.getElementById("email"); oObs = document.getElementById("obs"); /* * Expressões regulares para validação dos campos */ oERNome = /\D{3,}/; oEREMail = /.+@{1}.+\.+.+/; if (!oNome.value.match(oERNome)) { window.alert("Informe seu nome por favor."); oNome.select(); oNome.focus(); return; } if (oEMail.value.length > 0) { if (!oEMail.value.match(oEREMail)) { window.alert("O e-mail informado não é válido."); oEMail.select(); oEMail.focus(); return; } } if (oEMail.value.length == 0 && oFone.value.length == 0) { window.alert("Preencha pelo menos uma forma de contato (e-mail ou telefone)."); return; } //window.alert("Mensagem enviada com sucesso. Obrigado."); oAjax = criaAjax(); if (oAjax) { cURL = "spa_query.php?tp=50&sr=" + gcSpaSrImv + "&ts=" + escape(oTpSeg.value) + "&nm=" + escape(oNome.value) + "&end=" + escape(oEnder.value) + "&bai=" + escape(oBairro.value) + "&cid=" + escape(oCidade.value) + "&uf=" + escape(oUF.value) + "&fon=" + escape(oFone.value) + "&em=" + escape(oEMail.value) + "&obs=" + escape(oObs.value); oAjax.open('GET',cURL,false); oAjax.send(null); if (oAjax.readyState == 4 && oAjax.status == 200) { if (oAjax.responseText.indexOf("*OK*") != -1) { window.alert("Mensagem enviada com sucesso. Obrigado."); } else { window.alert("Erro no envio da mensagem.\n\n" + oAjax.responseText); } } } } function envioCadastro() { oNegoc = document.getElementById("neg"); oTpImv = document.getElementById("tp_imv"); oEndImv = document.getElementById("end_imv"); oRef = document.getElementById("ref"); oNome = document.getElementById("nm"); oFone = document.getElementById("fon"); oEnder = document.getElementById("end"); oValor = document.getElementById("val"); oObs = document.getElementById("obs"); /* * Expressões regulares para validação dos campos */ oEREndImv = /\D{3,}/; oERNome = /\D{3,}/; if (!oEndImv.value.match(oEREndImv)) { window.alert("Informe o endereço do imóvel por favor."); oEndImv.select(); oEndImv.focus(); return; } if (!oNome.value.match(oERNome)) { window.alert("Informe seu nome por favor."); oNome.select(); oNome.focus(); return; } if (oFone.value.length == 0) { window.alert("Informe um telefone para contato por favor."); oFone.select(); oFone.focus(); return; } //window.alert("Mensagem enviada com sucesso. Obrigado."); oAjax = criaAjax(); if (oAjax) { cURL = "spa_query.php?tp=51&sr=" + gcSpaSrImv + "&neg=" + escape(oNegoc.value) + "&ti=" + escape(oTpImv.value) + "&endi=" + escape(oEndImv.value) + "&ref=" + escape(oRef.value) + "&nm=" + escape(oNome.value) + "&fon=" + escape(oFone.value) + "&end=" + escape(oEnder.value) + "&val=" + escape(oValor.value) + "&obs=" + escape(oObs.value); oAjax.open('GET',cURL,false); oAjax.send(null); if (oAjax.readyState == 4 && oAjax.status == 200) { if (oAjax.responseText.indexOf("*OK*") != -1) { window.alert("Mensagem enviada com sucesso. Obrigado."); } else { window.alert("Erro no envio da mensagem.\n\n" + oAjax.responseText); } } } }