  function isValidEmail(strEmail)
  {
       validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

    if (strEmail.search(validRegExp) == -1) {
      return false;
    } 
    return true; 
  }

  function onSendForm()
  {
       var alertText;
       with(document.getElementById('kontakt'))
       {
              alertText="Nie uzupełniono następujących pól:\n";
              error=0;

              if(email.value=="")
              {
                     error=1;
                     alertText=alertText + "- brak adresu e-mail\n";
              }
              else if(!isValidEmail(email.value))
              {
                     error=1;
                     alertText=alertText + "- niepoprawny adres e-mail\n";
              }
              
              if(name.value=="")
              {
                     error=1;
                     alertText=alertText + "- nie podano imienia i nazwiska\n";
              }
              
              if(phone.value=="")
              {
                     error=1;
                     alertText=alertText + "- nie podano numeru telefonu\n";
              }
              
              if(error==0)
              {
                     submit();
                     
              }
              else
              {
                     alert(alertText);
              }
       }
  }

