<!--

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;
}

if(f.miasto.value.length < 1){
alert("Nie wpisałeś Nazwy Miejscowości!");
f.miasto.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.miasto.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.kod.value.length < 6){
alert("Nie wpisałeś prawidłowo kodu pocztowego!");
f.kod.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.kod.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.adres.value.length < 1){
alert("Nie wpisałeś prawidłowo adresu do korespondencji!");
f.adres.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.adres.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.wojewodztwo.value.length < 1){
alert("Nie wybrałeś Nazwy Województwa!");
f.wojewodztwo.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.wojewodztwo.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}

if(f.telefon.value.length < 1){
alert("Nie wpisałeś numeru swojego telefonu!");
f.telefon.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.telefon.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.akceptacja_regulaminu.checked==false ){
alert("Musisz zaakceptować warunki Regulaminu Olimpiady!");
f.akceptacja_regulaminu.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.akceptacja_regulaminu.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;
}
}

// -->