function capacitacao() { popup = window.open("http://www.amanco.com.br/Default.aspx/TP_PopupCapacitacao","capacitacao","left=30,top=30,scrollbars=no,width=300,height=250"); window.popup.focus(); } var oldid; function openItem(id){ var ds = document.getElementById(id).style.display; if(ds != "none") { document.getElementById(id).style.display = "none"; } else { document.getElementById(id).style.display = "block"; } if(typeof(oldid) != 'undefined') { if(oldid != id) { document.getElementById(oldid).style.display = "none"; } } //alert('old = ' + document.getElementById(oldid).style.display + ' -- new = ' + document.getElementById(d).style.display); oldid = id; } function goEmpresa(val) { if(val.length >= 1) { window.location = "/default.aspx/construtoras?id=" + val; } } function prodSearch(q) { if(document.getElementById(q).value.length < 3) { alert('Informe ao menos 3 letras em sua busca'); } else { return (true); } return (false); } /* TESLA */ function listarEstadosIframe() { parent.document.getElementById("carregaInfo").src = "onde_comprar_iframe_estados.asp?ppr="+document.getElementById("ppr").value; } function listarCidadesIframe() { parent.document.getElementById("carregaInfo").src = "onde_comprar_iframe_cidades.asp?ppr="+document.getElementById("ppr").value+"&estado="+document.getElementById("estado").value; } function listarBairrosIframe() { parent.document.getElementById("carregaInfo").src = "onde_comprar_iframe_bairros.asp?ppr="+document.getElementById("ppr").value+"&estado="+document.getElementById("estado").value+"&cidade="+document.getElementById("cidade").value; } /******************************** Lista de Cidades na pagina descricao_amanco_ppr.asp **********************/ function listarCidadesIframe2() { parent.document.getElementById("carregaInfo").src = "onde_comprar_iframe_cidades.asp?estado="+document.getElementById("estado").value; } function listarBairrosIframe2() { parent.document.getElementById("carregaInfo").src = "onde_comprar_iframe_bairros.asp?estado="+document.getElementById("estado").value+"&cidade="+document.getElementById("cidade").value; } //********************** Funcao para trocar as cores do menu de empresa ************************ function menuEmpresa(nome_da_div){ Divs = new Array(9); Divs[0] = "historico"; Divs[1] = "resultados_financeiros"; Divs[2] = "missao_visao_valores"; Divs[3] = "onde_estamos"; Divs[4] = "modelo_organizacional"; Divs[5] = "premios"; Divs[6] = "certificacoes"; Divs[7] = "publicidade_amanco"; Divs[8] = "politica_integrada_gestao"; for (i=0;i<=8;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para trocar as cores do menu de produtos ************************ function menuProdutos(nome_da_div){ Divs = new Array(10); Divs[0] = "lancamentos"; Divs[1] = "produtos_prediais"; Divs[2] = "produtos_irrigacao"; Divs[3] = "produtos_geomecanicos"; Divs[4] = "produtos_infraestrutura"; Divs[5] = "catalogos"; Divs[6] = "manual_ponto_venda"; Divs[7] = "essa_obra_tem_amanco"; Divs[8] = "qualidade"; Divs[9] = "tecnologia"; for (i=0;i<=9;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para trocar as cores do menu de onde comprar ************************ function menuOndeComprar(nome_da_div){ Divs = new Array(1); Divs[0] = "busca_revendedores"; for (i=0;i<=0;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para trocar as cores do menu de responsabilidade social ************************ function menuResponsabilidadeSocial(nome_da_div){ Divs = new Array(5); Divs[0] = "dimensao_ambiental"; Divs[1] = "dimensao_social"; Divs[2] = "conselho_desenvolvimento_sustentavel"; Divs[3] = "relatorios"; Divs[4] = "revista"; for (i=0;i<=4;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para trocar as cores do menu de rh ************************ function menuRH(nome_da_div){ Divs = new Array(2); Divs[0] = "porque_trabalhar_amanco"; Divs[1] = "envie_seu_curriculo"; for (i=0;i<=1;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para trocar as cores do menu de imprensa ************************ function menuImprensa(nome_da_div){ Divs = new Array(4); Divs[0] = "ultimas_noticias"; Divs[1] = "eventos"; Divs[2] = "assessoria_imprensa"; Divs[3] = "releases_imprensa"; for (i=0;i<=3;i++) { if(Divs[i] == nome_da_div){ document.getElementById(Divs[i]).className = "bg_menu_ativ"; document.getElementById('seta_'+Divs[i]).className = "seta_menu_ativ"; } else { document.getElementById(Divs[i]).className = "bg_menu"; document.getElementById('seta_'+Divs[i]).className = "seta_menu"; } } } //********************** Funcao para limpar as cores do menu ************************ function limpaMenu(nome_da_div){ document.getElementById(nome_da_div).className = "bg_menu"; document.getElementById('seta_'+nome_da_div).className = "seta_menu"; } //******************** Funcao para abrir as divs da descricao dos produtos ********************** function abrirDivs(nome) { var div = document.getElementById(nome); if(div.style.display == "none"){ div.style.display = ""; }else{ div.style.display = "none"; } } //******************** Funcao para abrir as Divs de duvidas frequentes ********************** function abrirDivsHidraulicas(nome_da_div){ Divs = new Array(10); Divs[0] = "txt1main"; Divs[1] = "txt2main"; Divs[2] = "txt3main"; Divs[3] = "txt4main"; Divs[4] = "txt5main"; Divs[5] = "txt6main"; Divs[6] = "txt7main"; Divs[7] = "txt8main"; Divs[8] = "txt9main"; Divs[9] = "txt10main"; for (i=0;i<=9;i++) { if(Divs[i] == nome_da_div){ //document.getElementById('txt1main').style.diplay = ""; eval( Divs[i] + ".style.display = ''"); } else { //document.getElementById(Divs[i]).style.diplay = "none"; eval( Divs[i] + ".style.display = 'none'"); } } } //******************** Funcao para abrir as Divs de duvidas frequentes ********************** function abrirDuvidasInfra(nome_da_div){ Divs = new Array(9); Divs[0] = "txt1main"; Divs[1] = "txt2main"; Divs[2] = "txt3main"; Divs[3] = "txt4main"; Divs[4] = "txt5main"; Divs[5] = "txt6main"; Divs[6] = "txt7main"; Divs[7] = "txt8main"; Divs[8] = "txt9main"; for (i=0;i<=8;i++) { if(Divs[i] == nome_da_div){ //document.getElementById('txt1main').style.diplay = ""; eval( Divs[i] + ".style.display = ''"); } else { //document.getElementById(Divs[i]).style.diplay = "none"; eval( Divs[i] + ".style.display = 'none'"); } } } //******************** Funcao para abrir as Divs de Setor Agricola ********************** function abrirDuvidasAgricola(nome_da_div){ Divs = new Array(16); Divs[0] = "txt1main"; Divs[1] = "txt2main"; Divs[2] = "txt3main"; Divs[3] = "txt4main"; Divs[4] = "txt5main"; Divs[5] = "txt6main"; Divs[6] = "txt7main"; Divs[7] = "txt8main"; Divs[8] = "txt9main"; Divs[9] = "txt10main"; Divs[10] = "txt11main"; Divs[11] = "txt12main"; Divs[12] = "txt13main"; Divs[13] = "txt14main"; Divs[14] = "txt15main"; Divs[15] = "txt16main"; for (i=0;i<=15;i++) { if(Divs[i] == nome_da_div){ //document.getElementById('txt1main').style.diplay = ""; eval( Divs[i] + ".style.display = ''"); } else { //document.getElementById(Divs[i]).style.diplay = "none"; eval( Divs[i] + ".style.display = 'none'"); } } } //******************** Funcao para abrir as Divs de Setor Predial (Engenheiros... e Instaladores...) ********************** function abrirDuvidasPredial(nome_da_div){ Divs = new Array(12); Divs[0] = "txt1main"; Divs[1] = "txt2main"; Divs[2] = "txt3main"; Divs[3] = "txt4main"; Divs[4] = "txt5main"; Divs[5] = "txt6main"; Divs[6] = "txt7main"; Divs[7] = "txt8main"; Divs[8] = "txt9main"; Divs[9] = "txt10main"; Divs[10] = "txt11main"; Divs[11] = "txt12main"; for (i=0;i<=11;i++) { if(Divs[i] == nome_da_div){ //document.getElementById('txt1main').style.diplay = ""; eval( Divs[i] + ".style.display = ''"); } else { //document.getElementById(Divs[i]).style.diplay = "none"; eval( Divs[i] + ".style.display = 'none'"); } } } //******************** Funcao para validar campo de busca de produto da HOME ********************** function valida_busca(obj){ /*if (obj.value.length <=2) { alert("Por favor digite pelo menos 3 caracteres para buscar o produto."); obj.focus(); return false; } else { return false; } */ return false } //******************** Funcao para validar combo de países do Header ********************** function combo_pais(obj){ if (obj == ""){ alert("Por favor escolha uma opcao valida."); return false; }else{ window.open(obj); } } //*** Funcao para validar combo de cases de empresas de "sua construcao" "instaladores hidraulicos" "engenheiros e projetistas" *** function combo_empresas(obj){ if (obj == ""){ alert("Por favor escolha uma opcao valida."); return false; }else{ location.href=(obj); } } //****************** Funcao para troca de imagens em "Produtos - Top Caixa Amanco" ****************** function trocaImagensTopcaixa(nome_da_imagem){ MM_preloadImages(nome_da_imagem); imagem = nome_da_imagem; document.images['area'].src = imagem; } //**************************** Funcao para validar o box de busca "Onde Comprar" **************************** function validaBuscaProdutos(form){ if (form.ppr.value == 9){ alert('Você precisa escolher Todas as revendas ou Apenas revendas com PPR'); form.ppr.focus(); return false; } if (form.estado.value == 0){ alert('Você precisa escolher um Estado'); form.estado.focus(); return false; } if (form.cidade.value == 0){ alert('Você precisa escolher uma Cidade'); form.cidade.focus(); return false; } if (form.ppr.value == 0) { if (form.bairro.value == 0){ alert('Você precisa escolher um Bairro'); form.bairro.focus(); return false; } } } //************************** Funcao para validar o Fale Conosco ************************** function validaFaleConosco(form){ var ret = 'Atencao,\n\n'; var nomecampo = ""; if(verificaVazio(form.nome)){ nomecampo += 'nome,'; ret += 'O campo Nome esta vazio\n'; } if(verificaVazio(form.email)){ nomecampo += 'email,'; ret += 'O campo E-mail esta vazio\n'; } if (!verificaEmail(form.email.value)){ nomecampo += 'email,'; ret += 'O E-mail inserido e invalido\n'; } if (verificaVazio(form.ddd_telefone)) { nomecampo += 'ddd_telefone,'; ret += 'O campo DDD do Telefone esta vazio\n'; } if (verificaVazio(form.telefone)) { nomecampo += 'telefone,'; ret += 'O campo Telefone esta vazio\n'; } if (verificaVazio(form.ddd_celular)) { nomecampo += 'ddd_celular,'; ret += 'O campo DDD do Celular esta vazio\n'; } if (verificaVazio(form.celular)) { nomecampo += 'celular,'; ret += 'O campo Telefone Celular esta vazio\n'; } if(verificaVazio(form.endereco)){ nomecampo += 'endereco,'; ret += 'O campo Endereco esta vazio\n'; } if(verificaVazio(form.cidade)){ nomecampo += 'cidade,'; ret += 'O campo Cidade esta vazio\n'; } if (form.estado.value == 0){ nomecampo += 'estado,'; ret += 'Você precisa escolher um Estado\n'; } if (verificaVazio(form.cep)) { nomecampo += 'cep,'; ret += 'O campo CEP esta vazio\n'; } if (verificaVazio(form.cep2)) { nomecampo += 'cep2,'; ret += 'O campo CEP Complemento esta vazio\n'; } if (verificaVazio(form.assunto)) { nomecampo += 'assunto,'; ret += 'O campo Assunto esta vazio\n'; } if (verificaVazio(form.mensagem)) { nomecampo += 'mensagem,'; ret += 'O campo Mensagem esta vazio\n'; } if (ret !='Atencao,\n\n'){ ret = '' + ret; alert(ret); campos = nomecampo.substr(0,nomecampo.indexOf(",")); campoErro = eval("document.frm_faleconosco." + campos); campoErro.focus(); return false; }else{ return true; } } //**************************** Funcao para validar o Cadastro **************************** function validaFormCadastro(form){ var ret = 'Atencao,\n\n'; var nomecampo = ""; if(verificaVazio(form.ds_nome)){ nomecampo += 'ds_nome,'; ret += 'O campo Nome esta vazio\n'; } if(verificaVazio(form.ds_empresa)){ nomecampo += 'ds_empresa,'; ret += 'O campo Empresa esta vazio\n'; } if(verificaVazio(form.ds_email)){ nomecampo += 'ds_email,'; ret += 'O campo E-mail esta vazio\n'; } if (!verificaEmail(form.ds_email.value)){ nomecampo += 'ds_email,'; ret += 'O E-mail inserido e invalido\n'; } if (verificaVazio(form.ds_ddd_telefone)) { nomecampo += 'ds_ddd_telefone,'; ret += 'O campo DDD do Telefone esta vazio\n'; } if (verificaVazio(form.ds_telefone)) { nomecampo += 'ds_telefone,'; ret += 'O campo Telefone esta vazio\n'; } if (form.id_interesse.value == 0){ nomecampo += 'id_interesse,'; ret += 'Você precisa escolher algo em area de Interesse\n'; } if (ret !='Atencao,\n\n'){ ret = '' + ret; alert(ret); campos = nomecampo.substr(0,nomecampo.indexOf(",")); campoErro = eval("document.formCadastro." + campos); campoErro.focus(); return false; }else{ return true; } } //*********************************************** Funcoes Genericas ********************************************* function verificaVazio(parObj){ if(parObj.value ==''){ return true; }else{ return false; } } //Verifica se o E-Mail e valido function verificaEmail(email) { var s = new String(email); // { } ( ) < > [ ] | \ / if ((s.indexOf("{")>=0) || (s.indexOf("}")>=0) || (s.indexOf("(")>=0) || (s.indexOf(")")>=0) || (s.indexOf("<")>=0) || (s.indexOf(">")>=0) || (s.indexOf("[")>=0) || (s.indexOf("]")>=0) || (s.indexOf("|")>=0) || (s.indexOf("\"")>=0) || (s.indexOf("/")>=0) ) return false; if (vogalAcentuada(email)) return false; // & * $ % ? ! ^ ~ ` ' " if ((s.indexOf("&")>=0) || (s.indexOf("*")>=0) || (s.indexOf("$")>=0) || (s.indexOf("%")>=0) || (s.indexOf("?")>=0) || (s.indexOf("!")>=0) || (s.indexOf("^")>=0) || (s.indexOf("~")>=0) || (s.indexOf("`")>=0) || (s.indexOf("'")>=0) ) return false; // , ; : = # if ((s.indexOf(",")>=0) || (s.indexOf(";")>=0) || (s.indexOf(":")>=0) || (s.indexOf("=")>=0) || (s.indexOf("#")>=0) ) return false; // procura se existe apenas um "@" if ( (s.indexOf("@") < 0) || (s.indexOf("@") != s.lastIndexOf("@")) ) return false; // verifica se tem pelo menos um ponto após o "@" if (s.lastIndexOf(".") < s.indexOf("@")) return false; // verifica se o último caracter nao e um "." if (s.lastIndexOf(".") == (s.length - 1) ) return false; // verifica se tem "." nao vem colado ao "@" if (s.lastIndexOf("@.") > 0 ) return false; return true; } function vogalAcentuada(s) { ls = s.toLowerCase(); //if ((ls.indexOf("a")>=0) || (ls.indexOf("à")>=0) || (ls.indexOf("a")>=0) || (ls.indexOf("a")>=0) || (ls.indexOf("e")>=0) || (ls.indexOf("í")>=0) || (ls.indexOf("ó")>=0) || (ls.indexOf("o")>=0) || (ls.indexOf("ô")>=0) || (ls.indexOf("ú")>=0) || (ls.indexOf("ü")>=0)) //return true; return false } // Permite apenas números em campos String function limpa_string(S) { var Digitos = "0123456789"; var temp = ""; var digito = ""; for (var i=0; i=0){ temp=temp+digito } } return temp } function validar_num(campo){ nome=campo.name num = limpa_string(campo.value); campo.value = num; } 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