// JavaScript Document
function valida_contato(){
	form = document.form;
	if (form.nome.value==""||form.assunto.value==""||form.email.value==""||form.mensagem.value==""){
      alert("Os campos nome, assunto, e-mail e mensagem devem estar preenchidos!");
      form.nome.focus();
      return false;
    }
}

function limparFormulario (objeto, msg) {
	if (objeto.value == msg)objeto.value = '';
}

function mostrarTexto (objeto, msg) {
	if (objeto.value == '')objeto.value = msg;
}

function SomenteNumero(e){
   if (window.event) //IE 
   { 
   		tecla = e.keyCode; 
   } 

   else if (e.which) //FF 
   { 
        tecla = e.which; 
   } 
        
   //teclas dos numemros(0 - 9) de 48 a 57
   //techa==8 é para permitir o backspace funcionar para apagar
        
           if ( (tecla >= 48 && tecla <= 57)||tecla == 8||tecla == 127) {
                           return true;
                  }
                  else {
					  		alert ("Utilize apenas valores numéricos");
                           return false;
                  }

}

function SomenteNumeroReal(e){
   if (window.event) //IE 
   { 
   		tecla = e.keyCode; 
   } 

   else if (e.which) //FF 
   { 
        tecla = e.which; 
   } 
        
   //teclas dos numemros(0 - 9) de 48 a 57
   //techa==8 é para permitir o backspace funcionar para apagar
        
           if ( (tecla >= 48 && tecla <= 57)||tecla == 8||tecla == 127||tecla == 46) {
                           return true;
                  }
                  else {
					  	   alert ("Utilize apenas valores numéricos ou ponto");
                           return false;
                  }

}

function Telefone(e,objeto){
   if (window.event) //IE 
   { 
   		tecla = e.keyCode; 
   } 

   else if (e.which) //FF 
   { 
        tecla = e.which; 
   } 
        
   //teclas dos numemros(0 - 9) de 48 a 57
   //techa==8 é para permitir o backspace funcionar para apagar
        
           if ( (tecla >= 48 && tecla <= 57)||tecla == 8||tecla == 127) {
			     if(objeto.value.length == 0)
					 objeto.value = '(' + objeto.value;
				
				 if(objeto.value.length == 3)
					  objeto.value = objeto.value + ')';
				
				 if(objeto.value.length == 8)
					 objeto.value = objeto.value + '-';
                           return true;
                  }
                  else {
					  		alert ("Utilize apenas valores numéricos");
                           return false;
                  }

}


function CEP(e,objeto){
   if (window.event) //IE 
   { 
   		tecla = e.keyCode; 
   } 

   else if (e.which) //FF 
   { 
        tecla = e.which; 
   } 
        
   //teclas dos numemros(0 - 9) de 48 a 57
   //techa==8 é para permitir o backspace funcionar para apagar
        
           if ( (tecla >= 48 && tecla <= 57)||tecla == 8||tecla == 127) {
			     if(objeto.value.length == 5)
					 objeto.value = objeto.value + '-' ;
				     return true;
                  }
                  else {
					  		alert ("Utilize apenas valores numéricos");
                           return false;
                  }

}

