//Função que faz a submissão do primeiro formulário da página
function gosubmit()
{
document.forms[0].submit();
}

//Função que abre a página de cadastro de e-mails na Newsletter
function cadnewsletter(email)
{
url = "newsletter.php?email="+email;
window.open(url, "Newsletter", "width=1,height=1,noresizable,scrollbars=no,status=0");
}

// Você possuiu uma ferramenta para gerenciar todos os seus projetos segundo PMI na WEB?

// Que tal experimentar o NET PROJECT
// Tudo isso e muito mais


// - Clique aqui e conheça mais detalhes

function view(dochtml)
	{
		if (navigator.appName == "Netscape") 
		{
			sec=window.open(dochtml,'_blank','scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=n	o,height=480,width=630'); window.sec.focus(); 
		}
		else 
		{ 	
		window.open(dochtml,'_blank','scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,height=480,width=630'); 
		}
	}
	
    function ValidaForm(){
		LimpaCpf(document.forms[0].cpf);
		var alterar = document.createElement("<input type = 'hidden' name = 'logar' value = 'logar'>");
		document.all.index.appendChild(alterar);
		document.forms[0].submit();
    }

    function LimpaCpf(RCPF){
        CPF = RCPF.value;
        cpf_limpo = "";
        retorno = true;
        for (i=0; i < CPF.length; i ++){
            ch = parseInt(CPF.charAt(i) );
            if (! isNaN(ch))
                cpf_limpo = cpf_limpo + ch;
        }
        CPF = cpf_limpo;

        if(CPF.length == 11){
            NOM = RCPF.name;    
            Formulario = 'document.all(NOM).value=CPF';
            eval(Formulario);
        }
    }

    function checaCPF(RCPF){
        CPF = RCPF.value;
        cpf_limpo = "";
        retorno = true;
        for (i=0; i < CPF.length; i ++){
            ch = parseInt(CPF.charAt(i) );
            if (! isNaN(ch))
                cpf_limpo = cpf_limpo + ch;
        }

	//alert(cpf_limpo);
        CPF =cpf_limpo;

        if (CPF.length != 11 || CPF == "00000000000" || CPF == "11111111111" ||

            CPF == "22222222222" || CPF == "33333333333" || CPF == "44444444444" ||

            CPF == "55555555555" || CPF == "66666666666" || CPF == "77777777777" ||

            CPF == "88888888888" || CPF == "99999999999")

            retorno= false;
        soma = 0;
        for (i=0; i < 9; i ++)
            soma += parseInt(CPF.charAt(i)) * (10 - i);
        resto = 11 - (soma % 11);
        if (resto == 10 || resto == 11)
            resto = 0;
        if (resto != parseInt(CPF.charAt(9)))
            retorno= false;
        soma = 0;
        for (i = 0; i < 10; i ++)
            soma += parseInt(CPF.charAt(i)) * (11 - i);
        resto = 11 - (soma % 11);
        if (resto == 10 || resto == 11)
            resto = 0;
        if (resto != parseInt(CPF.charAt(10)))
            retorno= false;
    
        if (retorno==true)
        {
            NOM = RCPF.name;    
            Valor = CPF.slice(0,3) + "." +CPF.slice(3,6) + "." +CPF.slice(6,9)+ "/" +CPF.slice(9,11);
            Formulario = 'document.all(NOM).value=Valor';
            eval(Formulario);
            retorno= true;
        }
    
        return retorno;
    }