function verificar() {
with(document.sugestoes)
{	
if (NOME.value == "")
{
alert("Informe o seu nome!");
NOME.focus();
return false;}
if (Email.value == "")
{
alert("Informe o email!");
Email.focus();
return false;}
if (Residencial.value == "")
{
alert("Informe o número de telefone para contato!");
Residencial.focus();
return false;}
if (OBSERVAÇOES.value == "")
{
alert("Preencha o campo com sua observações ou sugestões!");
OBSERVAÇOES.focus();
return false;}

submit();
}
}	

/* LIMPAR CAMPO SUGESTÕES */

function limpa_COM_sugestoes() {
if (document.sugestoes.Comercial.value == "Comercial") 
{
document.sugestoes.Comercial.value = "";
}
}

function limpa_CEL_sugestoes() {
if (document.sugestoes.Celular.value == "Celular") 
{
document.sugestoes.Celular.value = "";
}
}

function limpa_PRE1_sugestoes() {
if (document.sugestoes.Prefixo.value == "11") 
{
document.sugestoes.Prefixo.value = "";
}
}

function limpa_PRE2_sugestoes() {
if (document.sugestoes.Prefixo2.value == "11") 
{
document.sugestoes.Prefixo2.value = "";
}
}

function limpa_PRE3_sugestoes() {
if (document.sugestoes.Prefixo3.value == "11") 
{
document.sugestoes.Prefixo3.value = "";
}
}

/* MUDANÇA DE CAMPO SUGESTÕES*/

function troca_campo1_sugestoes()
{
if (document.sugestoes.Prefixo.value.length == 2)
{
document.sugestoes.Residencial.focus();
}
}

function troca_campo2_sugestoes()
{
if (document.sugestoes.Residencial.value.length == 9)
{
document.sugestoes.Prefixo2.focus();
}
}

function troca_campo3_sugestoes()
{
if (document.sugestoes.Prefixo2.value.length == 2)
{
document.sugestoes.Comercial.focus();
}
}

function troca_campo4_sugestoes()
{
if (document.sugestoes.Comercial.value.length == 9)
{
document.sugestoes.Prefixo3.focus();
}
}

function troca_campo5_sugestoes()
{
if (document.sugestoes.Prefixo3.value.length == 2)
{
document.sugestoes.Celular.focus();
}
}

/* DIVISOR DE NÚMEROS */

function Formatar(src, mask)
{
 var i = src.value.length;
 var saida = mask.substring(0,1);
 var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
 {
        src.value += texto.substring(0,1);
 }
}

/* CHECAGEM DE EMAIL */

function ValidaEmail()
{
  var obj = eval("document.forms[0].Email");
  var txt = obj.value;
  if ((txt.length != 0) && ((txt.indexOf("@") < 1) || (txt.indexOf('.') < 7)))
  {
    alert('Email incorreto!');
	obj.focus();
  }
}

/* SOMENTE NÚMEROS */
function numeros(x)
{   
if(navigator.appName=='Microsoft Internet Explorer'){
      var y=x.keyCode;
      if(y>=48 && y<=57 || y==8){
         return true;
      } else {
         return false;
      }
   }

   if(navigator.appName=='Netscape'){
      var y=x.which;
      if(y>=48 && y<=57 || y==8){
         return true;
      } else {
         return false;
      }
   }
}
