/* Created by webszok.net */

function checkForm(form) {
if (form.dane.value == '') { alert('Nie wypelniono pola Firma/Nazwisko!'); form.dane.focus(); return false; }
if (form.dane.value.length < 3) { alert('Pole Firma/Nazwisko! powinno mieć przynajmniej 3 znaki!'); form.dane.focus(); form.dane.select(); return false; }				
// if (form.adres.value == '') { alert('Nie podano adresu!'); form.adres.focus(); return false; }
if (form.telefon.value == '') { alert('Nie podano numeru telefonu!'); form.telefon.focus(); return false; }
if (form.telefon.value.length < 9) { alert('Twoj numer telefonu wydaje sie nie być poprawnie wpisany! Wpisz pelny numer.'); form.telefon.focus(); form.telefon.select(); return false; }	
if (form.klientemail.value != '') {
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if  (!filter.test(form.klientemail.value)) { alert('Proszę podać poprawny adres email'); form.klientemail.focus(); return false; }
}
if (form.tresc.value == '') { alert('Nie wpisano treści zapytania!'); form.tresc.focus(); return false; }
if (form.tresc.value == 'Wpisz treść...') { alert('Nie wpisano treści zapytania!'); form.tresc.focus(); return false; }
if (form.tresc.value.length > 2000) { alert('Tekst treści zapytania jest zbyt dlugi! Max 2000 znaków.'); form.tresc.focus(); form.tresc.select(); return false; }
return true; 
}