function check_match(event, match)
{
  var code = event.which || event.keyCode;

  if (
    code == Event.KEY_BACKSPACE ||
    code == Event.KEY_LEFT ||
    code == Event.KEY_RIGHT ||
    code == Event.KEY_DELETE ||
    code == Event.KEY_HOME ||
    code == Event.KEY_END ||
    code == Event.KEY_TAB ||
    code == Event.KEY_INSERT
  )
  return true;

  var value = String.fromCharCode(code);
  var valid = match.test(value);
  if (!valid) Event.stop(event);

  return valid;
}
