<!--

function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}	
} 

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);		
} 

}

}

function check_form(f) { // f is the form (passed using the this keyword)
if(f.nazwisko.value.length < 1){
alert("Nie wpisałeś swojego Imienia i Nazwiska!");
f.nazwisko.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.nazwisko.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

// check email address ( the exclamation means "not" )
if(!check_email(f.email.value)){
alert("Wpisz poprawny adres e-mail!");
f.email.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.miejscowosc.value.length < 1){
alert("Nie wpisałeś Nazwy Miejscowości!");
f.miejscowosc.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.miejscowosc.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.adresat.value.length < 1){
alert("Nie wybrałeś adresata!");
f.adresat.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.adresat.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.temat.value.length < 1){
alert("Nie wpisałeś tematu wiadomości!");
f.temat.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.temat.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.text_listu.value.length < 1){
alert("Nic nie wpisałeś w pole treści listu!");
f.text_listu.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.text_listu.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.polityka_prywatnosci.checked==false ){
alert("Musisz zgodzić się z Polityką Prywatności!");
f.polityka_prywatnosci.focus(); // put the prompt in the name field 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.polityka_prywatnosci.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}
}

// -->
