
// funkcja sprawdza wartosci w wymaganych polach formularza dodawania wspomnien

function checkMemoAddForm(whatButton){
blad=0;
if (document.getElementById('title').value==""){
//	alert ("Musisz dodac tytuł wspomnienia.");
	blad=1;
}
if (document.getElementById('destination').value=="0"){
//	alert ("Musisz wybrać kierunek podróży.");
	blad=1;
}
if(document.getElementById('travelPath')){
	if (document.getElementById('travelPath').value==""){
	//	alert ("Musisz podać trasę podróży.");
		blad=1;
	}
}
if (document.getElementById('termFrom').value==""){
//	alert ("Musisz podać termin wyjazdu.");
	blad=1;
}
if (document.getElementById('termTo').value==""){
//	alert ("Musisz podać termin powrotu.");
	blad=1;
}
//if (document.getElementById('zdjecie').value==""){
//	alert ("Musisz dodać przynajmniej jedno zdjęcie.");
//	blad=1;
//}
if (document.getElementById('podpis').value==""){
//	alert ("Musisz podać podpis.");
	blad=1;
}
if (document.getElementById('imie_nazwisko').value==""){
//	alert ("Musisz podać imię i nazwisko.");
	blad=1;
}
if (!document.getElementById('oswiadczenie').checked){
//	alert ("Musisz zgodzić się z oświadczeniem.");
	blad=1;
}
if (blad==0){
	if (whatButton=="podglad"){
		document.getElementById('formWspomnienie').submit();
	}else{
		document.getElementById('formWspomnienie').action='/?page=wspomnieniaZapisz';
		document.getElementById('formWspomnienie').submit();
	}
}else{
	alert("Musisz wypełnić wszystkie wymagane pola.");
}
return false;
}


