function valorc(orca){
if (orca.nome.value == ""){
alert("O campo \"nome\" não está preenchido.");
orca.nome.focus();
return (false);
}
if (orca.endereco.value == ""){
alert("O Campo \"E-mail\" está Vazio !!!");
orca.endereco.focus();
return (false);
}
if (orca.email.value.indexOf('@', 0) == -1){
alert("O Campo \"E-mail\" é Inválido !!!");
orca.email.focus();
return (false);
}
if (orca.email.value.indexOf('.', 0) == -1){
alert("O Campo \"E-mail\" é Inválido !!!");
orca.email.focus();
return (false);
}
return(true);
}

function valorc(cont){
if (cont.nome.value == ""){
alert("O campo \"Nome	\" não está preenchido.");
cont.nome.focus();
return (false);
}
if (cont.endereco.value == ""){
alert("O Campo \"Endereço\" está Vazio !!!");
cont.endereco.focus();
return (false);
}
if (cont.email.value.indexOf('@', 0) == -1){
alert("O Campo \"E-mail\" é Inválido !!!");
cont.email.focus();
return (false);
}
if (cont.email.value.indexOf('.', 0) == -1){
alert("O Campo \"E-mail\" é Inválido !!!");
cont.email.focus();
return (false);
}
if (cont.cont_contato.value == ""){
alert("Coloque um nome do responsável para contato.");
cont.cont_contato.focus();
return (false);
}
if (cont.endereco_contador.value == ""){
alert("O campo \"endereço\" não está preenchido.");
cont.endereco_contador.focus();
return (false);
}
if (cont.str_fone_contador.value == ""){
alert("O campo \"telefone\" não está preenchido.");
cont.str_fone_contador.focus();
return (false);
}
if (cont.bairro.value == ""){
alert("O campo \"bairro\" não está preenchido.");
cont.bairro.focus();
return (false);
}
if (cont.cidade_contador.value == ""){
alert("O campo \"cidade\" não está preenchido.");
cont.cidade_contador.focus();
return (false);
}
if (cont.str_cep_contador.value == ""){
alert("O campo \"CEP\" não está preenchido.");
cont.str_cep_contador.focus();
return (false);
}
if (cont.str_fax_contador.value == ""){
alert("O campo \"Fax\" não está preenchido.");
cont.str_fax_contador.focus();
return (false);
}
if (cont.str_cnpj.value == ""){
alert("Por favor, digite o CNPJ da empresa ao qual faz consultoria.");
cont.str_cnpj.focus();
return (false);
}

return(true);
}

function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {
     var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;

     if(document.all) { // Internet Explorer
       nTecla = evtKeyPress.keyCode; }
     else if(document.layers) { // Nestcape
       nTecla = evtKeyPress.which;
     }

     sValue = objForm[strField].value;

     // Limpa todos os caracteres de formatação que
     // já estiverem no campo.
     sValue = sValue.toString().replace( "-", "" );
     sValue = sValue.toString().replace( "-", "" );
     sValue = sValue.toString().replace( ".", "" );
     sValue = sValue.toString().replace( ".", "" );
     sValue = sValue.toString().replace( "/", "" );
     sValue = sValue.toString().replace( "/", "" );
     sValue = sValue.toString().replace( "(", "" );
     sValue = sValue.toString().replace( "(", "" );
     sValue = sValue.toString().replace( ")", "" );
     sValue = sValue.toString().replace( ")", "" );
     sValue = sValue.toString().replace( " ", "" );
     sValue = sValue.toString().replace( " ", "" );
     fldLen = sValue.length;
     mskLen = sMask.length;

     i = 0;
     nCount = 0;
     sCod = "";
     mskLen = fldLen;

     while (i <= mskLen) {
       bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/"))
       bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

       if (bolMask) {
         sCod += sMask.charAt(i);
         mskLen++; }
       else {
         sCod += sValue.charAt(nCount);
         nCount++;
       }

       i++;
     }

     objForm[strField].value = sCod;

     if (nTecla != 8) { // backspace
       if (sMask.charAt(i-1) == "9") { // apenas números...
         return ((nTecla > 47) && (nTecla < 58)); } // números de 0 a 9
       else { // qualquer caracter...
         return true;
       } }
     else {
       return true;
     }
   }
//Fim da Função Máscaras Gerais
