$(function() {
  $('#telefone').mask('(99) 9999-9999'); //telefone
// validate contact form on keyup and submit
  $("#frmPress").validate({
    //set the rules for the field names
    rules: {
      nome: {
      required: true,
      minlength: 2
      },
      email: {
      required: true,
      email: true
      },
      telefone: {
      required: true
      },
      informacao: {
      required: true
      } 
    },
    //set messages to appear inline
    messages: {
      nome: " Preencha o campo Nome.",
      email: " Favor cadastrar um email v&aacute;lido.",
      telefone: " Preencha o campo Telefone.",
      informacao: " Preencha o campo informa&ccedil;&atilde;o."
    }
  });
  textCounter(document.getElementById("informacao"),document.getElementById("remLen3"),4000); 
});
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}