function markFieldIncorrect(id)
{
  document.getElementById(id).style.backgroundColor = 'red';
  return false;
}

function checkForm()
{
  var is_ok = true;

  if (document.getElementById('email').value == '' && document.getElementById('phone').value == '') 
  { is_ok = markFieldIncorrect('email');
   is_ok = markFieldIncorrect('phone');
   }
      if (document.getElementById('first_name').value == '') is_ok = markFieldIncorrect('first_name');
    
  if (is_ok) {
    document.contact_form.submit();
  } else alert('Не заполнено одно из обязательных полей! \n\r One of mandatory fields is not filled!');
}
