function sprawdz (coSprawdzic) {
	var element=document.getElementById("formularz");
	
	/* Formularz komentarzy */
	if (coSprawdzic=="commentar") {
		if (element.content.value == "") { alert("Podaj treść komentarza."); element.content.focus(); return false;	}
		if (element.user_id.value == "") { alert("Podaj autora komentarza."); element.user_id.focus(); return false;}
	}
	/* Formularz logowanie */
	if (coSprawdzic=="loginForm") {
		if (element.login.value == "login" || element.login.value == "") { alert("Podaj login."); element.login.focus(); return false; }
		if (element.haslo.value == "haslo" || element.haslo.value == "") { alert("Podaj haslo."); element.haslo.focus(); return false; }
	}
	/* Formularz rejestracyjny */
	if (coSprawdzic=="registerForm") {
		if (element.login.value == "") { alert("Podaj login."); element.login.focus(); return false;	}
		if (element.password.value == "") { alert("Podaj hasło."); element.password.focus(); return false;	}
		if (element.password_omt.value == "") { alert("Powtórz hasło."); element.password_omt.focus(); return false;	}
		if (element.email.value == "") { alert("Podaj swój adres e-mail."); element.email.focus(); return false;	}
		if (element.signature.value == "") { alert("Podaj swój podpis."); element.signature.focus(); return false;}
		if (element.password.value != "" && element.password_omt.value == "" ) { alert("Powtórz hasło."); element.password_omt.focus(); return false;	}
		if (element.password.value != "" && element.password_omt.value != "" )
		{
			if (element.password.value != element.password_omt.value){alert("Podane przez Ciebie hasła nie są identyczne."); return false}
			else if ( element.login.value.toLowerCase() == "login" ) { alert("Twój login nie może się nazywać login."); element.login.focus(); return false; }
			else if ( element.password.value.toLowerCase() == "haslo" ) { alert("Twoje hasło nie może się nazywać haslo."); element.password.focus(); return false; }
			else if ( element.login.value == element.password.value ) { alert("Twoje hasło musi się różnić od loginu."); return false; }
			else { element.submit(); }
		}
	return false;
	}
	
	/* Formularz edycji profilu */
	if (coSprawdzic=="editProfile") {
		if (element.login.value == "") { alert("Podaj login."); element.login.focus(); return false;}
		if (element.email.value == "") { alert("Podaj swój adres e-mail."); element.email.focus(); return false;}
		if (element.signature.value == "") { alert("Podaj swój podpis."); element.signature.focus(); return false;}
		if (element.password.value != "" && element.password_omt.value == "" ) { alert("Powtórz hasło."); element.password_omt.focus(); return false;	}
		if (element.password.value != "" && element.password_omt.value != "" )
		{
			if (element.password.value != element.password_omt.value){alert("Podane przez Ciebie hasła nie są identyczne."); return false;}
			else if ( element.password.value.toLowerCase() == "haslo" ) { alert("Twoje hasło nie może się nazywać haslo."); element.password.focus(); return false; }
			else if ( element.login.value == element.password.value ) { alert("Twoje hasło musi się różnić od loginu."); return false; }
			else { element.submit(); }
		}
	}
	
	/* Formularz szukania */
	if (coSprawdzic=="search") {
		if (element.content.value == "") { alert("Wpisz frazę do wyszukiwania."); element.content.focus(); return false;	}
	}
	
	
}
