function trim(str)
 {
  while (str.substring(0,1) == ' ')
   {
    str = str.substring(1,str.length);
   }
  while (str.substring(str.length-1,str.length) == ' ')
   {
    str = str.substring(0,str.length-1);
   }
  return str;
 }

function checkForm(form)
 {
  EMAILre = /^[a-zA-Z0-9\.\-\_]+@[a-zA-Z0-9][a-zA-Z0-9-\.]*\.[a-zA-Z0-9]+$/;
  SPACJAre = /^\s*$/;
  CYFRYre = /^\d*$/;
  TELEFONre = /^\+\d+\.\d+$/;

  if (form.email.value == '')
   {
	  alert('Proszę uzupełnić pole "E-mail"');
	  form.email.focus();
	
	return false;
   }
  if (form.pytanie.value == '')
   {
    alert('Proszę uzupełnić pole "Treść pytania"');
    

	form.pytanie.focus();
	return false;
   }
  if (!EMAILre.test(form.email.value))
  {
   alert('Proszę wprowadzić prawidłowy adres e-mail!');
	form.email.select();
	form.email.focus();
	return false;
  }
 }
