//Validación del formulario de Contacto 
function validar_form_contacto(){
  
  with(document.formContacto) {
          
        if (txt_nombre.value == ''){
              
              alert("Debes introducir tu nombre");
              txt_nombre.focus();
              txt_nombre.style.background="#d5f5fc";
              return false;            
        
        }else{              
            patron_nombre = /[A-Za-z]/;
            if (patron_nombre.test(txt_nombre.value)==false){
                alert("El formato del nombre es incorrecto");
                txt_nombre.focus();
                txt_nombre.style.background="#d5f5fc";
                return false;
            }
        }
        
        if (txt_apellidos.value == ''){
          
              alert("Debes introducir tus apellidos");
              txt_apellidos.focus();
              txt_apellidos.style.background="#d5f5fc";
              return false;            
        
        }else{              
            patron_nombre = /[A-Za-z]/;
            if (patron_nombre.test(txt_apellidos.value)==false){
                alert("El formato de tus apellidos es incorrecto");
                txt_apellidos.focus();
                txt_apellidos.style.background="#d5f5fc";
                return false;
            }
        }
                
        if (txt_tel.value == ''){
          
              alert("Debes introducir un telefono de contacto");
              txt_tel.focus();
              txt_tel.style.background="#d5f5fc";
              return false;            
        
        }else{              
            patron_tel = /[0-9]/;
            if (patron_tel.test(txt_tel.value)==false){
                alert("El formato del telefono es incorrecto");
                txt_tel.focus();
                txt_tel.style.background="#d5f5fc";
                return false;
            }
        }           
        
        if (txt_email.value == ''){
      
          //mensaje de error
          alert("Debes introducir tu e-mail");           
          txt_email.focus();           
          txt_email.style.background="#d5f5fc";
          
          return false;
          
        }else{
            patron = /^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
            if (patron.test(txt_email.value)==false){
                alert("El e-mail introducido no es correcto");
                txt_email.focus();
                txt_email.style.background="#d5f5fc";
                return false;
            }
            
        }
        
        if (tarea_comentarios.value == ''){
                    
            alert("Escriba su pregunta o duda");
            tarea_comentarios.focus();
            tarea_comentarios.style.background="#d5f5fc";
            return false;
            
        } 
        
        if (txt_captcha.value == ''){
                    
            alert("Escriba el codigo de seguridad");
            txt_captcha.focus();
            txt_captcha.style.background="#d5f5fc";
            return false;
            
        }      
        
       //action="index.php"; 
       submit();
  } // fin de with     
    
  
}