    function focaCampo(campo)
    {
        if(campo.value == campo.getAttribute("padrao"))
        {
            campo.value = "";
        }
    }
    function desfocaCampo(campo)
    {
        if(campo.value == "" || campo.value == null)
        {
            campo.value = campo.getAttribute("padrao");
        }
    }
    function validaNewsletter()
    {
        if(document.getElementById("Coluna_esquerda1_boxnome").value == "" || document.getElementById("Coluna_esquerda1_boxnome").value == "Digite seu nome")
        {
            alert("Preencha o campo \"nome\" corretamente.");
            document.getElementById("Coluna_esquerda1_boxnome").focus();
            return false;
        }
        if(document.getElementById("Coluna_esquerda1_boxemail").value == "" || document.getElementById("Coluna_esquerda1_boxemail").value == "Digite seu e-mail")
        {
            alert("Preencha o campo \"e-mail\" corretamente.");
            document.getElementById("Coluna_esquerda1_boxemail").focus();
            return false;
        }
        f = document.getElementById("Coluna_esquerda1_boxemail");
        
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo de e-mail corretamente.");
            f.focus();
            return false;
        }
        cadastranews();
    }
    
    function validaContato()
    {
        f = document.formulario.assunto;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.areacontato;
        if(f.value == "Selecione uma opção")
        {
            alert("Por favor, escolha uma opção no campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.nome;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.empresa;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.email;
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
        
        
        f = document.formulario.telefone;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.comentarios;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
    }
    
    function validaCadastro()
    {
        f = document.formulario.nome;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.email;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
        
        f = document.formulario.login;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.senha;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        if(f.value != document.formulario.confirma.value)
        {
            alert('As senhas não conferem.');
            f.focus();
            return false;
        }
        
        f = document.formulario.empresa;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.telefone;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
    }
    

    function alternaCaixa(b)
    {
        document.getElementById('tabelaLogin').style.display = 'none';
        document.getElementById('tabelaEmail').style.display = '';
    }
    
    function alternaCaixa2(b)
    {
        document.getElementById('tabelaEmail').style.display = 'none';
        document.getElementById('tabelaLogin').style.display = '';
    }
    
    function validaBoxLogin()
    {
        f = document.formulario.loginuser;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.senhauser;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
    }
    
    
    function validaEsqueci()
    {
        f = document.formulario.box_mail;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
    }
    
   function validaBoxBusca()
   {
		return true;
        if (document.getElementById("Topo1_boxbusca").value == "" || document.getElementById("Topo1_boxbusca").value == "Digite um termo")
        {
            alert("Preencha o campo de busca.");
           document.getElementById("Topo1_boxbusca").focus();
            return false;
        }
        return true;
   }
   
   function chamaDivCapa()
   {
        if(document.getElementById("div_capa").style.display == 'none')
        {
            document.getElementById('div_capa').style.display = '';
        }
        else
        {
            document.getElementById('div_capa').style.display = 'none';
        }
   }
   
   function fechafoto()
   {
        
        document.getElementById('div_capa').style.display = 'none';
        return false;
   }
   
   function validaenvio()
   {
        f = document.formulario.nome;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.destinatario;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.emaildestinatario;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
   }
   
   function validaassinatura()
   {
        f = document.formulario.nome;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.empresa;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.cargo;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.cpf;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        if(!isCPF(f.value) && !isCNPJ(f.value))
        {
            alert("Por favor, informe um CPF ou CNPJ válido.");
            f.focus();
            return false;
        }
        
        
        
        f = document.formulario.endereco;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        function isNumericInt(campo) {

	        var t = 0;
	        for(cont=0;cont<campo.length;cont++)
	        {
		        if(campo.charAt(cont) != "0" && campo.charAt(cont) != "1" && campo.charAt(cont) != "2" && campo.charAt(cont) != "3" && campo.charAt(cont) != "4" && campo.charAt(cont) != "5" && campo.charAt(cont) != "6" && campo.charAt(cont) != "7" && campo.charAt(cont) != "8" && campo.charAt(cont) != "9")
			        {
			            return (false);
			        }
	        }
	        return (true);
        }
        f = document.formulario.numero;
        if(!isNumericInt(f.value))
        {
            alert("O campo " + f.getAttribute("nome") + " so aceita números.");
            f.focus();
            return false;
        }
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.bairro;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.cep;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.cidade;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.estado;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.telefone;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.fax;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        f = document.formulario.email;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
   }
   
   function altbox1(b)
    {
        //FIREFOX
        document.getElementById('d1').setAttribute("style", "display:block");
        document.getElementById('d2').setAttribute("style", "display:none");
        document.getElementById('d3').setAttribute("style", "display:none");
        document.getElementById('d4').setAttribute("style", "display:none");
        //IE
        document.getElementById('d1').getAttribute('style').display = 'block';
        document.getElementById('d2').getAttribute('style').display = 'none';
        document.getElementById('d3').getAttribute('style').display = 'none';
        document.getElementById('d4').getAttribute('style').display = 'none';
    }
    function altbox2(b)
    {
        //FIREFOX
        document.getElementById('d1').setAttribute("style", "display:none");
        document.getElementById('d2').setAttribute("style", "display:block");
        document.getElementById('d3').setAttribute("style", "display:none");
        document.getElementById('d4').setAttribute("style", "display:none");
        //IE
        document.getElementById('d1').getAttribute('style').display = 'none';
        document.getElementById('d2').getAttribute('style').display = 'block';
        document.getElementById('d3').getAttribute('style').display = 'none';
        document.getElementById('d4').getAttribute('style').display = 'none';
    }
    function altbox3(b)
    {
        //FIREFOX
        //document.getElementById('d1').setAttribute("style", "display:none");
        //document.getElementById('d2').setAttribute("style", "display:none");
        //document.getElementById('d3').setAttribute("style", "display:block");
        //document.getElementById('d4').setAttribute("style", "display:none");
        //IE
        //document.getElementById('d1').getAttribute('style').display = 'none';
        //document.getElementById('d2').getAttribute('style').display = 'none';
        //document.getElementById('d3').getAttribute('style').display = 'block';
        //document.getElementById('d4').getAttribute('style').display = 'none';
    }

    
    function habilitaSubPainel()
    {
        if(document.getElementById('d1_2').getAttribute('style').display == 'none')
        {
            document.getElementById('d1_2').getAttribute('style').display = 'block';
            document.getElementById('d1_2').setAttribute("style", "display:block");
        }
        else
        {
            document.getElementById('d1_2').getAttribute('style').display = 'none';
            document.getElementById('d1_2').setAttribute("style", "display:none");
        }
        return false;
    }
    
    function validaEmpresa()
    {
        f = document.formulario.nome;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }

        f = document.formulario.razao;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        if(document.getElementById('chk_assinante_j').checked){
            f = document.formulario.codAssinante_j;
            if(f.value == "")
            {
                alert("Por favor, preencha o código de assinante.");
                f.focus();
                return false;
            }        
        }        
        
        f = document.formulario.cnpj;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        if (!isCNPJ(f.value))
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
        
        f = document.formulario.contato;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.tel;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.email;
        
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
        
        
        f = document.formulario.login;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.senha;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + ".");
            f.focus();
            return false;
        }
        
        f = document.formulario.senha;
        g = document.formulario.confsenha1;
        if(f.value != g.value)
        {
            alert("As senhas não conferem, por favor digite sua senha novamente.");
            g.focus();
            return false;
        }
        
    }
    
    function validaVaga()
    {
        f = document.formulario.descrica_vaga;
        g = document.formulario.descricao_vaga_edit;
        if(f.value == "selecione" && g.value == "" || f.value == "selecione" && g.value == "outra descrição")
        {
            alert("Por favor, selecione a descrição da vaga ou escreva na caixa ao lado.");
            f.focus();
            return false;
        }
        
        if(f.value != "selecione" && g.value != "outra descrição")
        {
            alert("Por favor, selecione somente um campo informando a descrição da vaga.");
            f.focus();
            return false;
        }
        
        
        campo = document.formulario.publicacao;
        if (campo.value == "")
        {
            alert("Preencha a data.");
            campo.focus();
            return false;
        }
        else
        {
            erro=0;
            hoje = new Date();
            anoAtual = hoje.getFullYear();
            barras = campo.value.split("/");
            if (barras.length == 3)
            {
                   dia = barras[0];
                mes = barras[1];
                ano = barras[2];
                resultado = (!isNaN(dia) && (dia > 0) && (dia < 32)) && (!isNaN(mes) && (mes > 0) && (mes < 13)) && (!isNaN(ano) && (ano.length == 4) && (ano <= anoAtual && ano >= 1900));
                if (!resultado)
                {
                    alert("Data inválida.");
                    campo.focus();
                    return false;
                }
             }
             else
             {
                 alert("Data inválida.");
                 campo.focus();
                 return false;
             }
        }
        
        f = document.formulario.qtde_vagas;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo Quantidade de vagas.");
            f.focus();
            return false;
        }
        if(isNaN(f.value))
        {
            alert("O campo Quantidade de vagas não é um número");
            f.focus();
            return false;
        }
        
        f = document.formulario.uf;
        if(f.value == "uf")
        {
            alert("Por favor, selecione o campo UF.");
            f.focus();
            return false;
        }
        
        f = document.formulario.cidades;
        g = document.formulario.outra_cidade;
        if(f.value == "cidade" && g.value == "" || f.value == "cidade" && g.value == "outra cidade")
        {
            alert("Por favor, selecione a cidade da vaga ou escreva na caixa ao lado.");
            f.focus();
            return false;
        }
        
        if(f.value != "cidade" && g.value != "outra cidade")
        {
            alert("Por favor, selecione somente um campo informando sua cidade.");
            f.focus();
            return false;
        }
        
        
        f = document.formulario.bairro;
        g = document.formulario.outro_bairro;
        if(f.value == "bairro" && g.value == "" || f.value == "bairro" && g.value == "outro bairro")
        {
            alert("Por favor, selecione o bairro da vaga ou escreva na caixa ao lado.");
            f.focus();
            return false;
        }
        
        if(f.value != "bairro" && g.value != "outro bairro")
        {
            alert("Por favor, selecione somente um campo informando seu bairro.");
            f.focus();
            return false;
        }
        
        f = document.formulario.conhecimentos_especificos;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo Conhecimentos Especificos.");
            f.focus();
            return false;
        }
        
        f = document.formulario.rotina_trabalho;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo Rotina de Trabalho.");
            f.focus();
            return false;
        }
        
        f = document.formulario.observvacoes_gerais;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo Observações gerais.");
            f.focus();
            return false;
        }
        
        f = document.formulario.salario;
        if(f.value == "selecione")
        {
            alert("Por favor, preencha o campo Salário.");
            f.focus();
            return false;
        }
    }
    
    
  
    function listaClick()
    {
        document.getElementById('lista').getAttribute('style').display = 'block';
        document.getElementById('cadi').getAttribute('style').display = 'none';
    }

    function cadiClick()
    {
        document.getElementById('lista').getAttribute('style').display = 'none';
        document.getElementById('cadi').getAttribute('style').display = 'block';
    }
    
    function loguser()
    {
        document.getElementById('logusuario').getAttribute('style').display = 'block';
        document.getElementById('logempresa').getAttribute('style').display = 'none';
        //document.getElementById('Coluna_direita1_spuser').getAttribute('style').color = '#666666';
    }
    function logemp()
    {
        document.getElementById('logusuario').getAttribute('style').display = 'none';
        document.getElementById('logempresa').getAttribute('style').display = 'block';
        //document.getElementById('Coluna_direita1_spemp').getAttribute('style').color = '#666666';
    }
    
    function validaloginu()
    {
        f = document.formulario.Coluna_direita1_loginuser;
        if(f.value == "" || f.value == "Digite seu login")
        {
            alert("Por favor, preencha o Login.");
            f.focus();
            return false;
        }
        f = document.formulario.Coluna_direita1_senhauser;
        if(f.value == "")
        {
            alert("Por favor, preencha a Senha.");
            f.focus();
            return false;
        }
    }
    
    function validalogine()
    {
        f = document.formulario.Coluna_direita1_loginemp;
        if(f.value == "")
        {
            alert("Por favor, preencha o Login.");
            f.focus();
            return false;
        }
        f = document.formulario.Coluna_direita1_senhaemp;
        if(f.value == "")
        {
            alert("Por favor, preencha a Senha.");
            f.focus();
            return false;
        }
    }
    

    
    function janela(){
        alert('Para abrir esta janela, certifique-se de que nao há nenhum bloqueador de pop-up ativado.');
        window.open('esqueceusenha.aspx','janela','width=350, height=350, top=150, left=150, scrollbars=no,fullscreen=no');
        return false;
    }
    
    function validamailEsq()
    {
        f = document.formulario.box_mail;
        if(f.value == "")
        {
            alert("Por favor, preencha o campo E-mail.");
            f.focus();
            return false;
        }
        if (!isEmail(f.value)){
            alert("Por favor, preencha o campo " + f.getAttribute("nome") + " corretamente.");
            f.focus();
            return false;
        }
    }
    
    function corLink(link)
    {
        document.getElementById('span1').getAttribute('style').color = '#023169';
        document.getElementById('span3').getAttribute('style').color = '#023169';
        link.getAttribute('style').color = '#fe0002';
    }
    
       function corLink2(link)
    {
        document.getElementById('Span5').getAttribute('style').color = '#023169';
        document.getElementById('Span6').getAttribute('style').color = '#023169';
        link.getAttribute('style').color = '#fe0002';
    }
    function loginRapido(){
	    if (event.keyCode == 13){
		    document.getElementById('Coluna_direita1_lguser').click();
	    }
    }
    
    function altbx1(naoMostraCadastro)
    {
        if(!naoMostraCadastro){
            document.getElementById('d2').style.display = '';
            if(document.getElementById('caixa_chama_alteraDados'))
                document.getElementById('caixa_chama_alteraDados').style.display = 'none';
        }else{
            document.getElementById('d2').style.display = 'none';
            if(document.getElementById('caixa_chama_alteraDados'))
                document.getElementById('caixa_chama_alteraDados').style.display = '';
        }
            
        document.getElementById('d3').style.display = 'none';
        
        if(document.getElementById('escolhaTipoCadastro'))
            document.getElementById('escolhaTipoCadastro').style.display = 'none';
        
    }


    
    function altbx2(naoMostraCadastro)
    {
        if(!naoMostraCadastro)
        {
        
            document.getElementById('d3').style.display = '';
            if(document.getElementById('caixa_chama_alteraDadosUsuario'))
                document.getElementById('caixa_chama_alteraDadosUsuario').style.display = 'none';
        }
        else
        {
        
            document.getElementById('d3').style.display = 'none';
            if(document.getElementById('caixa_chama_alteraDadosUsuario'))
                document.getElementById('caixa_chama_alteraDadosUsuario').style.display = '';
        }
        
    document.getElementById('d2').style.display = 'none';
    
    if(document.getElementById('escolhaTipoCadastro'))
        document.getElementById('escolhaTipoCadastro').style.display = 'none';
    
    }
    
    function altbx100()
    {
        document.getElementById('d1').style.display = '';
        document.getElementById('d2').style.display = '';
    }
    
        function altbx3(b)
    {
        document.getElementById('d5').style.display = '';
    }
    
    function cadlist()
    {
        //document.getElementById('lista').getAttribute('style').display = 'block';
        document.getElementById('d4').style.display = '';
    }
    
    function listcad()
    {
        document.getElementById('lista').style.display = '';
        document.getElementById('d4').style.display = 'none';
    }
    
    
    function minipanel()
    {
        document.getElementById('d6').style.display = 'block';
    }
    
    function validaClassificado()
    {
        f = document.formulario.categoria;
        g = document.formulario.outra_categoria;
        if(f.value == "selecione" && g.value == "" || f.value == "selecione" && g.value == "outra categoria")
        {
            alert("Por favor, selecione a categoria ou escreva na caixa ao lado.");
            f.focus();
            return false;
        }
        
        if(f.value != "selecione" && g.value != "outra categoria")
        {
            alert("Por favor, selecione apenas um campo informando a categoria do produto.");
            f.focus();
            return false;
        }
        
        campo = document.formulario.publicacao;
        if (campo.value == "")
        {
            alert("Por favor, preencha a data.");
            campo.focus();
            return false;
        }
        else
        {
            erro=0;
            hoje = new Date();
            anoAtual = hoje.getFullYear();
            barras = campo.value.split("/");
            if (barras.length == 3)
            {
                   dia = barras[0];
                mes = barras[1];
                ano = barras[2];
                resultado = (!isNaN(dia) && (dia > 0) && (dia < 32)) && (!isNaN(mes) && (mes > 0) && (mes < 13)) && (!isNaN(ano) && (ano.length == 4) && (ano <= anoAtual && ano >= 1900));
                if (!resultado)
                {
                    alert("Data inválida.");
                    campo.focus();
                    return false;
                }
             }
             else
             {
                 alert("Data inválida.");
                 campo.focus();
                 return false;
             }
        }
        
        campo = document.formulario.titulo;
        if (campo.value == "")
        {
            alert("Por favor, preencha o título do classificado.");
            campo.focus();
            return false;
        }
        
        campo = document.formulario.descricao;
        if (campo.value == "")
        {
            alert("Por favor, preencha a descrição do classificado.");
            campo.focus();
            return false;
        }
     
     
        campo = document.formulario.preco;
        if (campo.value == "selecione")
        {
            alert("Por favor, escolha a faixa de preço.");
            campo.focus();
            return false;
        }
    }
    
    function altbox10(b)
    {
        document.getElementById('d6').style.display = 'block';
        document.getElementById('d3').style.display = 'block';
    }
    
    
    function mostraDivVaga()
    {
        document.getElementById('d2').style.display = 'none';
        document.getElementById('d3').style.display = 'none';
        document.getElementById('d6').style.display = 'none';
        document.getElementById('lista').style.display = 'none';
        document.getElementById('caixa_chama_alteraDados').style.display = 'none';
        document.getElementById('div_cadastro_vaga').style.display = '';
        document.getElementById('textoatual').innerText = document.getElementById('textoatual').innerText.replace(', você está logado (a) no portal e tem acesso a serviços exclusivos. Abaixo você encontra o painel de vagas oferecidas e o painel de classificados. No painel de vagas oferecidas, você pode incluir , alterar ou excluir uma vaga. No painel de classificados você pode cadastrar e vender produtos e serviços do setor foodservice. Você pode também alterar seus dados cadastrais.', ', você está na área de cadastro de vaga e já pode inserir uma nova vaga. Basta preencher as informações solicitadas abaixo e clicar em salvar informações. O cadastro será salvo em nosso sistema  e estará disponível pelo período de 1 mês a partir da data de publicação.');
        return false;
    }
    
    
    function validaBuscaVaga()
    {
        descricao = document.formulario.descrica_vaga;
        uf = document.formulario.uf;
        cidade = document.formulario.cidades;
        bairro = document.formulario.bairro;
        salario = document.formulario.salario;
    
        if(descricao.value == "selecione" && uf.value == "uf" && cidade.value == "cidade" && bairro.value == "bairro" && salario.value == "selecione")
        {
            alert('Por favor, especifique ao menos um parâmetro para efetuar sua busca.');
            return false;
        }
        
        return true;
    }
    
    
    function validaBuscaCandidato()
    {
        descricao = document.formulario.descrica_vaga;
        uf = document.formulario.uf;
        cidade = document.formulario.cidades;
        bairro = document.formulario.bairro;
        escolaridade = document.formulario.cescolaridade;
        formacao = document.formulario.cformacao;
        salario = document.formulario.salario;
    
        if(descricao.value == "selecione" && uf.value == "uf" && cidade.value == "cidade" && bairro.value == "bairro" && escolaridade.value == "escolaridade" && formacao.value == "formação" && salario.value == "selecione")
        {
            alert('Por favor, especifique ao menos um parâmetro para efetuar sua busca.');
            return false;
        }
        
        return true;
    }
    
    
    function validaBuscaClassificado()
    {
        categoria = document.formulario.categoria;
        titulo = document.formulario.titulo;
        descricao = document.formulario.descricao;
        salario = document.formulario.salario;
    
        if(categoria.value == "selecione" && titulo.value == "" && descricao.value == "" && salario.value == "selecione")
        {
            alert('Por favor, especifique ao menos um parâmetro para efetuar sua busca.');
            return false;
        }
        
        return true;
    }
    
    
    function isEmail(mail) {
	var ponto = 0;
	var arroba = 0;
	var letraAntes = 0;
	var letraDepois = 0;
	var i = 0;
	var l = mail.length;
	var ch = 0;
	if (l < 10)	return (false);
	for (i = 0; i < l; i++) {
		ch = mail.charCodeAt(i);
		if (ch == 46) {
			if (arroba > 0)	ponto += 1;
		} else {
			if (ch == 64) {
				arroba += 1;
			} else {
				if (((ch >= 65) && (ch <= 90)) || ((ch >= 97) && (ch <= 122))) {
					if (arroba > 0)
						letraDepois += 1;
					else
						letraAntes += 1;
				} else {
					if ((ch != 45) && (ch != 95)) {
						if ((ch < 48) || (ch > 57)) {
							return (false);
						}
					}
				}
			}
		}
	}
	if ((arroba == 1) && (ponto > 0) && (letraAntes > 1) && (letraDepois > 5)) {
		return (true);
	} else {
		return (false);
	}
}

    function isCPF (numcpf)
{
	x = 0;
	soma = 0;
	dig1 = 0;
	dig2 = 0;
	texto = "";
	numcpf1="";
	len = numcpf.length; x = len -1;
	// var numcpf = "12345678909";
	for (var i=0; i <= len - 3; i++) {
		y = numcpf.substring(i,i+1);
		soma = soma + ( y * x);
		x = x - 1;
		texto = texto + y;
	}
	dig1 = 11 - (soma % 11);
	if (dig1 == 10) dig1=0 ;
	if (dig1 == 11) dig1=0 ;
	numcpf1 = numcpf.substring(0,len - 2) + dig1 ;
	x = 11; soma=0;
	for (var i=0; i <= len - 2; i++) {
		soma = soma + (numcpf1.substring(i,i+1) * x);
		x = x - 1;
	}
	dig2= 11 - (soma % 11);
	if (dig2 == 10) dig2=0;
	if (dig2 == 11) dig2=0;
	//alert ("Digito Verificador : " + dig1 + "" + dig2);
	if ((dig1 + "" + dig2) == numcpf.substring(len,len-2)) {
		return true;
	}
	return false;
}
    
    
    function isCNPJ(cnpj)
      {
      var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
      digitos_iguais = 1;
      if (cnpj.length < 14 && cnpj.length < 15)
            return false;
      for (i = 0; i < cnpj.length - 1; i++)
            if (cnpj.charAt(i) != cnpj.charAt(i + 1))
                  {
                  digitos_iguais = 0;
                  break;
                  }
      if (!digitos_iguais)
            {
            tamanho = cnpj.length - 2
            numeros = cnpj.substring(0,tamanho);
            digitos = cnpj.substring(tamanho);
            soma = 0;
            pos = tamanho - 7;
            for (i = tamanho; i >= 1; i--)
                  {
                  soma += numeros.charAt(tamanho - i) * pos--;
                  if (pos < 2)
                        pos = 9;
                  }
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
            if (resultado != digitos.charAt(0))
                  return false;
            tamanho = tamanho + 1;
            numeros = cnpj.substring(0,tamanho);
            soma = 0;
            pos = tamanho - 7;
            for (i = tamanho; i >= 1; i--)
                  {
                  soma += numeros.charAt(tamanho - i) * pos--;
                  if (pos < 2)
                        pos = 9;
                  }
            resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
            if (resultado != digitos.charAt(1))
                  return false;
            return true;
            }
      else
            return false;
      }
      
      
      
      function abrepopup(arq, altura, largura)
      {
           window.open('popup.aspx?arquivo='+arq, 'popup', 'height=' + altura + ',width=' + largura + ',left=200,top=155,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no')
      }
      
        
        function teste()
        {
            if(document.getElementById('caixateste').style.display == 'none')
            {
                document.getElementById('caixateste').style.display = '';
            }
            else
            {
                document.getElementById('caixateste').style.display = 'none';
            }
        }

	function abre_popupBanner(arq,width, heigth,cod){
		configurar="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=" + width + ",height=" + heigth + ",top=35,left=35"
		window.open(arq,"Janela" + cod,configurar)
	}

//=========================================================================
function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}