function validate(formularz){
        KODre = /^\d\d-\d\d\d$/;
        NIPre = /^\d\d\d-\d\d-\d\d-\d\d\d$/;
        TELEFONre = /^\+\d+\.\d+$/;
        
	if (window.document.getElementById('login').value.length < 2){
		alert ('Musisz wypełnić pole: "login"');
		window.document.formularz.login.focus();
		return false;
	}
	if (window.document.getElementById('haslo').value.length < 6){
		alert ('Pole "haslo" winno mieć co najmniej 6 znaków');
		window.document.formularz.haslo.focus();
		return false;
	}
	if (window.document.getElementById('haslo').value != window.document.getElementById('haslo2').value)
	{
	alert('Podane hasła różnią się od siebie!');
	window.document.formularz.haslo2.select();
	window.document.formularz.haslo2.focus(); 
	return false;}
	
	if (window.document.getElementById('imie').value.length < 2){
		alert ('Musisz podać Imię i Nazwisko');
		window.document.formularz.imie.focus();
		return false;
	}
	if (window.document.getElementById('firma').value.length < 2){
		alert ('Musisz wypełnić pole: "Nazwa firmy"');
		window.document.formularz.firma.focus();
		return false;
	}
	if (window.document.getElementById('ulica').value.length < 2){
		alert ('Musisz wypełnić pole: "adres"');
                window.document.formularz.ulica.focus();
		return false;
	}
	if (window.document.getElementById('kod').value.length <6 ){
		alert ('Musisz wypełnić pole: "Kod pocztowy" w formacie xx-xxx');
                window.document.formularz.kod.select();
                window.document.formularz.kod.focus();
		return false;
	}
	if (window.document.getElementById('kod').value == 'xx-xxx') {
	alert ('Musisz wpisać poprawny kod pocztowy');
                window.document.formularz.kod.select();
                window.document.formularz.kod.focus();
		return false;
	}
	if (!KODre.test(window.document.getElementById('kod').value)) {
	alert ('Musisz wpisać poprawny kod pocztowy w formacie xx-xxx');
                window.document.formularz.kod.select();
                window.document.formularz.kod.focus();
		return false;
	}
	if (window.document.getElementById('telefon').value.length <13)
		{
		alert ('Musisz wypełnić pole: "Telefon" w formacie "+48.xxxxxxxxx');
		window.document.formularz.telefon.select();
		window.document.formularz.telefon.focus();
		return false;
	}
	if (window.document.getElementById('telefon').value == '+48.xxxxxxxxx') {
	alert ('Musisz wpisać poprawny telefon');
                window.document.formularz.telefon.select();
                window.document.formularz.telefon.focus();
		return false;
	}	
	if (!TELEFONre.test(window.document.getElementById('telefon').value)) {
	alert ('Pole "telefon" może zawierać tylko "+" "." oraz cyfry');
                window.document.formularz.telefon.select();
                window.document.formularz.telefon.focus();
		return false;
	}
	if (window.document.getElementById('email').value.length < 2){
		alert ('Musisz wypełnić pole: "email"');
		window.document.formularz.email.focus();
		return false;
	}
	if (window.document.getElementById('kontakt').value.length < 2){
		alert ('Musisz wypełnić pole: "Osoba kontaktowa"');
		window.document.formularz.kontakt.focus();
		return false;
	}
	if (window.document.getElementById('chbox').checked == true 
		&& !NIPre.test(window.document.getElementById('nip').value))
		{
		alert ('Musisz wypełnić pole: "NIP" w formacie "xxx-xx-xx-xxx');
		window.document.formularz.nip.select();
		window.document.formularz.nip.focus();
		return false;
	}
	if (window.document.getElementById('regulamin').checked == false){
		alert ('Musisz zaakceptować regulamin');
		window.document.formularz.regulamin.focus();
		return false;
	}
	if (window.document.getElementById('umowa').checked == false){
		alert ('Musisz zaakceptować umowę - wydrukuj ją wypełnij i prześlij do nas');
		window.document.formularz.umowa.focus();
		return false;
	}
	
return true;
}

