var dig=Math.round(Math.random()*1000);
function Validator(theForm)
{
  if (theForm.user.value == "")
  {
    alert("Поле \"Автор\" пустое!");
    theForm.user.focus();
    return (false);
  }
  if (theForm.subject.value == "")
  {
    alert("Поле \"Тема\" пустое!");
    theForm.subject.focus();
    return (false);
  }
  if (theForm.content.value == "")
  {
    alert("Поле \"Сообщение\" пустое!");
    theForm.content.focus();
    return (false);
  }
  if (theForm.chvalid.value != dig)
  {
    alert("Неверно введено число!");
    theForm.chvalid.focus();
    return (false);
  }
  return (true);
}
