window.onerror = TrataErro;

function TrataErro() {
    return true;
}
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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function abre(url){
x = screen.width - 9;
y = screen.height - 58;
//alert(url+" - "+x+" - "+y);
newwindow=window.open(url,'','height='+y+',width='+x+',top=0,left=0,scrollbars=yes');
//newwindow.moveTo(0,0);
if (window.focus) {
newwindow.focus();
}
return false;
//'http://www.id360.com.br/ofertimoveis/mapas/mapa.aspx?Latitude=-23.590662&Longitude=-46.626288','','width=768,height=420'
}

// Popup Centralizada
function OpenPop(width, heitgh, endereco)
{
 var end =  endereco;
 var w = width;
 var h = heitgh;
 var t = (screen.height/2)-(h/2);
 var l = (screen.width/2)-(w/2);
 window.open(end,'NOMEPAGINA','width='+w+',height='+h+',top='+t+',left='+l);
}
function abre(url){
x = screen.width - 9;
y = screen.height - 58;
//alert(url+" - "+x+" - "+y);
newwindow=window.open(url,'','height='+y+',width='+x+',top=0,left=0,scrollbars=yes');
//newwindow.moveTo(0,0);
if (window.focus) {
newwindow.focus();
}
return false;
//'http://www.id360.com.br/ofertimoveis/mapas/mapa.aspx?Latitude=-23.590662&Longitude=-46.626288','','width=768,height=420'
}

function CarregaPagina(Pagina,Estado) {
    if (Pagina.length > 0) {
        document.frmBusca.PaginaAtual.value = Pagina;
        document.frmBusca.Estado2.value = Estado;
        URL_Atual = location.href;
        splitURL_Atual = URL_Atual.split("/");
        if (document.getElementById("Parametros") != null) {
            document.frmBusca.action = "/carrega_paginas.asp?URL=" + document.getElementById("Parametros").value;
        }else {
            document.frmBusca.action = "/carrega_paginas.asp?URL=" + splitURL_Atual[3];
        }
        document.frmBusca.submit();
    }
}
function CarregaPagina2(Pagina, Estado) {
    if (Pagina.length > 0) {
        document.frmBusca.PaginaAtual.value = Pagina;
        document.frmBusca.Estado2.value = Estado;
        URL_Atual = location.href;
        alert("Ok");
        alert(URL_Atual);
        splitURL_Atual = URL_Atual.split("/");
        document.frmBusca.action = "/carrega_paginas.asp?URL=" + splitURL_Atual[3];
        document.frmBusca.submit();
    }
}
function CarregaPaginaObraRealizada(Pagina) {
    if (Pagina.length > 0) {
        document.frmBusca.PaginaAtual.value = Pagina;
        document.frmBusca.action = "empreendimentos.asp";
        document.frmBusca.submit();
    }
}

function CarregaPaginaEmpreendimentos(Pagina,Status) {
    if (Pagina.length > 0) {
        document.frmBusca.PaginaAtual.value = Pagina;
        document.frmBusca.Status2.value = Status;
        URL_Atual = location.href;
        splitURL_Atual = URL_Atual.split("/");
        if (splitURL_Atual[3] == "obrasrealizadas") {
            URL_Atual = "Obra Realizada";
        }
        document.frmBusca.action = "/carrega_empreendimentos.asp?Status=" + URL_Atual + "&URL=" + splitURL_Atual[3];
        document.frmBusca.submit();
    }
}

function CarregaPaginaImprensa(Pagina) {
    if (Pagina.length > 0) {
        URL_Atual = location.href;
        splitURL_Atual = URL_Atual.split("/");
        document.frmImprensa.PaginaAtual.value = Pagina;
        document.frmImprensa.action = "/carrega_noticias.asp?URL=" + splitURL_Atual[3] + "/" + splitURL_Atual[4]
        document.frmImprensa.submit();
    }
}

function TrabalheConosco() {
    if (document.frmTrabalheConosco.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmTrabalheConosco.Nome.focus();
        return;
    }
    if (document.frmTrabalheConosco.Endereco.value.length == 0) {
        alert("Erro:\n\nDigite o seu Endereço!");
        document.frmTrabalheConosco.Endereco.focus();
        return;
    }
    if (document.frmTrabalheConosco.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmTrabalheConosco.Email.focus();
        return;
    }
    AchouArroba = document.frmTrabalheConosco.Email.value.indexOf("@");
    AchouPonto = document.frmTrabalheConosco.Email.value.lastIndexOf(".");    
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmTrabalheConosco.Email.focus();        
        return;
    } 
    if (document.frmTrabalheConosco.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o seu DDD!");
        document.frmTrabalheConosco.DDD.focus();
        return;
    }
    if (document.frmTrabalheConosco.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmTrabalheConosco.Telefone.focus();
        return;
    }
    if (document.frmTrabalheConosco.AreaAtuacao.selectedIndex == 0) {
        alert("Erro:\n\nInforme a Área de Atuação!");
        document.frmTrabalheConosco.AreaAtuacao.focus();
        return;
    }
    if ((document.frmTrabalheConosco.Categoria[0].checked == false) && (document.frmTrabalheConosco.Categoria[1].checked == false)) {
        alert("Erro:\n\nInfome a Categoria!");
        document.frmTrabalheConosco.Categoria[0].focus();
        return;
    }
    if (document.frmTrabalheConosco.Arquivo.value.length == 0) {
        alert("Erro:\n\Informe o Arquivo do Currículo!");
        document.frmTrabalheConosco.Arquivo.focus();
        return;
    }
    document.getElementById("form_trabalheconosco").style.display = "none";
    document.getElementById("erro_trabalheconosco").style.display = "none";
    document.getElementById("sucesso_trabalheconosco").style.display = "none";
    document.getElementById("loading_trabalheconosco").style.display = "block";
    document.frmTrabalheConosco.submit();
}

function EnviarCadastro() {
    if (document.frmNoticias.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmNoticias.Nome.focus();
        return;
    }
    if (document.frmNoticias.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmNoticias.Email.focus();
        return;
    }
    AchouArroba = document.frmNoticias.Email.value.indexOf("@");
    AchouPonto = document.frmNoticias.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmNoticias.Email.focus();
        return;
    }
    if (document.frmNoticias.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a sua Mensagem!");
        document.frmNoticias.Mensagem.focus();
        return;
    }
    document.getElementById("form_noticia").style.display = "none";
    document.getElementById("erro_noticia").style.display = "none";
    document.getElementById("sucesso_noticia").style.display = "none";
    document.getElementById("loading_noticia").style.display = "block";
    document.frmNoticias.submit();
}

function EnviarCadastroJornalistas() {
    if (document.frmCadastroJornalistas.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmCadastroJornalistas.Nome.focus();
        return;
    }
    if (document.frmCadastroJornalistas.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmCadastroJornalistas.Email.focus();
        return;
    }
    AchouArroba = document.frmCadastroJornalistas.Email.value.indexOf("@");
    AchouPonto = document.frmCadastroJornalistas.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmCadastroJornalistas.Email.focus();
        return;
    }
    if (document.frmCadastroJornalistas.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o DDD do seu Telefone!");
        document.frmCadastroJornalistas.DDD.focus();
        return;
    }
    if (document.frmCadastroJornalistas.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmCadastroJornalistas.Telefone.focus();
        return;
    }
    document.getElementById("form_cadastrojornalistas").style.display = "none";
    document.getElementById("erro_cadastrojornalistas").style.display = "none";
    document.getElementById("sucesso_cadastrojornalistas").style.display = "none";
    document.getElementById("loading_cadastrojornalistas").style.display = "block";
    document.frmCadastroJornalistas.submit();
}


function TentarNovamenteTrabalheConosco() {
    document.getElementById("form_trabalheconosco").style.display = "block";
    document.getElementById("erro_trabalheconosco").style.display = "none";
    document.getElementById("sucesso_trabalheconosco").style.display = "none";
    document.getElementById("loading_trabalheconosco").style.display = "none";
}
function TentarNovamentefornecedores() {
    document.getElementById("form_fornecedores").style.display = "block";
    document.getElementById("erro_fornecedores").style.display = "none";
    document.getElementById("sucesso_fornecedores").style.display = "none";
    document.getElementById("loading_fornecedores").style.display = "none";
}

function TentarNovamenteCadastroNews() {
    document.getElementById("form_cadastronews").style.display = "block";
    document.getElementById("erro_cadastronews").style.display = "none";
    document.getElementById("sucesso_cadastronews").style.display = "none";
    document.getElementById("loading_cadastronews").style.display = "none";
}

function TentarNovamenteCadastroJornalistas() {
    document.getElementById("form_cadastrojornalistas").style.display = "block";
    document.getElementById("erro_cadastrojornalistas").style.display = "none";
    document.getElementById("sucesso_cadastrojornalistas").style.display = "none";
    document.getElementById("loading_cadastrojornalistas").style.display = "none";
}

function TentarNovamentePagamento() {
    document.getElementById("form_pagamento").style.display = "block";
    document.getElementById("erro_pagamento").style.display = "none";
    document.getElementById("sucesso_pagamento").style.display = "none";
    document.getElementById("loading_pagamento").style.display = "none";
}

function TentarNovamenteRecebaMaisInformacoes() {
    document.getElementById("form_recebamaisinformacoes").style.display = "block";
    document.getElementById("erro_recebamaisinformacoes").style.display = "none";
    document.getElementById("sucesso_recebamaisinformacoes").style.display = "none";
    document.getElementById("loading_recebamaisinformacoes").style.display = "none";
}

function TentarNovamenteIndique() {
    document.getElementById("form_indique").style.display = "block";
    document.getElementById("erro_indique").style.display = "none";
    document.getElementById("sucesso_indique").style.display = "none";
    document.getElementById("loading_indique").style.display = "none";
}

function TentarNovamenteNewsletter() {
    document.getElementById("form_newsletter").style.display = "block";
    document.getElementById("erro_newsletter").style.display = "none";
    document.getElementById("sucesso_newsletter").style.display = "none";
    document.getElementById("loading_newsletter").style.display = "none";
}

function TentarNovamentePrimeiraMao() {
    document.getElementById("form_primeiramao").style.display = "block";
    document.getElementById("erro_primeiramao").style.display = "none";
    document.getElementById("sucesso_primeiramao").style.display = "none";
    document.getElementById("loading_primeiramao").style.display = "none";
}
function ReiniciarIndique() {
    document.getElementById("form_indique").style.display = "block";
    document.getElementById("erro_indique").style.display = "none";
    document.getElementById("sucesso_indique").style.display = "none";
    document.getElementById("loading_indique").style.display = "none";
    document.frmIndique.reset();
    document.frmIndique.Nome.focus();
}

function ReiniciarCadastroNews() {
    document.getElementById("form_cadastronews").style.display = "block";
    document.getElementById("erro_cadastronews").style.display = "none";
    document.getElementById("sucesso_cadastronews").style.display = "none";
    document.getElementById("loading_cadastronews").style.display = "none";
    document.frmCadastroNews.reset();
    document.frmCadastroNews.Nome.focus();
}

function ReiniciarCadastroJornalistas() {
    document.getElementById("form_cadastrojornalistas").style.display = "block";
    document.getElementById("erro_cadastrojornalistas").style.display = "none";
    document.getElementById("sucesso_cadastrojornalistas").style.display = "none";
    document.getElementById("loading_cadastrojornalistas").style.display = "none";
    document.frmCadastroJornalistas.reset();
    document.frmCadastroJornalistas.Nome.focus();
}

function ReiniciarPagamento() {
    document.getElementById("form_pagamento").style.display = "block";
    document.getElementById("erro_pagamento").style.display = "none";
    document.getElementById("sucesso_pagamento").style.display = "none";
    document.getElementById("loading_pagamento").style.display = "none";
    document.frmPagamento.reset();
    document.frmPagamento.Nome.focus();
}

function ReiniciarRecebaMaisInformacoes() {
    document.getElementById("form_recebamaisinformacoes").style.display = "block";
    document.getElementById("erro_recebamaisinformacoes").style.display = "none";
    document.getElementById("sucesso_recebamaisinformacoes").style.display = "none";
    document.getElementById("loading_recebamaisinformacoes").style.display = "none";
    document.frmRecebaMaisInformacoes.reset();
    document.frmRecebaMaisInformacoes.Nome.focus();
}

function ReiniciarPrimeiraMao() {
    document.getElementById("form_primeiramao").style.display = "block";
    document.getElementById("erro_primeiramao").style.display = "none";
    document.getElementById("sucesso_primeiramao").style.display = "none";
    document.getElementById("loading_primeiramao").style.display = "none";
    document.frmPrimeiraMao.reset();
    document.frmPrimeiraMao.Nome.focus();
}
function ReiniciarTrabalheConosco() {
    document.getElementById("form_trabalheconosco").style.display = "block";
    document.getElementById("erro_trabalheconosco").style.display = "none";
    document.getElementById("sucesso_trabalheconosco").style.display = "none";
    document.getElementById("loading_trabalheconosco").style.display = "none";
    document.frmTrabalheConosco.reset();
    document.frmTrabalheConosco.Nome.focus();
}
function Reiniciarfornecedores() {
    document.getElementById("form_fornecedores").style.display = "block";
    document.getElementById("erro_fornecedores").style.display = "none";
    document.getElementById("sucesso_fornecedores").style.display = "none";
    document.getElementById("loading_fornecedores").style.display = "none";
    document.fornecedores.reset();
    document.fornecedores.Nome.focus();
}

function ReiniciarNovosNegocios() {
    document.getElementById("form_novosnegocios").style.display = "block";
    document.getElementById("erro_novosnegocios").style.display = "none";
    document.getElementById("sucesso_novosnegocios").style.display = "none";
    document.getElementById("loading_novosnegocios").style.display = "none";
    document.frmNovosNegocios.reset();
    document.frmNovosNegocios.Nome.focus();
}

function TentarNovamenteNovosNegocios() {
    document.getElementById("form_novosnegocios").style.display = "block";
    document.getElementById("erro_novosnegocios").style.display = "none";
    document.getElementById("sucesso_novosnegocios").style.display = "none";
    document.getElementById("loading_novosnegocios").style.display = "none";
}

function ReiniciarNewsletter() {
    document.getElementById("form_newsletter").style.display = "block";
    document.getElementById("erro_newsletter").style.display = "none";
    document.getElementById("sucesso_newsletter").style.display = "none";
    document.getElementById("loading_newsletter").style.display = "none";
    document.frmNewsletter.reset();
    document.frmNewsletter.Nome.focus();
    document.getElementById("todoformserhelbor2").style.display = "none";
}

function ReiniciarHelborLiga() {
    document.getElementById("form_helborliga").style.display = "block";
    document.getElementById("erro_helborliga").style.display = "none";
    document.getElementById("sucesso_helborliga").style.display = "none";
    document.getElementById("loading_helborliga").style.display = "none";
    document.frmHelborLiga.reset();
    document.frmHelborLiga.Nome.focus();
}

function TentarNovamenteNoticia() {
    document.getElementById("form_noticia").style.display = "block";
    document.getElementById("erro_noticia").style.display = "none";
    document.getElementById("sucesso_noticia").style.display = "none";
    document.getElementById("loading_noticia").style.display = "none";
}

function TentarNovamenteHelborLiga() {
    document.getElementById("form_helborliga").style.display = "block";
    document.getElementById("erro_helborliga").style.display = "none";
    document.getElementById("sucesso_helborliga").style.display = "none";
    document.getElementById("loading_helborliga").style.display = "none";
}

function ReiniciarNoticia() {
    document.getElementById("form_noticia").style.display = "block";
    document.getElementById("erro_noticia").style.display = "none";
    document.getElementById("sucesso_noticia").style.display = "none";
    document.getElementById("loading_noticia").style.display = "none";
    document.frmNoticias.reset();
    document.frmNoticias.Nome.focus();
}

function TentarNovamenteContato() {
    document.getElementById("form_contato").style.display = "block";
    document.getElementById("erro_contato").style.display = "none";
    document.getElementById("sucesso_contato").style.display = "none";
    document.getElementById("loading_contato").style.display = "none";
}

function ReiniciarContato() {
    document.getElementById("form_contato").style.display = "block";
    document.getElementById("erro_contato").style.display = "none";
    document.getElementById("sucesso_contato").style.display = "none";
    document.getElementById("loading_contato").style.display = "none";
    document.frmContato.reset();
    document.frmContato.Nome.focus();
}

function TentarNovamenteContatoFichaProduto() {
    document.getElementById("form_contatofichaproduto").style.display = "block";
    document.getElementById("erro_contatofichaproduto").style.display = "none";
    document.getElementById("sucesso_contatofichaproduto").style.display = "none";
    document.getElementById("loading_contatofichaproduto").style.display = "none";
}

function ReiniciarContatoFichaProduto() {
    document.getElementById("form_contatofichaproduto").style.display = "block";
    document.getElementById("erro_contatofichaproduto").style.display = "none";
    document.getElementById("sucesso_contatofichaproduto").style.display = "none";
    document.getElementById("loading_contatofichaproduto").style.display = "none";
    document.frmContatoFichaProduto.reset();
    document.frmContatoFichaProduto.Nome.focus();
}

function TentarNovamenteSerHelbor() {
    document.getElementById("form_serhelbor").style.display = "block";
    document.getElementById("erro_serhelbor").style.display = "none";
    document.getElementById("sucesso_serhelbor").style.display = "none";
    document.getElementById("loading_serhelbor").style.display = "none";
}

function ReiniciarSerHelbor() {
    document.getElementById("form_serhelbor").style.display = "block";
    document.getElementById("erro_serhelbor").style.display = "none";
    document.getElementById("sucesso_serhelbor").style.display = "none";
    document.getElementById("loading_serhelbor").style.display = "none";
    document.frmSerHelbor.reset();
    document.frmSerHelbor.Nome.focus();
}

function EnviarSerHelbor() {
    Achou = false;
    for (x = 0; x <= 3; x++) {
        if (document.frmSerHelbor.Opcao[x].checked) {
            Achou = true;
            break;
        }
    }
    if (Achou == false) {
        alert("Erro:\n\nSelecione uma Opção!");
        return;
    }
    if (document.frmSerHelbor.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmTrabalheConosco.Nome.focus();
        return;
    }
    if (document.frmSerHelbor.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmSerHelbor.Email.focus();
        return;
    }
    AchouArroba = document.frmSerHelbor.Email.value.indexOf("@");
    AchouPonto = document.frmSerHelbor.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmSerHelbor.Email.focus();
        return;
    }
    if (document.frmSerHelbor.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o seu DDD!");
        document.frmSerHelbor.DDD.focus();
        return;
    }
    if (document.frmSerHelbor.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmSerHelbor.Telefone.focus();
        return;
    }
    if (document.frmSerHelbor.Empreendimento.value.length == 0) {
        alert("Erro:\n\nDigite o Empreendimento!");
        document.frmSerHelbor.Empreendimento.focus();
        return;
    }
    if (document.frmSerHelbor.Bloco.value.length == 0) {
        alert("Erro:\n\nDigite o Bloco!");
        document.frmSerHelbor.Bloco.focus();
        return;
    }
    if (document.frmSerHelbor.Unidade.selectedIndex == 0) {
        alert("Erro:\n\nDigite a Unidade!");
        document.frmSerHelbor.Unidade.focus();
        return;
    }
    if (document.frmSerHelbor.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a Mensagem!");
        document.frmSerHelbor.Mensagem.focus();
        return;
    }
    document.getElementById("form_serhelbor").style.display = "none";
    document.getElementById("erro_serhelbor").style.display = "none";
    document.getElementById("sucesso_serhelbor").style.display = "none";
    document.getElementById("loading_serhelbor").style.display = "block";
    document.frmSerHelbor.submit();
}

function Personalize() {
    if (document.frmPersonalize.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmPersonalize.Nome.focus();
        return;
    }
    if (document.frmPersonalize.Senha.value.length == 0) {
        alert("Erro:\n\nDigite a sua Senha!");
        document.frmPersonalize.Senha.focus();
        return;
    }
    document.frmPersonalize.submit();
}

function EnviarMensagemFichaProduto() {
    if (document.frmContatoFichaProduto.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmContatoFichaProduto.Nome.focus();
        return;
    }
    if (document.frmContatoFichaProduto.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmContatoFichaProduto.Email.focus();
        return;
    }
    AchouArroba = document.frmContatoFichaProduto.Email.value.indexOf("@");
    AchouPonto = document.frmContatoFichaProduto.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmContatoFichaProduto.Email.focus();
        return;
    }
    if (document.frmContatoFichaProduto.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a Mensagem!");
        document.frmContatoFichaProduto.Mensagem.focus();
        return;
    }
    document.getElementById("form_contatofichaproduto").style.display = "none";
    document.getElementById("erro_contatofichaproduto").style.display = "none";
    document.getElementById("sucesso_contatofichaproduto").style.display = "none";
    document.getElementById("loading_contatofichaproduto").style.display = "block";
    document.frmContatoFichaProduto.submit();
}

function EnviarContato() {
    if (document.frmContato.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmContato.Nome.focus();
        return;
    }
    if (document.frmContato.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmContato.Email.focus();
        return;
    }
    AchouArroba = document.frmContato.Email.value.indexOf("@");
    AchouPonto = document.frmContato.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmContato.Email.focus();
        return;
    }
    //if (document.frmContato.DDD.value.length == 0) {
        //alert("Erro:\n\nDigite o seu DDD!");
        //document.frmContato.DDD.focus();
        //return;
    //}
    //if (document.frmContato.Telefone.value.length == 0) {
        //alert("Erro:\n\nDigite o seu Telefone!");
        //document.frmContato.Telefone.focus();
        //return;
    //}
    if (document.frmContato.Assunto.value.length == 0) {
        alert("Erro:\n\nSelecione o Assunto!");
        document.frmContato.Assunto.focus();
        return;
    }
    if (document.frmContato.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a Mensagem!");
        document.frmContato.Mensagem.focus();
        return;
    }
    document.getElementById("form_contato").style.display = "none";
    document.getElementById("erro_contato").style.display = "none";
    document.getElementById("sucesso_contato").style.display = "none";
    document.getElementById("loading_contato").style.display = "block";
    document.frmContato.submit();
}

function EnviarIndique() {
    if (document.frmIndique.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmIndique.Nome.focus();
        return;
    }
    if (document.frmIndique.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu e-Mail!");
        document.frmIndique.Email.focus();
        return;
    }
    AchouArroba = document.frmIndique.Email.value.indexOf("@");
    AchouPonto = document.frmIndique.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmIndique.Email.focus();
        return;
    }
    if (document.frmIndique.NomeAmigo1.value.length == 0) {
        alert("Erro:\n\nDigite o Nome do seu Amigo (1)!");
        document.frmIndique.NomeAmigo1.focus();
        return;
    }
    if (document.frmIndique.EmailAmigo1.value.length == 0) {
        alert("Erro:\n\nDigite o e-Mail do seu Amigo (1)!");
        document.frmIndique.EmailAmigo1.focus();
        return;
    }
    AchouArroba = document.frmIndique.EmailAmigo1.value.indexOf("@");
    AchouPonto = document.frmIndique.EmailAmigo1.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do e-Mail do seu Amigo (1) está inválido! Verifique!");
        document.frmIndique.EmailAmigo1.focus();
        return;
    }
    if (document.frmIndique.NomeAmigo2.value.length > 0) {
        if (document.frmIndique.EmailAmigo2.value.length == 0) {
            alert("Erro:\n\nDigite o e-Mail do seu Amigo (2)!");
            document.frmIndique.EmailAmigo2.focus();
            return;
        }
        AchouArroba = document.frmIndique.EmailAmigo2.value.indexOf("@");
        AchouPonto = document.frmIndique.EmailAmigo2.value.lastIndexOf(".");
        if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
            alert("O Formato do e-Mail do seu Amigo (2) está inválido! Verifique!");
            document.frmIndique.EmailAmigo2.focus();
            return;
        }
    }
    if (document.frmIndique.EmailAmigo2.value.length > 0) {
        if (document.frmIndique.NomeAmigo2.value.length == 0) {
            alert("Erro:\n\nDigite o Nome do seu Amigo (2)!");
            document.frmIndique.NomeAmigo2.focus();
            return;
        }    
        AchouArroba = document.frmIndique.EmailAmigo2.value.indexOf("@");
        AchouPonto = document.frmIndique.EmailAmigo2.value.lastIndexOf(".");
        if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
            alert("O Formato do e-Mail do seu Amigo (2) está inválido! Verifique!");
            document.frmIndique.EmailAmigo2.focus();
            return;
        }
    }

    if (document.frmIndique.NomeAmigo3.value.length > 0) {
        if (document.frmIndique.EmailAmigo3.value.length == 0) {
            alert("Erro:\n\nDigite o e-Mail do seu Amigo (3)!");
            document.frmIndique.EmailAmigo3.focus();
            return;
        }
        AchouArroba = document.frmIndique.EmailAmigo3.value.indexOf("@");
        AchouPonto = document.frmIndique.EmailAmigo3.value.lastIndexOf(".");
        if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
            alert("O Formato do e-Mail do seu Amigo (3) está inválido! Verifique!");
            document.frmIndique.EmailAmigo3.focus();
            return;
        }
    }
    if (document.frmIndique.EmailAmigo3.value.length > 0) {
        if (document.frmIndique.NomeAmigo3.value.length == 0) {
            alert("Erro:\n\nDigite o Nome do seu Amigo (3)!");
            document.frmIndique.NomeAmigo3.focus();
            return;
        }
        AchouArroba = document.frmIndique.EmailAmigo3.value.indexOf("@");
        AchouPonto = document.frmIndique.EmailAmigo3.value.lastIndexOf(".");
        if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
            alert("O Formato do e-Mail do seu Amigo (3) está inválido! Verifique!");
            document.frmIndique.EmailAmigo3.focus();
            return;
        }
    }

    document.getElementById("form_indique").style.display = "none";
    document.getElementById("erro_indique").style.display = "none";
    document.getElementById("sucesso_indique").style.display = "none";
    document.getElementById("loading_indique").style.display = "block";
    document.frmIndique.submit();
}

function EnviarHelborLiga() {
    if (document.frmHelborLiga.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmHelborLiga.Nome.focus();
        return;
    }
    if (document.frmHelborLiga.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmHelborLiga.Email.focus();
        return;
    }
    AchouArroba = document.frmHelborLiga.Email.value.indexOf("@");
    AchouPonto = document.frmHelborLiga.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmHelborLiga.Email.focus();
        return;
    }
    if (document.frmHelborLiga.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o seu DDD!");
        document.frmHelborLiga.DDD.focus();
        return;
    }
    if (document.frmHelborLiga.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmHelborLiga.Telefone.focus();
        return;
    }
    if (document.frmHelborLiga.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a Informação desejada!");
        document.frmHelborLiga.Mensagem.focus();
        return;
    }
    document.getElementById("form_helborliga").style.display = "none";
    document.getElementById("erro_helborliga").style.display = "none";
    document.getElementById("sucesso_helborliga").style.display = "none";
    document.getElementById("loading_helborliga").style.display = "block";
    document.frmHelborLiga.submit();
}

function EnviarNovosNegocios() {
    if (document.frmNovosNegocios.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmNovosNegocios.Nome.focus();
        return;
    }
    if (document.frmNovosNegocios.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmNovosNegocios.Email.focus();
        return;
    }
    AchouArroba = document.frmNovosNegocios.Email.value.indexOf("@");
    AchouPonto = document.frmNovosNegocios.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmNovosNegocios.Email.focus();
        return;
    }
    if (document.frmNovosNegocios.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o seu DDD!");
        document.frmNovosNegocios.DDD.focus();
        return;
    }
    if (document.frmNovosNegocios.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmNovosNegocios.Telefone.focus();
        return;
    }
    if (document.frmNovosNegocios.Logradouro.value.length == 0) {
        alert("Erro:\n\nDigite o Logradouro!");
        document.frmNovosNegocios.Logradouro.focus();
        return;
    }
    if (document.frmNovosNegocios.Mensagem.value.length == 0) {
        alert("Erro:\n\nDigite a Mensagem!");
        document.frmNovosNegocios.Mensagem.focus();
        return;
    }
    document.getElementById("form_novosnegocios").style.display = "none";
    document.getElementById("erro_novosnegocios").style.display = "none";
    document.getElementById("sucesso_novosnegocios").style.display = "none";
    document.getElementById("loading_novosnegocios").style.display = "block";
    document.frmNovosNegocios.submit();
}

function EnviarNewsletter() {
    if (document.frmNewsletter.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmNewsletter.Nome.focus();
        return;
    }
    if (document.frmNewsletter.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmNewsletter.Email.focus();
        return;
    }
    AchouArroba = document.frmNewsletter.Email.value.indexOf("@");
    AchouPonto = document.frmNewsletter.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmNewsletter.Email.focus();
        return;
    }
    document.getElementById("form_newsletter").style.display = "none";
    document.getElementById("erro_newsletter").style.display = "none";
    document.getElementById("sucesso_newsletter").style.display = "none";
    document.getElementById("loading_newsletter").style.display = "block";
    document.frmNewsletter.submit();
}

function EnviarCadastroNews() {
    if (document.frmCadastroNews.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmCadastroNews.Nome.focus();
        return;
    }
    if (document.frmCadastroNews.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmCadastroNews.Email.focus();
        return;
    }
    AchouArroba = document.frmCadastroNews.Email.value.indexOf("@");
    AchouPonto = document.frmCadastroNews.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmCadastroNews.Email.focus();
        return;
    }
    if (document.frmCadastroNews.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o DDD do seu Telefone!");
        document.frmCadastroNews.DDD.focus();
        return;
    }
    if (document.frmCadastroNews.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmCadastroNews.Telefone.focus();
        return;
    }
    if (document.frmCadastroNews.Endereco.value.length == 0) {
        alert("Erro:\n\nDigite o seu Endereço!");
        document.frmCadastroNews.Endereco.focus();
        return;
    }
    if (document.frmCadastroNews.CEP.value.length == 0) {
        alert("Erro:\n\nDigite o seu CEP!");
        document.frmCadastroNews.CEP.focus();
        return;
    }
    if (document.frmCadastroNews.Bairro.value.length == 0) {
        alert("Erro:\n\nDigite o seu Bairro!");
        document.frmCadastroNews.Bairro.focus();
        return;
    }
    if (document.frmCadastroNews.Cidade.value.length == 0) {
        alert("Erro:\n\nDigite a sua Cidade!");
        document.frmCadastroNews.Cidade.focus();
        return;
    }
    if (document.frmCadastroNews.Estado.value.length == 0) {
        alert("Erro:\n\nDigite o seu Estado!");
        document.frmCadastroNews.Estado.focus();
        return;
    }
    document.getElementById("form_cadastronews").style.display = "none";
    document.getElementById("erro_cadastronews").style.display = "none";
    document.getElementById("sucesso_cadastronews").style.display = "none";
    document.getElementById("loading_cadastronews").style.display = "block";
    document.frmCadastroNews.submit();
}

function EnviarPagamento() {
    if (document.frmPagamento.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmPagamento.Nome.focus();
        return;
    }
    if (document.frmPagamento.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmPagamento.Email.focus();
        return;
    }
    AchouArroba = document.frmPagamento.Email.value.indexOf("@");
    AchouPonto = document.frmPagamento.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmPagamento.Email.focus();
        return;
    }
    if (document.frmPagamento.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o DDD do seu Telefone!");
        document.frmPagamento.DDD.focus();
        return;
    }
    if (document.frmPagamento.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmPagamento.Telefone.focus();
        return;
    }
    document.getElementById("form_pagamento").style.display = "none";
    document.getElementById("erro_pagamento").style.display = "none";
    document.getElementById("sucesso_pagamento").style.display = "none";
    document.getElementById("loading_pagamento").style.display = "block";
    document.frmPagamento.submit();
}

function EnviarRecebaMaisInformacoes() {
    if (document.frmRecebaMaisInformacoes.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmRecebaMaisInformacoes.Nome.focus();
        return;
    }
    if (document.frmRecebaMaisInformacoes.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmRecebaMaisInformacoes.Email.focus();
        return;
    }
    AchouArroba = document.frmRecebaMaisInformacoes.Email.value.indexOf("@");
    AchouPonto = document.frmRecebaMaisInformacoes.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmRecebaMaisInformacoes.Email.focus();
        return;
    }
    if (document.frmRecebaMaisInformacoes.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o DDD do seu Telefone!");
        document.frmRecebaMaisInformacoes.DDD.focus();
        return;
    }
    if (document.frmRecebaMaisInformacoes.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmRecebaMaisInformacoes.Telefone.focus();
        return;
    }
    document.getElementById("form_recebamaisinformacoes").style.display = "none";
    document.getElementById("erro_recebamaisinformacoes").style.display = "none";
    document.getElementById("sucesso_recebamaisinformacoes").style.display = "none";
    document.getElementById("loading_recebamaisinformacoes").style.display = "block";
    document.frmRecebaMaisInformacoes.submit();
}

function FichaProduto(NomeEmpreendimento,idEmpreendimento) {
    if (idEmpreendimento.length > 0) {
        parent.location.href = "/" + NomeEmpreendimento;
    }
}

function FichaProduto2(NomeEmpreendimento, idEmpreendimento) {
    alert(NomeEmpreendimento + "-" + idEmpreendimento);
    if (idEmpreendimento.length > 0) {
        parent.location.href = "/" + NomeEmpreendimento;
    }
}
function FichaProdutoObras(NomeEmpreendimento, idEmpreendimento) {
    if (idEmpreendimento.length > 0) {
        parent.location.href = "/" + NomeEmpreendimento + "/obras/";
    }
}

function TracarRota() {
    if (document.frmRota.EnderecoProcurar.value.length == 0) {
        alert("Erro:\n\nDigite o Endereço de Origem para traçar a rota!");
        document.frmRota.EnderecoProcurar.focus();
        return;
    }
    document.getElementById("voltar1").style.display = "block";
    document.getElementById("voltar2").style.display = "block";
    document.getElementById("map").innerHTML = "<div id=\"loading\" style=\"margin-top: 90px; color: #444444; font-size: 16px; text-align: center;\"><img src=\"/images/loading4.gif\" width=\"35\" height=\"35\" alt=\"\" border=\"0\" style=\"margin: 5px;\" /><br />aguarde,<br />traçando a rota ...</div><div id=\"direcoes_0\" style=\"margin-top: 3px; display: none; height: 294px; width: 275px; border: 0px dashed #888888; float: left; margin-left: 5px; background-color: #ffffff; overflow-y: auto; overflow-x: hidden; font-family: Arial; font-size: 12px;\"><div id=\"direcoes\" style=\"display: table;\"></div></div><div id=\"map2\" style=\"display: block; height: 294px; width: 294px; margin-top: 3px; border: 0px dashed #888888; float: left; margin-left: 5px;\"></div>";
    document.getElementById("map").style.backgroundColor = "#ffffff";
    initialize(document.frmRota.EnderecoProcurar.value);
}

function ExibeErroRota() {
    document.getElementById("map").innerHTML = "<div style=\"margin-top: 70px; color: #444444; font-size: 16px; text-align: center;\"><img src=\"/images/alert.png\" width=\"32\" height=\"32\" alt=\"\" border=\"0\" style=\"margin: 5px;\" /><br /><b>ERRO:</b><br /><br />Não foi possível encontrar o endereço que você digitou!<br /><br />Por favor, informe outro endereço, detalhando o máximo possível desta vez (Endereço, Cidade e Estado).</div>";
}

function VoltarMapa() {
    document.getElementById("voltar1").style.display = "none";
    document.getElementById("voltar2").style.display = "none";
    document.getElementById("map").innerHTML = "<div style=\"margin-top: 90px; color: #444444; font-size: 16px; text-align: center;\"><img src=\"/images/loading4.gif\" width=\"35\" height=\"35\" alt=\"\" border=\"0\" style=\"margin: 5px;\" /><br />aguarde,<br />carregando o mapa ...</div>";
    document.getElementById("map").style.backgroundColor = "#ffffff";
    loadMap();
}

StatusFoto = 0;
StatusHome2 = 0;
StatusHome = 0;
timerFOTOS = null;
timerHOME2 = null;
timerHOME = null;

function CorrerFotos(Valor) {
    StatusFoto = Valor;
    Fotos();
}

function CancelarCorrerFotos() {
    StatusFoto = 0;
}

function VerificaFotos() {
    if (StatusFoto != 0) {
        Fotos();
    } else {
        clearTimeout(timerFOTOS);
    }
}

function PularFotos(Valor) {
    document.getElementById("rolagem_fotos").scrollLeft = document.getElementById("rolagem_fotos").scrollLeft + Valor;
}

function Fotos() {
    document.getElementById("rolagem_fotos").scrollLeft = document.getElementById("rolagem_fotos").scrollLeft + StatusFoto;
    timerFOTOS = setTimeout("VerificaFotos()", 1);
}

/*---------------------------------------------------------------------------------------*/
function CorrerHome2(Valor) {
    
    StatusHome2 = Valor;
    Home2();
}

function CancelarCorrerHome2() {
    StatusHome2 = 0;
}

function VerificaHome2() {
    if (StatusHome2 != 0) {
        Home2();
    } else {
        clearTimeout(timerHome2);
    }
}

function PularHome2(Valor) {
    document.getElementById("rolagem_home2").scrollLeft = document.getElementById("rolagem_home2").scrollLeft + Valor;
}

function Home2() {
    document.getElementById("rolagem_home2").scrollLeft = document.getElementById("rolagem_home2").scrollLeft + StatusHome2;
    //timerHome2 = setTimeout("VerificaHome2()", 1);
}

/*-----------------------------------------------------------*/
function BoxAcompanhe() {
    if (document.getElementById("bAcompanhe").style.display == "block") {
        document.getElementById("bAcompanhe").style.display = "none";
    } else {
        document.getElementById("bAcompanhe").style.display = "block";
    }
}

function CorrerHome1(Valor) {
    StatusHome1 = Valor;
    Home1();
}

function CancelarCorrerHome1() {
    StatusHome1 = 0;
}

function VerificaHome1() {
    if (StatusHome1 != 0) {
        Home1();
    } else {
        clearTimeout(timerHOME1);
    }
}

function PularHome1(Valor) {
    document.getElementById("rolagem_home1").scrollLeft = document.getElementById("rolagem_home1").scrollLeft + Valor;
}

function Home1() {
    document.getElementById("rolagem_home1").scrollLeft = document.getElementById("rolagem_home1").scrollLeft + StatusHome1;
    timerHOME1 = setTimeout("VerificaHome1()", 1);
}

function ProximoBannerHome() {
    splitBanners = ListaBanners.split("|");
    splitNomeBanners = ListaNomeBanners.split("|");
    splitListaIDBanners = ListaIDBanners.split("|");
    splitListaPreLancamentos = ListaPreLancamentos.split("|");
    splitListaBreveLancamentos = ListaBreveLancamentos.split("|");   
    if (BannerAtual == splitBanners.length-1) {
        BannerAtual = 1;
    } else {
        BannerAtual++;
    }
    if (ListaTotalVendidos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/100vendido.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else if (ListaPreLancamentos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/prelancamento.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else if (ListaBreveLancamentos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/brevelancamento.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else {
        document.getElementById("flash_home").innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    }
    for (x = 1; x <= splitBanners.length - 1; x++) {
        document.getElementById("botao_home_" + x).style.backgroundImage = "url(images/circulo.png)";
        document.getElementById("botao_home_" + x).style.color = "#222222";
    }
    document.getElementById("botao_home_" + BannerAtual).style.backgroundImage = "url(images/circulo_on.png)";
    document.getElementById("botao_home_" + BannerAtual).style.color = "#FFFFFF";
    document.getElementById("legenda_atual").innerHTML = splitNomeBanners[BannerAtual - 1];
}

function ProximoBannerHome2(Valor) {
    splitBanners = ListaBanners.split("|");
    splitNomeBanners = ListaNomeBanners.split("|");
    splitListaIDBanners = ListaIDBanners.split("|");
    splitListaPreLancamentos = ListaPreLancamentos.split("|");
    splitListaBreveLancamentos = ListaBreveLancamentos.split("|");   
    BannerAtual = Valor;
    if (ListaTotalVendidos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/100vendido.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else if (ListaPreLancamentos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/prelancamento.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else if (ListaBreveLancamentos.indexOf("_" + splitListaIDBanners[BannerAtual - 1] + "|") >= 0) {
        document.getElementById("flash_home").innerHTML = "<div style=\"position: absolute;\"><img src=\"/images/brevelancamento.png\" width=\"100\" height=\"101\" alt=\"\" border=\"0\" /></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";
    } else {
        document.getElementById("flash_home").innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"748\" height=\"187\"><param name=\"movie\" value=\"/" + splitBanners[BannerAtual - 1] + "\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\" allowscriptaccess=\"always\" ></embed></object>";    
    }    
    for (x = 1; x <= splitBanners.length - 1; x++) {
        document.getElementById("botao_home_" + x).style.backgroundImage = "url(images/circulo.png)";
        document.getElementById("botao_home_" + x).style.color = "#222222";
    }
    document.getElementById("botao_home_" + BannerAtual).style.backgroundImage = "url(images/circulo_on.png)";
    document.getElementById("botao_home_" + BannerAtual).style.color = "#FFFFFF";
    document.getElementById("legenda_atual").innerHTML = splitNomeBanners[BannerAtual - 1];
}

function ExibeNomeHome(Nome) {
   document.getElementById("nome_home_" + Nome).style.marginLeft = 33+((27 * Nome)-27) + "px";
   document.getElementById("nome_home_" + Nome).style.display = "block";
}

function OcultaNomeHome(Nome) {
    document.getElementById("nome_home_" + Nome).style.display = "none";
}

function EnviarPrimeiraMao() {
    if (document.frmPrimeiraMao.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmPrimeiraMao.Nome.focus();
        return;
    }
    if (document.frmPrimeiraMao.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmPrimeiraMao.Email.focus();
        return;
    }
    AchouArroba = document.frmPrimeiraMao.Email.value.indexOf("@");
    AchouPonto = document.frmPrimeiraMao.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmPrimeiraMao.Email.focus();
        return;
    }
    if (document.frmPrimeiraMao.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o DDD do seu Telefone!");
        document.frmPrimeiraMao.DDD.focus();
        return;
    }
    if (document.frmPrimeiraMao.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmPrimeiraMao.Telefone.focus();
        return;
    }
    if ((document.frmPrimeiraMao.Finalidade[0].checked == false) && (document.frmPrimeiraMao.Finalidade[1].checked == false)) {
        alert("Erro:\n\nSelecione a Finalidade da Compra!");
        return;
    }
    document.getElementById("form_primeiramao").style.display = "none";
    document.getElementById("erro_primeiramao").style.display = "none";
    document.getElementById("sucesso_primeiramao").style.display = "none";
    document.getElementById("loading_primeiramao").style.display = "block";
    document.frmPrimeiraMao.submit();
}

function LinkBannerHome() {
    splitBanners = ListaBanners.split("|");
    splitNomeBanners = ListaNomeBanners.split("|");
    splitListaIDBanners = ListaIDBanners.split("|");
    splitListaPreLancamentos = ListaPreLancamentos.split("|");
    splitListaBreveLancamentos = ListaBreveLancamentos.split("|");
    splitListaNomesLinksBanners = ListaNomesLinksBanners.split("|");


    RegistraQuantidadeClicks(splitListaIDBanners[BannerAtual - 1]);

    if (splitListaNomesLinksBanners[BannerAtual - 1].indexOf("http") >= 0) {
        window.location.href = splitListaNomesLinksBanners[BannerAtual - 1];
}
    else{
        parent.location.href = "/" + splitListaNomesLinksBanners[BannerAtual - 1];
    }

}
function RegistraQuantidadeClicks(Empreendimento) {
    ajax2 = ajaxInit();
    if (Empreendimento.lenght == 0 ){
        return;
    }
    if (ajax2) {
        ajax2.open("GET", "ajax_registracliques.asp?idEmpreendimento=" + Empreendimento + "&Rand=" + Math.ceil(Math.random() * 100000), true);
        ajax2.setRequestHeader("Content-type", "charset=iso-8859-1");
        ajax2.onreadystatechange = function() {
            if (ajax2.readyState == 4) {
                if (ajax2.status == 200) {
                    resultado = ajax2.responseText;
                }
             }
        }
    }
    ajax2.send(null);
}

function RegistraClicks() {
    
    ajax2 = ajaxInit();
    if (ajax2) {
        ajax2.open("GET", "ajax_registracliques_breve.asp",true);
        ajax2.setRequestHeader("Content-type", "charset=iso-8859-1");
        ajax2.onreadystatechange = function() {
            if (ajax2.readyState == 4) {
                if (ajax2.status == 200) {
                    resultado = ajax2.responseText;
                }
            }
        }
    }
    ajax2.send(null);
}

function HabilitaNewsletter(Checado) {
    if (Checado) {
        document.getElementById("todoformserhelbor2").style.display = "block";
    } else {
        document.getElementById("todoformserhelbor2").style.display = "none";
        document.frmNewsletter.Endereco.value = "";
        document.frmNewsletter.CEP.value = "";
        document.frmNewsletter.Bairro.value = "";
        document.frmNewsletter.Cidade.value = "";
        document.frmNewsletter.Estado.value = "";
    }
} 

function AbrirReceba() {
    timerID = setTimeout("ClicaBanner()", 500);
}

function ClicaBanner() {
   if (document.createEventObject){
      var evt = document.createEventObject();
      return document.getElementById("linkgeral").fireEvent('onclick', evt)
   } else {
      var evt = document.createEvent("HTMLEvents");
      evt.initEvent("click", true, true );
      return !document.getElementById("linkgeral").dispatchEvent(evt);
   }

}

function Clica(Elemento) {
    timerID = setTimeout("ClicaLightview('" + Elemento + "')", 500);
}

function ClicaLightview(Elemento) {
    if (document.createEventObject) {
        var evt = document.createEventObject();
        return document.getElementById(Elemento).fireEvent('onclick', evt)
    } else {
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent("click", true, true);
        return !document.getElementById(Elemento).dispatchEvent(evt);
    }
}

function Imprimir(id) {
    //window.open('"../imprimir.asp?Imagem=" + document.getElementById("link_" + (parseInt(id) - 1)).href', '_blank');
    document.getElementById("frmImprimir").src = "../imprimir.asp?Imagem=" + document.getElementById("link_" + (parseInt(id) - 1)).href;
    //location.href = "../imprimir.asp?Imagem=" + document.getElementById("link_" + (parseInt(id) - 1)).href;
    return;
}

function TourVirtual(URL, Largura, Altura) {
    if (URL.indexOf("http://") >= 0) {
        JanelaTour = window.open(URL, "JanelaTour", "width=" + Largura + ",height=" + Altura + ",left=10,top=10");
    } else {
        JanelaTour = window.open("/" + URL, "JanelaTour", "width=" + Largura + ",height=" + Altura + ",left=10,top=10");
    }
    JanelaTour.focus();
}
function PopulaCidade(Estado) {
    if (Estado.length > 0) {
        ajax2 = ajaxInit();
        resultado = "";
        document.getElementById("CidadeFornecedor").disabled = true;
        for (i = document.getElementById("CidadeFornecedor").length - 1; i >= 0; i--) {
            document.getElementById("CidadeFornecedor").remove(i);
        }
        document.getElementById("CidadeFornecedor").options[0] = new Option("Aguarde carregando cidades...", "Aguarde carregando cidades...");
        document.getElementById("CidadeFornecedor").selectedIndex = 0
        if (ajax2) {
            ajax2.open("GET", "ajax_retornacidades.asp?Estado=" + Estado + "&Rand=" + Math.ceil(Math.random() * 100000), true);
            ajax2.setRequestHeader("Content-type", "charset=iso-8859-1");
            ajax2.onreadystatechange = function() {
                if (ajax2.readyState == 4) {
                    if (ajax2.status == 200) {
                        resultado = ajax2.responseText;

                        if (resultado.length > 0) {
                            document.getElementById("CidadeFornecedor").disabled = false;
                            for (i = document.getElementById("CidadeFornecedor").length - 1; i >= 0; i--) {
                                document.getElementById("CidadeFornecedor").remove(i);
                            }
                            splitCidades = resultado.split("|");
                            for (i = 0; i <= splitCidades.length - 1; i++) {
                                document.getElementById("CidadeFornecedor").options[i] = new Option(splitCidades[i], splitCidades[i]);

                            }
                        }
                    }
                }
            }
            ajax2.send(null);
        }
    } else {
        for (i = document.getElementById("CidadeFornecedor").length - 1; i >= 0; i--) {
            document.getElementById("CidadeFornecedor").remove(i);
        }
        document.getElementById("CidadeFornecedor").options[0] = new Option("Selecione um estado...", "");
        return;   
    }
}
function Fornecedores() {
    if (document.frmfornecedores.Empresa.value.length == 0) {
        alert("Erro:\n\nDigite o seu Empresa!");
        document.frmfornecedores.Empresa.focus();
        return;
    }
    if (document.frmfornecedores.Nome.value.length == 0) {
        alert("Erro:\n\nDigite o seu Nome!");
        document.frmfornecedores.Nome.focus();
        return;
    }
    if (document.frmfornecedores.DDD.value.length == 0) {
        alert("Erro:\n\nDigite o seu DDD!");
        document.frmfornecedores.DDD.focus();
        return;
    }
    if (document.frmfornecedores.Telefone.value.length == 0) {
        alert("Erro:\n\nDigite o seu Telefone!");
        document.frmfornecedores.Telefone.focus();
        return;
    }
    if (document.frmfornecedores.Email.value.length == 0) {
        alert("Erro:\n\nDigite o seu E-Mail!");
        document.frmfornecedores.Email.focus();
        return;
    }
    AchouArroba = document.frmfornecedores.Email.value.indexOf("@");
    AchouPonto = document.frmfornecedores.Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert("O Formato do seu e-Mail está inválido! Verifique!");
        document.frmfornecedores.Email.focus();
        return;
    }
    if (document.frmfornecedores.Estado.value.length == 0) {
        alert("Erro:\n\nDigite o seu Estado!");
        document.frmfornecedores.Estado.focus();
        return;
    }
    if (document.frmfornecedores.CidadeFornecedor.value.length == 0) {
        alert("Erro:\n\nDigite o seu Cidade!");
        document.frmfornecedores.CidadeFornecedor.focus();
        return;
    }
    if (document.frmfornecedores.AreaAtuacao.value.length == 0) {
        alert("Erro:\n\nInforme a Área de Atuação!");
        document.frmfornecedores.AreaAtuacao.focus();
        return;
    }
    if (document.frmfornecedores.TipoServico.value.length == 0) {
        alert("Erro:\n\nInforme a Tipo de Serviço!");
        document.frmfornecedores.TipoServico.focus();
        return;
    }
    if (document.frmfornecedores.Mensagem.value.length == 0) {
        alert("Erro:\n\Informe a Mensagem!");
        document.frmTrabalheConosco.Mensagem.focus();
        return;
    }
    document.getElementById("form_fornecedores").style.display = "none";
    document.getElementById("erro_fornecedores").style.display = "none";
    document.getElementById("sucesso_fornecedores").style.display = "none";
    document.getElementById("loading_fornecedores").style.display = "block";
    document.frmfornecedores.submit();
}
function ExibeSiteProduto(Obj) {
    i = 0;
    for (i = 0; i < Obj.length; i++) {
        if (document.getElementById("Link_" + Obj[i].value) != null) {
            document.getElementById("Link_" + Obj[i].value).style.display = "none";
            document.getElementById("Link_" + Obj.value).style.display = "block";
        } 
    }
}

/*--------------------*/
function CorrerHome3(Valor) {
    StatusHome3 = Valor;
    Home3();
}

function CancelarCorrerHome3() {
    StatusHome3 = 0;
}

function VerificaHome3() {
    if (StatusHome3 != 0) {
        Home3();
    } else {
        clearTimeout(timerHome3);
    }
}

function PularHome3(Valor) {
    document.getElementById("rolagem_Home3").scrollLeft = document.getElementById("rolagem_Home3").scrollLeft + Valor;
}

function Home3() {
    document.getElementById("rolagem_Home3").scrollLeft = document.getElementById("rolagem_Home3").scrollLeft + StatusHome3;
    //timerHome3 = setTimeout("VerificaHome3()", 1);
}

/*--------------------*/

/*--------------------*/
function CorrerHome4(Valor) {
    StatusHome4 = Valor;
    Home4();
}

function CancelarCorrerHome4() {
    StatusHome4 = 0;
}

function VerificaHome4() {
    if (StatusHome4 != 0) {
        Home4();
    } else {
        clearTimeout(timerHome4);
    }
}

function PularHome4(Valor) {
    document.getElementById("rolagem_Home3").scrollLeft = document.getElementById("rolagem_Home3").scrollLeft + Valor;
}

function Home4() {
    document.getElementById("rolagem_Home3").scrollLeft = document.getElementById("rolagem_Home3").scrollLeft - StatusHome4;
    //timerHome4 = setTimeout("VerificaHome4()", 1);
}

/*--------------------*/

function RegistraVisitacoes(Empreendimento) {
    
    ajax2 = ajaxInit();
    if (ajax2) {
            ajax2.open("GET", "ajax_registracliques_espelho.asp?idEmpreendimento=" + Empreendimento + "&Rand=" + Math.ceil(Math.random() * 100000), true);
            ajax2.setRequestHeader("Content-type", "charset=iso-8859-1");
            ajax2.onreadystatechange = function () {
                if (ajax2.readyState == 4) {
                    if (ajax2.status == 200) {
                        resultado = ajax2.responseText;
                    }
                }
            }
        }
        ajax2.send(null);
    
}
