// JavaScript Document

		var reEmail = /(^(\S+@)([a-zA-Z0-9\-]+\.)+(com|net|edu|mil|gov|org|int|([a-zA-Z]{2}))$)/i
		
		function isEmpty(s) {return ((s == null) || (s.length == 0))}
		function isEmail(s) {return reEmail.test(s);}
		
		function validate() {
			var email = document.form2.email.value;	
				
			var errorStr = ""; 		
			var error = false;
			
			if (isEmpty(email)) {
				errorStr += 'Wypełnij pole formularza: e-mail!';
				errorStr += "\n";
				error = true;			
			}	
			if (!isEmpty(email) && !isEmail(email)) {
				errorStr += 'Niepoprawny adres e-mail!';
				errorStr += "\n";
				error = true;
			}
			
			if (error) {
				alert(errorStr);
			}		
			
			if(!error){
				document.form2.submit()
			}else return !error;
							
		}	
