function Focus(control) {

  control.focus();

  control.select();

}



function IsEmailCorrect(email) {

  return email.match(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/)!=null;

}



function IsEmpty(pole) {

  if (pole=='') 

  	return true

	else

	return false

}







function sprawdz()

{

if (IsEmpty(document.getElementById('input_1').value)) {
    alert('Proszę podać imię.');
    Focus(document.getElementById('input_1'));
    return false;
  }

if (!IsEmailCorrect(document.getElementById('input_2').value)) {
	alert('Proszę podać poprawny adres e-mail.');
	Focus(document.getElementById('input_2'));
	return false;
}


if (IsEmpty(document.getElementById('input_3').value)) {
    alert('Proszę podać Treść.');
    Focus(document.getElementById('input_3'));
    return false;
  }


return true;

}
