function okno(theURL,winName,features){window.open(theURL,winName,features);}
function Trim(tekst)
{var p=0;while((p<tekst.length)&&(tekst.charAt(p)==' '))
{p++;}
if(p==tekst.length)
return "";
var k=tekst.length-1;while((k>=0)&&(tekst.charAt(k)==' '))
{k--;}
return tekst.substring(p,k+1);}
function test_email2(pole)
{pole.value=Trim(pole.value);if((pole.value.indexOf('@',0)==-1)||(pole.value.indexOf('.',0)==-1))
{alert("Podaj poprawny adres e-mail!");
pole.select();pole.focus();return true;}
else
return false;}
function test_text(pole,text){pole.value=Trim(pole.value);if(pole.value=="") {
alert(text);pole.select();pole.focus();return true;}
else
return false;}
function test_select(pole,text)
{pole.options[pole.selectedIndex].value=Trim(pole.options[pole.selectedIndex].value);if(pole.options[pole.selectedIndex].value=="0")
{alert(text);return true;}
else
return false;}
function test_all(form)
{if(test_text(form.imie,"Podaj imię!") || test_text(form.nazwisko,"Podaj nazwisko!") || test_text(form.ulica,"Wpisz ul., nr budynku i mieszkania!") || test_text(form.kod,"Podaj kod!") || test_text(form.miasto,"Podaj miejscowość!") || test_email2(form.email_potw) || test_text(form.telefon_potw,"Podaj telefon!"))
return;else
form.submit();}