var err;

function checkForm(formno)
{
  err = true;

  if (formno == 1)
  {
    o = document.form1;

    if (o.sender.value=="")
    {
      error('You haven\'t said who to send the card from.');
      o.sender.focus();
    }
    else if (o.s_email.value.indexOf("@")<1)
    {
      error('You haven\'t specified the sender\'s email address.');
      o.s_email.focus();
    }
    else if (o.recipient.value=="")
    {
      error('You haven\'t said who to send the card to.');
      o.recipient.focus();
    }
    else if (o.r_email.value.indexOf("@")<1)
    {
      error('You haven\'t specified the recipient\'s email address.');
      o.r_email.focus();
    }

    err = (err && window.confirm('Are you sure you have entered all details correctly?'));
  }

  return err;
}

function error(txt)
{
  err = false;
  window.alert(txt);
}

