function nextField(field, max, next) {
  var tam = field.value.length;
  if (tam == max) {
    document.getElementById(next).focus();
  }
}




/*
function nextField(field, max, next) {
  var tam = $(field).value.length;
  if (tam == max) {
    $(next).focus();
  }
}*/
