function show_hide(el) {
	if( el=="box_1" ) {
		window.document.getElementById('box_1').style.display='block';
		window.document.getElementById('box_2').style.display='none';
		window.document.getElementById('box_3').style.display='none';
		window.document.getElementById('blok_1').style.backgroundImage='url(gfx/active.jpg)';
		window.document.getElementById('blok_2').style.backgroundImage='url(gfx/inactive.jpg)';
		window.document.getElementById('blok_3').style.backgroundImage='url(gfx/inactive.jpg)';
	}
	if( el=="box_2" ) {
		window.document.getElementById('box_1').style.display='none';
		window.document.getElementById('box_2').style.display='block';
		window.document.getElementById('box_3').style.display='none';
		window.document.getElementById('blok_1').style.backgroundImage='url(gfx/inactive.jpg)';
		window.document.getElementById('blok_2').style.backgroundImage='url(gfx/active.jpg)';
		window.document.getElementById('blok_3').style.backgroundImage='url(gfx/inactive.jpg)';
	}
	if( el=="box_3" ) {
		window.document.getElementById('box_1').style.display='none';
		window.document.getElementById('box_2').style.display='none';
		window.document.getElementById('box_3').style.display='block';
		window.document.getElementById('blok_1').style.backgroundImage='url(gfx/inactive.jpg)';
		window.document.getElementById('blok_2').style.backgroundImage='url(gfx/inactive.jpg)';
		window.document.getElementById('blok_3').style.backgroundImage='url(gfx/active.jpg)';
		
	}
	
}


function opis(x) {
	if( x>0 ) {
		switch(x) {
			case(1): opisik="nie polecam"; break;
			case(2): opisik="słaby"; break;
			case(3): opisik="dostateczny"; break;
			case(4): opisik="dobry"; break;
			case(5): opisik="bardzo dobry"; break;
			case(6): opisik="doskonały"; break;
		}
		window.document.getElementById('star_opis').innerHTML=opisik;
	}
	else {
		window.document.getElementById('star_opis').innerHTML="";
	}
}

function check_form_dodaj_osrodek() {
	f=window.document.forms['dodaj_osrodek'];
	error=0;
	error_msg="<b>Nie można wysłać wiadomości ponieważ:</b><ul>";
	
	if( !f['nazwa'].value ) {
		error=1;
		error_msg+="<li>nie podano nazwy ośrodka</li>";
	}
	if( !f['tel'].value ) {
		error=1;
		error_msg+="<li>nie podano numeru telefonu ośrodka</li>";
	}	
	if( !f['ulica'].value ) {
		error=1;
		error_msg+="<li>nie podano nazwy ulicy</li>";
	}	
	if( !f['nr_domu'].value ) {
		error=1;
		error_msg+="<li>nie podano numeru lokalu</li>";
	}	
	if( !f['kod'].value ) {
		error=1;
		error_msg+="<li>nie podano kodu pocztowego</li>";
	}	
	if( !f['miasto'].value ) {
		error=1;
		error_msg+="<li>nie podano nazwy miejscowości</li>";
	}	
	if( !f['wojewodztwo'].value ) {
		error=1;
		error_msg+="<li>nie wybrano województwa</li>";
	}	
	
	if( error ) {
		window.document.getElementById('error_box').style.display="block";
		window.document.getElementById('error_box').innerHTML=error_msg;
		window.document.getElementById('error_box').innerHTML+="</ul><input type=\"button\" style=\"border:none; color:#FFFFFF; background-color:#00BBF2;\" value=\"ZAMKNIJ\" onclick=\"window.document.getElementById('error_box').style.display='none';\" />";
	}
	else {
		f.submit();
	}
	
}


function check_form_kontakt() {
	f=window.document.forms['kontakt'];
	error=0;
	error_msg="<b>Nie można wysłać wiadomości ponieważ:</b><ul>";
	
	if( !f['imie'].value ) {
		error=1;
		error_msg+="<li>nie podano imienia i nazwiska</li>";
	}
	if( !f['email'].value ) {
		error=1;
		error_msg+="<li>nie podano zwrotnego adresu e-mail</li>";
	}	
	if( !f['tresc'].value ) {
		error=1;
		error_msg+="<li>nie wprowadzono treści pytania</li>";
	}	
	
	if( error ) {
		window.document.getElementById('error_box').style.display="block";
		window.document.getElementById('error_box').innerHTML=error_msg;
		window.document.getElementById('error_box').innerHTML+="</ul><input type=\"button\" style=\"border:none; color:#FFFFFF; background-color:#00BBF2;\" value=\"ZAMKNIJ\" onclick=\"window.document.getElementById('error_box').style.display='none';\" />";
	}
	else {
		f.submit();
	}
	
}


function check_form_zadaj_pytanie_osk() {
	f=window.document.forms['zadaj_pytanie_osk'];
	error=0;
	error_msg="<b>Nie można wysłać wiadomości ponieważ:</b><ul>";
	
	if( !f['imie'].value ) {
		error=1;
		error_msg+="<li>nie podano imienia i nazwiska</li>";
	}
	if( !f['email'].value ) {
		error=1;
		error_msg+="<li>nie podano zwrotnego adresu e-mail</li>";
	}	
	if( !f['tresc'].value ) {
		error=1;
		error_msg+="<li>nie wprowadzono treści pytania</li>";
	}	
	
	if( error ) {
		window.document.getElementById('error_box').style.display="block";
		window.document.getElementById('error_box').innerHTML=error_msg;
		window.document.getElementById('error_box').innerHTML+="</ul><input type=\"button\" style=\"border:none; color:#FFFFFF; background-color:#00BBF2;\" value=\"ZAMKNIJ\" onclick=\"window.document.getElementById('error_box').style.display='none';\" />";
	}
	else {
		f.submit();
	}
	
}
