window.onerror = TrataErro;

function TrataErro() {
    return true;
}

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;
        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;
        document.frmBusca.action = "empreendimentos.asp";
        document.frmBusca.submit();
    }
}

function CarregaPaginaImprensa(Pagina) {
    if (Pagina.length > 0) {
        document.frmImprensa.PaginaAtual.value = Pagina;
        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 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 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.Empreendimento.selectedIndex == 0) {
        alert("Erro:\n\nSelecione o Empreendimento!");
        document.frmContato.Empreendimento.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 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("|");   
    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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></embed></object>";
    } else if (ListaPreLancamentos.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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></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("|");
    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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></embed></object>";
    } else if (ListaPreLancamentos.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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></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\"><embed src=\"/" + splitBanners[BannerAtual - 1] + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" width=\"748\" height=\"187\"></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() {
    splitListaNomesLinksBanners = ListaNomesLinksBanners.split("|");
    //location.href = "ficha_produto.asp?idEmpreendimento=" + splitListaIDBanners[BannerAtual - 1];
    parent.location.href = "/" + splitListaNomesLinksBanners[BannerAtual - 1];
}

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) {
    alert(id);
    parent.window.frames[1].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();
}