﻿function $(id){
return document.getElementById(id);
}
function zmien_obrazek(nazwa,obrazek){
$(obrazek).src=nazwa;
}
function przywroc_obrazek(nazwa,obrazek){
$(obrazek).src=nazwa;
}

function PokazSchowajGrupe( id ) {
	var div = document.getElementById( 'grupa' + id);

div.style.display = ( div.style.display == 'none' ? 'block' : 'none' );
};
function error(text) {
	if (errfound) return;{
		window.alert(text);
	}
errfound = true;
}
function validation() {
	errfound = false;
	var errors = "";
	with (document.forms[0]) {
		if (godnosc.value == "")  errors += "Nie wpisałeś imienia i nazwiska. \n";
		if (mail.value == "")	errors += "Nie podałeś E-maila. \n";		
				if (tresc.value == "") errors += "Nie wpisałeś treśći wiadomości.";
		if (errors != "")  error(errors); 
	}
return !errfound;
}

