﻿window.onerror = TrataErro;

function TrataErro() {
    return true;
}

URLAtual = "";
splitURLAtual = location.href.split("/");
for (xURLAtual = 3; xURLAtual < splitURLAtual.length; xURLAtual++) {
    URLAtual = URLAtual + splitURLAtual[xURLAtual] + "/";
}

function SelecaoFoto(Objeto, Acao) {
    if (Acao == "over") {
        Objeto.style.cursor = "pointer";
        if (Objeto.style.borderColor != "#eb1c22") {
            Objeto.style.borderColor = "#777777";
        }
    } else {
        Objeto.style.cursor = "default";
        if (Objeto.style.borderColor != "#eb1c22") {
            Objeto.style.borderColor = "#ffffff";
        }
    }
}

function LigamosParaVoce(Status) {
    StatusClique = false;
    if (Status == undefined) {
        Status = 0;
    }
    if (document.getElementById("ligamos_para_voce").style.display != "block") {
        _gaq.push(['_trackPageview', '/ficha-produto/ligamos-para-voce']);
        document.getElementById("ligamos_para_voce").style.display = "block";
        document.getElementById("indique_amigo").style.display = "none";
        document.getElementById("compartilhe_amigo").style.display = "none";
        SomeDadosTopo();
        if (document.getElementById("saiba_mais_produto") != undefined) {
            document.getElementById("saiba_mais_produto").style.display = "none";
        }
        SomeDadosTopo();
        timerCLIQUE = setTimeout("CliqueTrue()", 250);
    } else {
        if (Status == 0) {
            document.getElementById("ligamos_para_voce").style.display = "none";
        }
        timerCLIQUE = setTimeout("CliqueFalse()", 250);
    }
}

function LigamosParaVoce2() {
    location.href = "/ligamos_para_voce";
}

function CarregaFoto(Objeto, Arquivo, ArquivoThumb, Origem, TotalImagens, TotalPlantas, TotalVideos, MensagemLoading, Indice, Tipo) {
    document.getElementById("loading_imagem").style.display = "block";
    document.getElementById("arquivo_imagem").style.display = "none";
    if (TotalImagens > 0) {
        for (x = 1; x <= TotalImagens; x++) {
            if (document.getElementById("imagem_atual_" + x) != undefined) {
                document.getElementById("imagem_atual_" + x).style.borderColor = "#ffffff";
            }
        }
    }
    if (TotalPlantas > 0) {
        for (x = 1; x <= TotalPlantas; x++) {
            if (document.getElementById("planta_atual_" + x) != undefined) {
                document.getElementById("planta_atual_" + x).style.borderColor = "#ffffff";
            }
        }
    }
    if (TotalVideos > 0) {
        for (x = 1; x <= TotalVideos; x++) {
            if (document.getElementById("video_atual_" + x) != undefined) {
                document.getElementById("video_atual_" + x).style.borderColor = "#ffffff";
            }
        }
    }
    Objeto.style.borderColor = "#eb1c22";
    //GravaSelecao(Tipo, ArquivoThumb);
    document.getElementById("arquivo_imagem").innerHTML = "<img id=\"arquivo_imagem_atual_" + Indice + "\" src=\"" + Origem + Arquivo + "\" alt=\"\" onload=\"ImagemCarregada('" + Indice + "');\" height=\"363\" width=\"516\" border=\"0\" />";
}

function ImagemCarregada(Indice) {
    timerID = setTimeout("SomeLoadingImagem(" + Indice + ")", 500);
}

function SomeLoadingImagem(Indice) {
    document.getElementById("loading_imagem").style.display = "none";
    document.getElementById("arquivo_imagem").style.display = "block";
    img = document.getElementById("arquivo_imagem_atual_" + Indice);
    if (img != undefined) {
        normal_width = img.width;
        img.removeAttribute("width");
        real_width = img.width;
        if (real_width < normal_width) {
            img.width = real_width;
        } else {
            img.width = normal_width;
        }

        normal_height = img.height;
        img.removeAttribute("height");
        real_height = img.height;
        if (real_height < normal_height) {
            img.height = real_height;
        } else {
            img.height = normal_height;
        }
    }
}

function SelecionaIndiceImagem(Indice, Acao) {
    document.getElementById(Acao + "_atual_" + Indice).style.borderColor = "#eb1c22";
}

function ExibirDetalheFichaProduto() {
    if (document.getElementById("ficha_produto_info_conteudo").style.display != "none") {
        document.getElementById("ficha_produto_info_conteudo").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_2").style.display = "block";
        document.getElementById("seta_minimizado").src = "/images/seta_mapa2.png";
        document.getElementById("minimizado_texto").innerHTML = "<a href='javascript:ExibirDetalheFichaProduto();'>" + document.getElementById("texto_detalhes_texto_2").innerHTML + "</a>";
    } else {
        document.getElementById("ficha_produto_info_conteudo").style.display = "table";
        document.getElementById("ficha_produto_info_conteudo_2").style.display = "none";
        document.getElementById("seta_minimizado").src = "/images/seta_mapa.png";
        document.getElementById("minimizado_texto").innerHTML = "<a href='javascript:ExibirDetalheFichaProduto();'>" + document.getElementById("texto_detalhes_texto").innerHTML + "</a>";
    }
}

function SelecionaAbaDetalheProduto2(Opcao) {
    if (document.getElementById("imagem_fichaproduto_faleconosco_1").src.indexOf("_off") < 0) {
        document.getElementById("fichaproduto_faleconosco_1").className = "abas_white_esq";
        document.getElementById("fichaproduto_faleconosco_2").style.marginRight = "10px";
        document.getElementById("fichaproduto_faleconosco").className = "abas_white_cen";
        document.getElementById("fichaproduto_faleconosco_2").className = "abas_white_esq";
        document.getElementById("imagem_fichaproduto_faleconosco_1").src = "/imgs/resultado_busca_03.jpg";
        document.getElementById("imagem_fichaproduto_faleconosco_2").src = "/imgs/resultado_busca_04.jpg";
        document.getElementById("form_faleconosco").style.display = "none";
    }
    if (Opcao == "fale_conosco") {
        location.href = "#fale_conosco";
        document.getElementById("fale_conosco").focus();
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "none";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "none";
        document.getElementById("ficha_produto_info_lazer").style.display = "none";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_faleconosco_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_faleconosco_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_faleconosco_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_faleconosco").className = "abas_red_cen";
            document.getElementById("fichaproduto_faleconosco_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_faleconosco_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_faleconosco_2").src = "/imgs/resultado_busca_02.jpg";
            document.getElementById("form_faleconosco").style.display = "block";
        }
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_white_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_white_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_white_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_white_cen";
            document.getElementById("fichaproduto_lazer_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_white_cen";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_04.jpg";
        }
        //window.scroll(0, 9999);
    }
}

function SelecionaAbaDetalheProduto(Opcao) {
    if (document.getElementById("imagem_fichaproduto_faleconosco_1").src.indexOf("_off") < 0) {
        document.getElementById("fichaproduto_faleconosco_1").className = "abas_white_esq";
        document.getElementById("fichaproduto_faleconosco_2").style.marginRight = "10px";
        document.getElementById("fichaproduto_faleconosco").className = "abas_white_cen";
        document.getElementById("fichaproduto_faleconosco_2").className = "abas_white_esq";
        document.getElementById("imagem_fichaproduto_faleconosco_1").src = "/imgs/resultado_busca_03.jpg";
        document.getElementById("imagem_fichaproduto_faleconosco_2").src = "/imgs/resultado_busca_04.jpg";
        document.getElementById("form_faleconosco").style.display = "none";
    }
    if (Opcao == "fale_conosco") {        
        document.getElementById("fale_conosco").focus();
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "none";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "none";
        document.getElementById("ficha_produto_info_lazer").style.display = "none";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "none";        
        if (document.getElementById("imagem_fichaproduto_faleconosco_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_faleconosco_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_faleconosco_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_faleconosco").className = "abas_red_cen";
            document.getElementById("fichaproduto_faleconosco_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_faleconosco_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_faleconosco_2").src = "/imgs/resultado_busca_02.jpg";
            document.getElementById("form_faleconosco").style.display = "block";
        }
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_white_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_white_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_white_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_white_cen";
            document.getElementById("fichaproduto_lazer_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_white_cen";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_04.jpg";
        }
        //window.scroll(0, 9999);
    }
    if (Opcao == "ficha_técnica") {
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "block";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "block";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "none";
        document.getElementById("ficha_produto_info_lazer").style.display = "none";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_white_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_red_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_red_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_02.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_white_cen";
            document.getElementById("fichaproduto_lazer_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_white_cen";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_04.jpg";            
        }        
    }
    if (Opcao == "lazer") {
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "none";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "none";
        document.getElementById("ficha_produto_info_lazer").style.display = "block";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_white_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_white_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_white_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_red_cen";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_lazer_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_02.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_white_cen";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_04.jpg";
        }        
    }
    if (Opcao == "características") {
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "none";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "none";
        document.getElementById("ficha_produto_info_lazer").style.display = "none";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "block";
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_white_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_white_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_white_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_white_cen";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_lazer_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_red_cen";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_02.jpg";
        }
    }
    if (Opcao == "apresentação") {
        document.getElementById("ficha_produto_info_conteudo_02").style.display = "none";
        document.getElementById("ficha_produto_info_conteudo_03").style.display = "none";
        document.getElementById("ficha_produto_info_apresentacao").style.display = "block";
        document.getElementById("ficha_produto_info_lazer").style.display = "none";
        document.getElementById("ficha_produto_info_caracteristicas").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_apresentacao_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_apresentacao_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_apresentacao").className = "abas_red_cen";
            document.getElementById("fichaproduto_apresentacao_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_apresentacao_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_apresentacao_2").src = "/imgs/resultado_busca_02.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_fichatecnica_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_fichatecnica_1").className = "abas_white_esq";
            if (document.getElementById("imagem_fichaproduto_apresentacao_1") != undefined) {
                document.getElementById("fichaproduto_fichatecnica_1").style.marginLeft = "10px";
            }
            document.getElementById("fichaproduto_fichatecnica_2").style.marginRight = "10px";
            document.getElementById("fichaproduto_fichatecnica").className = "abas_white_cen";
            document.getElementById("fichaproduto_fichatecnica_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_fichatecnica_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_fichatecnica_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_lazer_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_lazer_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer").className = "abas_white_cen";
            document.getElementById("fichaproduto_lazer_2").className = "abas_white_esq";
            document.getElementById("fichaproduto_lazer_2").style.marginRight = "10px";
            document.getElementById("imagem_fichaproduto_lazer_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_lazer_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_caracteristicas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_caracteristicas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_caracteristicas").className = "abas_white_cen";
            document.getElementById("fichaproduto_caracteristicas_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_caracteristicas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_caracteristicas_2").src = "/imgs/resultado_busca_04.jpg";
            document.getElementById("fichaproduto_faleconosco_1").style.marginLeft = "10px";
        }        
    }

}

function VerMapa() {
    _gaq.push(['_trackPageview', '/ficha-produto/ver-mapa-de-localizacao']);
    document.getElementById("localizacao").focus();
}

function FocoCampo(Objeto, Campo, Acao) {
    if (Acao == "blur") {
        if (Objeto.value.length == 0) {
            if (Campo == "Nome") {
                Objeto.value = "* Nome Completo";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "NomeFaleConosco") {
                Objeto.value = "* Nome";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "NomeLigamos") {
                Objeto.value = "* Nome";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "DDD") {
                Objeto.value = "* DDD";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "DDDFaleConosco") {
                Objeto.value = "DDD";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "DDDLigamos") {
                Objeto.value = "* DDD";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "Telefone") {
                Objeto.value = "* Telefone";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "TelefoneFaleConosco") {
                Objeto.value = "Telefone";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "TelefoneLigamos") {
                Objeto.value = "* Telefone";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "Mensagem") {
                Objeto.value = "* Digite a Mensagem";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "ComentariosLigamos") {
                Objeto.value = "Comentários";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "ComentariosFaleConosco") {
                Objeto.value = "Comentários";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "Email") {
                Objeto.value = "E-Mail";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "EmailFaleConosco") {
                Objeto.value = "* E-Mail";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "EmailLigamos") {
                Objeto.value = "E-Mail";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "EnderecoOrigem") {
                Objeto.value = "Digite o endereço de origem";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "NomeIndique") {
                Objeto.value = "Seu Nome:";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "EmailIndique") {
                Objeto.value = "Seu E-Mail:";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "NomeAmigoIndique") {
                Objeto.value = "Nome do seu Amigo:";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "EmailAmigoIndique") {
                Objeto.value = "E-Mail do seu Amigo:";
                Objeto.style.fontStyle = "italic";
            }
            if (Campo == "NomeCorretor") {
                Objeto.value = "Informe o nome do Corretor:";
                Objeto.style.fontStyle = "italic";
            }
        }
    } else {
        if (Objeto.value == "* Nome Completo") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "* Nome") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "* DDD") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "DDD") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "* Telefone") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Telefone") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "* Digite a Mensagem") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "* E-Mail") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "E-Mail") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Comentários") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Informe o nome do Corretor:") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }        
        if (Objeto.value == "Digite o endereço de origem") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Seu Nome:") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Seu E-Mail:") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "Nome do seu Amigo:") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
        if (Objeto.value == "E-Mail do seu Amigo:") {
            Objeto.value = "";
            Objeto.style.fontStyle = "normal";
        }
    }
}

function LimpaErro(Objeto) {
}

function EnviarFaleConosco(idEmpreendimento, Mensagem1, Mensagem2, Mensagem3, Mensagem4, Mensagem5, Mensagem6) {
    Nome = document.getElementById("Nome");
    Email = document.getElementById("Email");
    DDD = document.getElementById("DDD");
    Telefone = document.getElementById("Telefone");
    Mensagem = document.getElementById("Mensagem");
    if ((Nome.value.length == 0) || (Nome.value == "* Nome Completo")) {
        alert(Mensagem1);
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        //Nome.style.borderColor = "#eb1c24";
        Nome.focus();
        return;
    }
    if ((Email.value.length == 0) || (Email.value == "* E-Mail")) {
        alert(Mensagem2);
        //Email.style.borderColor = "#eb1c24";
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        Email.focus();
        return;
    }
    AchouArroba = Email.value.indexOf("@");
    AchouPonto = Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert(Mensagem6);
        //Email.style.borderColor = "#eb1c24";
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        Email.focus();
        return;
    }
    if ((DDD.value.length == 0) || (DDD.value == "* DDD")) {
        alert(Mensagem3);
        //DDD.style.borderColor = "#eb1c24";
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        DDD.focus();
        return;
    }
    if ((Telefone.value.length == 0) || (Telefone.value == "* Telefone")) {
        alert(Mensagem4);
        //Telefone.style.borderColor = "#eb1c24";
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        Telefone.focus();
        return;
    }
    if ((Mensagem.value.length == 0) || (Mensagem.value == "* Digite a Mensagem")) {
        alert(Mensagem5);
        //Mensagem.style.borderColor = "#eb1c24";
        document.getElementById("form_faleconosco_loading").style.display = "none";
        document.getElementById("form_faleconosco_erro").style.display = "none";
        document.getElementById("form_faleconosco_ok").style.display = "none";
        document.getElementById("form_faleconosco").style.display = "block";
        Mensagem.focus();
        return;
    }
    document.getElementById("form_faleconosco_loading").style.display = "block";
    document.getElementById("form_faleconosco_erro").style.display = "none";
    document.getElementById("form_faleconosco_ok").style.display = "none";
    document.getElementById("form_faleconosco").style.display = "none";
    
    var ajaxResultado = null;
    ajaxResultado = ajaxInit();
    resultado = "";
    if (ajaxResultado) {
        ajaxResultado.open("GET", "/ajax/enviar_fale_conosco.aspx?idEmpreendimento=" + idEmpreendimento + "&Nome=" + Nome.value + "&Email=" + Email.value + "&DDD=" + DDD.value + "&Telefone=" + Telefone.value + "&Mensagem=" + Mensagem.value + "&Rand=" + Math.ceil(Math.random() * 100000), true);
        ajaxResultado.setRequestHeader("Content-type", "charset=iso-8859-1");
        ajaxResultado.onreadystatechange = function() {
            if (ajaxResultado.readyState == 4) {
                if (ajaxResultado.status == 200) {
                    resultado = ajaxResultado.responseText;
                    if (resultado == "1") {
                        var ajaxResultadoAdwords = null;
                        ajaxResultadoAdwords = ajaxInit();
                        resultadoAdwords = "";
                        if (ajaxResultadoAdwords) {
                            ajaxResultadoAdwords.open("GET", "/enviar_fale_conosco_ficha_produto_adwords.aspx?Rand=" + Math.ceil(Math.random() * 100000), true);
                            ajaxResultadoAdwords.setRequestHeader("Content-type", "charset=iso-8859-1");
                            ajaxResultadoAdwords.onreadystatechange = function () {
                                if (ajaxResultadoAdwords.readyState == 4) {
                                    if (ajaxResultadoAdwords.status == 200) {
                                        resultadoAdwords = ajaxResultadoAdwords.responseText;
                                        timerID = setTimeout("ExibeOKFaleConosco()", 500);
                                    } else {
                                        timerID = setTimeout("ExibeErroFaleConosco()", 500);
                                    }
                                }
                            }
                            ajaxResultadoAdwords.send(null);
                        }
                    } else {
                        timerID = setTimeout("ExibeErroFaleConosco()", 500);
                    }
                } else {
                    timerID = setTimeout("ExibeErroFaleConosco()", 500);
                }
            }
        }
        ajaxResultado.send(null);
    }    
}

function ExibeErroFaleConosco() {
    document.getElementById("form_faleconosco_loading").style.display = "none";
    document.getElementById("form_faleconosco_erro").style.display = "block";
    document.getElementById("form_faleconosco_ok").style.display = "none";
    document.getElementById("form_faleconosco").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/fale-conosco/erro']);
}

function ExibeErroFaleConoscoErro() {
    document.getElementById("conteudo_fale_conosco_loading").style.display = "none";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "block";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "none";
    document.getElementById("conteudo_fale_conosco").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/fale-conosco/erro']);
}

function ExibeOKFaleConosco() {
    document.getElementById("form_faleconosco_loading").style.display = "none";
    document.getElementById("form_faleconosco_erro").style.display = "none";
    document.getElementById("form_faleconosco_ok").style.display = "block";
    document.getElementById("form_faleconosco").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/fale-conosco/ok']);
}

function ExibeOKFaleConoscoErro() {
    document.getElementById("conteudo_fale_conosco_loading").style.display = "none";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "none";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "block";
    document.getElementById("conteudo_fale_conosco").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/fale-conosco/ok']);
}

function TentarNovamenteFaleConosco(idEmpreendimento, MensagemErroNome, MensagemErroEmail, MensagemErroDDD, MensagemErroTelefone, MensagemErroMensagem, MensagemErroEmail2) {
    EnviarFaleConosco(idEmpreendimento, MensagemErroNome, MensagemErroEmail, MensagemErroDDD, MensagemErroTelefone, MensagemErroMensagem, MensagemErroEmail2);
}

function TentarNovamenteFaleConosco2() {
    EnviarFaleConosco2();
}

function TentarNovamenteFaleConosco3() {
    EnviarFaleConosco3();
}

function VoltarFaleConosco(Limpar) {
    Nome = document.getElementById("Nome");
    Email = document.getElementById("Email");
    DDD = document.getElementById("DDD");
    Telefone = document.getElementById("Telefone");
    Mensagem = document.getElementById("Mensagem");
    document.getElementById("form_faleconosco_loading").style.display = "none";
    document.getElementById("form_faleconosco_erro").style.display = "none";
    document.getElementById("form_faleconosco_ok").style.display = "none";
    document.getElementById("form_faleconosco").style.display = "block";
    if (Limpar) {
        Nome.value = "* Nome Completo";
        Nome.style.fontStyle = "italic";
        Email.value = "* E-Mail";
        Email.style.fontStyle = "italic";
        DDD.value = "* DDD";
        DDD.style.fontStyle = "italic";
        Telefone.value = "* Telefone";
        Telefone.style.fontStyle = "italic";
        Mensagem.value = "* Digite a Mensagem";
        Mensagem.style.fontStyle = "italic";
    }
    Nome.focus();
}

function VoltarFaleConosco2(Limpar) {
    Nome = document.getElementById("NomeFaleConosco");
    Email = document.getElementById("EmailFaleConosco");
    DDD = document.getElementById("DDDFaleConosco");
    Telefone = document.getElementById("TelefoneFaleConosco");
    Mensagem = document.getElementById("ComentariosFaleConosco");
    document.getElementById("conteudo_fale_conosco_loading").style.display = "none";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "none";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "none";
    document.getElementById("conteudo_fale_conosco").style.display = "block";
    if (Limpar) {
        Nome.value = "* Nome";
        Nome.style.fontStyle = "italic";
        Email.value = "* E-Mail";
        Email.style.fontStyle = "italic";
        DDD.value = "DDD";
        DDD.style.fontStyle = "italic";
        Telefone.value = "Telefone";
        Telefone.style.fontStyle = "italic";
        Mensagem.value = "Comentários";
        Mensagem.style.fontStyle = "italic";
    }
    Nome.focus();
}

function VoltarFaleConosco3(Limpar) {
    Nome = document.getElementById("NomeFaleConosco");
    Email = document.getElementById("EmailFaleConosco");
    DDD = document.getElementById("DDDFaleConosco");
    Telefone = document.getElementById("TelefoneFaleConosco");
    Mensagem = document.getElementById("ComentariosFaleConosco");
    document.getElementById("conteudo_fale_conosco_loading").style.display = "none";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "none";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "none";
    document.getElementById("conteudo_fale_conosco").style.display = "block";
    if (Limpar) {
        Nome.value = "* Nome";
        Nome.style.fontStyle = "italic";
        Email.value = "* E-Mail";
        Email.style.fontStyle = "italic";
        DDD.value = "DDD";
        DDD.style.fontStyle = "italic";
        Telefone.value = "Telefone";
        Telefone.style.fontStyle = "italic";
        Mensagem.value = "Comentários";
        Mensagem.style.fontStyle = "italic";
    }
    Nome.focus();
}

var StatusCarregou = false;

function SelecionaRotaEndereco(Objeto, Acao, Opcao, Latitude, Longitude) {
    if (StatusCarregou) {
        idEndereco = "0";
        if (Acao == "desmarcar") {
            if (Opcao == "0") {
                idEndereco = document.getElementById("endereco_tipo_endereco_0").value;
                document.getElementById("frame_mapa").contentWindow.CarregaMapa(Latitude, Longitude);
                if (document.getElementById("check_tipo_endereco_0") != undefined) {
                    document.getElementById("check_tipo_endereco_0").style.display = "block";
                }
                if (document.getElementById("check_tipo_endereco_1") != undefined) {
                    document.getElementById("check_tipo_endereco_1").style.display = "none";
                }
                if (document.getElementById("check_tipo_endereco_2") != undefined) {
                    document.getElementById("check_tipo_endereco_2").style.display = "none";
                }
            } else if (Opcao == "1") {
                idEndereco = document.getElementById("endereco_tipo_endereco_1").value;
                document.getElementById("frame_mapa").contentWindow.CarregaMapa2(document.getElementById("endereco_plantao").innerHTML);
                if (document.getElementById("check_tipo_endereco_0") != undefined) {
                    document.getElementById("check_tipo_endereco_0").style.display = "none";
                }
                if (document.getElementById("check_tipo_endereco_1") != undefined) {
                    document.getElementById("check_tipo_endereco_1").style.display = "block";
                }
                if (document.getElementById("check_tipo_endereco_2") != undefined) {
                    document.getElementById("check_tipo_endereco_2").style.display = "none";
                }
            } else if (Opcao == "2") {
                idEndereco = document.getElementById("endereco_tipo_endereco_0").value + "|" + document.getElementById("endereco_tipo_endereco_1").value + "|";
                document.getElementById("frame_mapa").contentWindow.CarregaMapa3(Latitude, Longitude, document.getElementById("endereco_plantao").innerHTML);
                if (document.getElementById("check_tipo_endereco_0") != undefined) {
                    document.getElementById("check_tipo_endereco_0").style.display = "none";
                }
                if (document.getElementById("check_tipo_endereco_1") != undefined) {
                    document.getElementById("check_tipo_endereco_1").style.display = "none";
                }
                if (document.getElementById("check_tipo_endereco_2") != undefined) {
                    document.getElementById("check_tipo_endereco_2").style.display = "block";
                }
            }
        }
    }
}

function TracarRota(Mensagem, Mensagem2, idEmpreendimento) {
    document.getElementById("EnderecoOrigem").blur();
    EnderecoPesquisa = document.getElementById("EnderecoOrigem");
    TotalLocais = 0;
    if (document.getElementById("check_tipo_endereco_0") != undefined) {
       if (document.getElementById("check_tipo_endereco_0").style.display == "block") {
           Endereco = document.getElementById("endereco_principal").innerHTML;
       }
       TotalLocais++;
    }
    if (document.getElementById("check_tipo_endereco_1") != undefined) {
       if (document.getElementById("check_tipo_endereco_1").style.display == "block") {
           Endereco = document.getElementById("endereco_plantao").innerHTML;
       }
       TotalLocais++;
    }
    if (document.getElementById("check_tipo_endereco_2") != undefined) {
        TotalLocais++;
        if (document.getElementById("check_tipo_endereco_2").style.display == "block") {
            alert(Mensagem);
        } else {
            if ((EnderecoPesquisa.value.length == 0) || (EnderecoPesquisa.value == "Digite o endereço de origem")) {
                alert(Mensagem2);
                EnderecoPesquisa.focus();
                return;
            }
            if (document.getElementById("map_canvas").style.display == "none") {
                document.getElementById("map_canvas_2").style.display = "none";
                document.getElementById("map_canvas").style.display = "block";
                document.getElementById("seta_mapa").src = "/images/seta_mapa.png";
                document.getElementById("mapa_texto").innerHTML = "<a href='javascript:ExibirMapaFichaProduto();'>" + document.getElementById("texto_detalhes_texto").innerHTML + "</a>";
            }
            document.getElementById("imagem_tracar_rota").style.display = "none";
            document.getElementById("imagem_voltar_mapa").style.display = "block";
            document.getElementById("EnderecoOrigem").readOnly = true;
            document.getElementById("mascara_mapa_rota").style.display = "block";
            document.getElementById("frame_mapa").contentWindow.TracarRota(EnderecoPesquisa.value, Endereco);
        }
    } else {
        if ((EnderecoPesquisa.value.length == 0) || (EnderecoPesquisa.value == "Digite o endereço de origem")) {
            alert(Mensagem2);
            EnderecoPesquisa.focus();
            return;
        }     
        if (document.getElementById("map_canvas").style.display == "none") {
            document.getElementById("map_canvas_2").style.display = "none";
            document.getElementById("map_canvas").style.display = "block";
            document.getElementById("seta_mapa").src = "/images/seta_mapa.png";
            document.getElementById("mapa_texto").innerHTML = "<a href='javascript:ExibirMapaFichaProduto();'>" + document.getElementById("texto_detalhes_texto").innerHTML + "</a>";
        }
        document.getElementById("imagem_tracar_rota").style.display = "none";
        document.getElementById("imagem_voltar_mapa").style.display = "block";
        document.getElementById("EnderecoOrigem").readOnly = true;
        document.getElementById("mascara_mapa_rota").style.display = "block";
        _gaq.push(['_trackPageview', '/ficha-produto/tracar-rota']);
        document.getElementById("frame_mapa").contentWindow.TracarRota(EnderecoPesquisa.value,Endereco);
    }
    if (TotalLocais == 1) {
        document.getElementById("mascara_mapa_rota").style.width = "650px";
    }
    if (TotalLocais == 3) {
        document.getElementById("mascara_mapa_rota").style.width = "850px";
    }
}

function ExibirMapaFichaProduto() {
    if (document.getElementById("map_canvas").style.display != "none") {
        document.getElementById("map_canvas_2").style.display = "block";
        document.getElementById("map_canvas").style.display = "none";
        document.getElementById("seta_mapa").src = "/images/seta_mapa2.png";
        document.getElementById("mapa_texto").innerHTML = "<a href='javascript:ExibirMapaFichaProduto();'>" + document.getElementById("texto_detalhes_texto_2").innerHTML + "</a>";
    } else {
        document.getElementById("map_canvas_2").style.display = "none";
        document.getElementById("map_canvas").style.display = "block";
        document.getElementById("seta_mapa").src = "/images/seta_mapa.png";
        document.getElementById("mapa_texto").innerHTML = "<a href='javascript:ExibirMapaFichaProduto();'>" + document.getElementById("texto_detalhes_texto").innerHTML + "</a>";
    }
}

function VoltarMapa(idEmpreendimento) {
    if (document.getElementById("check_tipo_endereco_0") != undefined) {
        if (document.getElementById("check_tipo_endereco_0").style.display == "block") {
            idEndereco = document.getElementById("endereco_tipo_endereco_0").value;
        }
    }
    if (document.getElementById("check_tipo_endereco_1") != undefined) {
        if (document.getElementById("check_tipo_endereco_1").style.display == "block") {
            idEndereco = document.getElementById("endereco_tipo_endereco_1").value;
        }
    }
    if (document.getElementById("check_tipo_endereco_2") != undefined) {
        if (document.getElementById("check_tipo_endereco_2").style.display == "block") {
            idEndereco = document.getElementById("endereco_tipo_endereco_0").value + "|" + document.getElementById("endereco_tipo_endereco_1").value;
        }
    }
    EnderecoPesquisa = document.getElementById("EnderecoOrigem");
    if (document.getElementById("map_canvas").style.display == "none") {
        document.getElementById("map_canvas_2").style.display = "none";
        document.getElementById("map_canvas").style.display = "block";
        document.getElementById("seta_mapa").src = "/images/seta_mapa.png";
        document.getElementById("mapa_texto").innerHTML = "<a href='javascript:ExibirMapaFichaProduto();'>" + document.getElementById("texto_detalhes_texto").innerHTML + "</a>";
    }
    document.getElementById("imagem_tracar_rota").style.display = "block";
    document.getElementById("imagem_voltar_mapa").style.display = "none";
    document.getElementById("EnderecoOrigem").readOnly = false;
    document.getElementById("mascara_mapa_rota").style.display = "none";
    splitPoints = parent.points[0].split("_");
    Latitude = splitPoints[0];
    Longitude = splitPoints[1];
    document.getElementById("frame_mapa").style.width = "978px";
    document.getElementById("frame_mapa").contentWindow.VoltarMapa(Latitude, Longitude);
    document.getElementById("frame_mapa").contentWindow.CarregaMapa(Latitude, Longitude);
}

function VerificaTracarRota() {
    if (points != null) {
        if (points.length > 0) {
            //document.getElementById("frame_mapa").style.display = "block";
            document.getElementById("sem_mapa").style.display = "none";
            splitPoints = points[0].split("_");
            Latitude = splitPoints[0];
            Longitude = splitPoints[1];
            Dados = dados_empreendimento[0];
            if (StatusEndereco) {
                document.getElementById("tracar_rota_exibe").style.display = "table";
                document.getElementById("frame_mapa").style.display = "block";
                if (parent.document.getElementById("check_tipo_endereco_0") != null) {
                    if (parent.document.getElementById("check_tipo_endereco_0").style.display == "block") {
                        document.getElementById("frame_mapa").src = "/mapa_ficha2.aspx?Largura=978&Altura=441&GoogleBar=1&Latitude=" + Latitude + "&Longitude=" + Longitude;
                    }
                }
                if (parent.document.getElementById("check_tipo_endereco_1") != null) {
                    if (parent.document.getElementById("check_tipo_endereco_1").style.display == "block") {
                        document.getElementById("frame_mapa").src = "/mapa_ficha2.aspx?Largura=978&Altura=441&GoogleBar=1&Endereco=" + document.getElementById("endereco_plantao").innerHTML;
                    }
                }
                if (parent.document.getElementById("check_tipo_endereco_2") != null) {
                    if (parent.document.getElementById("check_tipo_endereco_2").style.display == "block") {
                        document.getElementById("frame_mapa").src = "/mapa_ficha2.aspx?Largura=978&Altura=441&GoogleBar=1&Latitude=" + Latitude + "&Longitude=" + Longitude + "&Endereco=" + document.getElementById("endereco_plantao").innerHTML;
                    }
                }
            } else {
                document.getElementById("tracar_rota_exibe").style.display = "none";
                document.getElementById("frame_mapa").style.display = "block";
                document.getElementById("frame_mapa").src = "/mapa_ficha.aspx?Largura=978&Altura=441&GoogleBar=1&Latitude=" + Latitude + "&Longitude=" + Longitude;
            }
        } else {
            document.getElementById("frame_mapa").style.display = "none";
            document.getElementById("sem_mapa").style.display = "block";
        }
    } else {
        document.getElementById("frame_mapa").style.display = "none";
        document.getElementById("sem_mapa").style.display = "block";
    }
}

function VerificaTracarRota2(frame) {
    if (frame.src != "about:blank") {
        if ((document.getElementById("EnderecoOrigem").value.length > 0) && (document.getElementById("EnderecoOrigem").value != "Digite o endereço de origem")) {
            if (document.getElementById("StatusTracarRota").innerHTML == "1") {
                document.getElementById("tracar_rota").click();
            }
        }
    }
}

function MudaCursor(Objeto, Cursor) {
    if (Objeto.className.indexOf("red") < 0) {
        Objeto.style.cursor = Cursor;
    } else {
        Objeto.style.cursor = "default";
    }
}

function SelecionaAbaFichaProduto(Opcao, Objeto) {
    Objeto.style.cursor = "default";
    if (Opcao == "plantas") {
        document.getElementById("ficha_produto_videos_02_conteudo").style.display = "none";
        document.getElementById("ficha_produto_videos_02_conteudo_plantas").style.display = "block";
        document.getElementById("ficha_produto_videos_02_conteudo_videos").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_imagens_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_imagens_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_imagens").className = "abas_white_cen";
            document.getElementById("fichaproduto_imagens_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_imagens_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_imagens_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_plantas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_plantas_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_plantas_1").style.marginLeft = "10px";
            document.getElementById("fichaproduto_plantas").className = "abas_red_cen";
            document.getElementById("fichaproduto_plantas_2").className = "abas_red_dir";
            document.getElementById("imagem_fichaproduto_plantas_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_plantas_2").src = "/imgs/resultado_busca_02.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_videos_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_videos_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_videos").className = "abas_white_cen";
            document.getElementById("fichaproduto_videos_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_videos_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_videos_2").src = "/imgs/resultado_busca_04.jpg";
        }        
    }
    if (Opcao == "imagens") {
        document.getElementById("ficha_produto_videos_02_conteudo").style.display = "block";
        document.getElementById("ficha_produto_videos_02_conteudo_plantas").style.display = "none";
        document.getElementById("ficha_produto_videos_02_conteudo_videos").style.display = "none";
        if (document.getElementById("imagem_fichaproduto_imagens_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_imagens_1").className = "abas_red_esq";
            document.getElementById("fichaproduto_imagens").className = "abas_red_cen";            
            document.getElementById("fichaproduto_imagens_2").className = "abas_red_esq";
            document.getElementById("imagem_fichaproduto_imagens_1").src = "/imgs/resultado_busca_01.jpg";
            document.getElementById("imagem_fichaproduto_imagens_2").src = "/imgs/resultado_busca_02.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_plantas_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_plantas_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_plantas_1").style.marginLeft = "10px";                       
            document.getElementById("fichaproduto_plantas").className = "abas_white_cen";
            document.getElementById("fichaproduto_plantas_2").className = "abas_white_dir";
            document.getElementById("imagem_fichaproduto_plantas_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_plantas_2").src = "/imgs/resultado_busca_04.jpg";
        }
        if (document.getElementById("imagem_fichaproduto_videos_1").src.indexOf("_off") < 0) {
            document.getElementById("fichaproduto_videos_1").className = "abas_white_esq";
            document.getElementById("fichaproduto_videos").className = "abas_white_cen";
            document.getElementById("fichaproduto_videos_2").className = "abas_white_esq";
            document.getElementById("imagem_fichaproduto_videos_1").src = "/imgs/resultado_busca_03.jpg";
            document.getElementById("imagem_fichaproduto_videos_2").src = "/imgs/resultado_busca_04.jpg";
        }
    }
    if (Opcao == "videos") {
        document.getElementById("ficha_produto_videos_02_conteudo").style.display = "none";
        document.getElementById("ficha_produto_videos_02_conteudo_plantas").style.display = "none";
        document.getElementById("ficha_produto_videos_02_conteudo_videos").style.display = "block";
    }
}

function EnvieAmigo(Status) {
    StatusClique = false;
    if (Status == undefined) {
        Status = 0;
    }
    if (document.getElementById("indique_amigo").style.display != "block") {
        _gaq.push(['_trackPageview', '/ficha-produto/envie-para-um-amigo']);
        document.getElementById("indique_amigo").style.display = "block";
        document.getElementById("ligamos_para_voce").style.display = "none";
        document.getElementById("compartilhe_amigo").style.display = "none";
        SomeDadosTopo();
        if (document.getElementById("saiba_mais_produto") != undefined) {
            document.getElementById("saiba_mais_produto").style.display = "none";
        }
        SomeDadosTopo();
        timerCLIQUE = setTimeout("CliqueTrue()", 250);
    } else {
        if (Status == 0) {
            document.getElementById("indique_amigo").style.display = "none";
        }
        timerCLIQUE = setTimeout("CliqueFalse()", 250);
    }
}

function SomeDadosTopo() {
    document.getElementById("layer_topo_layer_pesquisa_resultado_sugestoes_pesquisa").style.display = "none";
    document.getElementById("layer_topo_layer_pesquisa_img_seta_pesquisa").src = "/images/seta_pesquisa.png";
    document.getElementById("layer_topo_layer_pesquisa_resultado_sugestoes_pesquisa").style.borderTop = "0px dashed #eeeeee";
    document.getElementById("layer_topo_layer_pesquisa_resultado_sugestoes_pesquisa").style.borderBottom = "0px solid #bdbdbd";
    document.getElementById("layer_topo_layer_pesquisa_seta_pesquisa").style.marginTop = "1px";
    document.getElementById("layer_topo_opcoes_busca_lista").style.display = "none";
    document.getElementById("layer_topo_topo_05_box_lista").style.display = "none";
    document.getElementById("layer_topo_topo_01_login_lista").style.display = "none";
    document.getElementById("layer_topo_topo_menu_03_lista").style.display = "none";
    document.getElementById("layer_topo_topo_01_idioma_lista").style.display = "none";
    document.getElementById("layer_topo_seta_idioma").src = "/imgs/topo/set.png";
    document.getElementById("layer_topo_opcoes_busca_seta").src = "/imgs/topo/set.png";
    document.getElementById("layer_topo_seta_login").src = "/imgs/topo/set.png";
    document.getElementById("layer_topo_seta_tudo_clique").src = "/imgs/topo/set_red.jpg";
    document.getElementById("layer_topo_topo_menu_02_04_lista").style.display = "none";
    document.getElementById("layer_topo_topo_menu_02_02_lista").style.display = "none";
    document.getElementById("layer_topo_menu_superior_form_principal_detalhada_lista").style.display = "none";
    document.getElementById("layer_topo_menu_superior_form_principal_estilo_lista").style.display = "none";
    document.getElementById("layer_topo_topo_01_intranet_lista").style.display = "none";
    document.getElementById("layer_topo_seta_intranet").src = "/imgs/topo/set.png";
}

function Compartilhe(Status) {
    StatusClique = false;
    if (Status == undefined) {
        Status = 0;
    }
    if (document.getElementById("compartilhe_amigo").style.display != "block") {
        _gaq.push(['_trackPageview', '/ficha-produto/compartilhe-este-imovel']);
        document.getElementById("compartilhe_amigo").style.display = "block";
        document.getElementById("ligamos_para_voce").style.display = "none";
        document.getElementById("indique_amigo").style.display = "none";
        if (document.getElementById("saiba_mais_produto") != undefined) {
            document.getElementById("saiba_mais_produto").style.display = "none";
        }
        SomeDadosTopo();
        timerCLIQUE = setTimeout("CliqueTrue()", 250);
    } else {
        if (Status == 0) {
            document.getElementById("compartilhe_amigo").style.display = "none";
        }
        timerCLIQUE = setTimeout("CliqueFalse()", 250);
    }
}

function LinkCompartilhe(Link, URL) {
    window.open(Link + URL);
}

function EnviarIndicacao(idEmpreendimento, idProduto, Mensagem1, Mensagem2, Mensagem3, Mensagem4, Mensagem5, Mensagem6, Mensagem7, Mensagem8) {
    Nome = document.getElementById("NomeIndique");
    Email = document.getElementById("EmailIndique");
    NomeAmigo = document.getElementById("NomeAmigoIndique");
    EmailAmigo = document.getElementById("EmailAmigoIndique");
    if ((Nome.value.length == 0) || (Nome.value == "Seu Nome:")) {
        alert(Mensagem1);
        Nome.focus();
        return;
    }
    if ((Email.value.length == 0) || (Email.value == "Seu E-Mail:")) {
        alert(Mensagem2);
        Email.focus();
        return;
    }
    AchouArroba = Email.value.indexOf("@");
    AchouPonto = Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert(Mensagem3);
        Email.focus();
        return;
    }
    if ((NomeAmigo.value.length == 0) || (NomeAmigo.value == "Nome do seu Amigo:")) {
        alert(Mensagem4);
        NomeAmigo.focus();
        return;
    }
    if ((EmailAmigo.value.length == 0) || (EmailAmigo.value == "E-Mail do seu Amigo:")) {
        alert(Mensagem5);
        EmailAmigo.focus();
        return;
    }
    AchouArroba = EmailAmigo.value.indexOf("@");
    AchouPonto = EmailAmigo.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert(Mensagem6);
        EmailAmigo.focus();
        return;
    }

    var ajaxResultado = null;
    ajaxResultado = ajaxInit();
    resultado = "";
    document.getElementById("conteudo_indique_amigo_loading").style.display = "block";
    document.getElementById("conteudo_indique_amigo_erro").style.display = "none";
    document.getElementById("conteudo_indique_amigo_ok").style.display = "none";
    document.getElementById("conteudo_indique_amigo").style.display = "none";

    if (ajaxResultado) {
        var parametros = "URLRequest=" + location.href + "&idEmpreendimento=" + idEmpreendimento + "&idProduto=" + idProduto + "&Nome=" + Nome.value + "&Email=" + Email.value + "&NomeAmigo=" + NomeAmigo.value + "&EmailAmigo=" + EmailAmigo.value;
        ajaxResultado.open("POST", "/enviar-indicacao/" + Math.ceil(Math.random() * 100000), true);
        ajaxResultado.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        ajaxResultado.setRequestHeader("Content-length", parametros.length);
        ajaxResultado.setRequestHeader("Connection", "close");
        ajaxResultado.onreadystatechange = function() {
            if (ajaxResultado.readyState == 4) {                
                if (ajaxResultado.status == 200) {
                    resultado = ajaxResultado.responseText;
                    if (resultado == "1") {
                        var ajaxResultadoAdwords = null;
                        ajaxResultadoAdwords = ajaxInit();
                        resultadoAdwords = "";
                        if (ajaxResultadoAdwords) {
                            ajaxResultadoAdwords.open("GET", "/enviar_amigo_adwords.aspx?Rand=" + Math.ceil(Math.random() * 100000), true);
                            ajaxResultadoAdwords.setRequestHeader("Content-type", "charset=iso-8859-1");
                            ajaxResultadoAdwords.onreadystatechange = function () {
                                if (ajaxResultadoAdwords.readyState == 4) {
                                    if (ajaxResultadoAdwords.status == 200) {
                                        resultadoAdwords = ajaxResultadoAdwords.responseText;
                                        timerID = setTimeout("ExibeOKIndique()", 500);
                                    } else {
                                        timerID = setTimeout("ExibeErroIndique()", 500);
                                    }
                                }
                            }
                            ajaxResultadoAdwords.send(null);
                        }
                    } else {
                        timerID = setTimeout("ExibeErroIndique()", 500);
                    }
                } else {
                    timerID = setTimeout("ExibeErroIndique()", 500);
                }
            }
        }
        ajaxResultado.send(parametros);
    }        
}

function VoltarIndique(Limpar) {
    Nome = document.getElementById("NomeIndique");
    Email = document.getElementById("EmailIndique");
    NomeAmigo = document.getElementById("NomeAmigoIndique");
    EmailAmigo = document.getElementById("EmailAmigoIndique");
    document.getElementById("conteudo_indique_amigo_loading").style.display = "none";
    document.getElementById("conteudo_indique_amigo_erro").style.display = "none";
    document.getElementById("conteudo_indique_amigo_ok").style.display = "none";
    document.getElementById("conteudo_indique_amigo").style.display = "block";
    if (Limpar) {
        Nome.value = "Seu Nome:";
        Nome.style.fontStyle = "italic";
        Email.value = "Seu E-Mail:";
        Email.style.fontStyle = "italic";
        NomeAmigo.value = "Nome do seu Amigo:";
        NomeAmigo.style.fontStyle = "italic";
        EmailAmigo.value = "E-Mail do seu Amigo:";
        EmailAmigo.style.fontStyle = "italic";
    }
    Nome.focus();
}

function ExibeErroIndique() {
    document.getElementById("conteudo_indique_amigo_loading").style.display = "none";
    document.getElementById("conteudo_indique_amigo_erro").style.display = "block";
    document.getElementById("conteudo_indique_amigo_ok").style.display = "none";
    document.getElementById("conteudo_indique_amigo").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/envie-para-um-amigo/erro']);
}

function ExibeOKIndique() {
    document.getElementById("conteudo_indique_amigo_loading").style.display = "none";
    document.getElementById("conteudo_indique_amigo_erro").style.display = "none";
    document.getElementById("conteudo_indique_amigo_ok").style.display = "block";
    document.getElementById("conteudo_indique_amigo").style.display = "none";
    _gaq.push(['_trackPageview', '/ficha-produto/envie-para-um-amigo/ok']);
}

function TentarNovamenteIndique() {
    document.getElementById("enviar_indique").click();
}

function Imprimir() {    
    URLAtual = location.href;
    splitURLAtual = URLAtual.split("/");
    URLAtual = "/imprimir";
    for (x = 3; x < splitURLAtual.length; x++) {
        URLAtual = URLAtual + "/" + splitURLAtual[x];
    }
    JanelaImpressao = window.open(URLAtual, "JanelaImpressao", "width=800,height=500,top=10,left=10,status=yes,scrollbars=yes");
    JanelaImpressao.focus();
    //window.print();
}

function CorretorOnline(idEmpreendimento) {

}

function FaleConoscoErro(Status) {
    StatusClique = false;
    if (Status == undefined) {
        Status = 0;
    }
    if (document.getElementById("fale_conosco").style.display != "block") {
        SomeDadosTopo();
        _gaq.push(['_trackPageview', '/erro-404/aba-o-que-estava-buscando']);
        document.getElementById("fale_conosco").style.display = "block";
        timerCLIQUE = setTimeout("CliqueTrue()", 250);
    } else {
        if (Status == 0) {
            document.getElementById("fale_conosco").style.display = "none";
            timerCLIQUE = setTimeout("CliqueFalse()", 250);
        }
    }
}

function FaleConoscoErro2(Status) {
    StatusClique = false;
    if (Status == undefined) {
        Status = 0;
    }
    if (document.getElementById("fale_conosco").style.display != "block") {
        SomeDadosTopo();
        _gaq.push(['_trackPageview', '/erro-500/aba-o-que-estava-buscando']);
        document.getElementById("fale_conosco").style.display = "block";
        timerCLIQUE = setTimeout("CliqueTrue()", 250);
    } else {
        if (Status == 0) {
            document.getElementById("fale_conosco").style.display = "none";
            timerCLIQUE = setTimeout("CliqueFalse()", 250);
        }
    }
}

function EnviarFaleConosco2() {
    Nome = document.getElementById("NomeFaleConosco");
    Email = document.getElementById("EmailFaleConosco");
    DDD = document.getElementById("DDDFaleConosco");
    Telefone = document.getElementById("TelefoneFaleConosco");
    Comentarios = document.getElementById("ComentariosFaleConosco");
    if ((Nome.value.length == 0) || (Nome.value == "* Nome")) {
        alert(document.getElementById("msg_erro_nome").value.replace("[br][br]", "\n\n"));
        Nome.focus();
        return;
    }
    if ((Email.value.length == 0) || (Email.value == "* E-Mail")) {
        alert(document.getElementById("msg_erro_email").value.replace("[br][br]", "\n\n"));
        Email.focus();
        return;
    }
    if (DDD.value == "DDD") {
        DDDEnvia = "";
    } else {
        DDDEnvia = DDD.value;
    }
    if (Telefone.value == "Telefone") {
        TelefoneEnvia = "";
    } else {
        TelefoneEnvia = Telefone.value;
    }
    if (Comentarios.value == "Comentários") {
        ComentariosEnvia = "";
    } else {
        ComentariosEnvia = Comentarios.value;
    }
    AchouArroba = Email.value.indexOf("@");
    AchouPonto = Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert(document.getElementById("msg_erro_email2").value.replace("[br][br]", "\n\n"));
        Email.focus();
        return;
    }
    document.getElementById("conteudo_fale_conosco_loading").style.display = "block";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "none";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "none";
    document.getElementById("conteudo_fale_conosco").style.display = "none";

    var ajaxResultado = null;
    ajaxResultado = ajaxInit();
    resultado = "";
    if (ajaxResultado) {
        ajaxResultado.open("GET", "/ajax/enviar_fale_conosco.aspx?Acao=FaleConoscoErro&Nome=" + Nome.value + "&Email=" + Email.value + "&DDD=" + DDDEnvia + "&Telefone=" + TelefoneEnvia + "&Comentarios=" + ComentariosEnvia + "&Rand=" + Math.ceil(Math.random() * 100000), true);
        ajaxResultado.setRequestHeader("Content-type", "charset=iso-8859-1");
        ajaxResultado.onreadystatechange = function() {
            if (ajaxResultado.readyState == 4) {
                if (ajaxResultado.status == 200) {
                    resultado = ajaxResultado.responseText;
                    if (resultado == "1") {
                        timerID = setTimeout("ExibeOKFaleConoscoErro()", 500);
                    } else {
                    timerID = setTimeout("ExibeErroFaleConoscoErro()", 500);
                    }
                } else {
                    timerID = setTimeout("ExibeErroFaleConoscoErro()", 500);
                }
            }
        }
        ajaxResultado.send(null);
    }
}

function EnviarFaleConosco3() {
    Nome = document.getElementById("NomeFaleConosco");
    Email = document.getElementById("EmailFaleConosco");
    DDD = document.getElementById("DDDFaleConosco");
    Telefone = document.getElementById("TelefoneFaleConosco");
    Comentarios = document.getElementById("ComentariosFaleConosco");
    if ((Nome.value.length == 0) || (Nome.value == "* Nome")) {
        alert(document.getElementById("msg_erro_nome").value.replace("[br][br]", "\n\n"));
        Nome.focus();
        return;
    }
    if ((Email.value.length == 0) || (Email.value == "* E-Mail")) {
        alert(document.getElementById("msg_erro_email").value.replace("[br][br]", "\n\n"));
        Email.focus();
        return;
    }
    if (DDD.value == "DDD") {
        DDDEnvia = "";
    } else {
        DDDEnvia = DDD.value;
    }
    if (Telefone.value == "Telefone") {
        TelefoneEnvia = "";
    } else {
        TelefoneEnvia = Telefone.value;
    }
    if (Comentarios.value == "Comentários") {
        ComentariosEnvia = "";
    } else {
        ComentariosEnvia = Comentarios.value;
    }
    AchouArroba = Email.value.indexOf("@");
    AchouPonto = Email.value.lastIndexOf(".");
    if ((AchouPonto < AchouArroba) || (AchouArroba <= 0 || AchouPonto <= 0)) {
        alert(document.getElementById("msg_erro_email2").value.replace("[br][br]", "\n\n"));
        Email.focus();
        return;
    }
    document.getElementById("conteudo_fale_conosco_loading").style.display = "block";
    document.getElementById("conteudo_fale_conosco_erro").style.display = "none";
    document.getElementById("conteudo_fale_conosco_ok").style.display = "none";
    document.getElementById("conteudo_fale_conosco").style.display = "none";

    var ajaxResultado = null;
    ajaxResultado = ajaxInit();
    resultado = "";
    if (ajaxResultado) {
        ajaxResultado.open("GET", "/ajax/enviar_fale_conosco.aspx?Acao=FaleConoscoErro404&Nome=" + Nome.value + "&Email=" + Email.value + "&DDD=" + DDDEnvia + "&Telefone=" + TelefoneEnvia + "&Comentarios=" + ComentariosEnvia + "&Rand=" + Math.ceil(Math.random() * 100000), true);
        ajaxResultado.setRequestHeader("Content-type", "charset=iso-8859-1");
        ajaxResultado.onreadystatechange = function() {
            if (ajaxResultado.readyState == 4) {
                if (ajaxResultado.status == 200) {
                    resultado = ajaxResultado.responseText;
                    if (resultado == "1") {
                        timerID = setTimeout("ExibeOKFaleConoscoErro()", 500);
                    } else {
                        timerID = setTimeout("ExibeErroFaleConoscoErro()", 500);
                    }
                } else {
                    timerID = setTimeout("ExibeErroFaleConoscoErro()", 500);
                }
            }
        }
        ajaxResultado.send(null);
    }
}

